POST:- is used to create and update resources PUT:- is used to update existing resources  Can I use POST instead of PUT method? and If I use POST method over PUT method, what will be disadvantages?  If POST can do work of PUT method, why PUT method is required?
According to , POST is used to create a resource:  The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line.  According to , PUT is used to create or replace a resource:  The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI.  So which HTTP method should be used to create a resource? Or should both be supported?
Disabling Intel Turbo Boost in ubuntu How many ways can $133$ be written as sum of only $1s$ and $2s$ Since last week I have been working on a way, how to sum $1$ and $2$ to have $133$.  So for instance we can have $133$ $1s$ or $61$ $s$2 and one and so on. Looking back to the example: if we sum: $1 + 1... + 1 = 133$ there is only one way. But for the second one there will be $131$ possible ways. And I have to do this for every possible combination. I am stuck with it and I have no idea whatsoever on how to begin.  Any ideas or methods I could use guys? $(S^1 \times [0,1])/\sim$ homeomorphic to unit disk $ D^2$ Let $\sim$ be the equivalence relation on $S_1 \times I$ given by $(x,t)\sim(y,s)$ if and only if $xt=ys$ where $I=[0,1]$  How do I prove that $(S_1 \times I)/\sim$ is homeomorphic to the unit disk $D^2$ with the induced topology? Let $p &gt; 3$ be a prime such that $p \equiv 2 \pmod 3$. Define the elliptic curve $E$ over $\mathbb{F}_p$ by $y^2 = x^3 + 1$. Prove that $E(\mathbb{F}_p)$ consists of $p+1$ points.  Using Fermat's little theorem you can prove that $x^3 + 1$ is a bijection on $\mathbb{F}_p$. Hence, $$\#E(\mathbb{F}_p) = \#\{(x,y) \in \mathbb{F}_p^2 : y^2 = x^3 + 1\} + \#\{\infty\} = \#\{(x,y) \in \mathbb{F}_p^2 : y^2 = x\} + 1.$$ But then I am stuck trying to prove that $y^2 = x$ has $p$ solutions $(x,y) \in \mathbb{F}_p^2$. How can I SELECT rows with MAX(Column value), PARTITION by another column in MYSQL? My table is:     id home datetime player resource     1 10 04/03/2009 john 399   2 11 04/03/2009 juliet 244   5 12 04/03/2009 borat 555   3 10 03/03/2009 john 300   4 11 03/03/2009 juliet 200   6 12 03/03/2009 borat 500   7 13 24/12/2008 borat 600   8 13 01/01/2009 borat 700     I need to select each distinct home holding the maximum value of datetime. Result would be:     id home datetime player resource     1 10 04/03/2009 john 399   2 11 04/03/2009 juliet 244   5 12 04/03/2009 borat 555   8 13 01/01/2009 borat 700     I have tried: -- 1 ..by the MySQL manual:   SELECT DISTINCT   home,   id,   datetime AS dt,   player,   resource FROM topten t1 WHERE datetime = (SELECT   MAX(t2.datetime) FROM topten t2 GROUP BY home) GROUP BY datetime ORDER BY datetime DESC  Doesn't work. Result-set has 130 rows although database holds 187. Result includes some duplicates of home. -- 2 ..join  SELECT   s1.id,   s1.home,   s1.datetime,   s1.player,   s1.resource FROM topten s1 JOIN (SELECT   id,   MAX(datetime) AS dt FROM topten GROUP BY id) AS s2   ON s1.id = s2.id ORDER BY datetime   Nope. Gives all the records. -- 3 ..something exotic:   With various results. Embedding C++ Objects into QML with Context Properties According to Qt5 documentation:  all public slots of C++ classes that inherit from QObject, are accessible from QML Here what I did:  C++  class MyClass : public QObject {     Q_OBJECT  public slots:     void doStuffFromQmlSlot()     {         qDebug() &lt;&lt; Q_FUNC_INFO;     }  public:     MyClass()     {         qDebug() &lt;&lt; Q_FUNC_INFO;     } };   my main.cpp contains:  MyClass myClass; QQmlEngine engine; engine.rootContext()-&gt;setContextProperty( "myclass", &amp;myClass ); QQmlComponent component( &amp;engine, QUrl::fromLocalFile("qml/qtquick-01/main.qml") ); component.create();   QML  import QtQuick 2.0  Rectangle {     width: 360     height: 360     Text {         text: qsTr("Hello World")         anchors.centerIn: parent     }     MouseArea {         anchors.fill: parent         onClicked: {             myclass.doStuffFromQmlSlot();              Qt.quit();         }     } }   Actually the QtCreator seems to recognixe the exposed myclass object into the QML as it enables auto-completion of both class name (myclass) and the public slot doStuffFromQmlSlot(). When I run the application I unfortunately got the following error:  ReferenceError: myclass is not defined  Any clue on what I'm doing wrong? Double and triple substitution in bash and zsh Follow-up to the background part in .  In bash I can use ${!FOO} for double substitution, in zsh ${(P)FOO}. In both, the old-school (hack-y) eval \$$FOO works.  So, the smartest and most logical thing for me would be ${${FOO}}, ${${${FOO}}}… for double/triple/n substitution. Why doesn’t this work as expected?  Second: What does the \ do in the eval statement? I reckon it’s an escape, making something like eval \$$$FOO impossible. How to do a triple/n substitution with that that works in every shell? As a native English speaker, which two further languages would give me the most travel utility worldwide? This follows on from a travel conversation a group of us had in a hostel in London.  Assuming I am travelling randomly between countries and continents, which two languages in addition to English would provide the most usefulness in any given country?  I suspect Spanish (North America, South America) and French (Europe, Africa) but with the base understanding between French and Spanish maybe the time would be best spent learning another language?  This question is a real puzzler since the following constraints apply   Length of time required to be "functional" in the language (cost-time trade off) Chance of reaching proficiency within any meaningful timeframe (Mandarin) Regional dialects destroying proficiency (Arabic) Easier Secondary languages underpinning the society (Arabic versus French argument) Similarity of Language families (Romance) leading to wasted effort (Italian v French) Utility of the Language (German versus English when English is understood) Enjoyment is a minor consideration   Happy to consider any other thoughts but it is a really interesting topic for consideration if you are linguistically minded. What is the difference between a "proof by contradiction" and "proving the contrapositive"? Intuitive, it feels like doing the exact same thing. And when I compare an exercise, one person proves by contradiction, and the other proves the contrapositive, the proofs look almost exactly the same.  For example, say I want to prove: $P \implies Q$ When I want to prove by contradiction, I would say assume this is not true. Assume $Q$ is not true, and $P$ is true. Blabla, but this implies $P$ is not true, which is a contradiction.  When I want to prove the contrapositive, I say. Assume $Q$ is not true. Blabla, this implies $P$ is not true.  The only difference in the proof is that I assume $P$ is true in the beginning, when I want to prove by contradiction. But this feels almost redundant, as in the end I always get that this is not true. The only other way that I could get a contradiction is by proving that $Q$ is true. But this would be the exact same things as a direct proof.   Can somebody enlighten me a little bit here ? For example: Are there proofs that can be proven by contradiction but not proven by proving the contrapositve? Proof by induction that $2 + 4 + 6 + \cdots + 2n = n(n+1)$ Open source computer algebra systems for general relativity I would like to use an open source computer algebra system (CAS) for research in general relativity. Kindly suggest a good choice between Ipython and Sage. I am more interested in the theoretical aspect rather than numerical computations. Count if two criteria match while ignoring duplicates I have a simple Sheet with 2 cells that I need to countif 2 conditions match and treat  duplicates as 1.  Column A    Column B Male        closed Female      invalid # Male        exception Male        closed Male        closed Female      new   I would like a formula that counts Male closed and return 1 result (ignoring duplicates) Best way to hide a window from the Alt-Tab program switcher? I've been a .NET developer for several years now and this is still one of those things I don't know how to do properly. It's easy to hide a window from the taskbar via a property in both Windows Forms and WPF, but as far as I can tell, this doesn't guarantee (or necessarily even affect) it being hidden from the Alt+↹Tab dialog. I've seen invisible windows show up in Alt+↹Tab, and I'm just wondering what is the best way to guarantee a window will never appear (visible or not) in the Alt+↹Tab dialog.  Update: Please see my posted solution below. I'm not allowed to mark my own answers as the solution, but so far it's the only one that works.  Update 2: There's now a proper solution by Franci Penov that looks pretty good, but haven't tried it out myself. Involves some Win32, but avoids the lame creation of off-screen windows. Is it possible to add images to comments? I was wondering if it is possible to post a comment with an image.  Recently, during a question about data-visualization in Cross Validated, there was a controversy about using one type of chart for another.   I had posted a question about pie-charts, after reading some references I decided to build an example and clarify the point of using waffle-chart vs pie-chart. In a way, my example was not an answer it was more properly a comment on waffle-charts. But it seems to be impossible to post a comment with an image (Maybe, there is a way but I can't figure out how).  I don't know if it is relevant to post images in comments in other SO sites. So, if there is no way to post images in comments... why not making it possible? And if there is a way to post an image with a comment, how I can do it? I'm trying to prove commutativity of addition for vector spaces, using the axioms for vector spaces. Apparently commutativity can be proven! Im having trouble getting a good feel for what is allowed and what is not. Here's my work so far:  $u+v+u+v = 2(u+v) = 2u + 2v = u+u+v+v = u+(u+v)+v$  Here I just wanna claim that $u+(v+u)+v = u+(u+v)+v$   $\Rightarrow -u+u+(v+u)+v+(-v) = -u+u+(u+v)+v+(-v)$ : here im just adding -u to the right, and -v to the left. Question: is this "adding to both sides" really legit in this context? Why?   Quick help proof: $-v+v = (-1)v+(1)v = (-1+1)v = 0v = 0 = v-v$  And another: $ 0+v = v+(-v) + v = (1)v + (-1)v + v = (1-1)v + v = v = v+0$  We have $0 + (u+v) + 0 = 0+(v+u)+0 \Rightarrow u+v = v+u$  This feels ugly and not at all elegant, especially the great leap "add -u to both sides" feels completely out of place. Do I need more lemmas? Is there a more elegant way?   //not homework or anything, just for my own pleasure, feel free to provide theory, as it is more insightful than solutions. :) Thanks!   EDIT: corrected notation a little. The  currently says  In the context of Stack Exchange sites, any copying and pasting of any amount of text or code that wasn't written by you is plagiarism if you try, explicitly or implicitly, to pass it off as your own work. (italics mine)  There is also a concept of . Should this also be addressed in the FAQs? In other words, is it OK to copy (large parts of) your own answer  without proper attribution? include svg images with the svg package A company is any form of business whether it is small or large. Generally the term &quot;company&quot; indicates a particular kind of business dealing in a specific product. An organisation is the larger form and generally comprises of a number of companies.  Simply, a company is an organization, but an organization is not just a company. An industry is the combination of companies in same line of business. Firm, corporation and business  are synonyms of &quot;company&quot;. An Agency is a particular kind of company, which serves as an intermediary between clients (other companies or individuals).  Is this correct? I run below command on ubuntu 16.4 :  sudo add-apt-repository ppa:noobslab/apps  of below question:    and get below error:  Traceback (most recent call last):   File "/usr/bin/add-apt-repository", line 11, in &lt;module&gt;     from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in &lt;module&gt;     import apt_pkg ModuleNotFoundError: No module named 'apt_pkg' Error in sys.excepthook: Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook     from apport.fileutils import likely_packaged, get_recent_crashes   File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in &lt;module&gt;     from apport.report import Report   File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in &lt;module&gt;     import apport.fileutils   File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in &lt;module&gt;     from apport.packaging_impl import impl as packaging   File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in &lt;module&gt;     import apt   File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in &lt;module&gt;     import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'  Original exception was: Traceback (most recent call last):   File "/usr/bin/add-apt-repository", line 11, in &lt;module&gt;     from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in &lt;module&gt;     import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'   Thanks for help For almost a year now, I have been in the uncomfortable position of having an idea.  However, there is one nice thing about this idea.  It makes a concrete, exact and relatively easy to test physical prediction.  The idea predicts that there is a 11,187 m/s (Earth’s escape velocity) aethereal wind directly into the surface of the Earth at its surface.  I believe it would be possible to test this by performing a vertical variation of modern versions of the Michelson-Morley experiment (MMX) with one arm pointed in the vertical direction. ()  In 2003, Müller et al. performed a normal (2 horizontal orthogonal arms) modern MMX using cryogenic optical resonators that found a “possible anisotropy of the speed of light c, (of) 2.6 +/- 1.7 parts in 10^15” (  )  In a brief conversation with Holger Müller a Professor at Berkeley and the lead author of that paper, he stated that to this knowledge no one had ever performed a variation of the experiment using a vertical arm.  He also mentioned that such an experiment would be complicated by the fact that gravity would slightly compress the length of the vertical bar making two equal length bars no longer equal in length.  “They haven't been done as far as i know. The problem is that any interesting physics signal would be hard to tell from a large signal from stretching of the arms under their own weight.” - H. Müller  I am interested in attempting to run this experiment myself.  To that end, I have the following questions:   Given current Physics understanding, is there any reason to expect that such a vertical variation of the MMX wouldn’t return the exact same results as all other MMXs, namely that there is no anisotropy in the speed of light? Given the complications mentioned by Professor Müller, are there reasonable methods available to overcome them?  Especially considering the size of the effect (c + 11,187m/s vs c) is substantially larger than the accuracy obtained in his and similar modern MMXs. What is the order of magnitude cost of such an experiment?  If I am to fund this personally, would such a project cost \$10,000?  \$100,000? \$1,000,000? more?   Any insight offered on this topic will be greatly appreciated.  EDIT: For what its worth, for people looking at this years later.  As I originally alluded to in a comment to [WetSavannaAnimal aka Rod Vance]'s much appreciated and comprehensive answer.  While, I've become increasingly comfortable with the idea that there is a flow of aether or spacetime or whatever you want to call it into the Earth at 11km/s; I strongly believe that a vertical MMX would return the same null result as the horizontal one.  And I believe it will do so because of length contraction; that length contraction exactly masks any anisotropy of the speed of light by ensuring that the roundtrip time of light in any direction is a constant; that length contraction ensures Lorentz co-variance.