I am making a command line game engine in python. However, when I attempt to print a command, it newlines and creates a jittery frame.  Adding the end attribute bogs down my computer and nearly crashes the shell. The dupe uses sys.stdout.write('') newline sys.stdout.flush or print'', or print('',end=''). all bog down shell and crash it. print('') doesn't bog down though which is weird.  #this is enough code to demonstrate the problem while true:     print('                                                                                =                                                                              ===                                                                            =====                                                                          =======                                                                        =========                                                                      ===========                                                                    =============    YYYYYYYYYYY                                                 ================================================================================') #crash issue import sys while True:     sys.stdout.write('mooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo')     sys.stdout.flush()    I expect the screen to fill, instead it wobbles up and down.

I'd like to do it in Python. What I'd like to do in this example in C: #include <stdio.h>  int main() {     int i;     for (i=0; i<10; i++) printf(".");     return 0; }  Output: ..........  In Python: >>> for i in range(10): print('.') . . . . . . . . . . >>> print('.', '.', '.', '.', '.', '.', '.', '.', '.', '.') . . . . . . . . . .  In Python print will add a \n or space, how can I avoid that? Now, it's just an example, don't tell me I can first build a string then print it. I'd like to know how to "append" strings to stdout.


I have a problem with GitHub Pages, whereby a very simple site (in ) gives a 404 Not Found error. I have tried all eighteen (!) solutions suggested in the different answers to .   Starting a bounty on a question with 18 existing answers (many of which solved the problem for others experiencing the same issue) seems odd, but re-asking the same question also seems wrong. What is the correct thing to do?

Suppose you had a question, and you really want a good answer that would solve your problem, but noticed it was already asked by someone else. Now, a lot of answers had been posted and upvoted, and maybe one was accepted. However, none of the answers solved your problem. The system does not promote the question very much because it is not considered "unanswered", and a lot of users who would otherwise bother to give a correct answer will probably skip the question completely as there are already many highly-voted answers.  Now, what should you do in this case?  One idea is to ask a new, completely identical question, but now you're in control to decide when it is answered. But would that go against SE policy?


I know that technically it's possible to do so using only a birth certificate and US drivers license. However there is a difference between what is technically possible and what happens in practice, so my question is has anyone done this recently? I only ask because my passport won't be here for a few weeks and was hoping to enter Canada and just have a family member FedEx it to my friend's house there. So has anyone tried it recently or know anyone who has?

I'm getting ready to renew my US passport for the first time.  Since I got this passport the ID requirements at the US-Canada border have gotten stricter, so I've been using my passport when driving across that border.  I have no current international travel plans within the renewal window, but I have relatives in Canada and one never knows when a family emergency might occur, especially with older relatives.  Renewing the passport requires temporarily surrendering the current (still-valid) one.  A little Googling tells me that I wouldn't be able to cross this border (in both directions) with an expired passport at all, so waiting doesn't help.  How do I retain my ability to drive to Canada and back home while my passport renewal is being processed?  I don't have an "enhanced" driver's license (whatever that is).  I do have a copy of my birth certificate.  My only citizenship is US.


In this question, I assumed the two side strings will also move with velocity $u$ and broke the vectors along the direction of motion of M and I got the velocity of the mass as $u\cos\theta +u\cos\theta = 2u\cos\theta$. (Both velocities of the two strings vector resolved and added) But the answer was wrong, as they broke the velocity of the mass, say $v$, into $v\cos\theta$ along the direction of the string and equated $$v\cos\theta = u$$ $$v=u\sec\theta$$ However, I do not find why my method of approach is wrong and why theirs should be correct. Please explain. Thank You!

In the arrangement shown in the figure, the ends P and Q of an inextensible string move downwards with uniform speed $u$, pulleys A and B are fixed. With what speed does the mass M move upwards?    My attempt: I resolved the component of $u$ along the $y-$axis. That is $u\cos\theta+u\cos\theta=2u\cos\theta$. But the answer is $\frac{u}{\cos\theta}$.  My questions  why can’t I simply resolve vector into components and solve ? I’m unable to determine my mistake. What am I missing here?


Python’s for statement iterates over the items of any sequence (a list or a string).  But where does the sequence come from in below code?  file=open('filename.txt','r') for line in file:     print line   Is this related to the __iter__() method?  Just some quote:       An object capable of returning its members one at a time. Examples of iterables include all sequence types (such as list, str, and tuple) and some non-sequence types like dict, file objects, and objects of any classes you define with an __iter__() or __getitem__() method. Iterables can be used in a for loop and in many other places where a sequence is needed (zip(), map(), ...). When an iterable object is passed as an argument to the built-in function iter(), it returns an iterator for the object. This iterator is good for one pass over the set of values. When using iterables, it is usually not necessary to call iter() or deal with iterator objects yourself. The for statement does that automatically for you, creating a temporary unnamed variable to hold the iterator for the duration of the loop. See also iterator, sequence, and generator.

How would one create an iterative function (or iterator object) in python?


I wanted to design a simple website but I've been struggling to change font. I looked many tutorial and read documentation but I don't understand what I'm doing wrong!  this is my html:        <title>My website</title>     <link rel='stylesheet' href="style.css">
Perchè non si riesce a cambiare font??
      and this is the style.css   @font-face {   font-family: 'Inter';   font-style:  normal;   font-weight: 400;   src: url("fonts/Inter-Regular.woff2") format("woff2"),        url("fonts/Inter-Regular.woff") format("woff"); }  .par {     font-size: 100px;     font-family: Inter; }   I can't really figure out how to make it work.  I'm currently testing it on windows 10 on Firefox and Chrome browsers (both updated)  Do you guys know what I'm doing wrong?  thanks!

Is there a way to add some custom font on a website without using images,  or some other graphics?  For example, I was working on a wedding website, and I found a lot of nice fonts for that subject. But I can't find the right way to add that font on the server. And how do I include that font with CSS into the HTML? Is this possible to do without graphics?


I have a full physical backup and binlogs available for my MySQL instance. Is there a way to perform a partial point in time recovery (meaning restoring in time a subpart of the whole database, i.e. some specific tables) without mean of a staging database, by simply selecting the desired binlogs?

I am getting the "wrong input table name" when use TRUNCATE as following:  TRUNCATE `stats`   The table should bans.  How to recover stats table?  I am using CentOS 6, and MySQL-Server.


Every time I am starting to work in a new programming field, I have a lot of questions, obviously. I am usually able to find answers on various forums or to figure them by my own.  Once in a while there is a question that I would definitely prefer to ask here, in SE, to know and learn from all this vast accumulated experience.  However each time when I am trying to ask a question like "what are the possible tools/ libraries/ frameworks / ways to do so and so", I am downvoted very quickly and the question is closed.  I think the whole purpose of SE is to share not our knowledge but first and foremost our experiences. Knowledge I can find anywhere: in books, in tutorials, in manuals. But to hear from somebody who already have tried, had got his hands "dirty" and can save others a lot of time by sharing it - why not?  EDIT: I know the rules, and I try not to ask such questions here, but I just don't understand why.   If somebody can tell others "I worked with this tool, it's good for so and so", or "this tool is very unstable and lack such and such options" - why not??  Really, folks, look on the most upvoted questions: for example,   So if I am lazy (as obviously most of us are) and instead of reading the book, I am going to SO to ask, it's OK.  However if I want to ask something much less trivial, though still of public interest like who  have the experience  with these or other tools and what his/her experience was, it is not OK?  Pity that 's SE attitude. There is a huge difference between opinion and experience

I've written a few questions on Stack Overflow before that have been closed due to being "not constructive" or "not a real question".  Now, after scanning the FAQ for the site a few times, I understand that my questions were indeed closed for good reason.  However, even after reading the FAQ, I still don't understand why a question of "what's the best practice here?" is a bad thing.  I feel as though if you properly explain your situation as thoroughly as possible, then it shouldn't be a bad question at all.  Questions like "what's the best language?" or "which framework should I use?" are indeed bad questions initially, but I feel if you specify in the post (or preferably in the title itself) what the context is, shouldn't that be deserving of some kind of an answer?  In  I asked what would be "best practice", and naturally my question was closed.  So I read the FAQ and learned how to make a more constructive question, of which I've now re-edited in an attempt to be less vague.  I understand the desire to avoid debate and lengthy discussion over a question, but I also feel as though sometimes there are certain questions which should be asked if proper context is given.  Why is a question over "best practice" always a bad question to ask?


Gauss's Law for magnetism is $$ \nabla \cdot B = 0 $$ This allows us to write the magentic field $B$ as the curl of another field the $\textbf{magnetic vector potential, } A$. $$ B=\nabla \times A $$ This adhers to $ \nabla \cdot (\nabla \times A)=0$ However, if a monopole does exist then we have $$ \nabla \cdot B= \rho_{m} $$ Where $\rho_{m}$ is some magnetic charge density however with a magentic vector potential this violates the equation, $ \nabla \cdot (\nabla \times A) \neq 0$. Does that mean if magnetic monopoles does exist, that the magnetic field can no longer be defined by a magnetic vector potential? In which case how was dirac able to still  define the magnetic field by a magnetic vector potentials?

Absence of magnetic charges is reflected in one of Maxwell's fundamental equations: $$\operatorname{div} \vec B = 0. \tag1$$ This equation allows us to introducte concept of vector potential: $$\vec B = \operatorname{rot} \vec A.$$ Using this concept, it is possible to express Maxwell's equations in a graceful symmetric form: $$\nabla^2 \vec A - \frac{1}{c^2}\frac{\partial^2 \vec A}{\partial t^2} = - \frac{\vec j}{\epsilon_0 c^2}, \tag2$$ $$ \nabla^2 \phi -\frac{1}{c^2}\frac{\partial^2 \phi}{\partial t^2} = - \frac{\rho}{\epsilon_0}. \tag3 $$  Noticing, that vector $\vec A$ and scalar $\phi$ potentials, as well as electric current density $\vec j$ and charge density $\rho$, form a 4-vector in Minkovsky space-time. Therefore, Maxwell's equations can be expressed in a covariant form, using d'Alembertian: $$\nabla_{\mu}\nabla^{\mu} A_{\nu} = \frac{j_{\nu}}{\epsilon_0}. \tag4$$  If magnetic monopols exist, Maxwell's equation $(1)$ will look as: $$\operatorname{div} \vec B = \mu_0 c \rho_{\mathrm{magnet}}.$$  As the divergence of $\vec{B}$ isn't equal to zero, it impossible to introduce concept of vector potential. Thus, the equation in the form of $(4)$ will not be possible to express.


