here is my beginner problem: I want to create a class with numerous attributes using a dictionary. Instead of using def init(self, att1, att2...) I'm trying to do: class Promo:     def __init__(self, **kwargs):         for k in kwargs:             self.k = kwargs[k]  passing a dictionary {att1:'xxxx', att2:'yyyy' , .....} as argument. Since I have a dozen of named arguments in each dictionary, how can I use **kwargs in my code? Thanks for you advice!! de716
Suppose I have a python object x and a string s, how do I set the attribute s on x? So:  &gt;&gt;&gt; x = SomeObject() &gt;&gt;&gt; attr = 'myAttr' &gt;&gt;&gt; # magic goes here &gt;&gt;&gt; x.myAttr 'magic'   What's the magic? The goal of this, incidentally, is to cache calls to x.__getattr__().
Differences among Doctoral Degrees/titles How do I install MATLAB via the ISO? Proving $\int_0^1 \frac{(\ln(x))^5}{1+x} \mathrm{d}x = -\frac{31\pi^6}{252}$ I would like to show the following identity:     $$\boxed{ I :=  \int_0^1 \dfrac{(\ln(x))^5}{1+x} \mathrm{d}x = -\dfrac{31\pi^6}{252} }$$     Here is what I tried. The change of variables $u=1/x$ yields $$I= \int_1^{\infty} \dfrac{(\ln(x))^5}{1+1/u} \dfrac{1}{u^2} \mathrm{d}u = \int_1^{\infty} \dfrac{(\ln(x))^5}{u^2+u} \mathrm{d}u$$ Then $z=u-1$ gives $$I = \int_{0}^{\infty} \dfrac{(\ln(z+1))^5}{z^2+3z+2} \mathrm{d}z $$ with $z^2+3z+2=(z+1)(z+2)$. I wanted to use contour integration like , but I was not sure how to proceed in this case. Anyway, the computations of the residues (of which "well-chosen" function? Maybe something like ?) seem to be difficult.  I believe that we can generalize to $\frac{(\ln(x))^n}{1+x}$, or maybe even more (e.g. $\frac{(\ln(x))^n}{ax^2+bx+c}$). Related computations are: , , , .  Thank you for your detailed help. Can a 64-bit OS run as a guest on a 64-bit VirtualBox host? Is it possible to run a 64-bit OS as a guest on a 64-bit machine with VirtualBox? I'm guessing it should be, but I'd like to make sure.  Do some virtualization technologies allow a single guest machine to use multiple cores? I guess it should be possible, but my VirtualBox open-source edition doesn't seem to do it. Query Activity for ORDER BY xxx DESC LIMIT I'm trying to create a query activity in order to show, from a Data Extension, only the last 5 articles ids. I tried with the formula ORDER BY xxx DESC LIMIT 0,5 as in SQL but it is not working and it is returning this exception:     The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified   How can I use ORDER BY in a Data Extension? Why $SU(3)$ and not $U(3)$? Is there a good reason not to pick $U(3)$ as the colour group? Is there any experiment or intrinsic reason that would ruled out $U(3)$ as colour group instead? I have a client that has a Links page in SharePoint 2013. On the page is a column called URL that is set as a hyperlink column, but they want the column to accept pw://example.com/... instead of just ...  Is there a way to change the hyperlink column to allow for this behavior? I considered creating it as a single line of text and then making that text box a hyperlink-enabled box. Is there another native option? If not, which of these would be easiest? I am new to SharePoint so any help would be appreciated! Thanks in advance!   URL    Type the Web address: (Click here to test)  pw://test  Invalid URL: pw://test When should I use double or single quotes in JavaScript? console.log(&quot;double&quot;); vs. console.log('single'); I see more and more JavaScript libraries out there using single quotes when handling strings. What are the reasons to use one over the other? I thought they're pretty much interchangeable. Xubuntu Dropbox icon fail I got multiple entry schengen visa issued by Greece. Can I directly travel from India - Qatar - Romania or through schengen state Alignment issue in 'Your Sites' section in the Android app There is some unwanted extra spaces in between each site in the Your Sites section.  Steps to reproduce:   Touch the Nav Icon in the left top corner Touch the EDIT link in YOUR SITES Scroll the screen; there is unwanted spaces in between the each site   For reference I recorded the same:    Configurations:   App Version: 1.0.85 Device Manufacturer: Motorola Device Model: XT1033 OS Version: 5.1 (2) Particle speed and density I am using a Particle system to simulate falling dust / debris. The particle start and end fairly quickly. They should look like a short burst of falling dust.  I cant figure out how to get the particles to fall at slightly different speeds.  The particles should be falling downwards with very little Brownian motion.  The fact that the particles are falling at the same speed makes them look odd / too uniform (almost like a static image of some particles which is moving down rather than individual particles.  Also the particles end at a set frame so I get a uniform trailing edge (as below).   A bit of air drag helps a bit but not much.  Question 1. how to vary the downward speed of the particles?  Question2. Can the density of particles be animated so I can brake up the distribution?  Thanks Oliver I am a new Ubuntu user running Ubuntu 13.04.  I've been trying to install and use a DeDRM tool, but I've been having problems doing so. I was following some directions that said I needed a version of Python 2.7, but not anything Python 3.0 or later (because 3.0 versions are missing some necessary libraries?). I tried to install Python 2.7.5.6, but it didn't work. I thought it was probably because I had the later version of Python, so I went through terminal and removed Python 3.3, so I could install the earlier version of Python.  Now that I've uninstalled Python 3.3, a lot of applications no longer work, including the terminal and the Ubuntu Software Center. I have no idea how to fix this problem now. Attempting official deploy process with single sandbox may reset/remove all existing work? Find the Resistance between Two Terminals Let's say R = 49 ohms, and we want to find Req between a and d, how do we do that? Do we have to find Req for the whole circuit? Get names of all keys in the collection Can you reject a postdoc offer after the PI has paid a large sum for flights/accommodation for your visit? I am being considered for a very nice industry scientist position but this involves many interviews and assessments and can take some time.  However I have also accepted an invitation to the US (I'm in Australia) to give a presentation in relation to high likelihood of employment as a postdoc in a research institute.  The postdoc supervisor has arranged for sightseeing and lab visits and hotels. I feel bad if somehow I wish to pursue the industry position.  Has anyone had a similar experience and have you turned down something like that before? I've been trying to wrap my head around the basic concepts of category theory, and I thought I would attempt to illustrate what I understand with the category of sets, probably the easiest example. Particularly, I've been trying to prove that $id_A$ (the identity morphism on $A$, for all $A \in Obj(\mathbf{Set})$) is $1_A \colon A \rightarrow A, x \mapsto x$.  This is a very intuitive and reasonable statement, and it's trivial to prove that $1_A$ is indeed an identity morphism on $A$, and I suppose uniqueness of $id_A$ can be demonstrated analogously to uniqueness of the identity element in a monoid (considering the subcategory which has $A$ as its only object, and endofunctions on $A$ as its only morphisms).  In this manner, it is not hard to prove that the proposition in the title is true, but this demonstration requires to make an assumption or guess as to what could $id_A$ be. Specifically, the scheme of the proof is: assume $id_A$ = $1_A$, see that it works with the definition of an identity morphism, show that the identity morphism is unique, and, in conclusion, $id_A$ can only be $1_A$. What I'm looking for, nonetheless, is a somehow more direct proof, that doesn't assume $id_A$ = $1_A$ at the start. I want to place myself in a state of little or no knowledge about sets and functions, and under this assumption, why would I assume $id_A$ = $1_A$ at first? Why not try with $id_\mathbb{Z}$ = $f \colon \mathbb{Z} \to \mathbb{Z}, x \mapsto x^2 + 1$, for example? It wouldn't work, but I don't have any reason to think that $1_\mathbb{Z}$ is a better guess for $id_\mathbb{Z}$.  I suppose that the proof for which I'm asking would work for categories of sets with additional structure, and probably for posets as well, although I'm not clear as to what modifications it would require to work.  Thanks. In the following snippet:  public class a {     public void otherMethod(){}     public void doStuff(String str, InnerClass b){}     public void method(a){         doStuff("asd",             new InnerClass(){                 public void innerMethod(){                     otherMethod();                 }             }         );     } }   Is there a keyword to refer to the outer class from the inner class?  Basically what I want to do is outer.otherMethod(), or something of the like, but can't seem to find anything. On the usage of "the" article with acronyms and initialisms I've read  and  I know that  1. The article is often used with initials that are pronounced letter by letter (initialisms).  2. The article is often NOT used with initials that are pronounced as a word (acronyms).  I used 'often' because I'm not sure about possible exceptions.  In my field of study (Operations Research), initials are frequently used to represent optimization problems (e.g., the TSP). I discussed this point with my university supervisor who makes comments on my reports (English is not his native language). He responded that:  "What I learned from [...] was that whenever we use (specific) acronyms, we don't use 'the' when they are within a sentence, and we use 'the' when a sentence starts with them. For instance,  (i) The HCP is an NP-Complete problem.  (ii) We developed a new algorithm to solve HCP."  HCP stands for the Hamiltonian Cycle Problem. It is really confusing me because I do not know when to use and when not to use the article. For example, on , the author Jane Watson writes:     Use a definite article with an initialism if the spelled out term begins with “the” but is not covered in the initialism.   which implies that I should use the article with "HCP". What do you think?