qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
50,964,008 | I am using an input field, and initially i update it using state.
```
<input type="text" value={this.state.opp.description} />
```
But when i run this. The input does not change value at all.
**My motive is to initially update input using state and then update the state using input value.**
I tried using onChang... | 2018/06/21 | [
"https://Stackoverflow.com/questions/50964008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4515044/"
] | You can use annotatedWith and @Named for doing exactly that.
```
bind(TradeService.class).annotatedWith(Names.named("carsTradeService")).to(CarsTradeService.class).in(Singleton.class);
```
And in the class you want to inject this bean you need to use
```
@Inject
@Named("carsTradeService")
private TradeService trade... | You can use guice multi binding. It is a guice extension.
<https://github.com/google/guice/wiki/Multibindings>
```
@Override
public void configure() {
Multibinder.newSetBinder(binder(),TradeService.class)
.addBinding()
.to(CarsTradeService.class);
Multibinder.newSetBinder(binder(),TradeService.class)
.add... |
30,948,597 | I created this popup window which will show up in response to a button being clicked in my gui. I have two questions regarding this.
1. How do I get rid of the text field below the radio buttons?
2. I need to check which radio button was selected once the ok button is clicked but I didn't create that button. So how wo... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30948597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4858150/"
] | 1. Use `JOptionPane.show**Message**Dialog` instead of `JOptionPane.showInputDialog`
if you still want to have `?` icon instead of `!` one, use
```
JOptionPane.showMessageDialog(null, panel, "title", JOptionPane.QUESTION_MESSAGE);
```
you can also remove icon by using `JOptionPane.PLAIN_MESSAGE`
If you want to mak... | I think what you're trying to do is referred to as **Direct Use** of the JOptionPane. [Refer to the documentation](https://docs.oracle.com/javase/8/docs/api/javax/swing/JOptionPane.html) for more details.
```
JOptionPane pane = new JOptionPane(arguments);
pane.set.Xxxx(...); // Configure
JDialog dialog = pane.creat... |
47,019,957 | Based on API, I can have multiple parameters which can be used in `order by`. There is a function which creates a `dynamic order by` parameter as a string. I want to use this in `.OrderBy` but not sure how to do this.
API Call:
```
{{url}}?keyword=singer&page=12&size=5&sortby=LastName&sortby=FirstName
```
Code:
``... | 2017/10/30 | [
"https://Stackoverflow.com/questions/47019957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4186830/"
] | It looks like the error occurs because `pi` is null. And it is null because, I would assume, the class standing in for the `T` generic doesn't have a property named `LastName ASC, FirstName ASC`. I would try something like the following:
```
var props = property.Split(",");
... //this code stays the same
foreach(strin... | After some trial and error, I am able to find an answer.
**Tested with followings:**
```
.OrderBy("LastName ASC, FirstName ASC")
.OrderBy("LastName ASC")
.OrderBy("LastName ASC,FirstName DESC")
```
**Linq:**
```
public CallCenterPageResult<CallCenterCustomerSummary> GetCustomers(int page, int pageSize, IEnumerabl... |
47,019,957 | Based on API, I can have multiple parameters which can be used in `order by`. There is a function which creates a `dynamic order by` parameter as a string. I want to use this in `.OrderBy` but not sure how to do this.
API Call:
```
{{url}}?keyword=singer&page=12&size=5&sortby=LastName&sortby=FirstName
```
Code:
``... | 2017/10/30 | [
"https://Stackoverflow.com/questions/47019957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4186830/"
] | It looks like the error occurs because `pi` is null. And it is null because, I would assume, the class standing in for the `T` generic doesn't have a property named `LastName ASC, FirstName ASC`. I would try something like the following:
```
var props = property.Split(",");
... //this code stays the same
foreach(strin... | If I understood the problem correctly.
```
Expression<Func<TEntity, TKey>> genericParameter = null;
genericParameter = x => x.foo;
var customerDetails = ctx.CallCenterCustomers
.Where(ccs => ccs.IsDeleted == false && (ccs.FirstName.Contains(keyword) || ccs.LastName.Contains(keyword) ... |
12,991,713 | I have a source text file that contains a bunch of regular expression.
I am reading the textfile, assigning regex matches to array indices, and creating XML using DOM.
However, there is some boilerplate information I need to add to the resulting XML document. Instead of creating hundreds of new, complex nested DOM el... | 2012/10/20 | [
"https://Stackoverflow.com/questions/12991713",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1214574/"
] | `element.setTextContent` will, as you discovered, escape the text you feed it rather than recognize and handle it as xml.
If you have a text representation of xml that you want to add as xml, you'll need to deal with it as xml, which means parsing it into a DOM `Node` and then appending it in that form.
If your text ... | That is how the xml text content is escaped you will get back your original text when you read it back
```
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
Element element= doc.createElement("element");
element.setTextContent("<Hello id=\"id\">");
doc.appendChild(element);
Trans... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | I have learned 2 languages that use gender.
First, let me say that native speakers are remarkably patient to non-native speakers for making gender errors. So relax, they will not view you in a bad light for doing so. In fact, they will be pleased that you are making the effort to learn their language.
For my first la... | It's quite normal in speech to use another pronoun that what the textbook says you "should". For example, if you were talking about a motorbike, it could be *das Motorrad*, it could be *der Töff* (dialectal in Switzerland, apparently), and it could even be *die Maschine*. So it would be quite normal to say "es" at the ... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | My advice is to not learn the nouns and internalize their genders but to **always learn the noun with its definite article as an indivisible unit**.
That is, instead of learning the German word *Tisch* "table" and that the word *Tisch* is masculine (because of some very likely inconsistent rule that no native speaker ... | First of all, I want to know which language you are currently learning and there are a host of exercises you can do to achieve your "internalization" process of grammatical gender and if it is a Romance language it is quite known that it contains widely applicable rules such as "-o" for male nouns and "-a" for female n... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | My advice is to not learn the nouns and internalize their genders but to **always learn the noun with its definite article as an indivisible unit**.
That is, instead of learning the German word *Tisch* "table" and that the word *Tisch* is masculine (because of some very likely inconsistent rule that no native speaker ... | It's quite normal in speech to use another pronoun that what the textbook says you "should". For example, if you were talking about a motorbike, it could be *das Motorrad*, it could be *der Töff* (dialectal in Switzerland, apparently), and it could even be *die Maschine*. So it would be quite normal to say "es" at the ... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | It's quite normal in speech to use another pronoun that what the textbook says you "should". For example, if you were talking about a motorbike, it could be *das Motorrad*, it could be *der Töff* (dialectal in Switzerland, apparently), and it could even be *die Maschine*. So it would be quite normal to say "es" at the ... | First of all, I want to know which language you are currently learning and there are a host of exercises you can do to achieve your "internalization" process of grammatical gender and if it is a Romance language it is quite known that it contains widely applicable rules such as "-o" for male nouns and "-a" for female n... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | I'm not sure to understand what you mean by "internalize the gender". Do you mean assimilate it to use the correct gender naturally without thinking about it?
This is done using the words again and again in different contexts. It will come naturally with time.
As you remarked with the sea and the honey, it can be dif... | I've been struggling with this in French forever, the advice is to learn the article with the noun, which is okay except for the elision which gives you "l'outil" and you have no idea what it is (I made the teacher mad by stating that I only use plurals so everything will be "les"). And for some reason I can't associat... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | My advice is to not learn the nouns and internalize their genders but to **always learn the noun with its definite article as an indivisible unit**.
That is, instead of learning the German word *Tisch* "table" and that the word *Tisch* is masculine (because of some very likely inconsistent rule that no native speaker ... | I've been struggling with this in French forever, the advice is to learn the article with the noun, which is okay except for the elision which gives you "l'outil" and you have no idea what it is (I made the teacher mad by stating that I only use plurals so everything will be "les"). And for some reason I can't associat... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | I've been struggling with this in French forever, the advice is to learn the article with the noun, which is okay except for the elision which gives you "l'outil" and you have no idea what it is (I made the teacher mad by stating that I only use plurals so everything will be "les"). And for some reason I can't associat... | First of all, I want to know which language you are currently learning and there are a host of exercises you can do to achieve your "internalization" process of grammatical gender and if it is a Romance language it is quite known that it contains widely applicable rules such as "-o" for male nouns and "-a" for female n... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | I'm not sure to understand what you mean by "internalize the gender". Do you mean assimilate it to use the correct gender naturally without thinking about it?
This is done using the words again and again in different contexts. It will come naturally with time.
As you remarked with the sea and the honey, it can be dif... | First of all, I want to know which language you are currently learning and there are a host of exercises you can do to achieve your "internalization" process of grammatical gender and if it is a Romance language it is quite known that it contains widely applicable rules such as "-o" for male nouns and "-a" for female n... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | I have learned 2 languages that use gender.
First, let me say that native speakers are remarkably patient to non-native speakers for making gender errors. So relax, they will not view you in a bad light for doing so. In fact, they will be pleased that you are making the effort to learn their language.
For my first la... | I've been struggling with this in French forever, the advice is to learn the article with the noun, which is okay except for the elision which gives you "l'outil" and you have no idea what it is (I made the teacher mad by stating that I only use plurals so everything will be "les"). And for some reason I can't associat... |
4,987 | As we know, many languages have grammatical gender for every noun, and the gender of a noun requires agreement from adjectives and sometimes verbs and requires the use of the correct pronoun for its gender.
I don't have any trouble simply learning the gender of words, and if I took a test on the gender I wouldn't have... | 2020/12/02 | [
"https://languagelearning.stackexchange.com/questions/4987",
"https://languagelearning.stackexchange.com",
"https://languagelearning.stackexchange.com/users/9828/"
] | I have learned 2 languages that use gender.
First, let me say that native speakers are remarkably patient to non-native speakers for making gender errors. So relax, they will not view you in a bad light for doing so. In fact, they will be pleased that you are making the effort to learn their language.
For my first la... | I'm not sure to understand what you mean by "internalize the gender". Do you mean assimilate it to use the correct gender naturally without thinking about it?
This is done using the words again and again in different contexts. It will come naturally with time.
As you remarked with the sea and the honey, it can be dif... |
3,251,172 | Let $f,g\in C^0(\mathbb R)$ and consider having an equation of the form
$$f(x)g\left(\frac{y-x}{\alpha}\right)=F(x,y),$$
where the right hand side is some function involving $x,y\in\mathbb R$. For the question at hand, the right hand side of the equality doesn't come into it at all; it is only to pose the above equalit... | 2019/06/04 | [
"https://math.stackexchange.com/questions/3251172",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/674318/"
] | Your second displayed equation makes no sense since it uses the same letters $x$, $y$ for different things.
We have a coordinate transformation $\psi: \>{\mathbb R}^2\to{\mathbb R}^2$ defined by
$$\psi:\>(u,v)\mapsto\left\{\eqalign{x&=v-\alpha u\cr y&=v\cr}\right.\ ,\qquad{\rm resp.},\qquad\psi^{-1}:\>(x,y)\mapsto\lef... | Nothing is going on behind the scenes: this is just different ways of writing the same thing. In your initial expression $f(x)g((y-x)/\alpha)$ you have that $f$ and $g$ are both linear functions of $x$ (and, given you've equated it to $F(x,y)$ that g is also a linear function of $y$). So it doesn't really matter how yo... |
1,291,635 | I'm building something akin to Google Analytics and currently I'm doing real time database updates. Here's the workflow for my app:
1. User makes a RESTful API request
2. I find a record in a database, return it as JSON
3. I record the request counter for the user in the database (i.e. if I user makes 2
API calls, I i... | 2009/08/18 | [
"https://Stackoverflow.com/questions/1291635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your hash solution sounds like it's a bit too complex. This set of slides is an insightful and **up-to-date** resource that addresses your issue head on:
* <http://www.slideshare.net/mattmatt/the-current-state-of-asynchronous-processing-with-ruby>
They say the simplest thing would be:
```
Thread.new do
MyModel.do_... | Do it later with [DelayedJob](https://github.com/tobi/delayed_job).
**Edit**: If your DB is being hit so much that one UPDATE is noticeably slowing down your requests, maybe you should consider setting up a master-slave database architecture. |
1,291,635 | I'm building something akin to Google Analytics and currently I'm doing real time database updates. Here's the workflow for my app:
1. User makes a RESTful API request
2. I find a record in a database, return it as JSON
3. I record the request counter for the user in the database (i.e. if I user makes 2
API calls, I i... | 2009/08/18 | [
"https://Stackoverflow.com/questions/1291635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Your hash solution sounds like it's a bit too complex. This set of slides is an insightful and **up-to-date** resource that addresses your issue head on:
* <http://www.slideshare.net/mattmatt/the-current-state-of-asynchronous-processing-with-ruby>
They say the simplest thing would be:
```
Thread.new do
MyModel.do_... | I just asked a similar question over on the EventMachine mailing list, and I was suggested that I try phat (<http://www.mikeperham.com/2010/04/03/introducing-phat-an-asynchronous-rails-app/>) to get asynchronous database access.
Maybe you should try it out. |
67,185 | In the United States, Is it possible to buy and sell the same stock on the same day? I heard day traders can do this, and you need to have at minimum of 25K in the account in order to be a day trader. If I have 25K in my account, do I automatically become a day trader and be able to buy and sell the same stock on the s... | 2016/07/10 | [
"https://money.stackexchange.com/questions/67185",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/26256/"
] | Because it takes 3 business days for the actual transfer of stock to occur after you buy or sell to the next owner, your cash is tied up until that happens. This is called the settlement period.
Therefore, brokers offer "margin", which is a form of credit, or loan, to allow you to keep trading while the settlement per... | If you're going to be a day trader, you really need to know your stuff. It's risky, to say the least.
One of the most important elements to being successful is having access to very fast data streams so that you can make moves quickly as trends stat to develop in the markets. If you're planning on doing this using con... |
67,185 | In the United States, Is it possible to buy and sell the same stock on the same day? I heard day traders can do this, and you need to have at minimum of 25K in the account in order to be a day trader. If I have 25K in my account, do I automatically become a day trader and be able to buy and sell the same stock on the s... | 2016/07/10 | [
"https://money.stackexchange.com/questions/67185",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/26256/"
] | You should not have to wait 3 days to sell the stock after purchase. If you are trading with a cash account you will have to wait for the sale to settle (3 business days) before you can use those funds to purchase other stock.
If you meet the definition of a pattern day trader which is 4 or more day trades in 5 busine... | If you're going to be a day trader, you really need to know your stuff. It's risky, to say the least.
One of the most important elements to being successful is having access to very fast data streams so that you can make moves quickly as trends stat to develop in the markets. If you're planning on doing this using con... |
67,185 | In the United States, Is it possible to buy and sell the same stock on the same day? I heard day traders can do this, and you need to have at minimum of 25K in the account in order to be a day trader. If I have 25K in my account, do I automatically become a day trader and be able to buy and sell the same stock on the s... | 2016/07/10 | [
"https://money.stackexchange.com/questions/67185",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/26256/"
] | If you're going to be a day trader, you really need to know your stuff. It's risky, to say the least.
One of the most important elements to being successful is having access to very fast data streams so that you can make moves quickly as trends stat to develop in the markets. If you're planning on doing this using con... | You need minimum of $25k otherwise you'll reach a limit. You'll have to wait 3 days for the sale to clear unless you're on margin. Don't buy anything based on idiots on Twitter or the internet. However, there's some good people to follow that know what they're doing.
Don't listen to this guy saying that E\*Trade or th... |
67,185 | In the United States, Is it possible to buy and sell the same stock on the same day? I heard day traders can do this, and you need to have at minimum of 25K in the account in order to be a day trader. If I have 25K in my account, do I automatically become a day trader and be able to buy and sell the same stock on the s... | 2016/07/10 | [
"https://money.stackexchange.com/questions/67185",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/26256/"
] | If you're going to be a day trader, you really need to know your stuff. It's risky, to say the least.
One of the most important elements to being successful is having access to very fast data streams so that you can make moves quickly as trends stat to develop in the markets. If you're planning on doing this using con... | You are only allowed to trade settled cash in a cash account. With T+2 settlement (adopted in the U.S. in 2017), the funds from a sale will not be available for two days. There is no limit to how many day trades you can make in a cash account as long as you are using settled funds. For example, assuming that you do not... |
67,185 | In the United States, Is it possible to buy and sell the same stock on the same day? I heard day traders can do this, and you need to have at minimum of 25K in the account in order to be a day trader. If I have 25K in my account, do I automatically become a day trader and be able to buy and sell the same stock on the s... | 2016/07/10 | [
"https://money.stackexchange.com/questions/67185",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/26256/"
] | Because it takes 3 business days for the actual transfer of stock to occur after you buy or sell to the next owner, your cash is tied up until that happens. This is called the settlement period.
Therefore, brokers offer "margin", which is a form of credit, or loan, to allow you to keep trading while the settlement per... | You should not have to wait 3 days to sell the stock after purchase. If you are trading with a cash account you will have to wait for the sale to settle (3 business days) before you can use those funds to purchase other stock.
If you meet the definition of a pattern day trader which is 4 or more day trades in 5 busine... |
67,185 | In the United States, Is it possible to buy and sell the same stock on the same day? I heard day traders can do this, and you need to have at minimum of 25K in the account in order to be a day trader. If I have 25K in my account, do I automatically become a day trader and be able to buy and sell the same stock on the s... | 2016/07/10 | [
"https://money.stackexchange.com/questions/67185",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/26256/"
] | Because it takes 3 business days for the actual transfer of stock to occur after you buy or sell to the next owner, your cash is tied up until that happens. This is called the settlement period.
Therefore, brokers offer "margin", which is a form of credit, or loan, to allow you to keep trading while the settlement per... | You need minimum of $25k otherwise you'll reach a limit. You'll have to wait 3 days for the sale to clear unless you're on margin. Don't buy anything based on idiots on Twitter or the internet. However, there's some good people to follow that know what they're doing.
Don't listen to this guy saying that E\*Trade or th... |
67,185 | In the United States, Is it possible to buy and sell the same stock on the same day? I heard day traders can do this, and you need to have at minimum of 25K in the account in order to be a day trader. If I have 25K in my account, do I automatically become a day trader and be able to buy and sell the same stock on the s... | 2016/07/10 | [
"https://money.stackexchange.com/questions/67185",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/26256/"
] | Because it takes 3 business days for the actual transfer of stock to occur after you buy or sell to the next owner, your cash is tied up until that happens. This is called the settlement period.
Therefore, brokers offer "margin", which is a form of credit, or loan, to allow you to keep trading while the settlement per... | You are only allowed to trade settled cash in a cash account. With T+2 settlement (adopted in the U.S. in 2017), the funds from a sale will not be available for two days. There is no limit to how many day trades you can make in a cash account as long as you are using settled funds. For example, assuming that you do not... |
67,185 | In the United States, Is it possible to buy and sell the same stock on the same day? I heard day traders can do this, and you need to have at minimum of 25K in the account in order to be a day trader. If I have 25K in my account, do I automatically become a day trader and be able to buy and sell the same stock on the s... | 2016/07/10 | [
"https://money.stackexchange.com/questions/67185",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/26256/"
] | You should not have to wait 3 days to sell the stock after purchase. If you are trading with a cash account you will have to wait for the sale to settle (3 business days) before you can use those funds to purchase other stock.
If you meet the definition of a pattern day trader which is 4 or more day trades in 5 busine... | You need minimum of $25k otherwise you'll reach a limit. You'll have to wait 3 days for the sale to clear unless you're on margin. Don't buy anything based on idiots on Twitter or the internet. However, there's some good people to follow that know what they're doing.
Don't listen to this guy saying that E\*Trade or th... |
67,185 | In the United States, Is it possible to buy and sell the same stock on the same day? I heard day traders can do this, and you need to have at minimum of 25K in the account in order to be a day trader. If I have 25K in my account, do I automatically become a day trader and be able to buy and sell the same stock on the s... | 2016/07/10 | [
"https://money.stackexchange.com/questions/67185",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/26256/"
] | You should not have to wait 3 days to sell the stock after purchase. If you are trading with a cash account you will have to wait for the sale to settle (3 business days) before you can use those funds to purchase other stock.
If you meet the definition of a pattern day trader which is 4 or more day trades in 5 busine... | You are only allowed to trade settled cash in a cash account. With T+2 settlement (adopted in the U.S. in 2017), the funds from a sale will not be available for two days. There is no limit to how many day trades you can make in a cash account as long as you are using settled funds. For example, assuming that you do not... |
33,054,069 | Primitives are immutable, there is no way to change its value.
```
var a = 'abc';
a[0] = 'b';
console.log(a);// abc as it is immutable
```
However, if I use wrapper object
```
var a = new String('abc');
typeof a// object
a[0] = 'b';
console.log(a);// abc <----- I actually expect it to be bbc as a is a object ... | 2015/10/10 | [
"https://Stackoverflow.com/questions/33054069",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4702386/"
] | The simple declaration `int bsp_end();` is interpreted differently in C and C++. The reason is that in C++, you can overload functions, which requires that their parameters are included in the symbol name for the linker, see C++ name mangling for further info. Now, since the function is compiled with a C compiler but t... | You need `extern "C"` around `#include`
```
extern " C" {
#include "c-header.h"
};
```
This is needed to stop the C++ name mangling |
23,778,690 | I have an `UIScrollview` which will contain X views, each view is of Class type "CategoryPostView" that contains an `UIImageView`. I am adding these views on the `scrollView` one after another. But when the image loads in the `imageView` I want to change the size of my `imageView`, therefor I want to change the Offset ... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23778690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/536124/"
] | The best way to use constraints **inside** a `UIScrollView` is to not use them at all.
If you want to layout the inside of the scroll view using constraints then create a UIView to contain everything in the scroll view and then place this view into the scroll view.
By doing this you can now use the container view tha... | I ended up using the class UIView+AutoLayout.
You can find it here <https://github.com/smileyborg/UIView-AutoLayout> and <https://github.com/jrturton/UIView-Autolayout> |
7,001,488 | I am looking to query my database based on what the user would like to search by: Ex. (Zip, City, State, Name, Etc Etc). Let's say I search by zip code, and there are 2 results in my SQL for that zip code.
I would like the results to be displayed in the following format on my webpage:
```
Company Name
Address
City, S... | 2011/08/09 | [
"https://Stackoverflow.com/questions/7001488",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/752684/"
] | What you could do, is pull each piece of information individually from the resulting row (change the fields based on what you pull from the table):
```
while($row = mysql_fetch_assoc($result))
{
echo htmlspecialchars($row['comp_name']) . '<br />';
echo htmlspecialchars($row['Address']) . '<br />';
echo $row['... | Since you are wanting to list the information, you could use an `<ul>` and output each row as `<li>`.
```
<style>
ul { list-style: none; }
</style>
<?php
while ($row = mysql_fetch_array($result)){
echo "<ul>";
echo "<li>".$row["companyName"]."</li><li>".$row["address"]."</li><li>".$row["city"].",... |
5,578,009 | here is my code:
```
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
```
This will successfully rewrite everything to https (it will "force" https), if I put it in my home directory's .htaccess file. However, what about if I only want my subdirectory of /support to force... | 2011/04/07 | [
"https://Stackoverflow.com/questions/5578009",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/693753/"
] | If you want to redirect only a subfolder and not a subdomain, that is even easier. To redirect the subfolder /support/ you would use the following code:
```
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^/support/(.*)$ https://%{HTTP_HOST}/support/$1 [QSA]
```
I added a QSA flag, which will force any query s... | Add the following rule before the %{HTTPS} line:
```
RewriteCond %{HTTP_HOST} ^support.domain.com$
```
This will only allow the rule to execute if the visitor is coming from the subdomain. Please note, these rules will likely need to be put in the .htaccess file that is the root for the subdomain, not the main site ... |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Yes; you can write your own main method and run `NSRunLoop` without returning from `NSApplicationMain`.
Have a look at this [link](http://web.archive.org/web/20100208054144/http://chrisalvares.com/blog/?p=7); this guy is using NSRunLoop in his main method, he is not loading NIB files though, but it should get you goin... | The solution is to invoke NSApplication manually. Create your app delegate first than replace the NSApplicationMain() call in main.m with the following:
```
AppDelegate * delegate = [[AppDelegate alloc] init];
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSApplication * application = [NSApplication s... |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In Swift, you can achieve this by appending the following line to the end of your `main.swift`:
```
NSRunLoop.currentRunLoop().run(); // Swift < 3.0
RunLoop.current.run(); // Swift >= 3.0
```
If you want to be able to stop the run loop you have to use the Core Foundation methods.
```
CFRunLoopRun(); //... | I just wrote a CLI app and I needed to run a runLoop to let NSWorkspace class works right and also to get notifications from NSWorkspace.
I made it thanks this discussion, but I don't understand why most of the answers suggest to use a NSTimer so I would like to share my solution without it.
Because [NSRunLoop run] "b... |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | ```
// Yes. Here is sample code (tested on OS X 10.8.4, command-line).
// Using ARC:
// $ cc -o timer timer.m -fobjc-arc -framework Foundation
// $ ./timer
//
#include <Foundation/Foundation.h>
@interface MyClass : NSObject
@property NSTimer *timer;
-(id)init;
-(void)onTick:(NSTimer *)aTimer;
@end
@implementation M... | I just wrote a CLI app and I needed to run a runLoop to let NSWorkspace class works right and also to get notifications from NSWorkspace.
I made it thanks this discussion, but I don't understand why most of the answers suggest to use a NSTimer so I would like to share my solution without it.
Because [NSRunLoop run] "b... |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The solution is to invoke NSApplication manually. Create your app delegate first than replace the NSApplicationMain() call in main.m with the following:
```
AppDelegate * delegate = [[AppDelegate alloc] init];
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSApplication * application = [NSApplication s... | I just wrote a CLI app and I needed to run a runLoop to let NSWorkspace class works right and also to get notifications from NSWorkspace.
I made it thanks this discussion, but I don't understand why most of the answers suggest to use a NSTimer so I would like to share my solution without it.
Because [NSRunLoop run] "b... |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In Swift, you can achieve this by appending the following line to the end of your `main.swift`:
```
NSRunLoop.currentRunLoop().run(); // Swift < 3.0
RunLoop.current.run(); // Swift >= 3.0
```
If you want to be able to stop the run loop you have to use the Core Foundation methods.
```
CFRunLoopRun(); //... | ```
// Yes. Here is sample code (tested on OS X 10.8.4, command-line).
// Using ARC:
// $ cc -o timer timer.m -fobjc-arc -framework Foundation
// $ ./timer
//
#include <Foundation/Foundation.h>
@interface MyClass : NSObject
@property NSTimer *timer;
-(id)init;
-(void)onTick:(NSTimer *)aTimer;
@end
@implementation M... |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The solution is to invoke NSApplication manually. Create your app delegate first than replace the NSApplicationMain() call in main.m with the following:
```
AppDelegate * delegate = [[AppDelegate alloc] init];
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSApplication * application = [NSApplication s... | ```
// Yes. Here is sample code (tested on OS X 10.8.4, command-line).
// Using ARC:
// $ cc -o timer timer.m -fobjc-arc -framework Foundation
// $ ./timer
//
#include <Foundation/Foundation.h>
@interface MyClass : NSObject
@property NSTimer *timer;
-(id)init;
-(void)onTick:(NSTimer *)aTimer;
@end
@implementation M... |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | In Swift, you can achieve this by appending the following line to the end of your `main.swift`:
```
NSRunLoop.currentRunLoop().run(); // Swift < 3.0
RunLoop.current.run(); // Swift >= 3.0
```
If you want to be able to stop the run loop you have to use the Core Foundation methods.
```
CFRunLoopRun(); //... | Follow the recommendations in the docs for [NSRunLoop run]:
```
BOOL shouldKeepRunning = YES; // global
NSRunLoop *theRL = [NSRunLoop currentRunLoop];
while (shouldKeepRunning && [theRL runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]);
``` |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Have a look at asynctask.m that runs an NSRunLoop manually
to enable the use of asynchronous "waitForDataInBackgroundAndNotify" notifications.
<http://www.cocoadev.com/index.pl?NSPipe>
```
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
while(!terminated)
{
//if (![[NSRunLoop currentRunLo... | Here is my take using only DispatchQueue. Most command line tools want to exit with a status. The background dispatch queue is concurrent.
```
import Foundation
var exitStatus: Int32 = 0
let background = DispatchQueue(label: "commandline", qos: .userInteractive, attributes: [], autoreleaseFrequency: .workItem)
back... |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Yes; you can write your own main method and run `NSRunLoop` without returning from `NSApplicationMain`.
Have a look at this [link](http://web.archive.org/web/20100208054144/http://chrisalvares.com/blog/?p=7); this guy is using NSRunLoop in his main method, he is not loading NIB files though, but it should get you goin... | In Swift, you can achieve this by appending the following line to the end of your `main.swift`:
```
NSRunLoop.currentRunLoop().run(); // Swift < 3.0
RunLoop.current.run(); // Swift >= 3.0
```
If you want to be able to stop the run loop you have to use the Core Foundation methods.
```
CFRunLoopRun(); //... |
2,154,600 | Is it possible to initialize a `NSRunLoop` without loading any NIB files (i.e., without calling `NSApplicationMain()`)?
Thanks. | 2010/01/28 | [
"https://Stackoverflow.com/questions/2154600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The solution is to invoke NSApplication manually. Create your app delegate first than replace the NSApplicationMain() call in main.m with the following:
```
AppDelegate * delegate = [[AppDelegate alloc] init];
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSApplication * application = [NSApplication s... | Follow the recommendations in the docs for [NSRunLoop run]:
```
BOOL shouldKeepRunning = YES; // global
NSRunLoop *theRL = [NSRunLoop currentRunLoop];
while (shouldKeepRunning && [theRL runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]);
``` |
572,267 | I tried to install the wacom tablet linux project thing, but when I did ./configure; make; make-install; it said there's no make file or something. I just need a way to change my pen movement speed. Thanks :) | 2015/01/10 | [
"https://askubuntu.com/questions/572267",
"https://askubuntu.com",
"https://askubuntu.com/users/353595/"
] | **Solution #1**
---------------
I'd suggest you check first if your tablet supports the `xsetwacom` speed parameter. To do this enter the terminal command:
```
xsetwacom --list parameters
```
This will output a list of possible `xsetwacom` parameters to set. Look for one called `Speed` or `SpeedLevel`. To slow the ... | For mouse i'm using [mouse.sh](https://github.com/ford15focus/snippets/blob/master/sh/X/mouse.sh), maybe it is working for tablets too. I have no tablet and can't test. |
572,267 | I tried to install the wacom tablet linux project thing, but when I did ./configure; make; make-install; it said there's no make file or something. I just need a way to change my pen movement speed. Thanks :) | 2015/01/10 | [
"https://askubuntu.com/questions/572267",
"https://askubuntu.com",
"https://askubuntu.com/users/353595/"
] | **Solution #1**
---------------
I'd suggest you check first if your tablet supports the `xsetwacom` speed parameter. To do this enter the terminal command:
```
xsetwacom --list parameters
```
This will output a list of possible `xsetwacom` parameters to set. Look for one called `Speed` or `SpeedLevel`. To slow the ... | I created a bash script to set the altered acceleration:
```
#!/bin/bash
device=$(xinput list | grep Wacom | grep stylus | grep -Po 'id=\K[^ ].')
property=$(xinput list-props $device | grep "Constant Deceleration" | grep -Po '\(\K[^\)]+')
xinput set-prop $device $property 2.0
```
(You might want to validate if it wo... |
69,356,468 | I'm trying to receive some data from an API call and do some task based on the received data.
Let's say I have my flutter app opened and in that opened state without any click or any interaction I get some data or do any function when I send something through the API.
I used Firebase FCM to do such task - When I send ... | 2021/09/28 | [
"https://Stackoverflow.com/questions/69356468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11164702/"
] | At first, let's put Flutter aside. Your problem is to pull data from API and do a specific task OR your API should notify the app through API.
For the first problem, a simple data polling should work: when the app is opened, you just start some kind of timer and periodically pull data from the API and do something. Ho... | Your question is little bit unclear. Whatever if you want to do some network call even without any interaction by user you can call network in your onInit method. This method runs at the very beginning for individual screen. Then do your task based on the response |
69,356,468 | I'm trying to receive some data from an API call and do some task based on the received data.
Let's say I have my flutter app opened and in that opened state without any click or any interaction I get some data or do any function when I send something through the API.
I used Firebase FCM to do such task - When I send ... | 2021/09/28 | [
"https://Stackoverflow.com/questions/69356468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11164702/"
] | At first, let's put Flutter aside. Your problem is to pull data from API and do a specific task OR your API should notify the app through API.
For the first problem, a simple data polling should work: when the app is opened, you just start some kind of timer and periodically pull data from the API and do something. Ho... | You need stream API for this,look into socket programming |
69,356,468 | I'm trying to receive some data from an API call and do some task based on the received data.
Let's say I have my flutter app opened and in that opened state without any click or any interaction I get some data or do any function when I send something through the API.
I used Firebase FCM to do such task - When I send ... | 2021/09/28 | [
"https://Stackoverflow.com/questions/69356468",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11164702/"
] | At first, let's put Flutter aside. Your problem is to pull data from API and do a specific task OR your API should notify the app through API.
For the first problem, a simple data polling should work: when the app is opened, you just start some kind of timer and periodically pull data from the API and do something. Ho... | You can use webs socket or pusher for this. When web socket is connected with your server that time you received some data and you can do your task. |
68,969,788 | Not sure what's wrong with below function but here is the error message
SQL compilation error: syntax error line 1 at position 0 unexpected 'function'.
JSON Script or Javascript?
```
function rsToJSON(query) {
var i;
var row = {};
var table = [];
while (query.resultSet.next()) {
for(col = 1; col <= query.stateme... | 2021/08/29 | [
"https://Stackoverflow.com/questions/68969788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1810575/"
] | >
> When I changed `Singleton` to `Scoped/Transient`, I no longer get this exception.
>
>
>
Please, only use scope lifetime with every `DbContext`, otherwise, I always raise weird exception (conflict tracking, object as `Singleton`, difference `DbContext` for `Transient` (if you intend to use repository pattern or... | Try to remove any await / async and maintains the Task.
In this mode you can use something like:
```cs
Task.Run(() => LogError(log)).ConfigureAwait(false)
```
In case you cannot remove async/await take a look to this package to create fire and forget asynchronous calls:
<https://www.nuget.org/packages/Microsoft.Vis... |
74,100,091 | I have the following XAML
```
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition He... | 2022/10/17 | [
"https://Stackoverflow.com/questions/74100091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2598770/"
] | >
> But if possible I would like to not use the Binding on ActualWidth.
>
>
>
Well, you need to define the width contraint somehow. `Auto` effectively means that the column will grow along with the widest element in it, i.e. the "minor" information `TextBlock` in this case.
So you should set the `Width` of the co... | You could achieve this in multiple ways.
Depends on the exact desired purpose.
One notable and easy example would be to use some trickery
You could put the main textblock and a rectangle in a horizontally alligned stackpanel with a row span of 2 and with a higher Z index than the secondary textblock. You set the rec... |
258,844 | Please help me to understand the meaning of "guilty" in this context:
>
> "He turns around and spots me.
>
>
> Byron.
> Once I would have done anything for Byron.
>
>
> ‘Skye! Skye Turner – it’s you, isn’t it?’
>
>
> ‘Guilty,’ I say, then instantly regret it.
>
>
> Byron engulfs me in his strong arms."
>
>
... | 2020/08/31 | [
"https://ell.stackexchange.com/questions/258844",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/89835/"
] | It is purely a conversational joke, a little old-fashioned, a way of saying "Yes", "That is correct", or "You have guessed correctly". In courts of law in English-speaking countries, a defendant (accused person) is asked to "plead" either "guilty" (they admit the crime) or "not guilty" (they deny the crime). Byron has ... | In court the judge may state the crime of which the defendant is accused, and the defendant will answer 'Guilty' or 'Not Guilty'. Guilty means 'Yes I did it', and Not Guilty means 'No I did not do it'.
This has become a colloquialism in modern English in which replying 'Guilty' (or Not guilty) to a question means an a... |
258,844 | Please help me to understand the meaning of "guilty" in this context:
>
> "He turns around and spots me.
>
>
> Byron.
> Once I would have done anything for Byron.
>
>
> ‘Skye! Skye Turner – it’s you, isn’t it?’
>
>
> ‘Guilty,’ I say, then instantly regret it.
>
>
> Byron engulfs me in his strong arms."
>
>
... | 2020/08/31 | [
"https://ell.stackexchange.com/questions/258844",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/89835/"
] | In addition to the two existing good answers, I'd like to add that the fuller version of "guilty" is "**guilty as charged**". The basic meaning of this phrase is the same as "guilty" as explained by Michael Harvey and jla, namely, to affirm that one is responsible for a crime that they have committed.
>
> The state w... | In court the judge may state the crime of which the defendant is accused, and the defendant will answer 'Guilty' or 'Not Guilty'. Guilty means 'Yes I did it', and Not Guilty means 'No I did not do it'.
This has become a colloquialism in modern English in which replying 'Guilty' (or Not guilty) to a question means an a... |
258,844 | Please help me to understand the meaning of "guilty" in this context:
>
> "He turns around and spots me.
>
>
> Byron.
> Once I would have done anything for Byron.
>
>
> ‘Skye! Skye Turner – it’s you, isn’t it?’
>
>
> ‘Guilty,’ I say, then instantly regret it.
>
>
> Byron engulfs me in his strong arms."
>
>
... | 2020/08/31 | [
"https://ell.stackexchange.com/questions/258844",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/89835/"
] | In court the judge may state the crime of which the defendant is accused, and the defendant will answer 'Guilty' or 'Not Guilty'. Guilty means 'Yes I did it', and Not Guilty means 'No I did not do it'.
This has become a colloquialism in modern English in which replying 'Guilty' (or Not guilty) to a question means an a... | >
> Skye! Skye Turner – it’s you, isn’t it?’
>
> ‘Guilty,’ I say, then instantly regret it.
>
>
>
'Guilty' implies that someone has done something wrong. In this response it conveys the positive assertion that the speaker is indeed the person they are looking for, and that it is something to be ashamed of as if... |
258,844 | Please help me to understand the meaning of "guilty" in this context:
>
> "He turns around and spots me.
>
>
> Byron.
> Once I would have done anything for Byron.
>
>
> ‘Skye! Skye Turner – it’s you, isn’t it?’
>
>
> ‘Guilty,’ I say, then instantly regret it.
>
>
> Byron engulfs me in his strong arms."
>
>
... | 2020/08/31 | [
"https://ell.stackexchange.com/questions/258844",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/89835/"
] | It is purely a conversational joke, a little old-fashioned, a way of saying "Yes", "That is correct", or "You have guessed correctly". In courts of law in English-speaking countries, a defendant (accused person) is asked to "plead" either "guilty" (they admit the crime) or "not guilty" (they deny the crime). Byron has ... | >
> Skye! Skye Turner – it’s you, isn’t it?’
>
> ‘Guilty,’ I say, then instantly regret it.
>
>
>
'Guilty' implies that someone has done something wrong. In this response it conveys the positive assertion that the speaker is indeed the person they are looking for, and that it is something to be ashamed of as if... |
258,844 | Please help me to understand the meaning of "guilty" in this context:
>
> "He turns around and spots me.
>
>
> Byron.
> Once I would have done anything for Byron.
>
>
> ‘Skye! Skye Turner – it’s you, isn’t it?’
>
>
> ‘Guilty,’ I say, then instantly regret it.
>
>
> Byron engulfs me in his strong arms."
>
>
... | 2020/08/31 | [
"https://ell.stackexchange.com/questions/258844",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/89835/"
] | In addition to the two existing good answers, I'd like to add that the fuller version of "guilty" is "**guilty as charged**". The basic meaning of this phrase is the same as "guilty" as explained by Michael Harvey and jla, namely, to affirm that one is responsible for a crime that they have committed.
>
> The state w... | >
> Skye! Skye Turner – it’s you, isn’t it?’
>
> ‘Guilty,’ I say, then instantly regret it.
>
>
>
'Guilty' implies that someone has done something wrong. In this response it conveys the positive assertion that the speaker is indeed the person they are looking for, and that it is something to be ashamed of as if... |
195,736 | How could I redraw this without nodes and just having dots between arrows?
```
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{petri}
\tikzset{state/.style={circle,draw=gray,inner sep=0pt,minimum size=7mm,label=center:$#1$,name=#1},
redarrow/.style={->, red, fill=none,>=stealth}... | 2014/08/10 | [
"https://tex.stackexchange.com/questions/195736",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/60486/"
] | I'm not entirely sure what you are looking for but perhaps this is a start: you could simply name the nodes rather than specifying `state` and then use a style for every node to ensure each is a filled circle.
```
\documentclass[tikz]{standalone}
\usetikzlibrary{positioning}
\usetikzlibrary{petri}
\tikzset{state/.sty... | You can simplify the code with a `matrix`. It helps to position nodes and with `matrix of nodes` option it automatically add names to nodes: `matrix_name-row-column`.
```
\documentclass[tikz]{standalone}
\usetikzlibrary{positioning}
\usetikzlibrary{matrix}
\tikzset{state/.style={circle,draw=black, fill=black, inner ... |
16,681,532 | I am working on a trivia concept for a website of mine. All the question data is stored on a mysql database. I use the following code for the user to submit the answer of the trivia which is randomized.
```
<html>
<title>Trivia</title>
<body>
<h1>Trivia</h1>
<?php
mysql_connect("localhost", "trivia", "<snip>")... | 2013/05/22 | [
"https://Stackoverflow.com/questions/16681532",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1618023/"
] | Retain question id in a hidden input field:
```
<input type="hidden" name="questionNumber" id="questionNumber" value="12345" />
```
Example: <http://www.tizag.com/htmlT/htmlhidden.php>
This way, you know the user response & question which user answered on submit.
Hope this will help. | Hopefully your questions have id's in the database. Use the question id as a hidden input field in your form. On the second page then, you only need to select the question which has the question id:
```
$query = 'SELECT * FROM questions WHERE id=' .mysql_real_escape_string($_POST['id']). ' LIMIT 1';
```
Also, you sh... |
41,690,606 | I have parent and child records that are identical in fields. However certain fields are only set at a parent level.
The parent field set to an empty string ("") signifies that the record is a parent. The other records have a value set which point to the parent hence these can be considered child records.
Now consid... | 2017/01/17 | [
"https://Stackoverflow.com/questions/41690606",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3294571/"
] | You can use the following rule to remove query strings fromthe uri /chapter-detail.php
```
RewriteEngine on
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^chapter-detail.php$ /chapter-detail.php? [L,R]
``` | You can use this
```
$url=strtok($_SERVER["REQUEST_URI"],'?');
``` |
46,279,084 | API I am using: <https://pypi.python.org/pypi/python-amazon-simple-product-api>
I have this part of my code
```
from amazon.api import AmazonAPI
products = self.amazon_api.search_n(1, Keywords=item['upc'], SearchIndex='All')
```
Exception I got
```
SearchException: Amazon Search Error: 'AWS.ECommerceService.NoExac... | 2017/09/18 | [
"https://Stackoverflow.com/questions/46279084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4094231/"
] | Try this:
```
from amazon.api import AmazonAPI, SearchException
```
After that,
```
try:
products = self.amazon_api.search_n(1, Keywords=item['upc'], SearchIndex='All')
found_match = True
except SearchException:
logging.warning("No search result found on Amazon for UPC: %s"%(item['upc']))
found_matc... | Try the `NoExactMatches` exception:
```
from AWS.EcommerceServiec import NoExactMatches
try:
products = self.amazon_api.search_n(1, Keywords=item['upc'],
SearchIndex='All')
found_match = True
except NoExactMatches:
logging.warning("No search result found on Amazon for UPC: %s"%(item['upc']))
found_ma... |
28,957,940 | I have a string like this:
```
"
BLA
Blub"
```
Now I would like to remove all leading line breaks. (But only the ones until the first "real word" appears. How is this possible?
Thanks | 2015/03/10 | [
"https://Stackoverflow.com/questions/28957940",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/867432/"
] | If it is acceptable that newline (and other whitespace) characters are removed from *both ends* of the string then you can use
```
let string = "\n\nBLA\nblub"
let trimmed = string.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet())
// In Swift 1.2 (Xcode 6.3):
let trimmed = (string as N... | You can use `extension` for Trim
**Ex.**
```
let string = "\n\nBLA\nblub"
let trimmed = string.trim()
extension String {
func trim() -> String {
return self.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
}
}
``` |
68,255,172 | I wrote a simple piece of code to learn pthread\_cond\_signal() and pthread\_cond\_wait(). I used pthread\_cond\_signal() and pthread\_cond\_wait() in code 1, but I didn't use pthread\_cond\_signal() and pthread\_cond\_wait() in code 2. Why do I think there is no difference between code 1 and code 2? Do I not understan... | 2021/07/05 | [
"https://Stackoverflow.com/questions/68255172",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15121005/"
] | >
> I wrote a simple piece of code to learn pthread\_cond\_signal() and pthread\_cond\_wait(). I used pthread\_cond\_signal() and pthread\_cond\_wait() in code 1, but I didn't use pthread\_cond\_signal() and pthread\_cond\_wait() in code 2. Why do I think there is no difference between code 1 and code 2?
>
>
>
I c... | The main difference is, that in your first code example you **wait** for a signal. If a signal arrives, the thread will 'immediately' continue.
In your second example you're polling a global (state) variable and go to sleep for a specific amount of time. If in the meantime the state changes, you will notice that chang... |
18,972,768 | /CustomPostType.php on line 165
```
// Initialise class variables as blank
$metaKeys = $this->get_meta_keys();
foreach( $metaKeys as $key )
if( !empty( $key ) )
$this->$key = null;
$this->ID = null;
```
The below code is what fixed the syntax error.
```
publi... | 2013/09/24 | [
"https://Stackoverflow.com/questions/18972768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2809489/"
] | There is syntax error in the code. It should be like this :
```
public function get_meta_keys( $objectName) {
$getClassVars = get_class_vars( $objectName );
return array_keys( $getClassVars);
}
```
Point to correct :
* Correct function signature. Add argument in the function get\_meta\_keys(). | Err, your code doesn't even look like it validates to me.
```
public function get_meta_keys( $objectName ) {
$getClassVars = get_class_vars( $objectName );
return array_keys( $getClassVars() );
}
``` |
18,972,768 | /CustomPostType.php on line 165
```
// Initialise class variables as blank
$metaKeys = $this->get_meta_keys();
foreach( $metaKeys as $key )
if( !empty( $key ) )
$this->$key = null;
$this->ID = null;
```
The below code is what fixed the syntax error.
```
publi... | 2013/09/24 | [
"https://Stackoverflow.com/questions/18972768",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2809489/"
] | There is syntax error in the code. It should be like this :
```
public function get_meta_keys( $objectName) {
$getClassVars = get_class_vars( $objectName );
return array_keys( $getClassVars);
}
```
Point to correct :
* Correct function signature. Add argument in the function get\_meta\_keys(). | Put semicolon at the end of the function call and also you need to format your code first.
```
public function get_meta_keys( )
{
$getClassVars = get_class_vars( $objectName );
return array_keys( $getClassVars() );
}
``` |
25,079,285 | **model**
```
class Clip < ActiveRecord::Base
validates_length_of :description, maximum: 160
end
```
**controller**
```
def update
@clip = @film.clips.find_by_permalink(params[:id])
respond_to do |format|
if @clip.update(clip_params)
format.html { redirect_to saas_admin_studio_film_path(@... | 2014/08/01 | [
"https://Stackoverflow.com/questions/25079285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985241/"
] | I don't think `resource` is the same Clip object as `@clip`.
Where in the code are you assigning `@clip` to be `resource`? I can't see where you have defined `resource` at all.
If you change it to be `<%= render 'saas_admin/shared/errors', resource: @clip %>` does the problem resolve? | As you have seen, though it probably seems backwards, the main difference between update and update! is how failed saves are handled.
When updating an ActiveRecord class the ! version will raise an exception if the record is invalid.
More info at <http://api.rubyonrails.org/classes/ActiveRecord/Base.html> |
11,686,798 | I'm trying to build a JavaScript parser for .ppt files. PPTX is no big deal since it' an "open" format, but I'm really lost regarding the file structure of a .ppt file and can't find any useful information.
Given this, has anyone ever tried this, or can at least point me to where I can see the 'spec' for the .ppt, so ... | 2012/07/27 | [
"https://Stackoverflow.com/questions/11686798",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1118461/"
] | .ppt is a binary file format. You can read the [1997-2007 spec here](http://msdn.microsoft.com/en-us/library/office/cc313106%28v=office.12%29.aspx)
Not to discourage you from trying, but you should note that this may wind up being a daunting/almost impossible task for 1 developer to implement since the entire spec rep... | Your dreams have been answered...
Someone built a pure JavaScript PPT binary file parser. Check it out on Git
<https://github.com/SheetJS/js-ppt> |
9,259 | I wrote an answer to question
[Who wrote about an energy free space elevator?](https://scifi.stackexchange.com/questions/39639/who-wrote-about-an-energy-free-space-elevator/121089?noredirect=1#comment297621_121089).
The question is asking for *scientific writers* - which may indicate
science-fiction writer using real... | 2016/03/03 | [
"https://scifi.meta.stackexchange.com/questions/9259",
"https://scifi.meta.stackexchange.com",
"https://scifi.meta.stackexchange.com/users/15592/"
] | I think the original deletion was the right thing to do - your answer has some serious problems:
* It's a story identification question: in addition to the tag, the OP clearly states in the question that he's looking for a Sci-Fi story, not a science reference.
* "scientific writers" is most likely a reference to Sci-... | Flag the post with a custom reason and another mod will review it, or bring it up here on meta for more public feedback. But it's not going to help you here, the question is looking for a particular work by a particular author, not the scientific literature on the idea. |
9,259 | I wrote an answer to question
[Who wrote about an energy free space elevator?](https://scifi.stackexchange.com/questions/39639/who-wrote-about-an-energy-free-space-elevator/121089?noredirect=1#comment297621_121089).
The question is asking for *scientific writers* - which may indicate
science-fiction writer using real... | 2016/03/03 | [
"https://scifi.meta.stackexchange.com/questions/9259",
"https://scifi.meta.stackexchange.com",
"https://scifi.meta.stackexchange.com/users/15592/"
] | The appropriate course to contact a moderator is to [flag the post with a custom reason explaining what you want reviewed](https://meta.stackexchange.com/a/261453/299342). You might get the same moderator, or you might not, and even if you do get a different moderator you might not get the desired reaction (in this cas... | Flag the post with a custom reason and another mod will review it, or bring it up here on meta for more public feedback. But it's not going to help you here, the question is looking for a particular work by a particular author, not the scientific literature on the idea. |
42,796 | Instead of dividing a beat, or an entire sequence of beats, could it be that it alters the duration of (say) one and a half beats? | 2016/03/16 | [
"https://music.stackexchange.com/questions/42796",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/24521/"
] | Yes, absolutely. For a typical "three in the time of two" tuplet (a triplet), just select the note length that will give you half of the length you desire. So for 4/4, one beat is a quarter and 1.5 is a dotted quarter; half of that is a dotted eighth.
Here's an example I made in Finale to represent that:
[ quavers, so in that ... |
42,796 | Instead of dividing a beat, or an entire sequence of beats, could it be that it alters the duration of (say) one and a half beats? | 2016/03/16 | [
"https://music.stackexchange.com/questions/42796",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/24521/"
] | In "traditional" notation, tuplets only occupy a complete number of beats, or a simple fraction (e.g. 1/2, 1/4) of a beat.
In "contemporary classical" music, you can write whatever you want to define the rhythm - but as another answer says, your example is pointless since the notes in the tuplet are the same length as... | Might need a more concrete example of the kind of thing you're asking. But if you mean: can you do something like a quaver triplet on beat one and a semiquaver triplet and quaver rest on beat 2 in common time, yes, absolutely. But making 1.5 beats into a triplet is just three straight (non-triplet) quavers, so in that ... |
121,962 | I'd like to bake hue and saturation information directly into an image. This is my current setup that gives desired color values:
[](https://i.stack.imgur.com/8iU6s.png)
If I merge group into a single layer I lose all the information provided in `Hue... | 2019/03/29 | [
"https://graphicdesign.stackexchange.com/questions/121962",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/135267/"
] | Simply **Flatten** the image - Layer Panel Menu > Flatten image.
Another option is to Merge Visible -- Create a new blank layer above everything, and highlight it, choose Merge Visible form the layer panel menu. This will basically flatten the image while *not* creating a "background" layer.
**What I generally use..... | 1. set the visibility on only for layers you want to merge. Hide all others
2. Press `Ctrl + Alt + Shift + E`
3. Voila !
Edit: Command + Option + E (Mac) |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | ```
[XmlRoot("root")]
public class Sample1Xml
{
internal Sample1Xml()
{
}
[XmlElement("node")]
public NodeType Node { get; set; }
#region Nested type: NodeType
public class NodeType
{
[XmlAttribute("attr1")]
public string Attr1 { get; set; }
[XmlAttribute("att... | In the class to be serialized:
```
public CData Content { get; set; }
```
And the CData class:
```
public class CData : IXmlSerializable
{
private string _value;
/// <summary>
/// Allow direct assignment from string:
/// CData cdata = "abc";
/// </summary>
/// <param name="value">The string... |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | In my case I'm using mixed fields, some CDATA some not,
at least for me the following solution is working....
By always reading the Value field, I'm getting the contents, regardless whether CDATA or just plain text.
```
[XmlElement("")]
public XmlCDataSection CDataValue {
get {
return new... | This works pretty well
```
using System.Collections.ObjectModel;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;
public class CDataContent
{
public CDataContent()
{
}
public CDataContent(string content)
{
this.Content = content;
}
[XmlIgnore]
public strin... |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | I had a similar need but required a different output format - I wanted an attribute on the node that contains the CDATA. I took some inspiration from the above solutions to create my own. Maybe it will help someone in the future...
```
public class EmbedScript
{
[XmlAttribute("type")]
public string Type { get;... | In my case I'm using mixed fields, some CDATA some not,
at least for me the following solution is working....
By always reading the Value field, I'm getting the contents, regardless whether CDATA or just plain text.
```
[XmlElement("")]
public XmlCDataSection CDataValue {
get {
return new... |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | In addition to the way posted by John Saunders, you can use an [XmlCDataSection](http://msdn.microsoft.com/en-us/library/system.xml.xmlcdatasection(v=vs.110).aspx) as the type directly, although it boils down to nearly the same thing:
```
private string _message;
[XmlElement("CDataElement")]
public XmlCDataSection Mes... | I had a similar need but required a different output format - I wanted an attribute on the node that contains the CDATA. I took some inspiration from the above solutions to create my own. Maybe it will help someone in the future...
```
public class EmbedScript
{
[XmlAttribute("type")]
public string Type { get;... |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | In addition to the way posted by John Saunders, you can use an [XmlCDataSection](http://msdn.microsoft.com/en-us/library/system.xml.xmlcdatasection(v=vs.110).aspx) as the type directly, although it boils down to nearly the same thing:
```
private string _message;
[XmlElement("CDataElement")]
public XmlCDataSection Mes... | In my case I'm using mixed fields, some CDATA some not,
at least for me the following solution is working....
By always reading the Value field, I'm getting the contents, regardless whether CDATA or just plain text.
```
[XmlElement("")]
public XmlCDataSection CDataValue {
get {
return new... |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | ```
[Serializable]
public class MyClass
{
public MyClass() { }
[XmlIgnore]
public string MyString { get; set; }
[XmlElement("MyString")]
public System.Xml.XmlCDataSection MyStringCDATA
{
get
{
return new System.Xml.XmlDocument().CreateCDataSection(MyString);
... | I had a similar need but required a different output format - I wanted an attribute on the node that contains the CDATA. I took some inspiration from the above solutions to create my own. Maybe it will help someone in the future...
```
public class EmbedScript
{
[XmlAttribute("type")]
public string Type { get;... |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | In the class to be serialized:
```
public CData Content { get; set; }
```
And the CData class:
```
public class CData : IXmlSerializable
{
private string _value;
/// <summary>
/// Allow direct assignment from string:
/// CData cdata = "abc";
/// </summary>
/// <param name="value">The string... | This implementation has the ability to process nested CDATA within the string you're encoding (based on John Saunders original answer).
For example, suppose you wanted to encode the following literal string into CDATA:
```
I am purposefully putting some <![CDATA[ cdata markers right ]]> in here!!
```
You would want... |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | This implementation has the ability to process nested CDATA within the string you're encoding (based on John Saunders original answer).
For example, suppose you wanted to encode the following literal string into CDATA:
```
I am purposefully putting some <![CDATA[ cdata markers right ]]> in here!!
```
You would want... | This works pretty well
```
using System.Collections.ObjectModel;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;
public class CDataContent
{
public CDataContent()
{
}
public CDataContent(string content)
{
this.Content = content;
}
[XmlIgnore]
public strin... |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | ```
[Serializable]
public class MyClass
{
public MyClass() { }
[XmlIgnore]
public string MyString { get; set; }
[XmlElement("MyString")]
public System.Xml.XmlCDataSection MyStringCDATA
{
get
{
return new System.Xml.XmlDocument().CreateCDataSection(MyString);
... | In my case I'm using mixed fields, some CDATA some not,
at least for me the following solution is working....
By always reading the Value field, I'm getting the contents, regardless whether CDATA or just plain text.
```
[XmlElement("")]
public XmlCDataSection CDataValue {
get {
return new... |
1,379,888 | Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer? | 2009/09/04 | [
"https://Stackoverflow.com/questions/1379888",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/142017/"
] | ```
[XmlRoot("root")]
public class Sample1Xml
{
internal Sample1Xml()
{
}
[XmlElement("node")]
public NodeType Node { get; set; }
#region Nested type: NodeType
public class NodeType
{
[XmlAttribute("attr1")]
public string Attr1 { get; set; }
[XmlAttribute("att... | This works pretty well
```
using System.Collections.ObjectModel;
using System.Linq;
using System.Xml;
using System.Xml.Serialization;
public class CDataContent
{
public CDataContent()
{
}
public CDataContent(string content)
{
this.Content = content;
}
[XmlIgnore]
public strin... |
41,393,525 | I'm working on a game using Swing and I'm using KeyBindings for input from the keyboard.
I'm having issues where the KeyBindings stop responding. It happens every time I run the application, but as far as I can tell, it's not when a certain chain of events occurs. The KeyBindings just stop receiving input from the key... | 2016/12/30 | [
"https://Stackoverflow.com/questions/41393525",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5540738/"
] | ***You might think this is a bug in MAC, while it is not Because MAC has the feature of secondary keys***.
As you are the user of MAC, I hope you are aware of this feature. This feature might be the **the cause** of your problem.
**The Secondary key feature of MAC :** is used where holding down a letter key will... | Besides what Tahir Hussain Mir suggest about changing the Mac key settings, I find the problem lies with the looping, it'd be more efficient to implement it in a event-driven way, I took the liberty to change your code a bit. Together with Hussain Mir suggest 's solution, it should solve your problem.
You could also h... |
26,711,970 | I am trying to match below mentioned regexp with `\b` and `\W`. It doesn't match with `\b` but matches with `\W`
```
my $response = "ABC-12-1-1::HELLO=TX,PROVFEADDR=\"\",ValueFORM=NAME-CITY-STREET-PRT,";
print "\n\n\n$response\n\n\n";
if ( $response =~ /PROVFEADDR=\b/ ) ##### matching with //PROVFEADDR=\W/
{
p... | 2014/11/03 | [
"https://Stackoverflow.com/questions/26711970",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336962/"
] | The reason `\b` does not match is that it needs a word and a non-word character next to it, and you have two non-word characters.
In your comments, you have mentioned that you are looking for a replacement for `\W` that also matches end of line, in which case a negative lookahead assertion can be used:
```
if($respon... | In `$response`, the character after `PROVFEADDR=` is the double quote, not a word, so it matches `\W`(non-word).
It doesn't match `\b` because it's not a word boundary. Compare it with:
```
if($response =~ /PROVFEADDR\b=/)
```
Here, between `R` and `=` is a word boundary. |
12,009,367 | Can someone explaine and help me with this. My webpage is slugish because the scroll function is dragging it down. I need to add a delay but don't understand how to do this.
```
$(window).scroll(handleScroll);
``` | 2012/08/17 | [
"https://Stackoverflow.com/questions/12009367",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1540479/"
] | You could write a simple [~~throttle~~ debounce function](http://www.nczonline.net/blog/2007/11/30/the-throttle-function/) to limit the times per second the scroll event will be handled.
```
function debounce(method, delay) {
clearTimeout(method._tId);
method._tId= setTimeout(function(){
method();
... | For scroll, you most likely need a throttle function like in Lodash or Underscore; great example:
```js
function throttle(func, timeFrame) {
var lastTime = 0;
return function () {
var now = new Date();
if (now - lastTime >= timeFrame) {
func();
lastTime = now;
}
};
}
```
T... |
24,412 | Some Christians claim a non-denominational church is better. However, as a scientist I like to see all angles of the story:
I was under the impression that since all Christians don't belong to **one church**,
(They agree to disagree on [Ephesians 4](https://www.biblegateway.com/passage/?search=Ephesians%204:1-13) and ... | 2014/01/04 | [
"https://christianity.stackexchange.com/questions/24412",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/6506/"
] | A non-denominational church is exactly what it sounds like. It is a Church that doesn't adhere to any earthly authority other than maybe the local Pastor at that Church. It doesn't recognize any denominational authority, just that of God and His Word.
I'd like to also address this portion of your question as well:
> ... | First, a Christian Denomination is a group of congregations which has joined together to share a common confession of faith.
A non-denominational church is simply a single congregation which has it's own unique confession of faith. Or, in other words, it is its own denomination consisting of a single congregation.
I... |
24,412 | Some Christians claim a non-denominational church is better. However, as a scientist I like to see all angles of the story:
I was under the impression that since all Christians don't belong to **one church**,
(They agree to disagree on [Ephesians 4](https://www.biblegateway.com/passage/?search=Ephesians%204:1-13) and ... | 2014/01/04 | [
"https://christianity.stackexchange.com/questions/24412",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/6506/"
] | Having been brought up in a nondenominational church (which shall remain nameless), I have an appreciation for that particular method of church polity. Interestingly, the local church of my formative years was very similar to numerous (thousands, really) other local churches which held to a similar tradition. The ties ... | First, a Christian Denomination is a group of congregations which has joined together to share a common confession of faith.
A non-denominational church is simply a single congregation which has it's own unique confession of faith. Or, in other words, it is its own denomination consisting of a single congregation.
I... |
24,412 | Some Christians claim a non-denominational church is better. However, as a scientist I like to see all angles of the story:
I was under the impression that since all Christians don't belong to **one church**,
(They agree to disagree on [Ephesians 4](https://www.biblegateway.com/passage/?search=Ephesians%204:1-13) and ... | 2014/01/04 | [
"https://christianity.stackexchange.com/questions/24412",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/6506/"
] | A non-denominational church is exactly what it sounds like. It is a Church that doesn't adhere to any earthly authority other than maybe the local Pastor at that Church. It doesn't recognize any denominational authority, just that of God and His Word.
I'd like to also address this portion of your question as well:
> ... | Having been brought up in a nondenominational church (which shall remain nameless), I have an appreciation for that particular method of church polity. Interestingly, the local church of my formative years was very similar to numerous (thousands, really) other local churches which held to a similar tradition. The ties ... |
360,828 | I have 6 figures of the same size and I would like them to be subfiqures in a figure in the format so that they are all aligned with 3 figures on the first row and 3 figures directly below.
I have tried the following which gives me 3 figures in each row but are all misaligned (I use the subfig package but it causes a... | 2017/03/28 | [
"https://tex.stackexchange.com/questions/360828",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/128678/"
] | **Edit:** I complete my code snippet to MWE and add image of figures.
I'm pretty sure, that your question is duplicate ... anyway, try the following:
```
\documentclass{article}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\subfloat[A]{\includegraphics[width=3cm]{example-imag... | You could also try this, which does not need subfig, nor subcaption. It gives you a little bit more control IMO.
```
\begin{figure}[!htb]
\hspace*{-1cm}
\includegraphics[width=62mm]{image1_1row.png}%
\hspace*{-1cm}
\includegraphics[width=62mm]{image2_1row.png}%
\hspace*{-1cm}
\includegraphics[width=62mm]{image3_1row.p... |
21,019 | I'm about to buy a Samsung Galaxy Ace (it's not much expensive and I think it's a pretty good phone), however everyone has been complaining with the battery life but admitting that isn't bad compared to all the other smartphones.
I read about how to save battery with tips/tricks, and I'll certainly do it; but I'd like... | 2012/03/25 | [
"https://android.stackexchange.com/questions/21019",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/13698/"
] | Modern phones use Li-ion and Li-poly batteries. So the battery life is not affected by whether you charge them at 0% or 90%.
It only has a long term effect. Batteries degrade with every charge cycle. A cycle is usually a recharge from below 50%. So charging while the battery capacity is still relatively high has a lon... | Full discharges put a strain on the battery.
[This](https://android.stackexchange.com/questions/1020/does-constant-charging-harm-my-android-cellphone) topic might be of some help to you (the first answer specifically). |
21,019 | I'm about to buy a Samsung Galaxy Ace (it's not much expensive and I think it's a pretty good phone), however everyone has been complaining with the battery life but admitting that isn't bad compared to all the other smartphones.
I read about how to save battery with tips/tricks, and I'll certainly do it; but I'd like... | 2012/03/25 | [
"https://android.stackexchange.com/questions/21019",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/13698/"
] | Full discharges put a strain on the battery.
[This](https://android.stackexchange.com/questions/1020/does-constant-charging-harm-my-android-cellphone) topic might be of some help to you (the first answer specifically). | When you say old phones, I think you meant devices which had Ni-Cad batteries. That practice of recharging only when the battery was run down is known as the [Memory Effect](http://en.wikipedia.org/wiki/Nickel%E2%80%93cadmium_battery#Memory_and_lazy_battery_effects)
Like Richard said, most phones don't use Ni-Cad any... |
21,019 | I'm about to buy a Samsung Galaxy Ace (it's not much expensive and I think it's a pretty good phone), however everyone has been complaining with the battery life but admitting that isn't bad compared to all the other smartphones.
I read about how to save battery with tips/tricks, and I'll certainly do it; but I'd like... | 2012/03/25 | [
"https://android.stackexchange.com/questions/21019",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/13698/"
] | Modern phones use Li-ion and Li-poly batteries. So the battery life is not affected by whether you charge them at 0% or 90%.
It only has a long term effect. Batteries degrade with every charge cycle. A cycle is usually a recharge from below 50%. So charging while the battery capacity is still relatively high has a lon... | When you say old phones, I think you meant devices which had Ni-Cad batteries. That practice of recharging only when the battery was run down is known as the [Memory Effect](http://en.wikipedia.org/wiki/Nickel%E2%80%93cadmium_battery#Memory_and_lazy_battery_effects)
Like Richard said, most phones don't use Ni-Cad any... |
3,585,004 | I have the code provided below. I've tried using jquery to select to make something happen but eventually what I have doesnt work or may be incorrect.
```
$("#emailList option").click(function() {
alert("OMG");
});
<select id="emailList" multiple="multiple" name="emailList">
<option>abc@123.com</option>
</select... | 2010/08/27 | [
"https://Stackoverflow.com/questions/3585004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/399365/"
] | Try:
```
$("#emailList").change(function() {
alert($('option:selected', $(this)).text());
});
``` | You can use the [`.change()`](http://api.jquery.com/change/) method like this:
```
$("#emailList").change(function() {
alert("Current value:" + $(this).val());
});
```
Since your `<option>` has no value, the text will be the value, so using [`.val()`](http://api.jquery.com/val/) works here. The [`.click()`](http:/... |
18,361 | I have a Windows 2008 Standard server. It currently has 3x 1TB drives in Software RAID 5 (as per the Disk Management Console).
I need to add another 2x 1TB drives.
Is there any way to add these two disks into the existing RAID 5 array without any data loss, or without having to back everything up (We don't have that ... | 2009/06/03 | [
"https://serverfault.com/questions/18361",
"https://serverfault.com",
"https://serverfault.com/users/7709/"
] | I *think* you could add the disks to the array and then use something like Partition Magic (or Partimage) to increase the size of the partition on the array of disks.
Regardless, you need a backup. RAID is not a backup strategy (as has been written many times in this site). Schedule the system downtime for immediately... | Does it need to be part of the same drive?
Could you add those two drives as a RAID 1 and mount them as an E drive?
Then move some of the file shares over there to help balance the usage.
Thats what I did the last time I had to add more space to a file server. Safer then messing with existing drives. |
18,361 | I have a Windows 2008 Standard server. It currently has 3x 1TB drives in Software RAID 5 (as per the Disk Management Console).
I need to add another 2x 1TB drives.
Is there any way to add these two disks into the existing RAID 5 array without any data loss, or without having to back everything up (We don't have that ... | 2009/06/03 | [
"https://serverfault.com/questions/18361",
"https://serverfault.com",
"https://serverfault.com/users/7709/"
] | It would appear that the short answer is "No" - a Windows RAID-5 array cannot be expanded (safely) once it has been made. So make sure you get enough headroom in it in the first place, or buy a proper RAID controller that supports online expansion! | I *think* you could add the disks to the array and then use something like Partition Magic (or Partimage) to increase the size of the partition on the array of disks.
Regardless, you need a backup. RAID is not a backup strategy (as has been written many times in this site). Schedule the system downtime for immediately... |
18,361 | I have a Windows 2008 Standard server. It currently has 3x 1TB drives in Software RAID 5 (as per the Disk Management Console).
I need to add another 2x 1TB drives.
Is there any way to add these two disks into the existing RAID 5 array without any data loss, or without having to back everything up (We don't have that ... | 2009/06/03 | [
"https://serverfault.com/questions/18361",
"https://serverfault.com",
"https://serverfault.com/users/7709/"
] | It would appear that the short answer is "No" - a Windows RAID-5 array cannot be expanded (safely) once it has been made. So make sure you get enough headroom in it in the first place, or buy a proper RAID controller that supports online expansion! | Does it need to be part of the same drive?
Could you add those two drives as a RAID 1 and mount them as an E drive?
Then move some of the file shares over there to help balance the usage.
Thats what I did the last time I had to add more space to a file server. Safer then messing with existing drives. |
18,361 | I have a Windows 2008 Standard server. It currently has 3x 1TB drives in Software RAID 5 (as per the Disk Management Console).
I need to add another 2x 1TB drives.
Is there any way to add these two disks into the existing RAID 5 array without any data loss, or without having to back everything up (We don't have that ... | 2009/06/03 | [
"https://serverfault.com/questions/18361",
"https://serverfault.com",
"https://serverfault.com/users/7709/"
] | I had the same problem with Windows Server 2003 (not able to expand a Windows RAID-5 array),
I ended up writing a program that does the trick (expand an NTFS partition on a dynamic RAID-5 volume, it also has the ability to recover from a drive failure during the expansion process)
The on-disk structure for Server 200... | Does it need to be part of the same drive?
Could you add those two drives as a RAID 1 and mount them as an E drive?
Then move some of the file shares over there to help balance the usage.
Thats what I did the last time I had to add more space to a file server. Safer then messing with existing drives. |
18,361 | I have a Windows 2008 Standard server. It currently has 3x 1TB drives in Software RAID 5 (as per the Disk Management Console).
I need to add another 2x 1TB drives.
Is there any way to add these two disks into the existing RAID 5 array without any data loss, or without having to back everything up (We don't have that ... | 2009/06/03 | [
"https://serverfault.com/questions/18361",
"https://serverfault.com",
"https://serverfault.com/users/7709/"
] | It would appear that the short answer is "No" - a Windows RAID-5 array cannot be expanded (safely) once it has been made. So make sure you get enough headroom in it in the first place, or buy a proper RAID controller that supports online expansion! | I had the same problem with Windows Server 2003 (not able to expand a Windows RAID-5 array),
I ended up writing a program that does the trick (expand an NTFS partition on a dynamic RAID-5 volume, it also has the ability to recover from a drive failure during the expansion process)
The on-disk structure for Server 200... |
68,759,254 | As far as I can see, the contracts of both are identical. Seems rather pointless to implement a whole new empty set for `Set.of()`.
I would presume the standard library implementors are aware of `Collections.emptySet()`, so there must be a specific reason I am not seeing. Due to the very generic method names, searchin... | 2021/08/12 | [
"https://Stackoverflow.com/questions/68759254",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/499922/"
] | You can call the `panic` function in the kernel:
```
panic("DON'T PANIC!\n");
``` | You should issue the command:
```sh
sudo bash -c 'echo "c" > /proc/sysrq-trigger'
``` |
53,297,450 | VBA implicitly converts values to `Variant` as needed, so what would be a use case of the [`CVar` function](https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/type-conversion-functions)? In the [example given in the documentation](https://learn.microsoft.com/en-us/office/vba/language/concept... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53297450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87698/"
] | ```
window.addEventListener('resize', () => {
if (window.innerWidth < 890) {
console.log('Less than 890px');
} else {
console.log('890px or more');
}
});
``` | try this
```js
if(window.attachEvent) {
window.attachEvent('onresize', function() {
if (window.innerWidth < 890) {
console.log('Less than 890px');
} else {
console.log('890px or more');
}
});
}
else if(window.addEventListener) {
window.addEventListener('r... |
53,297,450 | VBA implicitly converts values to `Variant` as needed, so what would be a use case of the [`CVar` function](https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/type-conversion-functions)? In the [example given in the documentation](https://learn.microsoft.com/en-us/office/vba/language/concept... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53297450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87698/"
] | ```
window.addEventListener('resize', () => {
if (window.innerWidth < 890) {
console.log('Less than 890px');
} else {
console.log('890px or more');
}
});
``` | Just use:
```
window.onresize = function(event) {
//your code here
};
``` |
53,297,450 | VBA implicitly converts values to `Variant` as needed, so what would be a use case of the [`CVar` function](https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/type-conversion-functions)? In the [example given in the documentation](https://learn.microsoft.com/en-us/office/vba/language/concept... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53297450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87698/"
] | ```
window.addEventListener('resize', () => {
if (window.innerWidth < 890) {
console.log('Less than 890px');
} else {
console.log('890px or more');
}
});
``` | ```
const on = (e, i, t = window) => typeof t.addEventListener === 'function'
? t.addEventListener (e, i)
: t.attachEvent ('on' + e, i)
const test = () => console.log (window.innerWidth < 890 ? '< 890' : '>= 890')
on ('resize', test)
``` |
53,297,450 | VBA implicitly converts values to `Variant` as needed, so what would be a use case of the [`CVar` function](https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/type-conversion-functions)? In the [example given in the documentation](https://learn.microsoft.com/en-us/office/vba/language/concept... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53297450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87698/"
] | `onresize` is to be used as an attribute in your html. e.g. `<body onresize="resizePage()"></body>`
The correct event is `resize`. Try following
```
if (window.attachEvent) {
window.attachEvent('resize', function() {
if (window.innerWidth < 890) {
console.log('Less than 890px');
} else {
console.l... | Just try the following code
```
window.onresize = resize;
function resize()
{
if(document.body.clientWidth < 890)
{
alert("resize event detected!");
}
}
``` |
53,297,450 | VBA implicitly converts values to `Variant` as needed, so what would be a use case of the [`CVar` function](https://learn.microsoft.com/en-us/office/vba/language/concepts/getting-started/type-conversion-functions)? In the [example given in the documentation](https://learn.microsoft.com/en-us/office/vba/language/concept... | 2018/11/14 | [
"https://Stackoverflow.com/questions/53297450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/87698/"
] | try this
```js
if(window.attachEvent) {
window.attachEvent('onresize', function() {
if (window.innerWidth < 890) {
console.log('Less than 890px');
} else {
console.log('890px or more');
}
});
}
else if(window.addEventListener) {
window.addEventListener('r... | Just use:
```
window.onresize = function(event) {
//your code here
};
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.