I have this code snipped which I use for input validation:  public void validaUserID(FacesContext context, UIComponent component, Object value) throws ValidatorException, SQLException {          int findAccount = 0;          if (ds == null) {             throw new SQLException("Can't get data source");         }         // Initialize a connection to Oracle         Connection conn = ds.getConnection();          if (conn == null) {             throw new SQLException("Can't get database connection");         }          // Convert Object into String         int findValue = Integer.parseInt(value.toString());           // With SQL statement get all settings and values         PreparedStatement ps = conn.prepareStatement("SELECT * from USERS where USERID = ?");         ps.setInt(1, findValue);         try {             //get data from database                     ResultSet result = ps.executeQuery();             while (result.next()) {                 // Put the the data from Oracle into Hash Map                 findAccount = result.getInt("USERID");             }         } finally {             ps.close();             conn.close();         }          // Compare the value from the user input and the Oracle data         if (value.equals(findAccount)) {             throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,                     value + " Session ID is already in use!", null));         }     }   For some reason the input data is not compared properly with the value in Oracle. What is the proper way to compare the two values?


Yesterday I encountered (and failed) a .   I re-read the post, found that I disagreed with the audit result and clicked I Understand to continue reviewing. I opened the review today, to take a second look but the page just tells me "answer not found".  Whether there was an audit or not - I like to go over my reviews again some time later and see what others made of them (especially in the suggested-edits queue) or if I see them differently by then. For audits based on deleted posts that is not possible.  So here's the feature request: Please show the subject of review audits as it has been displayed when audited, even if the post in question has by now been deleted.  NB: This topic came up now, because yesterday I disagreed with said audit - and would very much like to take a second look at the post again, to see if I still disagree or whether I now (with a good night's sleep in between) agree...

So moderators just got . Often, these bans are due to specific very bad reviews, like approving spam or non-answers. It will be common for us to give links to these bad reviews in the ban message that the reviewers will be presented with.  However, many of these reviewers lack the necessary reputation to see deleted posts. If we're banning someone from review for approving spam or non-answers, almost all of the time those posts will be deleted. If we give them links to the reviews they performed, they won't see the now-deleted posts that they approved, and won't have a chance to learn what they did wrong.  As examples of this, I had to actually take a screenshot to show the reviewers  and  the posts that triggered their ban, because they could no longer see them.  I propose that reviewers of any reputation level be able to see posts that they reviewed, even ones that were later deleted, if they are presented with a link to their review. They already saw the post once, so there's no harm in showing it to them again, and reviewers are going to need to see why they made a bad call on a particular review.


Let $A,B\in \mathbf{R}^{3\times 3}$. Let $A$ have 3 distinct eigenvalues $\lambda_1$, $\lambda_2$, $\lambda_3$ with corresponding eigenspaces $E_{\lambda_1}$, $E_{\lambda_2}$, $E_{\lambda_3}$. Let $B$ have 2 distinct eigenvalues $\mu_1$, $\mu_2$ with corresponding eigenspaces $E_{\mu_1}=\operatorname{span}(E_{\lambda_1}+E_{\lambda_2})$ and $E_{\mu_2}=E_{\lambda_3}$. (a) Determine the eigenvalues and eigenvectors of $AB$. (b) Prove that $AB=BA$.  I don't understand what my book means by "$\operatorname{span}(E_{\lambda_1}+E_{\lambda_2})$", is this simply the sum $E_{\lambda_1}+E_{\lambda_2}$ or something more complicated? For part (a). I took a vector $v\in E_{\mu_2}$, then $v\in E_{\lambda_3}$ so $(AB)v=A(Bv)=A(\mu_2 v)=\mu_2 AV=\mu_2 \lambda_3 v$ so $\lambda_3 \mu_2$ is an eigenvalue (corresponding to eigenvector $v\in E_{\mu_2}=E_{\lambda_3}$?). Similarly, take a vector $E_{\lambda_1}$, then (about this step I am not sure) $w\in E_{\mu_1}$. Therefore $(AB)w=A(Bw)=A(\mu_1 w)=\mu_1 (Aw)=\mu_1\lambda_1 w$ so $\lambda_1 \mu_1$ is an eigenvalue (corresponding to what eigenvector? Since $w$ must lie in $E_{\lambda_1}$ and $E_{\mu_1}$ I would say $E_{\lambda_1} \cap E_{\mu_1}$, but is this correct? For part (b), I know that simultaneously diagonalizable matrices commute, so I need to show that $A$ and $B$ have the same basis of eigenvectors, which again is trivial if I know what my book means by the $\operatorname{span}$-thing.

Problem: Consider two matrices $A, B \in \mathbb{R}^{3 \times 3}$. Suppose $A$ has three distinct real eigenvalues $\lambda_1, \lambda_2$ and $\lambda_3$ with respective eigenspaces $E_{\lambda_1}, E_{\lambda_2}$ and $E_{\lambda_3}$. Suppose furthermore that $B$ has two distinct real eigenvalues $\mu_1$ and $\mu_2$ with respective eigenspaces $E_{\mu_1} = \text{span}(E_{\lambda_1}, E_{\lambda_2})$ (the space spanned by $E_{\lambda_1}$ and $E_{\lambda_2}$) and $E_{\mu_2} = E_{\lambda_3}$.  1) Determine the eigenvalues and corresponding eigenspaces of $AB$.  2) Show that $AB = BA$.   Attempt at solution: I have no idea how to do this. I tried writing $\det(A - x \mathbb{I}_3) = (-1)^3 (x- \lambda_1) (x- \lambda_2) (x- \lambda_3)$ and then using the fact that $\det(AB) = \det(A) \det(B)$. But then I figured that the characteristic equation doesn't necessarily have to split like that ?


i recently downloaded linkedin learning app on bluestacks.  i cant find the the courses i downloaded in that app. where is the save file location of linkedlearning app. There is nothing on shared folder

Where does BlueStacks install my apps and where does it store the data (e.g. saved game files) for those apps?


I'm trying to restart Apache 2:  sudo service apache2 restart   But get the below error:  * Restarting web server apache2   AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1.  Set the 'ServerName' directive globally to suppress this message   I've tried to change   sudo gedit /etc/apache2/httpd.conf   A blank file appears, and I'd added this:  ServerName localhost   But that error doesn't disappear!  How can I fix this problem?

When I restart my Apache server using the command  sudo /etc/init.d/apache2 restart   I get the following error:  Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName   Is the server using 127.0.1.1 instead of 127.0.0.1? What causes this error?


