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 |
|---|---|---|---|---|---|
1,419 | As a follow on question from the 2012 [Uh oh. We have a [beginner] tag!](https://robotics.meta.stackexchange.com/questions/88/uh-oh-we-have-a-beginner-tag), I’ve noticed a couple of the meta tags discussed for deletion are still being used. Was this intentional or have they crept back into use somehow? Examples (see be... | 2021/10/18 | [
"https://robotics.meta.stackexchange.com/questions/1419",
"https://robotics.meta.stackexchange.com",
"https://robotics.meta.stackexchange.com/users/27817/"
] | This is a complex question that doesn't have a great answer - while Ben's answer does give some good explanations for how the system has worked in the past and it's worth considering and following that guidance - we've changed how and when we take sites out of beta in recent years and that's impacted many of our older ... | Teaser: Take a deep breathe everyone... we might have some news soon... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | Also, while [Goldberg](http://docs.sun.com/source/806-3568/ncg_goldberg.html#3098) is a great reference, the original text is also wrong: **IEEE754 is not gaurenteed to be portable**. I can't emphasize this enough given how often this statement is made based on skimming the text. Later versions of the document include ... | HM. Since the OP asked for C#:
Is the C# bytecode JIT deterministic or does it generate different code between different runs? I don't know, but I wouldn't trust the Jit.
I could think of scenarios where the JIT has some quality of service features and decides to spend less time on optimization because the CPU is do... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | This answer in the C++ FAQ probably describes it the best:
<http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.18>
It is not only that different architectures or compiler might give you trouble, float pointing numbers already behave in weird ways within the same program. As the FAQ points out if `y == x` is tru... | This is not a full answer to your question, but here is an example demonstrating that double calculations in C# are non-deterministic. I don't know why, but seemingly unrelated code can apparently affect the outcome of a downstream double calculation.
1. Create a new WPF application in Visual Studio Version 12.0.40629... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | From what I understand you're only guaranteed identical results provided that you're dealing with the same instruction set and compiler, and that any processors you run on adhere strictly to the relevant standards (ie IEEE754). That said, unless you're dealing with a particularly chaotic system any drift in calculation... | Since your question is tagged C#, it's worth emphasising the issues faced on .NET:
1. Floating point maths is not associative - that is, `(a + b) + c` is not guaranteed to equal `a + (b + c)`;
2. Different compilers will optimize your code in different ways, and that may involve re-ordering arithmetic operations.
3. I... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | Since your question is tagged C#, it's worth emphasising the issues faced on .NET:
1. Floating point maths is not associative - that is, `(a + b) + c` is not guaranteed to equal `a + (b + c)`;
2. Different compilers will optimize your code in different ways, and that may involve re-ordering arithmetic operations.
3. I... | HM. Since the OP asked for C#:
Is the C# bytecode JIT deterministic or does it generate different code between different runs? I don't know, but I wouldn't trust the Jit.
I could think of scenarios where the JIT has some quality of service features and decides to spend less time on optimization because the CPU is do... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | From what I understand you're only guaranteed identical results provided that you're dealing with the same instruction set and compiler, and that any processors you run on adhere strictly to the relevant standards (ie IEEE754). That said, unless you're dealing with a particularly chaotic system any drift in calculation... | This is not a full answer to your question, but here is an example demonstrating that double calculations in C# are non-deterministic. I don't know why, but seemingly unrelated code can apparently affect the outcome of a downstream double calculation.
1. Create a new WPF application in Visual Studio Version 12.0.40629... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | Since your question is tagged C#, it's worth emphasising the issues faced on .NET:
1. Floating point maths is not associative - that is, `(a + b) + c` is not guaranteed to equal `a + (b + c)`;
2. Different compilers will optimize your code in different ways, and that may involve re-ordering arithmetic operations.
3. I... | This is not a full answer to your question, but here is an example demonstrating that double calculations in C# are non-deterministic. I don't know why, but seemingly unrelated code can apparently affect the outcome of a downstream double calculation.
1. Create a new WPF application in Visual Studio Version 12.0.40629... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | I think your confusion lies in the type of inaccuracy around floating point. Most languages implement the [IEEE floating point standard](http://en.wikipedia.org/wiki/IEEE_floating-point_standard) This standard lays out how individual bits within a float/double are used to produce a number. Typically a float consists of... | Also, while [Goldberg](http://docs.sun.com/source/806-3568/ncg_goldberg.html#3098) is a great reference, the original text is also wrong: **IEEE754 is not gaurenteed to be portable**. I can't emphasize this enough given how often this statement is made based on skimming the text. Later versions of the document include ... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | HM. Since the OP asked for C#:
Is the C# bytecode JIT deterministic or does it generate different code between different runs? I don't know, but I wouldn't trust the Jit.
I could think of scenarios where the JIT has some quality of service features and decides to spend less time on optimization because the CPU is do... | Very few FPUs meet the IEEE standard (despite their claims). So running the same program in different hardware will indeed give you different results. The results are likely to be in corner cases that you should already avoid as part of using an FPU in your software.
IEEE bugs are often patched in software and are you... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | This answer in the C++ FAQ probably describes it the best:
<http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.18>
It is not only that different architectures or compiler might give you trouble, float pointing numbers already behave in weird ways within the same program. As the FAQ points out if `y == x` is tru... | HM. Since the OP asked for C#:
Is the C# bytecode JIT deterministic or does it generate different code between different runs? I don't know, but I wouldn't trust the Jit.
I could think of scenarios where the JIT has some quality of service features and decides to spend less time on optimization because the CPU is do... |
328,622 | I understand that floating point calculations have accuracy issues and there are plenty of questions explaining why. My question is if I run the same calculation twice, can I always rely on it to produce the same result? What factors might affect this?
* Time between calculations?
* Current state of the CPU?
* Differe... | 2008/11/30 | [
"https://Stackoverflow.com/questions/328622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40944/"
] | The short answer is that FP calculations are entirely deterministic, as per the [IEEE Floating Point Standard](http://en.wikipedia.org/wiki/IEEE_754), but that doesn't mean they're entirely reproducible across machines, compilers, OS's, etc.
The long answer to these questions and more can be found in what is probably ... | Since your question is tagged C#, it's worth emphasising the issues faced on .NET:
1. Floating point maths is not associative - that is, `(a + b) + c` is not guaranteed to equal `a + (b + c)`;
2. Different compilers will optimize your code in different ways, and that may involve re-ordering arithmetic operations.
3. I... |
70,038,544 | I need to find an element by ID "start-ads", but the numbers at the end change every time. Is it possible to search for an element not by the whole ID, but only by its part?
```
Full element id: <div id="start-ads-202308">
``` | 2021/11/19 | [
"https://Stackoverflow.com/questions/70038544",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17450315/"
] | To identify the following element:
```
<div id="start-ads-202308">
```
considering the static part of the value of *`id`* attribute you can use either of the following [Locator Strategies](https://stackoverflow.com/questions/48369043/official-locator-strategies-for-the-webdriver/48376890#48376890):
* Using `css_sel... | You can use [find\_element\_by\_css\_selector](https://selenium-python.readthedocs.io/locating-elements.html#locating-elements-by-css-selectors) and use a CSS selector that matches using a prefix
```
driver.find_element_by_css_selector("div[id^='start-ads-']")
``` |
28,198,893 | I am trying to extract the SPY.Close column from the data frame SPY which is created by quantmod. However, I would like to generalize this so that whatever symbol I pass initially can be used to create the close vector.
```
library(quantmod)
library(wmtsa)
library(ggplot2)
library(tseries)
library(pracma)
s <- getSymb... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28198893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4504163/"
] | Define a function to generate invoice number.
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
invoice_int = int(invoice_no.split('MAG')[-1])
new_invoice_int = invoice_i... | ```
def invoiceIncrement():
get_last_invoice_number
incremente_last_invoice_number
return next_invoice_number
class Invoice:
invoice_no = models.CharField(max_length=500, null=True, blank=True,
validators=[RegexValidator(regex='^[a-zA-Z0-9]*$',
message='Invoice must be Alphanumeric',co... |
28,198,893 | I am trying to extract the SPY.Close column from the data frame SPY which is created by quantmod. However, I would like to generalize this so that whatever symbol I pass initially can be used to create the close vector.
```
library(quantmod)
library(wmtsa)
library(ggplot2)
library(tseries)
library(pracma)
s <- getSymb... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28198893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4504163/"
] | ```
def invoiceIncrement():
get_last_invoice_number
incremente_last_invoice_number
return next_invoice_number
class Invoice:
invoice_no = models.CharField(max_length=500, null=True, blank=True,
validators=[RegexValidator(regex='^[a-zA-Z0-9]*$',
message='Invoice must be Alphanumeric',co... | Maybe this code can help
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
new_invoice_no = str(int(invoice_no[4:]) + 1)
new_invoice_no = invoice_no[0:-(len(new_invoice_no... |
28,198,893 | I am trying to extract the SPY.Close column from the data frame SPY which is created by quantmod. However, I would like to generalize this so that whatever symbol I pass initially can be used to create the close vector.
```
library(quantmod)
library(wmtsa)
library(ggplot2)
library(tseries)
library(pracma)
s <- getSymb... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28198893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4504163/"
] | ```
def invoiceIncrement():
get_last_invoice_number
incremente_last_invoice_number
return next_invoice_number
class Invoice:
invoice_no = models.CharField(max_length=500, null=True, blank=True,
validators=[RegexValidator(regex='^[a-zA-Z0-9]*$',
message='Invoice must be Alphanumeric',co... | ```
def invoice_number_gen():
last_invoice = Invoice.objects.all().order_by('id').last()
last_invoice_number = last_invoice.invoice_no
#invoice number format is 'customer_name_short + number' eg: CS003
last_invoice_digits =int(last_invoice_number[2:])
#comment: slicing CS003 to get the number 003 and c... |
28,198,893 | I am trying to extract the SPY.Close column from the data frame SPY which is created by quantmod. However, I would like to generalize this so that whatever symbol I pass initially can be used to create the close vector.
```
library(quantmod)
library(wmtsa)
library(ggplot2)
library(tseries)
library(pracma)
s <- getSymb... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28198893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4504163/"
] | Define a function to generate invoice number.
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
invoice_int = int(invoice_no.split('MAG')[-1])
new_invoice_int = invoice_i... | In above arulmr answer just edit char field
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
invoice_int = int(invoice_no.split('MAG')[-1])
width = 4
new_invoice_int ... |
28,198,893 | I am trying to extract the SPY.Close column from the data frame SPY which is created by quantmod. However, I would like to generalize this so that whatever symbol I pass initially can be used to create the close vector.
```
library(quantmod)
library(wmtsa)
library(ggplot2)
library(tseries)
library(pracma)
s <- getSymb... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28198893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4504163/"
] | Define a function to generate invoice number.
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
invoice_int = int(invoice_no.split('MAG')[-1])
new_invoice_int = invoice_i... | Maybe this code can help
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
new_invoice_no = str(int(invoice_no[4:]) + 1)
new_invoice_no = invoice_no[0:-(len(new_invoice_no... |
28,198,893 | I am trying to extract the SPY.Close column from the data frame SPY which is created by quantmod. However, I would like to generalize this so that whatever symbol I pass initially can be used to create the close vector.
```
library(quantmod)
library(wmtsa)
library(ggplot2)
library(tseries)
library(pracma)
s <- getSymb... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28198893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4504163/"
] | Define a function to generate invoice number.
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
invoice_int = int(invoice_no.split('MAG')[-1])
new_invoice_int = invoice_i... | ```
def invoice_number_gen():
last_invoice = Invoice.objects.all().order_by('id').last()
last_invoice_number = last_invoice.invoice_no
#invoice number format is 'customer_name_short + number' eg: CS003
last_invoice_digits =int(last_invoice_number[2:])
#comment: slicing CS003 to get the number 003 and c... |
28,198,893 | I am trying to extract the SPY.Close column from the data frame SPY which is created by quantmod. However, I would like to generalize this so that whatever symbol I pass initially can be used to create the close vector.
```
library(quantmod)
library(wmtsa)
library(ggplot2)
library(tseries)
library(pracma)
s <- getSymb... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28198893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4504163/"
] | In above arulmr answer just edit char field
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
invoice_int = int(invoice_no.split('MAG')[-1])
width = 4
new_invoice_int ... | Maybe this code can help
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
new_invoice_no = str(int(invoice_no[4:]) + 1)
new_invoice_no = invoice_no[0:-(len(new_invoice_no... |
28,198,893 | I am trying to extract the SPY.Close column from the data frame SPY which is created by quantmod. However, I would like to generalize this so that whatever symbol I pass initially can be used to create the close vector.
```
library(quantmod)
library(wmtsa)
library(ggplot2)
library(tseries)
library(pracma)
s <- getSymb... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28198893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4504163/"
] | In above arulmr answer just edit char field
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
invoice_int = int(invoice_no.split('MAG')[-1])
width = 4
new_invoice_int ... | ```
def invoice_number_gen():
last_invoice = Invoice.objects.all().order_by('id').last()
last_invoice_number = last_invoice.invoice_no
#invoice number format is 'customer_name_short + number' eg: CS003
last_invoice_digits =int(last_invoice_number[2:])
#comment: slicing CS003 to get the number 003 and c... |
28,198,893 | I am trying to extract the SPY.Close column from the data frame SPY which is created by quantmod. However, I would like to generalize this so that whatever symbol I pass initially can be used to create the close vector.
```
library(quantmod)
library(wmtsa)
library(ggplot2)
library(tseries)
library(pracma)
s <- getSymb... | 2015/01/28 | [
"https://Stackoverflow.com/questions/28198893",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4504163/"
] | Maybe this code can help
```
def increment_invoice_number():
last_invoice = Invoice.objects.all().order_by('id').last()
if not last_invoice:
return 'MAG0001'
invoice_no = last_invoice.invoice_no
new_invoice_no = str(int(invoice_no[4:]) + 1)
new_invoice_no = invoice_no[0:-(len(new_invoice_no... | ```
def invoice_number_gen():
last_invoice = Invoice.objects.all().order_by('id').last()
last_invoice_number = last_invoice.invoice_no
#invoice number format is 'customer_name_short + number' eg: CS003
last_invoice_digits =int(last_invoice_number[2:])
#comment: slicing CS003 to get the number 003 and c... |
14,292,750 | What's the best way to programmatically determine if the current machine is running Ubuntu, what architecture it has, and what version of Ubuntu it is running?
One way would be to scan the output of `uname -a` to check for the right kernel version and architecture.
Another way would be to scan `/etc/apt/sources.list`... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14292750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1131467/"
] | >
> One way would be to scan the output of uname -a to check for the right kernel version and architecture.
>
>
>
But one does not generally want to parse the output of such tools, because it's not elegant (it's considered a hack, so to say).
However, you can use the `uname()` function/syscall:
```
#include <sys... | Afaik most Linux distributions also use `/etc/issue`. The text in it can ofcourse have been changed by the admin to show a different login message.
Sample from fedora:
```
Fedora release 17 (Beefy Miracle)
Kernel \r on an \m (\l)
```
Sample from ubuntu:
```
Ubuntu 11.04 \n \l
``` |
14,292,750 | What's the best way to programmatically determine if the current machine is running Ubuntu, what architecture it has, and what version of Ubuntu it is running?
One way would be to scan the output of `uname -a` to check for the right kernel version and architecture.
Another way would be to scan `/etc/apt/sources.list`... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14292750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1131467/"
] | Apart from `uname -a`, There are several way to get information about the current distribution.
1. The best way is to parse the release files. They usually ended with `-release` or `_release` and located in `/etc`. Following command will find them all.
```
ls /etc/*{-,_}release
```
* Ubuntu uses `lsb_release`
* R... | Afaik most Linux distributions also use `/etc/issue`. The text in it can ofcourse have been changed by the admin to show a different login message.
Sample from fedora:
```
Fedora release 17 (Beefy Miracle)
Kernel \r on an \m (\l)
```
Sample from ubuntu:
```
Ubuntu 11.04 \n \l
``` |
14,292,750 | What's the best way to programmatically determine if the current machine is running Ubuntu, what architecture it has, and what version of Ubuntu it is running?
One way would be to scan the output of `uname -a` to check for the right kernel version and architecture.
Another way would be to scan `/etc/apt/sources.list`... | 2013/01/12 | [
"https://Stackoverflow.com/questions/14292750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1131467/"
] | You can use a library as a neutral to the operating system. A solution is [lsb](http://www.linuxfoundation.org/collaborate/workgroups/lsb/lsb-41-release-notes)and your question became close to [using lsb question](https://stackoverflow.com/questions/1337329/determine-linux-version-from-java). | Afaik most Linux distributions also use `/etc/issue`. The text in it can ofcourse have been changed by the admin to show a different login message.
Sample from fedora:
```
Fedora release 17 (Beefy Miracle)
Kernel \r on an \m (\l)
```
Sample from ubuntu:
```
Ubuntu 11.04 \n \l
``` |
33,935,373 | I `WPF/C#` desktop application, how to get the country where the user currently is running the application ?
I quess the following just returns the value based on whatever is selected in regional and language options of the Control Panel, therefore making it unusable here.
```
string countryName = RegionInfo.CurrentR... | 2015/11/26 | [
"https://Stackoverflow.com/questions/33935373",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2143213/"
] | Your problem is probably that you model class is not a clean JavaBean. At the moment Spark has no code to deal with properties that have a setter but no getter method. You can simply try something like this to inspect how Spark understands your class:
```
PropertyDescriptor[] props = Introspector.getBeanInfo(YourClass... | Here is what I tried and it worked: -
Here is POJO which stores String, Long and Int Values: -
```
import java.io.*;
public class TestingSQLPerson implements Serializable {
// Here is Data in a comma Separated file: -
// Sumit,20,123455
// Ramit,40,12345
private String name;
private int age;
private Long testL;
p... |
12,720,559 | ```
String text = "select ename from emp";
```
I want to know the space index after the word **from**. How to do it? | 2012/10/04 | [
"https://Stackoverflow.com/questions/12720559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1659254/"
] | If you're specifically looking for the index of the first space after the word "from", you can use:
```
text.substring(text.indexOf("from")).indexOf(' ');
```
If you're trying to do something more general, than you'll need to give a bit more information. But the indexOf() method will probably be very useful to you.
... | The very basic answer might look something like...
```
String text = "select ename from emp";
text = text.toLowerCase();
if (text.contains("from ")) {
int index = text.indexOf("from ") + "from".length();
System.out.println("Found space @ " + index);
System.out.println(text.substring(index));
} else {
... |
12,720,559 | ```
String text = "select ename from emp";
```
I want to know the space index after the word **from**. How to do it? | 2012/10/04 | [
"https://Stackoverflow.com/questions/12720559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1659254/"
] | If you're specifically looking for the index of the first space after the word "from", you can use:
```
text.substring(text.indexOf("from")).indexOf(' ');
```
If you're trying to do something more general, than you'll need to give a bit more information. But the indexOf() method will probably be very useful to you.
... | use indexOf() method. Hope u got the answer |
12,720,559 | ```
String text = "select ename from emp";
```
I want to know the space index after the word **from**. How to do it? | 2012/10/04 | [
"https://Stackoverflow.com/questions/12720559",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1659254/"
] | The very basic answer might look something like...
```
String text = "select ename from emp";
text = text.toLowerCase();
if (text.contains("from ")) {
int index = text.indexOf("from ") + "from".length();
System.out.println("Found space @ " + index);
System.out.println(text.substring(index));
} else {
... | use indexOf() method. Hope u got the answer |
31,251,171 | I am new to html/css but was assigned to get a html webpage done. When I specified a `font-size` for my webpage and was surprised to find that it was adjusted by my browser (Google Chrome), but I'm not sure why. I specified the `font-size` at `14px` and it was adjusted to be `14.3999996185303px` by the browser, which m... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31251171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3398461/"
] | Without `FlexibleContexts` all typeclass constraints on function definitions must have type variables. For example:
```
add :: Num a => a -> a -> a
add = (+)
```
Where `a` is the type variable. With `FlexibleContexts` enabled you can have any type inside a typeclass.
```
intAdd :: Num Int => Int -> Int -> Int
int... | Commonly it's used with the `MultiParamTypeClasses` extension, for example when using the `mtl` library you might write
```
doSomethingWithState :: MonadState MyState m => m ()
doSomethingWithState = do
current <- get
let something1 = computeSomething1 current
something2 = computeSomething2 current som... |
31,251,171 | I am new to html/css but was assigned to get a html webpage done. When I specified a `font-size` for my webpage and was surprised to find that it was adjusted by my browser (Google Chrome), but I'm not sure why. I specified the `font-size` at `14px` and it was adjusted to be `14.3999996185303px` by the browser, which m... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31251171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3398461/"
] | Without `FlexibleContexts` all typeclass constraints on function definitions must have type variables. For example:
```
add :: Num a => a -> a -> a
add = (+)
```
Where `a` is the type variable. With `FlexibleContexts` enabled you can have any type inside a typeclass.
```
intAdd :: Num Int => Int -> Int -> Int
int... | I've discovered a use for it apart from those mentioned: it results in clearer error messages from GHC. E.g. normally,
```
Prelude> max (1, 2) 3
<interactive>:1:1: error:
• Non type-variable argument in the constraint: Num (a, b)
(Use FlexibleContexts to permit this)
• When checking the inferred type
... |
31,251,171 | I am new to html/css but was assigned to get a html webpage done. When I specified a `font-size` for my webpage and was surprised to find that it was adjusted by my browser (Google Chrome), but I'm not sure why. I specified the `font-size` at `14px` and it was adjusted to be `14.3999996185303px` by the browser, which m... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31251171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3398461/"
] | Without `FlexibleContexts` all typeclass constraints on function definitions must have type variables. For example:
```
add :: Num a => a -> a -> a
add = (+)
```
Where `a` is the type variable. With `FlexibleContexts` enabled you can have any type inside a typeclass.
```
intAdd :: Num Int => Int -> Int -> Int
int... | `FlexibleContexts` is often used with type families. For example, when using `GHC.Generics`, it's common to see signatures like
```
foo :: (Generic a, GFoo (Rep a)) => Int -> a -> a
```
This can be seen as a variation of the `MultiParamTypeClasses` usage:
```
class (Generic a, rep ~ Rep a) => MPGeneric rep a
instan... |
31,251,171 | I am new to html/css but was assigned to get a html webpage done. When I specified a `font-size` for my webpage and was surprised to find that it was adjusted by my browser (Google Chrome), but I'm not sure why. I specified the `font-size` at `14px` and it was adjusted to be `14.3999996185303px` by the browser, which m... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31251171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3398461/"
] | Commonly it's used with the `MultiParamTypeClasses` extension, for example when using the `mtl` library you might write
```
doSomethingWithState :: MonadState MyState m => m ()
doSomethingWithState = do
current <- get
let something1 = computeSomething1 current
something2 = computeSomething2 current som... | `FlexibleContexts` is often used with type families. For example, when using `GHC.Generics`, it's common to see signatures like
```
foo :: (Generic a, GFoo (Rep a)) => Int -> a -> a
```
This can be seen as a variation of the `MultiParamTypeClasses` usage:
```
class (Generic a, rep ~ Rep a) => MPGeneric rep a
instan... |
31,251,171 | I am new to html/css but was assigned to get a html webpage done. When I specified a `font-size` for my webpage and was surprised to find that it was adjusted by my browser (Google Chrome), but I'm not sure why. I specified the `font-size` at `14px` and it was adjusted to be `14.3999996185303px` by the browser, which m... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31251171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3398461/"
] | I've discovered a use for it apart from those mentioned: it results in clearer error messages from GHC. E.g. normally,
```
Prelude> max (1, 2) 3
<interactive>:1:1: error:
• Non type-variable argument in the constraint: Num (a, b)
(Use FlexibleContexts to permit this)
• When checking the inferred type
... | `FlexibleContexts` is often used with type families. For example, when using `GHC.Generics`, it's common to see signatures like
```
foo :: (Generic a, GFoo (Rep a)) => Int -> a -> a
```
This can be seen as a variation of the `MultiParamTypeClasses` usage:
```
class (Generic a, rep ~ Rep a) => MPGeneric rep a
instan... |
9,520,148 | I am designing a theme layout for my web app.
Let's say if I have two controllers,A and B. I want A view to display div A and B view will display div B.
I know how to set this inside the controller by utilizing `if($this->router->fetch_class() == 'A')
{
//display div A
}`
But, how to achieve this in view? | 2012/03/01 | [
"https://Stackoverflow.com/questions/9520148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/992972/"
] | For several of your cross-classifications you have missing covariates:
```
with(masterData, table(sample, substrate, r1mis = is.na(r1) ) )
#
snipped the nonmissing reports
, , r1mis = TRUE
substrate
sample 1 2 3 4 5 6 7 8
3 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0
6 0 0 0 0 0 0 0... | As per my comment:
```
my.func <- function(df) {
data.frame(el1=all(is.na(df$el1)), F1=all(is.na(df$F1)))
}
ddply(workingData, .(sample, substrate), my.func)
```
Shows that you have many sub sets where both F1 and el1 are NA. (in fact every time one is all na, the other is as well!) |
34,675,357 | i have a multiple array.. the output looks like this:
```
Array
(
[0] => Array
(
[0] => AdsBot
[1] => 7
)
[1] => Array
(
[0] => SurveyBot
[1] => 1
)
[2] => Array
(
[0] => bingbot
[1] => 3
... | 2016/01/08 | [
"https://Stackoverflow.com/questions/34675357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5658705/"
] | you can use this function
```
function sortAscending($accounts, $key)
{
$ascending = function($accountA, $accountB) use ($key) {
if ($accountA[$key] == $accountB[$key]) {
return 0;
}
return ($accountA[$key] < $accountB[$key]) ? -1 : 1;
};
usort($accounts, $ascending);
... | Try [`usort()`](http://php.net/manual/en/function.usort.php). It allows you to define a callback to sort on a custom expression. In your case you want to reverse sort by the second indexed element in each sub-array:
```
<?php
$bots = [
[
'name' => 'AdsBot',
'number' => 7,
],
[
'... |
34,675,357 | i have a multiple array.. the output looks like this:
```
Array
(
[0] => Array
(
[0] => AdsBot
[1] => 7
)
[1] => Array
(
[0] => SurveyBot
[1] => 1
)
[2] => Array
(
[0] => bingbot
[1] => 3
... | 2016/01/08 | [
"https://Stackoverflow.com/questions/34675357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5658705/"
] | you can use this function
```
function sortAscending($accounts, $key)
{
$ascending = function($accountA, $accountB) use ($key) {
if ($accountA[$key] == $accountB[$key]) {
return 0;
}
return ($accountA[$key] < $accountB[$key]) ? -1 : 1;
};
usort($accounts, $ascending);
... | Please, see bellow code.
```
$arr = array(
0 => array(
'0' => 'AdsBot',
'1' => 7
),
1 => array(
'0' => 'SurveyBot',
'1' => 1
),
2 => array(
'0' => 'bingbot',
'1' => 3
),
3 => array(
'0' => 'bot',
'1' => 27
)
);
echo '<pre>... |
34,675,357 | i have a multiple array.. the output looks like this:
```
Array
(
[0] => Array
(
[0] => AdsBot
[1] => 7
)
[1] => Array
(
[0] => SurveyBot
[1] => 1
)
[2] => Array
(
[0] => bingbot
[1] => 3
... | 2016/01/08 | [
"https://Stackoverflow.com/questions/34675357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5658705/"
] | you can use this function
```
function sortAscending($accounts, $key)
{
$ascending = function($accountA, $accountB) use ($key) {
if ($accountA[$key] == $accountB[$key]) {
return 0;
}
return ($accountA[$key] < $accountB[$key]) ? -1 : 1;
};
usort($accounts, $ascending);
... | Use this way to sort your array
```
$arry = array( array('AdsBot','7'),
array('SurveyBot','1'),
array('bingbot','3'),
array('bot','27')
);
echo "<pre>"; print_r($arry); echo "</pre>";
function sortByOrder($a, $b) {
return $a['1'] - $b['1'];
}
usort($a... |
34,675,357 | i have a multiple array.. the output looks like this:
```
Array
(
[0] => Array
(
[0] => AdsBot
[1] => 7
)
[1] => Array
(
[0] => SurveyBot
[1] => 1
)
[2] => Array
(
[0] => bingbot
[1] => 3
... | 2016/01/08 | [
"https://Stackoverflow.com/questions/34675357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5658705/"
] | You can use [usort](http://php.net/manual/en/function.usort.php)
```
<?php
$data = array(
array('AdsBot', 7),
array('SurveyBot', 1),
array('bingbot', 3),
array('bot', 27)
);
usort($data, 'botSort');
function botSort($val1, $val2) {
if (is_array($val1) && is_array($val2)) {
if ($val1[1] <... | Try [`usort()`](http://php.net/manual/en/function.usort.php). It allows you to define a callback to sort on a custom expression. In your case you want to reverse sort by the second indexed element in each sub-array:
```
<?php
$bots = [
[
'name' => 'AdsBot',
'number' => 7,
],
[
'... |
34,675,357 | i have a multiple array.. the output looks like this:
```
Array
(
[0] => Array
(
[0] => AdsBot
[1] => 7
)
[1] => Array
(
[0] => SurveyBot
[1] => 1
)
[2] => Array
(
[0] => bingbot
[1] => 3
... | 2016/01/08 | [
"https://Stackoverflow.com/questions/34675357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5658705/"
] | You can use [usort](http://php.net/manual/en/function.usort.php)
```
<?php
$data = array(
array('AdsBot', 7),
array('SurveyBot', 1),
array('bingbot', 3),
array('bot', 27)
);
usort($data, 'botSort');
function botSort($val1, $val2) {
if (is_array($val1) && is_array($val2)) {
if ($val1[1] <... | Please, see bellow code.
```
$arr = array(
0 => array(
'0' => 'AdsBot',
'1' => 7
),
1 => array(
'0' => 'SurveyBot',
'1' => 1
),
2 => array(
'0' => 'bingbot',
'1' => 3
),
3 => array(
'0' => 'bot',
'1' => 27
)
);
echo '<pre>... |
34,675,357 | i have a multiple array.. the output looks like this:
```
Array
(
[0] => Array
(
[0] => AdsBot
[1] => 7
)
[1] => Array
(
[0] => SurveyBot
[1] => 1
)
[2] => Array
(
[0] => bingbot
[1] => 3
... | 2016/01/08 | [
"https://Stackoverflow.com/questions/34675357",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5658705/"
] | You can use [usort](http://php.net/manual/en/function.usort.php)
```
<?php
$data = array(
array('AdsBot', 7),
array('SurveyBot', 1),
array('bingbot', 3),
array('bot', 27)
);
usort($data, 'botSort');
function botSort($val1, $val2) {
if (is_array($val1) && is_array($val2)) {
if ($val1[1] <... | Use this way to sort your array
```
$arry = array( array('AdsBot','7'),
array('SurveyBot','1'),
array('bingbot','3'),
array('bot','27')
);
echo "<pre>"; print_r($arry); echo "</pre>";
function sortByOrder($a, $b) {
return $a['1'] - $b['1'];
}
usort($a... |
7,050,957 | OK. I'm starting out on Backbone.js, and trying to do some very simple things. Here's a very simple Model and Collection.
```
// my model
Friend = Backbone.Model.extend({});
// my collection
Friends = Backbone.Collection.extend({});
// instantiate friends and add some friends objects!
var friends = new Friends();
fr... | 2011/08/13 | [
"https://Stackoverflow.com/questions/7050957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181557/"
] | Have you forgot the [] to make it an array?
```
echo '[{name:"James"}, {name:"Michael"}]';
```
Also you check the length in the onsuccess method you can pass to fetch. At the moment you check the length directly after fetching, so your not sure if the result is still loaded.
```
friends.fetch(
{success:functio... | I think the JSON you're passing to `.add()` is invalid. You've got:
```
[
{name: "James"},
{name: "Michael"}
]
```
But you need to quote the keys too:
```
[
{"name": "James"},
{"name": "Michael"}
]
``` |
7,050,957 | OK. I'm starting out on Backbone.js, and trying to do some very simple things. Here's a very simple Model and Collection.
```
// my model
Friend = Backbone.Model.extend({});
// my collection
Friends = Backbone.Collection.extend({});
// instantiate friends and add some friends objects!
var friends = new Friends();
fr... | 2011/08/13 | [
"https://Stackoverflow.com/questions/7050957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181557/"
] | Have you forgot the [] to make it an array?
```
echo '[{name:"James"}, {name:"Michael"}]';
```
Also you check the length in the onsuccess method you can pass to fetch. At the moment you check the length directly after fetching, so your not sure if the result is still loaded.
```
friends.fetch(
{success:functio... | fetch() is an asynchronous call, so you'll be printing to the console before the fetch() has returned to populate your collection
To verify, put a breakpoint on the console.log(friends.length) line. The breakpoint will give the fetch() time to happen |
7,050,957 | OK. I'm starting out on Backbone.js, and trying to do some very simple things. Here's a very simple Model and Collection.
```
// my model
Friend = Backbone.Model.extend({});
// my collection
Friends = Backbone.Collection.extend({});
// instantiate friends and add some friends objects!
var friends = new Friends();
fr... | 2011/08/13 | [
"https://Stackoverflow.com/questions/7050957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/181557/"
] | fetch() is an asynchronous call, so you'll be printing to the console before the fetch() has returned to populate your collection
To verify, put a breakpoint on the console.log(friends.length) line. The breakpoint will give the fetch() time to happen | I think the JSON you're passing to `.add()` is invalid. You've got:
```
[
{name: "James"},
{name: "Michael"}
]
```
But you need to quote the keys too:
```
[
{"name": "James"},
{"name": "Michael"}
]
``` |
17,085,030 | I'm trying to find the most simplistic way of adding a delay on this bootstrap dropdown...<http://www.bootply.com/64074> I have tried various methods and scripts but I cant seem to do it. I've added a css line to allow auto dropdown on mouseover.
```
<!-- Top Nav -->
<div class="navbar ... | 2013/06/13 | [
"https://Stackoverflow.com/questions/17085030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2402389/"
] | This JQuery did the trick! <http://www.bootply.com/64081>
```
jQuery('ul.nav li.dropdown').hover(function() {
jQuery(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn();
}, function() {
jQuery(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut();
... | For those that come across this thread later.. check out this great plugin that is Bootstrap 3 compatible and works with nav menus, buttons, button groups etc:
<https://github.com/CWSpear/bootstrap-hover-dropdown> |
17,085,030 | I'm trying to find the most simplistic way of adding a delay on this bootstrap dropdown...<http://www.bootply.com/64074> I have tried various methods and scripts but I cant seem to do it. I've added a css line to allow auto dropdown on mouseover.
```
<!-- Top Nav -->
<div class="navbar ... | 2013/06/13 | [
"https://Stackoverflow.com/questions/17085030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2402389/"
] | This JQuery did the trick! <http://www.bootply.com/64081>
```
jQuery('ul.nav li.dropdown').hover(function() {
jQuery(this).find('.dropdown-menu').stop(true, true).delay(200).fadeIn();
}, function() {
jQuery(this).find('.dropdown-menu').stop(true, true).delay(200).fadeOut();
... | If you are using submenus, need to add .first() after .find():
```
$('div.dropdown').hover(function() {
$(this).find('.dropdown-menu').first().stop(true, true).delay(100).fadeIn(100);
}, function() {
$(this).find('.dropdown-menu').first().stop(true, true).delay(200).fadeOut(300);
});
``` |
27,640,567 | Quite embarrassing, but I can't find the python source code on my Mac (Yosemite). Going through the Django tutorial and stuck on the step below.
Now create a directory called admin inside templates, and copy the template admin/base\_site.html from within the default Django admin template directory in the source code o... | 2014/12/24 | [
"https://Stackoverflow.com/questions/27640567",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3905394/"
] | Without virtualenv: **path/to/your/python/X.X/site-packages/django** . In my case **/Library/Python/2.7/site-packages/django**
using virtualenv: **/Users/ME/.virtualenvs/my\_virtual\_env/lib/python2.7/site-packages/django**
Good luck | In your finder window if you show the **Devices** on the left sidebar you can search within your **Macintosh HD** for the **Library** folder which should contain your **Frameworks** folder. At least that's what worked for me. |
916,312 | I want to prove that $I,A,A^2\:$matrices $\in M\_{2\times 2}$ are $\textit {linearly independent}$.
I consider the following matrices and their "corresponding" vectors:
$I=\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\to (1,0,0,1)$
$A=\begin{pmatrix} a & b \\ c & d \end{pmatrix}\to (a,b,c,d)$
$A^2=\begin{pmatrix} a... | 2014/09/01 | [
"https://math.stackexchange.com/questions/916312",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/124031/"
] | The thing you're trying to prove is not true. Consider the case $A = I$.
More generally, if $A$ is any $2 \times 2$ matrix, then you can compute its characteristic polynomial, $c(x)$, the determinant of $A - xI$. That will be some quadratic polynomial in $x$, like
$$
3x^2 - 22 x^1 + 8x^0.
$$
It turns out that if you... | First of all your matrix is a root of its [characteristic polynomial](http://en.wikipedia.org/wiki/Characteristic_polynomial#Formal_definition) . The bad news is that its square is linear dependant from its lower order terms. The good news is that the algebra generated by this matrix (if its characteristic polynomial i... |
2,305,990 | Using VB.Net
I want to get a all datagrid cell values, then insert into table1.
Code
```
cmd = New SqlCommand("insert into table1 values('" & DataGrid.Rows(0).Cells(0).Value & "', '" & DataGrid.Rows(0).Cells(1).Value & "', '" & DataGrid.Rows(0).Cells(2).Value & "', '" & DataGrid.Rows(0).Cells(3).Value & "')", con)
c... | 2010/02/21 | [
"https://Stackoverflow.com/questions/2305990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/128071/"
] | Sticking to your existing code, despite its flaws (definatly look up: [SQL Injection](http://en.wikipedia.org/wiki/SQL_injection))
You could do somthing like this:
```
For Each row As DataGridViewRow in dataGrid.Rows
cmd = New SqlCommand("insert into table1 values('" & row.Cells(0).Value & "', '" & row.Cells(1).... | First of all: avoid SQL Injection by using Parameters
Then: Loop over all rows and insert them
Pseudocode:
```
foreach(var row in DataGid.Rows)
{
insert();
}
``` |
68,790,977 | I make mini app to find factorial. When i click button and get number in `js` it is not showing any thing.
This is my `script.js`
```
function factorial() {
let number = document.getElementById("number")
console.log(number);
for (let i = number - 1; i >= 1; i++) {
number = i * number
console.log(number);
}
con... | 2021/08/15 | [
"https://Stackoverflow.com/questions/68790977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16221393/"
] | Like this for example:
```js
function factorial() {
let number = document.getElementById("number").value
console.log(number);
for (let i = number - 1; i >= 1; i--) {
number = i * number
}
document.getElementById("result").innerHTML = number
}
```
```html
<input type="text" name="number" class="number"... | There is a property called [.value](https://www.w3schools.com/jsref/prop_text_value.asp). This will return the inner value of inputs (You can try it). After you achieved the value of the input, then you can run your statement.
>
> Read about **.textContent** [here](https://developer.mozilla.org/en-US/docs/Web/API/Nod... |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | There is 3 options you can use:
**1**. You could uncheck your `Keep my email addresses private` in your [GitHub E-mail Settings](https://github.com/settings/emails).
**2**. If you want hide e-mail your repositories, GitHub provide a noreply e-mail address in GitHub e-mail settings
>
> Because you have email privacy... | Using Github Desktop fixed my issue. |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | 1. Open `Emails` section of github.com. Visit <https://github.com/settings/emails>.
2. Go to `Keep my email addresses private` section and note down your `donotreply` email id.
3. Open `git terminal` and set your `donotreply` email id as your email id using following command:
```
git config --global user.email "<your_... | 1. Just go to github.com and click on your profile
2. Go to settings
3. Now click on the 'Email' on the left navigation panel
4. And search for the field 'Keep my email addresses private'
5. Please uncheck this option
6. Now please check again and I think your problem is solved now. |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | There is 3 options you can use:
**1**. You could uncheck your `Keep my email addresses private` in your [GitHub E-mail Settings](https://github.com/settings/emails).
**2**. If you want hide e-mail your repositories, GitHub provide a noreply e-mail address in GitHub e-mail settings
>
> Because you have email privacy... | I solved the errors by:
`git config --global user.email ""`
This just sets my email to blank (an empty string). I now set my email in individual projects with:
`git config user.email "myemail@domain.com"` |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | 1. Open `Emails` section of github.com. Visit <https://github.com/settings/emails>.
2. Go to `Keep my email addresses private` section and note down your `donotreply` email id.
3. Open `git terminal` and set your `donotreply` email id as your email id using following command:
```
git config --global user.email "<your_... | Using Github Desktop fixed my issue. |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | 1. Just go to github.com and click on your profile
2. Go to settings
3. Now click on the 'Email' on the left navigation panel
4. And search for the field 'Keep my email addresses private'
5. Please uncheck this option
6. Now please check again and I think your problem is solved now. | Using Github Desktop fixed my issue. |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | This is likely caused by a [new GitHub setting](https://github.com/blog/2346-private-emails-now-more-private) that blocks command line pushes that expose your email address.
Try unchecking the "Block command line pushes that expose my email" box in your [email settings](https://github.com/settings/emails) and then pus... | I solved the errors by:
`git config --global user.email ""`
This just sets my email to blank (an empty string). I now set my email in individual projects with:
`git config user.email "myemail@domain.com"` |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | I solved the errors by:
`git config --global user.email ""`
This just sets my email to blank (an empty string). I now set my email in individual projects with:
`git config user.email "myemail@domain.com"` | Using Github Desktop fixed my issue. |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | The remote repository has been configured to disallow you pushing a commit that would reveal your personal e-mail address. For example in GitHub you have checked the [*Block command line pushes that expose my email*](https://github.com/settings/emails) checkbox to [enable this](https://github.com/blog/2346-private-emai... | This is likely caused by a [new GitHub setting](https://github.com/blog/2346-private-emails-now-more-private) that blocks command line pushes that expose your email address.
Try unchecking the "Block command line pushes that expose my email" box in your [email settings](https://github.com/settings/emails) and then pus... |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | This is likely caused by a [new GitHub setting](https://github.com/blog/2346-private-emails-now-more-private) that blocks command line pushes that expose your email address.
Try unchecking the "Block command line pushes that expose my email" box in your [email settings](https://github.com/settings/emails) and then pus... | There is 3 options you can use:
**1**. You could uncheck your `Keep my email addresses private` in your [GitHub E-mail Settings](https://github.com/settings/emails).
**2**. If you want hide e-mail your repositories, GitHub provide a noreply e-mail address in GitHub e-mail settings
>
> Because you have email privacy... |
43,378,060 | I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.
The message is:
```
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanl... | 2017/04/12 | [
"https://Stackoverflow.com/questions/43378060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138579/"
] | This is likely caused by a [new GitHub setting](https://github.com/blog/2346-private-emails-now-more-private) that blocks command line pushes that expose your email address.
Try unchecking the "Block command line pushes that expose my email" box in your [email settings](https://github.com/settings/emails) and then pus... | 1. Just go to github.com and click on your profile
2. Go to settings
3. Now click on the 'Email' on the left navigation panel
4. And search for the field 'Keep my email addresses private'
5. Please uncheck this option
6. Now please check again and I think your problem is solved now. |
51,538,453 | I need to create a new table, based on two existing.
<http://sqlfiddle.com/#!9/74e49>
It must contain number of instances of every particular value from table1 in table2. Like:
* Name - koatuu1 - koatuu2 - koatuu3 - koatuu\_N ... koatuu\_350
* Johnson - 5 - 12 - 76 - 9 - 321 - 4
It must be something like this for eve... | 2018/07/26 | [
"https://Stackoverflow.com/questions/51538453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5896632/"
] | As per the answer given by google this is intended behaviour.
<https://issuetracker.google.com/issues/111819103>
They gave 3 options
1. Use android.view.ViewOutlineProvider (as per example here <https://github.com/googlesamples/android-ClippingBasic>).
2. Replace the ImageView with a BitmapShader, which is fast (... | Yep, I have encountered the same problem.
Maybe Android-Pie does not seem to support drawerDuff.Mode on drawPath ...
But, you still can be use drawBitmap to cut layers.
E.g:
```
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
if (clipPathBitmap != null) {
canvas.drawBitmap(cl... |
29,558 | We sell buttons (for the plug). Each of the buttons will cost 2,- Euro. A defined set of 3 buttons will cost 5,- EUR. All individual buttons are created as simple products. So far so good.
I have already tried a lot. The problems are:
* Grouped: The customer can define the number but the number is set).
* Bundle: com... | 2014/07/21 | [
"https://magento.stackexchange.com/questions/29558",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/12395/"
] | If you want to offer this defined set with its own product page, bundle products are the perfect fit.
To address your problems:
* When you create a bundle, you can choose to give it a fixed price instead of dynamic price, this means the price will not depend on the simple products.
* If you make the bundle options re... | If all the products are the same you can use tiered prices. If not, you can set promotions/discount rules to match a certain criteria.
Most of what you need might be [here.](http://www.magentocommerce.com/wiki/welcome_to_the_magento_user_s_guide/chapter_5) |
66,525,073 | Consider a simple array that contains a set of values.
```
var arr = ['ab', 'cd', 'ef'];
```
I'd like to convert the above array into,
```
[
{ name: 'ab' },
{ name: 'cd' },
{ name: 'ef' }
];
```
What I've tried:
```
arr.reduce((a, c) => ((a[c] = c), a), {});
``` | 2021/03/08 | [
"https://Stackoverflow.com/questions/66525073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5475148/"
] | You can do this using `Array.map`, which allows you to specify a function that returns a new item to replace in the array.
```js
arr.map(o => ({ name: o }))
```
Here's one without fancy arrow function shorthand, just in case you are confused.
```js
arr.map(function(o) {
return {
name: o,
}
})
``` | You can use forEach() and create a new array of objects pushing each new object.
```
var arr = ['ab', 'cd', 'ef'];
const newObjArr = [];
arr.forEach((str) => newObjArr.push({ name: str }))
console.log(newObjArr); //[ { name: 'ab' }, { name: 'cd' }, { name: 'ef' } ]
``` |
66,525,073 | Consider a simple array that contains a set of values.
```
var arr = ['ab', 'cd', 'ef'];
```
I'd like to convert the above array into,
```
[
{ name: 'ab' },
{ name: 'cd' },
{ name: 'ef' }
];
```
What I've tried:
```
arr.reduce((a, c) => ((a[c] = c), a), {});
``` | 2021/03/08 | [
"https://Stackoverflow.com/questions/66525073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5475148/"
] | You can do this using `Array.map`, which allows you to specify a function that returns a new item to replace in the array.
```js
arr.map(o => ({ name: o }))
```
Here's one without fancy arrow function shorthand, just in case you are confused.
```js
arr.map(function(o) {
return {
name: o,
}
})
``` | >
> You've tried: `arr.reduce((a, c) => ((a[c] = c), a), {});`
>
>
>
Your code there are 2 problems:
1. `{}`: The initialValue should be the `Array` instead.
2. `(a[c] = c`: You want to define the specific `name` instead of each `c` value
[**The `.reduce` syntax**](https://developer.mozilla.org/en-US/docs/Web/Ja... |
66,525,073 | Consider a simple array that contains a set of values.
```
var arr = ['ab', 'cd', 'ef'];
```
I'd like to convert the above array into,
```
[
{ name: 'ab' },
{ name: 'cd' },
{ name: 'ef' }
];
```
What I've tried:
```
arr.reduce((a, c) => ((a[c] = c), a), {});
``` | 2021/03/08 | [
"https://Stackoverflow.com/questions/66525073",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5475148/"
] | You can do this using `Array.map`, which allows you to specify a function that returns a new item to replace in the array.
```js
arr.map(o => ({ name: o }))
```
Here's one without fancy arrow function shorthand, just in case you are confused.
```js
arr.map(function(o) {
return {
name: o,
}
})
``` | Another way using [`With Object.fromEntries, you can convert from Array to Object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries)
```js
const arr = ['ab', 'cd', 'ef'];
const result = arr.map(item => Object.fromEntries([["name",item]]));
console.log(result);
``` |
12,088,519 | Well, here is the code I've tried so far.
```
public class CustomDateEditorRegistrar implements PropertyEditorRegistrar {
public void registerCustomEditors(PropertyEditorRegistry registry) {
registry.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy hh:mm a"), true))
... | 2012/08/23 | [
"https://Stackoverflow.com/questions/12088519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1619251/"
] | You may want to take a look at this:
[Grails Date unmarshalling](https://stackoverflow.com/questions/963922/grails-date-unmarshalling)
and this
[Binding a Grails date from params in a controller](https://stackoverflow.com/questions/2871977/binding-a-grails-date-from-params-in-a-controller) | I don't think you can register multiple editors for the same type, so I would instead write my own `MultiDateEditor` subclass of `CustomDateEditor` (or implement `PropertyEditorSupport` directly) which tries to bind a date using multiple formats. Then you only need to register `MultiDateEditor`:
```
public class Custo... |
261,602 | Here is my code for overriding vendor module template. when the page corresponding to this layout loads, it is fetching template file from vendor.after the refresh it is fetching from my custom module.Please help.
```
<referenceBlock name="items">
<action method="setTemplate">
<argument name="templ... | 2019/02/13 | [
"https://magento.stackexchange.com/questions/261602",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/76593/"
] | Below layouts are to be overrided.
* sales\_order\_create\_index.xml
* sales\_order\_create\_load\_block\_items.xml
* sales\_order\_create\_load\_block\_data.xml | You should put this in module.xml
```
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="My_Sales" setup_version="0.0.1">
<sequence>
<module name="Magento_Checko... |
42,997,363 | Below is datasource.jsp for adding dynamic dropdown into my customComponent dialog, I'm using this datasource in my customComponent as below mentioned field.
Here my requirement is need to get url values to dropdown when my customComponent used in any page(this page having urls). So here i need that currentPage url whe... | 2017/03/24 | [
"https://Stackoverflow.com/questions/42997363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4895053/"
] | You can achieve this using:
jQuery:
```
$('.desktop-button.tiny').attr('name', 'login_button');
```
Or Javascript:
```
document.querySelector(".desktop-button.tiny").setAttribute("name", "login_button");
```
```js
var addNameAttr = function () {
$('.desktop-button.tiny').attr('name', 'login_button');
conso... | You can select the button using its classes, `.desktop-button .tiny`.
Together with setting the name attribute, this would result in:
jQuery:
```
$(".desktop-button.tiny").attr("name", "login_button");
```
Pure JavaScript:
```
document.querySelector(".desktop-button.tiny").setAttribute("name", "login_button");
`... |
42,997,363 | Below is datasource.jsp for adding dynamic dropdown into my customComponent dialog, I'm using this datasource in my customComponent as below mentioned field.
Here my requirement is need to get url values to dropdown when my customComponent used in any page(this page having urls). So here i need that currentPage url whe... | 2017/03/24 | [
"https://Stackoverflow.com/questions/42997363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4895053/"
] | You can achieve this using:
jQuery:
```
$('.desktop-button.tiny').attr('name', 'login_button');
```
Or Javascript:
```
document.querySelector(".desktop-button.tiny").setAttribute("name", "login_button");
```
```js
var addNameAttr = function () {
$('.desktop-button.tiny').attr('name', 'login_button');
conso... | You first need to obtain the element and then set the name attribute.
Without jquery this would be:
```
<button id='my-button' type="submit" class="desktop-button tiny" onclick="document.stacks_in_3151032_page6.formAction.value = 1'login';">LOGIN</button>
document.getElementById('my-button').setAttribute('name', 'lo... |
779,033 | I tried using the Monte Carlo Method to approximate the sum $\sum\_{1}^{10000}e^{\frac{k}{10000}}$. First I genarating 100 random numbers in (1, 10000). Then by the strong law of large numbers:
$$\sum\_{i=1}^{100}\frac{f(U\_i)}{k} \to E[f(U)] = \theta$$
where:
$$\theta = \int\_{1}^{10000}e^{\frac{x}{10000}}dx$$
The ... | 2014/05/03 | [
"https://math.stackexchange.com/questions/779033",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/147464/"
] | You are confusing a few different concepts:
* You write $\frac{1}{k}\sum\_{i=1}^{100}f(U\_i)\to\mathbb{E}[f(U)]$ when you clearly mean $\frac{1}{100}\sum\_{i=1}^{100}f(U\_i)\approx\mathbb{E}[f(U)]$.
* You talk about random numbers in $\{1,\dots,10000\}$ (implying that you choose them uniformly). This is therefore a di... | This looks slightly messy to me, in that we are mixing to different approximations: an integral that is (numerically) approximated by a sum, and a integral (or a sum) that is (probabilistically) approximated by a Montecarlo extraction.
There is no need to convert the integral to a (approximate) sum to evaluate it via ... |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | You could use transmute, e.g.
```r
library(dplyr)
df <- data.frame(
A_1 = c(NA, NA, 3, 4, 5),
A_2 = c(1, 2, NA, NA, NA),
B_1 = c(NA, NA, 13, 14, 15),
B_2 = c(11, 12, NA, NA, NA)
)
df %>%
transmute(A = coalesce(A_1, A_2),
B = coalesce(B_1, B_2))
#> A B
#> 1 1 11
#> 2 2 12
#> 3 3 13
#> 4 4 1... | Edit: I believe this solution continues to work even after your edit. It works regardless of the number of elements or the number of cores per element. You just need to make sure things are named consistently, in the form `"{element}_{core}"`.
```
library(tidyverse)
df %>%
mutate(id = 1:n()) %>%
pivot_longer(-id... |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | You could use transmute, e.g.
```r
library(dplyr)
df <- data.frame(
A_1 = c(NA, NA, 3, 4, 5),
A_2 = c(1, 2, NA, NA, NA),
B_1 = c(NA, NA, 13, 14, 15),
B_2 = c(11, 12, NA, NA, NA)
)
df %>%
transmute(A = coalesce(A_1, A_2),
B = coalesce(B_1, B_2))
#> A B
#> 1 1 11
#> 2 2 12
#> 3 3 13
#> 4 4 1... | Here is another more concise solution, comparing to my other one. I think the use of `cur_data()` function is very helpful but you could also use `across(everything())` in its place:
```
library(dplyr)
library(purrr)
unique(sub("(\\D)_\\d+", "\\1", names(df))) %>%
map_dfc(~ df %>%
select(starts_with(.x)... |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | Here is another more concise solution, comparing to my other one. I think the use of `cur_data()` function is very helpful but you could also use `across(everything())` in its place:
```
library(dplyr)
library(purrr)
unique(sub("(\\D)_\\d+", "\\1", names(df))) %>%
map_dfc(~ df %>%
select(starts_with(.x)... | Here is an alternative with pivoting:
```
library(dplyr)
library(tidyr)
df %>%
pivot_longer(
everything()
) %>%
mutate(name = substr(name, 1, 1)) %>%
na.omit %>%
pivot_wider(
names_from = name,
values_from = value,
values_fn = list
) %>%
unnest(cols = c(A, B))
```
```
A B... |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | A base R option
```
list2DF(
lapply(
split.default(df, gsub("_.*", "", names(df))),
rowSums,
na.rm = TRUE
)
)
```
gives
```
A B
1 1 11
2 2 12
3 3 13
4 4 14
5 5 15
``` | I have asked for it here: <https://github.com/tidyverse/dplyr/issues/6109> where there are some possible solutions. For example
```r
library(dplyr)
library(purrr)
df %>%
transmute(map2_dfc(.x = across(ends_with("_1"), .names = '{sub("_1","",.col)}'),
.y = across(ends_with("_2")),
... |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | You could use transmute, e.g.
```r
library(dplyr)
df <- data.frame(
A_1 = c(NA, NA, 3, 4, 5),
A_2 = c(1, 2, NA, NA, NA),
B_1 = c(NA, NA, 13, 14, 15),
B_2 = c(11, 12, NA, NA, NA)
)
df %>%
transmute(A = coalesce(A_1, A_2),
B = coalesce(B_1, B_2))
#> A B
#> 1 1 11
#> 2 2 12
#> 3 3 13
#> 4 4 1... | Here is an alternative with pivoting:
```
library(dplyr)
library(tidyr)
df %>%
pivot_longer(
everything()
) %>%
mutate(name = substr(name, 1, 1)) %>%
na.omit %>%
pivot_wider(
names_from = name,
values_from = value,
values_fn = list
) %>%
unnest(cols = c(A, B))
```
```
A B... |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | A base R option
```
list2DF(
lapply(
split.default(df, gsub("_.*", "", names(df))),
rowSums,
na.rm = TRUE
)
)
```
gives
```
A B
1 1 11
2 2 12
3 3 13
4 4 14
5 5 15
``` | Edit: I believe this solution continues to work even after your edit. It works regardless of the number of elements or the number of cores per element. You just need to make sure things are named consistently, in the form `"{element}_{core}"`.
```
library(tidyverse)
df %>%
mutate(id = 1:n()) %>%
pivot_longer(-id... |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | Here is another more concise solution, comparing to my other one. I think the use of `cur_data()` function is very helpful but you could also use `across(everything())` in its place:
```
library(dplyr)
library(purrr)
unique(sub("(\\D)_\\d+", "\\1", names(df))) %>%
map_dfc(~ df %>%
select(starts_with(.x)... | Edit: I believe this solution continues to work even after your edit. It works regardless of the number of elements or the number of cores per element. You just need to make sure things are named consistently, in the form `"{element}_{core}"`.
```
library(tidyverse)
df %>%
mutate(id = 1:n()) %>%
pivot_longer(-id... |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | You could use transmute, e.g.
```r
library(dplyr)
df <- data.frame(
A_1 = c(NA, NA, 3, 4, 5),
A_2 = c(1, 2, NA, NA, NA),
B_1 = c(NA, NA, 13, 14, 15),
B_2 = c(11, 12, NA, NA, NA)
)
df %>%
transmute(A = coalesce(A_1, A_2),
B = coalesce(B_1, B_2))
#> A B
#> 1 1 11
#> 2 2 12
#> 3 3 13
#> 4 4 1... | A base R option
```
list2DF(
lapply(
split.default(df, gsub("_.*", "", names(df))),
rowSums,
na.rm = TRUE
)
)
```
gives
```
A B
1 1 11
2 2 12
3 3 13
4 4 14
5 5 15
``` |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | You could use transmute, e.g.
```r
library(dplyr)
df <- data.frame(
A_1 = c(NA, NA, 3, 4, 5),
A_2 = c(1, 2, NA, NA, NA),
B_1 = c(NA, NA, 13, 14, 15),
B_2 = c(11, 12, NA, NA, NA)
)
df %>%
transmute(A = coalesce(A_1, A_2),
B = coalesce(B_1, B_2))
#> A B
#> 1 1 11
#> 2 2 12
#> 3 3 13
#> 4 4 1... | I have asked for it here: <https://github.com/tidyverse/dplyr/issues/6109> where there are some possible solutions. For example
```r
library(dplyr)
library(purrr)
df %>%
transmute(map2_dfc(.x = across(ends_with("_1"), .names = '{sub("_1","",.col)}'),
.y = across(ends_with("_2")),
... |
70,442,285 | I want a code to be highlighted like this
jmp **label** ;comments
I want only **label** to be highlighted. I've tried something like this
context exclusive jmp\t \n brightmagenta
But in this case ";comments" turned brightmagenta as well which is not what I want. For the comments there is another exclusive context. ... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70442285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17735779/"
] | A base R option
```
list2DF(
lapply(
split.default(df, gsub("_.*", "", names(df))),
rowSums,
na.rm = TRUE
)
)
```
gives
```
A B
1 1 11
2 2 12
3 3 13
4 4 14
5 5 15
``` | Here is an alternative with pivoting:
```
library(dplyr)
library(tidyr)
df %>%
pivot_longer(
everything()
) %>%
mutate(name = substr(name, 1, 1)) %>%
na.omit %>%
pivot_wider(
names_from = name,
values_from = value,
values_fn = list
) %>%
unnest(cols = c(A, B))
```
```
A B... |
52,591,696 | Suppose I have several dataframes: df1, df2, df3, etc. The label with each dataframes is A1, A2, A3 etc. I want to use this information as a whole, so that I can pass them. Three methods came into my mind:
### method 1
use a label list: `labels=["A1", "A2", "A3"...]` and a list of dataframes `dfs=[df1, df2, df3...]`.... | 2018/10/01 | [
"https://Stackoverflow.com/questions/52591696",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2794152/"
] | An `OrderedDict` would probably be more conventional than using a series for this.
```
from collections import OrderedDict
d = OrderedDict([("A1", df1), ("A2", df2), ("A3", df3)])
```
This can easily be iterated over:
```
for label, df in d:
print(label, df)
```
That said I can't see any strong reason not to ... | Method 2 also works. Since Python 3.6 it remembers the order it is created too. |
727,766 | I am trying to bind data from SQL to a repeater control. I have tried what I usually do for a Gridview and it doesn't work. I would like to see an example whether it be using an SQLAdapter or using ExecuteReader from a command. Thank you!
```
string sql = "SELECT [WallPost], [DatePosted] FROM [WallTable] WHERE [UserId... | 2009/04/07 | [
"https://Stackoverflow.com/questions/727766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/84786/"
] | Using an example I had knocked up the other day
```
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"
AutoEventWireup="true"CodeFile="Default.aspx.cs" Inherits="Default2"
Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Con... | Doing it on the html (as in John Nolans answer) side is easier with the repeater since it uses templates.
If you want to do it in code behind, create a class that implements ITemplate then place it like so:
```
myRepeater.ItemTemplate = new MyTemplateClass();
``` |
3,955,820 | On my site, I load jQuery UI script using the following code:
`wp_enqueue_script('nf-jquery-ui','http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js')`
In my plugin I use the following code:
`wp_enqueue_script('wp_filebrowser-jqueryui','http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.j... | 2010/10/17 | [
"https://Stackoverflow.com/questions/3955820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/91612/"
] | You could deregister the first script by putting this line in your plugin...
```
wp_deregister_script( 'nf-jquery-ui');
```
before you call your 'enqueue script'
```
wp_enqueue_script('wp_filebrowser-jqueryui','http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js')
```
This should remove the first jQ... | The [WP API states](http://codex.wordpress.org/Function_Reference/wp_enqueue_script) the first param is a handler. That one is probably used so a script is only inserted once (although I can not say for sure).
It also [defines handlers](http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Default_scripts_in... |
42,493,272 | simple project, but a beginner at programming, so struggling. I am trying to set a couple of buttons to create a slider to change pictures. My problem is that when I set the position attribute to absolute in the div that contains the buttons, the div element that contains the buttons disappears.
So this is a screensho... | 2017/02/27 | [
"https://Stackoverflow.com/questions/42493272",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5684416/"
] | Try setting the z-index on the buttons to a value larger than that of the image (5).
```
.buttons {
cursor: pointer;
position: relative;
z-index: 10;
}
``` | Your container, `#imagewrap`, has `overflow: hidden`. When you make its children `position: absolute`, you remove them from calculations determining the size of the parent element, so the parent is no longer large enough to display the children. That means they are overflow, which you have specified should be hidden.
... |
110,768 | I have created a SharePoint 2013 Workflow in Visual Studio 2012. This workflow is activated when a list item is modified.
Once the list item modified, the workflow shows as the started. But on clicking "started" or "workflow name", it throws an error:
>
> The given key was not present in the dictionary.
>
>
> **S... | 2014/08/05 | [
"https://sharepoint.stackexchange.com/questions/110768",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/4399/"
] | Yes it is possible.
It is a SharePoint limitation, each Workflow is associated with one Task list and one History list but we can overcome this by creating 2010 workflow and call that in 2013 workflow.
SharePoint designer workflow 2013 allows you to call 2010 site workflows or List workflows.
So, you can create t... | Yes it is possible.
You can use SharePoint Designer to create the workflow and create new items to any(or multiple) lists.
Regards |
27,163,209 | I am new at Symfony. My Symfony version is 2.5.7 I have generated a CRUD using "`generate:doctrine:crud`".
There is a delete button, in the view of each entry. I want to add css class inside button.
For this button, the generated code is -
```
{{ form(delete_form) }}
```
By inspection from the browser, I got -
... | 2014/11/27 | [
"https://Stackoverflow.com/questions/27163209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/622896/"
] | I have solved the problem.. :) but not from twig.. from controller.. I have added the css class to `createDeleteForm()` method...
```
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('book_delete', array('id' => $id)))
->setMe... | Expanding on [Zed's](https://stackoverflow.com/a/27165580/1069375) answer, but I also needed the label in another language, all without touching anything other than the TWIG template:
```
{{ form_widget(delete_form.submit, {'label': 'Usuń', 'attr': {'class': 'btn btn-danger btn-lg', 'type': 'button', 'title': 'DELE... |
27,163,209 | I am new at Symfony. My Symfony version is 2.5.7 I have generated a CRUD using "`generate:doctrine:crud`".
There is a delete button, in the view of each entry. I want to add css class inside button.
For this button, the generated code is -
```
{{ form(delete_form) }}
```
By inspection from the browser, I got -
... | 2014/11/27 | [
"https://Stackoverflow.com/questions/27163209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/622896/"
] | I have solved the problem.. :) but not from twig.. from controller.. I have added the css class to `createDeleteForm()` method...
```
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('book_delete', array('id' => $id)))
->setMe... | All the answers here works to add the class to the submit button. However, if one just uses this line with delete\_form.submit the form won't work. The complete answer is:
```
{{ form_start(delete_form) }}
{{ form_widget(delete_form.submit, { 'attr': {'class': 'btn btn-danger', 'type': 'button'} }) }}
{{ form_end(dele... |
27,163,209 | I am new at Symfony. My Symfony version is 2.5.7 I have generated a CRUD using "`generate:doctrine:crud`".
There is a delete button, in the view of each entry. I want to add css class inside button.
For this button, the generated code is -
```
{{ form(delete_form) }}
```
By inspection from the browser, I got -
... | 2014/11/27 | [
"https://Stackoverflow.com/questions/27163209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/622896/"
] | Remove `{ 'label': 'Delete' }` and it should work. Here is an example:
```
{{ form_widget(delete_form.submit, { 'attr': {'class': 'btn btn-danger btn-lg', 'type': 'button'} }) }}
``` | Expanding on [Zed's](https://stackoverflow.com/a/27165580/1069375) answer, but I also needed the label in another language, all without touching anything other than the TWIG template:
```
{{ form_widget(delete_form.submit, {'label': 'Usuń', 'attr': {'class': 'btn btn-danger btn-lg', 'type': 'button', 'title': 'DELE... |
27,163,209 | I am new at Symfony. My Symfony version is 2.5.7 I have generated a CRUD using "`generate:doctrine:crud`".
There is a delete button, in the view of each entry. I want to add css class inside button.
For this button, the generated code is -
```
{{ form(delete_form) }}
```
By inspection from the browser, I got -
... | 2014/11/27 | [
"https://Stackoverflow.com/questions/27163209",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/622896/"
] | Remove `{ 'label': 'Delete' }` and it should work. Here is an example:
```
{{ form_widget(delete_form.submit, { 'attr': {'class': 'btn btn-danger btn-lg', 'type': 'button'} }) }}
``` | All the answers here works to add the class to the submit button. However, if one just uses this line with delete\_form.submit the form won't work. The complete answer is:
```
{{ form_start(delete_form) }}
{{ form_widget(delete_form.submit, { 'attr': {'class': 'btn btn-danger', 'type': 'button'} }) }}
{{ form_end(dele... |
22,527,216 | For good understanding I will take a simple abstraction of DHCP lease as example: The lease contains the IP and MAC address, the time it was granted at and can be renewed with a given time span. Once expired an event will be invoked. Again, this is just serving as the most minimal example I could come up with:
```
usi... | 2014/03/20 | [
"https://Stackoverflow.com/questions/22527216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3333312/"
] | Rather than creating thousands of timers, you could just store the expiration time of each `Lease` object, then in a single thread query for the expired ones periodically.
An off the top of my head code example:
```
var leases = new List<Lease>();
var running = true;
var expiredChecker = Task.Factory.StartNew(() =>
... | According to the [`System.Timers.Timer` MSDN page](http://msdn.microsoft.com/en-us/library/system.timers.timer%28v=vs.110%29.aspx):
>
> The server-based Timer is designed for use with worker threads in a
> multithreaded environment. Server timers can move among threads to
> handle the raised Elapsed event, resultin... |
22,527,216 | For good understanding I will take a simple abstraction of DHCP lease as example: The lease contains the IP and MAC address, the time it was granted at and can be renewed with a given time span. Once expired an event will be invoked. Again, this is just serving as the most minimal example I could come up with:
```
usi... | 2014/03/20 | [
"https://Stackoverflow.com/questions/22527216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3333312/"
] | I would suppose this depends partly on what resources you have available on your server, and what kind of accuracy and performance you need.
An alternative approach might be to store something as simple as a time stamp in each instance, and checking that value regularly, comparing it to current time, and updating it ... | According to the [`System.Timers.Timer` MSDN page](http://msdn.microsoft.com/en-us/library/system.timers.timer%28v=vs.110%29.aspx):
>
> The server-based Timer is designed for use with worker threads in a
> multithreaded environment. Server timers can move among threads to
> handle the raised Elapsed event, resultin... |
22,527,216 | For good understanding I will take a simple abstraction of DHCP lease as example: The lease contains the IP and MAC address, the time it was granted at and can be renewed with a given time span. Once expired an event will be invoked. Again, this is just serving as the most minimal example I could come up with:
```
usi... | 2014/03/20 | [
"https://Stackoverflow.com/questions/22527216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3333312/"
] | Rather than creating thousands of timers, you could just store the expiration time of each `Lease` object, then in a single thread query for the expired ones periodically.
An off the top of my head code example:
```
var leases = new List<Lease>();
var running = true;
var expiredChecker = Task.Factory.StartNew(() =>
... | I recommend use a `System.Threading.Timer` instead of the `System.Timers.Timer`. The second one is wrapper about the first one to be visible in the design time and it is not necessary if you really don't need design time support. **Timer internally calls ThreadPool.QueueUseWorkItem**, than threadpool is responsible for... |
22,527,216 | For good understanding I will take a simple abstraction of DHCP lease as example: The lease contains the IP and MAC address, the time it was granted at and can be renewed with a given time span. Once expired an event will be invoked. Again, this is just serving as the most minimal example I could come up with:
```
usi... | 2014/03/20 | [
"https://Stackoverflow.com/questions/22527216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3333312/"
] | I would suppose this depends partly on what resources you have available on your server, and what kind of accuracy and performance you need.
An alternative approach might be to store something as simple as a time stamp in each instance, and checking that value regularly, comparing it to current time, and updating it ... | I recommend use a `System.Threading.Timer` instead of the `System.Timers.Timer`. The second one is wrapper about the first one to be visible in the design time and it is not necessary if you really don't need design time support. **Timer internally calls ThreadPool.QueueUseWorkItem**, than threadpool is responsible for... |
48,166,675 | I have 3 tables (T\_BONUS\_TAB, T\_COND, T\_BONUS\_COND\_LINK).
One of them connects (T\_BONUS\_COND\_LINK) two other tables.
This table has 3 columns: bonus\_id, cond\_id (references to parent tables) and another column with additional value (priority).
```
create table T_BONUS_COND_LINK
(
cond_id NUMBER(9) no... | 2018/01/09 | [
"https://Stackoverflow.com/questions/48166675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7913988/"
] | The big difference is that with the `else`, the second condition will not be checked *at all* if the first condition was true. Without the `else`, the second condition will be checked.
Ramifications of that:
* If the conditions are not mutually-exclusive, without the `else` both could match and both `if` bodies could... | **In your example it makes no difference** but now if you have something a little bit **different** like this:
```
if (x >= 1) {
System.out.println("Hello!");
}
if (x <= 1) {
System.out.println("Bye!");
}
```
It will print the two string (if x equal 1) as the conditions are both `true` |
48,166,675 | I have 3 tables (T\_BONUS\_TAB, T\_COND, T\_BONUS\_COND\_LINK).
One of them connects (T\_BONUS\_COND\_LINK) two other tables.
This table has 3 columns: bonus\_id, cond\_id (references to parent tables) and another column with additional value (priority).
```
create table T_BONUS_COND_LINK
(
cond_id NUMBER(9) no... | 2018/01/09 | [
"https://Stackoverflow.com/questions/48166675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7913988/"
] | **In your example it makes no difference** but now if you have something a little bit **different** like this:
```
if (x >= 1) {
System.out.println("Hello!");
}
if (x <= 1) {
System.out.println("Bye!");
}
```
It will print the two string (if x equal 1) as the conditions are both `true` | The difference is on the runtime. In the if...else if... case if the case of if it is correct the else if will not be examined. In if.. and then another if.. both the cases of if's will be examined, so on the runtime you have one more comparison. In such a small programm will not make the difference, but consider a hug... |
48,166,675 | I have 3 tables (T\_BONUS\_TAB, T\_COND, T\_BONUS\_COND\_LINK).
One of them connects (T\_BONUS\_COND\_LINK) two other tables.
This table has 3 columns: bonus\_id, cond\_id (references to parent tables) and another column with additional value (priority).
```
create table T_BONUS_COND_LINK
(
cond_id NUMBER(9) no... | 2018/01/09 | [
"https://Stackoverflow.com/questions/48166675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7913988/"
] | The big difference is that with the `else`, the second condition will not be checked *at all* if the first condition was true. Without the `else`, the second condition will be checked.
Ramifications of that:
* If the conditions are not mutually-exclusive, without the `else` both could match and both `if` bodies could... | As far as the logic is concerned, as long as the two statements use mutually exclusive condition, and it is not possible to change `x` concurrently with your running thread, there would be no difference.
However,
* There would be a difference in execution if `x` is modified concurrently: the second version could prod... |
48,166,675 | I have 3 tables (T\_BONUS\_TAB, T\_COND, T\_BONUS\_COND\_LINK).
One of them connects (T\_BONUS\_COND\_LINK) two other tables.
This table has 3 columns: bonus\_id, cond\_id (references to parent tables) and another column with additional value (priority).
```
create table T_BONUS_COND_LINK
(
cond_id NUMBER(9) no... | 2018/01/09 | [
"https://Stackoverflow.com/questions/48166675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7913988/"
] | The big difference is that with the `else`, the second condition will not be checked *at all* if the first condition was true. Without the `else`, the second condition will be checked.
Ramifications of that:
* If the conditions are not mutually-exclusive, without the `else` both could match and both `if` bodies could... | The difference is on the runtime. In the if...else if... case if the case of if it is correct the else if will not be examined. In if.. and then another if.. both the cases of if's will be examined, so on the runtime you have one more comparison. In such a small programm will not make the difference, but consider a hug... |
48,166,675 | I have 3 tables (T\_BONUS\_TAB, T\_COND, T\_BONUS\_COND\_LINK).
One of them connects (T\_BONUS\_COND\_LINK) two other tables.
This table has 3 columns: bonus\_id, cond\_id (references to parent tables) and another column with additional value (priority).
```
create table T_BONUS_COND_LINK
(
cond_id NUMBER(9) no... | 2018/01/09 | [
"https://Stackoverflow.com/questions/48166675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7913988/"
] | As far as the logic is concerned, as long as the two statements use mutually exclusive condition, and it is not possible to change `x` concurrently with your running thread, there would be no difference.
However,
* There would be a difference in execution if `x` is modified concurrently: the second version could prod... | The difference is on the runtime. In the if...else if... case if the case of if it is correct the else if will not be examined. In if.. and then another if.. both the cases of if's will be examined, so on the runtime you have one more comparison. In such a small programm will not make the difference, but consider a hug... |
203,022 | On Christmas I got a 3DS XL with new Super Mario Bros. 2 Gold Edition. I wanted to do a system transfer from my old 3DS. But after the transfer my Mario game was gone.
How should I get my game back? | 2015/01/26 | [
"https://gaming.stackexchange.com/questions/203022",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/100565/"
] | If you did a system transfer, it should have transferred the downloaded game and/or any save data as long as you followed all of the instructions, and moved the SD card from the old 3DS to the new one.
You can try redownloading the game from the 3DS eShop, if you connected your Nintendo ID to it and that information ... | When you get a new 3DS with a game pre-installed, and you transferred data to that 3DS, the game will be gone. Simply re-download it for free off the e-shop. Save data stays as I redownloaded games I already had digitally and all my progress stayed intact. |
72,385,128 | I have a working script that contains the following code in a method of a custom class:
```
destination = this
._source
.makeCopy(
this._name,
this._folder
)
.setStarred(true);
```
This script is taking approximately 15 seconds to complete. `this._source` is an instance of DriveApp.File (`DriveApp.ge... | 2022/05/25 | [
"https://Stackoverflow.com/questions/72385128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/579701/"
] | **SUGGESTION:**
You could try [Drive API V2 Files:copy](https://developers.google.com/drive/api/v2/reference/files/copy) method. Initially tested this on a 280kb sheets file which resulted in 11000 milliseconds in computation time using the API Explorer. | ### Not sure if it's faster all of the time but it seems faster to me
```
function makeCopy() {
var folderid = "dfolderid";
var fileid = "fileid";
var folder = Drive.Files.get(folderid, { "supportsAllDrives": true });
var newFile = { "fileId": fileid, "parents": [folder] };
var args = { "resource": { "parent... |
17,367,700 | I have created a form with the option to dynamically add fields with excellent code help from <http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/>. The only issue is that I want the fields to generate without also showing new 'Add' and 'Remove' buttons. How should I go about doing this?... | 2013/06/28 | [
"https://Stackoverflow.com/questions/17367700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2532297/"
] | Like this?
```
var arrClasses = [];
$("div[class*='some-class-']").removeClass(function () { // Select the element divs which has class that starts with some-class-
var className = this.className.match(/some-class-\d+/); //get a match to match the pattern some-class-somenumber and extract that classname
if (cl... | You could loop through all the elements, pull the class name using a regular expression, and store them in an array:
```js
var classNames = [];
$('div[class*="some-class-"]').each(function(i, el){
var name = (el.className.match(/(^|\s)(some\-class\-[^\s]*)/) || [,,''])[2];
if(name){
classNames.push... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.