Following $[1]$ we realize that, in order to construct a covariant derivative, we must to compare two possible covariant derivatives such as: $(\bar{\nabla}_{a} - \nabla_{a})\Omega_{b}$, where $\Omega_{b}$ is a covector field. Now, the difference of the covariant derivatives defines a tensor field called $C^{c}_{ab}$ which later will be the christoffel symbols.  The Christoffel symbols appears when we identify the bar-covariant derivative as the partial derivative operators:  $$(\bar{\nabla}_{a} - \nabla_{a})\Omega_{b} = C^{c}_{ab}\Omega_{c} \iff  \nabla_{a}\Omega_{b} = \bar{\nabla}_{a}\Omega_{b} -  C^{c}_{ab}\Omega_{c} \implies   $$   $$ (\partial_{a} - \nabla_{a})\Omega_{b} = \Gamma^{c}_{ab}\Omega_{c} \iff  \nabla_{a}\Omega_{b} = \partial_{a}\Omega_{b} -  \Gamma^{c}_{ab}\Omega_{c} \tag{1}$$  But, these indices aren't summation convention, rather, they are the "Penrose's abstract index notation"; therefore these equations are coordinate free (latin indexes represent abstract notation and greek indexes are coordinate-chart representation/summation convention).   There's a convincent explanation for why the gammas are tensors (more generally the $C's$)$[1]$. Wald says then that the components of $\Gamma^{c}_{ab}$, the $\Gamma^{\delta}_{\mu \nu}$, transforms like a tensor but just for a covariant derivative with respect to $\partial_{a}$. But if we change coordinates, and therefore the basis vectors $\partial_{a} \to \partial '_{a}$, then we also need to change the notion of $(1)$ to another covariant derivative:  $$\nabla_{a}\Omega_{b} = \partial '_{a} -  \bar{\Gamma}^{c}_{ab}\Omega_{c} \tag{2}$$  and due to this we realize that the components of Christoffell symbols become non-tensorial. Ok, this is convincing, but the fact is, fixing a derivative $\bar{\nabla} _{a}$ in one chart (and following Wald's explanation), the components of $\Gamma^{c}_{ab}$ are indeed components of a tensor because the diference of covariant derivatives gives rise to a tensor in $(1)$. Therefore, due to tensor theory, you should be able to conclude that they transform like a tensor! This is quite confusing.  My doubt is: Christoffel symbols are tensors such as:  $$ \Gamma =\Gamma^{c}_{ab}\frac{\partial}{\partial x^{c}}\otimes dx^{a} \otimes dx^{b}?$$  $$* * *$$  $[1]$ WALD.R. General Relativity. pages $30-34$.

I've been reading about connections on fibre bundles recently and it's made me think about the exact nature of the Christoffel symbols in GR.  If we have a vector bundle $E$ over $M$ and put a connection $D$ on it, in some local trivialisation we can choose a fixed connection $D^0$ and a vector potential $A\in\Gamma(\textrm{End}(E)\otimes T^*M)$ such that $D=D^0+A$. (Typically $D^0$ is the flat connection where allowed.) Then, if we have a section $s\in\Gamma(E)$ written in our local trivialisation as $s^ie_i$, and similarly $A=A_{\mu j}^ie_i\otimes e^j\otimes dx^\mu$, the covariant derivative of $s$ is given by $$D_\mu s=(D_\mu^0s^i+A_{\mu j}^is^j)e_i$$ Now this will immediately recall the covariant derivative of Riemannian geometry/GR, which, on a vector field $v=v^\mu\partial_\mu$, is given by $$D_\mu v=(\partial_\mu v^\nu+\Gamma^\nu_{\mu\lambda}v^\lambda)\partial_\nu$$ Indeed vector fields are just sections of the tangent bundle so this is to be expected. The Christoffels symbol play the role of the vector potential for general bundles.  Now my question is the following: given $E$, $A$ is a bona fide section of the tensor product bundle $\textrm{End}(E)\otimes T^*M$ - but this seems to suggest that $\Gamma$ should be a bona fide section of the bundle $$\textrm{End}(TM)\otimes T^*M\cong TM\otimes T^*M\otimes T^*M.$$ But then should it not be a bona fide type-$(1,2)$ tensor? However it is well-known that it is not a tensor. The only thing I could think of was that $A$ can in general only be defined locally (i.e. on a local trivialisation); but the familiar calculation in GR that shows the Christoffels are not tensors computes their transformation properties, which should be local, so I don't think that the explicit locality of the vector potential should be a problem. In any case, trivial tangent bundles are possible, on which the vector potential can be defined globally. What am I missing?


I need to turn my random list of 25 integers into 5 chunks of 5 that go on 5 different lines.  I have found a way to turn the list in to chunks of 5 but I am unsure of how to separate them onto 5 different lines.  import random def fill(nx, x, y):     lx = []     j = 0     while (j < nx):         r = random.randint(x, y)         if r not in lx:             lx.append(r)             j = j + 1     return lx   def chunks(l, n):     for i in range(0, len(l), n):         yield l[i:i + n]   def display(lx):     lx = list(chunks(lx, 5))     print(lx)  n = 25 a = 10 b = 50 # myList = [] myList = fill(n, a, b) display(myList)   That is just the code to get the chunks of 5. I know lx.split wouldn't work because it is a list and I can't use \ to split them line by line. So I am unsure of how to get the 5 chunks onto 5 separate lines. Unless I am missing it the difference between mine ( potential duplicate) and the other question is that I have a list of random numbers already generated instead of trying to list out all of the numbers I am turning the 25 I have into chunks separated onto 5 different lines.

I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question:


Is it fine to use recently with the past simple tense in the following sentence:     Did you read any books recently?   Is it grammatically correct?  Or do I have to use:     Have you read any books recently?

Is it fine to use recently with the past simple tense in the following sentence?     Did you read any books recently?   Is it grammatically correct?  Or do I have to use:     Have you read any books recently?


I am confused that what is the difference of operators " and  ' in javascript!  like : $('#check_fax_file') $("#check_fax_file") any suggestion?

console.log("double"); vs. console.log('single'); I see more and more JavaScript libraries out there using single quotes when handling strings. What are the reasons to use one over the other? I thought they're pretty much interchangeable.


I'm not sure if it's a film, a TV programme, whether it was from the 80's or the 70's, I think it was colonists on Mars, it had aliens, ships that floated across the desert (Mars I think) and that's about all I can remember, just something i watched when very little, would love to know what it's called. I seen somebody asked a very similar question, but the answer from what i could see was from some animated thing, this is not animated what I'm referring to.

As a young boy in the 70's or early 80's, I watched a movie which took place on Mars. There was a family living and the boy discovered that his parents where robots. That's all I can remember. Does anyone know such a movie?


Specificly, this  was just asked  Due to this  by instagram which states     We are actively monitoring Stack Overflow and we will be removing the   Google Group soon. If you have questions that have not been answered,   please post to Stack Overflow or report bugs with the Bug Tool.

Saw this in the reopen queue tonight    The question is closed as off-topic/general-computing and the OP apologizes for having to post it here.   Sure enough, that is what the company directs customers to do:  From:       Need some help? Ask a question on Stackoverflow with the tag    nitrousio and our developers (and other developers) will reach out to help you.      newest questions tagged nitrousio - Stack Overflow      ....list....   I guess no one anticipated that not all product support questions will be valid programming questions.  Or maybe it is about turning support into a profit center by attracting other customers.  Not sure that makes sense, though.  I mean, I'd like private support tickets when I contact a service provider.   This has been addressed previously back in 2009 by Jeff Atwood in an answer to   However, there is a newer 2012 duplicate  where the answer is effectively "OK, if..."  I thought I would post this here so the community can chime in on where the limits of this kind of thing should be and enable the proper people to take care of it.


I have a simple PHP/MySQL psychiatric drug database website. Everything is working well, until the user puts a single quote anywhere into the search string. I get this error:     Fatal error: Uncaught Error: Call to a member function fetch() on boolean in /home/psychoph/public_html/connection.php:76 Stack trace: #0 /home/psychoph/public_html/index.php(70): include() #1 {main} thrown in /home/psychoph/public_html/connection.php on line 76   I tried this: $generic = $dbc->real_escape_string($generic); to no avail ($generic is the variable assigned to the user input)...I get this error:     Fatal error: Uncaught Error: Call to undefined method PDO::real_escape_string() in /home/psychoph/public_html/connection.php:12 Stack trace: #0 /home/psychoph/public_html/index.php(70): include() #1 {main} thrown in /home/psychoph/public_html/connection.php on line 12   Any guidance would be appreciated. I really just need to strip single quotes from the user input, but don't know how.  Here's the code for connection.php:  <?php $dbc = new PDO( "mysql:host=173.236.101.74;dbname=psychoph_psychopharm", 'psychoph_knasky', '#######');  try { $results = $dbc->query("     SELECT *      FROM drugs      WHERE generic = '$generic'     OR brand = '$generic'     "); // this method call returns the query results and places it into $results } catch (Exception $e) { echo "Unable to retrieve results";     exit; }  try { $side_effects = $dbc->query("     SELECT se.side_effect      FROM side_effects AS se     JOIN jnct_drug_side_effects AS jse ON se.id = jse.side_effect      JOIN drugs AS d ON jse.drug = d.id      WHERE generic = '$generic'     OR brand = '$generic'     "); } catch (Exception $e) { echo "Unable to retrieve results";     exit; }  try { $indications = $dbc->query("     SELECT i.indication      FROM indications AS i     JOIN jnct_drug_indications AS ji ON i.id = ji.indication      JOIN drugs AS d ON ji.drug = d.id      WHERE generic = '$generic'     OR brand = '$generic'     "); } catch (Exception $e) { echo "Unable to retrieve results";     exit; }  try { $oi_indications = $dbc->query("     SELECT oi.indication      FROM ol_indications AS oi     JOIN jnct_ol_drug_indications AS joi ON oi.id = joi.indication      JOIN drugs AS d ON joi.drug = d.id      WHERE generic = '$generic'     OR brand = '$generic'     "); } catch (Exception $e) { echo "Unable to retrieve results";     exit; }  $row = $results->fetch(PDO::FETCH_ASSOC);   $se_row = $side_effects->fetchAll(PDO::FETCH_COLUMN, 0);  $print_se = implode(", ", $se_row);   $ind_row = $indications->fetchAll(PDO::FETCH_COLUMN, 0);  $print_ind = implode(", ", $ind_row);   $oi_ind_row = $oi_indications->fetchAll(PDO::FETCH_COLUMN, 0);  $print_ol_ind = implode(", ", $oi_ind_row);  ?>   To clarify my question, I don't have any SQL injection concerns. This isn't a site that contains any data that needs protection (unless someone really wants to change the half-life of Zoloft on some random website for psychiatrists). I'm just trying to get this to work. I'm a physician trying to build a useful web tool, and don't like that a single quotation mark in my query returns an error message to the user. Is there a simple fix to this? I'm not a programmer - I'm trying to learn just enough to make this site work. Thanks, all!

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?