Here is my basic setup:  ArrayList<String> myList = new ArrayList<>(); myList.add("test"); String[] arr = myList.toArray(new String[myList.size()]); System.out.println(arr);   And i get the classic error: [Ljava.lang.String;@1540e19d  Can anyone explain and help me fix it?

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


I have data like the following:  apple pear sugar pizza pizza chicken pasta turkey   I want to grep for "pizza" but only grep the fourth column. I know i can use:  awk '$4 == "pizza"'    However i have a variable named food which contains the word pizza. When i do  food=pizza awk '$4 == "$food"'   I receive an error and also when i change to double apostrophes i receive this error:  awk: line 1: syntax error at or near ==   how can i achieve this?

Possible Duplicate:          I have a script, in which a script snippet is  x=3 awk '$2=$x{print $1}' infile   the external variable is x,  but it prompts an error in awk  so in this situation,how to make awk run successfully?  thanks!


Is $g \circ f$ invertible if both $f$ and $g$ are invertible?.  I know that $f: A \rightarrow B$ and $g: B \rightarrow C$.   This is what I have so far:   If $f$ is invertible, $f^{-1} : B \rightarrow A$, $f^{-1} \circ f = id_A$. And if $g$ is invertible,  $g^{-1} : C \rightarrow B$, $g^{-1} \circ g = id_B$.  Given all of this information, however, I am not sure how this proves that $g \circ f$ is invertible.

Suppose we have functions $f:A→B$ and $g:B→C$. Prove that if $f$ and $g$ are invertible, then so is $g \circ f$. Is the converse true? I.e., if $g \circ f$ is invertible, does it follow that $f$ and $g$ are both invertible?  I know that if $f$ and $g$ are invertible, then they are both injective and surjective. Therefore, I assume from this that I have to show $g \circ f$ is injective and surjective as well, thus proving it is invertible. However, I don't know how to show $g \circ f$ is bijective based only on the information I have.


I’ve joined a writer’s forum that has critiquing workshops, and I’m merrily participating.  Some of the work is really good.  But I keep running across usages of the word “whilst”, which to me is old fashioned and outdated.  Many of the posters there have English as a second (or third) language, and are (sometimes clearly) using translation engines to post their work for review.  Before commenting on their use of whilst, I thought I’d check to make sure I am correct.  So...  Is whilst proper English, as in, “...whilst snow fell gently outside her window”?  Is while a more appropriate word here?  If it is proper, is it still in common use in other countries (other than the U.S.), or is it old fashioned and outdated for English everywhere?

Possible Duplicate:          In terms of construction of sentences, can the two words while and whilst be used interchangeably?


I'm sure this is well-known, but it is weirdly difficult to find information on this topic. Some functors have a left-adjoint which itself has a left-adjoint. Consider the forgetful functor $$U : \mathbf{CMon} \leftarrow \mathbf{Ab}.$$ This has both a left adjoint $L$ (the free Abelian group on a commutative monoid) and a right-adjoint $R$ (the Abelian group of units). So we have $L \dashv U \dashv R$, hence $R$ has a left-adjoint that has a left-adjoint. What I want to know is, can this kind of thing go on forever? More precisely can we ever have an infinite sequence of left-adjoints, like: $$\ldots F_2 \dashv F_1 \dashv F_0$$ without any of the adjunctions being equivalences? If so, can we also make all the $F_i$ non-isomorphic? Other things I'd like to know:  How about two-sided sequences? $$\ldots F_2 \dashv F_1 \dashv F_0 \dashv F_{-1} \dashv F_{-2} \dashv \ldots$$ Can this happen with none of the adjunctions being equivalences, such that all the $F_i$ distinct?  Can all this behaviour still occur if the domain and codomain of $F_0$ are posets?   Also, please comment if you know of a notation for the $n$th left-adjoint of a functor.

Suppose we have (some categories and some functors such that) $F_1$ is left adjoint to $G_1$, $G_1$ left adjoint to $F_2$, $F_2$ left adjoint to $G_2$. Will $F_1$ then be equal to $F_2$ (and $G_1$ to $G_2$)?  Or can there exist arbitrarily long 'chains' of adjoint functors that do not trivialize?


This question is similar to a , but it's different. Background: On  we currently have problems with good questions being closed "too fast" / "too rigorously" or just "against community majority" As soon as a question gets a single close-vote it's almost guaranteed to get closed sooner or later. That in itself is not problematic. But now comes the problematic thing: Some of these questions gain "Leave Open" votes. and not one or maybe two, but four or five. Even then they will get closed, and this is IMO not desirable. A simple example: The question  has 23 upvotes. This is exceptionally much for . It is currently running through the close-vote-queue as "primarily opinion based". There are overall 4 close votes (2 via review queue, 1 the initial, 1 at the post itself), and 6 leave open votes. Also notable is, that when the question entered the queue it got 4 leave open votes, before any close-votes were added.  On the mentioned previous request,   Close vote is action made on the question itself, not always through the review system. Leave Open is review only action which was intended from the beginning only to remove the item from review  If I understand that correctly, the Item should be removed from the close-vote queue and have all current close-votes purged. Did I understand the purpose of close-votes correctly? What is the threshold for LeaveOpen Votes to clear the review item? Do leave-open votes clear the review item at all? EDIT: rereading the  it seems that  This did not happen here, why?

I've noticed and used the new (at least for me) button Leave Open, but I can't find any explanation as to the implication of clicking it.  I've found a highly voted  question:       ...How about, as soon as there's one vote to close, there should be an option to counter the close vote, something like "vote not to close" or whatever. This would then bring the "Vote to close" number down by one.   Is this that is happening? Or something else?    By reading the FAQ, there's no mention to this new action... so I'm assuming that an update is coming to the last paragraph of :     Users with 3000 reputation can cast up to 50 close votes per day. When a question reaches 5 close votes, it is marked as closed, and will no longer accept answers. Closed questions may be opened by casting reopen votes in the same manner. However, you may only vote to close or reopen a question once.


I Google and tried all sorts, I rebooted and held shift, I tried the crtl alt f1. Just boots right to the black screen with flashing underscore. Please help. It's a driver issue since I tried to install geforce experience

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


Would someone please tell me how I can sort this kind of JSON Array by the "name" in ascending alphabetical order?  {     "response": {         "game_count": 86,         "games": [             "10": {                 "appid": 10,                 "name": "Counter-Strike",                 "playtime_forever": 7604,                 "img_icon_url": "6b0312cda02f5f777efa2f3318c307ff9acafbb5",                 "img_logo_url": "af890f848dd606ac2fd4415de3c3f5e7a66fcb9f",                 "has_community_visible_stats": true             },             "80": {                 "appid": 80,                 "name": "Counter-Strike: Condition Zero",                 "playtime_forever": 62,                 "img_icon_url": "077b050ef3e89cd84e2c5a575d78d53b54058236",                 "img_logo_url": "acdb28ba1b4c2fcc526332c1b63fc0f7533f087f"             },                 .                 .                 .             ]      } }

I have CSV data loaded into a multidimensional array. In this way each "row" is a record and each "column" contains the same type of data.  I am using the function below to load my CSV file.  function f_parse_csv($file, $longest, $delimiter) {   $mdarray = array();   $file    = fopen($file, "r");   while ($line = fgetcsv($file, $longest, $delimiter))   {     array_push($mdarray, $line);   }   fclose($file);   return $mdarray; }   I need to be able to specify a column to sort so that it rearranges the rows.  One of the columns contains date information in the format of Y-m-d H:i:s and I would like to be able to sort with the most recent date being the first row.


When you hear the phrase “Try and act”, How do you paraphrase it? Is this expression common among native speakers?

In written and standard semi-formal (and above) spoken English, one would use "try to":  Try to be a better person. Try to get the fishhook out of my thumb, please. Try to find a pharmacy when you need one.  But in spoken English, we (Americans, at least) usually substitute "try and" for all those cases. "Try to" makes sense because the "to" begins the construction of an infinitive: "try to be", "try to do", "try to act" and so on. "Try and" on the other hand doesn't seem to make any sense. I'm curious how the "try and" crept in, and when. It's really tough to Google small words like these, so I'm not finding anything on the Web. Is it a contraction of something like "Try hard, and ..."? Note: I've seen  and it is somewhat related but doesn't tell me what I want to know. Edit Observe how, even on this site,  construction. Turning it on its head Note that you can't make a negative construction with "try and":  It's raining. Try not to get wet. It's raining. Try not and get wet. [?]  Even adding do doesn't help. The following means something different from "try not to get wet."  It's raining. Don't try and get wet.  Even use of to instead of and there means something else:  It's raining. Don't try to get wet.  "Try not to get wet" means try to stay dry. "Don't try to get wet" means avoid actively seeking out a soaking, and implies that a soaking might in fact be what you are looking for. MORE I just happened to notice a video from an editor for Merriam-Webster on this very topic, so I include the link here: .


I am writing code to execute two functions with the same name. I am using two different approaches:  Method1: with storing function in var   <!DOCTYPE html>
I am div1.

I am div2.
            Method2: using simple function    <!DOCTYPE html>
I am div1.

I am div2.
               Why does method1 execute both functions while method2 does not.

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other?


As I understand it, class features only apply to spells you gained through that class. For example, I can't use the Distant Spell metamagic on, say, Cure Wounds, if I gained Cure Wounds from being a Bard. Am I correct in this?  Speaking as both a player and DM here. I wanna know what I can build around.

Can a multiclass sorcerer/cleric use the Metamagic class ability with non-sorcerer spells? For example, using Twinned Spell when casting cure wounds to heal two creatures instead of just one?


Suppose i have pdf files a.pdf it will shows PDF document, version 1.5. How do file command know it?

As the question goes, how does Ubuntu know what file type a file without extension is?  When I save a file as "Untitled Document" without any extension, how does it know? Same thing for video and music formats...


I have read a bunch on closures, and for the most part understand the basic concept. That said, can someone explain the following snippet of code as far as where the closures are created and what the difference between returning a function and returning an object.      return function () {         var topics = {};          return {             subscribe: function (topic, listener) {                 if (listener && typeof (listener) === 'function') {                     topics[topic] = topics[topic] || { queue: [] };                 }                  var index = topics[topic].queue.push(listener) - 1;                  return (function (topic, index) {                     return {                         remove: function () {                             delete topics[topic].queue[index];                         }                     }                 })(topic, index);             },             publish: function (topic, info) {                 if (!topics[topic] || !topics[topic].queue.length) return;                  angular.forEach(topics[topic].queue, function (listener) {                     listener.apply(this, info);                 });             }         };     };

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


The Android app is failing to load the feed. Individual site question lists work fine along with questions but the feed just shows white and on a pull to refresh it shows a red popup error saying it failed to load the feed.   App Version: 1.0.95 Device Manufacturer: Google Device Model: Pixel 3 OS Version: 10 (6084386)

Recently upgraded to a Samsung S10e and Android 10, but all Q&A in the Stack Exchange app v1.0.95 are blank.  The title and comments are visible, but question/answer posts are just white space. Accessing the About page in the app is also blank.  I tried clearing data, cache and re-installing the app, but I still get the same behaviour.


I have a small problem with the \column command in the beamer class.   Up to now, it has worked perfectly but somehow a problem with the spacing has appeared.  \documentclass{beamer}  \begin{document}  \begin{frame}[fragile]  \frametitle{Argumente}  \begin{columns}[c] % The "c" option specifies centered vertical alignment while the "t" option is used for top vertical alignment      \column{.45\textwidth} % Left column and width     \centering \textbf{Pro}     \vspace{0.2cm}      \begin{itemize}         \item Vergleichbarkeit mehrerer Studien gewährleistet         \item Entscheidungshilfen für gesundheitspolitische Fragen         \item Überblick über Forschungslage     \end{itemize}      \column{.45\textwidth} % Right column and width     \centering \textbf{Kontra}     \vspace{0.2cm}      \begin{itemize}              \item \enquote{Äpfel-Birnen Problem}         \item \enquote{Garbage in - garbage out}         \item \emph{Publication bias}            \end{itemize}  \end{columns}  \end{frame}  \end {document}   It looks like this. I think the problem is quite obvious. I would like to make the "Pro" and the "Kontra" as well as the items appear in one line    Thank you very much for your help.   Helena

I'm trying present two concepts side by side in a frame. And I want each lineitem to be vertically aligned. Here is is an example where they are not aligned.  \begin{frame}{An Example of using columns in beamer}  \begin{columns}  \begin{column}{0.48\textwidth} \color{red}\rule{\linewidth}{4pt} foo \begin{itemize} \item this is line 1 of foo \item this is line 2 of foo which is long \item this is line 3 of foo \end{itemize} \end{column}  \begin{column}{0.48\textwidth} \color{blue}\rule{\linewidth}{4pt} bar \begin{itemize} \item this is line 1 of bar \item this is line 2 of bar \item need this line to be aligned with line 3 of foo \end{itemize} \end{column}  \end{columns}  \end{frame}


I need to find a nonlinear function $f:\mathbb{R}^2\rightarrow\mathbb{R}^2$ such that $f(\alpha (a,b))=\alpha f(a,b)$ for all $(a,b)\in\mathbb{R}^2$ and $\alpha\in\mathbb{R}$. I can't find anything. Context The requirement $f(\alpha (a,b))=\alpha f(a,b)$ says that $f$ respects the scalar multiplication, just as linear maps do. In particular, $f$ is homogeneous of degree $1$. To make it nonlinear, one has to somehow destroy the additive property $f(a+c,b+d)=f(a,b)+f(c,d)$.

Give an example of a function $f:\mathbb{R}^2 \mapsto \mathbb{R}^2$ such that $f(av) = af(v)$ for all $a \in \mathbb{R}$ and all $v \in \mathbb{R}^2$ but $f$ is not linear.   Basically, we need to find a function that adheres to the linear property of Homogeneity (closure under scalar multiplication) but not the linear property of Additivity (closure under vector addition). I'm having difficulties coming up with such a function as I can't find one that has the homogeneity property but not the Additivity property. I've tried polynomials in $P(\mathbb{R^2})$, trigonometric functions, etc. and none of them seem to work. My other guess is a piecewise function, but I'm not entirely sure.


The problem is this: I would like in a group of people to easily arrange and move them around such that every pair comes together exactly once, without any repetitions. I'm looking for all combinations, not all permutations. This should work for both even and odd numbers of people.  I'm looking for a solution that works physically for a group, such that people can be moved around in a consistent way - not a way to generate a list of all combinations.  I have read the solution in the below linked thread, but having experimented with this in a spreadsheet, I can only make it work for an even number of people.  I didn't comment on that thread because I'm new here and I'm not allowed to yet. I would deeply appreciate any help.

Given a list of people:  [   1,   2,   3,   4,   5,   6 ]   The goal is to generate some number of lists of pairs.  [   [     [1,2],     [3,4],     [5,6]   ],   [     [2,3],     [4,5],     [6,1]   ],   [     [3,1],     [5,2],     [4,6]   ],   [     [2,6],     [3,5],     [4,1]   ],   [     [4,2],     [5,1],     [3,6]   ] ]   Each list of pairs represents the schedule for that week. Each pair represents the people who should meet with that week.  In the example above, in the first week, persons 1 & 2, 3 & 4, 5 & 6 will meet. In the second week, persons 2 & 3, 4 & 5, 6 & 1 will meet and so on until everyone has meet with each other.  After some experimenting, it appears that for a list of n people, if n is even, there will be n - 1 lists of pairs. If n is odd, there will be n lists of pairs and one person will have a bye week where they don't meet with anyone.  Is there an algorithm to generate this list of pairs given a list of people?


I have a tire -standard 25 mm.  Normally I get tubes  700x20/25c which is what I ordered, but received 700x18x25c   will they fit and be ok?

When it comes to fixing bikes, i'm not to crash-hot. I can clean grime, oil the chain and put it back on if it falls off. However, when it comes to the inner tubes I usually rely on someone else to get me another tube and put it on for me (I can put them on, but in that sense I'm too lazy). So, today, when I went to pump up the tyres I found they had a puncture and I would prefer to change them as I haven't ridden this bike in a LONG time, only I'm not sure if there has to be a certain size tube. Help? Please? :)


