Creating a byte array from a string of hex in C
How to find the 'sizeof' (a pointer pointing to an array)?
Alternative IDE for VB6 and VBA I've been spoiled by Visual studio 2008 and Eclipse and have to do a little maintainence work on a VB6 app.  Does anyone know of an alternative/ updated IDE for VB6?  A rewrite is not an option I'm just fixing a couple of bugs and it's a big codebase. The Android OS monitors the power consumption of running apps and hardware (display). As you may guess, this is a useful feature as it allows to track down energy greedy apps.  Is there an application that would do such monitoring on Mac OS?  It should calculate the percentages of the charge that an application/process/hardware has used.  I use plenty of little software that runs in the background permanently. It would be nice to know if such little helpers drain the battery significantly. I look today on a few fresh question, and the view count was 0. Even after I refreshed the page a few time. This is definitely a bug, since the question isn't mine.  Also I don't think the all page was cached, since that the DateTime mark was change every reload.  But maybe the SQL result is cached. If RSA is limited to 117-200 bytes or so, is that a very limited use case? Am I missing something, or is RSA very very limiting when it comes to ecrypting data when it comes to the actual message size?  I have read that you can only encrypt a message of around 117 to 200 bytes in size (depending on your key size: 1024 or 2048 bits). Is this correct?  If so, I think I have read people suggesting on using it for larger files. I guess they are just repeating the process many times over and over in blocks of 117 bytes? Nested sequences of balls in a Banach space This seems to be a fairly easy question but I'm looking for new points of view on it and was wondering if anyone might be able to help.  (By the way- this question does come from home-work, but I've already solved and handed it, and I'm posting this out of interest, so no HW tag.)     Let $B_n=B(x_n,r_n)$ be a sequence of nested closed balls in a Banach space $X$. Prove that $\bigcap_{n=1}^\infty B_n\neq\varnothing$.   As I said before, it should be rather simple. When the radii decrease to 0, it's just a matter of selecting any sequence of points in $B_n$, and it must be Cauchy- and the limit is in the intersection.  My question is what to do when the radii do not decrease to 0? I got some tips about multiplying the balls by a sequence of decreasing scalars, or reducing the radii so that they decrease to 0, but found too many pathological cases for both methods.  Finally- I used a geometric arguemnt (which i've shown to work in any normed space) that if $B(x_1,r_1)\subset B(x_2,r_2)$ then $\| x_1-x_2\|\leq|r_1-r_2|$. This turned out to be some kind of technical catastrophe, but it worked...  Still, if anyone knows of a more elegant solution, I'd love to hear about it. How can I automatically center an image? I use:  \documentclss{mwrep} ... \begin{figure}   \includegraphics{a.jpg} \caption[Long caption]{Caption} \label{pic-a} \end{figure}   How can I make images to be always visible on the center of page? (To be more specific: the center of the image should be between the left and right margin - I use different left and right margins). I don't want to put anything after every \begin{figure} in my document.  Important: I don't want to waste an entire page on a single image at the very center of the page. I want only horizontal alignment. (left &lt;-> right) Make mod_wsgi use python2.7.2 instead of python2.6? i am running Ubuntu 10.04.1 LTS  and it came pre-packed with python2.6 but i need to replace it with python2.7.2.   (The reason is simple, 2.7 has a lot of features backported from 3 )  i had installed python2.7.2 using  ./configure make make altinstall   the altinstall option installed it, without touching the system default version, to /usr/local/lib/python2.7 and placed the interpreter in /usr/local/bin/python2.7  Then to help mod_wsgi find python2.7 i added the following to /etc/apache2/sites-available/wsgisite  WSGIPythonHome /usr/local   i start apache and run a test wsgi app BUT i am greeted by python 2.6.5  and not Python2.7  Later i replaced the default python simlink to point to python 2.7  ln -f /usr/local/bin/python2.7 /usr/bin/python   Now typing 'python' on the console opens python2.7 but somehow mod_wsgi still picks up python2.6  Next i tried,  PATH=/usr/local/bin:$PATH export PATH   then do a quick restart apache, but yet again its python2.6 !!    Here is my $PATH  /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games   contents of /etc/apache2/sites-available/wsgisite  WSGIPythonHome /usr/local   &lt;VirtualHost *:80&gt;      ServerName wsgitest.local     DocumentRoot /home/wwwhost/pydocs/wsgi     &lt;Directory /home/wwwhost/pydocs/wsgi&gt;         Order allow,deny         Allow from all     &lt;/Directory&gt;      WSGIScriptAlias / /home/wwwhost/pydocs/wsgi/app.wsgi  &lt;/VirtualHost&gt;   app.wsgi  import sys  def application(environ, start_response):     status = '200 OK'     output = sys.version      response_headers = [('Content-type', 'text/plain'),                         ('Content-Length', str(len(output)))]     start_response(status, response_headers)      return [output]   Apache error.log  'import site' failed; use -v for traceback [Sun Jun 19 00:27:21 2011] [info] mod_wsgi (pid=23235): Initializing Python. [Sun Jun 19 00:27:21 2011] [notice] Apache/2.2.14 (Ubuntu) mod_wsgi/2.8 Python/2.6.5 configured -- resuming normal operations [Sun Jun 19 00:27:21 2011] [info] Server built: Nov 18 2010 21:20:56 [Sun Jun 19 00:27:21 2011] [info] mod_wsgi (pid=23238): Attach interpreter ''. [Sun Jun 19 00:27:21 2011] [info] mod_wsgi (pid=23239): Attach interpreter ''. [Sun Jun 19 00:27:31 2011] [info] mod_wsgi (pid=23238): Create interpreter 'wsgitest.local|'. [Sun Jun 19 00:27:31 2011] [info] [client 192.168.1.205] mod_wsgi (pid=23238, process='', application='wsgitest.local|'): Loading WSGI script '/home/wwwhost/pydocs/$ [Sun Jun 19 00:27:50 2011] [info] mod_wsgi (pid=23239): Create interpreter 'wsgitest.local|'.   Has anybody ever managed to make mod_wsgi run on a non-system default version of python ? Set multicolumn width to default table width C++11 does not deduce type when std::function or lambda functions are involved Do free falling observers see gravitational blueshift? Observers at rest in gravitational fields will see infalling light signals as blueshifted.  Do inertial observers in free fall in a gravitational field see the same shift?  If someone is standing on a cliff at rest in the gravitational field and then steps off, do they instantly see a change in the blueshift as a result of being in free fall in an inertial reference frame? Update Manager is constantly offering me updates (e.g. security fixes, updates from PPAs).  How can I tell my Ubuntu installation to automatically download and install updates whenever they become available? It would seem that one way of proving this would be to show the existence of non-algebraic numbers. Is there a simpler way to show this? Kernel panic after update to 4.4.0-108-generic What to do when witches appear early in the game? Page 105 of D. Burton's A First Course in Rings and Ideals reads     It is not difficult to show that if (I'll call them $n$ and $m$ instead of $n_1$ and $n_2$) $n$, $m$ are square free integers, then $\mathbb{Q}(\sqrt{n}) \cong \mathbb{Q}(\sqrt{m})$ if and only if $n=m$.   Well, it is getting difficult for me, any help or would be appreciated.    My progress so far: Suppose $\phi :\mathbb{Q}(\sqrt{n})\to\mathbb{Q}(\sqrt{m})$ is an isomorphism. Then $\phi(u)=u$ for every $u \in \mathbb{Q}$, so that $\phi(\sqrt{n})^2=\phi(n)=n$. If $\phi(\sqrt{n})=a+b\sqrt{m}$ for some $a,b\in\mathbb{Q}$, then $(a+b\sqrt{m})^2=a^2+b^2m + 2ab\sqrt{m}=n$ implies $$a^2+b^2m = n$$ and $$2ab=0.$$  Then $b=0$ cannot happen since that would imply that $\sqrt{n}\in\mathbb{Q}$, where $n$ is a square-free integer. Also $a=b=0$ cannot happen. Hence $a=0$ and we have $$b^2m=n.$$ If $\psi:\mathbb{Q}(\sqrt{n})\to\mathbb{Q}(\sqrt{m})$ were an isomorphism then there would exist some $s\in\mathbb{Q}$ such that $$s^2m=n,$$ then $s=b$ or $s=-b$. Therefore the only isomorphisms from $\mathbb{Q}(\sqrt{n})$ to $\mathbb{Q}(\sqrt{n})$ are $\phi(u+v\sqrt{n})=u+vs\sqrt{m}$ and $\psi(u+v\sqrt{n})=u-vs\sqrt{m}$.    I don't know if there's an easier way and I don't know if I'm in the correct way here. Thanks beforehand :) How do I post code in chat? I would like to be able to post code in chat. I know that I can post inline snippets of code by using backticks, but I don't know how to post blocks of code, with the entire chat message formatted as code, and indentation respected. I am aware of . After reading the comments, I found out that I could format in "fixed width", but I can't see a "fixed width" button anywhere. What should I do? If you go to  and are a 4k+ user on Anime.SE, you will see the following:        There is one reopen vote on this question, but the reopen vote count is displayed on a different line than the word "reopen". This is slightly silly, and would perhaps benefit from converting reopen (1) to reopen&amp;nbsp;(1), and likewise for close and delete votes. (Or any other way of preventing a line break between the vote type and the vote count.)  A repro (the close link) from here on Meta: Inequality involving the sup of a function and its first and second derivatives Let $f:\mathbb{R} \to \mathbb{R}$ be a twice differentiable function. And let  $$\eqalign{   &amp; M_0  = \sup \left|f(x)\right|  \cr                &amp; M_1  = \sup \left|\frac{d}{dx} f(x) \right|  \cr                &amp; M_2  = \sup \left|\frac{d^2}{dx^2} f(x) \right| \cr }$$ Prove that  $$M_1 ^2  \leqslant 4M_0 M_2$$ I can not think how I can relate these values ​​in some inequality )= I have a file: Base.h  class Base; class DerivedA : public Base; class DerivedB : public Base;  /*etc...*/   and another file: BaseFactory.h  #include "Base.h"  class BaseFactory { public:   BaseFactory(const string &amp;sClassName){msClassName = sClassName;};    Base * Create()   {     if(msClassName == "DerivedA")     {       return new DerivedA();     }     else if(msClassName == "DerivedB")     {       return new DerivedB();     }     else if(/*etc...*/)     {       /*etc...*/     }   }; private:   string msClassName; };  /*etc.*/   Is there a way to somehow convert this string to an actual type (class), so that BaseFactory wouldn't have to know all the possible Derived classes, and have if() for each one of them? Can I produce a class from this string?   I think this can be done in C# through Reflection. Is there something similar in C++? Difference of the \dots*