I have an Indian passport, with F-1 visa living in US. I am travelling to India via Europe (exact point of change of flight isn't fixed, but it is either Amsterdam, Paris or the Frankfurt.) I wish to visit a friend in Paris for 4-5 days while coming back. (And also, we might travel to Netherlands or Spain in this period)  I am wondering, which consulate to apply for tourist Schengen visa in Atlanta, my trip starts on 23rd of May, so I have little more than 3 weeks time. While, it may be considered safe time frame, I wish to expedite the visa approval so that I can book the tickets.   More info: In the past, I have been issued Schengen visa twice: One a student visa from Chennai consulate in India; another, a Business visa issued from Swiss consulate in Atlanta. (Business visa from swiss consulate in Atlanta was issued in just one day, despite they said it might take a week.)

I'm travelling to Belgium for 3 days in the summer, but my first point of entry would be Germany and the closest embassy I have is the German embassy.  Will the German embassy issue a Schengen visa? Because I wouldn't actually be staying in Germany.


Why do things vibrate with resonant frequencies.  Why are there multiple frequencies from one impulse?  ammendment:  Why do chimes from bells have overtones? How to drums have overtones?   What is producing more than one frequency?

When you energise a taut string, the following resonant modes of vibration occur:    Plotting on the frequency domain, you can see their corresponding frequencies:    But what is the underlying physical principle? Why does this happen?  Is there any way of explaining it that could be understood by a smart 15 year old?  EDIT: I'm going to give my best attempt so far. Here goes:   We can start with sympathetic resonance. Sounding a particular frequency, a pure sinewave.  And noticing the string resonates sympathetically at the frequency of each harmonic. Say this is explained and understood. Now imagine that plucking a string is equivalent to a burst of white noise, which contains frequencies all the way through the spectrum. This could be approached backwards, by starting with random frequencies and noticing that resultant wave produced looks like white noise.   If the above is scientifically correct, then it restricts the domain of the question.  I would really like to be able to understand it scientifically and also be able to explain it intuitively.  PS Images from


My controller just blinks white once and doesn't connect ): even when its plugged in..   I tried:   2 different controllers a different USB cable turned off the ps4 and tried turning it on with the controller resetting it with the button in the back and the share/psn button tried connecting with it through safe-mode

I was playing my PS4 two days ago and then packed it up with two controllers that were both connected to this PS4.   I got to where I was going, set everything up and now the controllers won't connect. They show pulsing orange when they plug in, but when I hit the PS Button to connect, it blinks white 1-2 times and goes back to orange.   I have tried resetting them both.  Can anyone help?


How do find out which number you dialed after the call when a contact has multiple numbers associated with it. On an iphone

In iOS 8.4.1, if a caller who has 6 numbers, calls you and you see a missed call. Then, clicking the "i" symbol next to the missed call showed you all the 6 numbers of the caller and the number from which he called, was indicated with blue. This helped in knowing exactly what number he called me from and I could call back on the same number.  iOS 9.0.1 call log does not indicate the number the caller called from with blue (if the caller has more than one number). So, it becomes impossible to call the person back on the same number.  This was one very important feature that made iOS 8 very useful. Apple has taken away a very important feature.


Is it possible to use same working copy and to put the same into two different SVN servers(commit, update,...)?

Our I.T. dept doesn't allow connections to the SVN server from outside the physical office. (They're just kind of like that.) I need to work on projects when I'm not at the office.  I could just check out the project and wait until I come in to do a check-in. Maybe that would be best. But I like to check in frequently. I'm wondering if there's some way I can keep a project in two repositories and keep them both up to date. That way I'd always be able to check in somewhere in case my HD dies. I have my own repository on a VPS server that I use for personal projects.  I investigated the svn switch command. With my current project in both repos I tried switching my working copy from personal to work SVN servers...  $ svn switch --relocate svn+ssh://personalvps.com/svn/project/trunk svn://worksvn/project/trunk svn: The repository at 'svn://worksvn/project/trunk' has uuid '2baef97e-42ce-488c-bbba-c2625158c643', but the WC has 'f13e1f32-dc92-4c4a-b84d-34a59fe32063'   Then I tried adding the --username and --password params but got an error saying "no entry found."  Is this even possible or is it totally impractical?    UPDATE  Thanks for the answers. Unfortunately, any solution that involves action from I.T. (slight policy change, change a setting somewhere, install something) is not on the table. I have to find a solution within the current setup, which is no connections from outside except our Web servers.  I'll take a look at distributed version control.


I'm from Germany and I have an approved ESTA. I already bought flights to the US and back and I'm staying for 6 weeks. But now I'm thinking about spending around two weeks in Peru. Would it be possible to leave the US to Peru and return to the US after a few weeks with my ESTA?

I am a British citizen visiting the USA in early August for a two week vacation with friends. After the holiday I'm returning to my home in the UK for three weeks. After that I will return to the USA and will be working for my British employer under the Visa Waiver Program for a period of 80-85 days.  I have read already that there is technically no problems with this under ESTA rules, but should I limit this working period to a shorter time frame (e.g. 70 or so days) so that it does not negatively affect the decision made by the POE officer? Ideally I would love to be over in the states for the near-full 85 day period.  Any advice or previous experiences anyone can offer?  Some clarifications: As confirmed by the immigration attorney, as I am employed by my UK employer, it will be regarded as a business trip, the important part being that I will be working officially as a consultant for my UK employer just overseas for the allotted 85 or so days


Has anyone tried upgrading the soldered RAM on the Late 2014 Mac mini?  My boss bought me this Mac as a development machine, with 4GiB RAM, and it's really just not cutting it.  The hard drive is fine, I can live with 500GB, as I upload most of my stuff to our Git servers, and it's all fine; the RAM, however, is a real bottleneck. I can't keep my applications open to debug them correctly: with my browser, IDE(s), file editors, and application open, my Mac is usually running up in the 3,7-3,8GiB RAM section, which slows this thing down tremendously.  At home, I have the same Mac, however, I don't develop at home. At all. My Mac at home works just fine, for watching films, and TV, creating basic HTML sites (templates), and using MS Office.  I need a way to get more fast memory in to this Mac, otherwise I can't work properly.  Any help with this matter is much appreciated!

I know that the new rMBPs have no "user-serviceable" RAM. But is it possible to solder a new RAM chip onto a 2015 rMBP? Given that the technician doing this is able to install the new chip without damaging anything, would it work?


Through the the open window and the crack of the door, the wind came in, and rustled the book pages.  the preposition is "of" as opposed to "around".  What does "crack of the door" refer to?   1) the door was open and there is a crack  like this:      2) it refers to that kind of crack when the door is closed.  like this:    3) The door is broken, and crack refers to chinks  like this:   All the pictures came from Google search.

Can I use "crack around the door" in the following situation? If I am wrong, could you give me the correct expression? Thank you.  The door of Dad's room was half-open. Through the crack around the door, the wind came in and blew the book shut, then open.


I am in the process of getting rid of some old Apple products:   Late 2009 iMac iPad 2 (2012) iPhone 4 (2011)   I've reset my iPad 2 using the feature in the preferences, to erase all content and settings.  I also plan to format my Mac by doing a clean install of High Sierra.  Would the above processes be secure enough for me to then sell / give my products away? or could data still be recovered?

I just upgraded to the iPhone 5 and plan on selling my old iPhone 4. However, I want to make sure I don't keep any personal information (photos, emails, contacts) on the device. Since both iPhones are synced with iCloud, I'm not sure that I am safe to just start deleting stuff without those same changes being synced to the new device. What is the appropriate way to clean up the old iPhone to be ready to sell?


I just typed out an answer to a site on the SE network I did not use before (). After completing, I clicked on 'sign in' > 'sign in with google' to leverage my network account that has google login capability. As soon as I finished the login+account creation, I was shown my post, and to my horror only the first 2 lines remained (out of 15 or so). In a moment of clarity I went back 5x to the previous page and found my full text but otherwise this would have been a pretty sad entry to the new site. I am using an up to date version of chrome on a mac, but (though I don't sign up for a new site every day) I think I had this at least once before, perhaps a year ago. So suspect there is either a missing autosave when clicking the button that leaves the page, or an issue that not necessarily the latest version is displayed.

When writing an answer on a site where you don't have an account or are not logged in, below the answer entry textbox are options to create an account or continue as guest by providing a nickname and email. I had written an answer of several paragraphs on a network site, clicked "Sign up with Google" (resulting in association to my existing network-wide profile) but after doing so instead of showing my answer to be posted, only the first five or six words were retained.  I know that I had no account on this site previously because I just received the association bonus... I cannot tell whether the bug also affects totally new users or those with accounts but who are not logged in. This is a very unwelcoming user experience.  Please fix it. If the intended workflow is to click "Post Answer" first and associate the account afterwards, then the sign up options should not be shown until the answer is posted, and certainly not above the Post Answer button. This problem also occurs if you already have an account on the site, and click 'sign up with google' (which allows you to successfully log in).


lspci | grep -E 'VGA|Display'   shows that it has found my graphics card which is in the supported list and works fine on windows:  01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Pitcairn PRO [Radeon HD 7850 / R7 265 / R9 270 1024SP]   dmesg doesn't show any errors.  glxinfo | grep OpenGL   shows that it is not using the GPU:  OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.8, 256 bits)   Is there any way to force Ubuntu to use the GPU as I am currently unable to watch youtube and run phpstorm at the same time without considerable lag.

I have 14.04.5/16.04 or newer and an AMD GPU. I'm not getting the performance I want, and some programs say they need things like OpenCL.  I've heard about fglrx, but if I try to install it on my machine, it breaks and I have no GUI.  Is there anything I can do to get my AMD card working to its full potential?


I am flagging posts on SO which do not appear to be helpful to the site. If the flag i raise is helpful then why is my flag marked as disputed/not-helpful.   Most of the questions I have flagged have been put on hold. How does this happen?  Check the following screen shot:

I recently flagged a question as "very low quality", just like I've flagged many questions in the past. However, my flag was found to be unhelpful this time. The same thing happened when I recently flagged a post as not an answer.  Are the moderators being more strict when it comes to handling quality related flags? If so, why?


This is my code  $sql = 'SELECT * from customer';   $statement = $connection->prepare($sql);   $statement->execute();   if($statement->rowCount())   {     $row_all = $statement->fetchall(PDO::FETCH_ASSOC);      echo json_encode($row_all);            }     elseif(!$statement->rowCount())   {     echo "no rows";    }   it show "????".when retrieve from thai alphabet.where i have to fix code in the linecode? thank you so much

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I am rendering articles from database. But it shows special characters on page.  ex. â€˜MINORITYâ€™ CAN SHOW THE â€˜MAJORITYâ€™ WHO IS IN CHARGE!   I am using laravel 5.2 and mysql. How can I avoid this ? I have used following in , But it doesn't resolved problem.  <meta charset="utf-8">  Also tried, echo $newtitle = html_entity_decode($string, ENT_QUOTES, "UTF-8");   Please help!


I am not fond of solitary floats "floating" in the middle page. Consider this example:  \documentclass{report} %\usepackage{float} \usepackage{lipsum} \usepackage{graphicx} \begin{document} \lipsum[1-5]  \begin{figure}[htb]   \centering   \includegraphics[width=0.8\textwidth]{example-image-a} \end{figure}  \begin{figure}[htb]   \centering   \includegraphics[width=0.8\textwidth]{example-image-b} \end{figure}  \begin{figure}[htb]   \centering   \includegraphics{example-image-c} \end{figure} \end{document}   The output is:    How can I force the "C" image to top of page without affecting the harmony of "A" and "B" images floating symmetrically throughout the page? It means H is not an option.

I just got a short algorithm on my page, and it keeps getting aligned at the center of the page. But I want to have it aligned at the top, what do I have to do?


We were taught in school that gerund comes after 'for', while infinitive follows 'to'.   However, I came across this sentence :"Thank you for devoting your time to reading my letter"  Whatever research I try to do on the subject, the only results I get are 'ways to thank people for their time' and 'how to write formal letters' , but it's the given grammar structure i'm interested in.   So can you please help out?   Thank you so much! :)

