qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
11,357 | Normally, if I hear my good friend Shimon say a bracha, I answer Amen. Nonetheless, if it's during davening, and I hear him finish a bracha, it appears to be common practice to not say Amen.
In other words, (as far as I observed) during davening everyone exclusively says Amen to the brachos of the Chazzan, and to no o... | 2011/11/17 | [
"https://judaism.stackexchange.com/questions/11357",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/128/"
] | See [OC 6 (4) and MB](http://www.hebrewbooks.org/pdfpager.aspx?req=14170&st=&pgnum=23) who records a custom that each congregant says the morning blessings and the others answer omain (without the intention to fulfill their obligation by saying omain). See MB s.k. 13, who mentions a supporting view and the view of the ... | The rambam specifically forbids saying amen to birkot kriyat shema and shmoneh esrei if it is not from the chazan in a minyan. Other rishonim states that one can say amen to those of kriyat shema, but saying amen to shmoneh esrei of someone who’s whispering too loudly is specifically forbidden. |
830,217 | I use jQuery to get values of presaved elements from some websites, using paths like this:
>
> HTML BODY #bodyContainer #mainContentContainer #mainContent #productContentRight #swatchContent #colorSwatchContent SPAN
>
>
>
The problem i faced when the websites page contains tables and there are same element in ano... | 2009/05/06 | [
"https://Stackoverflow.com/questions/830217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20126/"
] | In order to grab one specific element when there are many that match you should give the elements classes, for example give each `table` a class describing what is in it, then give each `tr` a class describing what the row is about. Then each `td` with a class describing the specific part of the row that it describes, ... | tr[5] doesn't mean there are 5 trs (there could be 10!), it means that it is selecting the 5th one.
It looks to me like you are using an XPath selector to get your elements... which jQuery supports.
if you have control of the HTML, the easiest way to select a specific element is to give it an id... which in your firs... |
830,217 | I use jQuery to get values of presaved elements from some websites, using paths like this:
>
> HTML BODY #bodyContainer #mainContentContainer #mainContent #productContentRight #swatchContent #colorSwatchContent SPAN
>
>
>
The problem i faced when the websites page contains tables and there are same element in ano... | 2009/05/06 | [
"https://Stackoverflow.com/questions/830217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20126/"
] | I don't know why there are so many answers that you are using XPath because XPath was deprecated a long time ago and jQuery no longer supports it without the XPath compatibility plugin.
See Release Notes of 1.2 : <http://www.learningjquery.com/2007/09/upgrading-to-jquery-12>
XPath compatibility plugin : <http://docs.... | tr[5] doesn't mean there are 5 trs (there could be 10!), it means that it is selecting the 5th one.
It looks to me like you are using an XPath selector to get your elements... which jQuery supports.
if you have control of the HTML, the easiest way to select a specific element is to give it an id... which in your firs... |
830,217 | I use jQuery to get values of presaved elements from some websites, using paths like this:
>
> HTML BODY #bodyContainer #mainContentContainer #mainContent #productContentRight #swatchContent #colorSwatchContent SPAN
>
>
>
The problem i faced when the websites page contains tables and there are same element in ano... | 2009/05/06 | [
"https://Stackoverflow.com/questions/830217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20126/"
] | In order to grab one specific element when there are many that match you should give the elements classes, for example give each `table` a class describing what is in it, then give each `tr` a class describing what the row is about. Then each `td` with a class describing the specific part of the row that it describes, ... | Since jQuery supports xpath you could use firebug to get the specific xpath, and then use that in jQuery.
Just browse the source in firebug, right click any element, and then choose copy xpath. |
830,217 | I use jQuery to get values of presaved elements from some websites, using paths like this:
>
> HTML BODY #bodyContainer #mainContentContainer #mainContent #productContentRight #swatchContent #colorSwatchContent SPAN
>
>
>
The problem i faced when the websites page contains tables and there are same element in ano... | 2009/05/06 | [
"https://Stackoverflow.com/questions/830217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20126/"
] | I don't know why there are so many answers that you are using XPath because XPath was deprecated a long time ago and jQuery no longer supports it without the XPath compatibility plugin.
See Release Notes of 1.2 : <http://www.learningjquery.com/2007/09/upgrading-to-jquery-12>
XPath compatibility plugin : <http://docs.... | In order to grab one specific element when there are many that match you should give the elements classes, for example give each `table` a class describing what is in it, then give each `tr` a class describing what the row is about. Then each `td` with a class describing the specific part of the row that it describes, ... |
830,217 | I use jQuery to get values of presaved elements from some websites, using paths like this:
>
> HTML BODY #bodyContainer #mainContentContainer #mainContent #productContentRight #swatchContent #colorSwatchContent SPAN
>
>
>
The problem i faced when the websites page contains tables and there are same element in ano... | 2009/05/06 | [
"https://Stackoverflow.com/questions/830217",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20126/"
] | I don't know why there are so many answers that you are using XPath because XPath was deprecated a long time ago and jQuery no longer supports it without the XPath compatibility plugin.
See Release Notes of 1.2 : <http://www.learningjquery.com/2007/09/upgrading-to-jquery-12>
XPath compatibility plugin : <http://docs.... | Since jQuery supports xpath you could use firebug to get the specific xpath, and then use that in jQuery.
Just browse the source in firebug, right click any element, and then choose copy xpath. |
31,181,232 | My problem is following. I have enum with several variants that use increasing number of items. For simplicity I'll reduce the numbers to first two:
```
#[derive(Debug)]
pub enum Variant<A> {
Single([A; 1]),
Double([A; 2]),
}
```
I want to create special methods which would preferably transform `Single` into... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31181232",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/220485/"
] | I still wasn't sure how you would like your layout, but this will get you started. I just showed you how to get a single value and how to get a values from an array.
```
<?php
$ch = curl_init('http://www.expeditiontrips.com/xml/triplist.xml');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xml_raw = cu... | Finally Ended up with the following code. :) Hope it helps someone
```
<?php
$ch = curl_init('http://www.expeditiontrips.com/xml/triplist.xml');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xml_raw = curl_exec($ch);
curl_close($ch);
$trips = simplexml_load_string($xml_... |
46,736,914 | I have a WPF window that uses multiple viewmodel objects as its DataContext. The window has a control that binds to a property that exists only in some of the viewmodel objects. How can I bind to the property if it exists (and only if it exists).
I am aware of the following question/answer: [MVVM - hiding a control w... | 2017/10/13 | [
"https://Stackoverflow.com/questions/46736914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2799499/"
] | There are many different ways one could approach your scenario. For what it's worth, the solution you already have seems reasonable to me. The warning you get (I presume you are talking about the error message output to the debug console) is reasonably harmless. It does imply a potential performance issue, as it indica... | Here's a fairly simple solution using DataTriggers and a custom converter:
```
<Style TargetType="CheckBox">
<Style.Triggers>
<DataTrigger Binding="{Binding Converter={HasPropertyConverter PropertyName=Sometimes}}" Value="True">
<Setter Property="IsChecked" Value="{Binding Sometimes}" />
... |
45,780 | The effect of some photo filters can be summarized in transmission curves such as this one:
[](http://micro.magnet.fsu.edu/primer/lightandcolor/colortemperatureintro.html)
I want to simulate the effect o... | 2013/12/09 | [
"https://photo.stackexchange.com/questions/45780",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/23075/"
] | Disclaimer: this is off the top of my head --- I hope I am getting this right.
Probably you should make some assumption because I suppose that there is a loss of information when going from the "real" image to the RGB composition which is not reversible.
I mean, supposing a "real" RGB pixel (forget about demosaicin... | The problem you are trying to solve is highly underconstrained - the colour of each pixel in your digital image depends on the frequency distribution of the light entering that pixel. Different frequency distributions can result in the same RGB value being recorded in the image, however with the filter in place these d... |
45,780 | The effect of some photo filters can be summarized in transmission curves such as this one:
[](http://micro.magnet.fsu.edu/primer/lightandcolor/colortemperatureintro.html)
I want to simulate the effect o... | 2013/12/09 | [
"https://photo.stackexchange.com/questions/45780",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/23075/"
] | Disclaimer: this is off the top of my head --- I hope I am getting this right.
Probably you should make some assumption because I suppose that there is a loss of information when going from the "real" image to the RGB composition which is not reversible.
I mean, supposing a "real" RGB pixel (forget about demosaicin... | I ended up converting the RGB values of my source digital image to Spectrum Power Distributions (SPD) using the algorithm Brian Smits describes in this paper: [An RGB to Spectrum Conversion for Reflectances](http://www.cs.utah.edu/~bes/papers/color/).
Once I have a SPD for a given color, I apply the transmission curv... |
45,780 | The effect of some photo filters can be summarized in transmission curves such as this one:
[](http://micro.magnet.fsu.edu/primer/lightandcolor/colortemperatureintro.html)
I want to simulate the effect o... | 2013/12/09 | [
"https://photo.stackexchange.com/questions/45780",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/23075/"
] | The problem you are trying to solve is highly underconstrained - the colour of each pixel in your digital image depends on the frequency distribution of the light entering that pixel. Different frequency distributions can result in the same RGB value being recorded in the image, however with the filter in place these d... | I ended up converting the RGB values of my source digital image to Spectrum Power Distributions (SPD) using the algorithm Brian Smits describes in this paper: [An RGB to Spectrum Conversion for Reflectances](http://www.cs.utah.edu/~bes/papers/color/).
Once I have a SPD for a given color, I apply the transmission curv... |
9,396,313 | I have
```
<select onclick="alert('I was clicked!');" onblur="alert('Lost my focus :(');">
```
And I have jQuery listener that will click and blur this select if another element is clicked and blurred.
I have one problem and 1 question.
1. Why does onclick, onblur, on\* gets fired twice when another element trigg... | 2012/02/22 | [
"https://Stackoverflow.com/questions/9396313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/609477/"
] | The general algorithmn would be to find the color of the top left pixel, and then do a spiral scan inwards until you find a pixel not of that color. That will define one edge of your bounding box. Keep scanning until you hit one more of each edge. | <http://blog.damiles.com/2008/11/basic-ocr-in-opencv/>
might be of some help. You can use the simple bounding box method described in that tutorial or @Tyler Eaves spiral suggestion which works equally as well |
9,396,313 | I have
```
<select onclick="alert('I was clicked!');" onblur="alert('Lost my focus :(');">
```
And I have jQuery listener that will click and blur this select if another element is clicked and blurred.
I have one problem and 1 question.
1. Why does onclick, onblur, on\* gets fired twice when another element trigg... | 2012/02/22 | [
"https://Stackoverflow.com/questions/9396313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/609477/"
] | If you put the image into a `numpy` array, it's simple to find the edges which you can use PIL to crop. Here I'm assuming that the whitespace is the color `(255,255,255)`, you can adjust to your needs:
```
from PIL import Image
import numpy as np
im = Image.open("test.png")
pix = np.asarray(im)
pix = pix[:,:,0:3] # ... | The general algorithmn would be to find the color of the top left pixel, and then do a spiral scan inwards until you find a pixel not of that color. That will define one edge of your bounding box. Keep scanning until you hit one more of each edge. |
9,396,313 | I have
```
<select onclick="alert('I was clicked!');" onblur="alert('Lost my focus :(');">
```
And I have jQuery listener that will click and blur this select if another element is clicked and blurred.
I have one problem and 1 question.
1. Why does onclick, onblur, on\* gets fired twice when another element trigg... | 2012/02/22 | [
"https://Stackoverflow.com/questions/9396313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/609477/"
] | If you put the image into a `numpy` array, it's simple to find the edges which you can use PIL to crop. Here I'm assuming that the whitespace is the color `(255,255,255)`, you can adjust to your needs:
```
from PIL import Image
import numpy as np
im = Image.open("test.png")
pix = np.asarray(im)
pix = pix[:,:,0:3] # ... | <http://blog.damiles.com/2008/11/basic-ocr-in-opencv/>
might be of some help. You can use the simple bounding box method described in that tutorial or @Tyler Eaves spiral suggestion which works equally as well |
48,881,993 | I'm trying to change the color of the select-up-arrow and the color of the control when it's in focus, but without success. Have anyone done this using styled-components? | 2018/02/20 | [
"https://Stackoverflow.com/questions/48881993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5019903/"
] | ### This applies to `react-select@v2.*`
The same ideas as @bamse answer can be applied to v2 of react-select. The problem is that in v2 they removed pre-determined class names unless you specify to add them in with the prop `classNamePrefix`. They also changed what the class names in general look like.
General solut... | ### This applies to `react-select@v1.*`
[Here](https://github.com/JedWatson/react-select/issues/1679#issuecomment-307016615) you can find an example of styling `react-select` with `styled-components`.
To change to caret's colour when the select is opened you can use this
```
&.Select.is-open > .Select-control .Selec... |
48,881,993 | I'm trying to change the color of the select-up-arrow and the color of the control when it's in focus, but without success. Have anyone done this using styled-components? | 2018/02/20 | [
"https://Stackoverflow.com/questions/48881993",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5019903/"
] | This applies to react-select@v3.\*
----------------------------------
I had the same problem and solved it like this:
`CustomSelect.js` file:
```js
import ReactSelect from 'react-select';
import styled from 'styled-components';
export const CustomSelect = styled(ReactSelect)`
& .Select__indicator Select__dropdown... | ### This applies to `react-select@v1.*`
[Here](https://github.com/JedWatson/react-select/issues/1679#issuecomment-307016615) you can find an example of styling `react-select` with `styled-components`.
To change to caret's colour when the select is opened you can use this
```
&.Select.is-open > .Select-control .Selec... |
38,921,003 | I execute the guide of "Using a “Real” Cross-Compiler" descript on the [link](http://www.ev3dev.org/docs/tutorials/using-brickstrap-to-cross-compile/). In the botton of the guide there is a standard makefile. I write a simple program write in C and with the comand make it run. Now I would to write a program with the li... | 2016/08/12 | [
"https://Stackoverflow.com/questions/38921003",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6351174/"
] | If you're using gcc or clang, pass `-I /home/daniele/ev3c/include` to it in your recipe.
That'll allow you to `#include` from that path with `#include "someheader"`.
As far as Make-treatment of include files is concerned, they're usually implicit dependencies—that is you usually don't want to mention them in your depe... | Your .h file is header. Headers are included in the source code, not at compile time like libraries:
```
#include "ev3c.h"
```
for example.
A library has a different extension, like .a for example. You would add libev3c.a with:
```
-lev3c
```
in your makefile on the line that calls your compiler. However, you ha... |
324,427 | I am developing a 2D tile-based RPG game for desktop and (hopefully) Android. To represent a tile location in the game, I am using a class called `Location`, which has a value for `x`, `y`, and `room`. `room` refers to the `Room` that the `Location` is in. I use the `Location` class for calculations like whether a tile... | 2016/07/09 | [
"https://softwareengineering.stackexchange.com/questions/324427",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/196988/"
] | Instantiating and collecting small, short-lived, temporary objects, is perfectly fine. It is what modern garbage collectors are good at.
Modern (generational) garbage collectors are built on a couple of assumptions: most objects die young, most objects are small, most objects don't escape, most objects are immutable, ... | Garbage collection can become a performance issue in games, and might require special approaches. However, before you are *sure* that garbage collection of temporary `Location` instances is problematic, you would waste your time by trying to limit the amount of instances: “Premature optimization is the root of all evil... |
25,829,343 | (This is intended as a Q/A style question, intended to be a go-to resource for people that ask similar questions. A lot of people seem to stumble on the best way of doing this because they don't know all the options. Many of the answers will be ASP.NET specific, but AJAX and other techniques do have equivalents in othe... | 2014/09/14 | [
"https://Stackoverflow.com/questions/25829343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1139830/"
] | SignalR
-------
This is the answer I'm most excited to share, because it represents a much cleaner implementation that is lightweight and works well in today's mobile (data constricted) environment.
There have been several methods over the years to provide "realtime" pushing of data from the server to the client (or ... | Timer/UpdatePanel
-----------------
If you are using Web Forms, you can use a control called an UpdatePanel. The UpdatePanel is capable of refreshing sections of the page asynchronously, without causing a postback of the entire page. Combined with an asp:Timer, you can have the table update as often as you like. Here'... |
25,829,343 | (This is intended as a Q/A style question, intended to be a go-to resource for people that ask similar questions. A lot of people seem to stumble on the best way of doing this because they don't know all the options. Many of the answers will be ASP.NET specific, but AJAX and other techniques do have equivalents in othe... | 2014/09/14 | [
"https://Stackoverflow.com/questions/25829343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1139830/"
] | SignalR
-------
This is the answer I'm most excited to share, because it represents a much cleaner implementation that is lightweight and works well in today's mobile (data constricted) environment.
There have been several methods over the years to provide "realtime" pushing of data from the server to the client (or ... | AJAX Polling, poor implementation
---------------------------------
If you are using MVC or Web Forms, you can implement a technique called AJAX polling. This will constantly send an AJAX request to the server. The server will send a response containing the latest data. It is incredibly simple to implement. You don't ... |
25,829,343 | (This is intended as a Q/A style question, intended to be a go-to resource for people that ask similar questions. A lot of people seem to stumble on the best way of doing this because they don't know all the options. Many of the answers will be ASP.NET specific, but AJAX and other techniques do have equivalents in othe... | 2014/09/14 | [
"https://Stackoverflow.com/questions/25829343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1139830/"
] | SignalR
-------
This is the answer I'm most excited to share, because it represents a much cleaner implementation that is lightweight and works well in today's mobile (data constricted) environment.
There have been several methods over the years to provide "realtime" pushing of data from the server to the client (or ... | AJAX Polling, better implementation
-----------------------------------
Similar to the other AJAX based answer, you can continually poll the server. But this time, instead of responding with the data to display, we're going to reply with a list of ID's of the data. The client side is going to keep track of the data it... |
25,829,343 | (This is intended as a Q/A style question, intended to be a go-to resource for people that ask similar questions. A lot of people seem to stumble on the best way of doing this because they don't know all the options. Many of the answers will be ASP.NET specific, but AJAX and other techniques do have equivalents in othe... | 2014/09/14 | [
"https://Stackoverflow.com/questions/25829343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1139830/"
] | Timer/UpdatePanel
-----------------
If you are using Web Forms, you can use a control called an UpdatePanel. The UpdatePanel is capable of refreshing sections of the page asynchronously, without causing a postback of the entire page. Combined with an asp:Timer, you can have the table update as often as you like. Here'... | AJAX Polling, poor implementation
---------------------------------
If you are using MVC or Web Forms, you can implement a technique called AJAX polling. This will constantly send an AJAX request to the server. The server will send a response containing the latest data. It is incredibly simple to implement. You don't ... |
25,829,343 | (This is intended as a Q/A style question, intended to be a go-to resource for people that ask similar questions. A lot of people seem to stumble on the best way of doing this because they don't know all the options. Many of the answers will be ASP.NET specific, but AJAX and other techniques do have equivalents in othe... | 2014/09/14 | [
"https://Stackoverflow.com/questions/25829343",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1139830/"
] | AJAX Polling, better implementation
-----------------------------------
Similar to the other AJAX based answer, you can continually poll the server. But this time, instead of responding with the data to display, we're going to reply with a list of ID's of the data. The client side is going to keep track of the data it... | AJAX Polling, poor implementation
---------------------------------
If you are using MVC or Web Forms, you can implement a technique called AJAX polling. This will constantly send an AJAX request to the server. The server will send a response containing the latest data. It is incredibly simple to implement. You don't ... |
19,751,230 | For example, "parrots do not swim." Here the main verb is "swim". How can we extract that by language processing? Are there any known algorithms for this purpose? | 2013/11/03 | [
"https://Stackoverflow.com/questions/19751230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1813998/"
] | You can run a [dependency parsing](http://en.wikipedia.org/wiki/Dependency_grammar) algorithm on the sentence and the find the dependent of the `root` relation. For example, running the sentence "Parrots do not swim" through the [Stanford Parser online demo](http://nlp.stanford.edu:8080/parser/index.jsp), I get the fol... | To get the verb (or any other [Part-Of-Speech](http://en.wikipedia.org/wiki/Part-of-speech_tagging)) there are many supervised and unsupervised algorithms available like Viterbi Algorithm, Hidden Markov Models, Brill Tagger, Constraint Grammer, etc. Even we have libraries like [NLTK(Natural Language Tool Kit)](http://n... |
10,603,981 | I'm working on a game, and we have been storing our level information in JSON format. These levels are quite large, so we switched to just storing them in plain C#:
* A top level method has a switch statement for the name of the level/object
* There are several auto-generated methods that "new up" our object tree with... | 2012/05/15 | [
"https://Stackoverflow.com/questions/10603981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/132442/"
] | Those asserts occurs when you hit a condition that should *never* occur in the AOT compiler. Please report such cases to <http://bugzilla.xamarin.com>
>
> Is there some argument we can pass to mtouch to fix this?
>
>
>
You *might* be able to workaround this by using LLVM (or not using it) since it's a different c... | Just a recommendation for storage of the levels. Have you considered storing the levels in a very fast binary format like Protocol Buffers? .NET has a wonderful protocol buffers library called [Protobuf-net](http://code.google.com/p/protobuf-net/) that you might want to check out. |
168,837 | **[NBHM\_2006\_PhD Screening Test 2006\_Algebra]**
>
> Let $A$ be an $3\times 3$ orthogonal matrices with real entries,Then
> which are true
>
>
> 1. $\det A$ is rational number
> 2. $d(Ax,Ay)=d(x,y)$ for any two vector $x,y\in \mathbb{R}^3$ where $d$ is ussual eucledean distance.
> 3. All entries off $A$ are pos... | 2012/07/09 | [
"https://math.stackexchange.com/questions/168837",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/24690/"
] | **Hint:** For 2 (work out the details as exercise)
First, we show that if $A$ is orthogonal then $\| Ax \|^2 = \|x\|^2.$ Write $\|Ax \|^2 = (Ax)^{T}(Ax).$ Distribute the transpose and recall that $A^{T}A = I.$ Done.
Now, write $$d(Ax, Ay) = \| Ax - Ay \|^2 = (Ax-Ay)^{T}(Ax-Ay).$$ Simplify to get
$$(Ax)^{T}(Ax)-2(Ax)^... | For 4, think about a rotation matrix. |
168,837 | **[NBHM\_2006\_PhD Screening Test 2006\_Algebra]**
>
> Let $A$ be an $3\times 3$ orthogonal matrices with real entries,Then
> which are true
>
>
> 1. $\det A$ is rational number
> 2. $d(Ax,Ay)=d(x,y)$ for any two vector $x,y\in \mathbb{R}^3$ where $d$ is ussual eucledean distance.
> 3. All entries off $A$ are pos... | 2012/07/09 | [
"https://math.stackexchange.com/questions/168837",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/24690/"
] | **Hint:** For 2 (work out the details as exercise)
First, we show that if $A$ is orthogonal then $\| Ax \|^2 = \|x\|^2.$ Write $\|Ax \|^2 = (Ax)^{T}(Ax).$ Distribute the transpose and recall that $A^{T}A = I.$ Done.
Now, write $$d(Ax, Ay) = \| Ax - Ay \|^2 = (Ax-Ay)^{T}(Ax-Ay).$$ Simplify to get
$$(Ax)^{T}(Ax)-2(Ax)^... | The orthogonal matrix represents orthogonal transformation, which preservers inner product, so 2 is true.
3 is false, the counter example is the rotation matrix.
4 is also false, the eigenvalues are lying on the unit circle, not necessary real. |
168,837 | **[NBHM\_2006\_PhD Screening Test 2006\_Algebra]**
>
> Let $A$ be an $3\times 3$ orthogonal matrices with real entries,Then
> which are true
>
>
> 1. $\det A$ is rational number
> 2. $d(Ax,Ay)=d(x,y)$ for any two vector $x,y\in \mathbb{R}^3$ where $d$ is ussual eucledean distance.
> 3. All entries off $A$ are pos... | 2012/07/09 | [
"https://math.stackexchange.com/questions/168837",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/24690/"
] | For 4, think about a rotation matrix. | The orthogonal matrix represents orthogonal transformation, which preservers inner product, so 2 is true.
3 is false, the counter example is the rotation matrix.
4 is also false, the eigenvalues are lying on the unit circle, not necessary real. |
32,355,808 | >
> NOTE: I have read other stackoverflow questions relating to this topic
> but they did not help me. I also do not use any third-party SDKs.
>
>
>
When I submitted my app to the App Store, this is the message that I received after a few hours:
\*I only uploaded the App and enabled Test-Flight, I did not submit ... | 2015/09/02 | [
"https://Stackoverflow.com/questions/32355808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5213477/"
] | The solution is to do what it says:
>
> If your app does not use the Apple Push Notification service, no
> action is required.
>
>
>
It seems fairly clear by unless I'm missing something. | According to my research it is a bug from Apple. You should just ignore this as everything will work fine.
Ref:
[Missing Push Notification Entitlement Warning in email](https://stackoverflow.com/questions/32311097/missing-push-notification-entitlement-warning-in-email/32311431#32311431)
and
[iOS Missing Push notific... |
32,355,808 | >
> NOTE: I have read other stackoverflow questions relating to this topic
> but they did not help me. I also do not use any third-party SDKs.
>
>
>
When I submitted my app to the App Store, this is the message that I received after a few hours:
\*I only uploaded the App and enabled Test-Flight, I did not submit ... | 2015/09/02 | [
"https://Stackoverflow.com/questions/32355808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5213477/"
] | According to my research it is a bug from Apple. You should just ignore this as everything will work fine.
Ref:
[Missing Push Notification Entitlement Warning in email](https://stackoverflow.com/questions/32311097/missing-push-notification-entitlement-warning-in-email/32311431#32311431)
and
[iOS Missing Push notific... | We have had the same issues and everyone (included the client) was already really annoyed by those emails.
In our case an ancient dependency (FirebaseMessaging) has seemed to register to didReceiveRemoteNotification in some swizzling code - this triggered those warning-emails even if the app itself has no incorrect or... |
32,355,808 | >
> NOTE: I have read other stackoverflow questions relating to this topic
> but they did not help me. I also do not use any third-party SDKs.
>
>
>
When I submitted my app to the App Store, this is the message that I received after a few hours:
\*I only uploaded the App and enabled Test-Flight, I did not submit ... | 2015/09/02 | [
"https://Stackoverflow.com/questions/32355808",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5213477/"
] | The solution is to do what it says:
>
> If your app does not use the Apple Push Notification service, no
> action is required.
>
>
>
It seems fairly clear by unless I'm missing something. | We have had the same issues and everyone (included the client) was already really annoyed by those emails.
In our case an ancient dependency (FirebaseMessaging) has seemed to register to didReceiveRemoteNotification in some swizzling code - this triggered those warning-emails even if the app itself has no incorrect or... |
18,000,380 | I have added set of integers to a JTextArea for each button click.
what exactly I want is that I want to add all the integers and display in a separate `JTextArea`,Also I want to ask whether we can access the value of a variable within an action listener outside the action listener.
Here is the code:
```
private Act... | 2013/08/01 | [
"https://Stackoverflow.com/questions/18000380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2642969/"
] | If it wasn't a view, I'd have recommended this: open up an interactive shell with `manage.py shell`, then do:
```
from django.db import connection
# execute your functions
print connection.queries
```
This list will fill up with SQL queries as you execute them.
But since it's a view, I'd recommend you to use [djang... | You are doing it correctly. Code you wrote is for [Memcached Cache](https://docs.djangoproject.com/en/1.11/topics/cache/#memcached) not Database caching. So cache data is stored in the RAM of your server not in your database. Usually this is the fastest caching technique, but if your server doesn't have enough memory t... |
32,782,529 | I have been developing a web app on Microsoft Azure with a Git repository using Node.js and AngularJS.
It has been deploying successfully for the past few weeks and then today, I have added a small animation to the page using ng-show and @keyframes.
When attempting to push these changes to the git, I get the following... | 2015/09/25 | [
"https://Stackoverflow.com/questions/32782529",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3228185/"
] | Looking at last deployment (commit id starts with `4d00`), it seems it was successful. Could it be that for some reason the client disconnected (for some reason), but that the deployment is actually working fine?
Please try going to the deployment list in the portal, so check whether it all looks successful. I suspect... | In a similar post, see [Github Push Error: RPC failed; result=22, HTTP code = 413](https://stackoverflow.com/questions/7489813/github-push-error-rpc-failed-result-22-http-code-413)
the solution was to either reconfigure your webserver or to switch protocol (push via ssh instead of https).
You might want to try one of... |
91,504 | Can i create 2 legend objects in one script?
I'm currently working on a web-application in which i already do have a legend/TOC running and it looks like this:
```
var legendLayers=[];
legendLayers.push({layer:raum, title:'Raumkategorien', slider:true});
map.on("layers-add-result", function(){
var... | 2014/03/31 | [
"https://gis.stackexchange.com/questions/91504",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/9011/"
] | Have you destroyed your previous TOC? I've found that the legend widget get's confused if you build a new one without first destroying the old one. The legend widget has a destroy method, I'm not sure if the TOC does as well. Try completely removing the old TOC before building a new one.
Good Luck.
It's essentially s... | so i tried destroying the existing toc and creating a new one like this, but it doesn't seem to work
```
function gpJobComplete(jobinfo){
var mapurl = mapServiceURL + "/" + jobinfo.jobId;
var energy = new ArcGISDynamicMapServiceLayer(mapurl,{
id:"Beste Energieformen",
"opacity":... |
8,428,865 | What is the best way to match the scan (taken photo) point sets to the template point set (blue,green,red,pink circles in the images)?
I am using opencv/c++. Maybe some kind of the ICP algorithm? I would like to wrap the scan image to the template image!
template point set:
 would do the trick.
If not, I woul... | Have you looked at OpenCV's [descriptor\_extractor\_matcher.cpp](https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/descriptor_extractor_matcher.cpp) sample? This sample uses RANSAC to detect the homography between the two input images. I assume when you say wrap you actually mean warp? If you would like to warp ... |
8,428,865 | What is the best way to match the scan (taken photo) point sets to the template point set (blue,green,red,pink circles in the images)?
I am using opencv/c++. Maybe some kind of the ICP algorithm? I would like to wrap the scan image to the template image!
template point set:
 would do the trick.
If not, I woul... | Follow these steps:
1. Match points or features in two images, this will determine your wrapping;
2. Determine what transformation you are looking for for your wrapping. The most general would be homography (see cv::findHomography()) and the less general would be a simple translation (use cv::matchTempalte()). The int... |
8,428,865 | What is the best way to match the scan (taken photo) point sets to the template point set (blue,green,red,pink circles in the images)?
I am using opencv/c++. Maybe some kind of the ICP algorithm? I would like to wrap the scan image to the template image!
template point set:
 for each pixe... | Have you looked at OpenCV's [descriptor\_extractor\_matcher.cpp](https://code.ros.org/svn/opencv/trunk/opencv/samples/cpp/descriptor_extractor_matcher.cpp) sample? This sample uses RANSAC to detect the homography between the two input images. I assume when you say wrap you actually mean warp? If you would like to warp ... |
8,428,865 | What is the best way to match the scan (taken photo) point sets to the template point set (blue,green,red,pink circles in the images)?
I am using opencv/c++. Maybe some kind of the ICP algorithm? I would like to wrap the scan image to the template image!
template point set:
 for each pixe... | Follow these steps:
1. Match points or features in two images, this will determine your wrapping;
2. Determine what transformation you are looking for for your wrapping. The most general would be homography (see cv::findHomography()) and the less general would be a simple translation (use cv::matchTempalte()). The int... |
8,675,714 | I have a database that was created and is used by an architecture firm. All measurements are stored in a format like this: **15-3/4"** and **12' 6-3/4"**.
Is there a way to convert these types of measurements into floating point in Python? Or is there a library out there that provides this functionality?
Likewise, h... | 2011/12/30 | [
"https://Stackoverflow.com/questions/8675714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/802521/"
] | Consider the following self commented code. I tried to keep in simple
```
>>> from fractions import Fraction
>>> def Arch2Float(num):
#First Partition from Right so that the Feet and Unit always
#Remains aligned even if one of them is absent
ft,x,inch=num.rpartition("\'")
#Convert the inch to a real an... | Architectural to floating point:
```
import re
regex = re.compile('(\d+\' )*(\d+)-(\d+)\/(\d+)"')
regex.sub(lambda m: str((int((m.group(1) or '0').split("'")[0]) * 12)
+ int(m.group(2)))
+ ('%.2f' % (int(m.group(3)) / float(m.group(4))))[1:], measurement)
```
It's really atrocious, but I haven't worked with Pyt... |
8,675,714 | I have a database that was created and is used by an architecture firm. All measurements are stored in a format like this: **15-3/4"** and **12' 6-3/4"**.
Is there a way to convert these types of measurements into floating point in Python? Or is there a library out there that provides this functionality?
Likewise, h... | 2011/12/30 | [
"https://Stackoverflow.com/questions/8675714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/802521/"
] | Depending on how regular the patterns are, you can use *[str.partition](http://docs.python.org/library/stdtypes.html#str.partition)* to do the parsing:
```
def architectural_to_float(text):
''' Convert architectural measurements to inches.
>>> for text in """15-3/4",12' 6-3/4",3/4",3/4',15',15",15.5'""".s... | Architectural to floating point:
```
import re
regex = re.compile('(\d+\' )*(\d+)-(\d+)\/(\d+)"')
regex.sub(lambda m: str((int((m.group(1) or '0').split("'")[0]) * 12)
+ int(m.group(2)))
+ ('%.2f' % (int(m.group(3)) / float(m.group(4))))[1:], measurement)
```
It's really atrocious, but I haven't worked with Pyt... |
8,675,714 | I have a database that was created and is used by an architecture firm. All measurements are stored in a format like this: **15-3/4"** and **12' 6-3/4"**.
Is there a way to convert these types of measurements into floating point in Python? Or is there a library out there that provides this functionality?
Likewise, h... | 2011/12/30 | [
"https://Stackoverflow.com/questions/8675714",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/802521/"
] | Depending on how regular the patterns are, you can use *[str.partition](http://docs.python.org/library/stdtypes.html#str.partition)* to do the parsing:
```
def architectural_to_float(text):
''' Convert architectural measurements to inches.
>>> for text in """15-3/4",12' 6-3/4",3/4",3/4',15',15",15.5'""".s... | Consider the following self commented code. I tried to keep in simple
```
>>> from fractions import Fraction
>>> def Arch2Float(num):
#First Partition from Right so that the Feet and Unit always
#Remains aligned even if one of them is absent
ft,x,inch=num.rpartition("\'")
#Convert the inch to a real an... |
12,772,608 | If two scenarios can occur at the same time, does that (always/ever) constitute a third scenario?
My current thinking is that they are not necessarily exclusive (depends on the scenario). If you have two scenarios that could occur at the same time that they would only require a third scenario if the Given/When/Then st... | 2012/10/07 | [
"https://Stackoverflow.com/questions/12772608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856356/"
] | You can wrap whatever code in a function to make the "feels wrong" feeling disapear. E.g.:
```
function buildSqlInClauseFromCsv($csv)
{
return "in ('" . str_replace(",", "','", $csv) . "') ";
}
``` | There is only one correct way to escape strings for SQL - **use the function provided by the database api to escape strings for SQL**. While `mysyl_*` provides `mysql_real_escape_string()`:
```
$choices = explode(",", $variable);
foreach($choices as &$choice)
$choice = "'".mysql_real_escape_string($choice)."'";
... |
12,772,608 | If two scenarios can occur at the same time, does that (always/ever) constitute a third scenario?
My current thinking is that they are not necessarily exclusive (depends on the scenario). If you have two scenarios that could occur at the same time that they would only require a third scenario if the Given/When/Then st... | 2012/10/07 | [
"https://Stackoverflow.com/questions/12772608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856356/"
] | You can wrap whatever code in a function to make the "feels wrong" feeling disapear. E.g.:
```
function buildSqlInClauseFromCsv($csv)
{
return "in ('" . str_replace(",", "','", $csv) . "') ";
}
``` | Here is what I used:
```
WHERE column IN ('".str_replace(",", "','", $_GET[stringlist])."')
``` |
12,772,608 | If two scenarios can occur at the same time, does that (always/ever) constitute a third scenario?
My current thinking is that they are not necessarily exclusive (depends on the scenario). If you have two scenarios that could occur at the same time that they would only require a third scenario if the Given/When/Then st... | 2012/10/07 | [
"https://Stackoverflow.com/questions/12772608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856356/"
] | You can wrap whatever code in a function to make the "feels wrong" feeling disapear. E.g.:
```
function buildSqlInClauseFromCsv($csv)
{
return "in ('" . str_replace(",", "','", $csv) . "') ";
}
``` | we know that implode converts array to string,we need to provide the separator and then array as shown below, here we have (coma ,) as a separator.
Implode breaks each element of an array with the given separator,I have conceited '(single quotes) with the separator.
```
$arr = array();
$arr[] = "raam";
$arr[... |
12,772,608 | If two scenarios can occur at the same time, does that (always/ever) constitute a third scenario?
My current thinking is that they are not necessarily exclusive (depends on the scenario). If you have two scenarios that could occur at the same time that they would only require a third scenario if the Given/When/Then st... | 2012/10/07 | [
"https://Stackoverflow.com/questions/12772608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856356/"
] | You can wrap whatever code in a function to make the "feels wrong" feeling disapear. E.g.:
```
function buildSqlInClauseFromCsv($csv)
{
return "in ('" . str_replace(",", "','", $csv) . "') ";
}
``` | If $variable = "option1,option2,option3"
you can use:
"SELECT \* FROM TABLE WHERE FIND\_IN\_SET(some\_column, '$variable')" |
12,772,608 | If two scenarios can occur at the same time, does that (always/ever) constitute a third scenario?
My current thinking is that they are not necessarily exclusive (depends on the scenario). If you have two scenarios that could occur at the same time that they would only require a third scenario if the Given/When/Then st... | 2012/10/07 | [
"https://Stackoverflow.com/questions/12772608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856356/"
] | Here is what I used:
```
WHERE column IN ('".str_replace(",", "','", $_GET[stringlist])."')
``` | There is only one correct way to escape strings for SQL - **use the function provided by the database api to escape strings for SQL**. While `mysyl_*` provides `mysql_real_escape_string()`:
```
$choices = explode(",", $variable);
foreach($choices as &$choice)
$choice = "'".mysql_real_escape_string($choice)."'";
... |
12,772,608 | If two scenarios can occur at the same time, does that (always/ever) constitute a third scenario?
My current thinking is that they are not necessarily exclusive (depends on the scenario). If you have two scenarios that could occur at the same time that they would only require a third scenario if the Given/When/Then st... | 2012/10/07 | [
"https://Stackoverflow.com/questions/12772608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856356/"
] | we know that implode converts array to string,we need to provide the separator and then array as shown below, here we have (coma ,) as a separator.
Implode breaks each element of an array with the given separator,I have conceited '(single quotes) with the separator.
```
$arr = array();
$arr[] = "raam";
$arr[... | There is only one correct way to escape strings for SQL - **use the function provided by the database api to escape strings for SQL**. While `mysyl_*` provides `mysql_real_escape_string()`:
```
$choices = explode(",", $variable);
foreach($choices as &$choice)
$choice = "'".mysql_real_escape_string($choice)."'";
... |
12,772,608 | If two scenarios can occur at the same time, does that (always/ever) constitute a third scenario?
My current thinking is that they are not necessarily exclusive (depends on the scenario). If you have two scenarios that could occur at the same time that they would only require a third scenario if the Given/When/Then st... | 2012/10/07 | [
"https://Stackoverflow.com/questions/12772608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856356/"
] | If $variable = "option1,option2,option3"
you can use:
"SELECT \* FROM TABLE WHERE FIND\_IN\_SET(some\_column, '$variable')" | There is only one correct way to escape strings for SQL - **use the function provided by the database api to escape strings for SQL**. While `mysyl_*` provides `mysql_real_escape_string()`:
```
$choices = explode(",", $variable);
foreach($choices as &$choice)
$choice = "'".mysql_real_escape_string($choice)."'";
... |
31,015,900 | Can you please let me know how I can select 20 **unique** items for 4 arrays from a Master Array?
I have an array called `$countries` which looks like
```
$countries = ("Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Anguilla", "Antigua & Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austri... | 2015/06/24 | [
"https://Stackoverflow.com/questions/31015900",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1066197/"
] | ```
<?php
$countries = array("Afghanistan" , "Albania", "Algeria", "Andorra", "Angola", "Anguilla", "Antigua & Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bo... | Try using the array\_rand function, as described in the PHP docs here:
[array\_rand](http://php.net/manual/en/function.array-rand.php)
It takes an array, and some integer, and returns that many random array keys. Once you have those, put them in one of your $cat arrays, remove the keys from the master array, and repea... |
7,579,636 | When doing CLLocationManager, is there a delegate method that gets called when a user clicked the "Allow" or "Don't allow" prompt that request to use Location?
I tried this but this doesn't get called after a user "Allow" or "Don't allow".
```
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizatio... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7579636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166940/"
] | `[CLLocationManager locationServicesEnabled]` only tells your if the location service are enabled on the device.
`[CLLocationManager authorizationStatus]` returns the actual status you're looking for. | You'll have to implement `didFailWithError:` method:
```
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
if ([error domain] == kCLErrorDomain) {
// We handle CoreLocation-related errors here
switch ([error code]) {
// "Don't Allow" on two successiv... |
7,579,636 | When doing CLLocationManager, is there a delegate method that gets called when a user clicked the "Allow" or "Don't allow" prompt that request to use Location?
I tried this but this doesn't get called after a user "Allow" or "Don't allow".
```
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizatio... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7579636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166940/"
] | There is a delegate method for that
```
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized) {
// user allowed
}
}
``` | You'll have to implement `didFailWithError:` method:
```
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
if ([error domain] == kCLErrorDomain) {
// We handle CoreLocation-related errors here
switch ([error code]) {
// "Don't Allow" on two successiv... |
7,579,636 | When doing CLLocationManager, is there a delegate method that gets called when a user clicked the "Allow" or "Don't allow" prompt that request to use Location?
I tried this but this doesn't get called after a user "Allow" or "Don't allow".
```
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizatio... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7579636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166940/"
] | You'll have to implement `didFailWithError:` method:
```
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
if ([error domain] == kCLErrorDomain) {
// We handle CoreLocation-related errors here
switch ([error code]) {
// "Don't Allow" on two successiv... | `locationManager.locationServicesEnabled` indicates whether location services is available, but not necessarily mean they are allowed for your app.
Use `CLLocationManager.authorizationStatus()` if you need to find out the status at a point in time, or implement
`- (void)locationManager:(CLLocationManager *)manager d... |
7,579,636 | When doing CLLocationManager, is there a delegate method that gets called when a user clicked the "Allow" or "Don't allow" prompt that request to use Location?
I tried this but this doesn't get called after a user "Allow" or "Don't allow".
```
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizatio... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7579636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166940/"
] | There is a delegate method for that
```
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized) {
// user allowed
}
}
``` | `[CLLocationManager locationServicesEnabled]` only tells your if the location service are enabled on the device.
`[CLLocationManager authorizationStatus]` returns the actual status you're looking for. |
7,579,636 | When doing CLLocationManager, is there a delegate method that gets called when a user clicked the "Allow" or "Don't allow" prompt that request to use Location?
I tried this but this doesn't get called after a user "Allow" or "Don't allow".
```
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizatio... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7579636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166940/"
] | `[CLLocationManager locationServicesEnabled]` only tells your if the location service are enabled on the device.
`[CLLocationManager authorizationStatus]` returns the actual status you're looking for. | `locationManager.locationServicesEnabled` indicates whether location services is available, but not necessarily mean they are allowed for your app.
Use `CLLocationManager.authorizationStatus()` if you need to find out the status at a point in time, or implement
`- (void)locationManager:(CLLocationManager *)manager d... |
7,579,636 | When doing CLLocationManager, is there a delegate method that gets called when a user clicked the "Allow" or "Don't allow" prompt that request to use Location?
I tried this but this doesn't get called after a user "Allow" or "Don't allow".
```
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizatio... | 2011/09/28 | [
"https://Stackoverflow.com/questions/7579636",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/166940/"
] | There is a delegate method for that
```
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized) {
// user allowed
}
}
``` | `locationManager.locationServicesEnabled` indicates whether location services is available, but not necessarily mean they are allowed for your app.
Use `CLLocationManager.authorizationStatus()` if you need to find out the status at a point in time, or implement
`- (void)locationManager:(CLLocationManager *)manager d... |
61,323,298 | When upgrading to the latest version of RN 0.62.0 importing the package leads to `Type Errror: Super expression must either be null or a function` | 2020/04/20 | [
"https://Stackoverflow.com/questions/61323298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7516620/"
] | I've tried to upgrade `action-sheet` version in `react-native-gifted-chat` in pack
Like
```
"react-native-gifted-chat": "https://github.com/StagasaurusRex/react-native-gifted-chat.git#upgrade-action-sheet",
``` | I used this :
"yarn add <https://github.com/StagasaurusRex/react-native-gifted-chat.git#upgrade-action-sheet>"
it works! |
8,081,919 | **Solution:** Apparently the culprit was the use of `floor()`, the performance of which turns out to be OS-dependent in glibc.
---
This is a followup question to an earlier one: [Same program faster on Linux than Windows -- why?](https://stackoverflow.com/questions/8071851/same-program-faster-on-linux-than-windows-wh... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8081919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695132/"
] | Wikipedia says:
>
> Wine is a compatibility layer not an emulator. It duplicates functions
> of a Windows computer by providing alternative implementations of the
> DLLs that Windows programs call,[citation needed] and a process to
> substitute for the Windows NT kernel. This method of duplication
> differs from ... | While Wine is basically Windows, you're still comparing apples to oranges. As well, not only is it apples/oranges, the underlying vehicles hauling those apples and oranges around are completely different.
In short, your question could trivially be rephrased as "this code runs faster on Mac OSX than it does on Windows"... |
8,081,919 | **Solution:** Apparently the culprit was the use of `floor()`, the performance of which turns out to be OS-dependent in glibc.
---
This is a followup question to an earlier one: [Same program faster on Linux than Windows -- why?](https://stackoverflow.com/questions/8071851/same-program-faster-on-linux-than-windows-wh... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8081919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695132/"
] | **edit: It turned out that the culprit was `floor()` and not `rand()` as I suspected - see
the update at the top of the OP's question.**
The run time of your program is dominated by the calls to `rand()`.
I therefore think that `rand()` is the culprit. I suspect that the underlying function is provided by the WINE/... | While Wine is basically Windows, you're still comparing apples to oranges. As well, not only is it apples/oranges, the underlying vehicles hauling those apples and oranges around are completely different.
In short, your question could trivially be rephrased as "this code runs faster on Mac OSX than it does on Windows"... |
8,081,919 | **Solution:** Apparently the culprit was the use of `floor()`, the performance of which turns out to be OS-dependent in glibc.
---
This is a followup question to an earlier one: [Same program faster on Linux than Windows -- why?](https://stackoverflow.com/questions/8071851/same-program-faster-on-linux-than-windows-wh... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8081919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695132/"
] | From what I can tell, the C standard libraries used WILL be different in the two different scenarios. This affects the rand() call as well as floor().
From the mingw site... `MinGW compilers provide access to the functionality of the Microsoft C runtime and some language-specific runtimes.` Running under XP, this will... | While Wine is basically Windows, you're still comparing apples to oranges. As well, not only is it apples/oranges, the underlying vehicles hauling those apples and oranges around are completely different.
In short, your question could trivially be rephrased as "this code runs faster on Mac OSX than it does on Windows"... |
8,081,919 | **Solution:** Apparently the culprit was the use of `floor()`, the performance of which turns out to be OS-dependent in glibc.
---
This is a followup question to an earlier one: [Same program faster on Linux than Windows -- why?](https://stackoverflow.com/questions/8071851/same-program-faster-on-linux-than-windows-wh... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8081919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695132/"
] | **edit: It turned out that the culprit was `floor()` and not `rand()` as I suspected - see
the update at the top of the OP's question.**
The run time of your program is dominated by the calls to `rand()`.
I therefore think that `rand()` is the culprit. I suspect that the underlying function is provided by the WINE/... | Wikipedia says:
>
> Wine is a compatibility layer not an emulator. It duplicates functions
> of a Windows computer by providing alternative implementations of the
> DLLs that Windows programs call,[citation needed] and a process to
> substitute for the Windows NT kernel. This method of duplication
> differs from ... |
8,081,919 | **Solution:** Apparently the culprit was the use of `floor()`, the performance of which turns out to be OS-dependent in glibc.
---
This is a followup question to an earlier one: [Same program faster on Linux than Windows -- why?](https://stackoverflow.com/questions/8071851/same-program-faster-on-linux-than-windows-wh... | 2011/11/10 | [
"https://Stackoverflow.com/questions/8081919",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/695132/"
] | **edit: It turned out that the culprit was `floor()` and not `rand()` as I suspected - see
the update at the top of the OP's question.**
The run time of your program is dominated by the calls to `rand()`.
I therefore think that `rand()` is the culprit. I suspect that the underlying function is provided by the WINE/... | From what I can tell, the C standard libraries used WILL be different in the two different scenarios. This affects the rand() call as well as floor().
From the mingw site... `MinGW compilers provide access to the functionality of the Microsoft C runtime and some language-specific runtimes.` Running under XP, this will... |
21,441,672 | As the title says, I can't get Quartz.NET to work at all. I've got the latest versions of Quartz.NET (2.2.1), common.logging (2.1.2), common.logging.nlog (2.0.0), and NLog (2.1.0) from NuGet. Triggers aren't firing and there's absolutely nothing getting logged by Quartz. I'm guessing I screwed up the config somehow.
M... | 2014/01/29 | [
"https://Stackoverflow.com/questions/21441672",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1282069/"
] | You may be able to resolve this by placing the `ID` alternative above `ID expr`. When left-recursion is eliminated, all of your alternatives which are not left recursive are parsed before your alternatives which are left recursive.
For your example, the first non-left-recursive alternative `ID expr` matches the entire... | To get this expression (expr (expr foo) [ (expr 4) ]), you can use
>
> top : expr EOF;
>
>
>
>
> expr : expr '[' expr? ']' | ID | INT ;
>
>
> |
1,587,897 | Given a smooth real manifold $M$, and a real vector space $V$, when we talk about a $V$-valued $k$-form on $M$, do we mean an element of $\Gamma(\wedge^{\*k}M)\otimes V$, where $\Gamma$ denotes sections of a vector bundle and $\wedge^{\*k}M$ is the $k$th exterior bundle, or do we actually mean there is a $\pi:V\rightar... | 2015/12/24 | [
"https://math.stackexchange.com/questions/1587897",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/171560/"
] | I don't think that there is a uniform use of terminology, although it seems more common to me that "vector valued differential forms" refers to the case of a fixed vector space, whereas in the other case, I would use the terminology "vector bundle valued differential forms". An important difference between the two case... | In my experience, usually "vector valued differential form" refers to a differential form with values in a vector bundle, so let
$$E\longrightarrow M$$
be a vector bundle, then the space of $V$-valued $k$ forms is
$$\Omega^k(M;E) = \Gamma(\Lambda^kT^\*M\otimes V).$$
Notice that you can recover the first case you presen... |
3,131,129 | I'am encountering a problem with my Web Apps and cannot find any answers on the web.
I have a Java Web
App that works on parallel with
tomcat and apache using mod\_jk.
Everything works fine, but after one
day of running in tomcat, one of my
main servlet doing ajax request stop working. All the
others work fine. ... | 2010/06/28 | [
"https://Stackoverflow.com/questions/3131129",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/374067/"
] | * You may look at your server logs.
* You may use a browser addon like [Live HTTP Headers](http://livehttpheaders.mozdev.org/) to check the status of your ajax request(any http requests for that matter)
* If you are using a IDE, start the server in debug mode and debug your servlet and troubleshoot from there on. | Since you tagged SQL as well, I strongly suspect that your webapp is leaking SQL connections. I.e., your webapp is getting a connection and keeping it open all the time and *never* [closing](http://java.sun.com/javase/6/docs/api/java/sql/Connection.html#close%28%29) it. Because the connection is been too long open, the... |
296,431 | I'm searching for a good edition of Philosophiae Naturalis Principia Mathematica of Isaac Newton in English. Which edition of the Principia can you suggest me? If it's possible, cheap and similar to original with the original proofs of Isaac Newton.
I'm sorry for my poor English, I'm just learning it. | 2018/03/28 | [
"https://mathoverflow.net/questions/296431",
"https://mathoverflow.net",
"https://mathoverflow.net/users/122539/"
] | I would recommend this 1999 version by Cohen & Whitman:
[The Principia: The Authoritative Translation and Guide: Mathematical Principles of Natural Philosophy](https://rads.stackoverflow.com/amzn/click/0520290887)
This edition has comments that help you understand the original. It is also quite cheap. | Here is a free copy offered by its author, (edit: the translator, Ian Bruce),
* <http://www.17centurymaths.com/contents/newtoncontents.html> |
296,431 | I'm searching for a good edition of Philosophiae Naturalis Principia Mathematica of Isaac Newton in English. Which edition of the Principia can you suggest me? If it's possible, cheap and similar to original with the original proofs of Isaac Newton.
I'm sorry for my poor English, I'm just learning it. | 2018/03/28 | [
"https://mathoverflow.net/questions/296431",
"https://mathoverflow.net",
"https://mathoverflow.net/users/122539/"
] | The difficulty is not in the language that Newton uses, but in the incredibly original viewpoint that he takes. Get a good translation, by all means, but you'll also need the help of a good guide.
One of the best such guides I ever found was S. Chandrasekhar's fantastic "Newton's *Principia* for the Common Reader", Ox... | Here is a free copy offered by its author, (edit: the translator, Ian Bruce),
* <http://www.17centurymaths.com/contents/newtoncontents.html> |
296,431 | I'm searching for a good edition of Philosophiae Naturalis Principia Mathematica of Isaac Newton in English. Which edition of the Principia can you suggest me? If it's possible, cheap and similar to original with the original proofs of Isaac Newton.
I'm sorry for my poor English, I'm just learning it. | 2018/03/28 | [
"https://mathoverflow.net/questions/296431",
"https://mathoverflow.net",
"https://mathoverflow.net/users/122539/"
] | Here is a free copy offered by its author, (edit: the translator, Ian Bruce),
* <http://www.17centurymaths.com/contents/newtoncontents.html> | [This 2003 edition by Densmore & Donahue](https://rads.stackoverflow.com/amzn/click/1888009233) has the following book review
>
> Makes the great adventure of *Principia* available not only to modern
> scholars of history of science, but also to nonspecialist
> undergraduate students of humanities. It moves careful... |
296,431 | I'm searching for a good edition of Philosophiae Naturalis Principia Mathematica of Isaac Newton in English. Which edition of the Principia can you suggest me? If it's possible, cheap and similar to original with the original proofs of Isaac Newton.
I'm sorry for my poor English, I'm just learning it. | 2018/03/28 | [
"https://mathoverflow.net/questions/296431",
"https://mathoverflow.net",
"https://mathoverflow.net/users/122539/"
] | The difficulty is not in the language that Newton uses, but in the incredibly original viewpoint that he takes. Get a good translation, by all means, but you'll also need the help of a good guide.
One of the best such guides I ever found was S. Chandrasekhar's fantastic "Newton's *Principia* for the Common Reader", Ox... | I would recommend this 1999 version by Cohen & Whitman:
[The Principia: The Authoritative Translation and Guide: Mathematical Principles of Natural Philosophy](https://rads.stackoverflow.com/amzn/click/0520290887)
This edition has comments that help you understand the original. It is also quite cheap. |
296,431 | I'm searching for a good edition of Philosophiae Naturalis Principia Mathematica of Isaac Newton in English. Which edition of the Principia can you suggest me? If it's possible, cheap and similar to original with the original proofs of Isaac Newton.
I'm sorry for my poor English, I'm just learning it. | 2018/03/28 | [
"https://mathoverflow.net/questions/296431",
"https://mathoverflow.net",
"https://mathoverflow.net/users/122539/"
] | I would recommend this 1999 version by Cohen & Whitman:
[The Principia: The Authoritative Translation and Guide: Mathematical Principles of Natural Philosophy](https://rads.stackoverflow.com/amzn/click/0520290887)
This edition has comments that help you understand the original. It is also quite cheap. | [This 2003 edition by Densmore & Donahue](https://rads.stackoverflow.com/amzn/click/1888009233) has the following book review
>
> Makes the great adventure of *Principia* available not only to modern
> scholars of history of science, but also to nonspecialist
> undergraduate students of humanities. It moves careful... |
296,431 | I'm searching for a good edition of Philosophiae Naturalis Principia Mathematica of Isaac Newton in English. Which edition of the Principia can you suggest me? If it's possible, cheap and similar to original with the original proofs of Isaac Newton.
I'm sorry for my poor English, I'm just learning it. | 2018/03/28 | [
"https://mathoverflow.net/questions/296431",
"https://mathoverflow.net",
"https://mathoverflow.net/users/122539/"
] | The difficulty is not in the language that Newton uses, but in the incredibly original viewpoint that he takes. Get a good translation, by all means, but you'll also need the help of a good guide.
One of the best such guides I ever found was S. Chandrasekhar's fantastic "Newton's *Principia* for the Common Reader", Ox... | [This 2003 edition by Densmore & Donahue](https://rads.stackoverflow.com/amzn/click/1888009233) has the following book review
>
> Makes the great adventure of *Principia* available not only to modern
> scholars of history of science, but also to nonspecialist
> undergraduate students of humanities. It moves careful... |
19,731,053 | Is there any way to change shell print color in python 3.3.2 in Linux and Windows shell? I've read all other topics but none of them working with this version or I should import a module. For example I want to print like this with pure python modules:
. The
following example command inserts new line character between the seventh and
the eighth columns.
```
:%s/\%8v/\r/
```
This idea could be extended to use the number of... | quick and dirty solution - first, insert some character which is not in column (say, #) , then, `gv`, then `'<,'>s/#/\r/g`.
will be glad if one provide more clever solution. |
7,724,089 | I want to insert return before one column of multiple lines, so I select the characters of this column with `Ctrl`+`V` in normal mode, then type `I`, Vim enters insert mode. After typing `Enter` key, and press key `Esc`, only one line is broken. Is there any way to perform this function? Thanks. | 2011/10/11 | [
"https://Stackoverflow.com/questions/7724089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/668826/"
] | quick and dirty solution - first, insert some character which is not in column (say, #) , then, `gv`, then `'<,'>s/#/\r/g`.
will be glad if one provide more clever solution. | After selecting the desired lines, to break on third column:
```
:'<,'>g/./norm! 3|a^M
```
(`^M` inserted by pressing `<c-v><CR>` or `<c-q><CR>`)
, similar to answer on [Find every third value and insert cr or newline in VIM](https://stackoverflow.com/questions/7714278/find-every-third-value-and-insert-cr-or-newlin... |
7,724,089 | I want to insert return before one column of multiple lines, so I select the characters of this column with `Ctrl`+`V` in normal mode, then type `I`, Vim enters insert mode. After typing `Enter` key, and press key `Esc`, only one line is broken. Is there any way to perform this function? Thanks. | 2011/10/11 | [
"https://Stackoverflow.com/questions/7724089",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/668826/"
] | To break lines just before a particular column, use `\%v` search pattern atom
that matches in a given position with zero-width (see `:help /\%v`). The
following example command inserts new line character between the seventh and
the eighth columns.
```
:%s/\%8v/\r/
```
This idea could be extended to use the number of... | After selecting the desired lines, to break on third column:
```
:'<,'>g/./norm! 3|a^M
```
(`^M` inserted by pressing `<c-v><CR>` or `<c-q><CR>`)
, similar to answer on [Find every third value and insert cr or newline in VIM](https://stackoverflow.com/questions/7714278/find-every-third-value-and-insert-cr-or-newlin... |
31,033,200 | I am new to spring security. How do I interpret this?
```
@PreAuthorize("hasPermission(null, 'opetussuunnitelma', 'LUONTI')")
OpetussuunnitelmaDto addOpetussuunnitelma(OpetussuunnitelmaDto opetussuunnitelmaDto);
```
Which method from the permission evaluator would get called? I think the one with three paramet... | 2015/06/24 | [
"https://Stackoverflow.com/questions/31033200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4021611/"
] | >
> Which method from the permission evaluator would get called?
>
>
>
```
public boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission)
```
Would get called.
>
> I read that the first argument ( the Authentication object) is not
> supplied.
>
>
>
It's not expl... | [This answer](https://stackoverflow.com/a/31033890/5134722) has already got to the heart of what it seems the OP was truly asking. I will augment that answer with a slightly deeper dive into what is going on behind the scenes with the `hasPermission` expression.
Recap
-----
Let's first recap on [this answer](https://... |
10,861,004 | I would like to split or join text using a click of the mouse. As part of a project I am doing.
When the user clicks a character, a word boundary is marked or un-marked after the current character, depending on the current state.
Currently, each word of my text is contained in a span:
```
<span class="word">te</span... | 2012/06/02 | [
"https://Stackoverflow.com/questions/10861004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1392252/"
] | I don't know if that's exactly what you want but maybe it'll help:
I used a textarea and the [jCaret](http://www.jquery-plugin.buss.hk/my-plugins/jquery-caret-plugin) plugin to detect the cursor position, then insert or delete spaces on click:
**JS:**
```
$('textarea').bind('click', function() {
var v = $(this).... | You can't detect and process a click on an individual character unless that character has its own DOM element[1], so you will need additional spans. The only exception is inside a TextField or TextArea, where the click moves the cursor before triggering the OnClick handler. There the current cursor position will contai... |
44,127,807 | I have build jobs created in Jenkins and I want to publish the Job results to a HipChat room. I'm using [HipChat plugin](https://wiki.jenkins-ci.org/display/JENKINS/HipChat+Plugin). The issue here is that I am able to save my credentials in Jenkins Global credentials but I don't see any credentials listed for HipChat n... | 2017/05/23 | [
"https://Stackoverflow.com/questions/44127807",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5966949/"
] | You have to use credentials of "secret text" kind and use an OAuth Token V2 by doing the following:
1. Go to <https://YourHipChat.hipchat.com/account/api> and login (Replace "YourHipChat" in the url, with your company or whatever)
2. Click on Rooms-->YourChatRoom-->Integrations
3. Find Jenkins and add it.
4. Grab the ... | I could not find solution to the credential issue I faced but found another way for what I need. Instead of the HipChat plugin, I used HipChat notifier plugin from [Github link](https://github.com/yagince/hipchat-notifier-plugin), created a access token for chatroom and used the access token in HipChat notifier. It did... |
45,070,502 | Send data message for app notification via FCM.
I have various FCM data types, and each type has its own action separate way.
Everything works fine, if I send only one message. App could handle exactly what I want.
But send FCM more than twice, (for example, [FCM - data for action 1] then [FCM - data for action 2] )... | 2017/07/13 | [
"https://Stackoverflow.com/questions/45070502",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2598459/"
] | did you use NotificationManager for displaying the notifications?
Then try this
```
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify((int) System.currentTimeMillis(), notifBuilder.build());
```
see the
```
(int) System.curren... | If you want notification seperate, you need define diffrent id for notificaton:
```
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(<Unique notification id here>, notifBuilder.build());
``` |
5,777,131 | Are the below two pieces of code the same?
```
String foo = "foo";
String foo = new String("foo").intern();
``` | 2011/04/25 | [
"https://Stackoverflow.com/questions/5777131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723538/"
] | [`public String intern()`](http://download.oracle.com/javase/6/docs/api/java/lang/String.html#intern%28%29)
>
> It follows that for any two strings s
> and t, `s.intern() == t.intern()` is
> true if and only if `s.equals(t)` is
> `true`.
>
>
>
So I believe the answer is yes, although the second method will hav... | Yes, they are same. Basically `intern()` returns a representation of a string that is unique across the VM. This means you can use `==` instead of `.equals()` to compare the strings, saving on performance. |
5,777,131 | Are the below two pieces of code the same?
```
String foo = "foo";
String foo = new String("foo").intern();
``` | 2011/04/25 | [
"https://Stackoverflow.com/questions/5777131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723538/"
] | [`public String intern()`](http://download.oracle.com/javase/6/docs/api/java/lang/String.html#intern%28%29)
>
> It follows that for any two strings s
> and t, `s.intern() == t.intern()` is
> true if and only if `s.equals(t)` is
> `true`.
>
>
>
So I believe the answer is yes, although the second method will hav... | >
> Explicitly constructing a new String
> object initialized to a literal
> produces a non-interned
> String. (Invoking intern() on this
> String would return a reference to the
> String from the intern table.)
>
>
>
Taken from : <http://javatechniques.com/public/java/docs/basics/string-equality.html> |
5,777,131 | Are the below two pieces of code the same?
```
String foo = "foo";
String foo = new String("foo").intern();
``` | 2011/04/25 | [
"https://Stackoverflow.com/questions/5777131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723538/"
] | They have the same *end result*, but they are not the same (they'll produce different bytecode; the `new String("foo").intern()` version actually goes through those steps, producing a new string object, then interning it).
Two relevant quotes from `String#intern`:
>
> When the `intern` method is invoked, if the pool... | [`public String intern()`](http://download.oracle.com/javase/6/docs/api/java/lang/String.html#intern%28%29)
>
> It follows that for any two strings s
> and t, `s.intern() == t.intern()` is
> true if and only if `s.equals(t)` is
> `true`.
>
>
>
So I believe the answer is yes, although the second method will hav... |
5,777,131 | Are the below two pieces of code the same?
```
String foo = "foo";
String foo = new String("foo").intern();
``` | 2011/04/25 | [
"https://Stackoverflow.com/questions/5777131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723538/"
] | They have the same *end result*, but they are not the same (they'll produce different bytecode; the `new String("foo").intern()` version actually goes through those steps, producing a new string object, then interning it).
Two relevant quotes from `String#intern`:
>
> When the `intern` method is invoked, if the pool... | Yes, they are same. Basically `intern()` returns a representation of a string that is unique across the VM. This means you can use `==` instead of `.equals()` to compare the strings, saving on performance. |
5,777,131 | Are the below two pieces of code the same?
```
String foo = "foo";
String foo = new String("foo").intern();
``` | 2011/04/25 | [
"https://Stackoverflow.com/questions/5777131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723538/"
] | The first one i.e.
```
String foo = "foo";
```
in this line, we are creating a String using String literals. That means the string is automatically saved in String Constant pool.
In the 2nd one , i.e. -
```
String foo = new String("foo").intern();
```
Here we are creating a String using new String() & th... | Yes, they are same. Basically `intern()` returns a representation of a string that is unique across the VM. This means you can use `==` instead of `.equals()` to compare the strings, saving on performance. |
5,777,131 | Are the below two pieces of code the same?
```
String foo = "foo";
String foo = new String("foo").intern();
``` | 2011/04/25 | [
"https://Stackoverflow.com/questions/5777131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723538/"
] | They have the same *end result*, but they are not the same (they'll produce different bytecode; the `new String("foo").intern()` version actually goes through those steps, producing a new string object, then interning it).
Two relevant quotes from `String#intern`:
>
> When the `intern` method is invoked, if the pool... | >
> Explicitly constructing a new String
> object initialized to a literal
> produces a non-interned
> String. (Invoking intern() on this
> String would return a reference to the
> String from the intern table.)
>
>
>
Taken from : <http://javatechniques.com/public/java/docs/basics/string-equality.html> |
5,777,131 | Are the below two pieces of code the same?
```
String foo = "foo";
String foo = new String("foo").intern();
``` | 2011/04/25 | [
"https://Stackoverflow.com/questions/5777131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723538/"
] | The first one i.e.
```
String foo = "foo";
```
in this line, we are creating a String using String literals. That means the string is automatically saved in String Constant pool.
In the 2nd one , i.e. -
```
String foo = new String("foo").intern();
```
Here we are creating a String using new String() & th... | >
> Explicitly constructing a new String
> object initialized to a literal
> produces a non-interned
> String. (Invoking intern() on this
> String would return a reference to the
> String from the intern table.)
>
>
>
Taken from : <http://javatechniques.com/public/java/docs/basics/string-equality.html> |
5,777,131 | Are the below two pieces of code the same?
```
String foo = "foo";
String foo = new String("foo").intern();
``` | 2011/04/25 | [
"https://Stackoverflow.com/questions/5777131",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/723538/"
] | They have the same *end result*, but they are not the same (they'll produce different bytecode; the `new String("foo").intern()` version actually goes through those steps, producing a new string object, then interning it).
Two relevant quotes from `String#intern`:
>
> When the `intern` method is invoked, if the pool... | The first one i.e.
```
String foo = "foo";
```
in this line, we are creating a String using String literals. That means the string is automatically saved in String Constant pool.
In the 2nd one , i.e. -
```
String foo = new String("foo").intern();
```
Here we are creating a String using new String() & th... |
942,368 | $$P(x)=16x^4-81$$
I know that this factors out as:
$$P(x)=16(x-\frac { 3 }{ 2 } )^4$$
What I don't understand is the four different zeros of the polynomial...I see one zero which is $\frac { 3 }{ 2 }$ but not the three others. | 2014/09/23 | [
"https://math.stackexchange.com/questions/942368",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/170329/"
] | Try making the substitutions $a=2x$ and $b=3$. Then we have that
$$
16x^4-81=a^4-b^4.
$$
Recalling that $x^2-y^2=(x+y)(x-y)$, we have
$$
a^4-b^4=[a^2-b^2](a^2+b^2)=[(a-b)(a+b)](a^2+b^2)
$$
Plugging $2x$ in for $a$ and $3$ in for $b$ we have
$$
(a-b)(a+b)(a^2+b^2)=(2x-3)(2x+3)((2x)^2+3^2)=(2x-3)(2x+3)(4x^2+9).
$$
If you... | The four zeros are $\frac{3}{2},\frac{-3}{2},\frac{3i}{2},\frac{-3i}{2}$
The $n$th root of a number has $n$ answers.
To find each value of the $n$th root of $x$, draw a unit circle. The principal root is simply horizontal. Take that line and rotate it about the origin by increments of $\dfrac{2\pi}{n}$ to get each va... |
942,368 | $$P(x)=16x^4-81$$
I know that this factors out as:
$$P(x)=16(x-\frac { 3 }{ 2 } )^4$$
What I don't understand is the four different zeros of the polynomial...I see one zero which is $\frac { 3 }{ 2 }$ but not the three others. | 2014/09/23 | [
"https://math.stackexchange.com/questions/942368",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/170329/"
] | Recognize $16x^4-81$ as a difference of two squares.
Then factor into linear factors,
$$
\begin{align\*}
P(x)&=16x^4-81\\
&=(4x^2)^2-9^2\\
&=(4x^2-9)(4x^2+9)\\
&=(2x-3)(2x+3)(2x+3i)(2x-3i).
\end{align\*}
$$
Now $P(x)=0$ iff
$$
2x\pm3=0
\qquad\text{or}\qquad
2x\pm3i=0
$$
iff
$$
x=\pm\frac32
\qquad\text{or}\qquad
x=\pm\f... | The four zeros are $\frac{3}{2},\frac{-3}{2},\frac{3i}{2},\frac{-3i}{2}$
The $n$th root of a number has $n$ answers.
To find each value of the $n$th root of $x$, draw a unit circle. The principal root is simply horizontal. Take that line and rotate it about the origin by increments of $\dfrac{2\pi}{n}$ to get each va... |
942,368 | $$P(x)=16x^4-81$$
I know that this factors out as:
$$P(x)=16(x-\frac { 3 }{ 2 } )^4$$
What I don't understand is the four different zeros of the polynomial...I see one zero which is $\frac { 3 }{ 2 }$ but not the three others. | 2014/09/23 | [
"https://math.stackexchange.com/questions/942368",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/170329/"
] | Try making the substitutions $a=2x$ and $b=3$. Then we have that
$$
16x^4-81=a^4-b^4.
$$
Recalling that $x^2-y^2=(x+y)(x-y)$, we have
$$
a^4-b^4=[a^2-b^2](a^2+b^2)=[(a-b)(a+b)](a^2+b^2)
$$
Plugging $2x$ in for $a$ and $3$ in for $b$ we have
$$
(a-b)(a+b)(a^2+b^2)=(2x-3)(2x+3)((2x)^2+3^2)=(2x-3)(2x+3)(4x^2+9).
$$
If you... | You have to solve the expression $16x^4 - 81 = 0$, and you will get
$$ 16x^4 - 81 = (4x^2 - 9)(4x^2 + 9) = 0 $$
then you will find the other three roots you didn't find. |
942,368 | $$P(x)=16x^4-81$$
I know that this factors out as:
$$P(x)=16(x-\frac { 3 }{ 2 } )^4$$
What I don't understand is the four different zeros of the polynomial...I see one zero which is $\frac { 3 }{ 2 }$ but not the three others. | 2014/09/23 | [
"https://math.stackexchange.com/questions/942368",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/170329/"
] | Recognize $16x^4-81$ as a difference of two squares.
Then factor into linear factors,
$$
\begin{align\*}
P(x)&=16x^4-81\\
&=(4x^2)^2-9^2\\
&=(4x^2-9)(4x^2+9)\\
&=(2x-3)(2x+3)(2x+3i)(2x-3i).
\end{align\*}
$$
Now $P(x)=0$ iff
$$
2x\pm3=0
\qquad\text{or}\qquad
2x\pm3i=0
$$
iff
$$
x=\pm\frac32
\qquad\text{or}\qquad
x=\pm\f... | You have to solve the expression $16x^4 - 81 = 0$, and you will get
$$ 16x^4 - 81 = (4x^2 - 9)(4x^2 + 9) = 0 $$
then you will find the other three roots you didn't find. |
942,368 | $$P(x)=16x^4-81$$
I know that this factors out as:
$$P(x)=16(x-\frac { 3 }{ 2 } )^4$$
What I don't understand is the four different zeros of the polynomial...I see one zero which is $\frac { 3 }{ 2 }$ but not the three others. | 2014/09/23 | [
"https://math.stackexchange.com/questions/942368",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/170329/"
] | Recognize $16x^4-81$ as a difference of two squares.
Then factor into linear factors,
$$
\begin{align\*}
P(x)&=16x^4-81\\
&=(4x^2)^2-9^2\\
&=(4x^2-9)(4x^2+9)\\
&=(2x-3)(2x+3)(2x+3i)(2x-3i).
\end{align\*}
$$
Now $P(x)=0$ iff
$$
2x\pm3=0
\qquad\text{or}\qquad
2x\pm3i=0
$$
iff
$$
x=\pm\frac32
\qquad\text{or}\qquad
x=\pm\f... | Try making the substitutions $a=2x$ and $b=3$. Then we have that
$$
16x^4-81=a^4-b^4.
$$
Recalling that $x^2-y^2=(x+y)(x-y)$, we have
$$
a^4-b^4=[a^2-b^2](a^2+b^2)=[(a-b)(a+b)](a^2+b^2)
$$
Plugging $2x$ in for $a$ and $3$ in for $b$ we have
$$
(a-b)(a+b)(a^2+b^2)=(2x-3)(2x+3)((2x)^2+3^2)=(2x-3)(2x+3)(4x^2+9).
$$
If you... |
48,830,793 | I have a VPC in AWS account and there are 5 subnets associated with that VPC. Subnets are of 2 types - Public and private. How to identify which subnet is public and which is private ? Each subnet has CIDR 10.249.?.? range.
Basically when I launch an EMR in that subnet with lists of ec2SubnetIds , it says
\*\*\*The s... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48830793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1846749/"
] | The question is how to identify public subnets vs. private subnets, and the answer lies in what it means in AWS for a subnet of a VPC to be 'public' vs. 'private'.
Public subnets have a default route to an [Internet Gateway](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html); private sub... | The best solution is to specify only a single subnet, so that you don't incur cross-AZ data charges.
There's no definite way to identify public and private subnets without looking at their routing tables: a public subnet will route to an Internet Gateway, while a private subnet won't. If you're creating your clusters ... |
48,830,793 | I have a VPC in AWS account and there are 5 subnets associated with that VPC. Subnets are of 2 types - Public and private. How to identify which subnet is public and which is private ? Each subnet has CIDR 10.249.?.? range.
Basically when I launch an EMR in that subnet with lists of ec2SubnetIds , it says
\*\*\*The s... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48830793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1846749/"
] | The question is how to identify public subnets vs. private subnets, and the answer lies in what it means in AWS for a subnet of a VPC to be 'public' vs. 'private'.
Public subnets have a default route to an [Internet Gateway](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html); private sub... | I found this to be rather challenging. I hope others find this useful. This approach uses aws cli and jq. As of mid 2021 I'm using current versions of both. To caveat, this is specific to only IPv4, and VPCs with only 1 internet gateway.
From a bash shell start off by identifying the VPC in which you are considering t... |
48,830,793 | I have a VPC in AWS account and there are 5 subnets associated with that VPC. Subnets are of 2 types - Public and private. How to identify which subnet is public and which is private ? Each subnet has CIDR 10.249.?.? range.
Basically when I launch an EMR in that subnet with lists of ec2SubnetIds , it says
\*\*\*The s... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48830793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1846749/"
] | The question is how to identify public subnets vs. private subnets, and the answer lies in what it means in AWS for a subnet of a VPC to be 'public' vs. 'private'.
Public subnets have a default route to an [Internet Gateway](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html); private sub... | I was reading through this user guide [VPC with a single subnet](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Scenario1.html) and found this line helpful.
"A subnet that's associated with a route table that has a route to an internet gateway is known as a public subnet" |
48,830,793 | I have a VPC in AWS account and there are 5 subnets associated with that VPC. Subnets are of 2 types - Public and private. How to identify which subnet is public and which is private ? Each subnet has CIDR 10.249.?.? range.
Basically when I launch an EMR in that subnet with lists of ec2SubnetIds , it says
\*\*\*The s... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48830793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1846749/"
] | The best solution is to specify only a single subnet, so that you don't incur cross-AZ data charges.
There's no definite way to identify public and private subnets without looking at their routing tables: a public subnet will route to an Internet Gateway, while a private subnet won't. If you're creating your clusters ... | I found this to be rather challenging. I hope others find this useful. This approach uses aws cli and jq. As of mid 2021 I'm using current versions of both. To caveat, this is specific to only IPv4, and VPCs with only 1 internet gateway.
From a bash shell start off by identifying the VPC in which you are considering t... |
48,830,793 | I have a VPC in AWS account and there are 5 subnets associated with that VPC. Subnets are of 2 types - Public and private. How to identify which subnet is public and which is private ? Each subnet has CIDR 10.249.?.? range.
Basically when I launch an EMR in that subnet with lists of ec2SubnetIds , it says
\*\*\*The s... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48830793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1846749/"
] | The best solution is to specify only a single subnet, so that you don't incur cross-AZ data charges.
There's no definite way to identify public and private subnets without looking at their routing tables: a public subnet will route to an Internet Gateway, while a private subnet won't. If you're creating your clusters ... | I was reading through this user guide [VPC with a single subnet](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Scenario1.html) and found this line helpful.
"A subnet that's associated with a route table that has a route to an internet gateway is known as a public subnet" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.