body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
In the android app, looking at Math.SE, the formulas show up as raw (La)?TeX source. These should be rendered so they look look like pretty formulas: \int_a^b f'(x) dx = f(b) - f(a) should look like:
|
MathJax isn't currently working on the Android app, which makes it totally useless for the 'technical' sites like or . For example, in the Android app: Same post in a (mobile) browser: Please add this functionality!
|
We know the dimension of a affine algebraic variety $X\subseteq$ $\mathbb{A}^{n}_k$ (k a field, and $X$ does not have to be irreducible) is the biggest integer r such that there exists a strictly increasing chain $Z_{0}\subset Z_{1}\subset ... \subset Z_{r}\subset X$ of affine algebraic varieties in X. On the other side, $\overline{X}$ $\subseteq$ $\mathbb{P}^{n}_k$ is the smallest algebraic subset in $\mathbb{P}^{n}_k$ (k a field) such that $X\subseteq$ $\overline{X}$. I tried proving that the projective closure preserve the inclusions, i.e., if $Z\subseteq Y$, for $Z, Y\subseteq X$, then $\overline{Z}\subseteq \overline{Y}$, for $\overline{Z},\overline{Y}\subseteq\overline{X}$, but I don't know how to proceed or if this will help me with the initial problem.
|
Let $V$ be an irreducible variety of finite type over a field $k$, $V_{0}\subseteq V$ open and nonempty (or at least dense). Why is \begin{equation*}\operatorname{dim}_{\operatorname{Krull}}(V_{0})=\operatorname{dim}_{\operatorname{Krull}}(V)\text{?}\end{equation*} My professor uses this result (without mentioning a proof) as if it were somehow self-evident. I have tried to prove it, but I am at a loss. Who can help? The general statement is NOT true for arbitrary irreducible topological spaces, not even for varieties of finite type over an arbitrary integral domain, see for instance.
|
Without electromagnetic coupling, the QM charged particle wave function is not invariant under a local gauge transformation — one with a phase that depends on space (space-time): \begin{equation} \psi \mapsto e^{-i\alpha(x)}\phi \end{equation} In order to turn on the electromagnetic coupling, we make the replacement $$\hat{\vec{p}} \mapsto \hat{\vec{p}} - \frac{ie}{c}\vec{A}$$ This means that, in the Schrodinger equation is gauge invariant because the term arising from $\vec{A}$ is cancelled through the action of $\hat{\vec{p}} = i\hbar\partial$ on the phase factor $e^{-i\alpha(x)}$ in the wave function. The math trick is clear. But physics cannot be understood from it, namely, why the requirement of local gauge invariance requires 1) the charge conservation 2) and the emergence of some kind of carrier of interaction.
|
I am a mathematics student with a hobby interest in physics. This means that I've taken graduate courses in quantum dynamics and general relativity without the bulk of undergraduate physics courses and sheer volume of education into the physical tools and mindset that the other students who took the course had, like Noether's theorem, Lagrangian and Hamiltonian mechanics, statistical methods, and so on. The courses themselves went well enough. My mathematical experience more or less made up for a lacking physical understanding. However, I still haven't found an elementary explanation of gauge invariance (if there is such a thing). I am aware of some examples, like how the magnetic potential is unique only up to a (time-)constant gradient. I also came across it in linearised general relativity, where there are several different perturbations to the spacetime metric that give the same observable dynamics. However, to really understand what's going on, I like to have simpler examples. Unfortunately, I haven't been able to find any. I guess, since "gauge invariance" is such a frightening phrase, no one use that word when writing to a high school student. So, my (very simple) question is: In many high school physics calculations, you measure or calculate time, distance, potential energy, temperature, and other quantities. These calculations very often depend only on the difference between two values, not the concrete values themselves. You are therefore free to choose a zero to your liking. Is this an example of gauge invariance in the same sense as the graduate examples above? Or are these two different concepts?
|
I have a system where a cron job is used to drive a manage.py command every minute. The trouble is, the job can sometimes take longer than a minute, and it's not safe for two instances of the command to run at once. Is there a good way to make the command detect if another instance of itself is already running and exit early? Is there a better way to achieve the same end?
|
Is there a Pythonic way to have only one instance of a program running? The only reasonable solution I've come up with is trying to run it as a server on some port, then second program trying to bind to same port - fails. But it's not really a great idea, maybe there's something more lightweight than this? (Take into consideration that program is expected to fail sometimes, i.e. segfault - so things like "lock file" won't work)
|
The problem is to prove the following statement for all natural numbers. $$f(n)=\sum_{k=0}^n\binom{n+k}{k}\left(\frac{1}{2}\right)^k=2^n$$ I already proved this using mathematical induction. But, my instinct is telling me that there is some kind of combinatorial/algebraic method that can be used to solve this easily. (Unless my instinct is wrong.) Can anyone give me hint on how to do this?
|
How does one show that $$\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}=2^{n}$$ for each nonnegative integer $n$? I tried using the but I guess I am applying it incorrectly. With the snake oil technique we have $$F(x)= \sum_{n=0}^{\infty}\left\{\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}\right\}x^{n}.$$ I think I have to interchage the summation and do something. But I am not quite comfortable in interchanging the summation. Like after interchaging the summation will $$F(x)=\sum_{k=0}^{n}\sum_{n=0}^{\infty}\binom{n+k}{k}\frac{1}{2^k}x^{n}?$$ Even if I continue with this I am unable to get the correct answer. How does one prove this using the Snake oil technique? A combinatorial proof is also welcome, as are other kinds of proofs.
|
In order to get around an someone suggested spoofing my network cards mac address. How do I detect whether the wifi card supports mac address spoofing? There is material out there on this, but it is very dated. How do you do this on Ubuntu 17.10? I ended up just running this: sudo macchanger --mac 00:11:22:33:44:55 wlan0 Use iwconfig to detect the name of your wireless card. Unfortunately this did not resolve the issue with Starbucks WIFI.
|
My router can do port-forwarding based on MAC addresses. That is, a specific MAC will get a specific IP, for which I can configure a set of ports to be forwarded. In order to easily change that set of ports, I'd like to have different connections in the Network manager. How do I change the MAC address for a network connection?
|
Imagine a fundamental particle at rest with respect to ground frame and has temperature $x$ degrees celsius and imagine a 'similar' particle moving at a very high speed (take any value which would affect temperature significantly). So the particle moving has temperature greater than $x$ degrees celsius or exactly equal to $x$ degrees celsius?
|
In (non-relativistic) classical physics, if the temperature of an object is proportional to the average kinetic energy ${1 \over 2} m\overline {v^{2}}$of its particles (or molecules), then shouldn't that temperature depend on the frame of reference - since $\overline {v^{2}}$ will be different in different frames? (I.e. In the lab frame $K_l = {1 \over 2} m\overline {v^{2}} $, but in a frame moving with velocity $u$ relative to the lab frame, $K_u = {1 \over 2} m \overline {(v+u)^{2}}$).
|
Nowadays I see lots of questions using code sample display for highlight, not really on code samples. This is an example how it looks. I see comments about they are ok to use, and some other comments saying reverse. Is it ok to use them like that?
|
When reviewing Suggested Edits on Stack Overflow, I often come across "fixed formatting" suggestions that use to place emphasis on certain keywords, but isn't actual code. For example: I am having a difficult time with a background task in iOS. The problem I seem to be facing is that iOS is silently terminating the App if my background task runs for too long. What can I do to increase time iOS will wait for my background task to complete? Gets edited to: I am having a difficult time with a background task in iOS. The problem I seem to be facing is that iOS is silently terminating the App if my background task runs for too long. What can I do to increase time iOS will wait for my background task to complete? This seems like an invalid use of an inline code span because, well, it isn't code, and it is distracting. There are a of these edits being made. Often enough they get approved, which reinforces the behavior. Is this a valid use of inline code spans? If not, should it be edited and corrected? Should edits suggesting these changes be rejected?
|
''' <?php $page = $_SERVER['PHP_SELF']; $date_for_hold = date("Y-m-d"); $now = time(); $today = strtotime('18:11:35'); $tomorrow = strtotime('tomorrow 23:16:00'); if (($today - $now) == 0) { $refreshTime = $today - $now; //MySQL Queries... echo "Data Inserted"; } else{ echo "Not Inserted"; } ?> ''' I need this without opening the page and time runs in the backend, when time reaches to 5:00 a.m it will automatically insert data into the mysql database.
|
I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend? What I’ve thought out so far is having a script included in the top of every page and then let this script check whether it’s time to run this job or not. This is just a quick example of what I was thinking about: if ($alreadyDone == 0 && time() > $timeToRunMaintainance) { runTask(); $timeToRunMaintainance = time() + $interval; } Anything else I should take into consideration or is there a better method than this?
|
I used the following code to redirect all the HTTP pages of a site to the https:// version. <link rel="canonical" href=""> <script> var url = window.location.href; // get current URL var link = document.querySelector('link[rel=canonical]'); // get the link element var changedUrl = [url.slice(0, 4), 's', url.slice(4)].join(''); // change the URL to https:// link.setAttribute('href', changedUrl); // set href attribute of link element </script> Now my questions is, will Google read the dynamically generated canonical tags and index them like normal canonical tags? Or will I have to try another approach?
|
Most sources of documentation state that one can declare a webpage a duplicate of another by applying this tag on the duplicate page: <link rel="canonical" href="(absolute URL to original page)"> I could generate the above tag via the script below: <script> var l=document.createElement('Link'); l.rel='canonical';l.href='(absolute URL to original page)'; document.getElementsByTagName('head')[0].appendChild(l); </script> My question is, would google be able to process this javascript and believe I'm declaring the page as a duplicate page? or would I be forced to use the link tag in the header? I ask because I'm trying to reduce the unnecessary bytes required to be processed before the actual user readable content begins.
|
Person A: Did they eventually sign to a booking agency? Person B: Yes, but after I had stopped managing them I just would like to know if past simple would be possible and is past perfect here to explain that the band sign to a booking agency because but they did not have a manager to establish a strong link between them
|
Before I met her I had a poor opinion of her. As person had a poor opinion before a particular time in past (before He met her) so I think there should be had had. There are some more example like this: Before I went to the university, I worked/had worked as a carpenter for 5 years. Before I opened the door, I put/had put the key in the lock. Before I opened the door, I looked/had looked carefully into the barn for snipers. In all these sentence, for me, it should be perfect tense. I asked that question on another platform where I was told that if sequence of past event is obvious and sentences uses "before"and "after", we often use past tense. Which means we should use past tense in all these sentences. But I have another sentence "The train had left before I reached the station." If I follow above mentioned rule there should be "left" instead of "had left". But I am damn sure this sentence is correct with "had left". Am I correct? Thank you
|
A while back I installed Docker, but don't remember what I did. I'm still learning/getting used to Linux and am unsure how to get rid of the following error. When I run sudo /apt-get update I get the following error. How can get rid of this error? I'd like just to eliminate this error, not reinstall Docker, do /I need to revert the add-apt-repository action that I did when installing? Err:14 https://download.docker.com/linux/ubuntu eoan Release 404 Not Found [IP: 2600:9000:21d5:ae00:3:db06:4200:93a1 443] Get:15 http://us.archive.ubuntu.com/ubuntu eoan-updates InRelease [97.5 kB] Err:16 https://download.docker.com/linux/debian eoan Release 404 Not Found [IP: 2600:9000:21d5:ae00:3:db06:4200:93a1 443] Get:17 http://us.archive.ubuntu.com/ubuntu eoan-backports InRelease [88.8 kB] Hit:19 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease Reading package lists... Done E: The repository 'https://download.docker.com/linux/ubuntu eoan Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: The repository 'https://download.docker.com/linux/debian eoan Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
|
Does someone knows if it exists some ppa packages source for the newest Ubuntu version 19.10 i had problem with that when i upgraded from Ubuntu 19.04 to 19.10 i didn't work?
|
The argument to prove that there are different sizes of infinity is by saying .. no matter how many decimal numbers you write you can always come up with new one different from all others listed already.So, there is no one-one correspondence between natural numbers and decimal numbers. But, every time you come up with new one, you can add that new one to the list and correspond that to a natural number(which can go to infinity). So, again we have one-one correspondence and same cardinality and Hence same size of infinities. Please can someone help me what is wrong with my argument and what am I missing? It seems like the original argument is relying on the assumption that list of natural numbers end somewhere and we come up with a new decimal number to disprove one-one correspondence.
|
I'm having trouble understanding Cantor's diagonal argument. Specifically, I do not understand how it proves that something is "uncountable". My understanding of the argument is that it takes the following form (modified slightly from the article, assuming base 2, where the numbers must be from the set $ \lbrace 0,1 \rbrace $): \begin{align} s_1 &= (\mathbf{0},1,0,\dots)\\ s_2 &= (1,\mathbf{1},0,\dots)\\ s_3 &= (0,0,\mathbf{1},\dots)\\ \vdots &= (s_n \text{ continues}) \end{align} In this case, the diagonal number is the bold diagonal numbers $(0, 1, 1)$, which when "flipped" is $(1,0,0)$, neither of which is $s_1$, $s_2$, or $s_3$. My question, or misunderstanding, is: When there exists the possibility that more $s_n$ exist, as is the case in the example above, how does this "prove" anything? For example: \begin{align} s_0 &= (1,0,0,\mathbf{0},\dots)\ \ \textrm{ (...the wikipedia flipped diagonal)}\\ s_1 &= (\mathbf{0},1,0,\dots)\\ s_2 &= (1,\mathbf{1},0,\dots)\\ s_3 &= (0,0,\mathbf{1},\dots)\\ s_4 &= (0,1,1,\mathbf{1},\dots)\\ s_4 &= (1,0,0,\mathbf{1},\dots)\ \ \textrm{ (...alternate, flipped } s_4\textrm{)}\\ s_5 &= (1,0,0,0,\dots)\\ s_6 &= (1,0,0,1,\dots)\\ \vdots &= (s_n \text{ continues}) \end{align} In other words, as long as there is a $\dots \text{ continues}$ at the end, the very next number could be the "impossible diagonal number", with the caveat that it's not strictly identical to the "impossible diagonal number" as the wikipedia article defines it: For each $m$ and $n$ let $s_{n,m}$ be the $m^{th}$ element of the $n^{th}$ sequence on the list; so for each $n$, $$s_n = (s_{n,1}, s_{n,2}, s_{n,3}, s_{n,4}, \dots).$$ ...snip... Otherwise, it would be possible by the above process to construct a sequence $s_0$ which would both be in $T$ (because it is a sequence of 0s and 1s which is by the definition of $T$ in $T$) and at the same time not in $T$ (because we can deliberately construct it not to be in the list). $T$, containing all such sequences, must contain $s_0$, which is just such a sequence. But since $s_0$ does not appear anywhere on the list, $T$ cannot contain $s_0$. Therefore $T$ cannot be placed in one-to-one correspondence with the natural numbers. In other words, it is uncountable. I'm not sure this definition is correct, because if we assume that $m = (1, \dots)$, then this definition says that "$s_n$ is equal to itself"&mdadsh;there is no "diagonalization" in this particular description of the argument, nor does it incorporate the "flipping" part of the argument, never mind the fact that we have very clearly constructed just such an impossible $T$ list above. An attempt to correct the "diagonalization" and "flipping" problem: $$s_n = (\lnot s_{m,m}, \lnot s_{m,m}, \dots) \quad \text{where $m$ is the element index and} \quad\begin{equation}\lnot s_{m,m} = \begin{cases}0 & \mathrm{if\ } s_{m,m} = 1\\1 & \mathrm{if\ } s_{m,m} = 0\end{cases}\end{equation}$$ This definition doesn't quite work either, as we immediately run in to problems with just $s_1 = (0),$ which is impossible because by definition $s_1$ must be $ = (1)$ if $s_1 = (0)$, which would also be impossible because... Or more generally, with the revised definition there is a contradiction whenever $n = m$, which would seem to invalidate the revised formulation of the argument / proof. Nothing about this argument / proof makes any sense to me, nor why it only applies to real numbers and makes them "uncountable". As near as I can tell it would seem to apply equal well to natural numbers, which are "countable". What am I missing?
|
$$\iint\limits_{Q} \frac{dx\,dy}{x^{-1}+|\ln y| - 1} \le 1 ,~~ Q = [0; 1] \times [0;1]$$
|
Please, help me to prove that: $$ \int_Q \int \frac{dxdy}{x^{-1} + |\ln y| - 1} \leq 1,$$ where $$ Q = [0; 1] \times [0; 1] $$ Any ideas how to start. Thank you.
|
Now Consider the following idea I'm declaring a if/elif type to run the program Such as : number=int(input("Enter a number :")) If number ==0 Run program.py Elif number ==1 Run Program2.py Else number ==2 Run Program3.py Now clearly the command run program.py doesn't work so what should I do to make it execute program.py incase it is selected and close the main program where we are choosing the number?
|
I have a Python script that needs to execute an external program, but for some reason fails. If I have the following script: import os; os.system("C:\\Temp\\a b c\\Notepad.exe"); raw_input(); Then it fails with the following error: 'C:\Temp\a' is not recognized as an internal or external command, operable program or batch file. If I escape the program with quotes: import os; os.system('"C:\\Temp\\a b c\\Notepad.exe"'); raw_input(); Then it works. However, if I add a parameter, it stops working again: import os; os.system('"C:\\Temp\\a b c\\Notepad.exe" "C:\\test.txt"'); raw_input(); What is the right way to execute a program and wait for it to complete? I do not need to read output from it, as it is a visual program that does a job and then just exits, but I need to wait for it to complete. Also note, moving the program to a non-spaced path is not an option either. This does not work either: import os; os.system("'C:\\Temp\\a b c\\Notepad.exe'"); raw_input(); Note the swapped single/double quotes. With or without a parameter to Notepad here, it fails with the error message The filename, directory name, or volume label syntax is incorrect.
|
How to draw the following graph in my manuscript? I am unable to draw this graph. Can someone please me to draw this? I am new to TikZ. I have started learning from this link but unfortunately it does not show how to draw this kind of graph. Can someone please help?
|
I am interested in outputting this graph in latex using tikz: So far I got this: and my tikz code is \begin{tikzpicture} \node[shape=circle,draw=black] (A) at (0,0) {A}; \node[shape=circle,draw=black] (B) at (0,3) {B}; \node[shape=circle,draw=black] (C) at (2.5,4) {C}; \node[shape=circle,draw=black] (D) at (2.5,1) {D}; \node[shape=circle,draw=black] (E) at (2.5,-3) {E}; \node[shape=circle,draw=black] (F) at (5,3) {F} ; \path [->] (A) edge node[left] {$5$} (B); \path [->](B) edge node[left] {$3$} (C); \path [->](A) edge node[left] {$4$} (D); \path [->](D) edge node[left] {$3$} (C); \path [->](A) edge node[right] {$3$} (E); \path [->](D) edge node[left] {$3$} (E); \path [->](D) edge node[top] {$3$} (F); \path [->](C) edge node[top] {$5$} (F); \path [->](E) edge node[right] {$8$} (F); \end{tikzpicture} I want to know how to draw the arc between nodes B and E and also thicker arcs with their lengths in center. Any help is appreciated
|
I want to know, Why the zero morphism is independent of the zero object. I have $0 \in \mathcal{C}$ the zero object and $0_{X,Y}: X \to 0 \to Y$ the zero morphism. I am very confused to prove that the zero morphism is independent of the zero object. Can anybody give me an idea?
|
I want to prove that zero morphism does not depend on zero object. Let a zero object $0 \in \mathcal{C}$. I supposed that exists another zero object $0' \in \mathcal{C}$, and I considered $0: A \to B$ and also $$A \to 0 \to 0' \to B$$ But I don't know to prove that zero morphism $0: A \to B$ not does not depend on zero object. Can anybody give me a suggestion?
|
Any way to link another person's answer to the same post from within your answer to the same post? I tried the following: I took the share link of the OP's post put it in the browser tab to get the complete (redirected) url. I copied that url and added it as a link to my post. However, on clicking on that link, I was expecting the web page to scroll. Instead I got a round trip, and the page refreshed.
|
I've noticed that link-ids are not rewritten. I would much prefer it if they were. For instance, lets say I'm on . And, let's say I want to link to a specific answer like by @Eric. It would be nice if an inserted link on the page to that question would get rewritten to be href="#3346729". This would prevent the need for my browser to reload the page. I would save a lot of time, and with this extra time I could help even more people. This is of course only referencing the html to be rendered. I don't care at all about what sits in the SO DB... Though personally I wouldn't want to fix my internal linking to make assumptions about the transport.. That seems silly, but it is not my business. Wikipedia doesn't permit this because it is a bad idea, that's why Wikipedia is one step ahead with the [link generator], and even has [otherprojects:linkgenerators] accessible that make no assumptions about where the questions/answers are currently sitting. Even perlmonks had link generators some 10 years ago, [rt:num], and[id:node]. UPDATE If you change the display links to be only relative to the current page, you can no longer copy/paste them so that they can be used elsewhere, such as in another SO posting, or another website. – Robert Harvey 1 hour ago So Dr. Harvey has a point. I looked into how Wikipedia does this, because they're a few steps ahead of Stack Overflow, and apparently all you have to do is not specify the "comment" number. If you click on this link it will not rerender the page. http://meta.stackexchange.com/questions/58645/updated-question-plz-reread-please-make-links-to-other-answers-in-the-same-qu#58685 or this link, '#58685` If however, you click on this link it will http://meta.stackexchange.com/questions/58645/updated-question-plz-reread-please-make-links-to-other-answers-in-the-same-qu/58685#58685 So what SO is doing is rendering a different canonical url entirely for the comment at /58685 even though that page is most probably the same, how very dirty. Update AGAIN Had to change the links because they changed when I updated the title (another SO bug I guess)
|
I am new to StackOverflow and I wonder if it is possible to add tag "midao" ? The reason for this request is that there is Java Open-Source project called Midao () and it would be great to be able to ask questions / find answers by using that tag. Thank you in advance. P.S. I already investigated , and according to information there - I don't have enough privileges to create it myself.
|
Can someone please create the tag on our site? We need to have it because Foo is a recent/upcoming release / edition / model / episode of a popular, established OS / board game / bike brand / TV show Foo is a hot new language / ingredient / game we're currently using some other tag for questions about Foo, but it's causing ambiguity with a separate thing that's also named Foo This is not a joke post. We get a lot of feature requests that ask for this or that tag to be created, and every time, a discussion ensues wherein people explain that there is no "tag creation department" and that community members create tags just by using them. I'm posting this "question" so that future requests of that type can be closed as a duplicate of this, saving time and eliminating redundant conversations for everyone involved. See also:
|
Just noticed I received a badge achievement in the iPhone app. Tapped on it, and a browser view opens, and it's unauthenticated.
|
I noticed a small bug when clicking on the badge in the achievements overview. Instead of taking you to the badge tab in your profile on the mobile web site or desktop web site, it shows the default page on the mobile web site: Clicking on Copy Editor takes you here: Expected to go for me.
|
I am trying to derive the geodesic equation using variational principle. My Lagrangian is $$ L = \sqrt{g_{jk}(x(t)) \frac{dx^j}{dt} \frac{dx^k}{dt}}$$ Using the Euler-Lagrange equation, I have got this. $$ \frac{d^2 x^u}{dt^2} + \Gamma^u_{mk} \frac{dx^m}{dt} \frac{dx^k}{dt} = \frac{\frac{dx^u}{dt}}{g_{pq}\frac{dx^p}{dt}\frac{dx^q}{dt}} \frac{d}{dt}\left[g_{rs}\frac{dx^r}{dt}\frac{dx^s}{dt}\right]$$ How do I prove the right hand side to be zero to get the geodesic equation? Basically, I can rewrite the above mentioned equation as $$ \frac{d^2 x^\mu}{dt^2} + \Gamma^\mu_{\nu \lambda} \frac{dx^\nu}{dt} \frac{dx^\lambda}{dt} = \frac{dx^\mu}{dt} \frac{d\ \log(L)}{dt}$$ I need to know why is the following true? $$\frac{d\ \log(L)}{dt} =0$$ I know that the derivation might be simpler using a different Lagrangian but I want to do it using this one.
|
I would like to recover the (timelike) geodesics equations via the variational principle of the following action: $$ \mathcal{S}[x] = -m \int d\tau = -m \int \sqrt{-g_{\mu\nu}\,dx^{\mu}\,dx^{\nu}} $$ Using an arbitrary auxiliary parameter $\lambda$, then one is able to rewrite the action and obtains: $$ d\tau = \sqrt{-g_{\mu\nu}\, \tfrac{dx^{\mu}}{d\lambda}\tfrac{dx^{\mu}}{d\lambda}} d\lambda $$ $$ -m \int d\tau = -m \int (d\tau / d\lambda) d\lambda = -m\int\sqrt{-g_{\mu\nu}\, \tfrac{dx^{\mu}}{d\lambda}\tfrac{dx^{\mu}}{d\lambda}} d\lambda $$ Now we can vary the paths $x^{\mu}(\tau) \rightarrow x^{\mu}(\tau) + \delta x^{\mu}(\tau)$. I need the following equation to be true, so i get the geodesics equations, but I don't know how one can say the following: $$ \int d\tau \,\delta g_{\mu\nu}\frac{dx^{\mu}}{d\tau} \frac{dx^{\nu}}{d\tau} = \int d\tau\, g_{\mu\nu, \rho} \frac{dx^{\mu}}{d\tau} \frac{dx^{\nu}}{d\tau} \delta x^{\rho} $$ I know there is a simpler action, which leads to the same equation of motion, but there one has to do the same manipulation, which I sadly don't understand. Thanks for helping me!
|
Let $f$ be a holomorphic, non-constant function on $D=\{0<|z|<10\}$. It is given that for every $n \in \mathbb{N}$, $|f(\frac{1}{n})| \le \frac{1}{n!}$. Show that $f$ has an essential singularity at 0. I have no idea how to even approach this. Why is it not possible for $f$ to have a pole at 0? Note. In the original question it was written $n \in \mathbb{C}$ but I considered this a typo. Thanks in advance!
|
Let $f$ be holomorphic non-constant on $D=\left\{ 0<\left|z\right|<10\right\}$ . Given that for all $n\in\mathbb{N}$: $\left|f\left(\frac{1}{n}\right)\right|\leq\frac{1}{n!}$ prove that $f$ has an essential singularity at $0$. Find an example of $f$ satisfying the condition. My idea was to assume for contradiction the singularity is not essential, which means that either the limit $z\to0$ of $f$ exists or of $1/f$, and from $\left|f\left(\frac{1}{n}\right)\right|\leq\frac{1}{n!}$ we get that the limit of $f$ exists and is $0$. I then define $h(z)=f(z)$ for $z\neq0$ and $h(0)=0$, which is holomorphic on the entire disk, and derive a contradiction from there and the uniqueness theorem. But then the suitable holomorphic function is the Gamma function, which we have not really discussed in class and I'm not sure about it's properties. Any ways of solving this which avoids using the gamma function?
|
Unarmed strikes normally do damage equal to (1 + Str mod). If I punch someone and have a -2 Strength modifier, will I technically heal the target by 1 HP?
|
A slightly humorous thought occurred to me (a recovering rules lawyer) after reading . "None of the answers actually specify that 0 is the minimum damage." Logically it wouldn't make sense for an attack to apply negative damage or healing, except in specific cases like hitting a flame elemental with a fire attack. Ruling that you could do negative damage would lead to an exploit to avoid costs of healing. As such I highly doubt any DM would make such a ruling. I definitely wouldn't except for the most absurd and humorous of games were failure is the expected result not success. Another possibility (as suggested by Secespitus) is that negative damage would reflect back on the attacker. This could be seen as punching a strongman so hard (or in just the wrong way) as to injure your own hand. This would also play well in a failure is the only option game, and if there is a rule suggesting that it would be an appropriate answer to this question as well. Take the case of a person with less than 8 Strength, no levels in monk, and does not have a tavern brawler. Would they do -1(1 - 2) damage on unarmed strikes? If so what would the result of the negative damage be? "Healing" the target because such a puny hit actually raises their fighting spirits and makes them more capable of fighting Reflective Damage, the attacker actually takes 1 point of damage, representing injury to his hand or other damage I am curious to know if there is an official rule stating that the minimum damage an attack can do is 0 or is there something in the damage calculation that I am missing that would otherwise prevent negative damage?
|
This Sep 16 '18 business annoys me to no end. Like most of the world's population my brain wants to parse dates either little or big endian. I'd like to change the displayed date format to , but I use a number of devices (on occasion even the SE App on android). So even if I wanted to, using a custom css/js hack on my browser is not an option. But I cannot find an option to set this in my profile. Can we please have this?! Edit: I'm talking about the date format of older posts, where the "a few minutes ago" thing doesn't apply anymore. I'm turning this support question into a feature-request, as per comments.
|
My system uses the date format dd-MMM-yyyy. Most of the dates on SE/SO sites are formatted as MMM-dd-'yy. Having only 'yy makes it especially hard to search for years. yyyy would make that a lot easier. It would be really cool if this became user-configurable; I personally like the ISO 8601 format very much. No matter what, the default should change; only about 33% of SE users are from the USA, and only about 20% of SO users are. So it makes sense to go for a form of DMY, as that is what most of the world uses. Edit:
|
Bosons occupy the same quantum states, even if fermions obey Pauli's Exclusion Principle. Heisenberg's Uncertainty Principle rules out determining the quantum states occupied by two close fermions, etc.... I mean to say is it impossible in Quantum Mechanics to trace the history, or follow it, of a boson or fermion? There are inevitable errors. Why are we concerned about the loss of information in a black hole, where degeneracy breaks down? I mean, how are two mysteries different, with respect to conservation of information? We have laws of black hole thermodynamics, which prohibit the loss of energy...
|
I really can't understand what Leonard Susskind means when he says in the video that information is indestructible. Is that information that is lost, through the increase of entropy really recoverable? He himself said that entropy is hidden information. Then, although the information hidden has measurable effects, I think information lost in an irreversible process cannot be retrieved. However, Susskind's claim is quite the opposite. How does one understand the loss of information by an entropy increasing process, and its connection to the statement “information is indestructible”. Black hole physics can be used in answers, but, as he proposes a general law of physics, I would prefer an answer not involving black holes.
|
I need a greedy regex to select everything between curly braces but not the starting and ending curly braces for example: {here {first} and {second} and {third}} output should be {first}, {second} {third}
|
Unfortunately, despite having tried to learn regex at least one time a year for as many years as I can remember, I always forget as I use them so infrequently. This year my new year's resolution is to not try and learn regex again - So this year to save me from tears I'll give it to Stack Overflow. (Last Christmas remix). I want to pass in a string in this format {getThis}, and be returned the string getThis. Could anyone be of assistance in helping to stick to my new year's resolution? Related questions on Stack Overflow:
|
I installed Google Earth last night and cannot this morning find it. Silly question but why is there not an icon for the program as that method seems nice and simple?
|
I am new to Ubuntu. I need Java 8 & NetBeans but cannot install. I tried by downloading something, but it did not get installed. I tried same way for Google Earth, but it is also not installed. First I tried Ubuntu 13.x (32 bit), but had same issue after I installed Ubuntu 14.04 LTS (64-bit). Where can I got to get good advice on installation of software, and for using Ubuntu effectively?
|
If $X = N_x$ and $Y = 4*X + N_y$, where $N_x$, $N_y \sim N(0, 1)$, then we have that $P(Y|X=x) = N(4x, 1)$. If we want to then find $P(X|Y=y)$, I would think that Bayes would work: $P(X|Y=y) = P(Y|X=x)P(x)/P(y) = N(4x, 1)P(x)/P(y)$. For x=2, the solution is N(8/17, 1/17). I don't see how this results. Can someone clarify please? EDIT: Another user cited this as being a duplicate, but I don't see why. EDIT: Originally, I asked "what is $P(x)$, $P(y)$? Are they the pdf of $N(0, 1)$ at their respective values?"
|
How do I complete the square from the point I have left off at, and is this correct so far? I have a normal prior for $\beta$ of the form $p(\beta|\sigma^2)\sim \mathcal{N}(0,\sigma^2V)$, to get: $p(\beta|\sigma^2)=(2\pi\sigma^2V)^\frac{p}{2}\exp[-\frac{1}{2\sigma^2}\beta^T\beta]$ where $\beta^T\beta$ is $\sum\limits_{i=1}^p \beta_i^2$. My likelihood has a normal distribtuion for the data points y of the form $p(y|\beta,\sigma^2)\sim\mathcal{N}(B\beta,\sigma^2I) $ $p(y|\beta,\sigma^2)=(2\pi \sigma^2V)^\frac{n}{2}\exp[-\frac{1}{2\sigma^2}({\bf y}-{\bf B}{\bf \beta})^T({\bf y}-{\bf B}{\bf \beta})]$ (Note that $\beta$ is a matrix/vector too, \bf does not work.) To get my posterior for $\beta$ I combined the above, took the exponential parts only, and then expanded to get: $\exp[-\frac{1}{2\sigma^2}({\bf y}^T{\bf y}-{\bf y}^T{\bf B}\beta-\beta{\bf B}^T{\bf y}-\beta^T{\bf B}^T{\bf B}\beta)]\exp[-\frac{1}{2\sigma^2}({\bf \beta}^T{\bf B})]$. I dropped the $({\bf y}^T{\bf y})$ term, as is not a function of $\beta$. Putting into one expression without the exponential: $-\frac{1}{2\sigma^2}(-{\bf y}^T{\bf B}\beta-\beta{\bf B}^T{\bf y}-\beta^T{\bf B}^T{\bf B}\beta+{\bf \beta}^T{\bf B})$. I know I need to combine the similar terms and get into the form of the multivariate normal distribution, which is what I am aiming for, but I am unsure how to do this? I probably have to add an extra term to the expression to get it into the correct form? Note: This is not homework, it's a project, but my Bayesian working knowledge is not good at all and so I need to understand the working out. I intend to integrate out the $\beta$ and then the $\sigma^2$ after getting into the multivariate form.
|
Question: Let $\mathbb{F}$ a commutative field and $ a,b,c,d,e,f\in\mathbb{F} $ be scalars and suppose that $ A $ and $ B $ are the following matrices: $$ A = \begin{bmatrix} a & b \\ 0 & c \\ \end{bmatrix} $$ and $$ B = \begin{bmatrix} d & e \\ 0 & f \\ \end{bmatrix} $$ Prove that $ AB = BA $ if and only if $ \det\begin{pmatrix} \begin{bmatrix} b & a - c \\ e & d - f \\ \end{bmatrix} \end{pmatrix} = 0 $ My steps: $$ \det\begin{pmatrix} \begin{bmatrix} b & a - c \\ e & d - f \\ \end{bmatrix} \end{pmatrix} = 0 $$ $$ b(d - f) - e(a - c) = 0 $$ $$ bd - bf - ea + ec = 0 $$ $$ bd - bf = ea - ec $$ At this point I considered that one of the following things must be true for the solution to hold: $$ b = e = 0 $$ which would mean that $ A $ and $ B $ are diagonal matrices meaning $ AB = BA $ Another condition for the solution to hold would be $$ b = e, a = d, f = c $$ which would mean that $ A = B $ hence $ AB = BA $ must be true. Would this be the right approach to the problem or is there a point that I am missing?
|
Show that the matrices $$A=\begin{bmatrix} a & b \\ 0 & c \end{bmatrix} \text{and B = $\begin{bmatrix} d & e \\ 0 & f \end{bmatrix}$}$$ commute if and only if $$\begin{vmatrix} b & a-c \\ e & d-f\end{vmatrix}=0.$$ My approach: For $AB=BA$, we must have $AB=\begin{bmatrix} ad & ae+bf \\\ 0 & cf\end{bmatrix}$ and $BA=\begin{bmatrix} ad & bd+ce \\\ 0 & cf\end{bmatrix}$ where $ae+bf=bd+ce$. We need to show that if $ae+bf=bd+ce$ then $\begin{vmatrix} b & a-c \\ e & d-f\end{vmatrix}=0.$ Since $\begin{vmatrix} b & a-c \\ e & d-f\end{vmatrix}=0$, we see that: $$b(d-f)-e(a-c)=0 \iff bd-bf-ae+ce=0 \iff bd+ce=ae+bf.$$ Thus, if $AB=BA$ then $\begin{vmatrix} b & a-c \\ e & d-f\end{vmatrix}=0.$ (Showing the converse) If $\begin{vmatrix} b & a-c \\ e & d-f\end{vmatrix}=0$ then we have $bd+ce=ae+bf$ and $AB=BA$ if and only if $ae+bf=bd+ce$, which we have. Is this a proper approach am I missing something here?
|
I just finished up the Silmarillion and an idea that confused me was that the heirs of Earendil could choose their race, as when Arwen chooses to be mortal for Aragorn, but the Numenorean king, descended from Elros, attempts to sail to Aman to gain immortality, but doesn't that imply that the heirs of Elros didn't have the same choice?
|
Earendil and Elwing were given the choice of kindreds after their journey to Valinor, This choice was extended to their sons (specifically sons, not daughters or grandchildren) Elrond chose the race of the Eldar and his brother Elros chose to be counted amongst the Edain. Thus far Manwë's proclamation has been fulfilled. There are some inconsistencies here: Arwen was given the choice, but Elladan and Elrohir remained as Eldar in Imladris Tar-Vardamir was not given the choice The offspring of Imrazor and Mithrelas in Dol Amroth dont seem to have been given a choice I can think of only one explanation, that the Mannish blood is dominant over the blood of the Eldar, thus, As Vardamir was the offspring of two mortals he did not fall under Manwë's proclamation despite being the son of a half elven. However this does not seem to explain the other inconsistencies, Is it possible that Elladan and Elrohir and also the princes of Dol Amroth weren't considered important enough by Manwë or Eru to give them the choice. Also as a side note Tolkien states there were only three unions between man and elf, but this seems to ignore Turin/Finduilas and Imrazor/Mithrelas My question is, Why was Arwen given the choice and not the sons of Elros?
|
On Windows Server 2019 it just prompted me to change my password because it is due to expire. This is a local user (not an AD user) and I don't want the password to expire for this user (it has a strong, randomized password). I looked around in the UI but I couldn't find a way to do this. How is this done in Server 2019?
|
Is it possible to set password expiration date for one local account in Windows? It's possible to set account policy with net accounts /maxpwage command, but I'm interested in changing the date for one specific account, without making changes to the policy or other accounts. The net user <logonname> command can show the expiration date for the account given in Password Expires: field, but it seems like you cannot change it with any net user switch.
|
On any SE site, in the First Posts review queue we review new user's posts. As with any queue, we can get the Custodian, Reviewer, and Steward badges for reviewing a certain number of items in this queue. However, most of the time, especially when using smaller SE sites, I comment, vote on, flag, or vote to close a new user's post before going through the First Posts review queue. I am then unable to review this post in the First Posts review queue because I've already interacted with it. Given we're fulfilling the purpose of the review queue by interacting with the new user's post on the Q&A, I think interacting with new user's posts on the Q&A should count towards the reviewing badges. This would help improve the quality of the site in general because users will be further encouraged to upvote, comment, and help new users while on the Q&A portion more than they currently do.
|
The recent changes to /review has gotten everyone interested in cleaning up the muck. At present, only posts "reviewed" (by clicking on the review link) and actions taken (up/down/close/edit/flag) from within /review count towards the badge. However, it is entirely possible that one catches a poor question outside of /review (e.g., on the front page/tag page, etc.) and "reviews" it and takes some action on it. However, these actions do not count for the badge, at present. In all likelihood, this question would've also been in the /review queue and if one were fortuitous enough to have reviewed it there, these actions would've counted towards the badge. Would it be possible to include reviews made outside of /review to count if the question was also in the review queue? Note that this shouldn't apply if the question dropped out of the queue (either by inaction or after it was edited and improved by previous reviews).
|
I am using cuda c in visual studio. for checking the memory I use cuda-memccheck . while going through some sites I found that cudagrind of valgrind provides much more details of the error of memory.and further this is my misunderstanding or what I found it can be only used in linux system. Am I right?? or can cudagrind be applied in windows to check the memory error???
|
I was looking into Valgrind to help improve my C coding/debugging when I discovered it is only for Linux - I have no other need or interest in moving my OS to Linux so I was wondering if there is a equally good program for Windows.
|
I am trying to create a red box inside a pink box, but i can't get even this simple thing to work. I would like the red box to be in the center of the pink box. It would be even better if the red box was also center of the browser window. I try copying code from other answers but it does not work for me. .main { height: 300; width: 300; background-color: pink; display: flex; flex-flow: row wrap; justify-content: center; } .aaa { height: 200; width: 200; background-color: red; } <html> <head> <title>test</title> </head> <body bgcolor="#000000"> <div className="main"> <div className="aaa"> A </div> </div> </body> </html>
|
I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. <body> <div>Div to be aligned vertically</div> </body> How can I center a div vertically in all major browsers, including Internet Explorer 6?
|
How can I add explanation like that in figure in LateX under my equation?
|
Equation's symbols or parameters description are shown below, however, the = and the details of parameter are not aligned. I want to make a parameters list for a equation like this, in which symbols, = and detail information are aligned in terms of vertical position. where ... P = notional permeability factor N = number of waves Sd = damage level ... A tabular environment will produce more spacing before and after text. So how to make the = vertical aligned? The codes is provided: \begin{equation} \frac{H_s}{\Delta D_{n50} } = 1.0~ P^{0.13}~ \left(\frac{S_d}{N} \right)^{0.2} \xi_m^P~ \sqrt{\cot \alpha} \end{equation} where: $H_s$ = significant wave height, equal to the average of the highest 1/3 of the waves $\Delta$ = relative buoyant density, equal to $\rho_r / \rho_w - 1$, where $\rho_w$ is the water density $D_{n50}$ = nominal diameter defined in Equation (2) $P$ = notional permeability factor $S_d$ = damage level $N$ = number of waves $\xi_m$ = breaker parameter based on mean wave period $T_m$ $\alpha$ = slope angle
|
Why does this return true? This seems a little odd since I have two Strings which are separate objects but are said to be aliases of each other. public boolean stringEquals() { String tmp1 = "hello"; String tmp2 = "hello"; return tmp1==tmp2; }
|
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it and should it not be used? What's the difference?
|
I'd like to remove the brackets around my querysets using list comprehension. This is what I have : foo = [[<queryset: two>], [<queryset: four>], [<queryset: one>]] And this is what I want : bar = [<queryset: two>, <queryset: four>, <queryset: one>] I tried to use list comprehension like so but it didn't change anything : bar = [x for x in foo] What am I doing wrong ?
|
Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability? I tried to flatten such a list with a nested list comprehension, like this: [image for image in menuitem for menuitem in list_of_menuitems] But I get in trouble of the NameError variety there, because the name 'menuitem' is not defined. After googling and looking around on Stack Overflow, I got the desired results with a reduce statement: reduce(list.__add__, map(lambda x: list(x), list_of_menuitems)) But this method is fairly unreadable because I need that list(x) call there because x is a Django QuerySet object. Conclusion: Thanks to everyone who contributed to this question. Here is a summary of what I learned. I'm also making this a community wiki in case others want to add to or correct these observations. My original reduce statement is redundant and is better written this way: >>> reduce(list.__add__, (list(mi) for mi in list_of_menuitems)) This is the correct syntax for a nested list comprehension (Brilliant summary !): >>> [image for mi in list_of_menuitems for image in mi] But neither of these methods are as efficient as using itertools.chain: >>> from itertools import chain >>> list(chain(*list_of_menuitems)) And as @cdleary notes, it's probably better style to avoid * operator magic by using chain.from_iterable like so: >>> chain = itertools.chain.from_iterable([[1,2],[3],[5,89],[],[6]]) >>> print(list(chain)) >>> [1, 2, 3, 5, 89, 6]
|
Can I implement ridge regression in terms of OLS regression? Is it even possible? I am interested because scikit-learn supports non-negative least squares (NNLS), but not non-negative ridge regression. So, I'd like to transform my data as to be able to call the underlying NNLS function, but achieve ridge regression functionality.
|
How to perform non-negative ridge regression? Non-negative lasso is available in scikit-learn, but for ridge, I cannot enforce non-negativity of betas, and indeed, I am getting negative coefficients. Does anyone know why this is? Also, can I implement ridge in terms of regular least squares? Moved this to another question:
|
Since witches and wizards can get new wands if their old wands break, does that mean that their personalities change? So that means that 2 different wands suited a certain wizard at different points in time (one wand chooses the wizard when they're 11, assuming it's from Ollivander's, and the other wand after the first wand is broken, lost, or irreparable).
|
A spin off of wherein it's asked whether there are any canon examples of a witch or wizard owning more than one wand for practical reasons. As DVK's question doesn't specify regarding The wand chooses the wizard, I'm going to ask about that particular aspect. Can a witch or wizard be chosen by more than one wand? We've seen numerous examples in Harry Potter of individuals using wands that belong(ed) to someone else, or had a new wand made for them with Ollivander1 being under duress (Wormtail), but are there any examples in canon where a person is chosen by more than one wand? Is a child's first purchase from Ollivander's the one and only time they can be "chosen" by a wand? Or, should they break their wand, want a second wand, or lose their wand, and need a replacement, would they be able to be chosen a second time by a totally new wand? For reference if interested: ; ; ; ; [Pottermore/Flickr] ETA: and 1: I know there are other wandmakers in HP, but I am using Ollivander as my example because he is the best known in the series.
|
I have a script named temp.sh. I am running it from another script like... sh temp.sh | tr '|' '\n' > sel-employee count=`wc -l sel-employee` if [ '$count' == 0 ] ; then echo "ERROR" else echo "SUCCESS" fi when I run this script if file sel-employee has zero line OR more then zero line in both cases it is output SUCCESS. I can not understand why?
|
Sometimes I see shell scripts use all of these different ways of quoting some text: "...", '...', $'...', and $"...". Why are there so many different kinds of quote being used? Do they behave differently or affect what I can do inside them?
|
Problem : Compute the following limit: $ \lim_{n\rightarrow \infty } {\frac{1^{1}+2^{2}+3^{3}+...+n^{n}}{n^{n}}}$ I have known the solutions by using Stolz's Law. Then I try to compute it by following Squeeze Theorem, but it seems hard for me to find upper bound. Please help me! Thank you very much!
|
$$\lim_{n \to \infty}{\frac{1^1+2^2+3^3+\cdots+n^n}{n^n}}.$$ With a first look this must give $1$ as a result but have a problem to explain it. How can I do it? Edit I noticed that it is $\frac{\infty}{\infty}$. $$\lim_{n \to \infty}{n^{n}\frac{(\frac{1^1}{n^{n}}+\frac{2^2}{n^{n}}+\frac{3^3}{n^{n}}+\cdots+1)}{n^n}}= \lim_{n \to \infty}{\frac{1^1}{n^{n}}+\frac{2^2}{n^{n}}+\frac{3^3}{n^{n}}+\cdots+1}=1$$ Is this correct?
|
I have downloaded PyCharm and unzipped using unzip command. By using help from the internet I did everything to install it, but the ./configure command shows me an error: bash: ./configure: No such file or directory
|
I want to install the PyCharm IDE by JetBrains for Python (free community edition). I managed to , but I do not know how to install it. Can you please help me?
|
Let's say someone is applying for a PhD or postdoc position (or a number of such positions), and needs to decide who should write a recommendation letter. Assume that two letters are needed, but the person has four professors to choose from. All four professors say that they are comfortable with writing a strong letter. The applicant feels that all else equal, potential hirers give more weight to letters from people they know. Is it ok for the applicant to ask their professors whether they know a potential hirer, so that recommendation letters can be channelled accordingly?
|
Usually in United States, three letters of recommendation are required by graduate schools but some applicants might ask more than more than three professors (say five) for letters. In this situation, there might be an issue of choosing whose-letter-to-which-school. I wonder whether it is appropriate to ask each referee at which schools or departments they are relatively more well-known (having connections or interactions with professors in there) so that their letters are more powerful in there. If it is not appropriate to do so, are there any efficient ways for students to determine to which schools should they send a certain professor's letter? I am a little awkward with my grammar in this question (including the title). Please feel free to edit my question if you are a native speaker of English. Thank you very much!
|
When I iterate numbers with TikZ \foreach, they are stored in a macro. Now, when I need the letter corresponding to this macro, I can only convert it by saving it to a counter and then receiving it again. \foreach \n in {1,...,10} { \setcounter{number}{\n} \edef\letter{\alph{number}} } Directly issuing \alph{\n} does not work. I think it would be more efficient to avoid the counter. Is it possible convert directly?
|
Here's basically what I try to do: \begin{tikzpicture} \foreach \x in {1,2,3,4,5} { \draw (\x,1) node{\Alph{\x}}; } \end{tikzpicture} However if I do that, I get ERROR: Missing number, treated as zero. I tried to prefix the number with \the: \begin{tikzpicture} \foreach \x in {1,2,3,4,5} { \draw (\x,1) node{\Alph{\the\x}}; } \end{tikzpicture} and got: ERROR: You can't use `the character 1' after \the. After searching around on TeX.SE, I thought the following solution should work: \begin{tikzpicture} \foreach \c [count=\x] in {{A},{B},{C},{D},{E}} { \draw (\x,1) node{\c}; } \end{tikzpicture} However that got me an error that \x is not defined. So, how do I get the desired result?
|
In my application i add contacts to contacts list by ContentProviderOperation. In Galaxy 3 and 4 it's worked perfect. In Galaxy 2 i crash when i try to edit contact from the contacts list itself. I google and read that this issue happen to some android developers in this case, but i don't find solution to this exception. This my exception: 12-19 10:26:51.685: E/AndroidRuntime(6439): java.lang.NullPointerException 12-19 10:26:51.685: E/AndroidRuntime(6439): at com.android.contacts.editor.ContactEditorFragment.bindEditors(ContactEditorFragment.java) 12-19 10:26:51.685: E/AndroidRuntime(6439): at com.android.contacts.editor.ContactEditorFragment.bindEditorsForExistingContact(ContactEditorFragment.java) 12-19 10:26:51.685: E/AndroidRuntime(6439): at com.android.contacts.editor.ContactEditorFragment.setData(ContactEditorFragment.java) 12-19 10:26:51.685: E/AndroidRuntime(6439): at com.android.contacts.editor.ContactEditorFragment$6.onLoadFinished(ContactEditorFragment.java) 12-19 10:26:51.685: E/AndroidRuntime(6439): at com.android.contacts.editor.ContactEditorFragment$6.onLoadFinished(ContactEditorFragment.java) 12-19 10:26:51.685: E/AndroidRuntime(6439): at android.app.LoaderManagerImpl$LoaderInfo.callOnLoadFinished(LoaderManager.java:438) 12-19 10:26:51.685: E/AndroidRuntime(6439): at android.app.LoaderManagerImpl$LoaderInfo.onLoadComplete(LoaderManager.java:406) 12-19 10:26:51.685: E/AndroidRuntime(6439): at android.content.Loader.deliverResult(Loader.java:125) 12-19 10:26:51.685: E/AndroidRuntime(6439): at com.android.contacts.ContactLoader$LoadContactTask.onPostExecute(ContactLoader.java) 12-19 10:26:51.685: E/AndroidRuntime(6439): at com.android.contacts.ContactLoader$LoadContactTask.onPostExecute(ContactLoader.java) 12-19 10:26:51.685: E/AndroidRuntime(6439): at android.os.AsyncTask.finish(AsyncTask.java:602) 12-19 10:26:51.685: E/AndroidRuntime(6439): at android.os.AsyncTask.access$600(AsyncTask.java:156) 12-19 10:26:51.685: E/AndroidRuntime(6439): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615) 12-19 10:26:51.685: E/AndroidRuntime(6439): at android.os.Handler.dispatchMessage(Handler.java:99) 12-19 10:26:51.685: E/AndroidRuntime(6439): at android.os.Looper.loop(Looper.java:137) 12-19 10:26:51.685: E/AndroidRuntime(6439): at android.app.ActivityThread.main(ActivityThread.java:4507) 12-19 10:26:51.685: E/AndroidRuntime(6439): at java.lang.reflect.Method.invokeNative(Native Method) 12-19 10:26:51.685: E/AndroidRuntime(6439): at java.lang.reflect.Method.invoke(Method.java:511) 12-19 10:26:51.685: E/AndroidRuntime(6439): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) 12-19 10:26:51.685: E/AndroidRuntime(6439): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) 12-19 10:26:51.685: E/AndroidRuntime(6439): at dalvik.system.NativeStart.main(Native Method)
|
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
|
If a magnet exerts force on a iron block (opposite and EQUAL), does a iron block also exerts force on magnet (via Newton's third law)? If yes then what magnetic property does it has to produce equal and opposite force on magnet considering that its not a ideal environment? If no then is it not the violation of newton's third law?
|
Consider a system of the two identical positive point charges situated in free space (isolated from the influence of any other external fields) as shown in the attached diagram. Particle $1$ is at $(a,a,0)$ and particle $2$ is at $(0,a,0)$. Their velocities, at the considered instant of time, are as shown in the diagram ($\mathbf{v}_1$ along the $+x$ axis, $\mathbf{v}_2$ along the $+z$ axis). Now, by applying the Biot-Savart law, we find that the magnetic field due to particle $2$ at the position of particle $1$ is along $+y$ axis, which means that the force acting on particle $1$ is along $+z$ axis according to Fleming’s left-hand rule. A similar analysis shows that there is no magnetic force on particle $2$ as the magnetic field of particle $1$ should vanish at positions (relative to particle $1$) located along its velocity vector. Now, if we observe the net torque on the system of two particles about the $y$ axis then it is non-zero and is directed along the $-y$ axis. Here, there are no external forces or torques acting on the isolated two-particle system, and yet the net torque, as well as the net force on the particles, are nonzero. Why? Also, Newton's third law of motion seems to be broken in this scenario. Why? Edit $1$ I have come to know from the responses that the electromagnetic field itself takes away some momentum and angular momentum about the considered axis. However, I think that if I consider only two charged particles as my system then the Abraham-Lorentz force can be assumed to be acting upon the system, and that is sufficient to make sure that we have considered the momentum being carried away by the electromagnetic field itself. Even after considering the action of the Abraham-Lorentz force for the two-particle system, the scenario breaks both Newton's third law and the conservation of linear and angular momentum. This is because the Abraham Lorentz forces do not exactly counterbalance the force and the torques, on the two-particle system under consideration, due to the magnetic field. Edit $2$ The previous edit was a result of confusion and misunderstanding on my part. The force associated with the momentum carried away by the electromagnetic field as a result of the electromagnetic interaction described in the question is the Lorentz force itself which simply doesn't obey the third law of motion. The Abraham-Lorentz force is a different story. It is associated with the momentum carried away by the radiation emitted by the accelerated charged particles. This is an additional force apart from the Lorentz force and corresponds to an additional carriage of momentum by the electromagnetic field. The momentum carried away by the electromagnetic field in correspondence with the Lorentz force doesn't correspond to radiation.
|
The expressions are part of the proofs of the expressions $M\setminus (N \cup P) = (M \setminus N) \cap ( (M\setminus P) \text{ and } M\setminus (N ∩ P) = (M \setminus N) \cup ( (M\setminus P)$. So when I was trying to prove the first one I thought $\{x \mid x \in M \text{ and } x \notin N \cup P\}$ would be expressed as $\{x \mid x ∈ M \text{ and } x \notin N \text{ or } x ∈ M \text{ and } x \notin P\}$ as the "and" from the intersection would distribute over the "or" from the union. Yet to prove the equality, it should be $\{x \mid x \in M \text{ and } x \notin N \text{ and } x \in M \text{ and } x \notin P\}$ so that the equality holds until last step. For the second example just change the middle "and" with "or". Again I thought it should have been "and" as "and"s have associativity. I can simply memorize it and use it this way whenever a similar proof comes. Yet, I would be more than happy if someone tells me the reason behind this expressions, so that I see what's going on. Edit: My question has been identified as a possible duplicate of Proving DeMorgan's Theorem. First of all, my problem is not about proving the entire theorem. I actually have the proof in front of me. It is about a proof step I couldn't internalize. In the linked question there is limited mention of that specific step except for the fact that it is taken for granted as in the proof in front of me now (so again after reading the question and answers, I am at where I was before). I want an explanation of that step specifically and my question is about that step not a whole proof. Moreover, although I have to admit that my question depicts a step on proving DeMorgan's theorem, in this case M is not fixed as a universe and difference relation is not absolute but relative. As such the equalities can be thought of displaying properties of set difference as well. After I understand these relative difference properties (including a third one) and the specific steps I mentioned in my question, I want to continue with DeMorgan. As such I would appreciate help on a topic that is a step in moving to a more advanced topic and a question on a minor detail rather than the proof of a whole theorem.
|
I'm trying to prove that (without using logical equivalencies): $\overline{A\cap B} = \bar A \cup \bar B$ by proving both sides: (1) $ x \in \overline{A\cap B} \to x \in \bar A\cup\bar B$ (2) $ x \in \bar A\cup\bar B \to x \in \overline{A\cap B}$ I figured out the 2nd part, but I'm struggling with the first. The only thing I'm confident about now is: Let $x \in \overline{A\cap B}$. We prove that $x \in \bar A\cup \bar B$. By definition of complement, $x \not\in A\cap B$. I'm not sure if I should use cases, or if I should prove by contradictions. With the other variation of DeMorgan's, I could assume $x \in A$ and $x \in B$ and they would lead to contradictions with the first assumption, but I can't do that here because it's a $\cap$ instead of a $\cup$. For reference, here's the proof I was given for the other variation of DeMorgan's: Prove: $\overline{A \cup B} = \bar A \cap \bar B$ (1) if $x \in \overline{A \cup B}$ then $x \in \bar A \cap \bar B$ (2) if $x \in \bar A \cap \bar B$ then $x \in \overline{A \cup B}$ Proof: (1)Let $x \in \overline{A \cup B}$. We prove that $x \in \bar A \cap \bar B$. By definition of complement, $x \not\in A \cup B$. Suppose, for contradiction, $x \not\in \bar A$. By definition of complement, $x \in A$, and by definition of union, $x \in A\cup B$, a contradiction. Thus, $x \in \bar A$. Now, suppose for contradiction, $x \not\in \bar B$. By definition of complement, $x \in B$, and by definition of union, $x \in A \cup B$, a contradiction. So, $x \in \bar B$. Therefore, $x \in \bar A$ and $x \in \bar B$, so by definition of intersection, $x \in \bar A \cap \bar B$. (I'm leaving out the 2nd part, as I've figured out the 2nd part in my problem above) Any ideas? I'm assuming it has to be of similar complexity.
|
I have a project developed in PHP 5.4.35 using CakePHP, When I insert some unicode string into database, Example : Bệnh suy giảm trí nhớ After insert into database, this is the database content of record : Bệnh suy giảm trà nhá»› If I use php 5.4 it display perfectly on website : Bệnh suy giảm trí nhớ I also develop an api in json format for this project and the api response when I get this data is: B\u1ec7nh suy gi\u1ea3m tr\u00ed nh\u1edb When client (mobile client) get this data and display, it is displayed perfectly same as website. But when I move to a hosting with php 5.3.23, it is displayed on website just like on database: Bệnh suy giảm trà nhá»› And the api response : B\u00e1\u00bb\u2021nh suy gi\u00e1\u00ba\u00a3m tr\u00c3\u00ad nh\u00e1\u00bb\u203a It is dislayed : Bệnh suy giảm trà nhá»› on mobile device (which displayed perfectly if I use php5.4 for api) ; then I tried to use utf8_decode function of php after get it from database and this is result: utf8_decode($record); B��?nh suy giảm trí nh��? I thought that maybe this string was encoded before inserted to mysql in php5.4 and then decoded right after get it from the database, but in php5.3 it keep the string when insert and get from database. and the encoder, decoder of utf8 in php 5.3 and 5.4 is different??? I guest. I'm using cakephp 2.5.3 and it use PDO to insert and get data from database I've tried all the way to change charset, collate .... but it take no effect like : PDO -> exec ('SET names utf8'), PDO -> exec (' Set names utf8 collate utf8_unicode_ci'); .... I've also set the charset of header, html meta tags.... my database use utf8_unicode_ci collation in both environment no different in database version It's just I found no way to resolve the problem, so if anyone know about this please give me some solutions Thanks
|
I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur? This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.
|
So, often, when it's asked why Lily seems to be the only known case of Love/sacrifice protection, the answer is that in addition of giving their lives willingly, the one sacrificing themselves must be given a chance to escape. But if this is the case, why in Deathly Hallows Harry was given none at the Forest, and still the protection seems to work on all people on his side?
|
We know that Harry survived Voldemort's killing curse because Lily loved him so much that she sacrificed herself in an attempt to protect him. This resulted in a very powerful charm that pretty much rendered Harry immune to Voldemort (until Voldemort figured out the work-around). Then there's this passage describing that night: [Voldemort] was over the threshold as James came sprinting down the hall. It was easy, too easy, he had not even picked up his wand ... "Lily, take Harry and go! It's him! Go! Run! I'll hold him off -" Hold him off, without a wand in his hand! ... He laughed before casting the curse ... "Avada Kedavra!" Harry Potter and the Deathly Hallows Chapter 17: Bathilda's Secret So James Potter, fully aware that he was sacrificing himself (he said "I'll hold him off," not "I'll get rid of him") ran to face Voldemort because of his love for Lily and Harry. This seems to be very similar to how Lily tried to protect Harry from Voldemort even though she knew she would die. It seems to me that the same charm should have been cast upon Lily when James died, but just moments later Voldemort killed her too. Apparently James' sacrifice did not result in a charm that protected Lily, even though he did it from love for her and Harry. Why is this? Was something different in the circumstances?
|
Below is text from the book Joseph H. Silverman: A Friendly Introduction to Number Theory, 4th Edition, chapter 8, page 56. To solve $4x\equiv 3 \pmod{19}$ we will multiply both sides by $5$. This gives $20x\equiv 15 \pmod{19}$ But $20\equiv 1\pmod{19}$, so $20x\equiv x\pmod{19}$ Thus the solution is $x\equiv 15\pmod{19}$ I was wondering if I can document the steps on how this is done to solve a generic congruence - I know this can be done only for solving congruences with small numbers To solve $Ax\equiv B \pmod{m}$ Find P & Q such that they satisfy the following conditions Q = A * n P = B * n $Q \equiv 1 \pmod{m}$ Once you do this - you can easily solve the congruence. I have 2 questions Is this correct - i.e. my description of the steps of how the example in the book was solved? This seems to work when gcd(A, m) = 1. Will this work if the gcd is not 1.
|
When I am faced with a simple linear congruence such as $$9x \equiv 7 \pmod{13}$$ and I am working without any calculating aid handy, I tend to do something like the following: "Notice" that adding $13$ on the right and subtracting $13x$ on the left gives: $$-4x \equiv 20 \pmod{13}$$ so that $$x \equiv -5 \equiv 8 \pmod{13}.$$ Clearly this process works and is easy to justify (apart from not having an algorithm for "noticing"), but my question is this: I have a vague recollection of reading somewhere this sort of process was the preferred method of C. F. Gauss, but I cannot find any evidence for this now, so does anyone know anything about this, or could provide a reference? (Or have I just imagined it all?) I would also be interested to hear if anyone else does anything similar.
|
Suppose $x_1 ≥ x_2 ≥ · · · ≥ 0$. Then $\sum_{n=1}^{\infty} x_{n}$ converges if and only if $\sum_{n=1}^{\infty} 2^{n}x_{2^n}$ converges. I mean it is evident that $x_{2^n}$ is meant to be a sub sequence of $x_n$ but I'm quite unsure how to proceed.
|
The following is Cauchy condensation test: If $b_n \ge 0$ and $b_n \ge b_{n+1}$ then $\sum b_n$ converges if and only if $\sum 2^n b_{2^n}$ converges. Is the following modified Cauchy condensation test possible: Let $N \in \mathbb N$. Then if $b_n \ge 0$ and $b_n \ge b_{n+1}$ then $\sum b_n$ converges if and only if $\sum N^n b_{N^n}$ converges?
|
We have $f:\mathbb{R}\rightarrow\mathbb{R}$ which is continunous and its derivative is also continuous. We define set $D=\{x:f'(x)=0\}$. Prove that set $f(D)$ is of 0 (Lebesgue) measure. If we assume that $f$ is monotonic then every maximal interval on which $f$ is constant is landing on single point. Between such interval there is always a gap, so there are no intervals in $f(D)$. However, I believe that $f(D)$ can have "more" that countably infinite elements. If that's true, then I do not know how to proceed.
|
Let $f:\mathbb{R}\to \mathbb{R}$ be $C^1$ function and $K = \{x : f'(x) = 0 \} $. Show that $\mu \left(f\left(K\right)\right) = 0$, where $\mu$ is Lebesgue measure. My attempt was following: $$\mu \left(f\left(K\right)\right)= \int_{f(k)} 1 dy \stackrel{(*)}{=} \int_{K}f'(x) dx = \mu\left(K\right) \cdot 0 = 0$$ but we cannot substitute $y = f(x)$ at $(*)$ like that. I was told that there exists quite elementary proof (not using Sard's theorem) so I'm looking for it.
|
I am not talking about the login screen. has helped me fix that. I am talking about the initial start up screen with incrementing anticipation dots during the boot. It says Lubuntu instead of Ubuntu. I'd like it to say Ubuntu if possible. Where is this config file stored? This is the screen I want to modify:
|
With regards to Plymouth -- Are there alternative boot screens available? What's the easiest way to change the boot screen?
|
I was looking for newest unanswered questions, so I clicked the 'Unanswered' button and then, the 'newest' tag just below. Why did I get answered questions in the displayed list ? Isn't it supposed to filter the questions by unanswered and sort the list from newest to oldest unanswered questions ? EDIT : I don't want it filtered by a specific tag like C++ for example nor sort by upvotes like the 'no answer' tag. Just unanswered and sort by newest.
|
Why does the "Unanswered Questions" tab show questions that have answers?
|
Say I am hashing hashes (taking the hash of a previous hash) for an endless amount of time. How many times would it take, on average, to fall into a loop when using SHA-2 (more specifically SHA-256 and SHA-512), like such: original text = z (can be any string) hash z = b hash b = c hash c = d ... hash n = b (restarting loop) or more literally, original text = "test" SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" SHA-256 of "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" = "7b3d979ca8330a94fa7e9e1b466d8b99e0bcdea1ec90596c0dcc8d7ef6b4300c" ... SHA-256 of n = SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" How many attempts, on average, would this take?
|
Let's say I start with a particular 256 bit value. Call this $v$. I then hash that value, and get another 256 bit value. Call this $\text{SHA256}(v)$. I take this value and get another 256 bit value. Call this $\text{SHA256}^2(v)$. More generally, let's call the result of hashing $v$ repeatedly $n$ times $\text{SHA256}^n(v)$. Now my question is, how big will $n$ be, such that $\text{SHA256}^n(v) = v$? It would seem to me, that if it's a giant sort of permutation, $n$ would have to be $2^{256}$, is that correct? Is that provable, or is there any information on this? (Just curiosity, really.) Another question I had was, do all 256 bit strings have unique SHA256 values, and is there a way to show that? (Or, stated differently, can it be shown that there are no SHA-256 collisions in the language of all "256 bit strings"?)
|
Running the ls / command some files are coming out; What are those files? They are not even directories. Output of ls /: bin dev boot etc cdrom media mnt home lib lib64 proc root
|
In Windows there’re perhaps only a couple of important folders (by important I mean important in my logical picture of the Windows file system) in the installation drive (in my case C:\). Namely Program Files and Windows. I simply stay away from Windows folder and the “add remove program files” is good enough to handle the program files folder of Windows. Of course there’s a folder named Users where the users (who are not admins) can access only their folders. Thus there’s a clear picture at some level in my mind of the Windows file system. In Ubuntu, when I reach the location /, there’s a huge list of folders, most of which I have no clue as to what they contain. The /bin folder seems to be the equivalent of the Windows folder in windows. The /usr folder seems like it’s the equivalent of the Users folder in Windows. But even the /home folder looks like it can fit the bill. Please understand that I do understand, that Ubuntu (Linux) has a different character than that of Windows, i.e., there need not be exact equivalent of Windows functions, in Ubuntu. All I am looking for is a bit more clearer picture of the Ubuntu file system. This question is a part of a bigger question which I am splitting up to make it more answerable. The original question can be found here:
|
Good day, I have created a faraday cage with metal sheet of .5 mm thickness with aluminum foil wrapped outside and inside of the cage. I was happy at first to notice that the cellphone signal goes from one bar to nothing at all but the signal goes inside the cage intermittently and most of time stays at full strenght signal. I tried changing places and found dead zones but still frequencies go inside. Wifi signal though still cannot be attenuated. I was planning to create a topological shielding with 10x sheet of 1 mm and layer them together to deplete the frequency but i cant afford to do it if i plan to stay inside longer because of temperature issues. The reason I am doing this is because of electronic harrasment. I researched that devices can be hacked through emf emissions of devices and i need to protect my devices from these attacks. My question is, is there by any chance that the signals inside can be cancelled consistently? Do i need to consider the thickness of metal sheet or do i need to just layer tin foils to be enough to reflect or absorb frequencies. Do i need to make earth stakes to transfer the electrons on the metal to earth to regain it's absorption and reflection? Do i need to create topological shielding to deplete the frequecy from GHz to MHz brcause i researched that cellhpone signals are on a MHz frequency?. I found out as well that apperture/ appertures should be smaller than the wave. I need your help thank you.
|
Someone left their cell phone here, it was ringing like crazy. I stuck it in a metal pot with a metal lid to shut it up, it still rang. I later put it in a safe, it still rang, but so muffled as to not be annoying. (Admittedly the safe has a gasket on the door--it provides fire, flood and walking out with the guests protection, it wouldn't defeat a serious burglar.) How is the signal reaching the phone???
|
I have a function that recursively searches a tree, looking for a certain condition to hold. If it does hold, that node in the tree should be replaced by a new sort of node. In the example code below, I call the class Tree_Node because it acts a lot like a TreeNode but isn't exactly the same thing. Still I hope the basic idea is familiar and clear. public void func(Tree_Node tn) { if (!tn.isLeaf()) { if (tn.condition()) { tn = new Tree_Node(x); } else { func(tn.getChild(name)); } } } Now what I'm finding out is that tn = new Tree_Node(x) doens't change the value of the node in the tree, and I believe this is because the command is only changing the value of the local variable tn whereas I want to change the object stored at the location it's "pointing" to. In the tree, I want to replace this node with a different node. As I brainstorm solutions, I come up with two options that seem theoretically do-able: Somehow have memory of what the parent node was, maybe by passing it as an argument to the function, and then I can change the child of this parent. I could also perhaps define a .parent() method for Tree_Nodes, and then be able to call that method on tn. The second option that comes to mind is to somehow find the address in memory where this node is stored, and update the contents of this address. I would, for various reasons, strongly prefer to do this if it is possible and not too difficult. I've also spent some time googling "java memory address" to see if answers already exist for this, but a) don't see helpful information, and b) see a number of posts suggesting that doing this sort of thing is unsafe. Any solutions or advice would be welcome.
|
I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
|
The following is in C#. I'm trying to do something very simple (I think). I have a method that loads an XML document XDocument doc = XDocument.Load(uri); , but I don't want to tie up pc resources if there are issues (connectivity, document size, etc.). So I'd like to be able to add a timeout variable that will cut the method off after a given number of seconds. I'm a newbie when it comes to asynchronous programming and find it confusing that there are so many examples written so many different ways . . . and none of them appear simple. I'd like a simple solution, if possible. Here's my thoughts so far on possible solution paths: 1) A method that wraps the existing load public XDocument LoadXDocument(string uri, int timeout){ //code } 2) A wrapper, but as an extension method XDocument doc = XDocument.LoadWithTimeout(string uri, int timeout); 3) A generic extension method. Object obj = SomeStaticClass.LoadWithTimeout(??? method, int timeout); 3), on its face seems really nice, because it would mean being able to generically add timeouts to many different method calls and not specifically tied to one type of object, but I suspect that it is either i)impossible or ii) very difficult. Please assist. Thanks.
|
I am looking for good ideas for implementing a generic way to have a single line (or anonymous delegate) of code execute with a timeout. TemperamentalClass tc = new TemperamentalClass(); tc.DoSomething(); // normally runs in 30 sec. Want to error at 1 min I'm looking for a solution that can elegantly be implemented in many places where my code interacts with temperamental code (that I can't change). In addition, I would like to have the offending "timed out" code stopped from executing further if possible.
|
We have the following file: cat info.txt linux03.sys98.com net16777728 Speed: 1000Mb/s linux03.sys98.com net16777728 Speed: 1000Mb/s linux01.sys98.com net3f0 Speed: 1000Mb/s linux01.sys98.com net3f0 Speed: 1000Mb/s linux03.sys98.com net16777728 Duplex: Full linux03.sys98.com net16777728 Duplex: Full linux01.sys98.com net3f0 Duplex: Full linux01.sys98.com net3f0 Duplex: Full linux04.sys98.com net3f2 Link detected: no linux04.sys98.com net3f3 Link detected: no linux04.sys98.com net3f2 Speed: Unknown! linux04.sys98.com net3f3 Speed: Unknown! linux04.sys98.com net3f2 Duplex: Unknown! (255) linux04.sys98.com net3f3 Duplex: Unknown! (255) linux03.sys98.com net16777728 Link detected: yes linux03.sys98.com net16777728 Link detected: yes linux01.sys98.com net3f0 Link detected: yes linux01.sys98.com net3f0 Link detected: yes We want to align the third word with 20 spaces from the beginning of the second word as the following expected results: linux03.sys98.com net16777728 Speed: 1000Mb/s linux03.sys98.com net16777728 Speed: 1000Mb/s linux01.sys98.com net3f0 Speed: 1000Mb/s linux01.sys98.com net3f0 Speed: 1000Mb/s linux03.sys98.com net16777728 Duplex: Full linux03.sys98.com net16777728 Duplex: Full linux01.sys98.com net3f0 Duplex: Full linux01.sys98.com net3f0 Duplex: Full linux04.sys98.com net3f2 Link detected: no linux04.sys98.com net3f3 Link detected: no linux04.sys98.com net3f2 Speed: Unknown! linux04.sys98.com net3f3 Speed: Unknown! linux04.sys98.com net3f2 Duplex: Unknown! (255) linux04.sys98.com net3f3 Duplex: Unknown! (255) linux03.sys98.com net16777728 Link detected: yes linux03.sys98.com net16777728 Link detected: yes linux01.sys98.com net3f0 Link detected: yes linux01.sys98.com net3f0 Link detected: yes How to perform that with printf or any other solution?
|
the following syntax print the output1 down echo "$status" output1: component_name : TEZ_CLIENT recovery_enabled : true component_name : WEBHCAT_SERVER recovery_enabled : true component_name : YARN_CLIENT recovery_enabled : true component_name : ZKFC recovery_enabled : true component_name : ZOOKEEPER_CLIENT recovery_enabled : true component_name : ZOOKEEPER_SERVER recovery_enabled : true how to add the printf syntax in order to get the following lines: expected output component_name : TEZ_CLIENT recovery_enabled : true component_name : WEBHCAT_SERVER recovery_enabled : true component_name : YARN_CLIENT recovery_enabled : true component_name : ZKFC recovery_enabled : true component_name : ZOOKEEPER_CLIENT recovery_enabled : true component_name : ZOOKEEPER_SERVER recovery_enabled : true
|
Is there any possible way to export a map from Arcmap 10.5 without the white background? I need to insert the map in a dashboard with blue background and i only need the outline of the layer not the white background.
|
I cannot get ArcMap 10.0 or 10.1 to "Export Map" to a png or gif with a transparent background -- no matter what I set the background and transparent colors to. Thus, I created the following script, which does the trick, but I'd rather be able to get the default tool in ArcMap to do it. Any better ideas? # Purpose: This script exports an MXD view to a png file with transparent background, # which is problematic to do manually due to a Windows-related bug in the ArcMap UI. # Warning: It will make any white features (e.g. the default background color) transparent. # # INSTRUCTIONS: # When in ArcMap, viewing a saved mxd... # 1. From the Geoprocessing menu, select 'Python'. # 2. In the new Python window, right-click somewhere after >>>, and select 'Load...' # 3. Select this script. # 4. When this script appears, press Enter twice to run it. # 5. A new [mxd-name].png with transparent background will appear in the same directory as the mxd. # 6. When finished/satisfied, close the Python window. # http://forums.arcgis.com/threads/65463-Zoom-to-tile-and-Export-to-JPEG-with-World-File import arcpy png_resolution = 300 # Can adjust DPI # Set mxd and png name mxd = arcpy.mapping.MapDocument("CURRENT") pngname = mxd.filePath.replace(".mxd",".png") df = arcpy.mapping.ListDataFrames(mxd)[0] # Calculate ideal image size from the mxd view and desired DPI png_width = int((df.extent.XMax - df.extent.XMin) * png_res * 12 / df.scale) png_height = int((df.extent.YMax - df.extent.YMin) * png_res * 12 / df.scale) #Export PNG print "Exporting: {0}\n{1} x {2} pixels, {3}-dpi".format(pngname,png_width,png_height,png_res) arcpy.mapping.ExportToPNG(mxd, pngname, df, df_export_width = png_width, df_export_height = png_height, resolution = png_res, transparent_color = "255, 255, 255") #Clean up del df, pngname, png_res, png_width, png_height, mxd
|
I forgot my Ubuntu password. I entered recovery mode and changed the password for my user with passwd as root. I haven't used that machine for a long long time, so I also forgot that my home folder was actually encrypted using ecryptfs. My bad, but I don't have that 32-char long MOUNT passphrase... What are the options in this case? Have I lost all or is there still a chance to recover? is there a point to try with ecryptfs-recover-private and try to recall this forgotten LOGIN password which I changed with passwd? Will it return a success code if I eventually manage to find the password at the back of my head? if the point above doesn't happen, should I try the solution described here? and run the shadow crack? Or is there anything else I can do? I wouldn't like to break it more. Many thanks UPDATE: I think I found the old password. I am able to unwrap the passphrase. What's the way to go now? Go again root and passwd the user to the old password again or do a rewrap? Which is recommended? I just don't want to screw up things again :)
|
I am on Ubuntu 12.10 with one user using encrypted home. A while back I have changed by user password and then forgot it. I then made a backup of my files using to an external drive. I was about to delete my system and do a fresh install when I realized that there is a recovery option in which I can reset my user password. Using I have set a new password for my user. After rebooting I can log-in in Unity using my new password but I am thrown back to the Unity screen immediately. (No message about false password) Using the terminal I can log in using the new user-password. How can I re-enable my machine to decrypt my ecrypfs encrypted home with the unwrapped passphrase I know?
|
What is the fastest way to compute the square-root of a real, positive number x to a desired number of correct digits? For example, in number theory, $\sqrt{x}$ for nonnegative integers $x$ can be approximated to desired accuracy as a convergent of the continued fraction of $\sqrt{x}$ if this is known. In calculus, $\sqrt{t}$ can be found using the bisection method. This method is slow. Now, $\sqrt{t}$ can be computed faster by applying Newtons' method to the polynomial $x^2-t$ for any initial guess $k$ not equal to zero. When I say "fastest" I mean "least amount of computations" :) I also learned about Taylor polynomials; maybe using a Taylor polynomial about some $x$ close to to where $\sqrt{x}$ is known can be a fast method?
|
What is the fastest algorithm for finding the square root of a number? I created one that can find the square root of "$987654321$" to $16$ decimal places in just $20$ iterations I've now tried Newton's method as well as my own method (Newtons code as seen below) What is the fastest known algorithm for taking the second root of a number? My code for Newton's Method (*Edit: there was an error in my code, it is fixed in the comments below): a=2 //2nd root b=97654321 //base n=1 //initial guess c=0 //current iteration (this is a changing variable) r=500000 //total number of iterations to run while (c<r) { m = n-(((n^a)-b)/(a*b)) //Newton's algorithm n=m c++; trace(m + " <--guess ... iteration--> " + c) }
|
I just encountered this command on a linux forum online where the author warned that donot try this command for curiosity. So my curiosity comes. What is the meaning of command “:() { :|:& }; :” in shell?
|
I was reading Ubuntu Forum's warning about malicious commands and found this interesting gem: :(){ :|:& };: WARNING: The above code will crash your machine unless you have strict proc limits in place (which you probably don't) prompting a hard restart. Consider this code similar to running sudo rm -rf /. But what does that mean? Even with my programming experience I've never seen a command that cryptic that's not assembly language.
|
If a website is cached, does it mean that it has been indexed too? In this snapshot cache date is shown as 18th may but when i did site search for this domain I found 0 pages were indexed by google last week.
|
My website's google cache copy looks broken. Below is link to cache. http://webcache.googleusercontent.com/search?q=cache:http://paintcollar.com Can this affect the SERPs and crawling by google? What can I do to rectify it? PS. Few pages are being cached properly though.Below is URL to one such page. http://webcache.googleusercontent.com/search?q=cache:http://paintcollar.com/aneel
|
I have a requirement where in a list view of the Custom object, user can select multiple records and click a custom button.On click of this button, lightning component needs to open and ID of the selected records needs to be obtained in this lightning component. Could anyone please let me know how to achieve this in lightning?
|
I have a requirement where I want to have a custom list view button with an ability to perform a mass custom action in the Lightning environment. I do not see an option to add lightning quick-action on the list view. Is there any way to have a custom list view button on a custom object?
|
I have posted a question that in my opinion fits best into a beta community. Overall, the attention was not satisfactory although I even posted a bounty and the limited response I got was positive. Despite currently being the only bountied question it has been viewed about 30 times in 10 days and about a third of the views seem to be my own. I believe the question itself should be relatively easy to answer for people familiar with the subject, hence I believe the low impact is related to the early beta stage of the community. Is it acceptable to cross-post an unnoticed question from a beta community into a more mature related but thematically less on-point community? For reference, the beta community under consideration is Earth Sciences; I'm considering a cross-post into Physics and the relevant question () is about radar. Edit: Generally, cross-posting is deemed unacceptable (). However, this question seems to be a special case of the above. I can see a point to be made, that cross-posting is never allowed and that the beta status is irrelevant. At the same time I can see an argument for the opposing viewpoint, since many sensible strategies proposed in the case of mature sites (i.e. rephrasing the question, editing the question....) may not be helpful if the general traffic on a beta site is so low that the answer is simply not read by anyone, hence I feel that my question is not a straight forward application of the above one.
|
It is possible to migrate a question from one Stack Exchange site to another by closing, but if I have a question that I think is on-topic for multiple Stack Exchange sites, is it OK to post it on both (multipost)? For example, I have a question that's earned me the tumbleweed badge on SO and I'm not sure what the best thing to do with it is. It's about a web server so it might be answerable on Server Fault but it's really more of a programming thing, hence the posting the question on Stack Overflow. Is there any way to make the question visible on multiple sites (crosspost) and then accept the answer wherever it came from?
|
qiskit.providers.ibmq.exceptions.IBMQBackendApiError: 'Error submitting job:.... (Caused by SSLError(SSLError(1, \'[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056).... I used a basic Qiskit tutorial within a Conda environment, Python3.7, Ubuntu 18. The was no problem getting it to load account with token and display the following: ibmq_qasm_simulator has 0 queued and simulated qubits ibmqx2 has 241 queued and 5 qubits ibmq_16_melbourne has 3681 queued and 15 qubits ibmq_vigo has 393 queued and 5 qubits ibmq_ourense has 507 queued and 5 qubits ibmq_valencia has 0 queued and 5 qubits ibmq_armonk has 3 queued and 1 qubits ibmq_athens has 13 queued and 5 qubits ibmq_santiago has 17 queued and 5 qubits This is the section of code which generated the error: from qiskit.tools.monitor import job_monitor backend = provider.get_backend('ibmq_qasm_simulator') config = backend.configuration() job = q.execute(circuit, backend, shots=10) job_monitor(job) I found one reference to the issue being on their cloud and it suggested using a VPN or different Network. I also setup an IBM cloud account, but there does not appear to be a way to incorporate that into qiskit. The next thing I tried was seeing if the IP address of their cloud link being called would work just in a simple browser window along the lines of a suggestion about safe.io intercepting the SSL on Macs. I also tried a few things related to OpenSSL and reinstalling that bit etc... no luck. The qiskit package was installed using PIP within Conda. QisKit Version: qiskit-terra: 0.16.1 qiskit-aer: 0.7.1 qiskit-ignis: 0.5.1 qiskit-ibmq-provider: 0.11.1 qiskit-aqua: 0.8.1 qiskit: 0.23.1
|
I have been trying to execute the quantum circuit in the backend of the IBM 16 qubit Melbourne machine. I end up getting IBMQBackendApiError: 'Error submitting job: "HTTPSConnectionPool(): Max retries exceeded with url: **** SignedHeaders= ** Signature= ****(Caused by SSLError(SSLError(1, \'[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1108)\'))) but when I check my IBMQ account the status of the job is Creating. I do not understand why I get such an error. Can someone help to identify what exactly the issue is?
|
In my rpg-styled (top-down perspective) 2d game, I want my player to be at the center of the screen, while the entire world moves, giving the effect of player movement. I can make that, but my problem is at the edges of the game-world, I want the world to stop moving and the player to move.
|
I am making a game similar to Legend of Zelda: Link to the Past (top-down 2D action-adventure). I want the character to stay centred on the screen when he moves. Currently, whenever the player wants to move, I move all of the map in the opposite direction. This works, but as I add more objects to the world, moving them all gets more complicated. Is there a better way of approaching this?
|
The Android app is still in its alpha stages, and therefore not everything has been added yet. So, should we suggest things we want added to the Android app on Meta and Google+, or will they just be ?
|
So, I've been giving the mobile application a while for the last week or so, and I'm thrilled to be able to give feedback and report bugs on it. I'm also thrilled that I can use the Stack Exchange network on my mobile, or tablet! After about a week, though, I started to realize a few deficiencies in the application - some of which I've already reported as bugs, some of which are already reported, and some of which I'm not sure I should report, since I don't know what role this application is meant to serve. So, I consider myself a bit of a power user of [Meta]StackOverflow. I ask questions (at least on Meta), write answers, comment, but the bulk of my time spent on SO isn't geared towards that - it is, more times than not, flagging content, reviewing content, editing content, and otherwise consuming content. The mobile application is certainly geared towards producing content and consuming content. It does a fine job of that (although there are some rough cuts). What I find myself doing, more often than not, though, isn't directly related to production or consumption of content - although I would agree that editing posts while on a 4 inch screen isn't ideal. I'll compare my flow with the mobile version of the site. On the mobile site, I can check my profile. I can see my cumulative daily reputation score here. I can see my favorite questions here. I can see my most recent activity. I get credit for visiting the site. In the app, I can check the feed. I see new questions on sites that I'm definitely a member of, or that I've recently visited in the app. I'm not convinced I get credit for visiting the site on the mobile app. Nor am I convinced that I should - although I want to. On the mobile site, I can see what badges I've earned overall. In the app, I can see what badges I've earned that day. On the mobile site, I can order the results of questions with a lot of answers by votes. On the app, that's not possible. What I'm getting at is, despite it being an early alpha, it doesn't feel like it's going to have feature parity with the mobile desktop site. So, is it meant to supersede the mobile desktop site? Is it meant to be a CRUD application for SO? Or does it fit somewhere in between? I can provide better feedback and bug reports to the team if I have a clear understanding of what niche the app is trying to fill.
|
Let $f:\mathbb{R}\to \mathbb{R}$ be a continuous function and $f(x)=f(2x)$ is true $\forall{x\in{\mathbb{R}}}$. If $f(1)=3$, then the value of $$\int_{-1}^{1}f(f(x))dx$$ equals. I don't have any idea how to proceed. Any hints would be helpful. Thank you.
|
If $f(x)$ is a continuous function such that $f(x) = f(2x)$ and $f(1) = 3\;,$ Then $\displaystyle \int_{-1}^{1}f(f(x))\,dx$ $\bf{My\; Try::}$ Here $-\infty <x<\infty$ and Given $f(x) = f(2x)$ So Using Recursively $$\displaystyle f(x) = f(2^1x)=f(2^2x)=..........=\lim_{n\rightarrow \infty}f\left(2^{n-1}x\right)$$ OR we can write it as $$f(x) = f\left(\frac{x}{2}\right)=f\left(\frac{x}{2^2}\right)=........=\lim_{n\rightarrow \infty}f\left(\frac{x}{2^{n-1}}\right)$$ Now How can i prove that $f(x)$ is a constant function. Help me Thanks
|
I'm undergraduate student of mathematics. I need to prove: $$\sum_{k=0}^{n} \binom{2n}{2k}= 2^{2n-1}$$ Can you please help me
|
I'm repeating material for test and I came across the example that I can not do. How to calculate this sum: $\displaystyle\sum_{k=0}^{n}{2n\choose 2k}$?
|
I'm wondering if there exists a Lebesgue compact set (with respect to the usual topology on $[0,1]$) in $[0,1]\setminus \mathbb{Q}$ whose Lebesgue measure is positive. In fact we've just seen the Egoroff theorem in class, and I thought of the functions $$ f_n(x)= \left\{ \begin{array}{ll} \frac{1}{n} & \mbox{if } x\in[0,1]\setminus \mathbb Q\\ 1 & \mbox{otherwise.} \end{array} \right. $$ Obviously $f_n\to f\; \mu$-a.e., but since $\mathbb Q$ is dense, I'm wondering how we can find a compact set $F\subset [0,1]$ for a given $\delta>0$ such that $\mu([0,1]\setminus F)<\delta$ and $\sup_{x\in F} |f_n(x)-f(x)|\to 0 $ as $n\to 0$. Could you please explain why Egoroff holds in this case?
|
Does there exist $K \subseteq \mathbb{R} \backslash \mathbb{Q}$ such that $K$ is compact, and has Lebesgue measure greater than $0$? As I have been trying to think of examples, I suspect that any subset of $\mathbb{R} \backslash \mathbb{Q}$ that is closed can be at most countable, since the closure of an uncountable subset of irrationals should contain some rationals. And, the Lebesgue measure of a countable set is $0$. If there are any examples of such a set, I would be very interested to know how it is constructed.
|
All known proofs that the circle cannot be squared are based on Lindemann's theorem that $\pi$ is not analgebraic number. But this seems to be a case of using an atomic bomb to kill a fly. What really has to be proved is that $\pi$ is not the root of an algebraic equation with rational coefficients whose degree is a power of $2$. Lindemann proves it for all degrees, which is much much more than what is needed for the classical construction problem. It is not too hard to prove that $\pi$ is not the root of a quadratic equation, and perhaps some clever induction argument could carry the day. The point is that a direct proof for degree $2^n$ has not only never been published, it does not even seem to have been noticed that this much less powerful result is all that is needed.
|
Is there a direct proof that $\pi$ is not constructible, that is, that squaring the circle cannot be done by rule and compass? Of course, $\pi$ is not constructible because it is transcendental and so is not a root of any polynomial with rational coefficients. But is there a simple direct proof that $\pi$ is not a root of polynomial of degree $2^n$ with rational coefficients? The kind of proof I seek is one by induction on the height of a tower of quadratic extensions, one that ultimately relies on a proof that $\pi$ is not rational. Does any one know of a proof along these lines or any other direct proof? I just want a direct proof that $\pi$ is not constructible without appealing to transcendence.
|
I'm using the following function to get the current timestamp: $created_timestamp = date("Y-m-d H:i:s"); But how do I get a timestamp for the last day of next month. So for example, if it is the 15th of September to get the 31st of October. Including all the hours, minutes and seconds as well?
|
I need to get the first and last day of a month in the format YYYY-MM-DD given only the month and year. Is there a good, easy way to do this?
|
I am doing bread in a jar for a gift basket. It calls for Parmesan cheese(beer bread) what can i use for replacement if i have no Parmesan cheese. Is it necessary to add this ingredient?
|
The parmesan cheese in pasta recipe is quite expensive.....do we have cheaper alternative?? Are there are cheddar cheese which can replace parmesan cheese?
|
The following is a Template classes tutorial from learncpp.com : main.cpp #include "Array.h" int main() { Array<int> intArray(12); Array<double> doubleArray(12); for (int count = 0; count < intArray.getLength(); ++count) { intArray[count] = count; doubleArray[count] = count + 0.5; } for (int count = intArray.getLength()-1; count >= 0; --count) std::cout << intArray[count] << "\t" << doubleArray[count] << '\n'; return 0; } Array.h #ifndef ARRAY_H #define ARRAY_H #include <assert.h> // for assert() template <class T> class Array { private: int m_length; T *m_data; public: Array() { m_length = 0; m_data = nullptr; } Array(int length) { m_data = new T[length]; m_length = length; } ~Array() { delete[] m_data; } void Erase() { delete[] m_data; // We need to make sure we set m_data to 0 here, otherwise it will // be left pointing at deallocated memory! m_data = nullptr; m_length = 0; } T& operator[](int index) { assert(index >= 0 && index < m_length); return m_data[index]; } // The length of the array is always an integer // It does not depend on the data type of the array int getLength(); }; #endif Array.cpp #include "Array.h" template <typename T> int Array<T>::getLength() { return m_length; } Error : unresolved external symbol "public: int __thiscall Array::getLength(void)" (?GetLength@?$Array@H@@QAEHXZ) Explanation : In order for the compiler to use a template, it must see both the template definition (not just a declaration) and the template type used to instantiate the template. Also remember that C++ compiles files individually. When the Array.h header is #included in main, the template class definition is copied into main.cpp. When the compiler sees that we need two template instances, Array, and Array, it will instantiate these, and compile them as part of main.cpp. However, when it gets around to compiling Array.cpp separately, it will have forgotten that we need an Array and Array, so that template function is never instantiated. Thus, we get a linker error, because the compiler can’t find a definition for Array::getLength() or Array::getLength(). What does the explanation mean? i am having a hard time understanding the explanation provided by Alex(learncpp's creator).
|
Quote from : The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this? (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
|
Suppose I want to implement in C++ a data-structure to store oriented graphs. Arcs will be stored in Nodes thanks to STL containers. I'd like users to be able to iterate over the arcs of a node, in an STL-like way. The issue I have is that I don't want to expose in the Node class (that will actually be an abstract base class) which STL container I will actually use in the concrete class. I therefore don't want to have my methods return std::list::iterator or std::vector::iterator... I tried this: class Arc; typedef std::iterator<std::random_access_iterator_tag, Arc*> ArcIterator; // Wrong! class Node { public: ArcIterator incomingArcsBegin() const { return _incomingArcs.begin(); } private: std::vector<Arc*> _incomingArcs; }; But this is not correct because a vector::const_iterator can't be used to create an ArcIterator. So what can be this ArcIterator? I found this paper about but it did not help. I must be a bit heavy today... ;)
|
I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list. The custom list defines an iterator; class Iterator: public std::iterator<std::forward_iterator_tag, T> { // ... } Iterator begin() { return (Iterator(root)); } Iterator end() { return (Iterator(NULL)); } with the appropriate operators overloaded. Ideally, I would like to do this; class Foo { public: Foo() { std::list<int> x; std::vector<int> y; custom_list<int> z; iter = x.begin(); // OR iter = y.begin(); // OR iter = z.begin(); // ... }; private: std::iterator<int> iter; }; But obviously these are all iterators of different types. I can assume all the containers are of the same type however. Is there an elegant way to solve this problem?
|
Im trying to calculate the dielectric constant of a dielectric sample placed inside a rectangular waveguide over a range of frequenices. I used WR90 ( X band ).Using the s parameter data (S11 and S21), I used the Nicholson-Ross-Weir method to calculate the material parameters. But Im not getting a constant value(expected), rather Im getting wide variation in the dielectric constant. Given paper shows what i simulated in CST.
|
Im trying to find the material paramters of a dielectric sample using a waveguide(X band) employing the Transmission/Reflection technique. While performing simulation in CST, how to properly orient the sample inside? Is it necessary that the waveguide is flared?
|
I am calling php script which accesses my db from an android lass. The class is below; public class pk_http { // Progress Dialog private ProgressDialog qDialog; // JSON parser class JSONParser jParser = new JSONParser(); class phpCall extends AsyncTask<String, String, String> { @Override protected String doInBackground(String... args) { // Building Parameters String url = args[0]; List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL JSONObject json = jParser.makeHttpRequest(url, "GET",params); return null; } } Now when i call that from my calling class (the calling class does not extend Activity btw) this way; public static ArrayList<String> getLoginTileDataArray(Context c) { //CODE STUB: HTTP GET RETURNS THE FOLLOWING STRING String result = pk_http.phpCall.execute("http://myUrl/phpFile.php"); . . . I have a error pre-compilation that says; Non-static method 'execute(Params...) cannot be referenced from a static context. if i remove the 'sttic' no change. Am i calling the async method correctly?
|
The very common beginner mistake is when you try to use a class property "statically" without making an instance of that class. It leaves you with the mentioned error message: You can either make the non static method static or make an instance of that class to use its properties. Why? I am not asking for solutions. I would be grateful to know what is the reason behind it. The very core reason! private java.util.List<String> someMethod(){ /* Some Code */ return someList; } public static void main(String[] strArgs){ // The following statement causes the error. You know why.. java.util.List<String> someList = someMethod(); }
|
New to Linux. Mint and I don't mix. I want to switch from Mint to Ubuntu. I have no files to save. How can i accomplish total, clean, complete Ubuntu install (No home folder creation. No dual anything. No partitions to save anything.)? Do I actually have to "uninstall" the Mint OS? I cannot find anything anywhere that explains how to do this. What key do I press during start-up to let me change boot order to the bootable Ubuntu USB?
|
I would like to see a full how-to guide on how to install Ubuntu.
|
I saw this font in the following picture: Can you suggest something to make it usable for the chapter numbers in a (La)TeX document?
|
Is it possible to identify the font used in a specific document/picture? Answers to this question should identify: Possible methods to do this (perhaps one answer per method) and adequately describe how to use it (as opposed to merely stating it); Ways of finding the identified fonts, if possible (free or not); and Any prerequisites associated with the method used, if required (for example, "In order to use method X, your document has to be in format Y"). This question is meant as an FAQ, based on an . Its aim is to facilitate the community with the general procedures involved in font identification. Similar cases are solved on a per-usage basis on 's tag.
|
The problem is to determine the sum $$\sum_{n=1}^\infty \frac 1{2^n} \tan \frac 1{2^{n+1}}$$ I have been trying everything that comes to my mind (trigonometrical functions' formulas, transforming to integration, Taylor expansion, etc.) to no avail, so a slightest hint to a successful approach would be much appreciated.
|
Evaluate $$\lim_{n\to \infty} \sum_{r=1}^n \frac {1}{2^r}\tan \left(\frac {1}{2^r}\right)$$ I tried to create a telescoping sum but I couldn't. The last step I could reach was turning the limit into $$\lim_{n\to \infty} \sum_{r=1}^n \left(\frac {1}{2^r(1-\tan (2^{-r+1})} -\frac {1}{2^r(1+\tan (2^{-r+1})}\right) $$ But couldn't proceed further. Also I thought about Riemann sums but it was a pure dead end. Any help would be greatly appreciated
|
If f(x) and g(x) are Riemann integrable in [a,b], why $h(x)=\max\{f(x),g(x)\}$ is still Riemann integrable in [a,b]? Or maybe it is wrong?
|
Let $f,g$ be Riemann integrable functions, prove that the function $ h(x) $ defined by $$ h\left( x \right) = \max \left\{ {f\left( x \right),g\left( x \right)} \right\} $$ is also Riemann integrable.
|
I need to pass an array inside a routine and then to read its size. typedef struct { unsigned char Name[20]; }Sensors_; extern volatile Sensors_ Sensor; then inside source file I'm using this method void Save(){ SaveValue(Sensor.Name) } void SaveValue(volatile unsigned char Array[]){ printf("%d",sizeof(Array)); } The real size of my array is 20 characters, but i'm getting in output number 2. Why this is happening? I'm passing my array inside my method, so isn't the size same as my first array? Also i don't want to pass it as Sensors_ cause it's a generic method for other names too.
|
How do I determine the size of my array in C? That is, the number of elements the array can hold?
|
Let $p$ be prime and and $b \in \{1,2 \dots p-1\}.$ How do I show that $b^2$ is not divisible by $p,$ i.e. $p\nmid b^2?$ I'm guessing one has to use prime factor decomposition of $b$ first, so say $$b=\prod_{i=1}^{k} p_i^{\alpha_i} \implies b^2=\prod_{i=1}^{k} p_i^{2\alpha_i} $$ Next: if we assume the statement isn't true, i.e. $p \mid b^2=\prod_{i=1}^{k} p_i^{2\alpha_i} ,$ then I think we should end up having one of these $p_i$'s must be equal to $p,$ and we should arrive at a contradiction - this is where I'm a little stuck. Could you please write out a solution, - if possible, as an answer? Secondly, I think the problem can be generalized from prime to any non-perfect square $p$, but how do give the proof for that? Thank you!
|
Let $A$ be a UFD. Assume that $a,b \in A$ are relatively prime, $c \in A$ and $a | bc$. To prove that $a|c$, is the following approach correct (or do you have to use some type of prime factorization argument)? By the relatively prime assumption, $\gcd(a,b)$ is a unit. Call that unit $u \in A^{\times}$. Then we can write $u = ax + by$ for some $x,y \in A$. But then, $c = c \cdot u = c(ax+by)=cax+cby$. However, it is clear that $a|cax$ and the fact that $a|bc$ implies $a|cby$. Thus, $a|cax+cby=c$.
|
I defined a new class SafeQueue but when I import it and link it to my program, I get undefined reference error. safe_queue.h: #pragma once #include <queue> #include <mutex> #include <condition_variable> using namespace std; template<class T> class SafeQueue { public: SafeQueue(); ~SafeQueue(); void enqueue(T t); T dequeue(); private: queue<T> q; mutable mutex m; condition_variable c; }; safe_queue.cc: #include <queue> #include <mutex> #include <condition_variable> #include "safe_queue.h" using namespace std; // A threadsafe-queue. template <class T> SafeQueue<T>::SafeQueue() : q(), m(), c() {} template <class T> SafeQueue<T>::~SafeQueue() {} // Add an element to the queue. template <class T> void SafeQueue<T>::enqueue(T t) { lock_guard<mutex> lock(m); q.push(t); c.notify_one(); } // Get the "front"-element. // If the queue is empty, wait till a element is avaiable. template <class T> T SafeQueue<T>::dequeue() { unique_lock<mutex> lock(m); while(q.empty()) { // release lock as long as the wait and reaquire it afterwards. c.wait(lock); } T val = q.front(); q.pop(); return val; } Error: g++ ../logger/logger.o ../protos/backend.grpc.pb.o ../protos/keyvaluestore.grpc.pb.o ../protos/backend.pb.o ../protos/console.grpc.pb.o ../protos/keyvaluestore.pb.o ../protos/console.pb.o globals/globals.o grpc/backend_client.o grpc/console_client.o grpc/backend_server.o grpc/keyvaluestore_server.o grpc/console_server.o file_reader_functions/password_reader.o file_reader_functions/file_writer.o file_reader_functions/queries_writer.o pack_addrs/pack_addrs.o safe_queue/safe_queue.o master_node.o master_helper_functions/startup.o -L/usr/local/lib `pkg-config --libs protobuf grpc++` -lpthread -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -ldl -lz -o master_node /usr/bin/ld: globals/globals.o: in function `__static_initialization_and_destruction_0(int, int)': globals.cc:(.text+0x185): undefined reference to `SafeQueue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::SafeQueue()' /usr/bin/ld: globals.cc:(.text+0x19a): undefined reference to `SafeQueue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::~SafeQueue()' /usr/bin/ld: grpc/console_server.o: in function `ConsoleServiceImpl::JoinNetwork(grpc::ServerContext*, keyvaluestore::Request const*, console::ClusterInfo*)': console_server.cc:(.text+0x428): undefined reference to `SafeQueue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::enqueue(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' /usr/bin/ld: master_helper_functions/startup.o: in function `RunHealthChecks()': startup.cc:(.text+0x483): undefined reference to `SafeQueue<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::dequeue()' collect2: error: ld returned 1 exit status
|
Quote from : The only portable way of using templates at the moment is to implement them in header files by using inline functions. Why is this? (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
|
in my page I have an add button to add a new field into a table: $("#add").click(function () { var rowCount = $('#scale tr').length + 1; var newRow = '<tr id="row' + rowCount + '"><td>IP:</td><td> <input type="text" **class="ip"** id="ip' + rowCount + '" name="ip' + rowCount + '"> </input></td><td>Name:</td><td> <input type="text" id="n' + rowCount + '" name="n' + rowCount + '"> </input></td><td id="ip' + rowCount + 'ave"></td><td id="add"></td><td></td></tr>'; console.log(newRow); $("#scale tr:last").after(newRow); }); The row is added beautifully. I also have the following function in document ready: $(".ip").focusout(function(){ alert("here"); var id =this.id; console.log(id); if(!ipcheck(id)){ console.log("after function"); $("#"+id).css("color","red"); } else(pinging(id)); }); This code alerts me whenever I go to the first row of the table (the one which was initially existed) however for the new rows it doesn't work. My idea is to wrap all the listeners in a function and run the function whenever anything changes however as I have a lot of such a thing in my code I was wondering if there is a better/easier way to do it.
|
I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
|
How does the second law of thermodynamics disprove all machines?
|
Fermi in his lecture asserts: The second law of thermodynamics rules out the possibility of constructing a perpetuum mobile of the second kind. So, this means there can be no machine which just transforms all the heat energy gained by cooling surrounding bodies into mechanical work. But how does actually the Second Law prohibit this? The hot reservoir provides heat energy to the system. Does it cause a decrease in entropy of the universe(system + hot reservoir)? How? In order to receive heat wouldn't the system have to be cooler than the reservoir? If so, then entropy increases as the heat energy gets expelled from the reservoir at a higher temperature than the temperature the system receives the heat energy. Is it so? I'm not getting how the Second Law nullifies the existence of this machine. Could anyone please explain how the Law prohibits the perpetual machine of the second kind?
|
Here my code. I want remove from vector all elements with successfully called method 'release'. bool foo::release() { return true; } // ... vector<foo> vec; // ... remove_if(vec.begin(), vec.end(), [](foo & f) { return f.release() == true; }); // ... But remove_if not deleting all elements from vector vec. How remove_if works?
|
I want to clear a element from a vector using the erase method. But the problem here is that the element is not guaranteed to occur only once in the vector. It may be present multiple times and I need to clear all of them. My code is something like this: void erase(std::vector<int>& myNumbers_in, int number_in) { std::vector<int>::iterator iter = myNumbers_in.begin(); std::vector<int>::iterator endIter = myNumbers_in.end(); for(; iter != endIter; ++iter) { if(*iter == number_in) { myNumbers_in.erase(iter); } } } int main(int argc, char* argv[]) { std::vector<int> myNmbers; for(int i = 0; i < 2; ++i) { myNmbers.push_back(i); myNmbers.push_back(i); } erase(myNmbers, 1); return 0; } This code obviously crashes because I am changing the end of the vector while iterating through it. What is the best way to achieve this? I.e. is there any way to do this without iterating through the vector multiple times or creating one more copy of the vector?
|
On the sidebar, if there are more than 3 digits in the votes, it starts to split into two lines, and the second line does not carry the background colour of the first line (For instance, green if it has an accepted answer) like so: On a website like Meta.SE, such amounts of votes are common, so shouldn't it be necessary to fix this?
|
The score for the 4 questions are 111, 1218, 261 and 5 respectively, but they display 2 digits per line. This is an obvious bug in design.
|
I'm working through a circuit analysis text on my own for the purposes of getting started with Arduino. I just came across a box that explained why putting two different voltage sources in parallel is a bad idea but the explanation didn't quite make sense and now it's bugging me. I'm aware there is another, similar question here: but the answers aren't quite what I'm looking for. What I want to know is: how do I calculate the voltages, currents and resistances in a circuit that clearly defies idealizations? For instance, how much current will my poor different-voltage batteries encounter, respectively?
|
I have a computer power supply that I'm hacking together as a bench supply. For this particular model to power on, I need a minimum load across both +5V and +12V. "Easy," I thought, "I'll just connect both +5 and +12 to my power resistor!" And it worked, but then I started thinking, what does it mean to have these two different voltages connected in parallel? If the voltages were the same, then I would be . But what about different voltages? Also, what if I connected +5 and +12 in series, and then put a load on that? The equivalent voltage would be +17V; what would be the difference between that and parallel? Or am I going about this the wrong way; should I put a separate resistor on each rail? It seems like I can do better than that.
|
Which sentence is correct? and Why? She told me last week she hates action movies. She told me last week she hated action movies. As "hate" is a sensual verb and it does not finish in the past (you hate a type of movie and it does not change, at least with no mention in the context) I think Number one should be correct. But an English tutor told me the second one is correct as the discussion they are referring to has happened in the past. Which one is correct and why?
|
I know the past tense carries the past tense in every dependent clause, but referring specifically to places or to things that are eternal, like the Earth, seems a bit weird and therefore we sometimes (I believe incorrectly) say He didn't know that New Jersey was actually on the East Coast. Because it still is. Or He thought the Earth was round. So is it square now? Logically speaking, would you consider the use of past tense here a bit confusing in a day-to-day speech in these examples? Would you instinctively opt for using the present tense?
|
I have a problem with final compositing. I did make a planet with a ring, but behind the planet, the ring is still visible. I have an atmosphere too, but I think that's not a problem. Can anybody help? Here is what I like to see and what I see: And this is my composition:
|
I have multiple scenes each with different objects. I want to combine all these scenes in the compositor but when they render, all the objects from each scene overlap each other and are all transparent, so I can see all the objects when some should be hidden behind others. To join my scenes I'm using a mix node with add.
|
I accidentally deleted my E drive partition and i did not know. I extended my C drive, hence E drive's unallocated space was extended in the C drive. Now how can i get my files back of E drive? Its kind of emergency, can someone help me?
|
What steps can I take to try to recover lost or inaccessible data from any storage device? Answers: This applies to any computer storage device, e.g. internal/external hard drives, USB sticks, flash memory. The most important thing is to STOP using it, any type of I/O can ruin your chances of a recovery. We have separate questions covering common problems with USB flash drives in greater detail:
|
I coudn't update my newly installed ubuntu software. i get error like this matha@matha-HCL-Notebook:~$ sudo apt-get update [sudo] password for matha: E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/
|
I get this error when trying to use apt-get: E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it? How can I fix this?
|
Is there a performance difference (or any other reason) to use a JOIN instead of a WHERE clause as per the code examples below: ex1. select * from table_1, table_2 where table_1.id=table_2.id; ex2. select * from table_1 join table_2 on table_1.id = table_2.id;
|
Is there a difference in performance (in oracle) between Select * from Table1 T1 Inner Join Table2 T2 On T1.ID = T2.ID And Select * from Table1 T1, Table2 T2 Where T1.ID = T2.ID ?
|
So I for a while now I've thought that from a purely mechanical standpoint true neutral is the best alignment as a cleric; you can worship any deity because they will always be within 1 step; similarly, with aligned spells you are not restricted so long as you either worship a concept or have a true neutral deity. Chaotic, Evil, Good, and Lawful Spells: A cleric can’t cast spells of an alignment opposed to her own or her deity’s (if she has one). Spells associated with particular alignments are indicated by the chaotic, evil, good, and lawful descriptors in their spell descriptions. Alignment: A cleric’s alignment must be within one step of her deity’s, along either the law/chaos axis or the good/evil axis. Well, that's more or less my own theory on it but I tend to overlook stuff in the rules quite frequently and wanted confirmation from someone more familiar with this kind of stuff than me. Out of all the alignments, what is the best one for cleric, mechanically speaking? By "best" I mean in a typical pathfinder setting which alignment offers the most benefits in most situations if you only consider the effects alignment has on a clerics mechanics and class features. This is distinct from because this question is about pathfinder, not including 3.5 material that question is primarily from a role-play perspective it cites things like reasoning with people which is not what I'm asking about I'm asking about clerics specifically; it barely mentions spellcasters in general and Clerics are primarily commented that their aura is more likely to raise flags than other types of spellcasters. While I am well aware that optimization does not automatically make a good character, this question is specifically out of curiosity. I want to know if there is/what is the mechanically superior alignment is best for a Cleric.
|
Alignments of Good, Evil, Lawful & Chaotic seem to be hindrances. They affect your spell choice slightly, restrict certain equipment and worst of all, they make you weak to certain forms of weapons & magic. True Neutral alignments have none of these weaknesses, and can still seem use almost all spells/equipment with alignment restrictions. What am I missing?
|
$X\sim R(0,1)$ and $Y\sim R(0,1)$ (X and Y are uniformly distributed on the interval $[0,1])$ I need to find the density function of W when $W=X\cdot Y$ Can anyone help me?
|
Say $X_1, X_2, \ldots, X_n$ are independent and identically distributed uniform random variables on the interval $(0,1)$. What is the product distribution of two of such random variables, e.g., $Z_2 = X_1 \cdot X_2$? What if there are 3; $Z_3 = X_1 \cdot X_2 \cdot X_3$? What if there are $n$ of such uniform variables? $Z_n = X_1 \cdot X_2 \cdot \ldots \cdot X_n$?
|
I downloaded the latest version of hplip (3.19.5) from . Following the installation instructions, I ran: sh hplip-3.19.5.run It all worked well until the last step, where I got the following output: PRE-BUILD COMMANDS ------------------ OK BUILD AND INSTALL ----------------- Running './configure --with-hpppddir=/usr/share/ppd/HP --libdir=/usr/lib --prefix=/usr --enable-qt4 --disable-qt5 --enable-doc-build --disable-cups-ppd-install --disable-foomatic-drv-install --disable-libusb01_build --disable-foomatic-ppd-install --disable-hpijs-install --disable-class-driver --disable-udev_sysfs_rules --disable-policykit --enable-cups-drv-install --enable-hpcups-install --enable-network-build --enable-dbus-build --enable-scan-build --enable-fax-build --enable-apparmor_build' Please wait, this may take several minutes... Command completed successfully. Running 'make clean' Please wait, this may take several minutes... Command completed successfully. Running 'make' Please wait, this may take several minutes... error: 'make' command failed with status code 2 Indeed, when I run make I get: make: *** No targets specified and no makefile found. Stop.
|
Let's assume that one has some HP printer and/or scanner and checked its support status on the corresponding page of HPLIP site - . So one have the following information: the device Model name, Min. HPLIP Version and Driver Plug-in need. What should one install to make Ubuntu fully support the HP printer and/or scanner?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.