public static RegistryKey WritableRegistryRoot     {         get         {             return Registry.LocalMachine.OpenSubKey(@"SOFTWARE\SubFolder1\SubFolder2", true);         }     }   When I run the application I got this error      BlockquoteAn exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll.    But when I run the application as Administrator it works.  When I Change the LocalMachine to CurrentUser my Code works. I have decided to use LocalMachine so that I can use the save data in the registry even if I change my Authentication Login.  If there is other way to access LocalMachine Registry without running my application as administrator?
I know that we shouldn't being using the registry to store Application Data anymore, but in updating a Legacy application (and wanting to do the fewest changes), what Registry Hives are non-administrators allowed to use?    Can I access all of HKEY_CURRENT_USER (the application currently access HKEY_LOCAL_MACHINE) without Administrator privileges?
Smooth rendering of bitmap fonts "become a President" or "become President" If he had not been a film star, he would not have become President.     In my opinion, "a President" is correct. Examples:     "My dream is to be a teacher"   "My dream is to be a President"   Which is correct usage? President or a President? Upgrade to the latest PHP version in Ubuntu What's a recommended alternative to Quickbooks pro? I've just installed Ubuntu to replace Windows. I can't seem to find a good alternative to  to run on Ubuntu. Any help would be appreciated. Assume a table structure of MyTable(KEY, datafield1, datafield2...).  Often I want to either update an existing record, or insert a new record if it doesn't exist.  Essentially:  IF (key exists)   run update command ELSE   run insert command   What's the best performing way to write this? What word means what many people think 'ironic' means? I came across a user with a notification that states:     This account is temporarily suspended network-wide. The suspension period ends on Dec 2 '18 at 2:35.   Screencap for posterity:    Unless this user is  (in which case the full year should be shown, or at least a tooltip), it seems like they should have been unbanned 4 months ago. Is it considered rude if you only ask Questions but almost never answer one yourself I have used the websites of SO a lot the past few months because I am busy with a large scale web project. I feel I get better answers here on SO than when I just do a Google search, maybe because I can be more specific here with my problem, and the responses are really fast.  Occasionally when I am not working I try to answer some questions, but the question almost always has an answer which is 'as good as' or 'better' than the answer I would supply.  So my question/answer ratio is about 20/1 something, if not more. When I look at my profile page I see a bucket-load of questions and almost nothing I answered myself.  Is this considered bad behaviour? I can see that this looks a little egoistic.  : One devoted to one's own interests and advancement. Let $f:X \to Y$ be a homeomorphism between topological spaces $X$ and $Y$. Let $A \subseteq X$ and $B = f(A) \subseteq Y$ (given the subspace topology) and let $g: A \to B$ be the restriction of $f$ given by $g(a) = f(a)$ for $a \in A$.  Showing that $g$ is a homeomorphism.   $g$ injective   Let $g(a_1) = g(a_2)$, $a_1, a_2 \in A$.  $\implies f(a_1) = f(a_2)$  $\implies a_1 = a_2$ as $f$ homeomorphic.   g surjective   Let $y \in B$  $\implies y = f(a)$ for some $a \in A$.  $\implies y = g(a)$ for some $a \in A$.   $g$ continuous   Let $U \subseteq B$ be an open set in $B$.  $f(a) = g(a)$ for all $a \in A =&gt; f^{-1}(b) = g^{-1}(b)$ for all $b \in B$.  So $g^{-1}(U) = f^{-1}(U)$ which is open in $A$ as $f$ homeomorphic.   $g^{-1}$ continuous   Let $U \subseteq A$ be an open set in $A$.  $g(U) = f(U)$ which is open in $B$ as $f$ homeomorphic.  So $g$ is homeomorphic.  Is my understanding correct, this seems almost too straightforward so I was wondering have I overlooked something? "I feel bad for you" versus "I feel badly for you" The error I am having when trying to update my package list.  W: GPG error: http://download.opensuse.org ./ Release: The following signatures were invalid: KEYEXPIRED 1436387333  W: Failed to fetch http://ppa.launchpad.net/samrog131/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found  E: Some index files failed to download. They have been ignored, or old ones used instead. Show that if $a$ and $b$ are positive integers with $(a,b)=1$ then $(a^n, b^n) = 1$ for all positive integers n  Hi everyone, for the proof to the above question,  Can I assume that since $(a, b) = 1$, then in the prime-power factorization of a and b, they have no prime factor in common, when they are taken to the $nth$ power, they will still have no prime factors in common, and so $(a^n, b^n) = 1$ for all positive integers n.  I think I'm jumping to conclusions here again, if so, leave some tips on how to do the proof properly, thanks :)  And also, I do not know how to approach the reverse problem where if $(a^n, b^n) = 1 then (a, b) = 1$, any guidance will be much appreciated! Primary ideals in Noetherian rings For an $R$-module $M$ I have the following definition for a submodule $N\subset M$ to be $\mathfrak{p}$-primary: this is the case when $\text{Ass}(M/N) = \{\mathfrak{p}\}$, that is, $M/N$ is coprimary or $(0)$ is a primary submodule.  Now for an ideal $\mathfrak{q} \subset R$ this definition gives that $\mathfrak{q}$ is $\mathfrak{p}$-primary iff $\text{Ass}(R/\mathfrak{q}) = \{\mathfrak{p}\}$. It can be shown that this is equivalent with $\mathfrak{p}^n \subset \mathfrak{q}$ for some $n\in \mathbb{N}$ and the condition \begin{align*} \forall r,s \in R: rs \in \mathfrak{q}, r\not\in \mathfrak{p}\Rightarrow s \in \mathfrak{q}. \end{align*}     Now I suspect that if $R$ is Noetherian, and if $\mathfrak{q}$ is $\mathfrak{p}$-primary, then we have $\sqrt{\mathfrak{q}} = \mathfrak{p}$. I have shown this for PID's, but does this generaly hold?    And if so, is every ideal $\mathfrak{q}\subset R$ then $\sqrt{\mathfrak{q}}$-primary?   Many thanks. Prove $ \forall c \in \mathbb{R^{+}}, \forall B \in \mathbb{N}, \exists n \in \mathbb{N}, (n \geq B) \wedge (\sqrt{2n} > c \ln(n+2)) $? Why is there an electric field in a wire even though it is a conductor? If you take a perfect conductor, there cannot be a field across it since if there were, the particles would arrange themselves in a way to cancel out the field right?  Yet, why does the same not hold true for a wire. A wire is essentially a long, thin conductor yet electrons do indeed flow so there must be an electric field.  Does this not contradict with what happens in a conductor? Why don't the electrons re-arrange to cancel out the electric field? indentation of a whole paragraph My problem is that I would like to write something like in LaTeX:   But I can't seem to do it wihtout reading like:   Which is pretty anoying to do all the time, in the middle of writting. Is there a code to do it for a whole paragraph without written \hspace*{1,5 cm} in middle of a sentence How to use an alpha map in Blender Render? What is the difference between “do” and “make”? Callout Mock Responses & multiple HTTP Status Code values I'm trying to unit test the behavior of some code which performs callouts and its logic is dependent on the HTTP status code of the response - 200 vs 401.  The pattern being exercised is familiar:   Make callout Response is (unauthorized) HTTP 401 Logic checks Status value on the response if (status == 200) { /* yay! */ } if (status == 401) { /* make request for auth /* }   retry original callout with newly acquired authorization yay!    I am attempting to test the code's "try, auth, retry" behavior using the MultiStaticResourceCalloutMock but it appears that only a single status code can be set for all requests that the mock provider can respond to using the .setStatusCode(int) method. Is this accurate?  Is there a mechanism for using a single MultiStaticResourceCalloutMock and having it respond with different status codes per URL in the test context?  Is the only solution here to use a Dispatcher such as what Andrew Fawcett documents here in this answer?   Is there another method/mechanism that allows for different status codes to be returned by the mock provider on the HTTPResponse?    Some  showing the one-time usage pattern of the .setStatusCode(200) method and the multimock class.  @isTest private class CalloutMultiStaticClassTest {     @isTest static void testCalloutWithMultipleStaticResources() {         // Use MultiStaticResourceCalloutMock to         // specify fake response for a certain endpoint and          // include response body in a static resource.             MultiStaticResourceCalloutMock multimock = new MultiStaticResourceCalloutMock();         multimock.setStaticResource(             'http://api.salesforce.com/foo/bar', 'mockResponse');         multimock.setStaticResource(             'http://api.salesforce.com/foo/sfdc', 'mockResponse2');         multimock.setStatusCode(200);         multimock.setHeader('Content-Type', 'application/json');          // Set the mock callout mode         Test.setMock(HttpCalloutMock.class, multimock);          // Call the method for the first endpoint         HTTPResponse res = CalloutMultiStaticClass.getInfoFromExternalService(             'http://api.salesforce.com/foo/bar');         // Verify response received          System.assertEquals('{"hah":"fooled you"}', res.getBody());          // Call the method for the second endpoint         HTTPResponse res2 = CalloutMultiStaticClass.getInfoFromExternalService(             'http://api.salesforce.com/foo/sfdc');         // Verify response received          System.assertEquals('{"hah":"fooled you twice"}', res2.getBody());     } } I feel intimidated in learning TikZ. I was wondering if there are some nice materials (or just your replies) at different level:   for providing big picture, which is important to beginners to not lose direction during learning. for comprehensive reference.   Examples are important, but only examples are not always clear for understanding the big picture and organization.