Bulk upsert (insert-update) a csv in postgres
How to UPSERT (MERGE, INSERT ... ON DUPLICATE UPDATE) in PostgreSQL?
What does the '!!!' syntax mean in javascript? MySQL 5.5.16 allows anonymous connections Apparently, I can connect to MySQL (at least from my localhost) without having to provide any username or password. I can even put anything as username, as long as the password is empty. I have access to the information_schema and test databases. I can create tables. If I run SELECT USER() it returns the proper value randomstring@localhost, where the random string is whatever I used for username when I connected.  The mysql.user table contains root@localhost, root@127.0.0.1, @localhost and pma@localhost. I manually set encrypted passwords to all the records (UPDATE user SET password=...) and only root has any privileges, the other two records have "N" for all privileges. That record with the empty username looks suspicious, but I don't think it has anything to do with this and I think it was there from the beginning.  To make matters worse, if I add a user with a password, I can only connect using empty string as password (just like if I put anything as username). If I try to connect using the username I created and password I supplied when creating it (CREATE USER .. IDENTIFIED BY ..) it doesn't work.  Does anyone know what is wrong and how I can fix this?  Note: I am using MySQL 5.5.16 for Windows, provided by the XAMPP package. How to append to a file with fstream fstream::app flag seems not to work Generalized Euler sum $\sum_{n=1}^\infty \frac{H_n}{n^q}$ I found the following formula   $$\sum_{n=1}^\infty \frac{H_n}{n^q}= \left(1+\frac{q}{2} \right)\zeta(q+1)-\frac{1}{2}\sum_{k=1}^{q-2}\zeta(k+1)\zeta(q-k)$$  and it is cited that Euler proved the formula above , but how ?  Do there exist other proofs ?  Can we have a general formula for the alternating form   $$\sum_{n=1}^\infty (-1)^{n+1}\frac{H_n}{n^q}$$ Boundary Question in $\mathbb{R}^{2}$ (Manifolds) Probability brain teaser with infinite loop I found this problem and I've been stuck on how to solve it.     A miner is trapped in a mine containing 3 doors. The first door leads to a tunnel that will take him to safety after 3 hours of travel. The second door leads to a tunnel that will return him to the mine after 5 hours of travel. The third door leads to a tunnel that will return him to the mine after 7 hours. If we assume that the miner is at all times equally likely to choose any one of doors, what is the expected length of time until he reaches safety?   The fact that the miner could be stuck in an infinite loop has confused me. Any help is greatly appreciated. Who fired the shot and what is the symbolism in firing shot right next to Lucas at the end of the movie? At the end of , during the deer hunt, there’s a shot fired right next to Lucas (deliberately missing the shot).   Who fired the shot? Is it Theo's son? What is the meaning of that scene? Is someone warning Lucas that he made a mistake and definitely, Lucas will be punished in the future? Direction of friction when a car turns This question is present as a matter of historical interest.  While you are encouraged to help maintain its answers, please understand that "big list" questions are not generally allowed on Ask Ubuntu and will be closed per the .   It is possible to greatly extend the usage time of a laptop or netbook running on battery by disabling various services and installing various packages.   What tricks or tips do people have for getting an extra hour or two out of their batteries? What are the prerequisites to studying general relativity? This question recently appeared :     Slashdot posts a fair number of physics stories. Many of us, myself included, don't have the background to understand them. So I'd like to ask the Slashdot math/physics community to construct a curriculum that gets me, an average college grad with two semesters of chemistry, one of calculus, and maybe 2-3 applied statistics courses, all the way to understanding the mathematics of general relativity. What would I need to learn, in what order, and what texts should I use? Before I get killed here, I know this isn't a weekend project, but it seems like it could be fun to do in my spare time for the next ... decade.   It seems like something that would be a good addition to this site: I think it's specific enough to be answerable but still generally useful. The textbook aspect is covered pretty well by , but beyond that: What college-level subjects in physics and math are prerequisites to studying general relativity in mathematical detail? ID for Contact portion of Person Account Is it possible to get the ID of a Contact which is part of a Person Account?  I have a custom object which has a custom field referencing the Person Account, though it seems to be referencing the Contact directly. I have created a button which I am using to pass the ID into a Visualforce Page.  With the Insert Field drop-down on the create/edit button page I can put in {!Account.Id} or {!Contact.Id} but neither of these work. The Account ID is placed in the URL but is not the correct ID and the Contact ID is blank, which I assume is because the button is on a Person Account page and not a Contact Page. I have a JavaScript object. Is there a built-in or accepted best practice way to get the length of this object? const myObject = new Object(); myObject[&quot;firstname&quot;] = &quot;Gareth&quot;; myObject[&quot;lastname&quot;] = &quot;Simpson&quot;; myObject[&quot;age&quot;] = 21; Why it's true? $\arcsin(x) +\arccos(x) = \frac{\pi}{2}$ The following identity is true for any given $x \in [-1,1]$: $$\arcsin(x) + \arccos(x) = \frac{\pi}{2}$$  But I don't know how to explain it. I understand that the derivative of the equation is a truth clause, but why would the following be true, intuitively?  $$\int^{x}_{C1}\frac{1\cdot dx}{\sqrt{1-x^{2}}} + \int^{x}_{C2}\frac{-1 \cdot dx}{\sqrt{1-x^{2}}} =\\  \arcsin(x) - \arcsin(C1) + \arccos(x) - \arccos(C2) = 0 \\  \text{while } \arcsin(C1) + \arccos(C2) = \frac{\pi}{2}$$  I can't find the right words to explain why this is true?    Edit #1 (25 Jan, 20:10 UTC): The following is a truth clause: $$ \begin{array}{ll} \frac{d}{dx}(\arcsin(x) + \arccos(x)) = \frac{d}{dx}\frac{\pi}{2} \\ \\ \frac{1}{\sqrt{1-x^{2}}} + \frac{-1}{\sqrt{1-x^{2}}} = 0 \end{array} $$  By integrating the last equation, using the limits $k$ (a constant) and $x$ (variable), I get the following:  $$ \begin{array}{ll} \int^x_k\frac{1}{\sqrt{1-x^{2}}}dx + \int^x_k\frac{-1}{\sqrt{1-x^{2}}}dx = \int^x_k0 \\ \\ \arcsin(x) - \arcsin(k) + \arccos(x) - \arccos(k) = m  \text{ (m is a constant)}\\ \\ \arcsin(x) + \arccos(x) = m + \arcsin(k) + \arccos(k) \\ \\ \text{Assuming that } A = m + \arcsin(k) + \arccos(k) = \frac{\pi}{2} \text{ ,for } x \in [-1,1] \end{array} $$ Using Calculus, why is that true for every $x \in [-1,1]$?    Edit #2:  A big mistake of mine was to think that $\int^x_k0 = m \text{ (m is const.)}$, but that isn't true for definite integrals.  Thus the equations from "Edit #1" should be as follows: $$ \begin{array}{ll} \int^x_k\frac{1}{\sqrt{1-x^{2}}}dx + \int^x_k\frac{-1}{\sqrt{1-x^{2}}}dx = \int^x_k0 \\ \\ \arcsin(x) - \arcsin(k) + \arccos(x) - \arccos(k) = 0\\ \\ \arcsin(x) + \arccos(x) = \arcsin(k) + \arccos(k) \\ \\ A = \arcsin(k) + \arccos(k) = \frac{\pi}{2} \text{ ,for } x \in [-1,1] \end{array} $$ Why aren't logarithms defined for negative $x$? Sometime I see many application such as msn, windows media player etc that are single instance applications (when user executes while application is running a new application instance will not created).  In C#, I use Mutex class for this but I don't know how to do this in Java. K out of N encryption How can I get the list of files in a directory using C or C++? How can I determine the list of files in a directory from inside my C or C++ code?  I'm not allowed to execute the ls command and parse the results from within my program. Is there a way to get the (to-be-generated) SQL from a Hibernate Criteria?  Ideally, I would have something like:  Criteria criteria = session.createCriteria(Operator.class);  ... build up the criteria ... ... and then do something like ...  String sql = criteria.toSql()  (But this of course does not exist)   The idea would then be to use the SQL as part of a huge 'MINUS' query (I need to find the differences between 2 identical schemas - identical in structure, not in data - and the MINUS is not supported by Hibernate)  (BTW I know I can check the SQL from the log files) How do you show a hidden folder (whose name starts with .) in File Manager a.k.a. Nautilus on Ubuntu?  I am somewhat new to Ubuntu and can't seem to find the "view" menu. about Linux's zip utility says this about the -u flag:     Replace (update) an existing entry in the zip archive only if it has been modified more recently than the version already in the zip archive. For example:          zip -u stuff *   will add any new files in the current directory, and update any files which        have been modified since the zip archive stuff.zip was last created/modified.   My question is, if a particular file has been removed since the last time it was zipped, whether -u will recognize that the file has been removed and thus remove it from the *.zip file?  Or, lacking timestamp information (since the file is now removed), it will leave the backed up file in *.zip, since there is no "newer" file?