I have accepted the answer to this question by @dtanabe Here is my code  def abc(): pass x = abc class label:     def __init__(self,fnname):         self.lbl = fnname     def __repr__(self):         repr(self.lbl)     def __str__(self):         # how should this be defined?         # I have no objection if other class functions         # or variables need to be defined  u = label(x)   I would like print(u) to respond with abc (three characters) on the screen and print([u]) to respond with [abc] (five characters). In each of these two cases, I do not want to see on screen any single or double quote mark anywhere near the strings of length 3 or 5.  Of course, I would like the analogous behaviour for a function abcdefg, with print(u) giving rise to abcdefg on the screen and print([u]) giving rise to [abcdefg] on the screen.  Your answer is allowed to change the definition of the class, but it is not allowed to change anything outside the class definition.
In Python, how do I get a function name as a string, without calling the function?  def my_function():     pass  print get_function_name_as_string(my_function) # my_function is not in quotes   should output "my_function".  Is such function available in Python? If not, any ideas on how to implement get_function_name_as_string, in Python?
I stupidly ran sudo chown -R carlos:carlos / and carlos is my user. This changed all files to be Carlos and I could not boot up again (because the root files were now owned by #1000) and I cant get sudo acess in live cd (because the owner of /usr was changed to my user). Can anyone help me? FYI I have mounted my hard drive. RSA encryption with private key and decryption with a public key When is an elected moderator shown as "departed" on the election page? On Philosophy, one of the elected moderators has since deleted their account, and they're shown as "Departed" on :        However, , one of the elected moderators still has their "previous" flair shown in place, despite the fact that they've already resigned and left the Network completely in the wake of the recent events.        , the same happens (old flair remains), but without the clickable &lt;a&gt; around the image, and with a noticeable :        This looks inconsistent, so when exactly will a placeholder image showing "Departed" replace the flair for a departed election winner? I have several very similar images except some have some extra graphics that enlarge them slightly. This causes some pictures to be offset and not aligned visually when it's clear they should be.  How can I align several tikzpictures along the the same origin they were created and center vertically and horizontally properly?   First, I want to align the 3 large boxes regardless of the what the small boxes are doing Second, I want to be able to center them all without adding additional spaces the \begin{center} seems to do Third, I want to be able to reproduce the exact same results but everything in landscape mode without using the landscape package if possible. (as you can see, the problem is that TeX is putting one rectangle at a time which is not what I want) The methods should be easy and quick. I have many rectangles stacked and some need to be grouped arbitrarily. What these means is I want the methods to sort of be "smart" in that they can figure out themselves so I don't have to go change a lot of stuff each time I have to change the grouping. Basically I would like the first rectangle on the page to define the alignment location and the others on the same page to use it unless I tell them not to.   I've tried creating a custom bounding box as shown in  but it didn't do anything unless I make it too large which then causes other problems. (I can end up doing the alignment but it seems more complex than necessary)  \documentclass[10pt]{book} \usepackage{tikz}  \begin{document} \begin{tikzpicture}     \draw[line width=30pt] (0,0) -- (7,0); \end{tikzpicture}  \begin{tikzpicture}     \draw[line width=30pt] (0,0) -- (7,0);     \draw[line width=20pt] (-0.4, 0) -- (-0.1, 0); \end{tikzpicture}  \begin{tikzpicture}     \draw[line width=30pt] (0,0) -- (7,0);     \draw[line width=20pt] (-0.4, 0) -- (-0.1, 0);     \draw[line width=20pt] (-0.8, 0) -- (-0.5, 0); \end{tikzpicture}    \begin{center}% \begin{tikzpicture}%     \draw[line width=30pt] (0,0) -- (7,0); \end{tikzpicture}% \end{center}%  \begin{center}% \begin{tikzpicture}%     \draw[line width=30pt] (0,0) -- (7,0);     \draw[line width=20pt] (-0.4, 0) -- (-0.1, 0); \end{tikzpicture}% \end{center}%  \begin{center}% \begin{tikzpicture}%     \draw[line width=30pt] (0,0) -- (7,0);     \draw[line width=20pt] (-0.4, 0) -- (-0.1, 0);     \draw[line width=20pt] (-0.8, 0) -- (-0.5, 0); \end{tikzpicture}% \end{center}%     \begin{tikzpicture}%     \draw[line width=30pt] (0,0) -- (0,7); \end{tikzpicture}%   \begin{tikzpicture}%     \draw[line width=30pt] (0,0) -- (0,7);     \draw[line width=20pt] (0,-0.4) -- (0,-0.1); \end{tikzpicture}%  \begin{tikzpicture}%     \draw[line width=30pt] (0,0) -- (0,7);     \draw[line width=20pt] (0,-0.4) -- (0,-0.1);     \draw[line width=20pt] (0,-0.8) -- (0,-0.5); \end{tikzpicture}%    \begin{center}% \begin{tikzpicture}%     \draw[line width=30pt] (0,0) -- (0,7); \end{tikzpicture}% \end{center}   \begin{center}% \begin{tikzpicture}%     \draw[line width=30pt] (0,0) -- (0,7);     \draw[line width=20pt] (0,-0.4) -- (0,-0.1); \end{tikzpicture}% \end{center}%   \begin{center}% \begin{tikzpicture}%     \draw[line width=30pt] (0,0) -- (0,7);     \draw[line width=20pt] (0,-0.4) -- (0,-0.1);     \draw[line width=20pt] (0,-0.8) -- (0,-0.5); \end{tikzpicture}% \end{center}%   \end{document} Trouble understanding Landau & Lifshitz writing about Lagrangians and Galilean Relativity We have two inertial coordinate systems, $K'$ and $K$. $K$ is moving with infinitesimal velocity ${\epsilon}$ relative to $K'$. Using Galilean relativity we can transform this into $v'=v+{\epsilon}$. Here Lagrangian is only a function of speed $L=L(|v|^2)$. $L'$ may differ from $L$ only by a total derivative of function of coordinates and time, i.e. $L'=L+\frac{d}{dt}f(q,t)$  $"$We have $L'=L(|v|^2+2{v}·{\epsilon}+{\epsilon}^2)$. [1. ] Expanding this expression in powers of ${\epsilon}$ and neglecting terms above the first order, we obtain $L(|v'|^2)=L(|v|^2)+\frac{\partial{L}}{\partial{|v|^2}}2v·{\epsilon}$ [2.] The second term on the right of this equation is a total time derivative only if it is a linear function of the velocity $v$ $"$  I understand nothing in the quoted part. How do we get [2.]? Why does $\frac{\partial{L}}{\partial{|v|^2}}2v·{\epsilon}$ being a linear function of velocity imply that it's a total time derivative? Creating node shapes Recovering an accidentally deleted  folder in OSX - no Time Machine or backup available I am a longtime Windows user, recently switched to Mac. I replaced folder with another folder (they had the same name) thinking that OS X will merge the contents of both folders. But OS X deleted the original folder and replaced it with the new one. Windows merges both the folders (I do this often in Windows). I have now lost hundreds of files. I haven't enabled Time Machine. I've tried using Finder's Undo, but that doesn't work.  Currently, I am trying to recover my data using . It shows estimated time as 7 hours, 31 minutes. Does anyone know any free data recovery software that's faster and more powerful? How to remove the whitespace BEFORE itemize/enumerate? I'm somewhat of a LaTeX noob, and this is driving me completely nuts.  When I type  \documentclass{article} \usepackage{enumitem}  \begin{document}     Some text     \begin{itemize}[noitemsep]         \item Item 1         \item Item 2         \item Item 3     \end{itemize} \end{document}   I don't want the space which appears in between the text "Some text" and the itemization to be there:    When I search around on Google all I see is tons of long, complicated advice on this site, StackOverflow, forums, etc. on how to not fix the problem ("parskip is evil", etc.), or tons of vague/confusing answers on what package to look at, with no actual example for me to learn from.  So while this question is already asked many times, I have never found a single concrete answer to this question.    The question couldn't be simpler: How do I "properly" get rid of this extra space? Is there any way to know when I will receive my UK visa? Is there a difference between single and double quotes in Java? Centering \vdots in a system of many equations I have a system of equations with an arbitrary number of equations (k). I'd like to use \vdots to compactly describe the system, like so:  \begin{align*}   R(-1) &amp;= \sum_{i=1}^m A(i)R(i-1) \\   R(-2) &amp;= \sum_{i=1}^m A(i)R(i-2) \\         &amp;\vdots                    \\   R(-k) &amp;= \sum_{i=1}^m A(i)R(i-k) \end{align*}     I'd like the dots, however, to be centered with = or the entire equation. Is there an elegant way of centering a column or row with AMSMath? I'm currently using an unholy combination of whitespace operators (\; \, etc.) to get the job done. Do you use NULL or 0 (zero) for pointers in C++? I know I can only use the gym feature after hitting level 5, but are there any other privilege or rewards for the levels above 5?  For example, in Ingress, some items are only available for the higher level player. How about Pokemon Go? I am aware there are many questions similar to this on MSE but I am having trouble following any of the solutions given.   I have the function given by   $f(x) = \dfrac{xy}{x^2+y^2}\;$ for $(x,y)\neq (0,0)$ and $f(0,0)=0$  I have calculated the partial derivatives and found:   $$\frac{\partial f}{\partial x} = \frac{y(-x^2+y^2)}{(x^2+y^2)^2}, \quad \frac{\partial f}{\partial y} = \frac{x(-y^2+x^2)}{(y^2+x^2)^2}$$  Now I need to show the partial derivatives exist for $(x,y) = (0,0)$.  I am also asked to show it is not continuous at $(x,y)=(0,0)$, based on other answers I've seen it seems like this follows from solving the first part but I fail to see how that follows through as well.   I could just copy the solutions with my function in place as I have seen a lot of answers using the definition of the derivative, but realistically I do want to understand what the thinking behind this is.   Any help would be appreciated. A square matrix $n \times n$ is an invertible matrix iff the rank of the matrix is $n$. Which airlines allow in-cabin pets on transatlantic flights? $\lim_{x\to 0} \frac{\sin x - x}{x^2}$ without L'Hospital or Taylor How to find previous boot log after Ubuntu 16.04+ restarts? My question is, how can I find boot log from previous system boot attempt?  Today when first powering on my PC, boot process stopped on Ubuntu logo, when I pressed Esc I have seen several lines containing some kernel error and restart required at the bottom, so I pressed Ctrl+ALt+Del and next boot went OK without problems.  I have trouble finding messages from the screen I have seen during the first unsuccessful boot. Should I have taken picture to my phone?  /var/log/boot is there but empty, I searched  and  for strings I remembered with today's date like error but found nothing familiar to what I have seen on previous boot screen.  $ journalctl -b -1 gives me only kernel messages during boot, I can find that elsewhere too, and they are not what was appearing on screen during boot, journalctl is useless for me, I am looking for messages appearing on screen during boot time.  For now, only option is take a photo of write the message on paper. Why use the 'ref' keyword when passing an object? If I am passing an object to a method, why should I use the ref keyword? Isn't this the default behaviour anyway?  For example:  class Program {     static void Main(string[] args)     {         TestRef t = new TestRef();         t.Something = "Foo";          DoSomething(t);         Console.WriteLine(t.Something);     }      static public void DoSomething(TestRef t)     {         t.Something = "Bar";     } }   public class TestRef {     public string Something { get; set; } }   The output is "Bar" which means that the object was passed as a reference. I'm trying to make a map using the Javascript API.  I want to use my own basemap, but I can't find the most simple code to do this.  I always see something like this:    function init() {     map = new esri.Map("mapDiv", {       basemap: "satellite",       center: [-97.395, 37.537],       zoom: 11     });   But I don't want to use the ArcGIS online basemaps.  What is the code to make a map service I am hosting my basemap?