When compiling my document I get the following warning message:  Badbox line 1: Overfull \vbox (1.77525pt too high) has occurred while \output is active []   Now from Google I learned that this warning refers to a formatting problem while Latex is adding headers and footers. Therefore I guess the reference to "line 1" in the warning message does not help me in finding what causes the problem. The first line in my document looks like this:  \documentclass[a4paper,oneside]{report}   So my question is this: How can I find what part of my document causes this warning, given the message shown above?

Often, TeX outputs underfull hbox and vbox warnings when running and in the generated log file. What are these and how can I get rid of them?


Consider $Z=(Z_1,\ldots,Z_n)^T\sim N(\mu,V)$ with $\mu=(\mu_1,\ldots,\mu_n)^T$ and $V=\text{Cov}(Z)$. Show that for $d\in\mathbb{R}^n$ it is      $$ d^TZ\sim N(d^T\mu,d^TVd). $$      For me it is not clear how to show that $d^TZ$ is multivariate normal distributed. If that would be the case then because of $$ E(d^TZ)=d^TE(Z)=d^T\mu $$ and $$ \text{Cov}(d^TZ)=d^T\text{Cov}(Z)(d^T)^T=d^T\text{Cov}(Z)d $$ everything would be shown.    I've read that $d^TZ$ is multivariate normal distributed exactly then when for each $b\in\mathbb{R}$  $$ bd^TZ $$ is univariate normal distributed.  So I choose an arbitrary $b\in\mathbb{R}$ and would have to show that $$ bd^TZ=\sum_{i=1}^{n}bd_iZ_i~~~(*) $$ is univariate normal distributed. If the $Z_i$ were independent then it would be clear because a linear combination of independent univariate normal distributed random variables is itself univariate normal distributed.  But here the $Z_i$ are not independent, what to do now to show that (*) is univariate normal distributed?

Consider $Z=(Z_1,\ldots,Z_n)^T\sim N(\mu,V)$. Show:          If $a\in\mathbb{R}^m$ and $A$ is a $(m\times n)$-matrix with $\text{rang}(A)=m$ then     $$ Y=a+AZ\sim N(a+A\mu,AVA^T). $$      My questions is, what do I have to show for this?  I think I have to show that $Y$ has the density function $$ f(Y)=(2\pi)^{-m/2}\text{det}(AVA^T)^{-1/2}\exp\left\{-\frac{1}{2}(Y-(a+A\mu))^T(AVA^T)^{-1}(Y-(a+A\mu)\right\}. $$  But how can I show that? Don't know how to start.


I am trying to remember a title for a very large older book that featured among other things a dying race of very tall, graceful people living on a desert planet. They live in a spire and have a matriarchal society.   I remember them dressing all in black and using swords.   Other points I remember:   They leave the planet at some point (I think). They find ruins of their race that are very, very old. Main character also seemed to be a slightly rebellious young man.   I'll try and update if I remember anything else.

The aliens in this book are an humanoid alien mercenary race, fighting for some other aliens, against humans?.   The Ker are the fighters, the sen are the wise ones, and the kaa the family/non-fighters.  Their clan gets almost wiped out because both their employers and humanity fear them, and the last survivors head towards their race' home planet, together with a human captive, who learns about their ways.  The other aliens are some blob-like aliens with little genetic variety.  Ring any bells?


Is $$\dfrac{x^2 + 2x}{x}$$ a polynomial?

Is $\frac{x^2+x}{x+1}$ a polynomial?  Fist question can be: on which field/ring or etc? In basic, let's take over $\mathbb R$.  Actually, it is $x$ if $x \ne -1$.  Can we say again it is a polynomial, or a near-polynomial or what?   Can we say it is a polynomial over $\mathbb R - \{-1\}$? But there is structure here for $\mathbb R-\{-1\}$.  This question can be academically, not sure, but I want to ask it in the level of primary school, then academically.


I was trying to clone a deep object in Angular and started by using this: const newObj = { ...oldObj }  But I noticed that when I changed a property of newObj, oldObj was also updated, so I assume the clone was not done but in fact I was just passing a reference. I than changed to this: const newObj = JSON.parse(JSON.stringify(oldObj))  And it worked as I wanted. When a property of newObj was changed, nothing changed in oldObj. I thought the deconstruct method of cloning returned a new object, is it really a reference? Thanks.

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists.


Is the word "on" pronounced like /ʌn/ or /ən/ instead of /ɔn/ when it is unstressed in an American accent?

I am confused at whether or not there is a weak form at preposition's 'ON'. I've checked at some dictionaries at Cambridge and Oxford dictionary, they don't mention on the weak form's pronunciation. However, I, am a Japanese, checked at English-Japanese dictionaries, they mention on the weak form as /ən/.  For example, is there the difference of pronunciation between 'It goes on' and 'There is an apple on the table' in connected speech?  Does it exist?  Thanks Yuichi  *It's Edited


(base) ali@aliskunk:~$ sudo apt upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable Setting up grub-pc (2.04-1ubuntu26.2) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another p rocess: Resource temporarily unavailable dpkg: error processing package grub-pc (--configure):  installed grub-pc package post-installation script subprocess returned error ex it status 1 dpkg: dependency problems prevent configuration of grub-gfxpayload-lists:  grub-gfxpayload-lists depends on grub-pc (>= 1.99~20101210-1ubuntu2); however:   Package grub-pc is not configured yet.  dpkg: error processing package grub-gfxpayload-lists (--configure):  dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup erro r from a previous failure.                           Errors were encountered while processing:  grub-pc  grub-gfxpayload-lists E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm trying to install the flashybrid but when I enter the apt-get install flashybrid command, I get this error:  root@user-desktop:/home/user# apt-get install flashybrid Reading package lists... Done Building dependency tree Reading state information... Done flashybrid is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0B of additional disk space will be used. debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable Setting up flashybrid (0.15+nmu2) ... debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable dpkg: error processing flashybrid (--configure): subprocess post-installation script returned error exit status 1 Errors were encountered while processing: flashybrid E: Sub-process /usr/bin/dpkg returned an error code (1)   I also tried this one to find what is already using that file:  root@user-desktop:/home/user# lsof | grep /var/cache/debconf/config.dat lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/user/.gvfs Output information may be incomplete. dpkg-prec 4672 root 4rW REG 8,6 39658 1697827 /var/cache/debconf/config.dat   But I don't know how to fix this.


Hey guys so I have a form with two text inputs, when users fill it in, the data is inserted to a database like this..  $sql = "INSERT INTO $user (note_name, note_body, creation_date)         VALUES ('$name','$note','$date')";   However I am having a problem where when an apostrophe is entered as part of the text input, I get "Error in SQL syntax".. I believe that it is taking the apostrophe as part of the SQL query, right? So say if I enter "Bob's Computer" for the $note variable, the apostrophe in "Bob's" is closing of the apostrophe's around the variable?   Is there any way to resolve this?

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


When using Forest package to chart an organizational structure, I have to limit it to 4-5 hierarchy levels, as both pdflatex or lualatex throw an error ! TeX capacity exceeded, sorry [save size=50000].  The forest that fails contains approximately 500-600 nodes. There is only one forest per file.  I already tried to increase MikTex 2.9 (updated to the current) main memory by running  initexmf --edit-config-file=pdflatex initexmf --dump=pdflatex    but the error is still there and the number 50,000 in the error message is still the same. Is there a similar INI file for lualatex?  Q: Are there any other methods that would allow to increase memory utilization allowed for pdflatex or lualatex? When they run, they do not exceed 43 MB and 75 MB respectively before they exit with the error.  I am not providing an MWE yet as 1) I would have to scramble data and it would become hard to read, and 2) it is unlikely anyone here is prepared to spend time sifting thru 500 nodes anyhow. Open to suggestions!  One of the answers here suggested a workaround of including  \tikzset{external/system call= {pdflatex -save-size=800000                                 -pool-size=10000000                                 -extra-mem-top=50000000                                 -extra-mem-bot=10000000                                 -main-memory=90000000                                 \tikzexternalcheckshellescape                                 -halt-on-error                                 -interaction=batchmode                                -jobname "\image" "\texsource"}}    but the error is still there.  Also tried to use command line option --extra-mem-top=2000000 with no success.