I was reading this today:  We look forward to following your progress.  Am I correct in thinking that it is missing a be or that -ing should be removed?  So  We look forward to be following your progress.  or  We look forward to follow your progress.  Interestingly I get the same jarring feeling when reading the examples here


Show that $$\begin{array}{|ccc|} -2a & a + b & c + a \\ a + b & -2b & b + c \\ c + a & c + b & -2c \end{array} = 4(a+b)(b+c)(c+a)\text{.}$$  I added the all rows but couldn't get it.

How to evaluate this determinant by just using row and column operations ? I'm stuck.Help please!  \begin{vmatrix} -2a & a+b & a+c \\ b+a & -2b & b+c \\ c+a & c+b & -2c \end{vmatrix}  BTW is there any general method to simplify symmetric determinants like this?


I am auto-generating a LaTeX document. The input data can possibly generate empty data, so that I am left with something like this in the generated TeX source:  \begin{itemize}  \end{itemize}   This leads to lualatex complaining when compiling (of course):      Misplaced \item   Is there a way to make it ignore any empty list (no \item) silently?  For clarification: I do have a lot of itemize lists in the document and some can be empty depending on my data. I know I could filter that before generation, but that would be more cumbersome than a potential LaTeX solution.

Is there any way to make LaTeX tolerate empty itemize/enumerate (i.e. no \item)?  Specifically, I would welcome any package/elegant hack that would gracefully "cancel" a list if no elements are found (instead of firing up a Latex Error).  Before jumping to the obvious answer (which I expect would be something along the lines of "don't use itemize if you don't have items to put in" ;)) please consider my use-case:   I want to format remotely stored elements (say, bibliographic items), which I can only access as an XML file.  <elems>   <bibelem><title>Cool result 1</title><author>joe</author></bibelem>   <bibelem><title>Cool result 2</title><author>jim</author></bibelem> </elems>  I have a python script that downloads/parses the XML and outputs its content in a file bib.tex as a list of Latex macros-decorated data  \BibElem{Cool result 1}{joe} \BibElem{Cool result 2}{jim}  Now, I want to grant the end-user complete control over the styling of her/his produced document, so the intended usage within Latex is something like  \documentclass{article} \begin{document}   \newcommand{\BibElem}[2]{\item {\em #1} by {#2}}   \begin{itemize}     \input{bib.tex}   \end{itemize} \end{document}    The rationale behind this design choice is that the user should be restricted as little as possible in her/his styling choices. For instance, the user may either want to display the bibelems within a list as shown in the example, or may prefer a fancy-formatted tabular. On the other hand, the user should design the latex document once, and should be able to run it regardless of the amount of data produced by the source.  Therefore, the python script cannot make any assumption regarding the context in which its latex product will be included, and it should be up to the user to deal with empty bibliographies, i.e. with empty lists. How could one possibly do that?  Update: Werner proposed a nice solution that redefines the list environment to make Latex oblivious of the fact he is currently in a list. However, this only seems to work if the empty list is the last list in the document, as revealed by the following mwa:    \documentclass{article} \makeatletter \newenvironment{myitemize}   {\itemize}   {\@newlistfalse\enditemize} \makeatother \begin{document}   % Empty Itemize   \begin{myitemize}   \end{myitemize}   % Next non-nested itemize environment (can be itemize/enumerate/description)    \begin{myitemize}     \item Arghh!   \end{myitemize} \end{document}


Let's say I have a 1 meter steel rod floating in the vacuum of deep space far from any significant gravitational force, and at rest relative to myself.  Say I apply some force perpendicular to it and near one end:  |==============|   ^   |   |   Clearly the bar will remain within the plane of the bar and the force.  Within that plane, will the rod rotate about its center of mass, move entirely together with some veloctiy in the direction of the force, or a little of both?  If a little of both, how can we calculate how much of each as a function of the strength of the force?

Assume there is a rigid body in deep space with mass $m$ and moment of inertia $I$. A force that varies with time, $F(t)$, is applied to the body off-center at a distance $r$ from its center of mass. How do I calculate the instantaneous acceleration, rotational acceleration, and trajectory of this object, assuming it starts from rest?


I've begun importing from sketchup and my model groups have wire ( dashed line ) going back to the datum origin. They don't show in final renders  but is there any way I can turn off their displaying as they get in the way?    this is the same no matter if I use Blendup, but its the same via Collada, and 3DS.

I imported a .dae file but there seems to appear line like objects (and circles at the end of it) starting out from the center of the world. Can you tell me what they are and can it be removed?  But when I open the same environment (.dae file) in another application, I get a proper environment.


I have a long-running cron job that I want to run @reboot. I'm calling a bash script that runs two other bash scripts, using crontab -e as root (headless ssh machine). It seems like the second line of the bash script is running, but not the first.  start.sh calls first.sh and second.sh. second.sh seems like it's running, but first.sh doesn't.  I cannot figure out how to find out what is going wrong. I have added an output append &>> to crontab, the bash script that cron calls, and both bash scripts that the first script calls. Everything comes out blank.  I've tried , , , tried to . Everything I look at is blank. All the &>> *.log files are blank, strace returns nothing on the processes that are running, and I can't find first.sh running in any process manager.  ps aux | grep sh doesn't show first.sh to be running.  How can I find out why first.sh isn't being run? It's executable, and works just fine when I'm logged in and call it with terminal, but nothing seems to happen when I call it with cron. Even calling it directly from crontab -e does nothing. Same results.  EDIT: This was marked as a possible duplicate of  Though that is helpful information, it did not solve the problem. The same problem persists with absolute paths in cron.  EDIT: Including scripts for syntax errors, as per comment request: ,  (When this runs, ~/youtube.sh seems to get skipped, and ~/copy.sh runs), ,   When I call any of these manually, they work. When I call them from crontab, even directly, they don't work. ~/copy.sh works from crontab, the others don't.

I had set a cron job:  20 * * * * /usr/bin/sh /home/lucky/myfile.sh   The main problem is that at the schedule time, there is an error: "mail have sent to /var/spool/mail/lucky".  The contents of myfile.sh is:  mkdir jh cd jh


Let $R=M_n(D)$, $D$ is a division ring. Prove that every $R-$simple module is isomorphic to each other.  I need some hints to prove it.  Thank you very much.

I've a basic question.      $R$ is a simple left artinian ring. I want to show that all simple left $R$-modules are isomorphic.    A simple $R$-module $M$ is isomorphic to $R/J$ where $J$ is a maximal left ideal of $R$. Does this imply that $M\cong Ra$ for some $a\in R$, $a\neq 0$?   Many thanks.


I applied for a 2 year Business visa in July 2015. From other answers I have read, it seems a Standard Visitor visa should have been issued given this category was removed post 24 April 2015.  But for some reason the visa that was issued was a C - Visit - Business category still, in July 2015, for a 2 year validity.    Any idea why this may have been? Was it because the visa has a validity of 2 years? Note that the maximum stay is still limited to 6 months per visit (180 days) Can I use this visa to travel to UK for a tourism / vacation trip with no business purpose in that trip at all?

I hold a UK 10-year C-VISIT Visa that was issued to me IN 2013 for Tourism. In view of the changes to the Visitor Category from April 2015, would I be able to use the existing Tourist Visa for Business Purposes? Greatly appreciate your views.


A client came to me with their logo for a campaign and wanted me to do the collaterals. I did a few thing for her. Now she wants me to give her the names of pantone colors matching the exact two colors in her logo. How do I find the pantone shades for them? Please help!  Thanks

How would I select a specific Pantone color in Photoshop, e.g. PMS 5625?  Also, how do you pick a Pantone colour that is similar to a specific CMYK color, e.g. C61, M41, Y58, K16 green?    In this case Pantone 5615C looks closest to the CMYK color.


I have a fully updated iPhone 6. I continue to get old calendar reminders showing up on my iPhone. It routinely reminds me of a regular meeting that has been cancelled for two years in some cases.  I have gone into the Reminders app, but nothing shows there. None of these old meetings are on my calendar anymore.  How do I get rid of the old reminders?  Re:  The suspected dupe - As noted above, I have gone through the Reminders app. There is nothing there. The previous questions about reminders do not help me as they are not relevant.

My Reminders app is showing 6 reminders, but as far as I know, I have none. I've checked the completed file, checked in iCal on the Mac. Any ideas how to delete these reminders?


I've created a set of rules for a card game I would like to test, but I have no clue on how to build my nice-looking cards. Any hint on what program/site to use is very welcome.

I'm not sure if this is the right place to ask this kind of question but here it is.  I'm making a board game where there is a deck of monster cards and I'm interested - is there some tool/script that allows to make images for cards from some text file that contains all the needed information (.txt, .xml or something else)? What i would like is something like:   1) make a .psd with labels for name and defense values (also background and other images that can be anything)  2) have some file that lists all the monsters names and defense values (where i can quicly change them and regenerate images from that)  Also you can add somehing new later both in psd and this file (like I/II/III for monster difficulty). Optionally - not just change text, but also images (that would allow to change icons from the file, ect.) #dreams  Is there some tool that allows for this kind of fast iteration?


The following problem gives me a very hard time:     Let $M$ be a monoid with $a^2 = 1$ for $a \in M$. Show that $M$ is abelian.   It looks so simple as a monoid only needs to be associative and must have a neutral element (here $1$). So there are not much things to try. However, after some hours of trying I have to admit that I don't know what to try next.  Maybe somebody of you can give me a hint.  Kind regards!

Prove that if $g^2=e$ for all $g$ in $G$ then $G$ is Abelian.   This question is from group theory in Abstract Algebra and no matter how many times my lecturer teaches it for some reason I can't seem to crack it.   (Please note that $e$ in the question is the group's identity.)  Here's my attempt though...  First I understand Abelian means that if $g_1$ and $g_2$ are elements of a group $G$ then they are Abelian if $g_1g_2=g_2g_1$...  So, I begin by trying to play around with the elements of the group based on their definition...  $$(g_2g_1)^r=e$$  $$(g_2g_1g_2g_2^{-1})^r=e$$ $$(g_2g_1g_2g_2^{-1}g_2g_1g_2g_2^{-1}...g_2g_1g_2g_2^{-1})=e$$  I assume that the $g_2^{-1}$'s and the $g_2$'s cancel out so that we end up with something like,  $$g_2(g_1g_2)^rg_2^{-1}=e$$ $$g_2^{-1}g_2(g_1g_2)^r=g_2^{-1}g_2$$  Then ultimately...  $$g_1g_2=e$$  I figure this is the answer. But I'm not totally sure. I always feel like I do too much in the pursuit of an answer when there's a simpler way.  Reference: Fraleigh p. 49 Question 4.38 in A First Course in Abstract Algebra.


For a long time I used bibtex, but now with utf-8, it is recommended to use biblatex. Is biblatex better than bibtex? I am building a system that will use LaTeX. The system will use the bibliography style of the APA, among others. For that reason I would like to have solid foundations to argue the selection of one or the other.

I've heard of many different bibliography-related packages/platforms/?. What's the difference between the following, which is good for what tasks, advantages/disadvantages, which one is the most modern, etc.:   BibTeX    (If I missed anything important, please just add it here or answer about it)     Background  So far I've just typed in my citations (i.e. their sources) and lists of references manually (as regular footnotes/text) whichever way I needed them, but I'm considering switching to something more TeX-y. I usually use different literature for each paper, and I often have to switch between radically different styles for citations and the list of references, so flexibility is necessary. I'm trying to find out which platform would be the best for me, a hint at good introductory reading for whatever you recommend would be more than welcome.


One way to prove that a matrix and its transpose are similar is to apply polynomial matrix theory.   I wonder if there is another way to do that. Thanks.

Mariano mentioned somewhere that everyone should prove once in their life that every matrix is conjugate to its transpose.  I spent quite a bit of time on it now, and still could not prove it. At the risk of devaluing myself, might I ask someone else to show me a proof?


Are there best practices around when it's ok to open links into a new tab and when it's best not to?

In usability discussions about opening website external links in new windows, with regard to the argument of "keeping users on the site" there are occasionally references to usability studies which show that users are actually likely to leave the origin site instead of returning (thus defeating the purpose of opening the link in a new window).  But I can't find actual recent published studies on this, and I've searched extensively. Though Jakob Nielson is reputed to be a foremost expert, his recommendations are old and have no citations that I can find.  Does anyone know of credible, recent, published usability studies where users were disoriented by new windows and were more likely to not return to the origin site?  Update:   I understand there are accessibility issues, but as those matters are well-documented and backed up by the WCAG, I'm not in need of evidence supporting them.  This question is intentionally specific to the argument of "I want to keep users on my site" because it is the argument which -- due to lack of supporting evidence -- I can't effectively counter in discussions with the client.  Update:  Found this . Haven't fully deciphered it, but the thesis does claim that new windows / tabs increase the cognitive burden on users.


I tried with booking.com, and the only way seems to put in "2 bathrooms" in the name of the hotel, or simply look for apartments and hope that someone put it in the reviews or it is mentioned under the facilities. Just to make it clear, I'm not exclusively looking for apartments. It could also be suites or deluxe hotel rooms.  If there are any sites that include bathroom count (other than tripadvisor), I would very much appreciate any help I could get. I would then be able to filter out on a different site and search for their available rooms on booking.com.

I'm planning a winter vacation somewhere in Central Europe and would like to find a hotel with a fireplace somewhere in the mountains. Surprisingly though I haven't been able to find a search engine which lets me filter the search results by a specific keyword ("fireplace" in this example)  Is there a convenient way to find a list of hotels filtered by a custom keyword? Websites like Booking.com only let you choose from a limited set of amenity filters.


In Windows you can start .exe files with certain parameters to do certain tasks like:  shutdown.exe -s   Is there anything like this in Java, I know that I can make a terminal input with a Scanner function, but what if I want to start the application invisible/not from at terminal but still be able to tell the application something.

What is a good way of parsing command line arguments in Java?


What about the supposed aiming modifications when firing a weapon?  According to my research, when firing a weapon you are supposed to aim a little to the right when firing northwards and to the left when southwards. This is supposed due to the rotation of the earth. If that is so, it means that the moment the bullet leaves the gun it no longer moves according to the rotation of the earth.  By logic and common sense, the same behavior must be expected when planes leave Earth. Does Earth rotation effect planes?

Why do airplanes experience negligible Coriolis force while bullets experience the Coriolis force in long range shooting, even though the mass of airplane is much bigger than a bullet?


It's presently the 21st of December, and I've  on RPG.SE.  That seems to suggest I should get , which requires that I "post or comment on 12/21", but I'm not earning it. What's going on? Is there something I'm missing, or is the hat buggy?

During Winter Bash, users can earn hats. But sometimes it seems that a hat was awarded even though its requirements weren't (yet) met, or vice versa.  What could be the reason for this?


I read a lot of pdfs using Mendely and I want to buy an Ubuntu tablet for reading these pdfs on the go. I want to sync my pdf directory on my desktop (that's also running Ubuntu) with my tablet using rsync.  Question 1) When is a tablet with Ubuntu Touch installed going to be on the market?  Question 2) Shall I just buy a normal tablet and install Ubuntu on it? Can this be done easily with, say, a Samsung Galaxy Note?  Question 3) If I can install an application in Ubuntu, will I definitely be able to install it in Ubuntu touch? Will Ubuntu touch be incompatible with any Ubuntu apps?  I don't want to have to 'jailbreak' anything or do anything flakey. I just love Ubuntu, and I want it on the go. What is the best way to achieve this?

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


We were given yesterday couple of pigeonhole principle questions, i did solve most of them but these 3 i could not, i don't know even where to start.  1) 20 people are sitting around round table, on it there is a big pizza (20 slices) 10 of them with olives and 10 without, some of people like the pizza with olives while other don't, show that one can rotate the pizza such that at least half of the people(at least 10) are happy ?  2) Given a graph with 6 vertices prove that there is at least 3 vertices that have no edge between every two of them or that they all are connected ?  3) Given $x \in \mathbb{R}$ and $x \not \in \mathbb{Q}$ prove that for all $\epsilon >0$ there is $n>0$ such that $\{ n x \} < \epsilon$ ?  any help is appreciated, even if you know how solve one question, please leave a comment showing me how to prove it, or posting an answer,  Thank you.

