Let's say I have an object, called myMD5, like this:  &lt;md5 HASH object @ 0xb79b9860&gt;   And here is dir(myMD5):  ['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'block_size', 'copy', 'digest', 'digest_size', 'digestsize', 'hexdigest', 'name', 'update']   I want to get the hash string, and to do that I need to call myMD5.hexdigest().  The problem is that I'm actually making a challenge (called PyJail) and the use of the character dot (.) is forbidden.   So, I need to call this method by another way. Is there any way to call it like a function ? Something like this:  hexdigest(myMD5)   I tried to do this, but it does not work:  getattr(myMD5, dir(myMD5)[-3]) # returns &lt;classmethod object at 0xb79b998c&gt;   PS; Other elements are also forbidden by the challenge, like using quotes (', "), using import statements, using things like exec or eval, etc.
What is the best way to go about calling a function given a string with the function's name in a Python program.  For example, let's say that I have a module foo, and I have a string whose content is "bar". What is the best way to call foo.bar()?  I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this.
Eclipse: I turned on hidden characters now I can't turn off Proving the measure of an increasing sequence of measurable sets is the limit of the measures Compute the integral $\int_{A} x^m y^n z^p (1-x-y-z)^q dx dy dz$ I'm currently reading documentation about map projections to understand the source code of the Proj4 project.  The scale factor is named in a variety of sources I read. This sources explained its definition and its value for some projections.   In the source code of Proj4, for the mercator projection (sphere and ellipse case), the scale factor influences the coordinates on the projection :   //P-&gt;k0 is the scale factor xy.x = P-&gt;k0 * lp.lam; xy.y = - P-&gt;k0 * log(pj_tsfn(lp.phi, sin(lp.phi), P-&gt;e));   Why and how I should use the scale factor during the computation of the projection ? Is there any valuable resources on the web ?  This question in asked in the sense of projection computation. I can find the formula for the inverse and forward projection as well as the scale factor in a various of resources, but no one explains how I should use both in a algorithm. You have the definition of the projection and the definition of the scale factor, but it's not clearly written that I should multiply or divide the result by the scale factor.   Is it a general rule : if I find the formula for any projection with the related scale factor, should I, in all cases, always divide or multiply the results by the scale factor ? In the United States we have a saying, "your mileage may vary", which means "your experience may be different".  In English-speaking countries that don't use Imperial miles, is there an equivalent expression? Why do we need to use int main and not void main in C++? Prove $f(S \cup T) = f(S) \cup f(T)$ Whitespace Problems With Script and Variables Debugging automatic properties I no longer use the service that I originally used to register, and would like to change the service I use to log in, or at least add a second account.  Is this possible? How do I change my login provider or associate a backup method to log in?     For more information, see "" in the . How to allocate aligned memory only using the standard library? I just finished a test as part of a job interview, and one question stumped me, even using Google for reference. I'd like to see what the StackOverflow crew can do with it:  The memset_16aligned function requires a 16-byte aligned pointer passed to it, or it will crash. a) How would you allocate 1024 bytes of memory, and align it to a 16 byte boundary? b) Free the memory after the memset_16aligned has executed.  {        void *mem;    void *ptr;     // answer a) here     memset_16aligned(ptr, 0, 1024);     // answer b) here     } I am comfortable with the different sizes of infinities and Cantor's "diagonal argument" to prove that the set of all subsets of an infinite set has cardinality strictly greater than the set itself. So if we have a set $\Omega$ and $|\Omega| = \aleph_i$, then (assuming continuum hypothesis) the cardinality of $2^{\Omega}$ is $|2^{\Omega}| = \aleph_{i+1} &gt; \aleph_i$ and we have $\aleph_{i+1} = 2^{\aleph_i}$.  I am fine with these argument.  What I don't understand is why should there be a smallest $\infty$? Is there a proof (or) an axiom that there exists a smallest $\infty$ and that this is what we address as "countably infinite"? or to rephrase the question "why can't I find a set whose power set gives us $\mathbb{N}$"?  The reason why I am asking this question is in "some sense" $\aleph_i = \log_2(\aleph_{i+1})$. I do not completely understand why this process should stop when $\aleph_i = \aleph_0$.  (Though coming to think about it I can feel that if I take an infinite set with $\log_2 \aleph_0$ elements I can still put it in one-to-one correspondence with the Natural number set. So Is $\log_2 \aleph_0 = \aleph_0$ (or) am I just confused? If $n \rightarrow \infty$, then $2^n \rightarrow \infty$ faster while $\log (n) \rightarrow \infty$ slower and $\log (\log (n)) \rightarrow \infty$ even slower and $\log(\log(\log (n))) \rightarrow \infty$ even "more" slower and so on).  Is there a clean (and relatively elementary) way to explain this to me?  (I am totally fine if you direct me to some paper (or) webpage. I tried googling but could not find an answer to my question) I would like to redirect a URL with uppercase characters http://localhost/A/B to a lowercase version http://localhost/a/b using the .htaccess file. Using regex I can capture A and B but is it possible to convert them to lowercase? Fastest way to copy HDD All  I just install a fresh new Ubuntu 16.04 on my new desktop which has a 8th generation Intel CPU i5 8600K. When OS installed, I found there is only one option in display setting: 1024 x 768 (4:3),  My monitor is a HDMI monitor with 1920x1080 resolution  Do anyone have any idea how to make the resolution setting right? Thanks.  BTW. I do not install any graphic card, I use the internal GPU of Intel Salesforce - Maximum simultaneous requests callout limit Salesforce says      Maximum simultaneous requests to URLs with the same host for a callout   request is 20   Statement is very simple to read but it is not very clear as to what it means. Can anyone explain what this statement means and how can i reproduce this exception in my Sandbox?     Once more thing what is the difference between simultaneous and   concurrent? Are both same or different? I have a realy strange problem in Ubuntu 11.10. I have by accident my password set to empty. If I wan't to install software now the system asks for a password, but I haven't one anymore. If I enter my old password it sais it's wrong and if I leave it empty it also does. Now I wan't to set my password back, but the system asks for the old password before I can change it. That password doesn't exist, so I can't do anything anymore! Can someone help me please? Ethernet indicator in OSX menu bar I am using OSX 10.7  When I move between different ethernet networks (e.g., at work using ethernet on an external display, at home using thunderbolt ethernet), the ethernet does not always connect. However, I don't get immediate feedback. Instead, I connect to wi-fi. However, wi-fi is both slower and less reliable than ethernet. Thus, I'd like to know whether I am connected to ethernet or not. Of course I can go into preferences and network settings to see whether I'm connected to ethernet, but it would be better if there was some form of indicator in the status bar, just as there is for wi-fi. Thus, my question:  Is there a way of getting an indicator of ethernet connectivity in the OSX menu-bar?  Perhaps there is a free application that can do this. Oracle: function based index selective uniqueness A few weeks back I was using std::ifstream to read in some files and it was failing immediately on open because the file was larger than 4GB. At the time I couldnt find a decent answer as to why it was limited to 32 bit files sizes, so I wrote my own using native OS API.  So, my question then: Is there a way to handle files greater than 4GB in size using std::ifstream/std::ostream (IE: standard c++)  EDIT: Using the STL implementation from the VC 9 compiler (Visual Studio 2008).  EDIT2: Surely there has to be standard way to support file sizes larger than 4GB.