I asked  almost a year ago but did not have much luck. MikTex's PDFLaTeX has been updated since, but the error is still there:  ! TeX capacity exceeded, sorry [save size=50000].   Full source code at   Error log:   Same error with LuaLatex.  Hopefully this time some will be able to shed light on the limitation, why is it in place and what can be done to increase the amount of memory available to compilation.


Prove that the polynomial $z^4+z+1,~z \in \mathbb C$ has exactly two zeros in the right half plane. I couldn't implement Rouche's theorem using $f(z)=z^4,~g(z)=z+1$. Any other techniques using factorization etc.?

Consider the complex polynomial $p(z) = z^4+z+1$. I want to check that this polynomial has exactly one zero in each quadrant of $\Bbb C$. I do not want to solve the equation $z^4+z+1 = 0$ (as I strongly believe that's overkill here).  Since the coefficients are real, $z$ being a zero implies that $\overline{z}$ is also a zero. I believe that the strategy is using Rouché's Theorem in some way. So far, I know that all the zeros are in $1/2 < |z|<2$. Trying to use Rouché in, for example, the curve that: joins $0$ to $2$ by a straight segment, then $2$ to $2i$  by a counterclockwise circular arc, and then goes down to $0$ again, seems complicated, as the dominating part of the polynomial can vary.  On the other hand, by the Argument Principle, I could analyze the integral of $p'(z)/p(z)$. But then I would have to tackle the integral: $$\frac{1}{2\pi i}\int_\gamma \frac{4z^3+1}{z^4+z+1}\,{\rm d}z.$$Maybe I just don't remember my calculus well and this integral is actually easy to deal with, but otherwise I'm  stuck. Can someone give me some ideas? Thanks.


I am trying to call the __init__() method in a superclass, where said method takes arguments, but it doesn't seem to be working. Please see the code below:  >>> class A:         def __init__(self, param1, param2):             self._var1 = param1             self._var2 = param2  >>> class B(A):         def __init__(self, param1, param2, param3):             super(B, self).__init__(param1, param2)             self._var3 = param3   >>> a = A("Hi", "Bob") >>> a._var1 'Hi' >>> a._var2 'Bob' >>>  >>> b = B("Hello", "There", "Bob")  Traceback (most recent call last):   File "<pyshell#74>", line 1, in <module>     b = B("Hello", "There", "Bob")   File "<pyshell#69>", line 3, in __init__     super(B, self).__init__(param1, param2) TypeError: must be type, not classobj >>>   I have never been able to get this to work. What am I doing wrong? I would ideally like to use super() over A.__init__(self, <parameters>), if this is a possibility (which it must be).

In Python 2.5, the following code raises a TypeError:  >>> class X:       def a(self):         print "a"  >>> class Y(X):       def a(self):         super(Y,self).a()         print "b"  >>> c = Y() >>> c.a() Traceback (most recent call last):   File "<stdin>", line 1, in <module>   File "<stdin>", line 3, in a TypeError: super() argument 1 must be type, not classobj   If I replace the class X with class X(object), it will work. What's the explanation for this?


I bought a Dell Inspiron 14 5000 with Windows 10 Home preinstalled on it, and would like to completely replace it with the latest version of Ubuntu. By doing this, will I have to worry about any sorts of missing drivers or anything (like the fingerprint reader) not working if I get rid of the preinstalled Windows 10 system?  If so, are there ways to remedy the situation?

I have a device on which I would like to install Ubuntu. How do I find out if Ubuntu will work on it?


My main goal is to build an app that send lat lon from my smartphone to my carto (postgis) database and show the route "live" (in real time) as a line and not as a lot of points.  i am able to save every 40 seconds lat and long in the database as point using SQL API  example:  Cartourl/user/myusername/api/v2/sql?q=INSERT INTO my_table (description, the_geom) VALUES ('myroute', ST_SetSRID(ST_Point(lat, lng),4326))&api_key=myapykey   now i think i have to use ST_MakeLine to obtain a line from points. but can i do this every time that i submit a point? has to be done before? which query i have to use?  or i can do something like:  Cartourl/user/myusername/api/v2/sql?q=INSERT INTO my_table (description, the_geom) VALUES ('myroute', ST_SetSRID(ST_MakeLine(lat, lng),4326))&api_key=myapykey   or  SELECT   ST_MakeLine(the_geom_webmercator ORDER BY ST_X(the_geom), ST_Y(the_geom) ASC) as the_geom_webmercator,   min(cartodb_id) as cartodb_id FROM   my_table

Hi have a database from one app that was used to register travels made by the staff. The recorded rows looks like:   travel id (#) leg id (#) leg departure (date time and city) leg arrival (date time and city) staff member info other aggregable fields like the method of transportation, flight no, etc.   What is the data modeling standards used to connect the dots correctly so trips could be grouped by members, from-to (bearing in mind that one trip could have connexions) and preserve an order so I can query the last trip (on the time-series bars) and determine that the member is currently on that city.


hello I am new in the field of forcasting time series, I am working on a project to predict the number of visitors hourly from sensors . I found an RMSE equal to 76 for a variable in values ranging from 0 minimum to 400 maximum can this rmse be considered a good result or not and how i can interpret it.           RMSE          MAE Sarima 76.094180    46.066214 Prophet 76.247419   46.120543 XGBoost 76.405984   46.193548  Thank you very much

Is there a rule or a scale for judging if a certain MSE is small, very small, big or very big? Please give also a source to underpin your recommendation.


I need to create a modal for html page. When a button on the page is clicked, the modals shows up. Button to close modal contains in the modal itself.  The problem is that click event on close button, that meant to remove a modal html from document, is not working. However, console.log assigned to the same event show up in console. Why is that happening and how to fix it?  Pen:   Js code:  $(document).ready(function(){   $('#showModal').on('click', function() {     $('.container').append(modalHtml)   })    $(document).on('click','#closeModal',function(){     console.log('click triggered')     $(document).remove('#modal')  })    var modalHtml = '

this is a modal
close

' })

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.


I know that thermally excited materials "act as atomic oscillators" which can oscillate in a continuous range of frequencies, producing light in said frequencies. But in my searches, the nature of the oscillators isn't clear.  Are these quantum harmonic oscillators (i.e. each atom is a quantum oscillator)? If so, how is the frequency distribution continuous? And why is the energy of quantum oscillation related at all to the thermal energy distribution (Boltzmann distribution)?  In summary, what's the exact mechanism by which blackbody radiation is produced?  side question: I've read about the Bose-Einstein distribution for the blackbody spectrum, but don't understand much. How does that fit in here?

By conservation of energy, the solid is left in a lower energy state following emission of a photon.  Clearly absorption and emission balance at thermal equilibrium, however, thermodynamic equilibrium is a statement of the mean behaviour of the system, not a statement that the internal energy is constant on arbitrarily short timescales.  The energy has to come from somewhere during emission, and go somewhere during absorption.  Energy in a solid can be stored as kinetic and potential energy of electrons and nuclei, either individually or in collective modes such as phonons and plasmons.  In thermal equilibrium energy will be stored more or less in various forms depending on the temperature and material.  However, even if most of the thermal energy in a particular solid at temperature $T$ is stored in the form of phonons, it could be that phonons primarily interact with light indirectly via electrons, e.g. a phonon excites an electron in a phonon-electron interaction, which can interact with light via the EM field.  Given that light is an EM field, it makes sense to me that it is emitted and absorbed by charged particles.  The electron-photon interaction is probably dominant for visible and ultraviolet light, given that metals are opaque, while semiconductors and insulators are transparent to (visible and UV) light with energy lower than their bandgap. However, once you get into energies in the IR and below, or X-rays and above, other mechanisms apparently take over.  For example, on the high-energy end of the spectrum I've heard that gamma rays can interact directly with nuclear degrees of freedom, which is reasonable considering that gamma rays are emitted during a lot of nuclear reactions.  A review of  might give clues to important light-matter interactions over a broad range of wavelengths.  Whether all of the these processes are involved in blackbody emission is a somewhat different question.  What physical processes mediate energy transfer during blackbody emission, and in which energy ranges are the various processes dominant?


In many of the questions asked here, people recommend the use of control versioning for the write-up LaTeX documents, especially for documents that are large, such as theses.  The issue with doing that is that in order for the traditional control versioning diff to be of any use, sentences must be broken into lines. Otherwise, diff doesn't really provide any insight as to what changed in the document and things get messy really fast.  The plan is for all my new documents to follow the "each-sentence-in-a-new-line" format. But I would like to start using control versioning for some of my existing (and large) documents.  I was wondering whether there's a tool that takes a .tex file as input and spits out a new .tex file in which the sentences are separated by a newline character. I am mainly interested in a UNIX tool, but the more portable, the better.  Note: The problem is not as simple as inserting a newline after every period unfortunately. For example, when the tool finds "e.g." in the text, it needs to be smart enough to avoid inserting a newline there. Or, more of an annoyance instead of a big issue, since the last character in a paragraph is very likely to be a period, it needs to avoid inserting an extra newline there. Maybe a tool that utilises the LaTeX internals to identify when a sentence has actually ended?

Is there something like indent for LaTeX? I have a collaborator that is using Scientific Workplace and the code it produces is totally messed up; I know I shouldn't expect miracles, but any machine support would be useful.  EDIT: This question is quite undefined without my comment to KeithB's answer; the idea is to save VC-friendly one sentence/one paragraph per text file line structure which SWT "fixes" by wrapping everything into fixed column width format.


Edit to explain difference between this question and "exact duplicate": The proposed question has many answers, and they are written only to answer a conceptual question. My question is conceptual in nature, but I also asked for specific answer on how to do something functionally. Also, as I do not know what pass-by-reference and pass-by-value mean, how could I understand an answer to a question that I also do not understand? The answers available on the other question are not accessible to a layman who does not know the correct vocabulary. Unfortunately, I know "how" to do a lot of things with Java because I have taught myself, but often do not know the "what" or "why". Answering my question in terms of vocabulary words that I do not understand does not help, and is akin to me reading a textbook (which I have tried), and renders the point of asking the question mute. If you cannot answer it in a manner which the uninitiated can understand, and are unwilling to do so, you are so much hot air and certainly no better than the textbook. Thank you for your consideration.  I was getting a bunch of NaNs in my matrices when doing some operations and decided to run through the NetBeans Debugger. I found the issue, and fixed it but would like to know why it was happening. Here is my original code for a method:  public static double[] row_scalar_mult(double scale, double[] row){     for(int i=0; i<row.length;i++){         row[i] = row[i]*scale;     }                  return row; }   What I found was that the row of the 2D array that I passed to this method got acted on directly, which was not the intent. I thought that the method was supposed to just make a copy of it or some such thing and use it without changing what it was given. I fixed it below:  public static double[] row_scalar_mult(double scale, double[] row){     double[] result = new double[row.length];      for(int i=0; i<row.length;i++){         result[i] = row[i]*scale;     }             return result; }   But I am curious about this happening conceptually, and if there is some simple way to declare a variable or a method that keeps the input of the method intact outside the method. Also, I'm sure there is terminology for all of what I'm saying, but I didn't know what words to use in the search. I hope this isn't a repeat.

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


Ubuntu 17.10 comes with Firefox as the default browser.    Attempting to  sudo apt-get install chromium   informs that it is not found in the repository.  Question:  How do I install Chromium (so I can use my Google login to synchronize bookmarks and extensions)?

I have already tried using the Ubuntu Software Center, but it won't install the Chromium browser. How can I install it using the terminal?


Can someone explain the outcome to the follow scenario:  Buyer A places a limit order to buy 100 shares at $8.00, Seller B places a sale limit order at 7.50 for 40 shares.  What price would Seller B receive for his shares?  I suspect $8.00, is that correct?  B was the last to place the order so I presume $8.00.  Whereas if the placement of the orders was reversed and B placed sale order at $7.50 and A placed a buy order at $8.00 that A would received 40 shares at $7.50.  Clarification anyone?

Say a security has been trading at under $20.10, and there are limit orders selling at $20.10 and $20.21. Then Simon issues a limit order to buy at $20.21. According to , Simon would end up buying shares at $20.10.  Why does the exchange favor the buyer here?  I.e., why does the transaction execute at the seller's limit of $20.10 instead of the buyer's limit of $20.21?  (I.e., why don't Inara/River get to sell at $20.21 / above their limit, but Simon gets to buy at $20.10 / below his limit?)  Is the example flawed?  If it makes a difference, I'm mainly curious about NASDAQ and NYSE.  I tried Googling for specs (e.g. ), but couldn't find anything.  Only found that some  implementation executes the average of the buy/ask.  Just curious how the system works.


For anyone familiar with  (a UK government web-based GIS) I can shortcut this question by saying that I'm looking for the equivalent of the identify tool. For others, this is a tool which produces a report identifying the value of all the properties of any polygon from all selected layers on a click of the mouse.  So, say I had three layers, one with counties (name, population, area), one with nature reserves (name, area, type of reserve) and one with habitat (type, rarity, conservation status). I would like to be able to click on a point on the map (or draw a polygon), and produce a report which would list all the features from all the layers under that point, together with their attributes.  I'm using QGIS 2.18, but soon 3.

I have recently migrated from ArcGIS to QGIS.  Is there any way to identify a feature having multiple layers? I am currently working with about 400 shape files and need to know which is the one I'm currently working on. When I click the polygon I want to identify with the identify tool nothing happens unless I have the layer selected in the layer panel. The same happens with the selection tool.  How can I fix this? In ArcGis I could identify any feature without having it selected on the layer list and I've looked through the settings of QGis and found nothing.


I am learning generalized linear mixed effects model, and today I realized that there are two ways to set random slope in lmer(), when dealing with data where same subjects are repeatedly measured.   fit1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy) fit2 <- lmer(Reaction ~ Days + (1|Days:Subject), sleepstudy)   Looking at the results, it seems like lmer() doing different things. How each command differs from each other, and which should I use and when?  Update: Thanks to Matteo Lisi's answer and to the earlier post , I now understand the mechanism that the lme4 package is doing. However, I am still having difficulty understanding WHEN should I use WHICH. I would appreciate if you could explain for what types of research designs I should use which syntax.   Is that something I can choose based on AIC? Or, I should choose the syntax based on the design of the research? Could you provide examples of research designs?

I have a repeated measures from clusters, over several years, and I expect the cluster effect to vary each year.  Year is coded as a factor, with '1' as reference level. I have tried the following:  mod1 <- lmer(y ~ x + year + (year|cluster))   and  mod2 <- lmer(y ~ x + year + (1|cluster:year))   My first example specifies the following random effects:  ranef(mod1) $cluster     (Intercept)  year2         year3        year4         year5 AA   0.03721015  0.0573160920 -0.114709171  0.1588302187  0.125329740 AB  -0.12958994 -0.0458997003  0.216455596  0.2345170893  0.248950509 AC  -5.10692972 -0.1311546328  1.130347798  2.5215580167  5.070106525 AD   0.10087455 -0.2677088515 -0.345583355 -0.2442831982 -0.257074662 ....   Second one specifies:  ranef(mod2) $`cluster:year`               (Intercept) AA:year2  0.0838186244 AA:year3 -0.1197284361 AA:year4  0.1944488619 AA:year5  0.1562090690   I assumed they would be equivalent, given year is a factor, but I must not understand the random effect specification of lme4 well enough. Can anyone help me understand the difference between the two parameterizations?


I found after searching that this question has been asked before. But all the answers were not convincing. Suppose I have a body which is free, not constrained always rotate about its center of mass (COM). Why is that so? A convincing answer that I found was that in most cases the moment of inertial about the center of mass is the least and that's why the body rotates about the center of mass. But I ask it again with hope of the question not getting closed and getting a better succinct answer. I was thinking that motion about the COM is the most stable one and the rotation about other points degenerates. I don't think it's right. Is it? —————————————————————————————————— Note-: 1). This question has been wrongly closed. The other questions linked don’t answer my question at all. It asks me to ask a new question if my question is still not resolved. I did make it clear that I am not satisfied with the answers in the linked questions. 2). The answer to this question is that a free body never rotates about its center of mass ( the instantaneous axis of rotation never passes through the center of mass). In fact we choose a point about which we want to decompose the motion into rotation and translation and we could very well have chosen any point other than the center of mass and analysed rotation about it. Moreover the instantaneous axis of rotation for a free body never passes through the center of mass. I would urge the moderators to give me the right to add my answer to this question. This is the correct answer, the one which satisfied me the most and it is nowhere in the linked answers. So kindly give me the right to open this question and let me add my answer to it.

If a sphere has a torque vector coming out of it at point A, would the sphere rotate about its center or the axis of the torque vector?


Observe the following three sentences.   I have a dog. The reason being dogs are fun.  I have a dog. The reason being is dogs are fun.  I have a dog. The reason is dogs are fun.    Even though I regularly hear sentences like 1 and 2, I do not understand why they are grammatically correct.

I have heard someone say in a conversation, "Well, my point being,,,". As an English learner, I was puzzled but assumed that it was roughly the same as saying "My point is that..." or "Here's my point:"   Even if my guess was right, the phrase strikes me as a bit odd. Can anyone elaborate on the meaning/usage/gramatical explanation of this phrase?


I have been trying to find cows in my world on Minecraft in survival mode and I can't find them anywhere. How do they spawn? Can I do anything to find them?

In what way do animals in Minecraft spawn? It looks to me that they spawn more during the night (but where there are torches) and more kind of around you / around some other human player. Am I right, or does it work some other way?  Thank you.


I have problem with configuring guake because when I try to open guake preferences it happening, but i don't know where. :(  Preferences are inaccessible, I can't get to them.  So there is my Q, is there any possible to open it in alternative way, or maybe set guake from terminal?

Just installed guake - terminal emulator.  How can I get to preferences to customize it?  I don't seem to have any if the normal menu's available.  I searched everything on their help site to no avail.  I use Ubuntu 11 (now Ubuntu 16 in 2016)


How can I prevent the mouse from entering a secondary monitor, in Windows 7?  I want to restrict mouse movement to be only within the primary monitor.  Ideally I would also like to prevent accidentally moving any windows to the second monitor, or shifting input focus to it in any way.  The second monitor should only be used to display the full-screen window of a specific application.  There does not need to be any way to interact with that application, and ideally there should be no way to do so accidentally.  How can I restrict the mouse to a single monitor?  (There is a related question for Linux , this question is about Windows 7)

I have 4 monitors, two of which are kiosks and are just playing looped powerpoints but the other two I need to have interactive. How can I limit my cursor movement to just monitors 1 an 2 an not allow any interaction with 3 and 4?


I've got the following code, which gets the first 3 posts. However, I am hoping to style each differently with if statements. But when I add if statements (to determine whether it is the first or second post), they are added, which on top of the first 3 posts: accidently creating 5 posts.  Is there a proper way to style the posts depending on whether they are first, second and third, but keep within the showposts => 3 attribute?      <?php      $lifestyle_cat = array(         'category_name' => 'lifestyle',         'showposts' => 3,         'post_type' => 'post',         'post_status' => 'publish',         'orderby' => 'date',         'order' => 'DESC'     );      $lifestyle_query = new WP_Query( $lifestyle_cat );     if ( $lifestyle_query->have_posts()) {         $i = 0;          while ( $lifestyle_query->have_posts()) {              $i++;             $lifestyle_query->the_post();                 if ($i==1) { // these are added and not within the 3 show posts                    ?>
 <?php  the_title();?>  i = 1
 <?php                 } elseif ($i==2) { // these are added and not within the 3 show posts                      ?>
 <?php  the_title();?>  i = 2
 <?php                 } ?>
<?php the_title(); ?>
  <?php } } else {         // no posts found     }      wp_reset_postdata(); ?>

I'm working on a WordPress site for my band and I'd like to mark every 3rd post on our blog page to have a special class applied to it, anybody have any pointers on how to achieve this? Any help is very very appreciated, thanks! rock n roll.


$g = \Delta v/t$, so $\Delta v = gt$. $v = v_0 + \Delta v$, so $v = v_0 + gt$. So if $\Delta x = vt$, then $\Delta x$ should be $v_0t + gt$. Why the $\tfrac{1}{2}gt^2$? I'm really confused, so this question is also probably very confusing. Sorry and thanks in advance!

I'm preparing for my exam, but I have difficulties in perceiving why there is a $\frac{1}{2}$ in the distance formula $d=\frac{1}{2}at^2$?


I am setting up a function that will close a dropdown menu when clicked outside. The function works as intended, however it throws a error.  I am not sure what is causing the error, considering that the function works as intended.  const userBtn = document.querySelector(".header-userbtn"); const userMenu = document.querySelector(".header-usermenu");  function hideOnClickOutside(element, button) {   if (!element.classList.contains("active")) {     return false;   }   const outsideClickListener = event => {     if (!element.contains(event.target)) {       button.click();       removeClickListener();     }   };    const removeClickListener = () => {     document.removeEventListener("click", outsideClickListener);   };    document.addEventListener("click", outsideClickListener); }  userBtn.addEventListener("click", function(e) {   const chevron = this.querySelector(".chevron-wht");    this.classList.toggle("active");   chevron.classList.toggle("active");   userMenu.classList.toggle("active");    e.stopPropagation();   document.addEventListener(             /*main.js:31 */     "click",     hideOnClickOutside(userMenu, userBtn)); });   Here is the Error Message. It triggers every time the menu closes, and the function is called from the click event.  main.js:31 Uncaught TypeError: Failed to execute 'addEventListener' on 'EventTarget': The callback provided as parameter 2 is not an object.     at HTMLButtonElement.<anonymous> (main.js:31)

The situation is somewhat like-  var someVar = some_other_function(); someObj.addEventListener("click", function(){     some_function(someVar); }, false);   The problem is that the value of someVar is not visible inside the listener function of the addEventListener, where it is probably being treated as a new variable.


I'm not very familliar with jQuery and it's functions.  Does anyone know what these declarations are doing? (Btw. they wrap the entire .js content)   (function ($) { 'use strict' ... })(jQuery);  (function () { 'use strict' ... })();   The second I guess, is a declaration of an anonymus function to not make variables inside accessable from outside.  I know there's a ready function that is called when the DOM was loaded.   $(function () { 'use strict' ... });   Though I can't figure out what the first 2 functions do.

I'm new to both JavaScript and . In YUI library examples, you can find many uses of this construct:  (function() {     var Dom = YAHOO.util.Dom,     Event = YAHOO.util.Event,     layout = null,         ... })();   I think the last couple of parentheses are to execute the function just after the declaration.  ... But what about the previous set of parentheses surrounding the function declaration?  I think it is a matter of scope; that's to hide inside variables to outside functions and possibly global objects. Is it? More generally, what are the mechanics of those parentheses?


I recall Gandalf instructing Frodo in the lore of the Ring, and he mentioned that the Nine, the Seven and the Three, each had its proper stone or gem, but not so The One. It was unadorned and round, like one of the lesser rings.  Is there any mention of the gems on the Nine and the Seven? I know about the Three Elven Rings.  In my opinion, this is not a duplicate, as the other question queries about the make and material used for the rings. The gemstones have been mentioned very particularly by Gandalf, as possibly one of the proofs towards establishing the authenticity of Frodo's ring and its significance,  and have been highlighted in the Elven rings. There has not been any mention of them in the literature commonly available.

"One Ring to rule them all"...  Is there any detail in Tolkien's work indicating what those "all" rings - for Men, Elves and Dwarves - were made of?  Mithril?  Platinum?  Gold?  Some other magical material?  I would expect that The One's material would be "superior" to the ones it ruled?  Related to "  "


I installed dual boot Ubuntu with Windows, but I have a problem with WiFi because it doesn't work. I tried to fix it but I wasn't successful. What should I do?

It worked with the pre-installed Ubuntu, but after re-installing Ubuntu dual-boot with Windows 8.1, the WiFi is not working.  Is there a driver for this adapter that will work on Ubuntu 12.04?


There are $17$ people in a room. Every two people are mutually   friends, enemies, or strangers. Prove there must be three people all   of whom have the same relationship.   I think this is a graph coloring problem. It is a problem from my book but I am struggling to solve it. I tried to do many things, like considering the chromatic polynomial of the graph. But I have had no luck. I am really not sure how to approach the problem and will appreciate any help

Also, Prove that every edge-coloring of $K_6$ with $2$ colors contains at least two monochromatic copies of $K_3.$ I have no idea how to start these problems. What should I do?


Please Help ,,,,  I'm download this file from server ,, but how it open and work ... (I'm New in ubuntu )   Kaspersky Internet Security.dmg

I'm trying to install a .dmg file to ubuntu 14.04 I was trying to following    And a couple of other threads on askubuntu.   The problem i'm facing are so :   In the eHow they use something called dmg2dmg. Ubuntu seems to have dmg2img. So I used that instead. After I create the .img file, I try to create a data disk using the .img in brasero. It gives me error saying unsupported format. What am I doing wrong? If I ignore step 2 and just rename .img file to .iso     I'm able to mount iso and open the files/folders.  However how to install the .dmg ?? How to install it as an application ???


I would like to split three letters such as WER into three independent letters. as follows:  W = array[0] E = array[1] R = array[2]   I tried the command   WER | cut -c1 but I could not save the new string W in a variable.  I tried   set var1 = WER | cut -c1 and it didn't work.

I want to split 'hello' into h e l l o in an array using only bash, I could do it in sed with sed 's/./& /g' but I want to know how to split a string into an array in Bash when I do not know what the delimiter would be, or the delimiter is any single character.  I don't think I can use ${i// /} without some creativity because the delimiter is an unknown, and I don't think that expression accepts regex.  I tried using BASH_REMATCH with [[ string =~ ([a-z].).* ]] but it doesn't work as I expected.  What is the proper way to use only bash to accomplish a string.split() type of behavior?  The reason is that I am trying to write the rev utility in all bash:    while read data; do   word=($(echo $data|tr ' ' '_'|sed 's/./& /g'))   new=()   i=$((${#word[@]} - 1))   while [[ $i -ge 0 ]]; do     new+=(${word[$i]})     (( i-- ))   done   echo ${new[@]}|tr -d ' '|tr '_' ' '   done   But I used tr and sed, I want to know how to do the split properly and then I will fix it to be all bash.  Just for fun.


How do I change camera to current view in Mac Laptop? I am trying to do what "Ctrl + Alt + Numpad 0" does on desktop version Thanks

I've just got into Blender, and I like it a lot. But as I just switched from a stationary computer to a MacBook, I've got some new problems regarding the numpad. I can use 1-9 perfectly, But I have no idea how to emulate buttons like / (used to enter local view). I've searched the web for an answer, but I can't find any.


I am unable to understand that how the moving charge produces magnetic field around itself. Some one has answered that any moving charge is without acceleration due to which it produce electric and magnetic field. I am confused that electric field is possessed by charge when it is in rest as well. Why does it  not posses magnetic field?

I'm tutoring high school students. I've always taught them that:     A charged particle moving without acceleration produces an electric as well as a magnetic field.   It produces an electric field because it's a charge particle. But when it is at rest, it doesn't produce a magnetic field. All of a sudden when it starts moving, it starts producing a magnetic field. Why? What happens to it when it starts moving? What makes it produce a magnetic field when it starts moving?


I bought some chestnuts last week. The package date said December 4th and I want to cook them. It's the 5th today. I kept them out on kitchen counter all week. Are they safe to cook and eat still?  If the chestnuts are safe to eat, how long do I keep them in oven to cook them? I have never cooked chestnuts before so I have no way to compare notes to how I cook chestnuts.

I bought some chestnuts in the fall for Christmas but haven't used them all yet. How long do they keep? How would I tell if they 'went bad'? They look just like they did when I bought them (no blemishes) but may weigh less (they seem light) and seem harder to the touch (but I may be misremembering).


Today, I was talking to my friend. She is very good at English. During this conversation, she said, "I am on THE bus". I think, she has misused the definite article. In my opinion, it should have been, "I am on A bus". Because this is the first time she said anything about this bus. On the other hand, I know that she generally travel by bus.

Example sentence:     I had a little time before the train came.   Would you please explain to me why it is correct to use "the" before "train"? My teacher told me that "the" is used before objects well-known to both speakers and that if a noun is used for the first time we shoud use "a".   But in this example the speaker uses "train" for the first time. Moreover we don't know about this train, so we must use "a train", not "the train". But it was a native speaker who said it; what exactly did he mean to say?


I'd like to iterate over the value of each entry in a c# dictionary within my asp.net repeater. My IDictionary is nothing special - Just key-value pairs of data, and the values are arrays of strings. I'm trying to create a form select element with materializecss (, see "Optgroups"). Currently, what I have is this:  ...
     <asp:Repeater runat="server" ID="optgroupSelect">         <HeaderTemplate>             <select>         </HeaderTemplate>         <ItemTemplate>             <optgroup label="<%# Eval("Key") %>">                 <%-- Here comes the problem --%>                 <%# foreach (string s in Eval("Value")) { %>                     <option value="<%=s.toLower()%>"><%=s%></option>                 <%# } %>             </optgroup>         </ItemTemplate>         <FooterTemplate>             </select>             Please select something         </FooterTemplate>     </asp:Repeater>
 ...   I've worked with PHP for the last couple years and feel that I'm missing the mindset of an asp.net dev - Still, I have to do this for work. Obviously, the above code does not work, but it highlights what I'd like to achieve. I've gone through the whole  list to maybe find a component which could iterate over the databound value array, but most of them have their own style which I don't want (since everything should match with materializecss). I appreciate any help towards solving this, thanks for taking your time!    Note: My pages are .aspx Web Forms in the Asp.net Framework 4.8

Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks


If an attacker had a padded message and its corresponding CBC-MAC tag, how would they construct another message which produces the same tag for the same key as the original? The padding scheme used in this scenario is to add 0's to the end of the message until is it a full block.   What about when the attacker has an non-padded message? How would they accomplish a similar attack and what conditions are needed for the message for the attack?

I'm trying to wrap my head around how different padding methods affect the strength of CBC-MAC's. Suppose a message is split into different blocks, m1, m2, m3 etc. and the last block is padded with 0's to fill it if needed.  If the message is intercepted, why can an attacker easily create another message with the same MAC tag for the same key as the message that was intercepted?  If another message is intercepted that does not contain any padding (so it completely fills the last block), how does this make it more difficult for the attacker to create a tag that matches? Does the message need to meet any conditions for the attack to work?  If this padding method is not secure, what is a better method to secure against these attacks? Would it be more secure if the padding was just random? Not sure how that would work.


I bought a new Dell Inspiron 14 which has Intel I7 processor.  I tried installing Ubuntu as 2nd OS by following this .  I followed all the steps such as partitioning the C drive and setting up the Boot configurations.  I do get the Ubuntu install screen. It proceeds normally till the screen after Wifi selection screen. On this screen it always says that "You need 8.6 GB space to install software and other updates, but you have only 8 GB available."  It never lets me select the space I freed up from C drive of the Windows.  Has anyone else faced this problem?  I checked other questions here, but they seem old and not relevant to my problem.  Thank you!  EDIT (image added):

I'd like to see the full How-To on how to use manual partitioning during Ubuntu installation. The existing guides (at least those I found here) cover only automatic part and leave untouched the manual part (or extremely short and contain no pictures).  I'd like to cover such situations:     If your disk contains other systems:


I've almost completed the main quest and I've done a few side quests, and now I'm level 24. I am trying to defeat Alduin but I can't pull it off. , so something else is wrong.  My strategy so far has been to send in followers to help me, but they don't die and I do. I have fast healing but I don't have enough mana to keep it up.  What am I doing wrong? What strategy works to defeat Alduin?

I am level 31 and I have the Elder Scroll. I am not sure if my level is high enough to go to Whiterun and trap one of Alduin's minions. What level should I be before I attempt it?


So the atmosphere scatters light on its way to earth, making the color of our sky. For example, when the sky is blue on a clear, sunny day, the sunlight appears somewhat yellow because the blue light has been scattered away. However, there is something about this that I do not understand. If certain colors are scattered away, why is there 99.5% of the time some white when you look at the sun (e.g. in pictures)? Even at red sunsets with reddish skies, the sun seems to be somewhat white - how can this happen if almost all the original colors/photons have been scattered away and thus the rest should not be able to constitute a whitish color?  Example:

I believe that white light is white because it contains every wavelength, as white by itself has no frequency by itself.  Can somebody explain why really bright pure red, green, or blue LEDs seem white to us and to cameras?  Also, can a bright light ever be pure(eg is it possible to emit a pure red/pure blue/pure green bright light only with wavelengths in the range of that light), or will the inherent brightness of a light force other wavelengths into the light?


i just have a ubuntu live cd for some critical situations... I have a vaio F11 and a win10 as OS on it,but  windows can't boot from HDD, so I tried to access files using ubuntu live,but it says:  Error mounting /dev/sda3 at /media/ubuntu/14FCB981FCB95E24: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=999,gid=999,dmask=0077,fmask=0177" "/dev/sda3" "/media/ubuntu/14FCB981FCB95E24"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda3': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.   now please help me on this,I have some important data on my HDD...show me if there is anyway to copy them on an external HDD.

Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux


let $ T \in K ( H ) $ be $ T \geqslant 0 $.   What is the best way to show the following statement?     There is a compact, positive and unique operator $ A$ so that $ A^{2} = T $.   ( K ( H ) defined compact operator)

Let H a Hilbert space and $T:H\rightarrow H$ a linear bounded, self-adjoint, positive and compact operator. How can i prove that the square root of T, $\ T^{1/2}:H\rightarrow H$ is also compact and self-adjoint; thanks.


What is the significance of the log base being 2 in entropy? What if we take e or 10 as the base?

is the negative of the sum of the probabilities of each outcome multiplied by the logarithm of probabilities for each outcome. What purpose does the logarithm serve in this equation?  An intuitive or visual answer (as opposed to a deeply mathematical answer) will be given bonus points!


I am trying to reproduce the attached picture: But I can't in any way figure out what the correct way to write text next to an equation is.  Is there a package for this?

I want     I have at the moment    by  \documentclass{article} \usepackage{amsmath} \begin{document} \begin{subequations}   \begin{equation}     \omega_c = \sqrt{\omega_{0}^{2} - \mu^{2}}, \mu < \omega_{0}, \text{ Underdamped}   \end{equation}   \begin{equation}     \omega_c = \sqrt{\mu^{2} - \omega_{0}^{2}}, \mu > \omega_{0}, \text{ Overdamped}   \end{equation}   \begin{equation}     \omega_c = 0, \mu > 0, \text{ Critically damped.}   \end{equation} \end{subequations} \end{document}   which I do not like.  How can you have nicely tabbed text next to equations?


Searching for an equation to find the center of a sphere given 4 points, one finds that taking the determinant of the four (non-coplanar) points together with the variables $x$, $y$, and $z$ arranged like so:  $\left|\begin{array}{ccccc} x^2+y^2+z^2 & x & y&z&1\\ x_1^2 + y_1^2 + z_1^2 & x_1 & y_1 & z_1 & 1\\ x_2^2 + y_2^2 + z_2^2 & x_2 & y_2 & z_2 & 1\\ x_3^2 + y_3^2 + z_3^2 & x_3 & y_3 & z_3 & 1\\ x_4^2 + y_4^2 + z_4^2 & x_4 & y_4 & z_4 & 1\\ \end{array}\right| = 0$   yields the equation for the sphere.  Then one need only re-arrange terms into the more familiar form to find the center and radius.  This works fine.  My question is why.    This same approach also works for one or two dimensions.  I'm guessing it also works for finding hyperspheres in higher-dimensional spaces as long as you have a corresponding number of points.  But where did that determinant form come from?  Is there an intuitive meaning for what that relationship is saying?


In my town, people with PhD's in education use the terms, "on today" and "on tomorrow." I have never heard this usage before. Every time I hear them say it, I wonder if it is correct to use the word "on" in this way. The word "on" is commonly used with the days of the week-"on Monday," "on Saturday." It seems that using the word "on" is not correct terminology and it should be only "tomorrow," "Monday," etc. Please explain...

Which is correct?        I will transfer the amount on tomorrow.   I will transfer the amount by tomorrow.


In S2 E13 of the Arrow, Felicity pulls up an image of a car that was used in the robbery of snake venom from a zoo.  The car's license plate read "KAZ 547".  She states that the car is a rental and the address for the rental spot was somewhere in the Glades.  Now, a "KAZ" on license plates indicates that the car is from Kansas.  Does this mean that Starling City is in Kansas?  Or is this just another attempt by the writers to keep the true location of the city hidden?  Or, am I missing a really obvious fact about rental cars?

From the fact that the Lian Yu is somewhere in the Pacific, we can assume that the Queen's Gambit left from the west coast of the United States.   While it is never specified, it is heavily implied that the port the Gambit left was in or very near Starling City, as Sara was shown to have been visiting home the night before the trip, and went on the trip in secret.   In City of Blood (S02E21), Felicity mentions that she moved 1000 miles from Las Vegas, presumably to go to school in Starling City.   Where is the fictional Starling City located?


Automated key presser is perfect but it doesn't work on mac. Lets say I want to press T and K alternating indefinitely until I stop it. How do I do that?

Is it possible to automate the key press of a key (such as "a" or "<") in Mozilla Firefox, Google Chrome or Safari (in this order)? I'd like to automate the key press of "a" for example in Mozilla Firefox for 100 times every x seconds. With x being a value between 1 second and 10 seconds chosen randomly at every key press. What Applescript could make the trick?  Also, where can I find a list of all codes for each key of the keyboard?


As stated in the title above. How do you curse a non-intangible thing? I know you can curse people, and they experience pain or something unpleasant, or objects which destroy them, but how do you curse something intangible?

The facts:   The job was cursed.       Oh, he definitely wanted the Defence Against the Dark Arts job. The Aftermath of our little meeting proved that. You see, we have not been able to keep a Defence Against the Dark Arts professor for more than a year since I refused the post to Lord Voldemort.   - Albus Dumbledore, Harry Potter and the Half-Blood Prince  It lasted From 1957 until the fall of Voldemort (1998)       1957 (Y-23) [Voldemort] resurfaces and applies to teach [Defence Against the Dark Arts] Ten years after the death of [Hepzibah Smith], [Voldemort] returns to [Hogwarts], where Dumbledore] refuses to grant him a teaching job. He then curses the [Defence Against the Dark Arts] position, and since that day, no professor has stayed for more than one year in that post. Again we don't know exactly when this happened, but since most evidence points to [Dumbledore] becoming headmaster in 1956 [[Y-24]], [Voldemort] couldn't have come looking for a job much sooner than this. (HBP20)  No one could hold that position for more than one year       It's well seen throughout the series that there is a "curse" on the DADA teacher position, that no one can hold that post for more than a year    Is there (preferably canon) information on:   How did Voldemort manage to do such a powerful curse? Why didn't Dumbledore, knowing about the curse, not do anything to lift it? Why didn't Voldemort put that curse in the headmaster's position, or on the whole Gryffindor house?