There are $n$ boys and $n$ girls sitting around a round table in some order. In the middle of the table there is a pizza sliced to $2n$ parts some parts contain olives and some parts contain mushrooms. The boys are willing to eat only mushroom parts and girls are willing to eat only olive parts. Prove that it is possible to rotate the pizza so at least half the people are happy?  I couldn't find a similar question to this. I think it needs to use the pigeon hole theorem in some way but I cannot find the right way.


I have the following string expression which am trying to run ,But am getting error saying string format is not correct   for (i = diffvol; i < result.count; i++) {     B1Volume = Convert.ToDecimal(String.Format("result.Data[0].B{0}Volume", i));     B2Volume = Convert.ToDecimal(String.Format("result.Data[0].B{0}Volume", i)); }

I would like to do the equivalent of:  object result = Eval("1 + 3"); string now    = Eval("System.DateTime.Now().ToString()") as string   Following Biri s , I got this snippet (modified to remove obsolete method ICodeCompiler.CreateCompiler():  private object Eval(string sExpression) {     CSharpCodeProvider c = new CSharpCodeProvider();     CompilerParameters cp = new CompilerParameters();      cp.ReferencedAssemblies.Add("system.dll");      cp.CompilerOptions = "/t:library";     cp.GenerateInMemory = true;      StringBuilder sb = new StringBuilder("");     sb.Append("using System;\n");      sb.Append("namespace CSCodeEvaler{ \n");     sb.Append("public class CSCodeEvaler{ \n");     sb.Append("public object EvalCode(){\n");     sb.Append("return " + sExpression + "; \n");     sb.Append("} \n");     sb.Append("} \n");     sb.Append("}\n");      CompilerResults cr = c.CompileAssemblyFromSource(cp, sb.ToString());     if (cr.Errors.Count > 0)     {         throw new InvalidExpressionException(             string.Format("Error ({0}) evaluating: {1}",              cr.Errors[0].ErrorText, sExpression));     }      System.Reflection.Assembly a = cr.CompiledAssembly;     object o = a.CreateInstance("CSCodeEvaler.CSCodeEvaler");      Type t = o.GetType();     MethodInfo mi = t.GetMethod("EvalCode");      object s = mi.Invoke(o, null);     return s;  }


I was wondering how rotating objects would behave if we pulled them inwards DURING rotation? For example- If I was initially spinning a rock attached to a string in a uniform circular motion and then (at $t=0$) the string starts decreasing length at a net inward velocity of '$v$' then what would be equation and time period of the movement till the string length becomes 0? The diagram at $t=0$ would look something like this:  I tried coming up with an equation myself, taking center as (0,0): $$x=vt\cos\left(\frac{2 \pi t}{T} \right)$$ $$y=vt\sin\left(\frac{2 \pi t}{T} \right)$$ but since the time period ($T$) is variable (due to decreasing radius) I don't think it's correct as far as my intuition goes there would be a certain spiral inwards path followed but I can not understand how to find the time period? do I even have the right approach? Note: Please don't mark this as a h.w. question I'm just trying to understand it intuitively and if the question seems unclear just let me know I'll edit it instead of closing it, I'm losing sleep over this query

Will an object be pulled towards the centre linearly if the net force provided for a circular motion is larger than the required centripetal force? And why?  For example, if the object in a circular motion which is connected by a string is pulled towards the centre by hand.


I've recently installed ubuntu 19.04 in dual boot with windows 10 (both in UEFI). GRUB recognizes windows, but when I choose the option "Windows Boot Manager" the windows logo and the loading animation appear only for a few seconds, then the computer reboots, bringing me back to grub selection menu. I tried many things, including sudo update-grub and using boot-repair, but none of them worked. Here is the log for boot-repair, if that helps:  (I also have a 2tb hard drive as a secondary drive for data, but I use only one 240gb ssd for the operating systems).  The windows partition is still accessible through the file manager in Ubuntu. I've also disabled secure boot.   Both partitions are GPT

I installed Windows 7 and Windows 8 in EFI mode on a hard disk some days ago. Today, the bootloader got missing/corrupted.  I currently have the Windows 8 installer on a flash drive and tried using the Automatic Repair option to repair the bootloader but it didn't do anything. The Startup Repair option is also missing in the Windows 8 installer.  How I can repair/recreate the EFI bootloader from the Command Prompt?  BCDEDIT returns the following message:  The requested system device cannot be found.


I'm trying to match at least 3 objects to each other in the most efficient way. I keep getting a null pointer error. I've tried a few different approaches and can't seem to figure it out. Any help would be much appreciated.  protected void boardFill(ArrayList<ArrayList<T>> twoDList) {     for (int x = 0; x < COL; x++) {         twoDList.add(new ArrayList<T>());         for(int y = 0; y < ROW; y++) {             twoDList.get(x).add(gems.newGem());                      }               }      for (int i = 0; i < COL; i++) {         for (int j = 0; j < ROW; j++) {             getObject(i, j, twoDList.get(i).get(j));         }     } }  /*  * move pieces down after being removed  */ public void drop() { }  /*  * check if position is legal to move/swap  */ public boolean legal(int row, int col) {           return false; }  /*  * check if pieces are matching  */ public boolean matching(int r, int c) {     boolean flag = false;     return flag; }  public void getObject(int i, int j, T type) {    if (twoDList.get(i).get(j) == type) {        coordinates.add(twoDList.get(i).get(j));         if (i-1 >= 0) getObject(i - 1, j, type);        if (i+1 < ROW) getObject(i + 1, j, type);        if (j-1 >= 0) getObject(i, j - 1, type);        if (j+1 < COL) getObject(i, j + 1, type);    } }

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


Let $P:\mathbb R^m \to \mathbb R^m$ is orthogonal linear transformation on some subspace $U$ of $\mathbb R^m$. Execute the term for matrix of linear transformation P using standard base. Explain the procedure.  I know matrix for orthogonal linear transformation is P=$A(A^TA)^{-1}A^T$, I saw proof that this matrix is matrix of projection and it is orthogonal but,how I get that matrix, I could not find anything how to get that matrix, can you help me?

I've been reading . The goal is to find projection of $b$ on the line $L$ which is determined by vector $a$. ($Proj_L(b)$)  In the document, It is mentioned that If $p$ is thought as approximation to $b$, then $e=b-p$ is the error in that approximation (the word approximation is little confusing though, Isn't $e$ the exact value? Although this is not the problem). Then we know that If $p$ lies on the line through $a$, then $p = xa$ for some $x$. We also know that, $p$ is orthogonal to $e$, therefore their dot product equates to zero: $a^T(b-xa)=0$ $a^Tb - a^Txa = 0$ $xa^Ta = a^Tb$ $x = \frac{a^Tb}{a^Ta}$ Solving for $p$: $p = ax = a\frac{a^Tb}{xa^Ta}$  First part was almost completely understandable, but in the second part this projection is written in the terms of projection matrix ("$P: p = Pb$"): $p = xa = \frac{aa^Ta}{a^Ta}$ where did $b$ go? $x$ and $a$ have changed places, but isn't dot product commutative? Then, $P$ is solved: $P = \frac{aa^T}{a^Ta}$ Somehow, $aa^T$ is 3x3 matrix. How was this concluded? From my knowledge, The general definition of projection matrix is $A (A^{T}A)^{-1} A^T \vec{x}$ (where $A$ is matrix) Does the definition above has any relations with the projection matrix that was represented in document? If not, how was it derived? Thank you!