Any tips or solutions for this one?  By using a diagonal argument, show that the powerset $P(N) = (S|S ⊆ N)$ is uncountable.

I'm having trouble understanding Cantor's diagonal argument.  Specifically, I do not understand how it proves that something is "uncountable".  My understanding of the argument is that it takes the following form (modified slightly from the  article, assuming base 2, where the numbers must be from the set $ \lbrace 0,1 \rbrace $):  \begin{align} s_1 &= (\mathbf{0},1,0,\dots)\\ s_2 &= (1,\mathbf{1},0,\dots)\\ s_3 &= (0,0,\mathbf{1},\dots)\\ \vdots &= (s_n \text{ continues}) \end{align}  In this case, the diagonal number is the bold diagonal numbers $(0, 1, 1)$, which when "flipped" is $(1,0,0)$, neither of which is $s_1$, $s_2$, or $s_3$.  My question, or misunderstanding, is: When there exists the possibility that more $s_n$ exist, as is the case in the example above, how does this "prove" anything?  For example:  \begin{align} s_0 &= (1,0,0,\mathbf{0},\dots)\ \ \textrm{ (...the wikipedia flipped diagonal)}\\ s_1 &= (\mathbf{0},1,0,\dots)\\ s_2 &= (1,\mathbf{1},0,\dots)\\ s_3 &= (0,0,\mathbf{1},\dots)\\ s_4 &= (0,1,1,\mathbf{1},\dots)\\ s_4 &= (1,0,0,\mathbf{1},\dots)\ \ \textrm{ (...alternate, flipped } s_4\textrm{)}\\ s_5 &= (1,0,0,0,\dots)\\ s_6 &= (1,0,0,1,\dots)\\ \vdots &= (s_n \text{ continues}) \end{align}  In other words, as long as there is a $\dots \text{ continues}$ at the end, the very next number could be the "impossible diagonal number", with the caveat that it's not strictly identical to the "impossible diagonal number" as the wikipedia article defines it:     For each $m$ and $n$ let $s_{n,m}$ be the $m^{th}$ element of the $n^{th}$ sequence on the list; so for each $n$,      $$s_n = (s_{n,1}, s_{n,2}, s_{n,3}, s_{n,4}, \dots).$$      ...snip...      Otherwise, it would be possible by the above process to construct a sequence $s_0$ which would both be in $T$ (because it is a sequence of 0s and 1s which is by the definition of $T$ in $T$) and at the same time not in $T$ (because we can deliberately construct it not to be in the list). $T$, containing all such sequences, must contain $s_0$, which is just such a sequence. But since $s_0$ does not appear anywhere on the list, $T$ cannot contain $s_0$.      Therefore $T$ cannot be placed in one-to-one correspondence with the natural numbers. In other words, it is uncountable.   I'm not sure this definition is correct, because if we assume that $m = (1, \dots)$, then this definition says that "$s_n$ is equal to itself"&mdadsh;there is no "diagonalization" in this particular description of the argument, nor does it incorporate the "flipping" part of the argument, never mind the fact that we have very clearly constructed just such an impossible $T$ list above.  An attempt to correct the "diagonalization" and "flipping" problem:  $$s_n = (\lnot s_{m,m}, \lnot s_{m,m}, \dots) \quad \text{where $m$ is the element index and} \quad\begin{equation}\lnot s_{m,m} = \begin{cases}0 & \mathrm{if\ } s_{m,m} = 1\\1 & \mathrm{if\ } s_{m,m} = 0\end{cases}\end{equation}$$  This definition doesn't quite work either, as we immediately run in to problems with just $s_1 = (0),$ which is impossible because by definition $s_1$ must be $ = (1)$ if $s_1 = (0)$, which would also be impossible because...   Or more generally, with the revised definition there is a contradiction whenever $n = m$, which would seem to invalidate the revised formulation of the argument / proof.  Nothing about this argument / proof makes any sense to me, nor why it only applies to real numbers and makes them "uncountable". As near as I can tell it would seem to apply equal well to natural numbers, which are "countable".  What am I missing?


I'm thinking about buying a Chromebook and heard that it works good with Ubuntu. My question is, what does ubuntu offer me while using a Chromebook? Does it support Arabic language?

I have installed Ubuntu 13.04 on my desktop (runs like a charm). Then I used Crouton to install Ubuntu 12. 04 on my chromebook samsung (ARM). It also works quite well.  Here comes my question. Can we have a true Ubuntu (preferably 13.04) on my ARM chromebook?  It seems that the Crouton/Ubuntu is not 100% the real thing.  The best option would be to have the full Ubuntu 13.04 and remove the Chrome OS.


My Pokemon go logged me out and I tried using the same email I used to login when I first started, but it did not work? How do I get my account back?

So I had 20+ Pokemon on my account and today when I tapped on the app, it brought me back to the original screen when you first start playing. My friend who signed up tested using my username when she first started and my username was unavailable, meaning the account still exists. I don't have the password for the account, but I do have the email. So I wanted to know if it was possible to log back into an account?


I have created a cube in Visual Studio using C++ and I am trying to give it a random direction to move along. From what I have seen online, the equations I'm using for random numbers should be generating a random number between -1 and 1 or more formally (-1, 1). But for some reason, the random numbers being generated are the exact same.   I feel like there is something wrong with the division but I just cannot figure it out. Any help would be appreciated!  // Give the cube a random direction float x = 2*((float)rand()/(float)(RAND_MAX + 1.0)) - 1;  float y = 2*((float)rand()/(float)(RAND_MAX + 1.0)) - 1; float z = 2*((float)rand()/(float)(RAND_MAX + 1.0)) - 1;  m_directionVector = XMFLOAT3(x, y, z);

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?


$ sudo apt-get update Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease                    Get:3 http://security.ubuntu.com/ubuntu eoan-security InRelease [97.5 kB]       Hit:4 http://archive.ubuntu.com/ubuntu eoan InRelease                           Get:5 http://archive.ubuntu.com/ubuntu eoan-updates InRelease [97.5 kB]         Ign:2 https://download.rethinkdb.com/apt eoan InRelease                         Err:6 https://download.rethinkdb.com/apt eoan Release                             404  Not Found [IP: 167.172.11.96 443] Reading package lists... Done                                                   E: The repository 'http://download.rethinkdb.com/apt eoan Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.  How can I fix this problem?

When updating, I get the following error message:   W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.   Here, I find another statement on this error:   This recommends removing certain PPAs; and, I'm not sure if I should do that since it might mean not getting the updates that I need.    Is this what I should do?


se are working on a website since some days and have a problem right now. We try to position a img and a div side by side, which I reached but I found no solution to have 2 texts sepertly and centered verticaly in the div.  My question is how do I get a similar result as on this picture?   I searched in the markup of the site how it is done and recognised that it was made with disply type "table-cell", I tryed to build it but i failed.  I hope you can help me Thank you in advance

I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support.
Div to be aligned vertically
   How can I center a div vertically in all major browsers, including Internet Explorer 6?


While I admit that it is a bit goofy, but because StackOverflow is a StackExchange site, it seems like it would be reasonable to expect that stackoverflow.stackexchange.com would redirect to stackoverflow directly. Could superuser.stackexchange.com, stackoverflow.stackexchange.com, and serverfault.stackexchange.com be updated to redirect people to the actual websites?

I have a Chrome search engine of the form http://%s.stackexchange.com/ that I use to quickly move between various SE sites (I find this more efficient than bumbling my way through the multicollider).  It would be nice if we could get aliases (like e.g. http://so.stackexchange.com/ or http://stackoverflow.stackexchange.com/ as a redirect to ) for all the sites that have their own domain names. I believe that's just the Trilogy (SO, pt/ja/ru.SO, SU, SF) and Stack Apps (plus corresponding metas where they exist, plus Meta MathOverflow).  Note that Ubuntu already has  redirecting to .  EDIT: Either I forgot to check MathOverflow when I originally posted this, or it's been added since then -  redirects to  now. However,  does not go anywhere.


When I installed ubuntu 13.04, and 12.10 on my current computer I lost the ability to use the RALINK 3290 wifi.  I was able, in the past, to get it working by following the advice posted .  But after upgrading to 13.10 I am once again stuck without wifi and the normal solution is not working.    Here is the problem in more detail. I obtain the Ralink 3290 driver from either the vendor or the dropbox folder as described, no problem.  I extract the folder and make changes as described if needed. I run the 'make' command, as the command is running I get several warnings and then when I try and 'make install'  I end up with error:2  Here is the output when I run "make" and "make install" -   Clarification: My wifi is not totally non-fucntional, it can see the various wi-fi networks around me, and it tries to connect to my favorite ones, but it never fully connects.  It then just cycles through the various wifi networks, never connecting.

I just installed Ubuntu 12.10 on an ASUS X401U, and after installation there is no list of wireless connections. I didn't have that problem with an installation on HP. What I can do to enable Wifi?  07:00.0 Network controller [0280]: Ralink corp. Device [1814:3290]


xx = goal_x - self.car.x     yy = goal_y - self.car.y     **orientation = Vector(*self.car.velocity).angle((xx, yy)) / 180.**     last_signal = [self.car.signal1, self.car.signal2, self.car.signal3, orientation, -orientation]     action = brain.update(last_reward, last_signal)  I am a beginner to programming I want to know that why there is a asterik(*) before the self.car.velocity section in the vector field.

In the following method definitions, what does the * and ** do for param2?  def foo(param1, *param2): def bar(param1, **param2):


I was going through  paper. On Page 6, it's written  Corollary 2.3. For any positive integers $a_1$, $a_2$, $\ldots$, $a_n$, there exist integers $x_1$, $x_2$, $\ldots$, $x_n$, such that $$a_1x_1+a_2x_2+\cdots+a_nx_n = gcd(a_1, a_2, \ldots, a_n)$$  So, I was wondering if it is true for all $n≥0$ i.e. is it universal, or are there any constraints?

Given $a_1, a_2, a_3, \ldots , a_n$ not all zero, show $\gcd(a_1, a_2, a_3, \ldots , a_n)$ is the least positive integer that can be expressed in the form $a_1x_1+a_2x_2+ \ldots +a_nx_n$. Also deduce $a_1x_1+a_2x_2+ \ldots +a_nx_n = b$ has solutions $\iff \gcd(a_1, a_2, a_3, \ldots , a_n)|b$.   I know that $ax+by=n$ has integer solutions $\iff \gcd(a,b)|n$. I'll need to use induction to show $a_1x_1+a_2x_2+ \ldots +a_nx_n = \gcd(a_1, a_2, a_3, \ldots , a_n)$ has solutions, and then I will be able to say that as $\gcd(a_1, a_2, a_3, \ldots , a_n) | a_1x_1+a_2x_2+ \ldots +a_nx_n $ for any $x_1,x_2, x_3 \ldots x_n$ then $c \leq \gcd(a_1, a_2, a_3, \ldots , a_n)$ and $c \geq \gcd(a_1, a_2, a_3, \ldots , a_n)$, and thus $c=\gcd(a_1, a_2, a_3, \ldots , a_n)$.