How to have the same functionality as below in Python 2.7. No future please.   print(item, end="")

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.


It seems apart from Saruman, Sauron doesn't pay much attention to the Istari and doesn't do a great deal to try and counter them (aside from corrupting Saruman for his own needs) which comes to my assumption that he may have not been aware they were of the same order as him.  So was Sauron aware his enemies were in fact his equals (albeit they were of a lower order of maiar)?

In the History of Middle-Earth book collection Myths Transformed we learn a lot about how Sauron perceived the Istari and what he knew of them.     Sauron had, in fact been very like Saruman, and so understood him quickly and could guess what he would be likely to think and do, even without the aid of the palantiri or of spies; whereas Gandalf eluded and puzzled him.   (Home X: Myths Transformed)     Gandalf he did not understand. But certainly he had already become evil, and therefore stupid, enough to imagine that his different behaviour was due simply to weaker intelligence and lack of firm masterful purpose. He was only rather a cleverer Radagast — cleverer, because it is more profitable (more productive of power) to become absorbed in the study of people than of animals.   (ibid)  My question now is how does Gandalf elude and puzzle Sauron so much? We know he found Saruman simple to guess down to having similar minds (maybe down to both being maia of Aule?), we also know he must know a fair bit of Radagast as he refers to Gandalf as merely a smarter version of Radagast who was known to have abandoned his task which the Istari were given.   While Sauron went face to face with Saruman via the palantir, it is surprising that he finds Gandalf basically strange, even though Gandalf in reality does the most to circumvent Sauron out of the Istari in the north-west.   Gandalf enters Dol Guldur which Sauron flees. Gandalf enters Dol Guldur again in secret and claims he only just escaped with his life,  which suggests Sauron may have ended up noticing him. Gandalf pushes White Council to attack Dol Guldur which Sauron foresees. Gandalf fought with all nine of Sauron's greatest servants at Weathertop and played a part in destroying their physical bodies temporarily. Gandalf leads the Fellowship from Rivendell, which Sauron also knows. Gandalf strives with the Dark Tower when Frodo puts the ring on at Amon Hen. Gandalf is present at the Battle of the Black Gate, in which the mouth of Sauron declares they know all about Gandalf.   As I've pointed out, Gandalf is clearly sent to contest Sauron. But I don't understand why Sauron does not see this; throughout the Third Age, well, since the coming of the Istari Gandalf has played a role in almost every contest against Sauron.  So how did he elude and puzzle him?