Here we have the classical picture of the deformation of the space-time:    And I would to know if this representation is only a way to say how the gravity field of the earth is shaped, and how the gravity works in the area near it, or not.

Whenever I read about the curvature of spacetime as an explanation for gravity, I see pictures of a sheet (spacetime) with various masses indenting the sheet to form "gravity wells." Objects which are gravitationally attracted are said to roll down the curved sheet of spacetime into the gravity well. This is troubling to me, because, in order for objects on the locally slanted spacetime sheet to accelerate, gravity must be assumed. Therefore I ask; does the explanation of gravity as the curvature of spacetime assume gravity? If yes, what is the point of the theory? If No, what am I missing?


I got into a debate with one of my colleagues - we are both not native English speakers. She asked me a question "so we are currently not sending any data to him?" I replied "No".   I understand that this answer is a bit ambiguous, probably this was the reason she misunderstood it (my intention was to say no, we are not sending anything). To make it clear, I wrote "No, as in no we aren't"  After this she lectured me that a.) for the first question I should have answered 'yes' if I want to confirm and b.) No we aren't is not proper English because it's double negation.  Can anyone please clarify/explain a.) and b.)?

A double negative is generally defined as two negative words in the same clause. In these examples:  "No it is not." "No I don't think so."  is "No" considered a clause unto itself? Or is it in the same clause as the rest of the sentence, thus constituting a double negative?


I'm trying to have a popupwindow that has an EditText field for user to enter a new budget and a button to save the value. Once the "save" button is clicked, the TextView in the main activity should change according to what the user input in the budget (EditText) in the popupwindow. But when I implement the OnClickListener in for the "save" button in the popupwindow, the app crashes once I try to navigate to the popupwindow from the main activity.   public void onButtonShowPopupWindowClick(View view) {          // inflate the layout of the popup window         LayoutInflater inflater = (LayoutInflater)                 getSystemService(LAYOUT_INFLATER_SERVICE);         View popupView = inflater.inflate(R.layout.spending_budgetpopup, null);          // create the popup window         int width = RelativeLayout.LayoutParams.WRAP_CONTENT;         int height = RelativeLayout.LayoutParams.WRAP_CONTENT;         boolean focusable = true; // lets taps outside the popup also dismiss it         final PopupWindow popupWindow = new PopupWindow(popupView, width, height, focusable);          // show the popup window         // which view you pass in doesn't matter, it is only used for the window tolken         popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);          // dismiss the popup window when touched         popupView.setOnTouchListener(new View.OnTouchListener() {             @Override             public boolean onTouch(View v, MotionEvent event) {                 popupWindow.dismiss();                 return true;             }         });            Button button_savebudget = findViewById(R.id.budget_save);           button_savebudget.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View view) {                 String budget = newbudget.getText().toString();                 amount_budget.setText(budget);             }         });       }   The code above shows the OnClick method that opens up the PopupWindow from the main activity. And the "button_savebudget" is to save the value and change the TextView in the main activity.   The logcat is below :-      --------- beginning of crash 10-11 16:08:25.552 4980-4980/com.example.hannzern1998.spendingtest E/AndroidRuntime: FATAL EXCEPTION: main     Process: com.example.hannzern1998.spendingtest, PID: 4980     java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference         at com.example.hannzern1998.spendingtest.MainActivity.onButtonShowPopupWindowClick(MainActivity.java:100)         at com.example.hannzern1998.spendingtest.MainActivity$1.onClick(MainActivity.java:44)         at android.view.View.performClick(View.java:6294)         at android.view.View$PerformClick.run(View.java:24770)         at android.os.Handler.handleCallback(Handler.java:790)         at android.os.Handler.dispatchMessage(Handler.java:99)         at android.os.Looper.loop(Looper.java:164)         at android.app.ActivityThread.main(ActivityThread.java:6494)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)   I'm pretty sure the "button_savebudget" is the one that causes the crash because once I remove that particular piece of code the app doesn't crash but I'm not sure what else to change to fix it !


My mate-weather applet suddenly stopped working. Have tried other locations, none work. Has anyone else encountered this and do you know of a fix?  Seen on Ubuntu 16.04 LTS, MATE 1.18 and on Ubuntu 20.04 LTS, MATE 1.22.

From yesterday, openweather extention on the top panel does not show the weather. Its shows "Please wait Loading".  I tried to find the solution. There was a post of creating account on openweather website and use API id. I found that it is a subscription base plan. There was a free plan which allows 60 calls free for weather data.  I thought that the extention is open source. And may be I deleted any package that is required to work the extention so I reinstall the OS. But there is no difference of doing that.    What could possibly go wrong any guidance?


I have a CLR stored procedure that (among other things) calls a TSQL stored procedure. The TSQL stored procedure runs some dynamic SQL, and it prints the SQL before it runs for debugging purposes. Nothing from the PRINT statements shows up in the client. What is a good way to allow us to see these commands when we need to troubleshoot?  Sample code:  C# code in dll  public static void Print_CLR() {     using (SqlConnection conn = new SqlConnection("context connection=true"))        {             conn.Open();             using (SqlCommand c = new SqlCommand("exec dbo.Print_TSQL", conn))             {                c.ExecuteNonQuery();             }     } }   Proc called by CLR  CREATE PROC DBO.Print_TSQL AS PRINT 'WTF' GO --Exposing proc to SQL CREATE PROC dbo.Print_CLR AS EXTERNAL NAME  [CLRUtility].[CLRUtility.CLRUtility].Print_CLR GO --Executing, nothing is PRINTed for the client EXEC dbo.Print_CLR

