when one prints the following:  import datetime data = (datetime.datetime.now(), '%.3f' % float(8/9)) print(data)   he/she begets:     (datetime.datetime(2018, 10, 16, 23, 58, 19, 314376), '0.889')   However, often one would like python to write:     2018-10-16 23:58:19, 0.889   There are of course many fine ways to wood pack here and there, but which is the way of the python?  PS This is not a question about ways to print a datetime instance as a readable string (there are plenty and easily accessible answers on SO). This question additionally asks to remove the quotation marks around the two strings in data, both of which emerge in different ways when printing a tuple. There are also many easily accessible answers on ways to do this. The question is how to combine these things in the most readable/pythonic way.
This is my code:  import datetime today = datetime.date.today() print(today)   This prints: 2008-11-22 which is exactly what I want.  But, I have a list I'm appending this to and then suddenly everything goes "wonky". Here is the code:  import datetime mylist = [] today = datetime.date.today() mylist.append(today) print(mylist)   This prints the following:   [datetime.date(2008, 11, 22)]   How can I get just a simple date like 2008-11-22?
How can I make a macOS Mojave bootable USB installer in Windows 10? I have downloaded and saved macOS Mojave installation file from the Mac App Store into my external hard drive. Unfortunately, macOS has crashed on my Mac and now I need to install it again. I have used a software named TransMac to make a installation USB in windows following the steps in the link below:    But the provided USB drive after all these steps doesn't show up in my MacBook pro. Considering that I have saved Install macOS Mojave.app on my external hard drive, and I don't have access to any other Mac computers, How can I fix this issue and build a USB for installing Mojave? Have Chrome autodetect language before spelling checking? GNOME: disable sleep on lid close Is it possible to stop my laptop going to sleep when I close the lid?  GNOME 3.20, Fedora 24.    My laptop does not reliably wake from sleep.  (It happens to be a hardware issue... I think I basically killed it while trying to replace a wifi card.  But I want to keep using it for a while longer). Difference between Hashing a Password and Encrypting it The current top-voted to  states:     Another one that's not so much a security issue, although it is security-related, is complete and abject failure to grok the difference between hashing a password and encrypting it. Most commonly found in code where the programmer is trying to provide unsafe "Remind me of my password" functionality.   What exactly is this difference? I was always under the impression that hashing was a form of encryption. What is the unsafe functionality the poster is referring to? How to obtain the sum of the following series? $\sum_{n=1}^\infty{\frac{n^2}{2^n}}$ I am trying to prove the matrix norm equivalence for norms 1, 2, $\infty$ and Frobenius.  I have managed to solve find the constants for $||.||_{1}$ and  $||.||_{2}$ but I cannot see how to continue if I want to prove the following:  $||A||_{\infty} \leq \sqrt{n}||A||_{2}$   and the ones for Frobenius:  $||A||_{F} \leq \sqrt{n}||A||_{1}$  $||A||_{F} \leq \sqrt{n} ||A||_{2}$  Any help is appreciated. Thank you for your time This works just fine:      protected void txtTest_Load(object sender, EventArgs e)     {         if (sender is TextBox) {...}      }   Is there a way to check if sender is NOT a TextBox, some kind of an equivalent of != for "is"?  Please, don't suggest moving the logic to ELSE{} :) I live in an apartment which provides Internet service included in the rent. They use a company called Pavlov for the Internet    wireless seems to be working fine but wired connection is at least %30 faster.  Ethernet, Cat5 outlet is built in the wall, and there is only 1 outlet in each room.  I would like to take this 1 outlet coming out the wall and multiply it into 4 wires, for desktop, Playstation, TV and laptop, without losing any Internet bandwidth.   I have absolutely no idea whether this line is coming from a switch or a router but I have been researching Ethernet splitter, routers, switches, hubs and haven't found a solid answer.   Is there a way I can do this?  This picture cleared up few things:     It seems that an Ethernet switch is to Ethernet as a USB hub is to USB, but with packet inspection.  What is a 10/100Mbps Network Switch, actually, and what is the cap? Rotate Geographic map Why not introduce a donate button in Stack Exchange sites? Word that describes being "patriotic" for something that is not a country? I'm looking for a word that is similar to patriotic but does not relate to one's country (or state).  For what it's worth, I'm specifically referring to "overly patriotic" in a negative sense, to describe someone who has a overly sentimental/cultural or otherwise less-than-rational attachment or devotion to something and makes it part of their very identity. A common example might be an extremely zealous football fan. has played the role of Wolverine as a major character in various X-Men films since 2000 and contributed highly to the brand of the X-Men movie series. But is he playing the Wolverine character for the last time in Logan?  I am getting to know from my friends that  is the last movie in which he is playing Wolverine and they all say that this is his last contracted film.  Are these rumors true? Is there any official information that confirms that this is Hugh Jackman's last movie as Wolverine? Is there a rule of thumb for objective questions asked out of curiosity? Isaac Moses, the patriarch of Mi Yodeya, :  [...] the general Stack Exchange directive, expressed in the uneditable part of that section of the About page, to &quot;Focus on questions about an actual problem you have faced. Include details about what you have tried and exactly what you are trying to do.&quot; In fact, while this directive is perfect for the behemoth programming site that Stack Exchange grew out of, it doesn't fit very well for any of the more intellectually-oriented, rather than practically-oriented sites. [...]  This is something that's bugged me for a while, and ended up prompting a discussion between Anna, Aarthi and me. The gist of it: is there any simple test that can be used to identify answerable questions asked in good faith when the &quot;problem to be solved&quot; is... simple curiosity? Obviously, this is something that sites like  and  have had to contend with for some time, but now and then such questions pop up even on sites where folks are generally trying to solve real problems. While a potentially interesting thought experiment, . Strictly-speaking, problems like that fail the  test. And yet, I would keep that question simply because I learned something useful from the answers − not necessarily something I would ever apply to socks mind you, but certainly something I might apply to similar problems. I don't believe the question was asked in bad faith or for mindless social fun; yet, I have a bit of trouble stretching the definition of &quot;based on actual problems&quot; to contain it. Obviously, the fact that we're hosting a growing number of sites dedicated mostly or entirely to intellectual curiosity makes this something of a rhetorical question. The &quot;actual problems&quot; part of the FAQ was added specifically to draw a line between good and bad  − heading off  and their ilk. But it's a pretty damn good litmus test, and if it's ok to ignore it for some questions − or particularly for  − then what should stand in its place? Add review queues to Android app I know there are some similar posts on adding review queues to the mobile web page. However, this is regarding the Stack Exchange Android app. I really would like to review posts and edits from the Android app, however this isn't included in the app yet. I'm not sure how it would be implemented; maybe there could be a button or something for review. Could we please see this? Without using any non-standard (Windows included) utilities, is it possible to download using the Windows command line?  The preferred version is Windows XP, but it's also interesting to know for newer versions.  To further clarify my question:   It has to be using HTTP The file needs to be saved Standard clean Windows install, no extra tools   So basically, since everybody is screaming , I want simple Wget functionality, without using Wget. I want to calculate $$ \int_{0}^{\infty} \frac{\arctan{2t}}{e^{2\pi t}+1} \, {\rm d}t $$ and am wondering if there at all is an analytical expression for the result. I haven't tried much so far, but expressing the denominator as the geometric series and then substituting $z=2\pi t (n+1)$. Equivalently I get $$ \sum_{n=0}^{\infty} \frac{{\rm si}\left(\pi(n+1)\right)}{2\pi (n+1)} $$ where $$ {\rm si}(x) = -\int_{x}^{\infty} \frac{\sin(t)}{t} \, {\rm d}t $$ is the shifted ${\rm Si}(x)$ function. The value is approximately $0.03618247146$, in fact I know from comparison with something else that it is exactly $\frac{\ln \pi -1}{4}$, but there should be some (direct) derivation, or?  Thanks for your input if you have any.  Edit: I tried to follow your instructions, but am now stuck. So I wrote $$ {\cal L}^{-1} \left(\frac{\psi(t)-\psi(1)}{t-1}\right)(s) =\sum_{n=0}^{\infty} \frac{e^{-sn}}{n+1} = e^s \int_s^\infty \frac{{\rm d}x}{e^{x}-1} $$ and taking the Laplace-transform \begin{align} \psi(t) &amp;= \psi(1) + (t-1)\int_0^\infty {\rm d}s \, e^{-s(t-1)} \int_s^\infty \frac{{\rm d}x}{e^{x}-1} \\ &amp;= \psi(1) + (t-1) \int_0^\infty {\rm d}x \int_{0}^{x} {\rm d}s \, \frac{e^{-s(t-1)}}{e^{x}-1} \\ &amp;= \psi(1) + \int_{0}^{\infty} {\rm d}x \, \frac{1-e^{-x(t-1)}}{e^x-1} \tag{1} \\ &amp;= -\frac{1}{t} + \psi(1) + \int_0^\infty {\rm d}x \, \frac{1-e^{-tx}}{e^x-1} \tag{2} \\ &amp;= \dots \\ &amp;=-\sum_{k=0}^{n} \frac{1}{t+k} + \psi(1) + \int_0^\infty {\rm d}x \, \frac{1-e^{-(t+n)x}}{e^x-1} \\ &amp;\stackrel{(\rm{2})}{=} -\frac{1}{2t} + \ln(t) - \int_0^\infty {\rm d}x \, \left\{ \frac{1}{2} - \frac{1}{x} + \frac{1}{e^x-1}\right\} e^{-tx} \tag{Binet 1} \end{align} where $\psi(1)=-\gamma$.  Now we integrate over $t$ from $1$ to $y$ yielding $$ \ln \Gamma(y) \stackrel{({\rm 1})}{=} \psi(1)\,(y-1) + \int_0^\infty {\rm d}x \, \frac{y-1+\frac{e^{-x(y-1)}-1}{x}}{e^x-1} $$ but what now? Substitute? In a certain case, the user will be asked to confirm if he/she wishes to leave the page, due to editing a post, even when he/she has stopped editing.  To reproduce:   Start editing a post (I've only experienced this with a question) Another user finishes editing the post before you and the message "This post has been edited" appears Clicking on the message bar will take you out of editing mode and will show you the updated post from the other user's edits Trying to navigate away from the page will then ask for your confirmation Closure of a Ball is Contained in Closed Ball (usual metric) Let $\overline{B_d (x, r)}$ be the closure of an open ball, and let $\hat B_d (x, r)$ be a closed ball. Show that in any metric space $(X, d)$, $\overline{B_d (x, r)} \subseteq \hat B_d (x, r)$ for all $x \in X$ and $r &gt; 0$.    I used the definition of closure: $\overline{B}$ = $B \bigcup B'$. If $x \in \overline{B}$, then $x \in B$ or $x \in \overline{B}$, or both. If $x \in B$, then clearly $x \in \hat B$ since $B \subseteq \hat B$. But, if $x \in B'$, then $x$ is an accumulation point. Since $\hat B$ is closed, it contains all accumulation points of $B$. Thus, $x \in \hat B$.  Is this approach correct, or at least in the right direction? Should I be using the closure definition, or try another one? Thank you. A command-line clipboard copy and paste utility? In Windows I used command-line clipboard copy-and-paste utilities...      pclip.exe and gclip.exe     These were UnixUtils ports for Windows (but they only handled plain text). There were a couple of other native Windows utilities which could write/extract any format.    I've looked for something similar in Synaptic Package Manager, but I can't find anything.    Is there something there, that I've missed? ... or maybe this is available in Bash scripting?    The type of utility I'd like will be able to read/write via std-in/std-out or file-in/file-out, and handle Unicode, Rich Text Format, picture, etc. clipboard formats...    NB: I'm not after a clipboard manager. How to receive sms from our android app?