I am trying to create a table with 10 column but it goes beyond the width of the page and two columns are not seen. What should i do.

I have a table that I want to insert on a page, but at least one (perhaps both) of the following conditions are met:   The table is too wide to fit within the text block or page. That is, I'm exceeding some horizontal restriction. The table is too tall to fit within the text block or page. That is, I'm exceeding some vertical restriction.   What are my options to make this table fit? If it doesn't fit, regardless of my attempts, what other options exist?


I think adverb is needed here to quality “come round”. So why here we use “quicker”?  Thanks for your reply.

This is a follow up to this question:   "Quicker" is an adverb, as are "more" (in this context) and "quickly".  So is there a difference besides preference between these?


I am trying to show that for nonnegative $f$ on $\mathbb{R}$ if $||f||_1<\infty$, we have  $$ \lim_{p\uparrow \infty}||f||_p=||f||_\infty $$ I have tried to fiddle around with  $$ \left(\int_\mathbb{R}|f|^p|f|^{1-p} \right)^{1/p}<\infty $$ but haven't found a nice way to get an estimate on $\int_E|f|^p$ from this. Honestly I am pretty uncomfortable with non finite measure spaces.   Any hints would be awesome! Any references for problems similar to this would also be awesome.  edit: this is not a duplicate of the linked question as 1) my measure space is not finite, 2) my function is in $L^1$ and not necessarily in $L^\infty$