Our DBA team doesn't verify the backups using the below TSQL (which can easily be done post-backup and takes almost no time, so I don't get why not):  RESTORE VERIFYONLY FROM DISK = 'D:\Backups\LOCATION'   They've had issues in the past, so even though we'd think they'd learn from it, they haven't.  I created a Powershell script to do this because we have about 100+ servers and I just want to run this script against all the backups just to ensure they're valid.  The below script runs correctly (in that it doesn't break or throw errors), I am curious if there's a way to get the printed message back in Powershell that we would normally get in SSMS where it states The backup set on file 1 is valid as verification.  $SqlCon = New-Object System.Data.SqlClient.SqlConnection $SqlCon.ConnectionString = "SERVER=SERV\INST;Integrated Security=true;DATABASE=master"  $baks = Get-ChildItem "D:\Backups\" -Filter *.BAK  foreach ($bak in $baks) {     $SqlCon.Open()     $cd = New-Object System.Data.SqlClient.SqlCommand     $cd.Connection = $SqlCon      $cd.CommandText = "RESTORE VERIFYONLY FROM DISK = @f"     $cd.Parameters.Add("@f", $bak.FullName)     $cd.ExecuteNonQuery()     $SqlCon.Close() }


When I sign in via remote desktop sometimes the guest user is active and I need to wait for their permission to disconnect them before I can log in via remote desktop. However I do not want any user to be able to prevent me from signing in. How can I make it so when I sign in via remote desktop other sessions are automatically ended?  I am using windows 8

Scenario:  I am at work. I want to remote desktop into my machine at home. Problem is, my 5-year-old daughter is playing games on Starfall.com (or something similar) on her (non-admin) account. When I attempt to connect I see this message:     Another user is currently logged on to this computer. If you continue, this user has to disconnect from this computer. Do you want to continue?   I click Yes and then see     Please wait for 'UserName' to respond   This presents my daughter with an Allow/Disallow dialog on whether to let me connect. She clicks Disallow (or No or whatever it says) and then I see     'UserName' has denied your request   Question:  How can I force my account to log in and disconnect her session?  Additional Info:  My account is an administrator account. My daughter's account is a non-administrator account. Home machine is Windows 7 Pro with fast user switching enabled.  Note In my case, turning off fast user switching is not an option. Kyle pointed out in his answer that turning it off would allow the admin to force another user off. I'm accepting his answer and it identifies the issue, even though it doesn't solve my exact problem. I need to keep fast user switching's ability to change accounts without closing the previous account's session over being able to force myself to connect.


If loss is decreasing but val_loss not, what is the problem and how can I fix it?  I get such vague result:

I am trying to train a LSTM model. Is this model suffering from overfitting?   Here is train and validation loss graph:


I need to solve for $x$ in this congruence:  $$17x+7 \equiv 3 \pmod 6$$

I'm having some troubles understanding the solution (going from step $2$ to step $3$) of this linear congruence equation. Here's the problem with the solution:   Solve the congruence $2x + 11 \equiv 7 \pmod 3$.   First, we reduce all the coefficients $\pmod 3$:  $$2x + 2 \equiv 1 \pmod 3. \tag{1}$$  Next, we add $1$ to both sides, using the fact that $2 + 1 \equiv 0 \pmod 3$:  $$2x \equiv 2 \pmod 3. \tag{2}$$  Finally, we multiply both sides by $2$, using the fact that $2 · 2 = 4 \equiv 1 \pmod 3$:  $$x \equiv 1 \pmod 3. \tag{3}$$  That is, any number in the set $\{\ldots, −5, −2, 1, 4, \ldots\}$ will solve the original congruence.    Like I said my problem is the step between $(2)$ and $(3)$. If I multiply both sides of $(2)$ by $2$ I get:  $$4x \equiv 4 \pmod 3.$$  Now, I understand that $4$ is congruent to $1 \pmod 3$ so the RHS "simplifies" to $1 \pmod 3$ but I don't understand why the LHS "simplifies" to $x$. Can someone help me with this?


I have a Windows 8.1 laptop and the CD/DVD drive periodically makes noises as if something is trying to acccess it, even though there is no disk in there. Also the optical disk access mouse cursor periodically appears.  Is there any way to diagnose this?

I didn't had this problem before, recently I bought a SSD and installed Windows 7 x64 on it,  and now the DVD sometimes spins without reason, it has no CD in it (this makes a bit of a lag).  EDIT:  it usually spins when I start windows explorer, or some other action that probably involves exploring windows folders (starting winamp also could spin it)  saving a file (in ms word ctrl+s) can also spin it


recently i learned about python identity operators and i facing a problem while i using it in python shell and pycharm .  my shell code be like ->  >>> a = 6000 >>> b = 6000 >>> b is a False   it ans me False .  but when i using pycharm like ->  a = 6000 b = 6000 print( b is a )   it ans me True .  Can anyone explain me where i am going wrong and what is actual difference between python shell and ide ?

Why does the following behave unexpectedly in Python?  >>> a = 256 >>> b = 256 >>> a is b True           # This is an expected result >>> a = 257 >>> b = 257 >>> a is b False          # What happened here? Why is this False? >>> 257 is 257 True           # Yet the literal numbers compare properly   I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100.  Based on the above, I can hypothesize that Python is internally implemented such that "small" integers are stored in a different way than larger integers and the is operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not?


I have tried to use the Stolz theorem and calculate $\lim_{n\to \infty}{\frac{a_{n+1}-a_n}{b_{n+1}-b_n}}$ and i have reached $\lim_{n\to \infty}{\frac{1 + \frac{1}{2} + \frac{1}{3} + ... + \frac{1}{n-2} + \frac{1}{n-1} + \frac{1}{n}}{\ln (n+1)}}$ but I do not know how to continue. Could someone help me? Thanks in advance.

How can I compute the following limit? $$ \lim_{n\to\infty}\frac{\dfrac{n}{1}+\dfrac{n-1}{2}+\dots+\dfrac{2}{n-1}+\dfrac{1}{n}}{\ln(n!)} $$  I have tried lots of methods, I can't get the answer. Although I think the limit is $0$, I don't know how to explain it. Please, if someone could help me it would be fantastic.


enum Color  {    GREY = 4294967294,    RED   }   RED is assigned the largest value a 4 byte unsigned int can hold. When I use sizeof to know the size of my enum Color (sizeof (Color)), it prints 4. If I assign -1 to RED, the sizeof prints 8. Does that mean an enum is by default unsigned?

Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is <= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)?


I want nopasswd thing for my jenkins user. For that, I have to edit the /etc/sudoers file,  But   luvpreet@DHARI-Inspiron-3542:/$ sudo vi /etc/sudoers   This gives me that this file is readonly and so, I cannot edit this file.  I change to root,  luvpreet@DHARI-Inspiron-3542:/$ sudo su   And I am getting something like this,   \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$    and even now I cannot edit the file. It still says this is readonly.  What is wrong ?  How do I solve this issue ?

How do I edit an invalid sudoers file? It throws the below error and it's not allowing me to edit again to fix it.  Here is what happens:  $ sudo visudo >>> /etc/sudoers: syntax error near line 28 <<< sudo: parse error in /etc/sudoers near line 28 sudo: no valid sudoers sources found, quitting


When should a taxon be considered to be a subspecies of a certain species, and when as a different species? Are there some general guidelines how to assign a specific taxonomic status to a taxon?

Within a species there may be subspecies that are named using trinomial nomenclautre. For example the Grizzly Bear, Ursus arctos horribilis is a subspecies of the Brown Bear Ursus arctos.   The dictionary definitions of subspecies seldom expand beyond this:     A taxonomic category that ranks below species, usually a fairly permanent geographically isolated race.   I'm assuming redefining species into subspecies is not a completely arbitrary process as the definitions would imply, but is based on biology. What are the biological criteria for a group within a species to be "upgraded" to a subspecies?


Words "leave" and "arrive" belong to which part of speech (noun or bare infinitive) in the following sentences:     We saw Fred leave.      Did you hear them arrive?

I have been reading Men With Brooms for a few days. I read a sentence which did not make any sense to me, so I landed here to get some help on it. I have pasted the sentence from the novel. Please go through it and let me know your valuable feedback on it.  An excerpt from the novel (Men With Brooms: A Sweeping Epic, paperback 2002, a novelization by Diane Baker Mason):     Gordon was about to walk away from the Impala when he saw it stop and his son get out. So it was real the boy had come.   As per my opinion it should have been:     Gordon was about to walk away from the Impala when he saw it stopped and his son got out. So it was real the boy had come.   I have two questions here:   Why did the writer use stop and get instead of stopped and got? As she is telling us a story which happened in the past. Let's say the writer is telling us her mind's situation and she used the present tense for it but why did she use stop and get instead of stops and gets?


I'm looking for a word with a positive undertone to describe a teenager who does her own thing and doesn't cave in to peer pressure.  Any suggestions?  Thanks.  Question edited 1/30/16.  Someone marked this question as a duplicate, but I think the other question is quite different from the one already posted.  The other question is asking about a single word to describe someone who doesn't follow the crowd for the single purpose of being contrary.  A contrary state of mind has nothing to do with what I'm looking for.  I'm writing a recommendation for a teenager who is polite, independent, confident, and doesn't follow the crowd...  NOT out of a sense of being different for the sake of being different, and not because she's ornery and contrary, but because she's her own person, and not swayed by what the other teens are doing.  Can we re-open this discussion?

Such a person does not hold in high regard the decisions taken by a group (not a team) of people. She believes that groups tend to be anarchic and don't serve their purpose.  An example would be - for outings with friends, this person will not like planning it with the group since they will mess it up.  Therefore, this person has convinced herself that when more people are involved with something, it will be worse. She distrusts crowds instinctively basically.


i exported a line with the x3d format from paraview, and imported it into the blender. May i know how to color the line in the blender, please? Because there is usually an existing vertex color for the face object but there is no vertex color for the line object.

So people have had similar problems showing colors on .ply files  and   but I don't think this is the same case.  I've exported a .ply file from a program called paraview with color info on it.  I've uploaded the file  and as you can see, the color info came with it.  But for whatever reason when I import it into blender and go look for the per-vertex color info where I would expect to find it, its empty:   Am I doing something wrong?  It seems like there had been a problem with impo but this is 2.81.  I would assume it was fixed?


I'm on Ubuntu 12.04 and I was wondering if is there any way to sort the indicators like this(Image):    The bottom bar is the default one and the upper bar is how I'd like to sort 'em.   dbus-send --type=method_call --print-reply --dest=com.canonical.indicator.application /com/canonical/indicator/application/service com.canonical.indicator.application.service.GetApplications | grep "object path"   returns this:  object path "/org/ayatana/NotificationItem/lang_indicator/Menu" object path "/org/ayatana/NotificationItem/My_Weather_Indicator/Menu" object path "/org/ayatana/NotificationItem/transmission/Menu" object path "/org/ayatana/NotificationItem/bluetooth_manager/Menu" object path "/org/ayatana/NotificationItem/indicator_sysmonitor/Menu" object path "/org/ayatana/NotificationItem/nm_applet/Menu"   How I have to edit the "~/.local/share/indicators/application/ordering-override.keyfile" to do this?