I am getting this error: Argument 2 passed to db_query() must be an array, string given. In db_query in below function.   function uc_guest_checkout_uc_checkout_complete($order, $account) {   if (!empty($_SESSION['uc_guest_checkout'])  && !user_is_logged_in()) {     switch ($order->data['complete_sale']) {       case 'new_user':         // For guest checkout, we replace the ubercart generated username and email         // for a new user with one that is more anonymous.         $name = uniqid('anon-', TRUE);         $mail = $name . '.' . uc_store_email();                 db_query('UPDATE {users} SET name = "%s", mail = "%s" WHERE uid = %d', $name, $mail, $account->uid);       break;   case 'logged_in':     // If the order is marked logged in but anonymous, this means that      // we must have set the uid to the default account, but still treat     // this as a new user.     $order->data['complete_sale'] = 'new_user';     break;     }   }   _uc_guest_checkout_end(); }   I tried this queries but none were creating account with valid names and emails as per db_query which is throwing error but successfully creating user accounts.where as these below queries creating names with random names.  db_update('users')         ->fields(array(             'name' => $name,             'mail' => $mail         ))         ->condition('uid', $account->uid)                ->execute();  db_query('UPDATE {users} SET name = :name, mail = :mail WHERE uid = :uid',                 array(':name' => $name, ':mail' => $mail, ':uid' => $account->uid));   How do I resolve this?

I am using ubercart guest checkout module. I am able to submit  the order as guest etc works fine.   After Reviewing the order and submitting it throws me this error   Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /var/www/html/dev.demo.net/sites/all/modules/ubercart_guest_checkout/uc_guest_checkout.module on line 263 and defined in db_query() (line 2342 of /var/www/html/dev.demo.net/includes/database/database.inc).   This is the query which is causing that issue    db_query('UPDATE {users} SET name = "%s", mail = "%s" WHERE uid = %d', $name, $mail, $account->uid);   I tried to change this query like this  db_update('users') ->fields(array(     'name' => $name,     'mail' => $mail )) ->condition('uid',$account->uid,'=')        ->execute();   still no luck, it throws me same above specified error.    How can i resolve the query of above one in order to avoid the error. Any suggestions w.r.t query will be nice.Thanks in advance.


How do I install (for example with apt-get install command) the new version of virtual box 5.1.22 (while i have 5.1.18) with command line? What commands do I use?

How do I install a .deb file via the command line?


I have the following matrix with dimensions $n \times n$ ($z\in\mathbb R$ and $n\in\mathbb N$):  $$\begin{bmatrix}         z & 1 & 1 & \cdots & 1 \\         1 & z & 1 & \cdots & 1 \\         1 & 1 & z & \cdots & 1 \\         \vdots & \vdots & \vdots & \ddots & \vdots \\         1 & 1 & 1 & \cdots & z \\         \end{bmatrix}$$  I need to find the determinant of it. I came up with the term $(z-1)^{n-1} (z+(n-1))$ after finding out the determinants for $n=1, n=2, n=3, n=4$, etc. Now my question is, how can I proof it that this   Thanks in advance.

I have the following $n\times n$ matrix:  $$A=\begin{bmatrix} a & b & \ldots & b\\ b & a & \ldots & b\\ \vdots & \vdots & \ddots & \vdots\\ b & b & \ldots & a\end{bmatrix}$$  where $0 < b < a$.  I am interested in the expression for the determinant $\det[A]$ in terms of $a$, $b$ and $n$.  This seems like a trivial problem, as the matrix $A$ has such a nice structure, but my linear algebra skills are pretty rusty and I can't figure it out.  Any help would be appreciated.


I am a software developer with little knowledge of Electrical Engineering. I have delivered some Raspberry PI projects that extensively use Relays.   I recently heard that Triacs are much cheaper and safer than Relays and can do the same job. If that is true, my question is:  Why are Triacs so under emphasised in Raspberry PI  (or Arduino) projects and people prefer using Relays?   Also, are Triacs suitable for 120V AC or is there any Triac that can control 12V DC as well?  Thank you,

What are the scenarios where Triacs can not replace a relay or vice-versa?


I'm walking through the manual of man-page. I don't understand the importance of the 6th section Games in Man-pages. What it's really mean?.

So, for example, when I type man ls I see LS(1). But if I type man apachectl I see APACHECTL(8) and if I type man cd I end up with cd(n).  I'm wondering what the significance of the numbers in the parentheses are, if they have any.


We just played forbidden Island my partner was the pilot and we collected all four treasures and made it to the helicopter pad. Do we still need the  "helicopter Lift card" to fly off the island with the treasure seeing as they are the pilot anyways?  Also if I am a Navigator is it correct to say that I can move someone 2 spaces but not utilize that move for an action also . For example could I move someone 2 spaces (1 move)and then have them shore up a flooded tile ( turn # 2 of mine)?

If I am a Navigator and I decide to move my partner can I also assume an action through them also? For example if I move a partner 2 spaces beside a flooded tile can I shore up the piece for an action through them?


How can I format my script and input to show only 10 numbers and have the characters of ( ) and + at the start of the number? Thanks.

I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.


I have very long lists of YouTube links/bookmarks. I want to create playlists for my YouTube channel with them. Is there any way to do it automatically without having to add each individual URL to a playlist?

I have something like that  how do I convert this to a YouTube playlist?


I have a model that trains itself by looking at the last 12 months of data, and then predicts the next month (out of sample).  Say I have 24 months worth of data, thus allowing me 12 opportunities to train and test my model (train: months 1-12; test: month 13; train: months 2-13; test: month 14, etc.)  How would I cross-validate this?

Question: I want to be sure of something, is the use of k-fold cross-validation with time series is straightforward, or does one need to pay special attention before using it?   Background: I'm modeling a time series of 6 year (with semi-markov chain), with a data sample every 5 min. To compare several models, I'm using a 6-fold cross-validation by separating the data in 6 year, so my training sets (to calculate the parameters) have a length of 5 years, and the test sets have a length of 1 year. I'm not taking into account the time order, so my different sets are :   fold 1 : training [1 2 3 4 5], test [6] fold 2 : training [1 2 3 4 6], test [5] fold 3 : training [1 2 3 5 6], test [4] fold 4 : training [1 2 4 5 6], test [3] fold 5 : training [1 3 4 5 6], test [2] fold 6 : training [2 3 4 5 6], test [1].   I'm making the hypothesis that each year are independent from each other. How can I verify that? Is there any reference showing the applicability of k-fold cross-validation with time series.


I want to add a custom program to the favourites of Ubuntu dock, but there is no option for that.     Translating the text in this image (same as above) only says:   All windows Quit   It also doesn't appear in "Show Applications":   Is there a way for adding the program to both Favourites and Applications menus?

I miss those pins I make in Windows.     How can I do the same in Ubuntu 17.10 with GNOME 3?


I want to have all DNS queries passing through tor.  How to set my default DNS to go through tor?  In other word I want to use the IP given by tor-resolve google.com instead of dig google.com.

When I am using Tor, and not using the Tor bundle there is a possibility of DNS leaks in certain situations.   What can be done to minimize it? Is it possible to resolve DNS via Tor?


Recently, I've been  in chat, 'tagging' it with emoji (🎶).  But they don't come up in search!   Yea, this is probably waaaaaaaay down the priority list. But it's a nice-to-have.

I did a search for A$, but a whole bunch of results containing "Å", "A's" and "as" were return, could not find one containing "A$":    Same thing for other special characters such as "#".


I have a file, which contains the name of some files. I want to find the total size of files in the list.  #cat filelist /tmp-directory/connector_db_ connector_db /tmp-directory/connector_db -connector_db /tmp-directory/connector_db_connector_db   As you can see the names of the file contains space, and more badly a hyphen (-). I am trying to find the total size of these files with below command.  #du -sch `cat filelist` du: invalid option -- 'o' du: invalid option -- 'n' du: invalid option -- 'n' du: invalid option -- 'e' du: invalid option -- 't' du: invalid option -- 'o' du: invalid option -- 'r' du: invalid option -- '_' du: invalid maximum depth `b'   I tried adding " " as shown below and then tried which also failed  #cat filelist "/tmp-directory/connector_db_ connector_db" "/tmp-directory/connector_db -connector_db" "/tmp-directory/connector_db_connector_db"  #du -sch `cat filelist` du: invalid option -- 'o' du: invalid option -- 'n' .....   But this works when I use below command, directly in shell.  #du -sch "/tmp-directory/connector_db -connector_db" 0       /tmp-directory/connector_db -connector_db 0       total   So, how to handle such a situation. I have filelist of 3 lac files. More badly, "du -sch" is not handling the list when file list exceeds around 20000. I am splitting the list into 20000 lines with split command. Is there any alternate method for finding the size of 3 lac files easily?

Or, an introductory guide to robust filename handling and other string passing in shell scripts.  I wrote a shell script which works well most of the time. But it chokes on some inputs (e.g. on some file names).  I encountered a problem such as the following:   I have a file name containing a space hello world, and it was treated as two separate files hello and world. I have an input line with two consecutive spaces and they shrank to one in the input. Leading and trailing whitespace disappears from input lines. Sometimes, when the input contains one of the characters \[*?, they are replaced by some text which is is actually the name of files. There is an apostrophe ' (or a double quote ") in the input and things got weird after that point. There is a backslash in the input (or: I am using Cygwin and some of my file names have Windows-style \ separators).   What is going on and how do I fix it?


Where we need to override finalize() method in java when we don't have idea when finalize() method for any given object might be run?What type of resources we can close in finalize()?What is the best chances when GC will called finalize() method?

I've been reading through a lot of the rookie Java questions on finalize() and find it kind of bewildering that no one has really made it plain that finalize() is an unreliable way to clean up resources.  I saw someone comment that they use it to clean up Connections, which is really scary since the only way to come as close to a guarantee that a Connection is closed is to implement try (catch) finally.    I was not schooled in CS, but I have been programming in Java professionally for close to a decade now and I have never seen anyone implement finalize() in a production system ever.  This still doesn't mean that it doesn't have its uses, or that people I've worked with have been doing it right.  So my question is, what use cases are there for implementing finalize() that cannot be handled more reliably via another process or syntax within the language?    Please provide specific scenarios or your experience, simply repeating a Java text book, or finalize's intended use is not enough, as is not the intent of this question.


Consider the function $$f(x) = \frac 1 {x^2+1}$$ $f(x) \to 0$ as $x \to \pm\infty$, thus we can say that $f(x)$ has roots at $\pm\infty$. Can we apply Rolle's theorem to prove $f'(c)=0, c \in (-\infty, \infty)$?   NOTE: $c=0$ does exist as specified above. This also works for other functions like $\frac{x}{x^2+1}$. However, is using Rolle's theorem a valid proof in this case?

Let $f : \mathbb{R} \to \mathbb{R}$ be a function which is differentiable everywhere on $\mathbb{R}$. If we know that  $$\lim_{x\to-\infty}f(x) = L = \lim_{x\to\infty}f(x)$$ How would one go about showing that there must exist $c \in \mathbb{R}$, such that $f'(c) = 0$ for all cases at once?


I have a script to calculate the cumulative capacity in all the servers.  for i in `cat servers` do ssh user@$i "df -t xfs --total | grep total"; done > capout.txt awk -vDT="Capacity" '         {sum2 += $2          sum3 += $3          sum4 += $4          sum5 += $5         } END     {GIGA=2^30           print DT,"\t" sum2/GIGA,"\t" sum3/GIGA,"\t" sum4/GIGA ,"\t"  sum3/sum2*100         }' capout.txt >> capacity.csv   Script works fine and i am getting the output as below.  Capacity   1047.43         439.4   608.032         41.9502   However i do not want to have the 3 trailing decimal points, I just need to restrict to one or two decimal points here.

My Command is below and its print Free CPU and Used CPU below format.  I want to restrict awk output to 2 decimal place.  grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} {free=($5)*100/($2+$3+$4+$5)} END {print "Used Cpu:",usage "%"} {print "Free Cpu:",free "%"}'   Output :   Free Cpu: 98.9588%  Used Cpu: 1.04125%   Desired output :  Free Cpu: 98.95%  Used Cpu: 1.04%


Find the number of pairs of positive integers (n, k) that satisfy the equation $(n+1)^{k} -1 = n!$  My try: seeing the problem, I saw Wilson's theorem which states that $(p-1)! = p-1 mod p$. Therefore, we can let $a-1=n$, then $a^k -1 =(a-1)!$ where in A is prime, I tried a= 2, a=3, and a=5 as solutions but can't find anymore, why cant i find anymore primes?

How to find all positive integers $n$ such that $(n-1)!+1$ can be written as $n^k$ for some positive integer $k$?


I asked:  I have a dual-boot system with Windows Vista and Ubuntu 11.04.  I'd like to upgrade the Ubuntu to 14.04 LTS.  Can I do it?  And how can I do it so that the Windows Vista partition remains intact?  This question received a "duplicate" marking incorrectly.  My question is not about simply upgrading from 11.04 to 14.04 LTS; I know that requires three steps.  It's about doing it on a dual-boot system, without disturbing the Windows partition.  Can this be done?  And how do I go about it?

I am currently using Ubuntu 10.04. I know there is a 10.10 release, but can I upgrade directly to 11.04? Could you walk me through the steps please?


This is a strange occurrence to be sure. First off, I'm using Chrome version 23.x and have not tried to reproduce this in other browsers yet.  I receive a JSON array from the server of the form:  JSON  { "layout":0, "caption":"Work History", "cols":[    {"field":"company","label":"Company Name","hidden":false,"order":-1,"validationType":2,"list":[]},       {"field":"date_start","label":"From","hidden":false,"order":-1,"validationType":1,"list":[]},    {"field":"date_end","label":"Until","hidden":false,"order":-1,"validationType":0,"list":[]},    {"field":"position","label":"Title","hidden":false,"order":-1,"validationType":2,"list":[]},    {"field":"description","label":"Description","hidden":false,"order":-1,"validationType":0,"list":[]},    {"field":"project","label":"Project","hidden":false,"order":-1,"validationType":64,"list":[]}    ] }   Then, I attempt to loop over the cols objects with Javascript"  Javascript  for (var c in json.cols) {     console.log("col name: " + c); }   Google Chrome's console prints the following:  Output  col name: 0 col name: 1 col name: 2 col name: 3 col name: 4 col name: 5 col name: remove   There should only be 6 outputs, first of all. Second, where does this final "remove" key come from? Why is it listed?

I've been told not to use for...in with arrays in JavaScript. Why not?


It is well known that independence of random variables implies zero correlation but zero correlation need not imply independence.  I came across plenty of mathematical examples demonstrating dependence despite zero correlation. Are there any real life examples to support this fact?

Any hard-working student is a counterexample to "all students are lazy".  What are some simple counterexamples to "if random variables $X$ and $Y$ are uncorrelated then they are independent"?


Let $E$ and $F$ be subsets of some set $S$, which may be finite or infinite. Suppose we are given a bijection $g\colon E\to F$. Is there an explicit way to construct from $g$ a bijection $h\colon S\setminus F\to S\setminus E$?  By explicit, I mean that it is not enough to show that $g$ exists (this is clear, since the cardinalities of $S\setminus F$ and $S\setminus E$ are equal).

We all know that $|\mathbb{N}| = \aleph_0$. Since $|\{-1\} \cup \mathbb{N}| = \aleph_0$ as well, I guess you could say that $\aleph_0 + 1 = \aleph_0$.  You can go on to derive that $\aleph_0 + \aleph_0 = \aleph_0$, and by induction $n \times \aleph_0 = \aleph_0$ (assuming that $n$ is finite, anyway).  Now, here's a thing: What is $\aleph_0 - \aleph_0$?  Well, $|\mathbb{P}| = \aleph_0$, and $|\mathbb{P} \backslash \mathbb{N}| = \aleph_0$, so perhaps $\aleph_0 - \aleph_0 = \aleph_0$?  No, wait. Consider the set $S = \{n \in \mathbb{N}: n > 5\}$. Now we have $|S| = \aleph_0$, and yet $|\mathbb{N} \backslash S| = 5$. So maybe $\aleph_0 - \aleph_0 = 5$?  But that is absurd, since we can redefine $S$ to make the result any finite number we wish. Or we can define $S$ such that the result is countably infinite.  Does this mean that the notion of $\aleph_0 - \aleph_0$ simply has no definite answer? Or am I just being too simplistic here?


I have an API response which returns a date time object in String. I need to convert it into a UTC Datetime object to compare with the current datetime.  How do I convert this to an UTC DateTime object?  received    "2019-03-22T06:35:57Z"

I need to parse  strings like "2008-09-03T20:56:35.450686Z" into Python's datetime type.  I have found  in the Python standard library, but it is not very convenient.  What is the best way to do this?


understanding Map.prototype  javascript  Hi all...  I have gone through many example and tutorials to understand what Map.prototype  actually represents..  in some blogs i saw that it represents Map object but if i have created two Map objects in the same file which one it will refer to?  and  can anyone please tell what the below condition mean?  var temp = Map.prototype ? new Map() : {} ;   are they checking if any objects of Map created if yes then create new object??

I'm not that into dynamic programming languages but I've written my fair share of JavaScript code. I never really got my head around this prototype-based programming, does any one know how this works? var obj = new Object(); obj.prototype.test = function() { alert('Hello?'); }; var obj2 = new obj(); obj2.test();  I remember a lot discussion I had with people a while back (I'm not exactly sure what I'm doing) but as I understand it, there's no concept of a class. It's just an object, and instances of those objects are clones of the original, right? But what is the exact purpose of this ".prototype" property in JavaScript? How does it relate to instantiating objects? Update: correct way var obj = new Object(); // not a functional object obj.prototype.test = function() { alert('Hello?'); }; // this is wrong!  function MyObject() {} // a first class functional object MyObject.prototype.test = function() { alert('OK'); } // OK  Also these  really helped a lot.


Reading PHB p. 242 about  (second paragraph) it begins “As a bonus action, you can...”.  Does this mean that when it is cast that a wizard gets to use a bonus action and move the sphere?  And if so, does this mean that on each of this wizard’s turns (within 1 minute duration), he gets to use a bonus action to move the sphere?  Or  Does a wizard have to have a bonus action (in his back pocket so to speak) to make use of this feature of the spell (being able to move it).

The  description of casting times says that spells with a casting time of "bonus action" require a bonus action to cast (p. 79, emphasis mine):  Most spells require a single action to cast, but some spells require a bonus action, a reaction, or much more time to cast. Bonus Action A spell cast with a bonus action is especially swift. You must use a bonus action on your turn to cast the spell, provided that you haven't already taken a bonus action this turn. You can't cast another spell during the same turn, except for a cantrip with a casting time of 1 action.  It's pretty clear that bonus actions aren't automatic (p. 69):  You can take a bonus action only when a special ability, spell, or other feature of the game states that you can do something as a bonus action. You otherwise don't have a bonus action to take.  So to cast a spell like Healing Word (p. 93), do I  need to be granted a bonus action that I can use, or do I have a bonus action I can use?  I guess I'm unclear on whether I need to have a bonus action before I can spend it on something, or whether having an ability, spell, or whatnot that can be done as a bonus action grants me the bonus action I need to use it.


I was receiving a message upon booting my Ubuntu installation that the boot drive had exactly 0 bytes left and somewhere else on this forum someone suggested looking at the kernels that were installed. I had about 20. I removed like five of the oldest to see if that would resolve the issue and when I rebooted all I get is this:  error: file '/vmlinuz-4.4.0-59-generic' not found   error: you need to load the kernel first   Do I have to reinstall or is there some way to recover from this?

I installed the latest kernel (4.1) and want to boot into it instead of 3.9. How can i do this on ubuntu 15.04?


Is there a difference in meaning between "to positively resolve situations" and "to resolve situations positively." Sorry, I thought there was a difference in that the question asks if in the first phrase if the adverb modifies the infinitive and in the second modifies the infinitive phrase was there a different in meaning such as the first phrase indicating all situations were settled and in the second that the situations were favorably settled.

He swam slowly to the island.  He slowly swam to the island.    Some experts say that there is a “slight difference” in meaning. Would you please tell me that difference?


Is light always in this dual state or when it is acting as wave, there is no particle nature and vice versa?

I often hear about the wave-particle duality, and how particles exhibit properties of both particles and waves. However, I wonder, is this actually a duality? At the most fundamental level, we 'know' that everything is made up out of particles, whether those are photons, electrons, or maybe even strings. That light for example, also shows wave-like properties, why does that even matter? Don't we know that everything is made up of particles? In other words, wasn't Young wrong and Newton right, instead of them both being right?


I have a very high-dimensional dataset with 27k features. I want to a reduce the dimensionality of the dataset. I want to use PCA to reduce the dimensionality to 2 as the toolbox I am using expects 2 dimensions.  But When I am trying to apply PCA in Matlab I am getting an out of memory error. Can I apply PCA twice to get down to 2 dimesions, i.e. 27k -> intermediate -> 2 dimensions?

Consider a set $X=(X_1; \dots; X_n)$ of $n$ data points such that $X_i \in \mathbb{R}^d$ is a column vector. Let $Y = \text{pca_proj}(X)$ denote the projection of points in $X$ according to the PCA components i.e.  $$Y_i \in \mathbb{R}^d\\ Y_i = W X_i$$  where $W \in \mathbb{R}^{d \times d}$ is the projection matrix obtained from PCA, and each row of $W$ is an eigen vector of $X^T X$.   Now let's define $Z = \text{pca_proj}(Y)$. My questions is: does $Y = Z$? If not, what happens if we keep applying PCA recursively on a matrix? Does it converge to a specific matrix?


How come that I received two Yearling badges within a week (almost)?

I just randomly looked at the , and there it lists two yearling badges, both awarded with about five minutes time difference on Aug 16. Actually, this user is here for 2 years and five months, and also hit his 200-rep mark long ago.  What is going on here?


I want to install Ubuntu on an HP Laptop with Windows 8.1 installed. Does the Ubuntu installer allow the dual boot setup?

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


can anyone please explain me is it correct to say "I have lunch at 1 pm". My doubt is if it is correct then how can we use a specific time expression with present perfect tense? If it is wrong to say "I have completed my homework yesterday." which implies specific time expression with present perfect tense. I have doubt in using time expressions with present perfect tense. i will be thankful if any one gives me relevant info.

This  states that:  When you use the present perfect tense you have to be talking about a period of time that you still consider to be going on. For example, if it’s still morning, you can say, "I’ve shaved this morning." If it is afternoon or evening, all of a sudden "I’ve shaved this morning" sounds really weird.  "I've shaved this morning" sounds more like past perfect, and indication of specific time (in the morning) makes this sentence incorrect.  Am  I spot on? Then what is the difference between the construct of past perfect, present perfect and future perfect?


Ideally, I would like to specify architecture and Ubuntu version and download all dependencies for that package, then take them to another computer.    I know about apt-get download.... and that would work fine if the architectures and versions matched.  I do see an architecture modifier, but not a version modifier.  Any help, or pointing me toward how to accomplish this with aptitude or another package tool would be appreciated.  even if I could take one .deb to the target computer and list all concrete dependencies... that would really solve the problem.

I have a friend who has got a computer that is not connected to the Internet. Is there any way to install software offline easily?


How can I go about putting Ubuntu on my  with dual boot options? That way I can have a computer when needed and Android on the other.  I have tried to Google it, but keep coming to pages listing just the Nexus devices and I honestly just want to use Ubuntu on a Samsung tablet.  Specifications: ⠀Processor: Samsung Exynos 5420 Octa 1.8 GHz (ARM-based SoC with integrated Mali GPU) ⠀Memory: 3GB ⠀Graphics adapter: ARM Mali-T628 MP6 ⠀Display: 12.2 inch 16:10, 2560x1600 pixel, capacitive touchscreen, LCD ⠀Hard disk: 32GB eMMC Flash, 32GB , 22.82GB free    Any help would be appreciated.

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


As a quick example:  list1 = ['a', 'b', 'c'] list2 = ['a', 'stack', 'overflow'] for i in list1 and list2:     print i   this prints all the elements in list2. Why is this? How can I just print the elements that are in both lists?

Given a list ["foo", "bar", "baz"] and an item in the list "bar", how do I get its index (1) in Python?


I am running on Python 3.7.1 and I've been trying to find a way to clear a screen of any previously printed messages. The problem is that os.system("cls") does nothing, it only makes a small window pop up for a fraction of a second, then it closes. I've tried to add a \n at the end and multiplying it by how many letters there are, still not working.

Like most Python developers, I typically keep a console window open with the Python interpreter running to test commands, dir() stuff, help() stuff, etc.  Like any console, after a while the visible backlog of past commands and prints gets to be cluttered, and sometimes confusing when re-running the same command several times.  I'm wondering if, and how, to clear the Python interpreter console.  I've heard about doing a system call and either calling cls on Windows or clear on Linux, but I was hoping there was something I could command the interpreter itself to do.  Note: I'm running on Windows, so Ctrl+L doesn't work.


Suppose $a$ and $b$ are independent Poisson RV with $\lambda_a$ and $\lambda_b$ respectively.  Find the pmf of $c = a - b$. Is $c$ a Poisson RV?  Characteristic function of $c(w)$ would be  $$E[e^{iwc}]=E[e^{iw(a-b)}]=E[e^{iwa}]*E[e^{-iwb}]=e^{-(\lambda_a - \lambda_b)(1-e^{iw})}$$  this is a Poisson RV.

One can calculate the probability of a correct score of a football match by Poisson(Number of Team1 goals, Mean average Team1 goals) x Poisson(Number of Team2 goals, Mean average Team2 goals)  So for 0:0 scoreline, Poisson(0, 1.05) x Poisson(0, 2.5)  if mean Team1 is 1.05 and mean Team2 is 2.5.   But how does one calculate the probability/odds of "home team to win by exactly one goal"? Adding double Poissons for each 2:1, 1:0, 3:2, etc scorelines might be one of the methods but it will be a tedious task and I am trying to avoid Excel for the time being to find the simplest method to calculate this. How do you involve the other team in your calculations?   Was hoping an easier, simpler way was there (something like calculating P=0 and then 1-P(0) to find odds of P>=1).


Problem: Let $f_1(y)$ and $f_2(y)$ be density functions, and let $a$ be a constant such that $0\le a\le 1.$ Consider the function $f(y)=af_1(y)+(1-a)f_2(y).$   Show that $f(y)$ is a density function. Such a density function is often referred to as a  mixture of two density functions. Suppose that $Y_1$ is a random variable with density function $f_1(y),$ and that  $E(Y_1)=\mu_1$ and $\operatorname{Var}(Y_1)=\sigma_1^2;$ and similarly suppose that $Y_2$ is a random variable with density function $f_2(y),$ and that $E(Y_2)=\mu_2$ and $\operatorname{Var}(Y_2)=\sigma_2^2.$ Assume that $Y$ is a random variable whose density is a mixture of the densities corresponding to $Y_1$ and $Y_2.$  (i) Show that $E(Y)=a\mu_1+(1-a)\mu_2.$  (ii) Show that $\operatorname{Var}(Y)=a\sigma_1^2+(1-a)\sigma_2^2+a(1-a)[\mu_1-\mu_2]^2.$ [Hint: $E(Y_i^2)=\mu_i^2+\sigma_i^2,\;i=1,2.$]   My Work So Far:   Since $f_1$ and $f_2$ are non-negative, and $a$ and $1-a$ are also non-negative, it follows  that $f$ is non-negative. We integrate: \begin{align*} \int_{\mathbb{R}}f(y)\,dy &=\int_{\mathbb{R}}[af_1(y)+(1-a)f_2(y)]\,dy\\ &=a\int_{\mathbb{R}}f_1(y)\,dy+(1-a)\int_{\mathbb{R}}f_2(y)\,dy\\ &=a+1-a\\ &=1, \end{align*} as required. (i) We have \begin{align*} E(Y) &=\int_{\mathbb{R}}y\,f(y)\,dy\\ &=\int_{\mathbb{R}}y\,[af_1(y)+(1-a)f_2(y)]\,dy\\ &=a\int_{\mathbb{R}}y\,f_1(y)\,dy+(1-a)\int_{\mathbb{R}}y\,f_2(y)\,dy\\ &=aE(Y_1)+(1-a)E(Y_2), \end{align*} as expected.  (ii) We compute \begin{align*} \operatorname{Var}(Y) &=a^2\operatorname{Var}(Y_1)+(1-a)^2\operatorname{Var}(Y_2)+2a(1-a)\operatorname{Cov}(Y_1,Y_2)\\ &=a^2\sigma_1^2+(1-a)^2\sigma_2^2+2a(1-a)[E(Y_1Y_2)-\mu_1\mu_2]. \end{align*} We can arrive at this expression also by expanding out $V(Y)=E(Y^2)-(E(Y))^2.$ I see no way to simplify this. Indeed, if we assume $Y_1$ and $Y_2$ are independent, then the variances merely add, because the covariance disappears. It looks wrong to me, but I have verified that the identity holds for a couple of uniform distributions. I keep going around in circles on this one. Any ideas?    Many thanks for your time!

Say I have two normal distributions A and B with means $\mu_A$ and $\mu_B$ and variances $\sigma_A$ and $\sigma_B$. I want to take a weighted mixture of these two distributions using weights $p$ and $q$ where $0\le p \le 1$ and $q = 1-p$. I know that the mean of this mixture would be $\mu_{AB} = (p\times\mu_A) + (q\times\mu_B)$.  What would the variance be?    A concrete example would be if I knew the parameters for the distribution of male and female height. If I had a room of people that was 60% male, I could produce the expected mean height for the whole room, but what about the variance?


[0] => Array         (             [id] => 9             [order_address_id] => 9             [created] => 2015-12-17 12:24:20             [order_status] => dispatched             [total_discount] =>              [total_shipping_charge] => 60             [s_state] => NY             [b_state] => NY             [order_id] => 9             [p_name] => Product 1             [qty] => 1             [price] => 475         )      [1] => Array         (             [id] => 9             [order_address_id] => 9             [created] => 2015-12-17 12:24:20             [order_status] => dispatched             [total_discount] =>              [total_shipping_charge] => 60             [s_state] => MA             [b_state] => MA             [order_id] => 9             [p_name] => Product 2             [qty] => 1             [price] => 349         )   I want to find if array with same ID repeats then I have to delete total_shipping_charge from second and subsequent array having same id. How can I do it in PHP?

How can I remove duplicate values from a multi-dimensional array in PHP?  Example array:  Array (     [0] => Array     (         [0] => abc         [1] => def     )      [1] => Array     (         [0] => ghi         [1] => jkl     )      [2] => Array     (         [0] => mno         [1] => pql     )      [3] => Array     (         [0] => abc         [1] => def     )      [4] => Array     (         [0] => ghi         [1] => jkl     )      [5] => Array     (         [0] => mno         [1] => pql     )  )


Extend of this question:  Above link's output also include the "name" of folder type, need to exclude these "type":             "date_added": "13170994909893393",            "date_modified": "13184204204228233",            "id": "2098",            "name": "ElasticSearch",            "sync_transaction_version": "1",            "type": "folder"   How to get only field if "type" of the same object is "url", otherwise ignore:  A valid pattern that will be put in the output:             "type": "url",            "url": "https://url_here"

I get a long list of such arrays  {     "id": "byu6g6c4cjys5mdkg5znh8ju8c",     "create_at": 1511875272294,     "update_at": 1511875272294,     "delete_at": 0,     "display_name": "BMA",     "name": "BMA",     "description": "",     "email": "aleksandar.ivanov@random.com",     "type": "O",     "company_name": "",     "allowed_domains": "",     "invite_id": "gdgz1tbxuinntx1fbr1ax7kehy",     "allow_open_invite": false,     "scheme_id": null   }   I want to get by JQ only the ID where the name is BMA. At the moment I parse " jq -r '.[]["name"]" and I can filter the output from curl by name and I will get "BMA" and also 100 other names, but I need to filter only the ID where name is =BMA. Any ideas?


I have heard from some people that a view counts when you watch the video for more than a minute and others have said 15 seconds.  How does YouTube determine what a view is?

I have the following scenario: I have uploaded a video to YouTube and I am logged in, but each time I refresh the page or "view" the video, the count does not change.   How does the video count work? If I load it once, play it 2-3 times, will it still count as 1? Does it count my own viewings?


I have a multi-line equation as follows:  \begin{enumerate} \item  \begin{enumerate}  \item   \begin{align*}    A \cap (B \cup C)     & =  x \in A \cap (B \cup C) \\     & =  x \in A \wedge x \in (B \lor C)\\     & =  x \in (A \wedge B) \lor x \in (A \wedge C) \\     & =  x \in (A \cap B) \cup x \in (A \cap C) \\     & =  (A \cap B) \cup (A \cap C)   \end{align*}  \end{enumerate} \end{enumerate}   But I can't get the first line to level up with the question number (please see image below). How can I achieve that?

If I type    \begin{enumerate}         \item        \begin{align*}         eqn 1         eqn 2       \end{align*}   \end{enumerate}   the label will appear on the first lines and the equations will appear on subsequent lines. How do I make it so that the equations begin on the same line as the enumerate label? Obviosly, I could manually adjust the location using \vspace and \rule, but is there a better way?


package question; import java.util.Scanner; public class quiz {     public static int score = 0;     public static void main(String args[]){-         Scanner inp123 = new Scanner(System.in);          String q1;  System.out.println("whats my name?");         q1 = inp123.nextLine();         if (q1=="matt"){             System.out.print("Correct that is my name!");         }else{             System.out.println("Incorrect");             score = score + 1;             System.out.print("Your score is: ");             System.out.println(score);             quiz.main(args);         }   Heres my code and when I input matt it says its incorrect new to java, if anyone can help me or be willing to teach me java reply or hit up my inbox, I have good experience in python and looking for a new language

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


Let $G$ be  a group of order 21 .Question is whether it is abelian or not?  Number of Sylow 3 subgroups =1+3k divides 7 hence k=0 or k=2.Number of Sylow 7 subgroups=1+7k divides 3 hence k=0.In both cases if we get a unique sylow 3 and a unique sylow 7 subgroup we are done that the group is abelian using Internal Direct Property of groups .  But what if  number of Sylow 3 subgroups is 7??It does not contradict anything here we have 2*7+7=21 elements i.e works fine  Can I extend this arguement to conclude my proposition or I need something else.Please help

solution :-  $21= 3 \times 7$  there is only one Sylow $3$ and Sylow $7$ subgroup  so, Sylow $3$ and Sylow $7$ subgroup are normal in group $G$  so $G$ is cyclic group of order $21$.  Am I right ?  somebody told me that group of order $21$ is not cyclic.  he gave me this .  If group of order 21 is not cyclic, then can we understand it by Sylow method ?


I am running DOTA 2 on lowest graphics and with GPU enabled and the temp is getting (I am not joking) 90-95 °C. What to do it's getting too hot!  My Laptop specs:   processor: Intel i3 3rd gen Ram: 4 GB  GPU: Nvidia 850 m (1gb)

I just ordered the Nvidia GTX card. I have a dilemma, though. Should I keep using the driver which is available in "additional drivers" in Ubuntu, or should I install the driver from the Nvidia site?  So which driver is the best for me?


I have a hard time understanding why I should define properties on the constructor class or its prototype object.  Here what i understand about prototype  - declaring properties in prototypes (instead of the linked parent object) saves performance since each child object will not have its own COPY of the parent's properties.   Question: But I thought you can't copy values from non-primitive types i.e. function objects only pass references... and can only copy from primitives?   **Does this mean if I inherit parent's methods like below I am copying the reference to the methods or actually copies? **  function Parent() {    this.name = "jeff"; }  var child = new Parent(); console.log(child.name); /// is copied from parent or the reference is copied??    In the following example, I am referencing the prototype... right?  Parent.prototype.age = 9; child.age // I looks at the parent class, then reference to prototype.age.   ****Question 2:** If i can change the prototype.age for a particular object, then I'm actually copied the value right? So what's the point i.e.**  child.age = 10; // changed the value for THIS object

What's the difference between  var A = function () {     this.x = function () {         //do something     }; };   and  var A = function () { }; A.prototype.x = function () {     //do something };


How do I recalculate normals for all objects in the scene? Normally, I select an object at a time, press Tab, press a to select all vertices/faces and press Ctrl-n. If I have 20+ objects in the scene, can do it in one hit combo?

I want to untriangulate every object in my scene with this script:  import bpy  for ob in bpy.data.objects:     bpy.ops.mesh.tris_convert_to_quads(limit=0.9, uvs=False, vcols=False, sharp=False, materials=False)   But it doesn't work in object mode, any ideas on how I can get it working?


I tried to install libsd1.2-dev, but got an error due to some dependencies that I do not know how to solve.  sudo apt-get -f install libsdl1.2-dev   Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  libsdl1.2-dev : Depends: libglu1-mesa-dev but it is not going to be installed or                       libglu-dev E: Unable to correct problems, you have held broken packages.   My uname -a is:  Linux moon 3.8.0-31-generic #46-Ubuntu SMP Tue Sep 10 19:56:49 UTC 2013 i686 i686 i686 GNU/Linux  Running Lubuntu-Desktop. Installed is libsdl1.2-debian (version 1.2.15-5ubuntu1)  Any help would be very much appreciated.

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


I'm using a Lenovo Ideapad u330p. It came with Windows 10 preinstalled.  I installed Ubuntu 16.4 on a separate partition and the default boot loader was replaced with Grub 2.  I have since uninstalled Ubuntu but found I was unable to boot from a UEFI USB or CD/DVD device through Grub.  I uninstalled Grub hoping it would default to the Windows Boot Loader. This wasn't the case. I now receive the following error message;  "System boot order not found. Initializing defaults"  The system then resets and gets stuck in a loop with this error message.  If I load the boot order menu using the Novo button I am able to launch windows. However changing the boot order in the bios does not persist when I exit, as such I am still unable to use the windows boot manager to install anything.  Further more, I am unable to access the partition that Ubuntu was installed on.  It cannot be seen or accessed from within Windows.  Can anybody tell me how to;  a) Wipe the hard drive completely and reinstall an operating system? b) Repair the boot loader? c) Access the partition that Ubuntu was installed on? (It is on an LVM partition)  Any assistance would be greatly appreciated.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I've created a JFrame window with a JComboBox. I can select things but they don't do anything. I thought that event was a String, but it isn't. What is the solution for this?  import java.awt.FlowLayout; import java.awt.event.ItemEvent; import java.awt.event.ItemListener;  import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel;  public class Gui extends JFrame {     private JComboBox box;     private JLabel picture;      private static String[] filename = {"", "b.png", "x.png"};      public Gui() {         super("the title");         setLayout(new FlowLayout());         box = new JComboBox(filename);         box.addItemListener(                 new ItemListener() {                     public void itemStateChanged(ItemEvent event) {                         if(event.getStateChange()==ItemEvent.SELECTED){                             System.out.println("test");                             if(event=="b.png") {                                 System.out.println("test2");                             }                         }                     }                 });         add(box);     } }


Is there any way to call multiple @wire methods sequentially? As per the documentation, all the wire methods will run asynchronously, but what if I want to execute multiple wire methods sequentially, is there any way?

I have two different @wire methods that are calling Apex methods to get different results from two different objects.  After this information has been retrieved by each @wire respectively, I'd like to afterwards compare the results and set a few other attributes on the page.  How do I achieve this?  Should I use connectedCallback() or renderedCallback() or neither?  Is there a better way to do multiple Apex method calls then process them afterwards within the JS when the component loads?  I'm hoping there's a graceful way to accomplish this in LWC without having to chain Promises, or having to handle all of this within a single Apex method call.


I'm trying to move the element to the bottom of its parent but only way to do that is to make it positioned absolute but i want it to be relative.    #output{   height: 100px;   background-color: red; }  #inner{   height: 30px;   background-color: blue;   /*float: down*/ }

Given the following HTML:

     Copyright Foo web designs

    I would like #copyright to stick to the bottom of #container. Can I achieve this without using absolute positioning?


I have Linux installed on my PC along with Linux (Ubuntu). How can I access files from Windows 8 which are present on the Linux's partition?

I tried all programs recommended to mount Linux partitions like EXT2 or EXT3 or even EXT4 but no one can do well on Windows 7 32 bit.  I want to access read-write, is there a program that can do this?


I have played terraria for a while now but I have noticed that my corruption biome is spreading into my desert and I’m not sure if this is a good thing or a really bad thing. My question is how do I stop the spread of corruption easily for above and below ground? (for hardmode) Also all I know is that corruption spreads “3-6 blocks per day” is this irl? And does it spread faster or slower through sand?

I've tried to make an artificial Corruption biome in Terraria for two purposes:   Farming mobs; Getting a lot of Vile Mushrooms;   But I want to do it accurately and limit the size of the corrupted area. So I'm stuck with the following problems:   Will Ebonstone make blocks of dirt in contact with it corrupted, if I place them in such way? Does Corruption spread through Corrupted grass and Thorns? How big or long may corrupted Thorns be?


While reading the documentation of endnotes I have found the following line:  \let\footnote=\endnote   Until now I always wrote \let without a =, so I would have written  \let\footnote\endnote   And both methods seem to achieve the same. So is there any difference in using the = and if yes, what is it?

Both uses of the \let primitive often lead to the same result. Is this even true for every case? What was the thought process behind it. And if they are actually not equivalent, are there particular situations in which you can only use one or the other?  Addendum  Summary  As your plenty and nice answers show, there are cases in which you clearly have to respect one of the variations (for instance regarding assignments to '=' and macros that check for spaces). These were totally understandable points and they explain a lot. Now, @Werner's answer confirmed one ingenuous thought of mine:     "The use of = is purely to emphasize the fact that an assignment is being made [...]"   Moreover Knuth himself seem to have intended the synopsis including the '=', though he also used the other way. Why did he include it then? It will probabilly have to do with the exact meaning of the TeX source snippet cited by @Werner. To be honest, I don't know WEB either, but if there is someone who does, can he explain it (in very easy terms) by adding an edit to his answer? New answers are clearly welcome too.  Side Note  As an element of a gray area I found an example where using the syntax including the equal sign causes "difficulties":  If you have control sequences which need the 'csname-expandafter' mechanism, and you want to stick to the minimal exploitation of \expandafter by saying  \expandafter\let\csname foo1\expandafter\endcsname\csname bar1\endcsname   you can't add an equal sign because it would distract TeX from reading the \expandafters correctly. To get the equal sign work you would need to use the slightly unhandier version  \expandafter\let\csname foo1\expandafter\endcsname\expandafter=\csname bar1\endcsname


I want to check whether the sum of two list is same or not.   lst1 = [1 2 3 4] lst2 = [0 3 3 4] if sum(lst1) == sum(lst2):     return true   Here the sum returns true. If I hash the list I get different values but hashing is computationally expensive. I only want to check whether the elements in the two lists are same (only with the exception of 1 element). I am using Binary search technique of dividing the list and then checking the hash. if hashes are different I am checking if its more than once.  But as I said hashing is computationally expensive. Also the order does matter here. Thank you

My  has failed me.  In Python, are the following two tests for equality equivalent?  n = 5 # Test one. if n == 5:     print 'Yay!'  # Test two. if n is 5:     print 'Yay!'   Does this hold true for objects where you would be comparing instances (a list say)?  Okay, so this kind of answers my question:  L = [] L.append(1) if L == [1]:     print 'Yay!' # Holds true, but...  if L is [1]:     print 'Yay!' # Doesn't.   So == tests value where is tests to see if they are the same object?


I conclude the other post from stack-exchange, and Wikipedia, I come up with the following explanation of white noise process. My question is simply want to know whether my understanding is correct or not My explanation:  if a_t is said to be a white noise process white noise process , can be viewed as combination of 2 part, "white noise"&"process" the first part use the physical properties of white noise to describe the statistical properties of the process. The latter part is to point out this sequence of no. is a process. Therefore the white noise process should have the following properties: 1.E(a_t)=0 2.var(a_t)=S^2 3.ACF of a_t =0

What is the best way of defining white noise process so it is intuitive and easy to understand?


While installing Apache as a service, I have accidentally removed Windows' default http service. Now many dependant services don't work and I can't get it back.  Is there a way (beside restore points since it's been a while and I noticed this too late) to fix this both as a service and in the registry?  What I have done:   Installed Apache using http -k -n "http" command. Noticed that I have misspelled httpd and typed http instead. Removed the service using sc delete http Reinstalled Apache using http -k -n "httpd" Found out spooler isn't starting. Searched the web and found http was a Windows service required for many discovery tasks. Panicked

I replaced apache webserver with http(WINHTTP windows service) for use virtual hosts feature. But I was missing  http(WINHTTP windows service) which I previously removed.I  now want to  reinstall this service for use print spooler.


I have a form that has three submit buttons as follows:  <input type="submit" name="COMMAND" value="&lsaquo; Prev"> <input type="submit" name="COMMAND" value="Save"> <input type="reset"  name="NOTHING" value="Reset"> <input type="submit" name="COMMAND" value="Next &rsaquo;"> <input type="button" name="NOTHING" value="Skip &rsaquo;" onclick="location = 'yada-yada.asp';">   The row of buttons is a mix of submit, reset and JavaScript buttons. The order of buttons is subject to change, but in any case the save button remains between prev and next buttons.  The problem here is that when a user hits Enter to submit the form, the post variable "COMMAND" contains "Prev"; normal, as this is the first submit button on the form. I however want the "Next" button to be triggered when the user submits the form via the Enter button. It is kind of like setting it as the default submit button, even though there are other buttons before it.

Let's say you create a wizard in an HTML form. One button goes back, and one goes forward. Since the back button appears first in the markup when you press Enter, it will use that button to submit the form.  Example:    <form>   <!-- Put your cursor in this field and press Enter -->   <input type="text" name="field1" />    <!-- This is the button that will submit -->   <input type="submit" name="prev" value="Previous Page" />    <!-- But this is the button that I WANT to submit -->   <input type="submit" name="next" value="Next Page" /> </form>     I would like to get to decide which button is used to submit the form when a user presses Enter. That way, when you press Enter the wizard will move to the next page, not the previous. Do you have to use tabindex to do this?


The original problem was to consider how many ways to make a wiring diagram out of $n$ resistors. When I thought about this I realized that if you can only connect in series and shunt. - Then this is the same as dividing an area with $n-1$ horizontal and vertical lines. When each line only divides one of the current area sections into two smaller ones.  This is also the same as the number of ways to make a set of $n$ (and only $n$) rectangles into a bigger rectangle. If the rectangles can be drawn by dividing the big rectangle, line by line, into the set of rectangles without lose endpoints of the line. - Can someone come to think of "a expression of $n$" which equals this amount, independent of the order of the rectangles or position?  (It is only the relations between the area sections that matters and not left or right, up or down. However dividing an area with a horizontal line is not the same as dividing it with a vertical line.)

How many ways can a rectangle be partitioned by either vertical or horizontal lines into n sub-rectangles? At first I thought it would be:        f(n) = 4f(n-1) - 2f(n-2)   where f(0) = 1     and f(1) = 1    but the recurrence relation only counts the cases in which at least one side (either top, bottom, left or right of the original rectangle) is not split into sub-rectangles. There are many other partitions that don't belong to those simple cases like  [EDIT ImageShack has removed the picture. One of the cases is the sixth partition when n = 4 in the picture in the accepted answer below.]  Any other related problem suggestions are welcome. Also it is nice to know how to traverse this partition efficiently.


I am showing content from product content type of commerce module using view but view is showing some repeated content.how to solve this problem.

I have created a view where I am displaying the the node title and a logo (a cck field). In the arguments I have passed the taxonomy term name.  In the result a node is displaying 2 or 3 times; I already checked the distinct checkbox in the Query settings but that also does not work. I have used the random sort, which seems to cause the duplicates; when I remove the random sort, it works fine.  How can I avoid the duplicates without disabling the random sort?


Prove that for every polynomial $w(\lambda)=(-1)^{n}\lambda^{n}+a_{n-1} \lambda^{n-1}+...+a_{1}\lambda +a_{0}$ with coefficients in the body of $ K $ exist matrix $A \in M_{nxn}(K)$ such that $w(\lambda)$ is a characteristic polynomial of matrix $A$.   I had one task where $w(\lambda)$ was a characteristic polynomial of some $A$ but I don't have idea how to prove that always exist such a matrix.I have $det(A-\lambda I)=(-1)^{n}\lambda^{n}+a_{n-1} \lambda^{n-1}+...+a_{1}\lambda +a_{0}$ and it is difficult to find a formula for $ A $ from this to prove that $A$ exist.Please, give me some tips...

Is every monic real polynomial the characteristic polynomial of some real square matrix? I strongly suspect so, but I couldn't find a proof.


Looking at the axioms of comprehension and replacement, I see that they allow for the use of parameters in the formulas used in the axioms. From what I can understand, parameters are specific sets that may not be definable in the language of set theory. Using these sets in formulas gives us extra expressive power. Why are we allowed to do this? Are these parameters in the domain of discourse? How would we determine that these parameters are indeed sets if they aren't definable in the language of set theory? Thanks to all who can clear this up.  Edit: My question is concerned with why we are allowed to use parameters, not what they are.

I'm doing some work in Jech's Set Theory book and I am a little confused about the definition of parameter in the Axiom Schema of Separation. Within a formula, what relationship would a parameter have with the free variables, and bound variables? I'm just fuzzy about what exactly a parameter is and how it is used in the formulas. I appreciate any help. Thanks.


Is it possible to skip the headmark only on the section definition page?  %KLASSE DOCUMENT \documentclass[a4paper, 12pt, bibliography=totocnumbered, twoside]{scrartcl}  %TWOSIDE HANDLING \raggedbottom %TWOSIDE VSPACES ISSUE \usepackage[automark, headsepline]{scrlayer-scrpage} %HEADER & FOOTER STYLE \pagestyle{scrheadings} \clearscrheadfoot %CLEAR HEADER & FOOTER \chead{\headmark} %CENTER CHAPTER IN HEADER \automark[section]{section} %LINKE SEITE / RECHTE SEITE \cfoot{\pagemark} %CENTER PAGE IN FOOTER \usepackage{blindtext} \usepackage{lipsum}  \begin{document}  %--------------------------------------------------------------- INHALTSVERZEICHNIS \tableofcontents \newpage \section{First Section} \lipsum[1] \subsection{First Subsection} \lipsum[2] \newpage \section{Second Section} \lipsum[3] \lipsum[3] \lipsum[3] \subsection{Second Subsection} \lipsum[4] \section{Third Section} \lipsum[1] \subsection{Third Subsection} \lipsum[2] \lipsum[2] \lipsum[2] \newpage \section{Fourth Section} \lipsum[3] \subsection{Fourth Subsection} \lipsum[4] \lipsum[1] \lipsum[2] \lipsum[3] \lipsum[4] \end{document}

i try to disable the ohead on the first page of a section (and only the first page). I tried a lot of things(e.g. \thispagestyle) but nothing really works.  \documentclass[paper=a4,fontsize=12pt,parskip=half,bibliography=totoc,listof=totoc,headings=normal]{scrartcl}  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[ngerman]{babel}  \usepackage[headsepline,plainheadsepline,footsepline,plainfootsepline]{scrlayer-scrpage}  \pagestyle{scrheadings} \automark{section} \clearscrheadfoot  \ihead{Mr. XY}  \ohead{\headmark} \ofoot[\pagemark]{\pagemark}   \begin{document}  \section{first} %here comes a lot of text... %ein I don't want to have "first" in the header \section{second} %here comes a lot of text again...  \end{document}   Hope that someone can give me a solution for that problem. Thanks.


This is the link to my zipped dump file, any help would be greatly appreciated.

I see you have succussfully answered this question previously but it is not specific to my system.  I have downloaded your file and created the relevant dump file but I don't know how to analyse it. Can I upload it to you for some advice please?


I'm stuck with DSL Lite (a slow Internet connection).   Is it possible to speed up my AT&T 'DSL Lite' connection by augmenting it with some bandwidth from my Cellphone's tethered 'hot-spot' connection?   I often use my cellphone's tethered hotspot because it is much faster than my DSL-Lite connection; however, I find it is too expensive to use regularly. It seems like I should be able to combine these two data streams and use them simultaneously.  My current thinking is that some software might exist that makes it possible to use the cheapest bandwidth first (ATT's DSL-Lite) and leave it on (always flowing) but when the connection pauses/waits/bottlenecks/etc., it would then get a boost of bandwidth from the cellphone hotspot.

I am technically knowledgeable enough to know that this most likely isn't possible, BUT, I am curious just the same (it must be put to rest). Is there anything preventing us from creating a means to use two different internet connections, like two different ethernet cards or an ethernet card and a wireless card, and using the two IP addresses at once for more internet speed?  My specific situation is that I would like to use both a wireless card and my wired connection on my machine running Kubuntu 13.10. Using two internet connections would allow me to do things like:   Torrent and browse simultaneously without lag Open Firefox with multiple tabs faster (?) Download a couple or a few large files at once double time Increase overall internet connection speed (?)


On my web page I have panels which contain various input widgets, some of which are Bootstrap button groups. The basic HTML for these looks similar to this:

         <button type="button" class="btn">Option A</button>

         <button type="button" class="btn">Option B</button>

         <button type="button" class="btn">Option C</button>

   The panels of inputs are generated via Knockout templates, and are shown or hidden depending on which menu item the user selects in a main menu tree. This is done using jQuery's addClass() and removeClass() to add or remove the hide class that's present in Bootstrap/AdminLTE. In both cases this class is just defined as display: none !important.  I have jQuery code that performs tasks when the user provides input. For the buttons, it looks like this:  $(".param-widget-buttongroup .btn-group button").on("click", function() {     // Do some stuff here - send messages to the device I'm controlling, etc. });   This is done after the Knockout data bindings are applied. It definitely used to work, and still does for my other non-buttongroup inputs - however, at some point in the last month or so of development it's stopped working, and I'm currently trying to work out why.  If I place a console.log() in the click handler function, nothing is printed when the button is clicked. However, reporting $(".param-widget-buttongroup .btn-group button").length at the point when I'm attempting to add the click handler returns a count of 152 (ie. all the buttons across all the panels), so the buttons are definitely being found.  I've eventually determined that if I execute $(".param-widget-buttongroup .btn-group button").on("click", function(){ console.log("Button pressed"); }) in the Chrome web console, I only actually see this on click if the button's panel is visible at the time I attach the handler. Buttons whose panels are not visible do not get that handler set on them, even though the number of buttons found by the selector is still reported as 152. Once the handler is attached, however, I can show a different panel and come back to the original one later, and the expected output will still be printed on click.  Is there any reason jQuery would decide not to attach the click handler if the item is hidden at the time? I've not had this issue with any of the other inputs I'm using (single buttons, text boxes, select boxes, ion range sliders, ...).  Alternatively, is there a way I can definitively check what click handler an element currently has? I've tried checking the $(...)[0].onclick value of the element, but regardless of whether the jQuery handler was attached successfully or not, this value is always null.

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


Let $X$ be a simplex and $Y\subseteq |X|$ a simplicial complex. Can I construct a simplicial complex $X'\supseteq Y$ s.t. $|X'|=|X|$? Can I do it without introducing new vertices apart from $V:=X^{(0)}\cup Y^{(0)}$?  My first idea was to start with $X':=Y$ and repeatedly adding, for each $\sigma\subseteq V$ s.t. $\sigma$ is a nondegenerate simplex and $X'\cup \sigma$ is a simplicial complex, $X':=X'\cup\sigma$. However, does it work?

Does there exist a topological space $X$ and a closed subspace $A$ such that each of $X$ and $A$ is isomorphic to the topological space of some simplicial complex, but such that there does not exist a pair $(S,T)$ consisting of a simplicial complex $S$ and a subcomplex $T$ with $(X,A) \cong (|S|,|T|)$?  This is (essentially) problem A2 from Chapter 3 of Spanier's book Algebraic topology. At first I suspected that the intended example was the comb space $A$ inside the unit square $X$, but it seems that $A$ is not polyhedral (if it were, then being compact, it would have to be the space of a finite simplicial complex). It doesn't seem to me that there is an example that has already appeared in Spanier's book, so I am somewhat at a loss as to the intended answer.


Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R} $ satisfying $f(x-f(y)) = f(f(y)) + xf(y) + f(x) - 1$  I have solved this by doing the  substitution $x \rightarrow 2f(y)$ and then replacing $x$ back. I get $f(x) = 1 -  \frac{x^2}{2}$  Now, I want to find all the other functions satisfying the equation or prove that this is the only solution. This is just like the  I have already asked, with the difference being that this functional equation has two variables alongwith some nested functions.   From the approach in the answer to that question, I tried assuming another function $g$ satisfying the equation and then try to prove that $h = f - g$ is a constant function with value $0$. But, I am unable to do that in this case.   Also, there aren't many constraints on the function except it being from $\mathbb{R} \rightarrow \mathbb{R} $. How can I even approach the problem in this case? Are there any methods involving calculus?

Let $f:\mathbb{R}\rightarrow \mathbb{R}$ be such that    $$f\big(x-f(y)\big)=f\big(f(y)\big)+x\cdot f(y)+f(x)-1$$   for all $x,y \in\mathbb{R}$.  Then, what is the value of $|f(16)|-25$?   what i try  put $f(y)=z.$ then $f(x-z)=f(f(x))+xz+f(x)-1$  put $f(x)=t.$ then $f(x-z)=f(t)+zx+t-1$  How do i solve it Help me please


I have Motorola Moto G XT1033, rooted. I installed CM12 Nightly. I am not able to download apps sized more than 200 MB from Play Store. No option to uninstall updates of Play Store.  How to fix it?

Suddenly (after a Play Store update?) I can't install or update any Apps. I always get error code 905 when I try to do so. How can I fix this?


I have an attribute table for buildings in my city. The important fields are Output Area, where the building is located, and TotalArea, a calculated sum of the floorspace of that building.  What I'd like to do is find the total area of all buildings in each output area, and add that data to the output area table.  What's the best way to do this?

I would like to calculate the sum of values in one column, based on values in another column. To illustrate my question I uploaded the picture below. The second column consists of zipcodes, the third total sales. I would like to know what the total sales per zipcode are? So in this case:  What is the sum of column three for column two's value 1023? Output then should be 4 (0+1+1+2+0). The sum for 1024 then should be 11,5 following the same logic.  As this is quite a large dataset I would like to have the QGIS field calculator (or any other tool) calculate a new field which states the total sales in the zipcode. So far I can't seem to get it working and was hoping someone here could help me.  As you can see I have some missing values, is this a problem in calculation? Perhaps good to mention is that it is a table.


For, $\int_0^{\infty} \frac{\arctan(x)-\arctan(2x)}x \mathrm dx$  Let, $I_1=\int_0^{\infty} \frac{arctan(x)}x\mathrm dx$ and $I_2=\int_0^{\infty} \frac{\arctan(2x)}x\mathrm dx$  For, $I_1$ let $x=\frac 1u $ so $I_1=\int_{\infty}^{0} \frac{\arctan(\frac1u)}{\frac1u}\left(-\frac1{u^2}\right)\mathrm du$ $=\int_0^{\infty} \frac{arccot(u)}{u}du$  From which it follows, $I_1=\int_0^{\infty} \frac{\frac\pi2-\arctan(x)}x\mathrm dx$ So, $2I_1=\int_0^{\infty} \frac{\frac \pi2}x\mathrm dx$  In the same way it can be shown that, $2I_2=\int_0^{\infty} \frac{\frac\pi2}x\mathrm dx$  So, $2I=2I_1-2I_2=0$  But, Wolfram Alpha says,   So, where is my error?

Find $$\int_{0}^{\infty}{f(x)-f(2x)\over x}\, \mathrm{d}x$$ if $f\in C([0,\infty])$ and $\lim\limits_{x\to \infty}{f(x)=L}$.   I tried denoting $\displaystyle \int{f(x)\over x}dx=F(x)$, but I don't know what to do with $F(\infty)-F(0)$. I also tried somehow to use l'Hopital's rule but don't seem to come by a plausible justification for it, nor do I arrive at a clear expression. I would really appreciate your help in this.


In C++, I've heard that you need to separate the implementation from the interface in order to reduce compile times. In  question, the answerer basically says that if you change the header then the source is recompiled, so if you separate the interface from the implementation then there is less chance you will need to change the header. But here are the two scenarios I see:   Have all code in header file  Whenever you change any code, the entire file is recompiled. Have code in separate header files and source files  Since the header file is usually copy and pasted (via include) into the source file, if you make a change to either the header or source files the whole file will still have to be recompiled because it is as if they are one file.  Whether you change either the header or the source file, the whole file (both the header and the source) are recompiled.    So then what is the advantage of separating interface from implementation? You might say it is so that you can have multiple implementations for a single interface by means of inheritance, but can't you still do that when you have all the code in the header file? You could also say that it is so that the interface does not see any implementation details, but what is the use of that?  The only reason I can see why separating interface from implementation is that if the C++ compiler skips over the part of the source file that is the header file that is copy and pasted into the source code if it is not changed and just compiles the rest of the source file. So is this the case? Do C++ compilers skip compilation of certain parts of files that have not changed? I know that that is probably not what happens, but I cannot think of any other explanation.  Edit  I've already seen  question. What I am asking is why are the compilation times faster with separate implementation and interface files. I understand that there are advantages with separate implementation and interface files such as what Lightness Races in Orbit stated, but I am asking is why are compile times better if they are at all.

Why does C++ have header files and .cpp files?


I am trying to figure out what kind of hardware I need to run a phpBB 3 server for a fairly large community. When I say hardware, I mean CPU, RAM, and IO specs. When I say fairly large community, I mean a community of about 30,000 people that averages, let's say, 1,000 posts per day, with about 100 users active per day.  I have seen people discussing having 1 GB RAM for a phpBB 2 community of 5,000 users, but that is, of course, a bit old. Any ideas?

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?