persian encoding (utf-8) for jsp page in eclipse in Eclipse IDE
How to pass Unicode characters as JSP/Servlet request.getParameter?
Why is the minimum size of a generating set for a finite group at most $\log_2 n$? It seems to be known that the minimum size of a generating set for a finite group of order $n$ is at most $\log_2 n$. Can someone explain why this is true?  Edit: noted that the logarithm is base 2, and $n$ represents the order of the group. Preserving signatures of decorated functions Suppose I have written a decorator that does something very generic. For example, it might convert all arguments to a specific type, perform logging, implement memoization, etc.  Here is an example:  def args_as_ints(f):     def g(*args, **kwargs):         args = [int(x) for x in args]         kwargs = dict((k, int(v)) for k, v in kwargs.items())         return f(*args, **kwargs)     return g  @args_as_ints def funny_function(x, y, z=3):     """Computes x*y + 2*z"""     return x*y + 2*z  &gt;&gt;&gt; funny_function("3", 4.0, z="5") 22   Everything well so far. There is one problem, however. The decorated function does not retain the documentation of the original function:  &gt;&gt;&gt; help(funny_function) Help on function g in module __main__:  g(*args, **kwargs)   Fortunately, there is a workaround:  def args_as_ints(f):     def g(*args, **kwargs):         args = [int(x) for x in args]         kwargs = dict((k, int(v)) for k, v in kwargs.items())         return f(*args, **kwargs)     g.__name__ = f.__name__     g.__doc__ = f.__doc__     return g  @args_as_ints def funny_function(x, y, z=3):     """Computes x*y + 2*z"""     return x*y + 2*z   This time, the function name and documentation are correct:  &gt;&gt;&gt; help(funny_function) Help on function funny_function in module __main__:  funny_function(*args, **kwargs)     Computes x*y + 2*z   But there is still a problem: the function signature is wrong. The information "*args, **kwargs" is next to useless.  What to do? I can think of two simple but flawed workarounds:  1 -- Include the correct signature in the docstring:  def funny_function(x, y, z=3):     """funny_function(x, y, z=3) -- computes x*y + 2*z"""     return x*y + 2*z   This is bad because of the duplication. The signature will still not be shown properly in automatically generated documentation. It's easy to update the function and forget about changing the docstring, or to make a typo. [And yes, I'm aware of the fact that the docstring already duplicates the function body. Please ignore this; funny_function is just a random example.]  2 -- Not use a decorator, or use a special-purpose decorator for every specific signature:  def funny_functions_decorator(f):     def g(x, y, z=3):         return f(int(x), int(y), z=int(z))     g.__name__ = f.__name__     g.__doc__ = f.__doc__     return g   This works fine for a set of functions that have identical signature, but it's useless in general. As I said in the beginning, I want to be able to use decorators entirely generically.  I'm looking for a solution that is fully general, and automatic.  So the question is: is there a way to edit the decorated function signature after it has been created?  Otherwise, can I write a decorator that extracts the function signature and uses that information instead of "*kwargs, **kwargs" when constructing the decorated function? How do I extract that information? How should I construct the decorated function -- with exec?  Any other approaches? What is a mixin, and why are they useful? How do I identify predatory and low quality journals? With Beall's List gone, how can I tell if a journal is spam? . While the reasons for his doing this are not yet public, this is a real loss of a valuable service. Does anyone know of similar services available to the general public?  Edit:  is definitely relevant, but that approach is more appropriate for finding top journals rather than identifying bottom ones. I.e., following that method would probably exclude lots of valid, lower-tier journals. Are there any approaches to easily identifying a predatory publisher? django manytomanyfield .add() method Pagenumbers aligned raggedleft in scrartcl with tocstyle? When trying to typeset a table of contents with KOMAscriptand tocstyle(alpha 0.2d), I finally managed to change the font of the pagenumbers (like the rest of the document to CMSS) with \settocfeature{pagenumberhook}{\changefont{cmss}{m}{n}}, however now the page numbers are aligned at the left and not at the right side!   So how can I change that back to an alignment on the right side of the page numbers like that, but with the sans serif font?   Example:  \documentclass[11pt, a4paper]{scrartcl} \usepackage[ngerman]{babel} \usepackage{blindtext}  \newcommand{\changefont}[3]{ \fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}  \usepackage[]{tocstyle} \usetocstyle{classic} %\settocstylefeature[1]{entryvskip}{10pt} %\settocstylefeature[2]{entryvskip}{3pt} %\settocstylefeature[1]{entryhook}{\bfseries} \settocfeature{pagenumberhook}{\changefont{cmss}{m}{n}}  \begin{document}  \changefont{cmss}{m}{n}  \tableofcontents  \newpage  \blinddocument \blinddocument \blinddocument  \end{document} I have 10 years of daily returns data for 28 different currencies. I wish to extract the first principal component, but rather than operate PCA on the whole 10 years, I want to rollapply a 2 year window, because the currencies' behaviours evolve and so I wish to reflect this. However I have a major problem, that is that both the princomp() and prcomp() functions will often jump from positive to negative loadings in adjacent PCA analyses (ie 1 day apart). Have a look at the loading chart for the EUR currency:    Clearly I can't use this because adjacent loadings will jump from positive to negative, so my series which uses them will be erroneous. Now take a look at the absolute value of the EUR currency loading:    The problem is of course that I still cannot use this because you can see from the top chart that the loading does go from negative to positive and back at times, a characteristic which I need to preserve.   Is there any way I can get around this problem? Can I force the eigenvector orientation to always be the same in adjacent PCAs?   By the way this problem also occurs with the FactoMineR PCA() function. The code for the rollapply is here:  rollapply(retmat, windowl, function(x) summary(princomp(x))$loadings[, 1], by.column = FALSE, align = "right") -&gt; princomproll Show lim sup (an) = lim inf (an) for increasing for increasing sequence of subsets. How to reduce the fan noise and how to increase battery life? I have a brand new Sony Vaio S series laptop.() It came factory installed with Windows 7 professional Edition 64bit. Runs Intel core i5, 500 GB HDD , 4GB Ram. First I installed ubuntu 11.10 64 bit along side Windows to dual boot. Later,since the problem did not solve, I installed ubuntu 12.04 64bit along side Windows to dual boot. However the problem keeps annoying me.  Problem: When running ubuntu 11.10/12.04, the battery lasts only about 1.5 hours. The Fan runs loud and continuously. And there is a lot of heat generated. System monitor shows less than 5% CPU used. My laptop enjoys hybrid graphic and I tried turning off ADM graphic card and keep Intel graphic card on. However I can not get the Fan noise or heat to go away and consequently the battery drain continues. BTW, in windows, the laptop gives 4-5 hours of battery power, Fan is silent and there is no heat problem. Any ideas on how to reduce the fan noise and how to increase battery life in ubuntu 11.10/12.04? Is there actually a 0 probability of finding an electron in an orbital node? Angle between 2 points Given the following image:   $\hskip{1.5 in}$   Supposing $A(100, 300)$ and $B(300, 100)$, how can I find the angle $\alpha$ between A and B?  On a side note, what's the main difference between a point and a vector? translating a point to a vector is as simple as Point = Vector? Sometimes I find articles where the terms are interchangable Show $||Tx||_2 \leq ||(v_n)||_2 \cdot ||x||_{\infty}$ Let $(v_n)_{n \geq 1} \in \ell ^2$ be a fixed bounded sequence of real numbers. Define a mapping $T$ on $\ell ^{\infty}$ using the formula $$T(a_1, a_2,...)=(v_1a_1,v_2a_2,...), \, \, \, \, \, x=(a_1,a_2,...) \in \ell^{\infty}$$  We can use the fact that, $Tx \in \ell^2 $ for every $x \in \ell^{\infty}$ and $T: (\ell^{\infty},||\cdot ||_{\infty}) \rightarrow (\ell^{2},||\cdot ||_{2})$ is a linear operator.  Show $||Tx||_2 \leq ||(v_n)||_2 \cdot ||x||_{\infty}$ for all $x \in \ell^{\infty}$    Here is what I tried:  $||Tx||_2 = \bigg( \sum v_k^2 a_k^2 \bigg)^{1/2} \leq (||x||_{\infty}^2 \sum v_k^2 )^{1/2}= (||x||_{\infty}^2 ||(v_k)||_2^2 )^{1/2} = ||(v_k)||_2 \cdot ||x||_{\infty}$  Is this OK? I am trying to install Microsoft Office 2013 on Ubuntu 12.04 LTS (32-bit). I have downloaded an iso file of said product and installed wine1.4-i386 using the apt-get command on the terminal.  The question is I don't know the steps how to install it. I can't get much tutorials on Internet how MSOffice2013 can be installed on Ubuntu.  If any versions of wine isn't an option, what other options can be used to run Microsoft Office 2013? I'm trying to solve this problem from Hatcher 3.3.24.  Let $M$ be a closed connected 3-manifold, and write $H_1(M, \mathbb{Z})$ as $\mathbb{Z^r} \oplus T$ where $T$ is torsion. Show that $H_2(M, \mathbb{Z})$ is $\mathbb{Z^r}$ if $M$ is orientable or $\mathbb{Z^{r-1}} \oplus \mathbb{Z_2}$ if $M$ is not orientable. In particular $r \geq 1$ if $M$ is not orientable. Using exercise 6 construct examples showing there are no other restrictions on the homology groups of closed 3-manifolds. (In the nonorientable case consider the manifold $N$ obtained from $S^2 \times I$ by identifying $S^2 \times \{0\}$ with $S^2 \times \{1\}$ via a reflection of $S^2$.)  I think I've solved the first part, here's my proof:   First note the following theorem: If $M$ is a closed connected and orientable n-manifold then $H_n(M, \mathbb{Z}) = \mathbb{Z}$ and $Tors(H_{n-1}(M, \mathbb{Z})) = 0$. If nonorientable, then $H_n(M, \mathbb{Z}) = 0$, $Tors(H_{n-1}(M, \mathbb{Z})) = \mathbb{Z_2}$.  Now note by Poincare duality and UCT we have that $H_2(M) \cong H^1(M) \cong \mathbb{Z^r} \oplus T_0 \cong \mathbb{Z^r}$.   In the nonorientable case consider the exact sequence:  $0 \longrightarrow H_2(M) \longrightarrow H_1(M) \longrightarrow H_0(M) \longrightarrow 0$  But we know $H_1(M) = \mathbb{Z^r} \oplus Z_2$ from the earlier theorem and $H_0(M) = \mathbb{Z}$.   Therefore $H_2(M) \cong ker(\mathbb{Z^r} \oplus Z_2 \rightarrow \mathbb{Z}) \cong \mathbb{Z^{r-1}} \oplus \mathbb{Z_2}$.   For the rest of the question I'm quite lost. How many digits does $2^{1000}$ contain? I tried this way, I only need to know if this is correct or if there are better ways to solve this:  $2^{1000}$ does not have a factor of $5$ obviously therefore we can assume  $$ 10^{m} &lt; 2^{1000} &lt; 10^{m+1}$$ for some  $m$   Assume $ k = 2^{1000}$, then take log on both sides $\log k = 1000  \log 2 \approx 301.02999 &gt; 301$  Therefore $2^{1000}$ has $302$ digits. Play a Sound with Python What is the pronunciation of the possessive words that already end in s? Possible Duplicate:           My name is Greg — this is Greg 's post.  If my name ended with an 's', I am aware of the proper apostrophe usage (James&nbsp;→ James'), but how should this be pronounced?  Phonetically, am I Jameses best friend or James best friend? Connected compact covering space of torus is homeomorphic to $S^1\times S^1$ How to disable SSLv2 or SSLv3? every rank 2 oriented matroid is realizable