Is it possible to change the order of icons shown in the indicator applet? With Tomboy indicator, Weather indicator, Clipboard-manager indicator, Ubuntu One and Dropbox indicators and a Battery Status indicator in addition to the classic Messages indicator and Sound Menu indicator my Indicator Applet becomes a little bit messed up, sorting the icons would help a lot...


Say I have a data set, how do I know if the distribution is normal or not? If not, how can I tell what type of distribution it is? Are there some tests for identifying distribution types?

I have a large dataset (500000 data, V1 column include all the data).  x <- read.csv("mydata.csv", header=F) hist(x)   Which gives:    Looking at the data, I believe it is not a normal distribution. As a further check, I constructed a qqplot:  x_norm <- (x$V1 - mean(x$V1))/sd(x$V1) qqnorm(x_norm); abline(0, 1)   which gave:    To check the goodness of fit of x$V1 (rawdata) to a normal distribution, I used:  rnorm <- rnorm(500000, mean(x$V1), sd(x$V1)) cc <- cbind(rnorm, x$V1) g <- goodfit(cc, method="MinChisq") summary(g)           Goodness-of-fit test for poisson distribution               X^2 df      P(> X^2) Pearson 914.5227 17 1.679266e-183 Warning message: In summary.goodfit(g) : Chi-squared approximation may be incorrect   With plot(g) giving:    Does this seem correct? Can I confidently conclude my dataset X$V1 is or is not a normal distribution?  Based on the above analysis, what other distribution should I test?


I'd like to show that for $p,q$ distinct primes, the extensions $\mathbb Q(\sqrt p),\mathbb Q(\sqrt q)$ are not isomorphic. I don't really have knowledge of the "high-level language" of algebraic number theory, so my approach is going to be very bit-wise, if you will.  Here's my try:  If there were such an isomorphism, call it $\varphi$. I know that we must have: $$\left\{\begin{align}&\varphi\mid_{\mathbb Q} = \text{id} \\ &\varphi(\sqrt p) =\pm\sqrt p \end{align}\right.$$  So essentially the existence of $\varphi$ means that for any $a+b'\sqrt p$ there exist $c,d$ such that $\varphi(a+b'\sqrt p) = a+b\sqrt p = c+d\sqrt q$ (where $b$ might be a sign change of $b'$). Take, to simplify $a=0, b=1$. Let $\alpha = \sqrt p - d\sqrt q = c$, from above. We can rearrange to obtain $$\begin{align}&(\alpha-\sqrt p)^2 = d^2q \Rightarrow \\ \Rightarrow& \ \alpha^2 - 2\alpha\sqrt p + p - d^2q = 0 \\ \Rightarrow& \ \sqrt p -\frac{c^2+p-d^2q}{2c} = \sqrt p - \lambda = 0\end{align}$$  But then it has to be that $(x^2-p) \mid (x-\lambda)$, which cannot be.  This proof however doesn't satisfy me for two reasons. First of all, I'd like to have stopped at the polynomial I found in $\alpha$,  shown that it was irreducible in $\mathbb Q(\sqrt2)$, and argued in terms of extension degrees. However I don't know how to show that. The second reason is that I'm not using the primality of $p,q$ other than having it imply the irreducibility of $x^2-p$. It seems to me from the way the exercise is worded that if they were compound and $x^2-p,x^2-q$ were still irreducible, we might have a homomorphism.  Can someone clarify?

Page 105 of D. Burton's A First Course in Rings and Ideals reads     It is not difficult to show that if (I'll call them $n$ and $m$ instead of $n_1$ and $n_2$) $n$, $m$ are square free integers, then $\mathbb{Q}(\sqrt{n}) \cong \mathbb{Q}(\sqrt{m})$ if and only if $n=m$.   Well, it is getting difficult for me, any help or would be appreciated.    My progress so far: Suppose $\phi :\mathbb{Q}(\sqrt{n})\to\mathbb{Q}(\sqrt{m})$ is an isomorphism. Then $\phi(u)=u$ for every $u \in \mathbb{Q}$, so that $\phi(\sqrt{n})^2=\phi(n)=n$. If $\phi(\sqrt{n})=a+b\sqrt{m}$ for some $a,b\in\mathbb{Q}$, then $(a+b\sqrt{m})^2=a^2+b^2m + 2ab\sqrt{m}=n$ implies $$a^2+b^2m = n$$ and $$2ab=0.$$  Then $b=0$ cannot happen since that would imply that $\sqrt{n}\in\mathbb{Q}$, where $n$ is a square-free integer. Also $a=b=0$ cannot happen. Hence $a=0$ and we have $$b^2m=n.$$ If $\psi:\mathbb{Q}(\sqrt{n})\to\mathbb{Q}(\sqrt{m})$ were an isomorphism then there would exist some $s\in\mathbb{Q}$ such that $$s^2m=n,$$ then $s=b$ or $s=-b$. Therefore the only isomorphisms from $\mathbb{Q}(\sqrt{n})$ to $\mathbb{Q}(\sqrt{n})$ are $\phi(u+v\sqrt{n})=u+vs\sqrt{m}$ and $\psi(u+v\sqrt{n})=u-vs\sqrt{m}$.    I don't know if there's an easier way and I don't know if I'm in the correct way here. Thanks beforehand :)


I asked  about whether I need to re-apply for my mortgage in order to not have to pay private mortgage insurance anymore. All answers mentioned that this is not necessary.  However, I'm wondering if the answers apply only to the original appraised value. In other words, do I need to remortgage if I appraise my house again, and the house is appraised at a higher value and therefore I end up owning a higher percentage of the home than before? Can lenders request me to apply for a new mortgage in order to get rid of PMI based on a new appraisal?

I called my lender last week. I am close to owning 20% of my home and want to get rid of PMI. They said I can only do it by remortgaging my house. Is that true? With the mortgage rates increasing, I will definitely lose some money by remortgaging the house.  Also, I know that I can request the PMI charge to stop if I own 20% of the value of the home, or it will stop automatically once I own 22% of the value. Is it possible that the lender meant I can't do it with 20% but it will be done at 22% automatically without the need to remortgage the house?


I am working with below code :   List<String> layerDataList = new ArrayList<String>(); if (layerDataList.isEmpty()) {   layerDataList.add(layerData); }  Iterator<String> lir = layerDataList.iterator(); // Iterator created  while (lir.hasNext()) {   String layerD = lir.next();   if (layerD != layerData) {     layerDataList.add(layerData);   } }   I got exception : java.util.ArrayList$Itr.checkForComodification(Unknown Source)  What is the issue?

We all know you can't do the following because of ConcurrentModificationException:  for (Object i : l) {     if (condition(i)) {         l.remove(i);     } }   But this apparently works sometimes, but not always. Here's some specific code:  public static void main(String[] args) {     Collection<Integer> l = new ArrayList<>();      for (int i = 0; i < 10; ++i) {         l.add(4);         l.add(5);         l.add(6);     }      for (int i : l) {         if (i == 5) {             l.remove(i);         }     }      System.out.println(l); }   This, of course, results in:  Exception in thread "main" java.util.ConcurrentModificationException   Even though multiple threads aren't doing it. Anyway.  What's the best solution to this problem? How can I remove an item from the collection in a loop without throwing this exception?  I'm also using an arbitrary Collection here, not necessarily an ArrayList, so you can't rely on get.


I have a surface pro 3 with a 32gb SD card. I've set the OneDrive location to this SD card (since they removed the placeholder feature and so I am forced to download everything). The drive letter assigned to the SD card is D:\, verified by disk management utility.  The problem is that I am unable to acces this drive/card with command line - both regular and admin elevated. ie, the command cd D:\ simply just returns nothing and stays in the current folder.   This is causing quite a few command line tools to break on my computer as it dosnt return an error (but nothing seems to work).   The answer marked below is correct. However, for more information try

This may be a silly question, and I think I have looked elsewhere to find the answer...  Might be a path issue, but when I open the command line and type from the C:\>: cd D:\  I cannot get to the D drive.  Even if I type: cd D:\<folder name>  The command.exe will auto-complete the line with the tab key, so it knows where I'm at.  It just doesn't print to screen the result or actually get me there.  This problem exists for the network drives as well. Now, if I use the chdir (cd) command like this: chdir D: or cd d: I get the print out of the D:\ below the command but it still says I'm in the C:\. I feel like I'm missing something simple.


I have a problem. How can I test in C++ if I have latitude and longitude of a point(a car with GPS) and I need to find if the point is inside the area of a circle. I have the center of the circle in latitude and longitude and the radius is in km.  For example:  I'm in the point :  52.51523649714909 13.18586926568004  And the circle center position is:  48.147763 11.563454 radius : 50km   I have this values from the project I need to resolve.

How do I calculate the distance between two points specified by latitude and longitude?  For clarification, I'd like the distance in kilometers; the points use the WGS84 system and I'd like to understand the relative accuracies of the approaches available.


I am new to python decorators and I tried to count calls with primitive counter and it failed:  def logging_calc(func):     counter = 0      def inner(a,b):         counter += 1         print(counter)         return func(a,b)     return inner   but if I set counter to be a dictionary it succeed.  def logging_calc(func):     counter.calls = 0     def inner(a,b):         counter.calls += 1         print(counter.calls)         return func(a,b)     return inner   help me understand please :)

The following code works as expected in both Python 2.5 and 3.0:  a, b, c = (1, 2, 3)  print(a, b, c)  def test():     print(a)     print(b)     print(c)    # (A)     #c+=1       # (B) test()   However, when I uncomment line (B), I get an UnboundLocalError: 'c' not assigned at line (A). The values of a and b are printed correctly. This has me completely baffled for two reasons:   Why is there a runtime error thrown at line (A) because of a later statement on line (B)? Why are variables a and b printed as expected, while c raises an error?   The only explanation I can come up with is that a local variable c is created by the assignment c+=1, which takes precedent over the "global" variable c even before the local variable is created. Of course, it doesn't make sense for a variable to "steal" scope before it exists.  Could someone please explain this behavior?


I have been trying to solve the following recurrence relation  $$T(n)=2T(\frac{n}{2}) + nlgn$$ by using substitution method.  I started to compute $T(1)$ ,$T(4)$,$T(8)$,$T(16)$ to guess a solution as below:  $$T(1)=1$$ $$T(2)=2+2lg2=4$$ $$T(4)=8+8lg2=16$$ $$T(8)=32+24lg2=56$$ $$T(16)=112+64lg2=176$$  My guess is that $T(n)$ should be something like $nlg^2n$ but I couldn't get a correct term.  Can anyone improve my guess?