Could someone help me prove that given a finite measure space $(X, \mathcal{M}, \sigma)$ and a measurable function $f:X\to\mathbb{R}$ in $L^\infty$ and some $L^q$, $\displaystyle\lim_{p\to\infty}\|f\|_p=\|f\|_\infty$?    I don't know where to start.


Consider the following sentence:     (1) The project will include Alice, Bob, and an expected two new hires.   This sounds correct to me; it means we are expecting to hire two new people and will put them on the project together with Alice and Bob.  But logically, it seems bizarre to have a singular article "an" together with a number "two"; in most cases a noun quantified by a number word doesn't also get an article:     (2) The project will include Alice, Bob, and two people from marketing.   But removing the "an" from sentence (1) sounds definitely wrong to me:     (3*) The project will include Alice, Bob, and expected two new hires.   Although it could be fixed by inverting the word order:     (4) The project will include Alice, Bob, and two expected new hires.   What is the rule that makes (1) grammatical?

I wasn't sure how best to phrase the title of this question.  I'm interested in constructions of the following form:      An estimated 50 people died in the bombing.   'An estimated' could be substituted with adverbs like 'approximately' or 'about', so it seems that prepending the indefinite article to certain words produces an adverb.  My question is why the indefinite article should function in this way.  For one thing, the use of 'a[n]' when the following noun is generally plural seems odd.  There are quite a few words that fit this pattern:   An additional ... An approximate ... An estimated ... An extra ... A good ... A huge ... A mere ... A possible ... A record ... A scant ... A whopping ...


