qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
22,202,887 | I got the following XML:
```
<Node attr1="value1" attr2="value2">
<SubNode SubAttr1="subValue1" subAttr2="subValue2" />
</Node>
```
I would like to know if there is a way to do a XQuery expression to return only the `<Node>` element.
`<Node attr1="value1" attr2="value2">
<Node>` | 2014/03/05 | [
"https://Stackoverflow.com/questions/22202887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1571185/"
] | I'm sorry you're out of luck here for a general solution – if you're bound to use Microsoft SQL Server, which does not offer computed element constructors with names that are computed on the fly (like @dirkk is using).
When you know that this element is always called "Node", you can do following (using a fixed node na... | You can write a function to do this:
```
declare function local:strip-children($e as element()*) as element()* {
element {node-name($e)} {$e/@*}
};
local:strip-children(/Node)
```
Of course you can also do this without a function like so:
```
element {node-name(/node)} {/Node/@*}
```
So you simply inline the c... |
10,376,380 | I'm using jQuery to open a popup window which works great but I've also have it that the #content div detaches from "parent" page ...
```
$('.newWindow').click(function(ev){
window.open('popout.html','pop out','width=400,height=345');
ev.preventDefault();
$('#content').detach();
return false;
});
```
link used:
`... | 2012/04/29 | [
"https://Stackoverflow.com/questions/10376380",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1359310/"
] | ```
$(document).keydown(function(event) {
if(event.keyCode === 70) {
$.("#myTextarea").css('display','block');
$.('textarea').focus();
return false;
}
```
Basically you need to prevent the default event behavior by return false from the function or calling event.preventDefault().
<http://api.jquery.c... | try this:
```
$(document).keydown(function(event) {
if(event.keyCode === 70) {
$.("#myTextarea").val(" ");
$.("#myTextarea").css('display','block');
$.('textarea').focus();
}
``` |
2,920,424 | In elasticity, the kinetic energy $T$ and the potential energy $V$ are
$$
T(u\_t) = \frac{1}{2}\rho{u\_t}^2 \qquad\text{and}\qquad V(u\_x) = \frac{1}{2} E {u\_x}^2 ,
$$
where $u$ is the displacement, $u\_t$ the velocity, and $u\_x$ the strain. The symbols $\rho>0$ and $E>0$ denote respectively the mass density and Youn... | 2018/09/17 | [
"https://math.stackexchange.com/questions/2920424",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/418542/"
] | In this case you have $q=u$ is a single function of two variables $(x\_1,x\_2)=(t,x)$, so Euler-Lagrange takes the form
$$
\dfrac{\partial\mathcal{L}}{\partial q}=\sum\_{j=1}^{2}\frac{\partial}{\partial x\_j}\left(\frac{\partial\mathcal{L}}{\partial q\_{,j}}\right)
$$
where $q\_{,j}=\dfrac{\partial q}{\partial x\_j}$.
... | After I read some books dedicated to variational calculus, I came up with the following answer, which is perfectly consistent with the accepted answer by @user10354138. From the Lagrangian density $$\mathcal L(u,u\_t,u\_x) = T(u\_t)-V(u\_x)$$ defined in OP, we formulate the principle of stationary action $\delta \mathc... |
31,707,358 | I have a question about §7.3.4/6 in the c++ standard:
>
> If name lookup finds a declaration for a name in two different
> namespaces, and the declarations do not declare the same entity and do
> not declare functions, the use of the name is ill-formed.
>
>
>
Is seems to suggest that there are cases where the s... | 2015/07/29 | [
"https://Stackoverflow.com/questions/31707358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1272610/"
] | Yes, with `extern`. From [dcl.link]:
>
> Two declarations for a function
> with C language linkage with the same function name (ignoring the namespace names that qualify it) that
> appear in different namespace scopes refer to the same function. **Two declarations for a variable with C
> language linkage with the ... | But using declarations do declare names for entities. From the C++11 standard, §7.3.3[namespace.udecl]/1:
>
> A using-declaration introduces a name into the declarative region in which the using-declaration appears.
>
>
>
> >
> > *using-declaration*:
> >
> >
> >
> >
> > >
> > > `using typename`*opt* *neste... |
31,707,358 | I have a question about §7.3.4/6 in the c++ standard:
>
> If name lookup finds a declaration for a name in two different
> namespaces, and the declarations do not declare the same entity and do
> not declare functions, the use of the name is ill-formed.
>
>
>
Is seems to suggest that there are cases where the s... | 2015/07/29 | [
"https://Stackoverflow.com/questions/31707358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1272610/"
] | Yes, with `extern`. From [dcl.link]:
>
> Two declarations for a function
> with C language linkage with the same function name (ignoring the namespace names that qualify it) that
> appear in different namespace scopes refer to the same function. **Two declarations for a variable with C
> language linkage with the ... | ```
namespace A{
void fun(){}
}
namespace B{
void fun(){}
}
int main()
{
using namespace A;
using namespace B;
fun()//ambiguous call here because this entity is present in both the namespaces
}
```
In above code call to fun is ambiguous as look up will not able to find the correct fun to call .
Second example is be... |
31,707,358 | I have a question about §7.3.4/6 in the c++ standard:
>
> If name lookup finds a declaration for a name in two different
> namespaces, and the declarations do not declare the same entity and do
> not declare functions, the use of the name is ill-formed.
>
>
>
Is seems to suggest that there are cases where the s... | 2015/07/29 | [
"https://Stackoverflow.com/questions/31707358",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1272610/"
] | But using declarations do declare names for entities. From the C++11 standard, §7.3.3[namespace.udecl]/1:
>
> A using-declaration introduces a name into the declarative region in which the using-declaration appears.
>
>
>
> >
> > *using-declaration*:
> >
> >
> >
> >
> > >
> > > `using typename`*opt* *neste... | ```
namespace A{
void fun(){}
}
namespace B{
void fun(){}
}
int main()
{
using namespace A;
using namespace B;
fun()//ambiguous call here because this entity is present in both the namespaces
}
```
In above code call to fun is ambiguous as look up will not able to find the correct fun to call .
Second example is be... |
37,793,738 | I´m writing because it´s been really difficult to understand the Jira Development Environment, given that there are many differences between 6.x and 7.x versions and the documentations not always is accurate, as far as I could see as a starter in this platform.
**I´d like to know if someone can help me to create an a... | 2016/06/13 | [
"https://Stackoverflow.com/questions/37793738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6441394/"
] | I received an answer from the Jira Team.
"... when JIRA is up and running, please go to Admin > Applications section and install JIRA Software (Agile) part of JIRA. It brings all development extensions..."
I didn´t know that had to be activated in the version 7 of Jira. There, I could find the Agile package. | JIRA has a lot of history and it shows in its documentation. I'll try to give some pointers.
[This page](https://developer.atlassian.com/jiradev/latest-updates/preparing-for-jira-7-0/jira-7-0-api-changes) lists the API changes between JIRA 6 and 7.
Because JIRA 7 introduced different applications (core, software, se... |
8,727,326 | I'm working on a tracking system which will save a web user's activity to a **database**, it will be a simple system which I want to only intiate a save "when" a user click's on a specific link.
I have found so many applications which have a lot of features such as chart, history and etc. My problem with them is I do... | 2012/01/04 | [
"https://Stackoverflow.com/questions/8727326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/813625/"
] | The regexpr for a 6 digit number is
```
\d{6}
```
Edit:
The code will look like
```
public static String extractDigits(final String in) {
final Pattern p = Pattern.compile( "(\\d{6})" );
final Matcher m = p.matcher( in );
if ( m.find() ) {
return m.group( 0 );
}
return "";
}
``` | Not sure if Java's Regex supports lookarounds. If it does:
```
(?<!\d)\d{6}(?!\d)
```
Edit: it does. (Thanks Bohemian) |
8,727,326 | I'm working on a tracking system which will save a web user's activity to a **database**, it will be a simple system which I want to only intiate a save "when" a user click's on a specific link.
I have found so many applications which have a lot of features such as chart, history and etc. My problem with them is I do... | 2012/01/04 | [
"https://Stackoverflow.com/questions/8727326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/813625/"
] | Not sure if Java's Regex supports lookarounds. If it does:
```
(?<!\d)\d{6}(?!\d)
```
Edit: it does. (Thanks Bohemian) | Why not simply use `substring()`?
```
String s = "Your code: 123456. Your reference number is 012. The total amount is E 1250,00..";
String s2 = s.substring(11);
String code = s2.substring(0, s2.indexOf("."));
```
or just:
```
String code = s.substring(11, 17);
```
since it's always 6 digits. |
8,727,326 | I'm working on a tracking system which will save a web user's activity to a **database**, it will be a simple system which I want to only intiate a save "when" a user click's on a specific link.
I have found so many applications which have a lot of features such as chart, history and etc. My problem with them is I do... | 2012/01/04 | [
"https://Stackoverflow.com/questions/8727326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/813625/"
] | Not sure if Java's Regex supports lookarounds. If it does:
```
(?<!\d)\d{6}(?!\d)
```
Edit: it does. (Thanks Bohemian) | ```
String text = "125432";
String regex = "\\D*\\d{6}\\D*";
Matcher m = Pattern.compile(regex).matcher(text);
if(m.find())
System.out.println(m.group(0).trim().substring(0,6));
``` |
8,727,326 | I'm working on a tracking system which will save a web user's activity to a **database**, it will be a simple system which I want to only intiate a save "when" a user click's on a specific link.
I have found so many applications which have a lot of features such as chart, history and etc. My problem with them is I do... | 2012/01/04 | [
"https://Stackoverflow.com/questions/8727326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/813625/"
] | The regexpr for a 6 digit number is
```
\d{6}
```
Edit:
The code will look like
```
public static String extractDigits(final String in) {
final Pattern p = Pattern.compile( "(\\d{6})" );
final Matcher m = p.matcher( in );
if ( m.find() ) {
return m.group( 0 );
}
return "";
}
``` | Why not simply use `substring()`?
```
String s = "Your code: 123456. Your reference number is 012. The total amount is E 1250,00..";
String s2 = s.substring(11);
String code = s2.substring(0, s2.indexOf("."));
```
or just:
```
String code = s.substring(11, 17);
```
since it's always 6 digits. |
8,727,326 | I'm working on a tracking system which will save a web user's activity to a **database**, it will be a simple system which I want to only intiate a save "when" a user click's on a specific link.
I have found so many applications which have a lot of features such as chart, history and etc. My problem with them is I do... | 2012/01/04 | [
"https://Stackoverflow.com/questions/8727326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/813625/"
] | The regexpr for a 6 digit number is
```
\d{6}
```
Edit:
The code will look like
```
public static String extractDigits(final String in) {
final Pattern p = Pattern.compile( "(\\d{6})" );
final Matcher m = p.matcher( in );
if ( m.find() ) {
return m.group( 0 );
}
return "";
}
``` | ```
String text = "125432";
String regex = "\\D*\\d{6}\\D*";
Matcher m = Pattern.compile(regex).matcher(text);
if(m.find())
System.out.println(m.group(0).trim().substring(0,6));
``` |
8,727,326 | I'm working on a tracking system which will save a web user's activity to a **database**, it will be a simple system which I want to only intiate a save "when" a user click's on a specific link.
I have found so many applications which have a lot of features such as chart, history and etc. My problem with them is I do... | 2012/01/04 | [
"https://Stackoverflow.com/questions/8727326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/813625/"
] | Why not simply use `substring()`?
```
String s = "Your code: 123456. Your reference number is 012. The total amount is E 1250,00..";
String s2 = s.substring(11);
String code = s2.substring(0, s2.indexOf("."));
```
or just:
```
String code = s.substring(11, 17);
```
since it's always 6 digits. | ```
String text = "125432";
String regex = "\\D*\\d{6}\\D*";
Matcher m = Pattern.compile(regex).matcher(text);
if(m.find())
System.out.println(m.group(0).trim().substring(0,6));
``` |
14,364,556 | I am upgrading a project from Rails 2.3.2 to 2.3.15. It appears that `exists?` may now be considered a finder, which means functions such as `after_find` are now callbacks from `exists?`.
In 2.3.2 `exists?` did not trigger a callback to `after_find`. I am having trouble finding a readable changelog other than commits... | 2013/01/16 | [
"https://Stackoverflow.com/questions/14364556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/300041/"
] | For your second question, use the `nonzero()` method. I had to dig through [the source](https://github.com/scipy/scipy/blob/v0.11.0/scipy/sparse/base.py#L415) to find it, since I couldn't find it in any of the reference documentation.
```
def nonzero(self):
"""nonzero indices
Returns a tuple of arrays (row,co... | >
> what does `[0,1:3]` mean?
>
>
>
That means: row 0, elements `1` to `3` (exclusive). Since Numpy and Scipy use zero-based indices, row 0 is the first row and `1:3` denotes the first and second column.
`Asp[0, 1:2,3]` is invalid because you've got three indices, `0`, `1:2` and `3`. Matrices only have two axes.
... |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | When a `Fragment` is made visible (i.e., the selected page in your `ViewPager`), its [setUserVisibleHint()](https://developer.android.com/reference/android/support/v4/app/Fragment.html#setUserVisibleHint(boolean)) method is called. You can override that method in your `TwoFragment` and use it to trigger a refresh.
```... | Try This
```
ViewPager mViewPager = (ViewPager)findViewById(R.id.pager);
mViewPager.setOffscreenPageLimit(2);
``` |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | When a `Fragment` is made visible (i.e., the selected page in your `ViewPager`), its [setUserVisibleHint()](https://developer.android.com/reference/android/support/v4/app/Fragment.html#setUserVisibleHint(boolean)) method is called. You can override that method in your `TwoFragment` and use it to trigger a refresh.
```... | As of 2020 it is advisable to use architecture components(MVVM) such as LiveData and viewModel
This way all Fragments can share the same state
see docs here <https://developer.android.com/jetpack/guide> |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | Try this - it works for me
This code reloads current fragment, when it visible to user. Works when swiping and when back button pressed on next fragment.
```js
@Override
public void setUserVisibleHint(boolean isVisible) {
super.setUserVisibleHint(isVisible);
if (isVisible) {
Fragme... | If you wouldn't mind refreshing every fragment every time a tab changes, you could simply override the `getItemPosition()` method of your FragmentPagerAdapter and make it return always the value `POSITION_NONE`. Example:
```
@Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
```
By doin... |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | Try This
```
ViewPager mViewPager = (ViewPager)findViewById(R.id.pager);
mViewPager.setOffscreenPageLimit(2);
``` | As of 2020 it is advisable to use architecture components(MVVM) such as LiveData and viewModel
This way all Fragments can share the same state
see docs here <https://developer.android.com/jetpack/guide> |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | Try This
```
ViewPager mViewPager = (ViewPager)findViewById(R.id.pager);
mViewPager.setOffscreenPageLimit(2);
``` | you could use ViewPager.addOnPageChangeListener to listen to when the fragments are swiped and incorporate some type of action there. |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | When a `Fragment` is made visible (i.e., the selected page in your `ViewPager`), its [setUserVisibleHint()](https://developer.android.com/reference/android/support/v4/app/Fragment.html#setUserVisibleHint(boolean)) method is called. You can override that method in your `TwoFragment` and use it to trigger a refresh.
```... | Inside Your fragment class use the below code:
```
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser) {
getFragmentManager().beginTransaction().detach(this).attach(this).commit();
}
}
``` |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | Try This
```
ViewPager mViewPager = (ViewPager)findViewById(R.id.pager);
mViewPager.setOffscreenPageLimit(2);
``` | If you wouldn't mind refreshing every fragment every time a tab changes, you could simply override the `getItemPosition()` method of your FragmentPagerAdapter and make it return always the value `POSITION_NONE`. Example:
```
@Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
```
By doin... |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | As of 2020 it is advisable to use architecture components(MVVM) such as LiveData and viewModel
This way all Fragments can share the same state
see docs here <https://developer.android.com/jetpack/guide> | If you wouldn't mind refreshing every fragment every time a tab changes, you could simply override the `getItemPosition()` method of your FragmentPagerAdapter and make it return always the value `POSITION_NONE`. Example:
```
@Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
```
By doin... |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | When a `Fragment` is made visible (i.e., the selected page in your `ViewPager`), its [setUserVisibleHint()](https://developer.android.com/reference/android/support/v4/app/Fragment.html#setUserVisibleHint(boolean)) method is called. You can override that method in your `TwoFragment` and use it to trigger a refresh.
```... | Try this - it works for me
This code reloads current fragment, when it visible to user. Works when swiping and when back button pressed on next fragment.
```js
@Override
public void setUserVisibleHint(boolean isVisible) {
super.setUserVisibleHint(isVisible);
if (isVisible) {
Fragme... |
41,655,797 | App open on first fragment and there is 2 tabs i want to refresh second fragment
when i move to it but i don't want to refresh first fragment
MainActivity
------------
```
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
to... | 2017/01/14 | [
"https://Stackoverflow.com/questions/41655797",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6811388/"
] | Inside Your fragment class use the below code:
```
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser) {
getFragmentManager().beginTransaction().detach(this).attach(this).commit();
}
}
``` | If you wouldn't mind refreshing every fragment every time a tab changes, you could simply override the `getItemPosition()` method of your FragmentPagerAdapter and make it return always the value `POSITION_NONE`. Example:
```
@Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
```
By doin... |
17,854,351 | ```
DECLARE
@A VARCHAR(MAX),
@StartPosistion int,
@StringLen int
Select -- Setting up the strings to split (details)
@StartPosistion = charindex('Eye Colour:', details),
@StringLen = patindex('%'+CHAR(10)+'%',substring(details,@StartPosistion ,len(details)))
FROM
XXX.XXX --Table/Database
SEL... | 2013/07/25 | [
"https://Stackoverflow.com/questions/17854351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1058168/"
] | When You use charindex('Eye Colour:', details) the charindex will return starting postion of Eye Colour, but ideally you need location after Eye coluor so you can just hard code 11+1, 11 being the length of 'Eye Colour:' and Plus 1 for actual starting postion of RED.
can you please give the details of on value so that... | Replace the search string in the results you already have
with "substring(XXX.XXX ,@StartPosistion ,@StringLen-1 ) AS EyeColour" you're getting "Eye Colour: Red"
so around that...
```
Replace (substring(XXX.XXX ,@StartPosistion ,@StringLen-1 ), 'Eye Colour: ', '') AS EyeColourValueOnly
``` |
19,687,959 | I have an object of type `Product` and type `Variant`. `Variant` and `Product` have the same structure, but are two different types, and so I can't make just one method to encompass both. Is it possible to make an extension method that would accept both of these types? | 2013/10/30 | [
"https://Stackoverflow.com/questions/19687959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2316642/"
] | You cannot do that unless `Product` and `Variant` have common base class or interface.
If they have common base class or interface then you can try to write extension method for it e.g.
```
public static void MyMethod(this ICommonInterface obj) {}
```
Otherwise you'll have to create two separate extensions methods.... | You could take advantage of the `dynamic` type:
```
using System.Linq;
class Program
{
static void Main(string[] args)
{
var myList = new object[] {
new Product(){Id=1},
new Variant(){Id=1}
};
Process(myList);
}
static void Process(object[] myList)
... |
19,687,959 | I have an object of type `Product` and type `Variant`. `Variant` and `Product` have the same structure, but are two different types, and so I can't make just one method to encompass both. Is it possible to make an extension method that would accept both of these types? | 2013/10/30 | [
"https://Stackoverflow.com/questions/19687959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2316642/"
] | You cannot do that unless `Product` and `Variant` have common base class or interface.
If they have common base class or interface then you can try to write extension method for it e.g.
```
public static void MyMethod(this ICommonInterface obj) {}
```
Otherwise you'll have to create two separate extensions methods.... | Steve,
Two possible answers to this question from a Commerce Server perspective. Depends on whether you are talking about the Core Systems API or the Commerce Foundation API. I'll address both below:
**OPTION 1 : Commerce Server Core Systems API**
Unfortunately, the two classes Product and Variant DO NOT share a com... |
19,687,959 | I have an object of type `Product` and type `Variant`. `Variant` and `Product` have the same structure, but are two different types, and so I can't make just one method to encompass both. Is it possible to make an extension method that would accept both of these types? | 2013/10/30 | [
"https://Stackoverflow.com/questions/19687959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2316642/"
] | You cannot do that unless `Product` and `Variant` have common base class or interface.
If they have common base class or interface then you can try to write extension method for it e.g.
```
public static void MyMethod(this ICommonInterface obj) {}
```
Otherwise you'll have to create two separate extensions methods.... | You can not change the Product and Variant classes, but you can subclass them and apply a interface to the subclass. This interface can be used for the extension method:
```
using System;
public class Program
{
public static void Main()
{
var p = new MyProduct();
p.Name = "test";
Conso... |
19,687,959 | I have an object of type `Product` and type `Variant`. `Variant` and `Product` have the same structure, but are two different types, and so I can't make just one method to encompass both. Is it possible to make an extension method that would accept both of these types? | 2013/10/30 | [
"https://Stackoverflow.com/questions/19687959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2316642/"
] | Steve,
Two possible answers to this question from a Commerce Server perspective. Depends on whether you are talking about the Core Systems API or the Commerce Foundation API. I'll address both below:
**OPTION 1 : Commerce Server Core Systems API**
Unfortunately, the two classes Product and Variant DO NOT share a com... | You could take advantage of the `dynamic` type:
```
using System.Linq;
class Program
{
static void Main(string[] args)
{
var myList = new object[] {
new Product(){Id=1},
new Variant(){Id=1}
};
Process(myList);
}
static void Process(object[] myList)
... |
19,687,959 | I have an object of type `Product` and type `Variant`. `Variant` and `Product` have the same structure, but are two different types, and so I can't make just one method to encompass both. Is it possible to make an extension method that would accept both of these types? | 2013/10/30 | [
"https://Stackoverflow.com/questions/19687959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2316642/"
] | Steve,
Two possible answers to this question from a Commerce Server perspective. Depends on whether you are talking about the Core Systems API or the Commerce Foundation API. I'll address both below:
**OPTION 1 : Commerce Server Core Systems API**
Unfortunately, the two classes Product and Variant DO NOT share a com... | You can not change the Product and Variant classes, but you can subclass them and apply a interface to the subclass. This interface can be used for the extension method:
```
using System;
public class Program
{
public static void Main()
{
var p = new MyProduct();
p.Name = "test";
Conso... |
22,728,427 | i have android application that display a listview that extends Base Adapter to get image and text.
now i want to add a header section for this list view how to do it ? can anyone help me ???
this is how the list view is shown 
**what i wnat is that... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22728427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3006788/"
] | Simply use the current system time to "undo" the seed by introducing a new unique random seed:
```
set.seed(Sys.time())
```
If you need more precision, consider fetching the [system timestamp by millisecond](https://stackoverflow.com/questions/16548528/linux-command-to-get-time-in-milliseconds) (use R's `system(...,... | set.seed() just works for the first line containing randomly sample, and will not influence the next following command. If you want it to work for the other lines, you must call the set.seed function with the same "seed"-the parameter. |
22,728,427 | i have android application that display a listview that extends Base Adapter to get image and text.
now i want to add a header section for this list view how to do it ? can anyone help me ???
this is how the list view is shown 
**what i wnat is that... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22728427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3006788/"
] | Simply use the current system time to "undo" the seed by introducing a new unique random seed:
```
set.seed(Sys.time())
```
If you need more precision, consider fetching the [system timestamp by millisecond](https://stackoverflow.com/questions/16548528/linux-command-to-get-time-in-milliseconds) (use R's `system(...,... | set.seed() only works for the next execution. so what you want is already happening.
see this example
```
set.seed(12)
sample(1:15, 5)
```
[1] 2 12 13 4 15
```
sample(1:15, 5) # run the same code again you will see different results
```
[1] 1 3 9 15 12
```
set.seed(12)#set seed again to see first set of results... |
22,728,427 | i have android application that display a listview that extends Base Adapter to get image and text.
now i want to add a header section for this list view how to do it ? can anyone help me ???
this is how the list view is shown 
**what i wnat is that... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22728427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3006788/"
] | Simply use the current system time to "undo" the seed by introducing a new unique random seed:
```
set.seed(Sys.time())
```
If you need more precision, consider fetching the [system timestamp by millisecond](https://stackoverflow.com/questions/16548528/linux-command-to-get-time-in-milliseconds) (use R's `system(...,... | ```
set.seed(NULL)
```
See help documents - `?set.seed`:
>
> "If called with seed = NULL it re-initializes (see ‘Note’) as if no seed had yet been set."
>
>
> |
22,728,427 | i have android application that display a listview that extends Base Adapter to get image and text.
now i want to add a header section for this list view how to do it ? can anyone help me ???
this is how the list view is shown 
**what i wnat is that... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22728427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3006788/"
] | set.seed() only works for the next execution. so what you want is already happening.
see this example
```
set.seed(12)
sample(1:15, 5)
```
[1] 2 12 13 4 15
```
sample(1:15, 5) # run the same code again you will see different results
```
[1] 1 3 9 15 12
```
set.seed(12)#set seed again to see first set of results... | set.seed() just works for the first line containing randomly sample, and will not influence the next following command. If you want it to work for the other lines, you must call the set.seed function with the same "seed"-the parameter. |
22,728,427 | i have android application that display a listview that extends Base Adapter to get image and text.
now i want to add a header section for this list view how to do it ? can anyone help me ???
this is how the list view is shown 
**what i wnat is that... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22728427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3006788/"
] | ```
set.seed(NULL)
```
See help documents - `?set.seed`:
>
> "If called with seed = NULL it re-initializes (see ‘Note’) as if no seed had yet been set."
>
>
> | set.seed() just works for the first line containing randomly sample, and will not influence the next following command. If you want it to work for the other lines, you must call the set.seed function with the same "seed"-the parameter. |
22,728,427 | i have android application that display a listview that extends Base Adapter to get image and text.
now i want to add a header section for this list view how to do it ? can anyone help me ???
this is how the list view is shown 
**what i wnat is that... | 2014/03/29 | [
"https://Stackoverflow.com/questions/22728427",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3006788/"
] | ```
set.seed(NULL)
```
See help documents - `?set.seed`:
>
> "If called with seed = NULL it re-initializes (see ‘Note’) as if no seed had yet been set."
>
>
> | set.seed() only works for the next execution. so what you want is already happening.
see this example
```
set.seed(12)
sample(1:15, 5)
```
[1] 2 12 13 4 15
```
sample(1:15, 5) # run the same code again you will see different results
```
[1] 1 3 9 15 12
```
set.seed(12)#set seed again to see first set of results... |
5,889,160 | I am currently trying to check my db table to see if a user's level is equal to or less than 10, if so then show an entire html list, if not and is equal or less than 5 show only the remaining part of the list. Here's where I started:
```
<?php
$levels = mysql_query("SELECT level FROM users");
if ($levels <= 10) {
... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5889160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726082/"
] | Try this:
```
<?php if ($levels <= 5): ?>
html list
<?php elseif ($levels <= 10): ?>
html list
<?php endif; ?>
```
As [David Fells said](https://stackoverflow.com/questions/5889160/php-if-statment-for-showing-certain-blocks-of-html/5889185#5889185), make sure you are getting a result first :)
**EDIT**: I misrea... | You need to ask for the levels <= 5 before levels <= 10, because levels <= 10 will always find levels <= 5. |
5,889,160 | I am currently trying to check my db table to see if a user's level is equal to or less than 10, if so then show an entire html list, if not and is equal or less than 5 show only the remaining part of the list. Here's where I started:
```
<?php
$levels = mysql_query("SELECT level FROM users");
if ($levels <= 10) {
... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5889160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726082/"
] | Try this:
```
<?php if ($levels <= 5): ?>
html list
<?php elseif ($levels <= 10): ?>
html list
<?php endif; ?>
```
As [David Fells said](https://stackoverflow.com/questions/5889160/php-if-statment-for-showing-certain-blocks-of-html/5889185#5889185), make sure you are getting a result first :)
**EDIT**: I misrea... | The code has lots of bugs-
Firstly,
```
$levels = mysql_query("SELECT level FROM users");
```
returns an array with levels of all the users. You want to query specific user's level using WHERE clause.
Next , when you want to differentiate between <=5 and btween 5 &10, u need to use either of the methods
```
if($l... |
5,889,160 | I am currently trying to check my db table to see if a user's level is equal to or less than 10, if so then show an entire html list, if not and is equal or less than 5 show only the remaining part of the list. Here's where I started:
```
<?php
$levels = mysql_query("SELECT level FROM users");
if ($levels <= 10) {
... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5889160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726082/"
] | ```
$result = mysql_query(sprintf("SELECT level FROM users WHERE user_id = %d", $current_user_id));
if (list($level) = mysql_fetch_array($result)) {
if ($level <= 5) {
// whatever
}
elseif ($level <= 10) {
// whatever
}
else {
// whatever
}
}
```
Does that clear it up at all? You need to supp... | You need to ask for the levels <= 5 before levels <= 10, because levels <= 10 will always find levels <= 5. |
5,889,160 | I am currently trying to check my db table to see if a user's level is equal to or less than 10, if so then show an entire html list, if not and is equal or less than 5 show only the remaining part of the list. Here's where I started:
```
<?php
$levels = mysql_query("SELECT level FROM users");
if ($levels <= 10) {
... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5889160",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/726082/"
] | ```
$result = mysql_query(sprintf("SELECT level FROM users WHERE user_id = %d", $current_user_id));
if (list($level) = mysql_fetch_array($result)) {
if ($level <= 5) {
// whatever
}
elseif ($level <= 10) {
// whatever
}
else {
// whatever
}
}
```
Does that clear it up at all? You need to supp... | The code has lots of bugs-
Firstly,
```
$levels = mysql_query("SELECT level FROM users");
```
returns an array with levels of all the users. You want to query specific user's level using WHERE clause.
Next , when you want to differentiate between <=5 and btween 5 &10, u need to use either of the methods
```
if($l... |
41,238,403 | I am using Hazelast Map and trying to store Objects against key which is object of my custom class i.e. `HMapKey`. Here is snippet of `HMapKey` class.
```
public class HMapKey implements Serializable{
private String keyCode;
private long time;
public HMapKey(String keyCode, long time) {
this.keyCode... | 2016/12/20 | [
"https://Stackoverflow.com/questions/41238403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2074626/"
] | First of all, I don't know what you're trying to do when you say "I try to retrieve it".
If you use your key as in the get method everything works fine:
```
@Test
public void test() {
HazelcastInstance hz = createHazelcastInstance();
IMap<HMapKey, Integer> map = hz.getMap("aaa");
HMapKey key = new HMapKe... | Hazelcast does not deserialize the keys / values and executes `equals` or `hashCode` methods but compares the serialized objects by their corresponding bytestream. If you're searching for one or more properties, please see the answer from Tom <https://stackoverflow.com/a/41238649/917336> |
41,238,403 | I am using Hazelast Map and trying to store Objects against key which is object of my custom class i.e. `HMapKey`. Here is snippet of `HMapKey` class.
```
public class HMapKey implements Serializable{
private String keyCode;
private long time;
public HMapKey(String keyCode, long time) {
this.keyCode... | 2016/12/20 | [
"https://Stackoverflow.com/questions/41238403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2074626/"
] | You can achieve that by declaring variable `time` as `transient`. But note that it will lead to collisions and give random results. Your put operation would overwrite the previous value even though it's properties are different.
```
HazelcastInstance instance = Hazelcast.newHazelcastInstance();
IMap<HMapKey, String> ... | Hazelcast does not deserialize the keys / values and executes `equals` or `hashCode` methods but compares the serialized objects by their corresponding bytestream. If you're searching for one or more properties, please see the answer from Tom <https://stackoverflow.com/a/41238649/917336> |
9,456,111 | As I read from [android sample](http://developer.android.com/resources/tutorials/notepad/index.html), if I use SimpleCursorAdapter, it automatically set the id of list view to primary key of the table, so if I call the following event :
```
protected void onListItemClick(ListView l, View v, int position, long id)
{
... | 2012/02/26 | [
"https://Stackoverflow.com/questions/9456111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178643/"
] | As your `List<T>` consists of custom data container objects, you just have to add a method such as `getPrimaryKey()` to that data container class. Now, in the method `onListItemClicked`, you can easily read that key by doing
```
DataContainer dataContainer = myDataList.get(position);
int primaryKey = dataContainer.get... | Extend CursorAdapter instead of ArrayAdapter. Then override bindView and newView to implement custom logic and behaviour. |
24,067,201 | I'm trying to use OpenAL for an IOS game I'm working on, but having an issue opening the audio device. Specifically, when I call the function alcOpenDevice(NULL), I get 'NULL' in return. This is causing issues, of course, but I can't tell what I'm doing wrong.
I'm new to OpenAL, so I've been looking at a couple guides... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24067201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1320607/"
] | [This SO answer](https://stackoverflow.com/questions/4201220/openal-initialization-problem-ipod-only) seems to validate my comment about `AVAudioSession` conflicting with OpenAL. Try removing `AVAudioSession`, or initializing OpenAL first (tho I imagine this would cause the inverse problem). | Alright, so I ended up starting over in a fresh project with a copy-pasted version of AudioSamplePlayer from the first sample project I linked. -It worked.
I then edited it step by step back to the format I had set up in my project. -It still works!
I still don't know what I did wrong the first time, and I'm not sure... |
24,067,201 | I'm trying to use OpenAL for an IOS game I'm working on, but having an issue opening the audio device. Specifically, when I call the function alcOpenDevice(NULL), I get 'NULL' in return. This is causing issues, of course, but I can't tell what I'm doing wrong.
I'm new to OpenAL, so I've been looking at a couple guides... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24067201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1320607/"
] | **The Short Answer:**
Apple's implementation of `alcOpenDevice()` only returns the device once. Every subsequent call returns NULL. This function can be called by a lot of Apple audio code, so take out EVERY TRACE of audio code before using OpenAL and manually calling that function yourself.
**The Long Answer:**
I s... | [This SO answer](https://stackoverflow.com/questions/4201220/openal-initialization-problem-ipod-only) seems to validate my comment about `AVAudioSession` conflicting with OpenAL. Try removing `AVAudioSession`, or initializing OpenAL first (tho I imagine this would cause the inverse problem). |
24,067,201 | I'm trying to use OpenAL for an IOS game I'm working on, but having an issue opening the audio device. Specifically, when I call the function alcOpenDevice(NULL), I get 'NULL' in return. This is causing issues, of course, but I can't tell what I'm doing wrong.
I'm new to OpenAL, so I've been looking at a couple guides... | 2014/06/05 | [
"https://Stackoverflow.com/questions/24067201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1320607/"
] | **The Short Answer:**
Apple's implementation of `alcOpenDevice()` only returns the device once. Every subsequent call returns NULL. This function can be called by a lot of Apple audio code, so take out EVERY TRACE of audio code before using OpenAL and manually calling that function yourself.
**The Long Answer:**
I s... | Alright, so I ended up starting over in a fresh project with a copy-pasted version of AudioSamplePlayer from the first sample project I linked. -It worked.
I then edited it step by step back to the format I had set up in my project. -It still works!
I still don't know what I did wrong the first time, and I'm not sure... |
17,217,266 | I am trying to group results that I am getting from store to be displayed inside ComboBox .
I have a combobox that looks like this:

and I need it to look like this :

That means... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17217266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035712/"
] | Please, you can get this done using a Grid to Render your combobox content. Refer to this post: <http://www.sencha.com/forum/showthread.php?132328-CLOSED-ComboBox-using-Grid-instead-of-BoundList>
Following the article I was able to create this:
 | That is the code the worked for me:
If you are using Sencha Architect, add the createPicker inside an Override and manually create the listConfig as an Object.
```
{
xtype: 'combobox',
createPicker: function() {
var me = this,
picker,
menuCls = Ext.baseCSSPrefix + 'menu',
... |
17,217,266 | I am trying to group results that I am getting from store to be displayed inside ComboBox .
I have a combobox that looks like this:

and I need it to look like this :

That means... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17217266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035712/"
] | Please, you can get this done using a Grid to Render your combobox content. Refer to this post: <http://www.sencha.com/forum/showthread.php?132328-CLOSED-ComboBox-using-Grid-instead-of-BoundList>
Following the article I was able to create this:
 | I've implemented my own version of the combo with a grid as its list component. You can get it on [GitHub](https://github.com/rixo/GridPicker), and I've put some [examples online](http://planysphere.fr/ext/GridPicker/examples/).
The 3rd example closely matches what you're trying to achieve.
Here's an example that wou... |
17,217,266 | I am trying to group results that I am getting from store to be displayed inside ComboBox .
I have a combobox that looks like this:

and I need it to look like this :

That means... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17217266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035712/"
] | I wanted a much simpler solution, so I'll share what I came up with.
For my purposes, I had a `key` that I wanted to group on, which is a single character. I knew the headers I wanted to show for each key, so I pre-sorted the list to make sure the types came together, and then I just render a group header each time I ... | Please, you can get this done using a Grid to Render your combobox content. Refer to this post: <http://www.sencha.com/forum/showthread.php?132328-CLOSED-ComboBox-using-Grid-instead-of-BoundList>
Following the article I was able to create this:
 |
17,217,266 | I am trying to group results that I am getting from store to be displayed inside ComboBox .
I have a combobox that looks like this:

and I need it to look like this :

That means... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17217266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035712/"
] | This is an extension that improves on Sean Adkinson answer above by making a reusable component from his code.
I have had mixed results with replacing BoundList with a GridPanel with Ext 5.0.1 there for this is what I used.
One caveat it does not support collapsing the groups but it works great for me.
Tested in Ex... | Please, you can get this done using a Grid to Render your combobox content. Refer to this post: <http://www.sencha.com/forum/showthread.php?132328-CLOSED-ComboBox-using-Grid-instead-of-BoundList>
Following the article I was able to create this:
 |
17,217,266 | I am trying to group results that I am getting from store to be displayed inside ComboBox .
I have a combobox that looks like this:

and I need it to look like this :

That means... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17217266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035712/"
] | I wanted a much simpler solution, so I'll share what I came up with.
For my purposes, I had a `key` that I wanted to group on, which is a single character. I knew the headers I wanted to show for each key, so I pre-sorted the list to make sure the types came together, and then I just render a group header each time I ... | That is the code the worked for me:
If you are using Sencha Architect, add the createPicker inside an Override and manually create the listConfig as an Object.
```
{
xtype: 'combobox',
createPicker: function() {
var me = this,
picker,
menuCls = Ext.baseCSSPrefix + 'menu',
... |
17,217,266 | I am trying to group results that I am getting from store to be displayed inside ComboBox .
I have a combobox that looks like this:

and I need it to look like this :

That means... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17217266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035712/"
] | This is an extension that improves on Sean Adkinson answer above by making a reusable component from his code.
I have had mixed results with replacing BoundList with a GridPanel with Ext 5.0.1 there for this is what I used.
One caveat it does not support collapsing the groups but it works great for me.
Tested in Ex... | That is the code the worked for me:
If you are using Sencha Architect, add the createPicker inside an Override and manually create the listConfig as an Object.
```
{
xtype: 'combobox',
createPicker: function() {
var me = this,
picker,
menuCls = Ext.baseCSSPrefix + 'menu',
... |
17,217,266 | I am trying to group results that I am getting from store to be displayed inside ComboBox .
I have a combobox that looks like this:

and I need it to look like this :

That means... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17217266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035712/"
] | I wanted a much simpler solution, so I'll share what I came up with.
For my purposes, I had a `key` that I wanted to group on, which is a single character. I knew the headers I wanted to show for each key, so I pre-sorted the list to make sure the types came together, and then I just render a group header each time I ... | I've implemented my own version of the combo with a grid as its list component. You can get it on [GitHub](https://github.com/rixo/GridPicker), and I've put some [examples online](http://planysphere.fr/ext/GridPicker/examples/).
The 3rd example closely matches what you're trying to achieve.
Here's an example that wou... |
17,217,266 | I am trying to group results that I am getting from store to be displayed inside ComboBox .
I have a combobox that looks like this:

and I need it to look like this :

That means... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17217266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035712/"
] | This is an extension that improves on Sean Adkinson answer above by making a reusable component from his code.
I have had mixed results with replacing BoundList with a GridPanel with Ext 5.0.1 there for this is what I used.
One caveat it does not support collapsing the groups but it works great for me.
Tested in Ex... | I've implemented my own version of the combo with a grid as its list component. You can get it on [GitHub](https://github.com/rixo/GridPicker), and I've put some [examples online](http://planysphere.fr/ext/GridPicker/examples/).
The 3rd example closely matches what you're trying to achieve.
Here's an example that wou... |
17,217,266 | I am trying to group results that I am getting from store to be displayed inside ComboBox .
I have a combobox that looks like this:

and I need it to look like this :

That means... | 2013/06/20 | [
"https://Stackoverflow.com/questions/17217266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1035712/"
] | I wanted a much simpler solution, so I'll share what I came up with.
For my purposes, I had a `key` that I wanted to group on, which is a single character. I knew the headers I wanted to show for each key, so I pre-sorted the list to make sure the types came together, and then I just render a group header each time I ... | This is an extension that improves on Sean Adkinson answer above by making a reusable component from his code.
I have had mixed results with replacing BoundList with a GridPanel with Ext 5.0.1 there for this is what I used.
One caveat it does not support collapsing the groups but it works great for me.
Tested in Ex... |
46,998,985 | HTML:
```
<form>
<div class="form-group">
<label for="vorname">Vorname</label>
<input type="text" class="form-control" id="vorname" onkeyup="createLoginName();" placeholder="">
</div>
<div class="form-group">
<label for="nachname">Nachname</label>
<input type="text" class="form-c... | 2017/10/29 | [
"https://Stackoverflow.com/questions/46998985",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8582176/"
] | I would phrase this as:
```
INSERT INTO temp_Log (?, ?) -- put the column names here
SELECT dq1.RowID,
(CASE WHEN MIN(dq1.Action) = MAX(d1.Action) THEN MIN(dq1.Action)
WHEN SUM(dq1.Action = 'Allow') > 0 AND SUM(dq1.Action = 'Reject') > 0 THEN 'Reject'
WHEN SUM(dq1.Acti... | If it's not possible that a Row\_ID has Allow as Action more than once, then following query should work:
```
INSERT INTO temp_Log
(SELECT distinct RowID,Action
FROM DQLog
Where Action = 'Reject'
UNION ALL
SELECT distinct RowID,Action
FROM DQLog
Where Action = 'Fix'
And RowID not in (Select d... |
41,487,598 | I have a client with a Azure subscription sitting in a US GOV data center. This subscription is under an EA (not pay-as-you-go).
Attempting to use the standard billing APIs (ratecard and usage) fails with a 'Subscription not found' error. I.e. running the following:
```
https://management.azure.com/subscriptions/[su... | 2017/01/05 | [
"https://Stackoverflow.com/questions/41487598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7379668/"
] | I don't have any experience with the Gov environment, but otherwise my experience is that Resource Usage API also works for EA, whereas the RateCard does not.
I would suggest you to start out with the powershell cmdlets for an easy start
\* *Get-AzureRmUsage*
<https://learn.microsoft.com/en-us/powershell/resourcemanage... | For EA offer IDs, you need to use the following API:
>
> <https://consumption.azure.com/v2/enrollments/(enrollment_id)/pricesheet>
>
>
>
You will need to provide EA API Key (different than bearer token from other APIs):
>
> curl -X GET <https://consumption.azure.com/v2/enrollments/(enrollment_id)/pricesheet> -H... |
54,667,290 | On the app that I develop I want to have english and greek in debug mode (because I don't speak greek and the app is for Greece) and only Greek when when in release( because I have a requirement to only support Greek and no english when the app is released).
So, does anyone know how can I do this in iOS? | 2019/02/13 | [
"https://Stackoverflow.com/questions/54667290",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4915700/"
] | As you have a timestamp column it's probably better to use `systimestamp` instead of `sysdate`, and add an interval rather than a fraction of a day - which would lose the fractional second precision (and time zone, if your column actually stores that too).
You would either just have a date (if you use `sysdate + 30/14... | you can create a trigger as shown below. this will insert current timestamp+30 minutes each time you insert a row to the table.
```
create or replace trigger before_insert
before insert
on table_name for each row
declare
v_time date;
begin
select sysdate+30/1440 into v_time from dual;
:new.cur_time :=v_time;
end;
... |
54,156,313 | For example: in this repo, <https://github.com/evancz/elm-architecture-tutorial/> , how do I load one of the Elm files into elm repl, so I can evaluate functions, look at type signatures, etc ?
In Haskell I would use :l | 2019/01/12 | [
"https://Stackoverflow.com/questions/54156313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9325070/"
] | Unfortunately the examples on the GitHub link don't expose anything, so you cannot import from them as-is. Since you have access to source code you can of course modify the sources to support this, so read on :)
In general, it is done in repl by using command `import`
>
> import SomeModule exposing (fun1, fun2)
>
>... | This would be better placed as a comment on kaskelotti's good answer above, but in order to have the module in a different folder from where you start the repl, you can update the `elm.json` file associated with your project, adding "YOUR\_DESIRED\_DIRECTORY" to the "source-directories" array.
Also note that the filen... |
36,533 | I have a cast iron skillet and one of the guests coming for dinner is vegan. Since cast iron is seasoned by all kinds of grease over time I wonder if this is suitable for vegans. I don't want to offend anyone or witness some drama. | 2013/09/04 | [
"https://cooking.stackexchange.com/questions/36533",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/15020/"
] | A vegan is not going to eat your pan, just the food that was made on it. As no animals were harmed in the making of your pan (well, probably but how would you know) the pan itself wouldn't be an issue. Of course if a tiny bit of pan seasoning could go into the food, however anything else used in the preparation of the ... | You'd have to ask your vegan to be absolutely sure. If they're practical, they'll acknowledge that there might be a bit of meat fat polymerized onto the pan but they won't be actually eating it, as long as you've seasoned and cleaned well. If however they're sufficiently strict, they could conceivably say, no, it's tou... |
36,533 | I have a cast iron skillet and one of the guests coming for dinner is vegan. Since cast iron is seasoned by all kinds of grease over time I wonder if this is suitable for vegans. I don't want to offend anyone or witness some drama. | 2013/09/04 | [
"https://cooking.stackexchange.com/questions/36533",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/15020/"
] | You'd have to ask your vegan to be absolutely sure. If they're practical, they'll acknowledge that there might be a bit of meat fat polymerized onto the pan but they won't be actually eating it, as long as you've seasoned and cleaned well. If however they're sufficiently strict, they could conceivably say, no, it's tou... | I am a vegetarian and I am totally put off by the idea of seasoned pans that don't get cleaned with soap and water. One of the reasons I am a vegetarian is because I consider meat to be unclean (not a religious objection, just my own many-years' judgment), and I won't eat out of a pan I would consider uncleaned, which ... |
36,533 | I have a cast iron skillet and one of the guests coming for dinner is vegan. Since cast iron is seasoned by all kinds of grease over time I wonder if this is suitable for vegans. I don't want to offend anyone or witness some drama. | 2013/09/04 | [
"https://cooking.stackexchange.com/questions/36533",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/15020/"
] | You'd have to ask your vegan to be absolutely sure. If they're practical, they'll acknowledge that there might be a bit of meat fat polymerized onto the pan but they won't be actually eating it, as long as you've seasoned and cleaned well. If however they're sufficiently strict, they could conceivably say, no, it's tou... | What people seem to be missing in some of these answers is that some people will become very ill upon eating trace amounts of animal material. Ask you guest if it is suitable or inform your guest of your intent so they can decide for themselves if they would like to eat your food.
There's no dishonor in asking the que... |
36,533 | I have a cast iron skillet and one of the guests coming for dinner is vegan. Since cast iron is seasoned by all kinds of grease over time I wonder if this is suitable for vegans. I don't want to offend anyone or witness some drama. | 2013/09/04 | [
"https://cooking.stackexchange.com/questions/36533",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/15020/"
] | You'd have to ask your vegan to be absolutely sure. If they're practical, they'll acknowledge that there might be a bit of meat fat polymerized onto the pan but they won't be actually eating it, as long as you've seasoned and cleaned well. If however they're sufficiently strict, they could conceivably say, no, it's tou... | I've only been a vegetarian for a little over 3 years. My roommate used a cast-iron skillet with vegetarian-appropriate seasoning to fry burgers. I thought I could handle it, but when the meat was cooking, and for several hours afterward, the smell of the cooked meat was literally disgusting. I am most surprised at mys... |
36,533 | I have a cast iron skillet and one of the guests coming for dinner is vegan. Since cast iron is seasoned by all kinds of grease over time I wonder if this is suitable for vegans. I don't want to offend anyone or witness some drama. | 2013/09/04 | [
"https://cooking.stackexchange.com/questions/36533",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/15020/"
] | A vegan is not going to eat your pan, just the food that was made on it. As no animals were harmed in the making of your pan (well, probably but how would you know) the pan itself wouldn't be an issue. Of course if a tiny bit of pan seasoning could go into the food, however anything else used in the preparation of the ... | I am a vegetarian and I am totally put off by the idea of seasoned pans that don't get cleaned with soap and water. One of the reasons I am a vegetarian is because I consider meat to be unclean (not a religious objection, just my own many-years' judgment), and I won't eat out of a pan I would consider uncleaned, which ... |
36,533 | I have a cast iron skillet and one of the guests coming for dinner is vegan. Since cast iron is seasoned by all kinds of grease over time I wonder if this is suitable for vegans. I don't want to offend anyone or witness some drama. | 2013/09/04 | [
"https://cooking.stackexchange.com/questions/36533",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/15020/"
] | A vegan is not going to eat your pan, just the food that was made on it. As no animals were harmed in the making of your pan (well, probably but how would you know) the pan itself wouldn't be an issue. Of course if a tiny bit of pan seasoning could go into the food, however anything else used in the preparation of the ... | What people seem to be missing in some of these answers is that some people will become very ill upon eating trace amounts of animal material. Ask you guest if it is suitable or inform your guest of your intent so they can decide for themselves if they would like to eat your food.
There's no dishonor in asking the que... |
36,533 | I have a cast iron skillet and one of the guests coming for dinner is vegan. Since cast iron is seasoned by all kinds of grease over time I wonder if this is suitable for vegans. I don't want to offend anyone or witness some drama. | 2013/09/04 | [
"https://cooking.stackexchange.com/questions/36533",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/15020/"
] | A vegan is not going to eat your pan, just the food that was made on it. As no animals were harmed in the making of your pan (well, probably but how would you know) the pan itself wouldn't be an issue. Of course if a tiny bit of pan seasoning could go into the food, however anything else used in the preparation of the ... | I've only been a vegetarian for a little over 3 years. My roommate used a cast-iron skillet with vegetarian-appropriate seasoning to fry burgers. I thought I could handle it, but when the meat was cooking, and for several hours afterward, the smell of the cooked meat was literally disgusting. I am most surprised at mys... |
36,533 | I have a cast iron skillet and one of the guests coming for dinner is vegan. Since cast iron is seasoned by all kinds of grease over time I wonder if this is suitable for vegans. I don't want to offend anyone or witness some drama. | 2013/09/04 | [
"https://cooking.stackexchange.com/questions/36533",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/15020/"
] | I am a vegetarian and I am totally put off by the idea of seasoned pans that don't get cleaned with soap and water. One of the reasons I am a vegetarian is because I consider meat to be unclean (not a religious objection, just my own many-years' judgment), and I won't eat out of a pan I would consider uncleaned, which ... | What people seem to be missing in some of these answers is that some people will become very ill upon eating trace amounts of animal material. Ask you guest if it is suitable or inform your guest of your intent so they can decide for themselves if they would like to eat your food.
There's no dishonor in asking the que... |
36,533 | I have a cast iron skillet and one of the guests coming for dinner is vegan. Since cast iron is seasoned by all kinds of grease over time I wonder if this is suitable for vegans. I don't want to offend anyone or witness some drama. | 2013/09/04 | [
"https://cooking.stackexchange.com/questions/36533",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/15020/"
] | I've only been a vegetarian for a little over 3 years. My roommate used a cast-iron skillet with vegetarian-appropriate seasoning to fry burgers. I thought I could handle it, but when the meat was cooking, and for several hours afterward, the smell of the cooked meat was literally disgusting. I am most surprised at mys... | What people seem to be missing in some of these answers is that some people will become very ill upon eating trace amounts of animal material. Ask you guest if it is suitable or inform your guest of your intent so they can decide for themselves if they would like to eat your food.
There's no dishonor in asking the que... |
249,353 | Suppose that $f\in L^1(0,+\infty)$ is a monotone decreasing, positive function. Prove that $$\lim\_{x \to +\infty}x(\log x)\cdot f(x)=0.$$ | 2012/12/02 | [
"https://math.stackexchange.com/questions/249353",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/84067/"
] | The assertion is not true. Consider
$$
f\_0=\sum\limits\_{n\geqslant1}(n^2\mathrm e^{n^2})^{-1}\mathbf 1\_{[0,\mathrm e^{n^2}]},
$$
then $f\_0$ is nonincreasing, $g\_0(x)=f\_0(x)x\log(x)$ does not converge to zero when $x\to\infty$ since $g\_0(\mathrm e^{n^2})\geqslant1$ for every $n\geqslant1$, and the integral of $f... | I think it's not true, for example $f(x)=1/x$
and we have
$\lim\_{x\rightarrow 0}xln(x)(1/x)=+\infty$ |
249,353 | Suppose that $f\in L^1(0,+\infty)$ is a monotone decreasing, positive function. Prove that $$\lim\_{x \to +\infty}x(\log x)\cdot f(x)=0.$$ | 2012/12/02 | [
"https://math.stackexchange.com/questions/249353",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/84067/"
] | The assertion is not true. Consider
$$
f\_0=\sum\limits\_{n\geqslant1}(n^2\mathrm e^{n^2})^{-1}\mathbf 1\_{[0,\mathrm e^{n^2}]},
$$
then $f\_0$ is nonincreasing, $g\_0(x)=f\_0(x)x\log(x)$ does not converge to zero when $x\to\infty$ since $g\_0(\mathrm e^{n^2})\geqslant1$ for every $n\geqslant1$, and the integral of $f... | Edit: This argument assumes that the limit exists, which need not happen.
A change of variables gives, for $a>1$,
$$
\int\_{a}^{\infty} \frac{dx}{xln(x)} = \int\_{\ln(a)}^{\infty} \frac{du}{u} =\infty
$$
If the limit was not zero, call it $L$ (admitting $L=\infty$), we would get, for $x>a$ (with $a$ large enough) $f(x... |
2,300,081 | I am writing a plugin and need to live bind a click. The plugin works fine when I do a normal click bind, but not a live bind.
I've boiled the plugin down to the basics:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).live('click', function(){
console.log(... | 2010/02/19 | [
"https://Stackoverflow.com/questions/2300081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74552/"
] | After thinking this through, I realized it makes no sense to call `live` on an existing DOM element because it's already in the DOM.
Trick is to use `live` when invoking the plugin:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).click(function(){
console.... | Any particular reason you have 2 `click` event binded into a single object? The second bind will overwrite the `live` bind, so the `live` will never fired. |
2,300,081 | I am writing a plugin and need to live bind a click. The plugin works fine when I do a normal click bind, but not a live bind.
I've boiled the plugin down to the basics:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).live('click', function(){
console.log(... | 2010/02/19 | [
"https://Stackoverflow.com/questions/2300081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74552/"
] | Any particular reason you have 2 `click` event binded into a single object? The second bind will overwrite the `live` bind, so the `live` will never fired. | I think it's not a good point of view.
Now suppose that your plugin is a sort of lightbox,and it is looking to anchor elements inside the DOM.
Usually at the dom ready you will do something like
```
$(dom_elements).myplugin();
```
What if your appending some links via jsor ajax to your page?
I don't think that rebin... |
2,300,081 | I am writing a plugin and need to live bind a click. The plugin works fine when I do a normal click bind, but not a live bind.
I've boiled the plugin down to the basics:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).live('click', function(){
console.log(... | 2010/02/19 | [
"https://Stackoverflow.com/questions/2300081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74552/"
] | this works without workarounds outside of the plugin:
```
(function ($) {
$.fn.liveBindTest = function () {
return this['live']('click', function () {
console.log('click');
return false;
});
};
})(jQuery);
$('a').liveBindTest();
``` | Any particular reason you have 2 `click` event binded into a single object? The second bind will overwrite the `live` bind, so the `live` will never fired. |
2,300,081 | I am writing a plugin and need to live bind a click. The plugin works fine when I do a normal click bind, but not a live bind.
I've boiled the plugin down to the basics:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).live('click', function(){
console.log(... | 2010/02/19 | [
"https://Stackoverflow.com/questions/2300081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74552/"
] | After thinking this through, I realized it makes no sense to call `live` on an existing DOM element because it's already in the DOM.
Trick is to use `live` when invoking the plugin:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).click(function(){
console.... | I think it's not a good point of view.
Now suppose that your plugin is a sort of lightbox,and it is looking to anchor elements inside the DOM.
Usually at the dom ready you will do something like
```
$(dom_elements).myplugin();
```
What if your appending some links via jsor ajax to your page?
I don't think that rebin... |
2,300,081 | I am writing a plugin and need to live bind a click. The plugin works fine when I do a normal click bind, but not a live bind.
I've boiled the plugin down to the basics:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).live('click', function(){
console.log(... | 2010/02/19 | [
"https://Stackoverflow.com/questions/2300081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74552/"
] | After thinking this through, I realized it makes no sense to call `live` on an existing DOM element because it's already in the DOM.
Trick is to use `live` when invoking the plugin:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).click(function(){
console.... | I find this works (jQuery 1.5.2):
```
(function($) {
$.fn.clickTest = function () {
return this.each(function() {
$('.clicker').die('click').live('click', function() {
console.log('clicked');
});
$(this).click(function() {
$('body').append('<a href="#" class="clicker... |
2,300,081 | I am writing a plugin and need to live bind a click. The plugin works fine when I do a normal click bind, but not a live bind.
I've boiled the plugin down to the basics:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).live('click', function(){
console.log(... | 2010/02/19 | [
"https://Stackoverflow.com/questions/2300081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74552/"
] | this works without workarounds outside of the plugin:
```
(function ($) {
$.fn.liveBindTest = function () {
return this['live']('click', function () {
console.log('click');
return false;
});
};
})(jQuery);
$('a').liveBindTest();
``` | I think it's not a good point of view.
Now suppose that your plugin is a sort of lightbox,and it is looking to anchor elements inside the DOM.
Usually at the dom ready you will do something like
```
$(dom_elements).myplugin();
```
What if your appending some links via jsor ajax to your page?
I don't think that rebin... |
2,300,081 | I am writing a plugin and need to live bind a click. The plugin works fine when I do a normal click bind, but not a live bind.
I've boiled the plugin down to the basics:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).live('click', function(){
console.log(... | 2010/02/19 | [
"https://Stackoverflow.com/questions/2300081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74552/"
] | I find this works (jQuery 1.5.2):
```
(function($) {
$.fn.clickTest = function () {
return this.each(function() {
$('.clicker').die('click').live('click', function() {
console.log('clicked');
});
$(this).click(function() {
$('body').append('<a href="#" class="clicker... | I think it's not a good point of view.
Now suppose that your plugin is a sort of lightbox,and it is looking to anchor elements inside the DOM.
Usually at the dom ready you will do something like
```
$(dom_elements).myplugin();
```
What if your appending some links via jsor ajax to your page?
I don't think that rebin... |
2,300,081 | I am writing a plugin and need to live bind a click. The plugin works fine when I do a normal click bind, but not a live bind.
I've boiled the plugin down to the basics:
```
(function($) {
$.fn.liveBindTest = function() {
return this.each(function() {
$(this).live('click', function(){
console.log(... | 2010/02/19 | [
"https://Stackoverflow.com/questions/2300081",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/74552/"
] | this works without workarounds outside of the plugin:
```
(function ($) {
$.fn.liveBindTest = function () {
return this['live']('click', function () {
console.log('click');
return false;
});
};
})(jQuery);
$('a').liveBindTest();
``` | I find this works (jQuery 1.5.2):
```
(function($) {
$.fn.clickTest = function () {
return this.each(function() {
$('.clicker').die('click').live('click', function() {
console.log('clicked');
});
$(this).click(function() {
$('body').append('<a href="#" class="clicker... |
29,074,684 | I'm not a programmer, I've created a web site using a major hosting service's application. I want to insert code into a box provided by the hosting service that allows you to paste any HTML code.
I want to create a link on the site that opens a popup window to display text that I hard-code into the code. I don't want... | 2015/03/16 | [
"https://Stackoverflow.com/questions/29074684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4675385/"
] | You should call
```
a.send "#{attr}=", 1
a.save!
``` | You can try this
```
def set_attributes(*attributes)
attributes.each {|attribute| self.send("#{attribute}=", 1)}
end
``` |
1,255,371 | Proving that $|z-1|-|z+1|=1$ its an hyperbola, and $\Re(1-z)=|z|$ its an ellipse.
If $z\in \mathbb C$
I cant see why there are a hyperobla and an ellipse respct. | 2015/04/28 | [
"https://math.stackexchange.com/questions/1255371",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/116309/"
] | I'll give you an idea :
$Re(1-z) = Re (1 - x - iy) = 1 - x $
On the other hand, $ |z| = \sqrt{x^2 + y^2} $
So, we can write :
$ (1-x)^2 = x^2 + y^2 $
Then you can rearrange the last part.. | The set of points whose difference of distances to fixed points, the foci ($(-1,0),(1,0)$ respectively here )is constant, is a hyperbola. Here $|z-1|$ is the distance to -1 and $|z+1|$ is the distance to $-1$. |
1,255,371 | Proving that $|z-1|-|z+1|=1$ its an hyperbola, and $\Re(1-z)=|z|$ its an ellipse.
If $z\in \mathbb C$
I cant see why there are a hyperobla and an ellipse respct. | 2015/04/28 | [
"https://math.stackexchange.com/questions/1255371",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/116309/"
] | **To show that $|z-1|-|z+1|=1$ is a hyperbola**
Let $a=|z-1|, b=|z+1|$ where $z=x+iy$.
Hence
$a^2=(x-1)^2+y^2$ and $ b^2=(x+1)^2+y^2$.
Given equation:
$\qquad \qquad\qquad \qquad \qquad a-b=1\qquad\qquad $
Multiply by $a+b$ and swapping sides:
$\qquad a+b=a^2-b^2\qquad $
Adding:
$\qquad\qquad\qquad \qquad\q... | The set of points whose difference of distances to fixed points, the foci ($(-1,0),(1,0)$ respectively here )is constant, is a hyperbola. Here $|z-1|$ is the distance to -1 and $|z+1|$ is the distance to $-1$. |
1,255,371 | Proving that $|z-1|-|z+1|=1$ its an hyperbola, and $\Re(1-z)=|z|$ its an ellipse.
If $z\in \mathbb C$
I cant see why there are a hyperobla and an ellipse respct. | 2015/04/28 | [
"https://math.stackexchange.com/questions/1255371",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/116309/"
] | **To show that $|z-1|-|z+1|=1$ is a hyperbola**
Let $a=|z-1|, b=|z+1|$ where $z=x+iy$.
Hence
$a^2=(x-1)^2+y^2$ and $ b^2=(x+1)^2+y^2$.
Given equation:
$\qquad \qquad\qquad \qquad \qquad a-b=1\qquad\qquad $
Multiply by $a+b$ and swapping sides:
$\qquad a+b=a^2-b^2\qquad $
Adding:
$\qquad\qquad\qquad \qquad\q... | I'll give you an idea :
$Re(1-z) = Re (1 - x - iy) = 1 - x $
On the other hand, $ |z| = \sqrt{x^2 + y^2} $
So, we can write :
$ (1-x)^2 = x^2 + y^2 $
Then you can rearrange the last part.. |
61,319,852 | I am using a custom UI component in my project which has it's own few attributes. I want to change a specific one using a function when it is clicked. I don't know how to access it though, I am fairly new in this department.
```
<com.chinodev.androidneomorphframelayout.NeomorphFrameLayout
android:i... | 2020/04/20 | [
"https://Stackoverflow.com/questions/61319852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11516530/"
] | In `NeomorphFrameLayout` you can add a public function changeElevation ex
```
fun changeElevation(elevation :Float){
neomorph_elevation = elevation
}
```
and can use in onClickListener like
```
btnsystem.changeElevation(5f)
``` | As they specified in library that,
Attributes: neomorph\_clickable option set it to true and onClick trigger a function from xml or from setOnClickListener whichever you prefer...
<https://github.com/4inodev/Neomorphic-FrameLayout-Android> |
61,319,852 | I am using a custom UI component in my project which has it's own few attributes. I want to change a specific one using a function when it is clicked. I don't know how to access it though, I am fairly new in this department.
```
<com.chinodev.androidneomorphframelayout.NeomorphFrameLayout
android:i... | 2020/04/20 | [
"https://Stackoverflow.com/questions/61319852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11516530/"
] | In `NeomorphFrameLayout` you can add a public function changeElevation ex
```
fun changeElevation(elevation :Float){
neomorph_elevation = elevation
}
```
and can use in onClickListener like
```
btnsystem.changeElevation(5f)
``` | android-repository-history
==========================
History of Android repository XML
repository2-$N.xml and addons\_list-3.xml
-----------------------------------------
Used by `sdkmanager` command.
repository-$N.xml and addons\_list-2.xml
----------------------------------------
Used by `android` command, whic... |
102,545 | I would like to create a custom WP admin area, that uses custom URLs to navigate thought it and have a custom generated HTML.
A member will be able to login via a custom URL, for example: mysite.com/dashaboard or my.mysite.com When logged in a member will be able to see custom admin area where she/he can create pages,... | 2013/06/10 | [
"https://wordpress.stackexchange.com/questions/102545",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/1343/"
] | I'm not entirely sure you can do this with a single query in MySQL as you can't delete from tables which you reference in a sub-query. I would actually recommend doing this using [wp-cli](http://wp-cli.org/) and using the WordPress API to delete the duplicate posts (which will also delete any post meta and associated t... | I know, it's an old thread but since i had a similar problem i would like to add some advises to the Answer from Bendoh (unfortunately i dont have the reputation to make a comment)
Since wordpress and some Plugins are also storing data in the post table, i would recommend to add an post\_type to your querry:
```
glob... |
110,157 | Which is correct way to create new custom theme in magento 2.0.4 under pub/static/frontend folder or app/design/frontend folder ? | 2016/04/08 | [
"https://magento.stackexchange.com/questions/110157",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/38266/"
] | Unfortunately, those options are gone now in Magento.
Regarding the visitor log, everything is logged via the `\Magento\Customer\Model\Logger` model and via events observers declared under `\Magento\Customer\etc\frontend\events.xml`.
However, the automatic cleaning seems to be totally gone.
Regarding the system and ... | If you want to log your variables you can do this way.
```
<?php
namespace Test\Testpayment\Observer;
class Sendtogateway implements \Magento\Framework\Event\ObserverInterface
{
protected $_responseFactory;
protected $_url;
protected $order;
protected $logger;
protected $_checkoutSession;
public funct... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | ↑ Just to demonstrate: I have marked this post with our current “citation needed” post notice. It currently covers *objective* citations perfectly well. The post notice we're asking about will be a sibling to this one, and will be applied by a moderator when a post strongly needs *subjective* citation added (for exampl... | To me this is a poor criterion, though well intended. We could do better by nuancing, creating explicit exceptions, or replacing it.
====================================================================================================================================
I've had a comparable answer deleted on another SE be... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | Too Many Words for a post notice: be concise
--------------------------------------------
Let's do some liposuction on the proposed post notice:
>
> Answers should be supported using evidence and/or experience. See [citation expectations for subjective answers](https://rpg.meta.stackexchange.com/questions/8696/what-... | Any post notice for this is inappropriate.
------------------------------------------
You're offering advice to someone on how to improve their post. If you said it (nicely) in a comment it would be friendly and helpful.
Putting it in a moderator tool instead makes it hostile and vaguely threatening.
Why on Earth wo... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | I do not like the assumption that answers are not drawing on experience.
========================================================================
My experience with being pestered about explicitly certifying that my answer is drawn from my own experience is that I don't like it. That practice has mostly put me off ans... | I propose a different style for **explicit citation needed questions**
Do you remember the Bête question? The one that moderators looked at 3 times in the first hours? Yes, I had put a note to it that demanded citations to books in the very beginning.
2 answers were deleted by mods after I had pointed out the lack of... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | ↑ Just to demonstrate: I have marked this post with our current “citation needed” post notice. It currently covers *objective* citations perfectly well. The post notice we're asking about will be a sibling to this one, and will be applied by a moderator when a post strongly needs *subjective* citation added (for exampl... | Any post notice for this is inappropriate.
------------------------------------------
You're offering advice to someone on how to improve their post. If you said it (nicely) in a comment it would be friendly and helpful.
Putting it in a moderator tool instead makes it hostile and vaguely threatening.
Why on Earth wo... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | Moderator proposal:
===================
>
> All answers must be supported by citing evidence or experience. Please review [our citation expectations for subjective answers](https://rpg.meta.stackexchange.com/questions/8696/what-are-the-citation-expectations-of-answers-on-rpg-stack-exchange), as well as [our guidance ... | To me this is a poor criterion, though well intended. We could do better by nuancing, creating explicit exceptions, or replacing it.
====================================================================================================================================
I've had a comparable answer deleted on another SE be... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | ↑ Just to demonstrate: I have marked this post with our current “citation needed” post notice. It currently covers *objective* citations perfectly well. The post notice we're asking about will be a sibling to this one, and will be applied by a moderator when a post strongly needs *subjective* citation added (for exampl... | Moderator proposal:
===================
>
> All answers must be supported by citing evidence or experience. Please review [our citation expectations for subjective answers](https://rpg.meta.stackexchange.com/questions/8696/what-are-the-citation-expectations-of-answers-on-rpg-stack-exchange), as well as [our guidance ... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | An advisory rather than a warning
---------------------------------
>
> This answer could be improved if you were able to cite experience (your own or someone else's) to help users judge whether it fits their situation or not. [This post](https://rpg.meta.stackexchange.com/questions/9228/how-do-we-appropriately-back-... | Moderator proposal:
===================
>
> All answers must be supported by citing evidence or experience. Please review [our citation expectations for subjective answers](https://rpg.meta.stackexchange.com/questions/8696/what-are-the-citation-expectations-of-answers-on-rpg-stack-exchange), as well as [our guidance ... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | I propose a different style for **explicit citation needed questions**
Do you remember the Bête question? The one that moderators looked at 3 times in the first hours? Yes, I had put a note to it that demanded citations to books in the very beginning.
2 answers were deleted by mods after I had pointed out the lack of... | To me this is a poor criterion, though well intended. We could do better by nuancing, creating explicit exceptions, or replacing it.
====================================================================================================================================
I've had a comparable answer deleted on another SE be... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | Too Many Words for a post notice: be concise
--------------------------------------------
Let's do some liposuction on the proposed post notice:
>
> Answers should be supported using evidence and/or experience. See [citation expectations for subjective answers](https://rpg.meta.stackexchange.com/questions/8696/what-... | To me this is a poor criterion, though well intended. We could do better by nuancing, creating explicit exceptions, or replacing it.
====================================================================================================================================
I've had a comparable answer deleted on another SE be... |
9,477 | One of the tools that diamond moderators have at their disposal is the post notice. We have several different types of post notice for example, this one, for posts that require additional citations:
>
> Some of the information contained in this post requires additional references. Please edit to add citations to reli... | 2019/10/01 | [
"https://rpg.meta.stackexchange.com/questions/9477",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/28591/"
] | I do not like the assumption that answers are not drawing on experience.
========================================================================
My experience with being pestered about explicitly certifying that my answer is drawn from my own experience is that I don't like it. That practice has mostly put me off ans... | An advisory rather than a warning
---------------------------------
>
> This answer could be improved if you were able to cite experience (your own or someone else's) to help users judge whether it fits their situation or not. [This post](https://rpg.meta.stackexchange.com/questions/9228/how-do-we-appropriately-back-... |
3,267 | My [edit for a few capitalization fixes](https://apple.stackexchange.com/review/suggested-edits/239477) was rejected. What was wrong with it? | 2018/06/20 | [
"https://apple.meta.stackexchange.com/questions/3267",
"https://apple.meta.stackexchange.com",
"https://apple.meta.stackexchange.com/users/287761/"
] | Hopefully I can provide some further context as the person who rejected the edit.
* The edit did not substantially improve the post. I understand editing to fix spelling mistakes since Stack Exchange search does not understand mistakes unlike Google and find similar words, and I have more than once been frustrated bec... | I see this as an edge case. We typically expect edits to be substantial, but this post is very short so it’s hard to tell how much better the question reads with some punctuation and grammar.
I could see rejecting that sort of edit myself, but looking at it I’ve reversed the rejection. Also, that post is already answ... |
45,685,463 | Normally, I would assume that C++ 11 thread automatically destroy after detach. But the thing is, I can't find anything to prove this assumption.
According to [this article](http://www.bogotobogo.com/cplusplus/C11/1_C11_creating_thread.php)
>
> Once detached, the thread should live that way forever.
>
>
>
forev... | 2017/08/15 | [
"https://Stackoverflow.com/questions/45685463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4608491/"
] | You should consult a better reference. From [`std::thread::detach`](http://en.cppreference.com/w/cpp/thread/thread/detach):
>
> Separates the thread of execution from the thread object, allowing execution to continue independently. Any allocated resources will be freed once the thread exits.
>
>
> After calling det... | A std::thread is just a thin wrapper around your platform's native threading library... It doesn't really contain much internally besides a few flags and the native handle to the platform's thread representation (which for both Unix & Windows is a fancy integral identifier). Speaking specifically of Unix-like systems, ... |
892,262 | I am facing problem in loading data. I have to copy 800,000 rows from one table to another in Oracle database.
I tried for 10,000 rows first but the time it took is not satisfactory. I tried using the "BULK COLLECT" and "INSERT INTO SELECT" clause but for both the cases response time is around 35 minutes. This is not ... | 2009/05/21 | [
"https://Stackoverflow.com/questions/892262",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Anirban,
Using an "INSERT INTO SELECT" is the fastest way to populate your table. You may want to extend it with one or two of these hints:
* APPEND: to use direct path loading, circumventing the buffer cache
* PARALLEL: to use parallel processing if your system has multiple cpu's and this is a one-time operation or ... | Is the table you are copying to the same structure as the other table? Does it have data or are you creating a new one? Can you use exp/imp? Exp can be give a query to limit what it exports and then imported into the db. What is the total size of the table you are copying from? If you are copying most of the data from ... |
892,262 | I am facing problem in loading data. I have to copy 800,000 rows from one table to another in Oracle database.
I tried for 10,000 rows first but the time it took is not satisfactory. I tried using the "BULK COLLECT" and "INSERT INTO SELECT" clause but for both the cases response time is around 35 minutes. This is not ... | 2009/05/21 | [
"https://Stackoverflow.com/questions/892262",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I would agree with Rob. Insert into () select is the fastest way to do this.
What exactly do you need to do? If you're trying to do a table rename by copying to a new table and then deleting the old, you might be better off doing a table rename:
```
alter table
table
rename to
someothertable;
``` | try to drop all indexes/constraints on your destination table and then re-create them after data load.
use `/*+NOLOGGING*/` hint in case you use NOARCHIVELOG mode, or consider to do the backup right after the operation. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.