How can I solve the recurrence relation $T(n) = 2T(n/2) + n\log n$? It almost matches the Master Theorem except for the $n\log n$ part.


I currently have 3 monitors, usually I also have 1 TV on the setup. When the TV is present, it's connected to a Yamaha A2050, which is connected to PC by HDMI. ATM Yamaha is connected to one of my monitors.  Sometimes, when I change Yamaha's input or turn off TV, or now when I change monitor input from PC (DVI-D) to Yamaha (HDMI), Windows understands that the display was disconected. Windows tries to rearrange monitors layout, that leads to a long time DWM hang and moves windows to different positions.  I believe the situation gets worsse because Yamaha display is set as main display.  I'd like Windows/DWM to stop freaking out and hanging. Whatever is making displays seem disconnected will bring them back soon enough.  Is there a way to disable this "feature"?

I'm using Windows 7 + Windows Media Center for my HTPC. It works great except from one annoying issue. Whenever I turn off my TV while listening to music, the music stops for a second or while Windows 7 tries to figure out what monitor is attached. After that second it settles down on a default 800x640. While not a big deal, it is annoying as I don't want to have the TV on while playing music.  Is there anyway to fix the monitor/disable monitor auto-detection on Windows 7 so it would not start recalibrating everything when I turn off my TV?


Suppose a blind person wanted to know whether a switch (such as a light switch) was on or off (also suppose the switch was vertical.  Wouldn't it be natural to think that top (=1), would mean on, and bottom (=0), would mean off.  You think about the scenarios (I might edit the question, later).  But then what if more than one switch was connected to the same light? For the case of two switches   U: SameOrientation =   {((0,1), (0,1)), ((1,0), (1,0))}  V: DifferentOrientation =   {((0,1), (1,0)), ((1,0), (0,1))}  for which there are only two possible electrical wiring configurations:  U = Off, V = On  or  U = On, V = Off  In both cases, for the switches to "be standard", both switches would need to communicate, via a circuit, so that when one would be propped on, the other one would switch on as well  (just the same if one is switched off: and the other switch automatically switches off as well).  Any other ideas, or views?

Most of us use switches every day in various forms.  And although there are sometimes general norms in countries as to which direction is "on", there is variation between countries.  So when developing a product with a switch in it, which direction makes the most sense for "on", and why?  I'm not talking about other ways of showing that they will be on or off, I'm more talking about whether "on" is up, down, left, or right.  Any research on this would be appreciated.


In 2019 we plan to give $25,000 to our 26 yr old grandchild.  All of our ready cash is in joint checking and savings accounts, with both names on the checks.  Can we write one $25,000 check as a gift without having to file the gift tax return?  If we have to write separate checks, must they be of equal amount.  Is there anything relevant in the timing of the gifts if two checks must be written?

My sister and I would like to give another relative $25,000 as a gift.  We have a joint bank account together, and had planned on writing a single check from the joint account for the full amount.  We consider the gift as being half from each of us, so $12,500 per person, safely under the annual gift allowance.  However, since the full amount is over the annual gift allowance and I'd be the only one signing the check, would the IRS consider this more as a single gift from me, which would be over the annual gift allowance?  It would be much less convenient to send two checks, one from each of us, but if it's the only way to avoid having to fill out the gift tax form with my taxes, that's what we would wind up doing.


I am running VM Workstation 12 Player and have installed Ubuntu 16.10 on the VM.  I have made an extended partition for the swap space after having had to remove the swap partition in order to extend the primary partition space.  I enter   fdisk -l   and get  Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x7d4da0a8  Device     Boot     Start       End   Sectors  Size Id Type /dev/sda1  *         2048 157700095 157698048 75.2G 83 Linux /dev/sda2       157700096 159793151   2093056 1022M  5 Extended   Yet, when I type  sudo mkswap /dev/sda2   I get  mkswap: error: swap area needs to be at least 40 KiB   It seems that I have just over 1 GB of space on /dev/sda2

I did not create a swap partition during Ubuntu installation.  Later, I freed up some space and made a swap partition.  Now after each boot up, I am manually opening gparted to right-click the swap partition to turn on the 'swapon' option.  How can I automatically enable the swap partition at boot?  Also, if I had not created the swap partition, what are my other options?


I am trying to install packages using apt-get: root@ubuntu:/# sudo apt-get install build-essential libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext unzip Reading package lists... Done Building dependency tree Reading state information... Done Package libcurl4-gnutls-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Unable to locate package build-essential E: Unable to locate package libssl-dev E: Package 'libcurl4-gnutls-dev' has no installation candidate E: Unable to locate package libexpat1-dev E: Unable to locate package gettext E: Unable to locate package unzip  My main goal is to install package make , which I need to manually install a lower version of PHP This is what happened: root@ubuntu:~/php-5.4.31# make The program 'make' is currently not installed. You can install it by typing: apt-get install make  And then I go on and do apt-get install make root@ubuntu:/# apt-get install make Reading package lists... Done Building dependency tree Reading state information... Done Package make is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'make' has no installation candidate  I am running Ubuntu 14.04.1 LTS on a virtual machine (Hyper-V) if that helps

There are now errors when updating and I cannot install most software due to a corrupted  /etc/apt/sources.list   file. Is there a copy I can download to replace it?  The file would be for Ubuntu 12.04 (Final Beta) in the United States.


I'm not expecting much as I've searched the and tried a whole bunch of stuff, but any help would be appreciated. Running 16.04 until I hit the login loop. I tried recovery modes and tty logins everything I could find. I resorted to installing 16.04 on a new partition just so I could get back on the system. I have additional accounts on the downed system but all of them are locked out. I tried restoring the .Xauthority and other authentication files. Not using any nvidia drivers: Kernel driver in use: i915. Any suggestions? Thanks  Sorry but I am new to Ubuntu and if I knew what exactly I should be looking for I would have included that info. I have zero access to an Ubuntu install, either thru the GUI or thru the command line. All I get back from my login attempts in the tty is: "Invalid password" Part of my confusion is that I had to install Ubuntu onto a new partition just to get any access to the computer. Probably was a better way but it was all I could come up with. Now that I am on the new partition on the new Ubuntu install I am not sure I am looking at the correct info on the correct partition. So when you ask for the output of "ls -ld" how do I run that for the downed system and not the one I am currently using? Thanks for helping me define my question better (or maybe I made it worse)

My Ubuntu is stuck in a login loop when trying to enter my desktop. When I login, the screen gets black and soon after that the login screen comes back.   I've read that the problem might be caused by an error depending on the graphics, here's my graphics card: ATI Radeon 7670M


I accidentally deleted Cortana (okay it wasn't an accident). By running  rm -rf /c/Windows/SystemApps/Microsoft.Windows.Cortana_cw5n1h2txyewy/*   in bash. Cortana was gone (yay!) but now I can't search anything from the start menu (unintended and unacceptable consequence). I need to get this feature back but I don't know how. I could live with re-installing Cortana, but I'm not sure how to do that. Another solution that enables searching from the windows start menu without Cortana would be better.

With reference to:    I removed the Cortana packages from my running Windows 10 using the method posted by magicandre1981 and using  win6x_registry_tweak.   My question is how can I re-install Cortana (or for that matter any other package removed similarly)?  I have opened up the install.wim image (converted from a Win 10 install.esd file) and found Cortana in the system apps folder, but don't know how / what to use to re-install it.  Any help please?


I'm very new to blender, and I have this problem where I have unwanted indenting on my donut icing. I don't know what caused this, and I don't know how to get rid of it either. It looks like this:  Thanks in advance.

I tried to follow the new Blender 2.8 tutorial from Blender Guru.   When entering "Sculpting" with the icing there were suddenly alot of holes in it. Why is this?


Ok. So I defeated the wall of flesh. I created this a mushroom biome and the truffle won't move in. I have a mushroom door, mushroom work bench, a table, torches, and it's made out of mushroom grass. There are also mushroom monsters that I see in the underground mushroom biome and I see the giant mushrooms in the background. I know there is not a crimson or a corrupt biome nearby by because I cleansed them. My house is also the right heigth. The truffle keeps saying he wants to move in. Please help me figure out why the truffle won't move in.

I currently find myself in a pickle because even after I've built the mushroom biome and met all other requirements, the Truffle NPC won't move in.   I've defeated not only the Wall of Flesh but Ocram already. Created a surface mushroom biome. Built a house made out of mushrooms with mushroom furniture.   I have no idea how long it takes for the NPC to move in or if I'm wrong in any of the steps.


I use LaTeX and TexStudio.  I work with transripts and have so far found \longtable to be my best friend, e.g.:  \begin{longtable}[H]{p{1.7cm}p{11.5cm}}     Ignoramus  &  Richard, what are your favourite animals? \\     Richard    &  Gnus, penguins and deers, of course! \\     \caption*{(Animal talk)}  \end{longtable}   I have to make (yet another) dozens of such dialogues. Soe of them are quite long - that's one reason to use longtable.  I have tried to figure out how I can make a macro or something to let me insert a template like:  \begin{longtable}[H]{p{1.7cm}p{11.5cm}}        &   \\     \caption*{()}  \end{longtable}   but to no avail.  It seems that in   It seems that kileuser have this option:   What is the simple solution for a TexStudio user?

This is not about new macros like \newcommand, \def and others. This is not about autocompletion like using .cwl (in TexStudio) This is also not about using shortcuts for predefined commands that are listed in the shortcuts sections.   It is more closely related to the 3. Though. I want to define shortcuts for commands that are not listed there.  e.g. When I type Ctrl + Shift + B, I want   \begin{bmatrix} \end{bmatrix}   to be inserted just like Ctrl+ Enter inserts \\.


Could you explain the usage of it in the following sentences?   I don't like it  when you speak like this. I hate it when you speak like this. I know it for certain that he is in town now. He owes it to his brother that he became a research chemist.

I wanted to leave the question title as is so as not to take away from my amusement :).  Anyway,     It's raining.   What is raining? Is it the sky? The clouds? The weather? The rain? What is "it"? Any historical insights on the statement?


Is there a quick way to see how many people I've helped ("reached") across all SE sites?

The New Model profiles on Meta.SE (pretty big improvement!) have a section for "" stat.  Now, unless I'm much mistaken, that stat is specific to a given site on the network.  If that assumption is indeed correct, is there a way to find out the "People Reached" summary across 100% of the sites on the network for all your connected profiles?