The way I understood general relativity is that there is no force of gravity but instead all object just move forward but the space they move through is distorted and that's why their trajectory seems to be different than a straight line. Now here is the question, if an object is not moving at all, i.e. it has no speed, does that mean that even though space is curved around them there is no speed to move the object towards the larger object?

The relativistic explanation of gravity is geometric, the motion of a body in a field of space-time distortion can be described as being at rest and travelling along a geodesic of that field, but why does it travel along that geodesic? What causes it to move?


I don't understand why in Point class where I call the method on an object , it returns false. So, in method, in third/fourth/fifth case it returns false even if values of x and y of every objects are zero. class Point{     private int x;     private int y;     public Point(int x, int y) {         this.x = x;         this.y = y;     }  public boolean method(Point p) {       if (p!=null)              return x==p.x && y==p.y;         else return false;   }  }  public class AppPoint{     public static void main(String[] args) {         Point p = new Point (0, 0);         Point q = new Point (0, 0);         Object r = new Point (0, 0);         Object s = new Point (0, 0);         System.out.println(p.method(p));         System.out.println(p.method(q));         System.out.println(p.method(r));         System.out.println(r.method(q));         System.out.println(r.method(s));     } }  // method return: true true false false false

I ran into an interesting (and very frustrating) issue with the equals() method today which caused what I thought to be a well tested class to crash and cause a bug that took me a very long time to track down.   Just for completeness, I wasn't using an IDE or debugger - just good old fashioned text editor and System.out's. Time was very limited and it was a school project.  Anyhow -   I was developing a basic shopping cart which could contain an ArrayList of Book objects. In order to implement the addBook(), removeBook(), and hasBook() methods of the Cart, I wanted to check if the Book already existed in the Cart. So off I go -  public boolean equals(Book b) {     ... // More code here - null checks     if (b.getID() == this.getID()) return true;     else return false; }   All works fine in testing. I create 6 objects and fill them with data. Do many adds, removes, has() operations on the Cart and everything works fine. I read that you can either have equals(TYPE var) or equals(Object o) { (CAST) var } but assumed that since it was working, it didn't matter too much.  Then I ran into a problem - I needed to create a Book object with only the ID in it from within the Book class. No other data would be entered into it. Basically the following:  public boolean hasBook(int i) {     Book b = new Book(i);     return hasBook(b); }  public boolean hasBook(Book b) {     // .. more code here     return this.books.contains(b); }   All of a sudden, the equals(Book b) method no longer works. This took a VERY long time to track down without a good debugger and assuming the Cart class was properly tested and correct. After swaapping the equals() method to the following:  public boolean equals(Object o) {     Book b = (Book) o;     ... // The rest goes here    }   Everything began to work again. Is there a reason the method decided not to take the Book parameter even though it clearly  was  a Book object? The only difference seemed to be it was instantiated from within the same class, and only filled with one data member. I'm very very confused. Please, shed some light?