qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
8,638,109 | I saw a class "AttributeSelectedClassifier" was once created in the following ways:
```
AttributeSelectedClassifier classifier = new AttributeSelectedClassifier();
classifier.setClassifier(base);
classifier.setEvaluator(eval);
```
This above one looks natural to me. But how about the following one.
```
classifier ... | 2011/12/26 | [
"https://Stackoverflow.com/questions/8638109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288609/"
] | This means that the classifier variable is declared as a superclass or superinterface of `AttributeSelectedClassifier`, and that you need to call a method which is not defined in the class or interface, but only on `AttributeSelectedClassifier`. This notation *casts* the variable to `AttributeSelectedClassifier`:
```
... | By doing `((AttributeSelectedClassifier)classifier)` you are casting ("*forcing*") the `classifier` object to behave like an instance of `AttributeSelectedClassifier`.
The `classifier` variable was probably previously declared as a superclass of AttributeSelectedClassifier. |
8,638,109 | I saw a class "AttributeSelectedClassifier" was once created in the following ways:
```
AttributeSelectedClassifier classifier = new AttributeSelectedClassifier();
classifier.setClassifier(base);
classifier.setEvaluator(eval);
```
This above one looks natural to me. But how about the following one.
```
classifier ... | 2011/12/26 | [
"https://Stackoverflow.com/questions/8638109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/288609/"
] | Look at the below code. Person implements the `CanWalk` interface. If you assign a `Person` to `CanWalk` interface as shown in the main method, which is a common practice, you can only invoke the methods that are specified in the `CanWalk` interface i.e. `walk()`. If you want to invoke `f()`, that **isn't** declared in... | By doing `((AttributeSelectedClassifier)classifier)` you are casting ("*forcing*") the `classifier` object to behave like an instance of `AttributeSelectedClassifier`.
The `classifier` variable was probably previously declared as a superclass of AttributeSelectedClassifier. |
113,098 | I’m building a character for a one shot and my DM has okay’d my character being a vampire using the rules from the *Monster Manual* (under the ["Player Characters as Vampires"](https://www.dndbeyond.com/sources/mm/monsters-v#RegionalEffects) sidebar on p. 295).
What I am unsure on is what exactly it means when it says... | 2018/01/09 | [
"https://rpg.stackexchange.com/questions/113098",
"https://rpg.stackexchange.com",
"https://rpg.stackexchange.com/users/35947/"
] | RAW: yes, you gain the traits listed
------------------------------------
You have listed the traits correctly. According to the rules as written, not even Legendary Resistance gets special treatment. It is most likely because a PC-turned-vampire is more often than not an NPC. If you (or your GM or both of you) consid... | If balance is a key issue for you and your DM there are a couple of provisions in the MM that you should bear in mind.
First, one way to look at it is, as the commenter above me put it, whether or not the transformation to becoming a full-fledged vampire is complete. You and your DM would have to work together to dete... |
46,586,701 | I am trying to compare the current row value to the previous row value but only within the same group.
I have Group1 (Plant), ChildGroup1 (DeviceTag), Details Group,
I have tried this code within the Fill property but it does not work, it just seems to change the color of the first row every time per group regardless ... | 2017/10/05 | [
"https://Stackoverflow.com/questions/46586701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4996493/"
] | I always find this kind of thing easier to do in the dataset query (assuming you can control the query in the dataset).
Manipulate your final dataset (the one SSRS will receive) to have another column which tells SSRS to color the cell or not. And keep your business logic in the DB query.
You could number each row (w... | You need to use the Scope parameter of the Previous function, providing the name of your ChildGroup1 (DeviceTag). e.g.
=IIf(Fields!DeviceTag.Value <> Previous(Fields!DeviceTag.Value , "ChildGroup1" ), "Yellow", "White")
Here's the doco:
<https://learn.microsoft.com/en-us/sql/reporting-services/report-design/report-b... |
61,575,944 | I want to create a menu that works with embedded systems. I use C.
This is how I plan to make it:
1. First, the pressed keys are identified by the interrupts.
2. A array is update on those identifications.
3. Find the corresponding term acording to array content.
4. The operation is performed.
My array is like this.... | 2020/05/03 | [
"https://Stackoverflow.com/questions/61575944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | There are several ways to archive but in the end, they are both hard to maintain and cause performance down. Let's say you would build a lookup table to ref to, assume you have 4 buttons, an array with 5 entries -> the size of lookup table(worse case) is `4x4x4x4x4 = 1024` entries. Finding the corresponding action in t... | You can use simple conditionals and assign a dictionary for each value.
Firstly, convert the array of numbers into just a singular number-
```c
int arr_to_int(int* arr, int len)
{
int number = 0;
for (int i = 0, val; i < len; i++)
{
val = arr[i];
while (val != 0)
{
val ... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | ***Basic form:*** space bias
this is a basic form that has no anchors or boundrys
`(?:[ ]|\d(?![ ])){8}\d`
[dem0](https://regex101.com/r/rS05bf/1)
feature:
* block of 9
* minimum block size of 2
* match takes maximum spaces vs minimal digits
---
***Basic form:*** number bias
same basic form that has been ... | 1. Add a comma before the spaces
2. split at the comma
3. keep only either space or digits
4. Count number of characters and see if it matches the required size
```
s = c("123456789", "kfasdf 3456789asdf",
"a 1", "12345 789", "1 9",
"a 678a")
sapply(strsplit(gsub("(\\s+)", ",\\1", s), ",... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | Another option is to match 8 times either a digit OR a space not preceded by a digit and then match a digit at the end.
```
(?<![\d\h])(?>\d|(?<!\d)\h){8}\d
```
*In parts*
* `(?<![\d\h])` Negative lookbehind, assert what is on the left is not a horizontal whitespace char or digit
* `(?>` Atomic group (no backtracki... | If you are looking for a clean **regex** solution, then you should use the following pattern:
```
(?=[ \\d]{9}(.*$))[ ]*\\d+\\1$
```
...where you combine a positive lookahead with a regular matching that includes a match from the lookahead.
The **R** syntax is then
```
str_extract(x, regex('(?=[ \\d]{9}(.*$))[ ]*\... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | ***Basic form:*** space bias
this is a basic form that has no anchors or boundrys
`(?:[ ]|\d(?![ ])){8}\d`
[dem0](https://regex101.com/r/rS05bf/1)
feature:
* block of 9
* minimum block size of 2
* match takes maximum spaces vs minimal digits
---
***Basic form:*** number bias
same basic form that has been ... | If you are looking for a clean **regex** solution, then you should use the following pattern:
```
(?=[ \\d]{9}(.*$))[ ]*\\d+\\1$
```
...where you combine a positive lookahead with a regular matching that includes a match from the lookahead.
The **R** syntax is then
```
str_extract(x, regex('(?=[ \\d]{9}(.*$))[ ]*\... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | Another option is to match 8 times either a digit OR a space not preceded by a digit and then match a digit at the end.
```
(?<![\d\h])(?>\d|(?<!\d)\h){8}\d
```
*In parts*
* `(?<![\d\h])` Negative lookbehind, assert what is on the left is not a horizontal whitespace char or digit
* `(?>` Atomic group (no backtracki... | ***Basic form:*** space bias
this is a basic form that has no anchors or boundrys
`(?:[ ]|\d(?![ ])){8}\d`
[dem0](https://regex101.com/r/rS05bf/1)
feature:
* block of 9
* minimum block size of 2
* match takes maximum spaces vs minimal digits
---
***Basic form:*** number bias
same basic form that has been ... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | The desired substring contains 9 digits or fewer than 9 digits. In the second case it begins with a space, ends with a digit and each of the 7 characters in between is a space preceded by a space or a digit followed by a digit. We therefore could use the following regular expression.
```
\d{9}|\s(?:(?<=\s)\s|\d(?=\d))... | That's not an easy task for regexp-s. You really should consider parsing the string yourself. At least partially. Because you need the lengths of capturing groups and regexp-s do not have this feature.
But if you really want to use them, then there's a workaround:
I'll use JS so that the code can be ran right here.... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | Another option is to match 8 times either a digit OR a space not preceded by a digit and then match a digit at the end.
```
(?<![\d\h])(?>\d|(?<!\d)\h){8}\d
```
*In parts*
* `(?<![\d\h])` Negative lookbehind, assert what is on the left is not a horizontal whitespace char or digit
* `(?>` Atomic group (no backtracki... | 1. Add a comma before the spaces
2. split at the comma
3. keep only either space or digits
4. Count number of characters and see if it matches the required size
```
s = c("123456789", "kfasdf 3456789asdf",
"a 1", "12345 789", "1 9",
"a 678a")
sapply(strsplit(gsub("(\\s+)", ",\\1", s), ",... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | ***Basic form:*** space bias
this is a basic form that has no anchors or boundrys
`(?:[ ]|\d(?![ ])){8}\d`
[dem0](https://regex101.com/r/rS05bf/1)
feature:
* block of 9
* minimum block size of 2
* match takes maximum spaces vs minimal digits
---
***Basic form:*** number bias
same basic form that has been ... | You may use the [regex pattern](https://regex101.com/r/7IlxOa/2)
```
[ \d](?:(?<=[ ])[ ]|\d){7}\d
```
and in **R** use
```
str_extract(x, regex('[ \\d](?:(?<=[ ])[ ]|\\d){7}\\d'))
```
See [this demo](https://ideone.com/tWIouq).
---
[](https://... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | Using string `s` from @d.b's answer.
Extract optional whitespace followed by numbers.
```
library(stringr)
str_extract(s, '(\\s+)?\\d+')
#[1] "123456789" " 3456789" " 1" "12345" "1" " 678"
```
Check their length using `nchar`.
```
nchar(str_extract(s, '(\\s+)?\\d+')) == 9
#[1] TRUE TR... | 1. Add a comma before the spaces
2. split at the comma
3. keep only either space or digits
4. Count number of characters and see if it matches the required size
```
s = c("123456789", "kfasdf 3456789asdf",
"a 1", "12345 789", "1 9",
"a 678a")
sapply(strsplit(gsub("(\\s+)", ",\\1", s), ",... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | You may use the [regex pattern](https://regex101.com/r/7IlxOa/2)
```
[ \d](?:(?<=[ ])[ ]|\d){7}\d
```
and in **R** use
```
str_extract(x, regex('[ \\d](?:(?<=[ ])[ ]|\\d){7}\\d'))
```
See [this demo](https://ideone.com/tWIouq).
---
[](https://... | That's not an easy task for regexp-s. You really should consider parsing the string yourself. At least partially. Because you need the lengths of capturing groups and regexp-s do not have this feature.
But if you really want to use them, then there's a workaround:
I'll use JS so that the code can be ran right here.... |
60,777,481 | I am trying to implement recycler View in android but after adding it to the app it is not showing anything. I have searched online yet I am not able to figure out what am I doing wrong.
Also When I declare dashpercent and dashsubject (mentioned in adapter) in class RecyclerViewHolder extends RecyclerView.ViewHolder th... | 2020/03/20 | [
"https://Stackoverflow.com/questions/60777481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12505541/"
] | Another option is to match 8 times either a digit OR a space not preceded by a digit and then match a digit at the end.
```
(?<![\d\h])(?>\d|(?<!\d)\h){8}\d
```
*In parts*
* `(?<![\d\h])` Negative lookbehind, assert what is on the left is not a horizontal whitespace char or digit
* `(?>` Atomic group (no backtracki... | The desired substring contains 9 digits or fewer than 9 digits. In the second case it begins with a space, ends with a digit and each of the 7 characters in between is a space preceded by a space or a digit followed by a digit. We therefore could use the following regular expression.
```
\d{9}|\s(?:(?<=\s)\s|\d(?=\d))... |
49,272,176 | I'm trying to initialise a value in dictionary as follow,
```
var og:image: String
```
But after `og:` it tries to assign the type considering `og` as the variable to site\_name, which is obviously wrong.
>
> Is there a way to assign `og:image` as variable to `String` type using
> special or escape characters?
> ... | 2018/03/14 | [
"https://Stackoverflow.com/questions/49272176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5484311/"
] | You cannot use : (colon). But if you really want:
```
var ogCOLONimage: String
```
Joking apart. You could use a Dictionary or something like that:
```
var images: [String: String] = ["og:image" : "your string"]
```
Now you can access your `og:image` data with `images["og:image"]`. | Swift allow you to use almost any character when naming variables. You can even use Unicode characters.
However, there are a few restrictions:
>
> Constant and variable names can’t contain whitespace characters, mathematical symbols, arrows, private-use (or invalid) Unicode code points, or line- and box-drawing char... |
49,272,176 | I'm trying to initialise a value in dictionary as follow,
```
var og:image: String
```
But after `og:` it tries to assign the type considering `og` as the variable to site\_name, which is obviously wrong.
>
> Is there a way to assign `og:image` as variable to `String` type using
> special or escape characters?
> ... | 2018/03/14 | [
"https://Stackoverflow.com/questions/49272176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5484311/"
] | Turns out swift has it's own feature in terms of naming specificity of variables in structs i.e. `CodingKeys`, so in terms for me the below naming convention worked,
```
struct Metadata: Decodable{
var metatags: [enclosedTags]
}
struct enclosedTags: Decodable{
let image: String
... | Swift allow you to use almost any character when naming variables. You can even use Unicode characters.
However, there are a few restrictions:
>
> Constant and variable names can’t contain whitespace characters, mathematical symbols, arrows, private-use (or invalid) Unicode code points, or line- and box-drawing char... |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | Yes, as long as you are responsible with the payments and treat it as a cash substitute, and not a loan. I waited until I was 21 to apply for my first credit card, which gave me a later start to my credit history.
That led to an embarrassing credit rejection when I went to buy some furniture after I graduated college.... | >
> Assuming I only use it to buy things I can afford (which I trust
> myself to do), essentially treating it as a debit card, is this a good
> idea?
>
>
>
This is definitely a good idea.
From my own experience, before I got my first credit card through my local bank (age 18), I tired to apply for a card that h... |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | I also feel it's important to NOT get a credit card. I'm in my mid 30's and have had credit cards since I was 20, as has everyone I know. Every single one of those people, with the exception of my dad, is currently carrying some amount of credit card debt - almost always in the thousands of dollars.
Here is the essen... | I will disagree with the other answers. The idea that there is some to establish a "credit history" is largely a myth propagated by loaners who see it as positive propaganda to increase the numbers of their prospective customers.
You will find some people who claim they were rejected for a card because they had no "cr... |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | The length of time you have established credit does improve your credit score in the long run.
As long as you can avoid paying interest, you might see if you can get a card with cash back rewards. I have one from Citi that sends me a $50 check every so often when I have enough rewards built up. | I will disagree with the other answers. The idea that there is some to establish a "credit history" is largely a myth propagated by loaners who see it as positive propaganda to increase the numbers of their prospective customers.
You will find some people who claim they were rejected for a card because they had no "cr... |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | The length of time you have established credit does improve your credit score in the long run.
As long as you can avoid paying interest, you might see if you can get a card with cash back rewards. I have one from Citi that sends me a $50 check every so often when I have enough rewards built up. | No, don't open a credit card. Get used to paying cash for everything from the beginning. The best situation you can be in is not to have any credit. When it comes time to buy a house, put down %30 percent and your 0 credit score won't matter.
This will keep you within your means, and, with governments gathering more a... |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | Yes, it is a very good idea to start your credit history early. It sounds like you have a good understanding of the appropriate use of credit, as a substitute for cash rather than a supplement to income. As long as you keep your expenses under control and pay off your card each month, I see no problems with the idea.
... | >
> Assuming I only use it to buy things I can afford (which I trust
> myself to do), essentially treating it as a debit card, is this a good
> idea?
>
>
>
This is definitely a good idea.
From my own experience, before I got my first credit card through my local bank (age 18), I tired to apply for a card that h... |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | I want to recommend an exercise:
Find all the people nearby who you can talk to in less than 24 hours about credit cards: Your family, whoever lives with you, and friends.
Now, ask each of them "what's the worst situation you've gotten yourself into with a credit card?"
Personally, the ratio of people who I asked wh... | Definitely not. Credit cards only exist to suck you into the soulless corporate system. What you want to remember here is that you can't trust banks, so you'll want to convert all your savings into some durable asset, say, bitcoins for example, and then hoard them like Smaug until after the Fall. |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | >
> Assuming I only use it to buy things I can afford (which I trust
> myself to do), essentially treating it as a debit card, is this a good
> idea?
>
>
>
This is definitely a good idea.
From my own experience, before I got my first credit card through my local bank (age 18), I tired to apply for a card that h... | Definitely not. Credit cards only exist to suck you into the soulless corporate system. What you want to remember here is that you can't trust banks, so you'll want to convert all your savings into some durable asset, say, bitcoins for example, and then hoard them like Smaug until after the Fall. |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | The length of time you have established credit does improve your credit score in the long run.
As long as you can avoid paying interest, you might see if you can get a card with cash back rewards. I have one from Citi that sends me a $50 check every so often when I have enough rewards built up. | This is a good idea, but it will barely affect your credit score at all.
Credit cards, while a good tool to use for giving a minor boost to your credit score and for purchasing things while also building up rewards with those purchases, aren't very good for building credit.
This is because when banks calculate your... |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | I will disagree with the other answers. The idea that there is some to establish a "credit history" is largely a myth propagated by loaners who see it as positive propaganda to increase the numbers of their prospective customers.
You will find some people who claim they were rejected for a card because they had no "cr... | Definitely not. Credit cards only exist to suck you into the soulless corporate system. What you want to remember here is that you can't trust banks, so you'll want to convert all your savings into some durable asset, say, bitcoins for example, and then hoard them like Smaug until after the Fall. |
48,490 | I spend about $20-30 a week on my debit card, with periodic $200-300 purchases every few months. I've thought about getting a credit card the moment I turn 18 and using it to buy everything, then immediately paying it off. Assuming I only use it to buy things I can afford (which I trust myself to do), essentially treat... | 2015/05/28 | [
"https://money.stackexchange.com/questions/48490",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/13558/"
] | Yes, it is a very good idea to start your credit history early. It sounds like you have a good understanding of the appropriate use of credit, as a substitute for cash rather than a supplement to income. As long as you keep your expenses under control and pay off your card each month, I see no problems with the idea.
... | I will disagree with the other answers. The idea that there is some to establish a "credit history" is largely a myth propagated by loaners who see it as positive propaganda to increase the numbers of their prospective customers.
You will find some people who claim they were rejected for a card because they had no "cr... |
10,997,719 | I'm in the process of learning Databases and SQL. From what I have read adding an index to a table can increase performance to from around (log(n)) to even constant time.
Considering the increased space usage, at what point does it make sense to add an index to a table?
For example if i was using an employees table... | 2012/06/12 | [
"https://Stackoverflow.com/questions/10997719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207026/"
] | Here are two examples that might help you think about this. These are not to be relied on as technically accurate (e.g. because of the effect of consecutive reads on the disk being more efficient than random seeks) but they are an illustration.
The first example is to think of a small table that is a couple of blocks... | My opinion is use index on columns you access frequently (like Primary Keys (this should be default), columns in Search criteria), you used in `WHERE` clause. It will speed up retrieval.
You should consider the fact that the table may grow in the future, putting indexes on it now prepare you for that. |
10,997,719 | I'm in the process of learning Databases and SQL. From what I have read adding an index to a table can increase performance to from around (log(n)) to even constant time.
Considering the increased space usage, at what point does it make sense to add an index to a table?
For example if i was using an employees table... | 2012/06/12 | [
"https://Stackoverflow.com/questions/10997719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207026/"
] | Here are two examples that might help you think about this. These are not to be relied on as technically accurate (e.g. because of the effect of consecutive reads on the disk being more efficient than random seeks) but they are an illustration.
The first example is to think of a small table that is a couple of blocks... | In general every table should be indexed. In particular, every table should have a primary key, which will automatically create an index (most likely a clustered index).
However, even if you didn't create a primary key, even very small tables will benefit from indexing. |
26,455,856 | so this is my code
```
function func_readmsg () {
$targetmessage = $_POST['inquiry_no'];
$result = mysqli_query(mysqli_connect("localhost", "root", "", "dbbyahenijuan"),
"SELECT * FROM tblinquiry where finquiry_no='$targetmessage' ");
while($row = mysqli_fetch_array($result)) {
global $sen... | 2014/10/19 | [
"https://Stackoverflow.com/questions/26455856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4159902/"
] | First, add a method to your class that determines if a String is numeric:
```
private boolean isNumeric(String number)
{
try
{
Integer.parseInt(number);
return true;
}
catch(NumberFormatException e)
{
return false;
}
}
```
The way this method works is that we attempt t... | you can readfile line by line:
```
BufferedReader reader = new BufferedReader(new FileReader("test.txt"));
String line = null;
while ((line = reader.readLine()) != null) {
System.out.println(line);
```
after you can check line string if it is numeric with a boolean function
```
public static boolean... |
26,455,856 | so this is my code
```
function func_readmsg () {
$targetmessage = $_POST['inquiry_no'];
$result = mysqli_query(mysqli_connect("localhost", "root", "", "dbbyahenijuan"),
"SELECT * FROM tblinquiry where finquiry_no='$targetmessage' ");
while($row = mysqli_fetch_array($result)) {
global $sen... | 2014/10/19 | [
"https://Stackoverflow.com/questions/26455856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4159902/"
] | First, add a method to your class that determines if a String is numeric:
```
private boolean isNumeric(String number)
{
try
{
Integer.parseInt(number);
return true;
}
catch(NumberFormatException e)
{
return false;
}
}
```
The way this method works is that we attempt t... | Try this code
```
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;
public class FileScanner {
File f = new File("test.txt");
public static void main(String[] args) {
FileScanner ... |
26,455,856 | so this is my code
```
function func_readmsg () {
$targetmessage = $_POST['inquiry_no'];
$result = mysqli_query(mysqli_connect("localhost", "root", "", "dbbyahenijuan"),
"SELECT * FROM tblinquiry where finquiry_no='$targetmessage' ");
while($row = mysqli_fetch_array($result)) {
global $sen... | 2014/10/19 | [
"https://Stackoverflow.com/questions/26455856",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4159902/"
] | First, add a method to your class that determines if a String is numeric:
```
private boolean isNumeric(String number)
{
try
{
Integer.parseInt(number);
return true;
}
catch(NumberFormatException e)
{
return false;
}
}
```
The way this method works is that we attempt t... | I make some modification to let you choose what case do you want print
```
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;
public class FileScanner {
File f = new File("test.txt");
List<S... |
20,778,839 | I'm trying to automate a click when visting a website. This is the HTML I'm looking at.
```
<div class="box_wrapper">
<a id="itemcode_11094414" class="box">7.5</a>
<a id="itemcode_11094415" class="box">8</a>
<a id="itemcode_11094416" class="box">8.5</a>
</div>
```
when I select the size, say for insta... | 2013/12/26 | [
"https://Stackoverflow.com/questions/20778839",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2535164/"
] | The problem is the 9 patch itself: it's **malformed**.
The black line on the **left side** is simply WRONG (it "touches" the lens).
It should be a single pixel near the lower part, so that its prolongation doesn't touch the lens.
This is it

N... | After using 9patch to create a photo, you can a image file which it's file extension is XX.9.png.
For example, search.9.png in drawable folder and you should use "android:background=@drawable/search" in xml. |
64,528 | I am planning to study abroad in Japan in two years through my college for a year at a Japanese speaking university. I also have goals/aspirations to one day work/live in Japan. Is it weird/acceptable to give myself a kanji name based off of meaning or sound of my current name? My name is Ruth which means "friend" and ... | 2018/12/21 | [
"https://japanese.stackexchange.com/questions/64528",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/32328/"
] | Firstly, for legal documents you should always be writing your name as it appears on your passport. When documents ask for your name, age, etc. they're trying to confirm your identity. If you supply a false name then they won't be able to tell whether you're a real person or not.
As for the social part, I think it's u... | I think it's more natural to write your name in English form as we're familiar with English, but I like your try.
The reasons we call ourselves in another name are
1: 70% we find it fancy
2: 30% some people are difficult to be called with the original one like りゅ りょ sounds |
106,380 | What web server code should I consider using for file hosting? (http deamon, i dont think i can choose FS. I may be able to choose an randomly offer linux distro the host offers)
The web server will only host files, with no need for cookies, reading a database, etc. The requirements are;
1. Must be able to rewrite ur... | 2010/01/26 | [
"https://serverfault.com/questions/106380",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | I would recommend looking into Puppet/Facter or OCS Inventory NG.
Puppet
------
Puppet (which uses Facter), can be used to push out updates and configure nodes. It retrives information (or facts) about your nodes via Facter. Even though Puppet (via Facter) doesn't know who the primary user is, you can add facts (info... | Have you looked at www.spiceworks.com software? I'm in a Microsoft environment, so I don't know if it will also perform on Linux clients, but it does a good job of inventorying both hardware and software. It's also free. Microsoft System Center is also very helpful. |
106,380 | What web server code should I consider using for file hosting? (http deamon, i dont think i can choose FS. I may be able to choose an randomly offer linux distro the host offers)
The web server will only host files, with no need for cookies, reading a database, etc. The requirements are;
1. Must be able to rewrite ur... | 2010/01/26 | [
"https://serverfault.com/questions/106380",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | Have you looked at www.spiceworks.com software? I'm in a Microsoft environment, so I don't know if it will also perform on Linux clients, but it does a good job of inventorying both hardware and software. It's also free. Microsoft System Center is also very helpful. | JDisc Discovery creates an inventory for Windows and many Unix operating systems (including Linux).
<http://www.jdisc.com> |
106,380 | What web server code should I consider using for file hosting? (http deamon, i dont think i can choose FS. I may be able to choose an randomly offer linux distro the host offers)
The web server will only host files, with no need for cookies, reading a database, etc. The requirements are;
1. Must be able to rewrite ur... | 2010/01/26 | [
"https://serverfault.com/questions/106380",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | I would recommend looking into Puppet/Facter or OCS Inventory NG.
Puppet
------
Puppet (which uses Facter), can be used to push out updates and configure nodes. It retrives information (or facts) about your nodes via Facter. Even though Puppet (via Facter) doesn't know who the primary user is, you can add facts (info... | Your likely not looking for split solutions BUT for the Microsoft Licenses I like to stay with the tool that they will use should you get audited and that is a version of MSIA. Microsoft Software Inventory Analyzer, <http://www.microsoft.com/sam/en/us/msia.aspx>
It however only audits Microsoft apps, but it can be ref... |
106,380 | What web server code should I consider using for file hosting? (http deamon, i dont think i can choose FS. I may be able to choose an randomly offer linux distro the host offers)
The web server will only host files, with no need for cookies, reading a database, etc. The requirements are;
1. Must be able to rewrite ur... | 2010/01/26 | [
"https://serverfault.com/questions/106380",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | I would recommend looking into Puppet/Facter or OCS Inventory NG.
Puppet
------
Puppet (which uses Facter), can be used to push out updates and configure nodes. It retrives information (or facts) about your nodes via Facter. Even though Puppet (via Facter) doesn't know who the primary user is, you can add facts (info... | JDisc Discovery creates an inventory for Windows and many Unix operating systems (including Linux).
<http://www.jdisc.com> |
106,380 | What web server code should I consider using for file hosting? (http deamon, i dont think i can choose FS. I may be able to choose an randomly offer linux distro the host offers)
The web server will only host files, with no need for cookies, reading a database, etc. The requirements are;
1. Must be able to rewrite ur... | 2010/01/26 | [
"https://serverfault.com/questions/106380",
"https://serverfault.com",
"https://serverfault.com/users/-1/"
] | Your likely not looking for split solutions BUT for the Microsoft Licenses I like to stay with the tool that they will use should you get audited and that is a version of MSIA. Microsoft Software Inventory Analyzer, <http://www.microsoft.com/sam/en/us/msia.aspx>
It however only audits Microsoft apps, but it can be ref... | JDisc Discovery creates an inventory for Windows and many Unix operating systems (including Linux).
<http://www.jdisc.com> |
26,126,363 | I am trying to call a web service of a shipping company in my php code and get the result xml. I have this sample code and i want to know if there is an alternative using curl.
Code:
```
function doPost($_postContent) {
$postContent = "xml_in=".$_postContent;
$host="test.company.com";
$contentLen = str... | 2014/09/30 | [
"https://Stackoverflow.com/questions/26126363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1059261/"
] | You can use the `CURLOPT_PORT` option to change the port to 81. See <http://php.net/manual/en/function.curl-setopt.php>
```
$url = "http://test.company.com/shippergate2.asp";
$ch = curl_init();
curl_setopt($ch, CURLOPT_PORT, 81);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "PHP Script");
... | I guess a complete solution is needed but I suggest checking this basic CURL wrapper for PHP <https://github.com/shuber/curl> |
52,349,928 | How could I create a conditional statement that prevents entering the fail state, and asks the user for new data when either the data is invalid or the data is not 1, 2, 3 OR 4 ?
```
int choice;
while ( !choice || choice != 1 || 2 || 3 || 4){
cout << "Entry Invalid. Enter again: ";
cin >> choice
}
```
For... | 2018/09/16 | [
"https://Stackoverflow.com/questions/52349928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9183124/"
] | Let's suppose your input `011R0` is stored in array `buf` then to print ASCII value of each character, you'll have to access each character and print it as if you are printing an integer:
```
int i;
while(buf[i])
{
printf("%d\n",buf[i]);
++i;
}
```
By using indices `[i]` one can access each c... | *I thought printing out %c would give me the ASCII value ?* **No**, the format specifier `%c` prints equivalents `char` value, since `buf4`, `buf5`..etc are char array, so when you prints `*buf5` it prints first char of array & if you print `ascii` value of that, you have to subtract it from `48`(ASCII value of 0) if `... |
990,285 | $e^x$$(1+e^x)^{1\over{2}}$
why can't use integration by part,
What is meant by in the form of f(g(x))g'(x)?
Can you give a few example?
Thank you | 2014/10/25 | [
"https://math.stackexchange.com/questions/990285",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/173339/"
] | Integration by substitution says that
$$
\int f(g(x))g'(x) \; dx = \int f(u)\;du
$$
where $u = g(x)$. This is a tool that will let you compute the integral of all functions that look exactly like $f(g(x))g'(x)$. When you first see this, you might be thinking that this seems like a very specialised rule that only seem g... | in your example i would set $t=\sqrt{1+e^{x}}$ then we get $t^2=1+e^{x}$ and we have $2tdt=e^xdx$ thus your integral is $2\int t^2dt$ |
990,285 | $e^x$$(1+e^x)^{1\over{2}}$
why can't use integration by part,
What is meant by in the form of f(g(x))g'(x)?
Can you give a few example?
Thank you | 2014/10/25 | [
"https://math.stackexchange.com/questions/990285",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/173339/"
] | Integration by substitution says that
$$
\int f(g(x))g'(x) \; dx = \int f(u)\;du
$$
where $u = g(x)$. This is a tool that will let you compute the integral of all functions that look exactly like $f(g(x))g'(x)$. When you first see this, you might be thinking that this seems like a very specialised rule that only seem g... | $$\int (e^x+1)^{1/2}e^x\ dx=\int (1+\color{green}{e^x})^{1/2}\ d\color{green}{e^x}=\int(1+\color{green}{u})^{1/2}\ d\color{green}{u}=\frac23(1+u)^{3/2}=\frac23(1+e^x)^{3/2}.$$
Equivalenty,
$$\int (e^x+1)^{1/2}e^x\ dx=\int (\color{green}{1+e^x})^{1/2}\ d(\color{green}{1+e^x})=\int \color{green}{u}^{1/2}\ d\color{green... |
29,390,701 | I am working in codeigniter. My problem is i want to show all rows having same id. But when i perform group\_by it only outputs one row of that group.
below is my model
```
function category_content(){
$this->db->select('*');
$this->db->from('category');
$this->db->group_by('category_id');
... | 2015/04/01 | [
"https://Stackoverflow.com/questions/29390701",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2717813/"
] | As per the sql properties `Group By` groups all the matching records and will show you only one. It seems you want to sort them by id. Then its better to use `order by` | See the Example hope you will get to know this..
```
tableA
_____
id name marks
-- ---- ---
1 x 25
2 y 27
1 z 30
SELECT * FROM tableA group by id
OUTPUT:
1 x 25
2 y 27
```
in your case you should use WHERE clause.
```
SELECT * FROM tableA... |
4,124,091 | I use Visual Studio 2008 Professional with .NET 3.5 SP1 installed. It is not showing Entity Model when I select "New Project". The MSDN links show that it was included with .NET 3.5 SP1.
Why it is not appearing on my VS 2008? | 2010/11/08 | [
"https://Stackoverflow.com/questions/4124091",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194328/"
] | You probably need to install *VS2008* SP1, which contains the tooling used to develop against .Net 3.5 SP1. | It won't appear as new project. It will appear as *ADO.NET Entity Data Model* when you add a new item to an existing project:
 |
73,033,294 | I', trying to run this functin only on mobile devices which is less than 768px , it works on this screen width but it also ignore the condition and works on larger screens than 768px, i tried to clear interval but there is something wrong with my code
```js
$(document).ready(function () {
$(window).on("resize", fun... | 2022/07/19 | [
"https://Stackoverflow.com/questions/73033294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/19351845/"
] | If you want to use it later you create it in a macro variable and reference it later with a &variableName
Let's assume:
* data set name is myDataset
* variable name is value
* Single observation/row in the data set
* Macro variable output name is myValue
```
*create fake data;
data myDataset;
date = mdy(7, 18, 2022)... | SAS does not have any "global variables". All variables live in datasets. If you want to use a value from the first observation of one dataset in a data step that is using some other dataset as its main input then just read it in once at the start of the data step and its value will stay the same for the whole data ste... |
4,118,439 | In problem 33 iv Chapter 5 of Spivak's *Calculus*, there is a comment in the solution manual that (in essence) remarks $\lim\_{x \to \infty} \sin x$ **does not exist**.
I wanted to see if I could prove this statement by negating the formal definition of $\lim\_{x \to \infty}f(x)=L \iff \exists L \in \mathbb R \Big [ \... | 2021/04/27 | [
"https://math.stackexchange.com/questions/4118439",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/544640/"
] | No knowledge of continuity is needed for this result. Suppose towards contradiction that $\lim\_{x \to \infty} \sin(x) = L$. Then let $\epsilon = \frac{1}{4}$ and let $N$ be such that $x > N$ implies $|\sin(x) - L| < \frac{1}{4}.$
Choose integers $k, m > N$. Then clearly $2πk > N$ and $2πm + \frac{π}{2} > N$. But obse... | Note that since $\sin(x)$ is periodic for every real $N$ there exists a real $x>N$ and $y>N$ such that $\sin(x)=1$ and $\sin(y)=-1$
From here it’s easy to see that this implies if the limit exists then it must be $1$ since if it’s any other value $m$ then you can let $\epsilon$ be less than $|1-m|$ to obtain a cont... |
4,118,439 | In problem 33 iv Chapter 5 of Spivak's *Calculus*, there is a comment in the solution manual that (in essence) remarks $\lim\_{x \to \infty} \sin x$ **does not exist**.
I wanted to see if I could prove this statement by negating the formal definition of $\lim\_{x \to \infty}f(x)=L \iff \exists L \in \mathbb R \Big [ \... | 2021/04/27 | [
"https://math.stackexchange.com/questions/4118439",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/544640/"
] | >
> i.e. I wanted to write a proof that:
>
>
> $$\forall L \in \mathbb R \Big [\exists \epsilon \gt 0 \text{ s.t. } \forall N \in \mathbb R \ \exists x \in \mathbb R \text{ s.t. }\big (x \gt N \land \lvert \sin(x) - L \rvert \geq \epsilon \big) \Big]$$
>
>
>
We can do this using $\varepsilon = \frac{1}{2}$.
**C... | No knowledge of continuity is needed for this result. Suppose towards contradiction that $\lim\_{x \to \infty} \sin(x) = L$. Then let $\epsilon = \frac{1}{4}$ and let $N$ be such that $x > N$ implies $|\sin(x) - L| < \frac{1}{4}.$
Choose integers $k, m > N$. Then clearly $2πk > N$ and $2πm + \frac{π}{2} > N$. But obse... |
4,118,439 | In problem 33 iv Chapter 5 of Spivak's *Calculus*, there is a comment in the solution manual that (in essence) remarks $\lim\_{x \to \infty} \sin x$ **does not exist**.
I wanted to see if I could prove this statement by negating the formal definition of $\lim\_{x \to \infty}f(x)=L \iff \exists L \in \mathbb R \Big [ \... | 2021/04/27 | [
"https://math.stackexchange.com/questions/4118439",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/544640/"
] | >
> i.e. I wanted to write a proof that:
>
>
> $$\forall L \in \mathbb R \Big [\exists \epsilon \gt 0 \text{ s.t. } \forall N \in \mathbb R \ \exists x \in \mathbb R \text{ s.t. }\big (x \gt N \land \lvert \sin(x) - L \rvert \geq \epsilon \big) \Big]$$
>
>
>
We can do this using $\varepsilon = \frac{1}{2}$.
**C... | Note that since $\sin(x)$ is periodic for every real $N$ there exists a real $x>N$ and $y>N$ such that $\sin(x)=1$ and $\sin(y)=-1$
From here it’s easy to see that this implies if the limit exists then it must be $1$ since if it’s any other value $m$ then you can let $\epsilon$ be less than $|1-m|$ to obtain a cont... |
7,391,333 | I am trying to implement a simple contact manager using the VirtualStringTree component. I have it set up to look like a list-view component with only three columns that will all contain text:

For the data structure, I am using svTree by Linas, which was mentioned in ano... | 2011/09/12 | [
"https://Stackoverflow.com/questions/7391333",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/471837/"
] | You need to set OnLoadNode and OnSaveNode procedures for your TSVTree and implement your logic here. You can look at Project2 in the Demos folder. E.g.:
```
uses
uSvHelpers;
MyTree.OnSaveNode := DoSave;
MyTree.OnLoadNode := DoLoad;
procedure TForm1.DoLoad(Sender: TSVTree<TMainData>; Node: TSVTreeNode<TMainData>; S... | Looks like you need to implement the OnSaveNode and OnLoadNode events:
```
procedure TForm.VTLoadNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);
begin
// Load Node Data record from the stream
end;
procedure TForm.VTSaveNode(Sender: TBaseVirtualTree;
Node: PVirtualNode; Stream: TStream);
beg... |
27,443,929 | I'm trying to get a dropdown show the right value when editing using a viewmodel but it only works when i pass the complete model to the view.
When I do it like this and there is already a contact selected it shows that contact in the edit screen.
**Model**
```
public class ClientModel
{
public int ID { get; set; ... | 2014/12/12 | [
"https://Stackoverflow.com/questions/27443929",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4252392/"
] | I found the answer after some more research here <https://stackoverflow.com/a/11949123/4252392>.
The problem was that ViewBag's name is the same as the model's property.
So i changed the Viewbag's name.
**New Controller**
```
public ActionResult EditContact(int? id)
{
if (id == null)
{
return new H... | If you set selected value in ContactID property from dropdown so you need to set dropdown in view like below:
```
@model Project.Models.ClientEditContactModel
@Html.DropDownListFor(model => model.ContactID, (SelectList)ViewBag.Contact,
"select a contact")
``` |
3,955,878 | I am currently using apTreeshape to simulate phylogenetic trees using the "Yule-Hardy" Method. What I want to do is randomly generate between 20 and 25 different numbers for three different groupings (small, medium and large trees) and then generate about 40 trees for every random number chosen from within the grouping... | 2010/10/18 | [
"https://Stackoverflow.com/questions/3955878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/478864/"
] | Apologies if I don't quite understand the question, but what about:
```
sm_leaves <- sample(3:50, 25, replace=FALSE)
s_leafy <- rep(sm_leaves, each=10)
``` | You want `rep()` with the `each=10` option:
```
> set.seed(42)
> sm_leaves <- sample(3:50,25,replace=F)
> s_leafy <- rep(sm_leaves, each=3) ## here rep=3 to generate small sample
> s_leafy
[1] 46 46 46 47 47 47 16 16 16 40 40 40 31 31 31 25 25
[18] 25 33 33 33 8 8 8 29 29 29 30 30 30 20 20 20 42
[... |
3,955,878 | I am currently using apTreeshape to simulate phylogenetic trees using the "Yule-Hardy" Method. What I want to do is randomly generate between 20 and 25 different numbers for three different groupings (small, medium and large trees) and then generate about 40 trees for every random number chosen from within the grouping... | 2010/10/18 | [
"https://Stackoverflow.com/questions/3955878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/478864/"
] | Using 'rep' is clearly the answer for how to do this quickly in R, but why doesn't your code work? A little investigation reveals why.
First, take out the randomness and give yourself a simple, reproducible example. Set sm\_leaves to c(3,4,5) and see what happens. You get:
3 4 5 5 5 5 5 5 5 5 5 5
which still looks w... | Apologies if I don't quite understand the question, but what about:
```
sm_leaves <- sample(3:50, 25, replace=FALSE)
s_leafy <- rep(sm_leaves, each=10)
``` |
3,955,878 | I am currently using apTreeshape to simulate phylogenetic trees using the "Yule-Hardy" Method. What I want to do is randomly generate between 20 and 25 different numbers for three different groupings (small, medium and large trees) and then generate about 40 trees for every random number chosen from within the grouping... | 2010/10/18 | [
"https://Stackoverflow.com/questions/3955878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/478864/"
] | Using 'rep' is clearly the answer for how to do this quickly in R, but why doesn't your code work? A little investigation reveals why.
First, take out the randomness and give yourself a simple, reproducible example. Set sm\_leaves to c(3,4,5) and see what happens. You get:
3 4 5 5 5 5 5 5 5 5 5 5
which still looks w... | You want `rep()` with the `each=10` option:
```
> set.seed(42)
> sm_leaves <- sample(3:50,25,replace=F)
> s_leafy <- rep(sm_leaves, each=3) ## here rep=3 to generate small sample
> s_leafy
[1] 46 46 46 47 47 47 16 16 16 40 40 40 31 31 31 25 25
[18] 25 33 33 33 8 8 8 29 29 29 30 30 30 20 20 20 42
[... |
180,737 | Please, help me to put a proper word collocation into a sentence.
I need to describe in an office announcement that a new printer is set for satisfy any employee (printing) need.
I found the phrase *"to support needs"*, but I am not sure about it.
The context is here:
>
> Dear Colleagues,
>
>
> We would like ... | 2018/09/25 | [
"https://ell.stackexchange.com/questions/180737",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/81713/"
] | It doesn't end with '**s**' because it's the (bare) **infinitive**, which is used without '**to**' after verbs like **hear**, bid, let, make, see, need, dare, etc.
<https://www.englishgrammar.org/bare-infinitive-2/> | Sound in this sentence is a noun, so you are talking about the 'sound' of his/her voice, not the 'sounds' that he/she is making.
'Do' and 'go' are both verbs, so they do not follow the same rule. |
64,443,026 | In JSX/TSX syntax from react, all inputs seems to be define with the same props declaration which is `InputHTMLAttributes`:
```js
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
accept?: string;
alt?: string;
autoComplete?: string;
autoFocus?: boolean;
capture?:... | 2020/10/20 | [
"https://Stackoverflow.com/questions/64443026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8583669/"
] | Multiply, then reset negative values:
```
# transpose and multiply per row
res <- t(m) * v
res <- t(res)
# then reset negatives to original value
res[m < 0] <- m[ m < 0 ]
res
# a b c
# [1,] -1 -1 -1
# [2,] 4 6 -9
# [3,] 6 6 -3
# [4,] 8 -4 -2
``` | Here is another base R option using `msk` as the mask
```
> m*t((msk <- t(m)>0)*v + !msk)
a b c
[1,] -1 -1 -1
[2,] 4 6 -9
[3,] 6 6 -3
[4,] 8 -4 -2
``` |
64,443,026 | In JSX/TSX syntax from react, all inputs seems to be define with the same props declaration which is `InputHTMLAttributes`:
```js
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
accept?: string;
alt?: string;
autoComplete?: string;
autoFocus?: boolean;
capture?:... | 2020/10/20 | [
"https://Stackoverflow.com/questions/64443026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8583669/"
] | You can use the condition `m>0` to subset the result:
```
i <- m>0
#i <- which(m>0) #Maybe faster Alternative
m[i] <- (m %*% diag(v))[i]
#m[i] <- (m * v[col((m))])[i] #Maybe faster Alternative
m
# a b c
#[1,] -1 -1 -1
#[2,] 4 6 -9
#[3,] 6 6 -3
#[4,] 8 -4 -2
```
Or another maybe fast version:
```
i <- +(... | Here is another base R option using `msk` as the mask
```
> m*t((msk <- t(m)>0)*v + !msk)
a b c
[1,] -1 -1 -1
[2,] 4 6 -9
[3,] 6 6 -3
[4,] 8 -4 -2
``` |
64,443,026 | In JSX/TSX syntax from react, all inputs seems to be define with the same props declaration which is `InputHTMLAttributes`:
```js
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
accept?: string;
alt?: string;
autoComplete?: string;
autoFocus?: boolean;
capture?:... | 2020/10/20 | [
"https://Stackoverflow.com/questions/64443026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8583669/"
] | ```
to_upd <- which(m>0)
m[to_upd] <- (m * v[col(m)])[to_upd]
m
# a b c
# [1,] -1 -1 -1
# [2,] 4 6 -9
# [3,] 6 6 -3
# [4,] 8 -4 -2
```
Data
```
v <- c(2,3,-3)
m <- cbind(
a = c(-1,2,3,4),
b = c(-1,2,2,-4),
c = c(-1,3,1,-2)
)
``` | Here is another base R option using `msk` as the mask
```
> m*t((msk <- t(m)>0)*v + !msk)
a b c
[1,] -1 -1 -1
[2,] 4 6 -9
[3,] 6 6 -3
[4,] 8 -4 -2
``` |
64,443,026 | In JSX/TSX syntax from react, all inputs seems to be define with the same props declaration which is `InputHTMLAttributes`:
```js
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
accept?: string;
alt?: string;
autoComplete?: string;
autoFocus?: boolean;
capture?:... | 2020/10/20 | [
"https://Stackoverflow.com/questions/64443026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8583669/"
] | You can do like this:
```r
m * c(1, v)[col(m) * (m > 0) + 1L]
#R> a b c
#R> [1,] -1 -1 -1
#R> [2,] 4 6 -9
#R> [3,] 6 6 -3
#R> [4,] 8 -4 -2
```
>
> My dataset is large, so I'm looking for an elegant solution
>
>
>
If by elegant you mean fast, then this seems to be an as fast or faster solution compa... | Here is another base R option using `msk` as the mask
```
> m*t((msk <- t(m)>0)*v + !msk)
a b c
[1,] -1 -1 -1
[2,] 4 6 -9
[3,] 6 6 -3
[4,] 8 -4 -2
``` |
68,819 | [Cosmic rays](https://en.wikipedia.org/wiki/Cosmic_ray) are energetic particles coming from space that hit the Earth's atmosphere and produce a lot of [secondary radiation](https://en.wikipedia.org/wiki/Air_shower_(physics)) (some of which we see in visible light as aurorae). Would it make sense for an organism floatin... | 2017/01/21 | [
"https://worldbuilding.stackexchange.com/questions/68819",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/31844/"
] | I would say that yes, it's borderline possible.
The organism should be very resistant to ionizing radiation; a Universe that allows [*Deinococcus radiodurans*](https://en.wikipedia.org/wiki/Deinococcus_radiodurans) to exist would have little trouble in producing this new critter, even limiting ourselves to DNA.
The o... | It can't exist and this is why
------------------------------
This organism would have to be unlike any that lives on Earth. First of all, if the organism was in our upper atmosphere it would be too protected from the cosmic rays for sustainable life. If it has DNA, it would have to be very protected in order to preve... |
68,819 | [Cosmic rays](https://en.wikipedia.org/wiki/Cosmic_ray) are energetic particles coming from space that hit the Earth's atmosphere and produce a lot of [secondary radiation](https://en.wikipedia.org/wiki/Air_shower_(physics)) (some of which we see in visible light as aurorae). Would it make sense for an organism floatin... | 2017/01/21 | [
"https://worldbuilding.stackexchange.com/questions/68819",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/31844/"
] | I would say that yes, it's borderline possible.
The organism should be very resistant to ionizing radiation; a Universe that allows [*Deinococcus radiodurans*](https://en.wikipedia.org/wiki/Deinococcus_radiodurans) to exist would have little trouble in producing this new critter, even limiting ourselves to DNA.
The o... | Cosmic rays might *first* affect some non-living substance, which then provides energy and/or nurishment to the life.
That might indeed be a critical factor, like fixing nitrogen for the base of the food chain.
These cosmic rays can cause chemical reactions or nuclear reactions, such as 14C on our planet. So it could... |
60,078,041 | I am trying to create a regular expression to separate each word from `.` (dot) in JavaScript.
```
function myFunction() {
var url = "in.k1.k2.k3.k4.com"
var result
var match
if (match = url.match(/^[^\.]+\.(.+\..+)$/)) {
console.log(match);
}
}
```
Actual result is:
```
match[0] : in.k1.k2.k3.k4.com
... | 2020/02/05 | [
"https://Stackoverflow.com/questions/60078041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12337410/"
] | In order to store more than one JSON record, use an array, as when loading you can just load JSON types (an an array is the ideal JSON type you're looking for for that use case).
In that case, to read all scores:
```py
scores = []
with open ("score.json") as json_data:
scores = json.load(json_data)
```
But most... | The way your code is written, it will append score dictionaries instead of adding an object in an array of scores.
If you check the output file score.json it will look like {...}{...}{...} whereas it should be like [{...},{...},{...}] |
60,078,041 | I am trying to create a regular expression to separate each word from `.` (dot) in JavaScript.
```
function myFunction() {
var url = "in.k1.k2.k3.k4.com"
var result
var match
if (match = url.match(/^[^\.]+\.(.+\..+)$/)) {
console.log(match);
}
}
```
Actual result is:
```
match[0] : in.k1.k2.k3.k4.com
... | 2020/02/05 | [
"https://Stackoverflow.com/questions/60078041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12337410/"
] | In order to store more than one JSON record, use an array, as when loading you can just load JSON types (an an array is the ideal JSON type you're looking for for that use case).
In that case, to read all scores:
```py
scores = []
with open ("score.json") as json_data:
scores = json.load(json_data)
```
But most... | You can read the file line by line, every line will contain a valid JSON object:
```
with open('score.json') as fp:
for line in fp:
data = json.loads(line)
# do something with data
```
Or if you need everything in one object:
```
with open('score.json') as fp:
data = []
for line in fp:
... |
60,078,041 | I am trying to create a regular expression to separate each word from `.` (dot) in JavaScript.
```
function myFunction() {
var url = "in.k1.k2.k3.k4.com"
var result
var match
if (match = url.match(/^[^\.]+\.(.+\..+)$/)) {
console.log(match);
}
}
```
Actual result is:
```
match[0] : in.k1.k2.k3.k4.com
... | 2020/02/05 | [
"https://Stackoverflow.com/questions/60078041",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12337410/"
] | The way your code is written, it will append score dictionaries instead of adding an object in an array of scores.
If you check the output file score.json it will look like {...}{...}{...} whereas it should be like [{...},{...},{...}] | You can read the file line by line, every line will contain a valid JSON object:
```
with open('score.json') as fp:
for line in fp:
data = json.loads(line)
# do something with data
```
Or if you need everything in one object:
```
with open('score.json') as fp:
data = []
for line in fp:
... |
50,598,509 | I want to change CSV file content:
```
itemId,url,name,type
1|urlA|nameA|typeA
2|urlB|nameB|typeB
3|urlC,urlD|nameC|typeC
4|urlE|nameE|typeE
```
into an array:
```
[itemId,url,name,type]
[1,urlA,nameA,typeA]
[2,urlB,nameB,typeB]
[**3**,**urlC**,nameC,typeC]
[**3**,**urlD**,nameC,typeC]
[4,urlE,nameE,typeE]
```
Co... | 2018/05/30 | [
"https://Stackoverflow.com/questions/50598509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5448792/"
] | The header row has a different separator than the data. That's a problem. You need to change the header row to use `|` instead of `,`. Then:
```
require 'csv'
require 'pp'
array = Array.new
CSV.foreach("test.csv", col_sep: '|', headers: true) do |row|
if row['url'][/,/]
row['url'].split(',').each do |url|
... | You'll need to test the fifth column to see how the line should be parsed. If you see a fifth element (row[4]) output the line twice replacing the url column
```
array = Array.new
CSV.foreach("test.csv") do |row|
if row[4]
array << [row[0..1], row[3..4]].flatten
array << [[row[0]], row[2..4]].flatten
else
... |
142,696 | I have not given this too much thought until recently, when a bit of a back and forth happened with a client. So, when I start a new document in InDesign, **for CMYK print**, how to I know how to setup the color settings ?
Many times I will just not look at this and go with whatever is set by default, but apparently t... | 2020/10/29 | [
"https://graphicdesign.stackexchange.com/questions/142696",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/62949/"
] | Why bother about color profiles?
================================
First of all you need to accept that *different printers follow different standards*. The same CMYK numbers will look differently when printed according to different standards. It's not possible to make a PDF which will be perfect under all circumstance... | I'm not sure what kind of answer you expect here. Sure there are differences. For CMYK settings, the best idea is always to discuss this with the printing service. Often they offer custom profiles that are calibrated to their machines.
For presentations in RGB you usually don't have much control on what device your de... |
142,696 | I have not given this too much thought until recently, when a bit of a back and forth happened with a client. So, when I start a new document in InDesign, **for CMYK print**, how to I know how to setup the color settings ?
Many times I will just not look at this and go with whatever is set by default, but apparently t... | 2020/10/29 | [
"https://graphicdesign.stackexchange.com/questions/142696",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/62949/"
] | Why bother about color profiles?
================================
First of all you need to accept that *different printers follow different standards*. The same CMYK numbers will look differently when printed according to different standards. It's not possible to make a PDF which will be perfect under all circumstance... | In theory it shouldnt matter\* what your working space is. Its just a indication that you designed the colors with the assumption that the numeric values match this color definition. Its like stating what language you intend to use, a factual statement. Its then the publish cycles job to get it as close as possible to ... |
55,064,957 | With my current code, I'm trying to clear the corresponding cells (columns K:N) when the column (C:J) is blank. It's the reference of Rng. I think it's an `If Then` statement but not sure how to fit it within the code... I understand this is long but any help would be fantastic!
For example, if C30:J30 is empty it cle... | 2019/03/08 | [
"https://Stackoverflow.com/questions/55064957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10964535/"
] | That's because `www.amazon.de` *is* a relative link. To link a different domain (host), you need to begin the [authority component](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax) with double slashes: `//www.amazon.de`, or with the scheme included `https://www.amazon.de`. | You have to add the protocol ('https://') to the link:
```
document.getElementById('linkname').setAttribute("href", "https://www.amazon.de");
``` |
55,064,957 | With my current code, I'm trying to clear the corresponding cells (columns K:N) when the column (C:J) is blank. It's the reference of Rng. I think it's an `If Then` statement but not sure how to fit it within the code... I understand this is long but any help would be fantastic!
For example, if C30:J30 is empty it cle... | 2019/03/08 | [
"https://Stackoverflow.com/questions/55064957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10964535/"
] | You have to add the protocol ('https://') to the link:
```
document.getElementById('linkname').setAttribute("href", "https://www.amazon.de");
``` | It seems you are missing 'http://' or 'https://' |
55,064,957 | With my current code, I'm trying to clear the corresponding cells (columns K:N) when the column (C:J) is blank. It's the reference of Rng. I think it's an `If Then` statement but not sure how to fit it within the code... I understand this is long but any help would be fantastic!
For example, if C30:J30 is empty it cle... | 2019/03/08 | [
"https://Stackoverflow.com/questions/55064957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10964535/"
] | That's because `www.amazon.de` *is* a relative link. To link a different domain (host), you need to begin the [authority component](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Generic_syntax) with double slashes: `//www.amazon.de`, or with the scheme included `https://www.amazon.de`. | It seems you are missing 'http://' or 'https://' |
3,701,329 | If $\dfrac{z-\alpha}{z+\alpha},(\alpha \in R)$ is a purely imaginary number and $|z|=2$, then find value of $\alpha$.
Now I took $\dfrac{z-\alpha}{z+\alpha}=t$ and as t is purely imaginary, and use the fact that $t+ \bar{t}=0$ and obtained the answer $\alpha = \pm2$.
But I was wondering that if there is any way to th... | 2020/06/01 | [
"https://math.stackexchange.com/questions/3701329",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/290994/"
] | Consider the open cover $\{X\}$. This is a finite open cover of every subset of $X$. So your modified notion would apply to every set.
---
That said, there is a version of this notion which is nontrivial: what if we bound the sizes of the open sets involved? (Note that this is a fundamentally *metric*, as opposed to ... | If you do that, then **every** subset of $E$ of $X$ has that property. Just take the open cover $\{X\}$ of $E$. It has a finite subcover (itself). |
39,884,860 | boot(1.4.0) "Pageable" for pagination.It works fine without any issue.But by default the page value starts from "0" but in the front-end the page value starts from "1". So is there any standard approach to increment value instead of manually increment the page number inside the code?
```
public Page<Device> find(Devic... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39884860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3656056/"
] | Spring Boot will be using Spring Data under the covers.
The Spring Data class you need to configure is the following:
org.springframework.data.web.PageableHandlerMethodArgumentResolver
and in particular the following method:
<http://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/web/Pa... | To get better result, you need to extend RepositoryRestMvcConfiguration, like below
```
@Configuration
public class RespositoryConfiguration extends RepositoryRestMvcConfiguration {
@Override
@Bean
public HateoasPageableHandlerMethodArgumentResolver pageableResolver() {
HateoasPageableHandlerM... |
39,884,860 | boot(1.4.0) "Pageable" for pagination.It works fine without any issue.But by default the page value starts from "0" but in the front-end the page value starts from "1". So is there any standard approach to increment value instead of manually increment the page number inside the code?
```
public Page<Device> find(Devic... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39884860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3656056/"
] | If you are using Spring Boot 2.X you could switch from `WebMvcConfigurerAdapter` to application properties. There is a set of properties to configure pageable:
```
# DATA WEB (SpringDataWebProperties)
spring.data.web.pageable.default-page-size=20 # Default page size.
spring.data.web.pageable.max-page-size=2000 # Maxim... | Spring Boot will be using Spring Data under the covers.
The Spring Data class you need to configure is the following:
org.springframework.data.web.PageableHandlerMethodArgumentResolver
and in particular the following method:
<http://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/web/Pa... |
39,884,860 | boot(1.4.0) "Pageable" for pagination.It works fine without any issue.But by default the page value starts from "0" but in the front-end the page value starts from "1". So is there any standard approach to increment value instead of manually increment the page number inside the code?
```
public Page<Device> find(Devic... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39884860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3656056/"
] | Spring added this future as well. Just make oneIndexed parameter equals to true in your configuration file and pagination will start from page 1.By default its false and pagination starts from 0.
```
spring.data.web.pageable.one-indexed-parameters=true
``` | Spring Boot will be using Spring Data under the covers.
The Spring Data class you need to configure is the following:
org.springframework.data.web.PageableHandlerMethodArgumentResolver
and in particular the following method:
<http://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/web/Pa... |
39,884,860 | boot(1.4.0) "Pageable" for pagination.It works fine without any issue.But by default the page value starts from "0" but in the front-end the page value starts from "1". So is there any standard approach to increment value instead of manually increment the page number inside the code?
```
public Page<Device> find(Devic... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39884860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3656056/"
] | If you are using Spring Boot 2.X you could switch from `WebMvcConfigurerAdapter` to application properties. There is a set of properties to configure pageable:
```
# DATA WEB (SpringDataWebProperties)
spring.data.web.pageable.default-page-size=20 # Default page size.
spring.data.web.pageable.max-page-size=2000 # Maxim... | To get better result, you need to extend RepositoryRestMvcConfiguration, like below
```
@Configuration
public class RespositoryConfiguration extends RepositoryRestMvcConfiguration {
@Override
@Bean
public HateoasPageableHandlerMethodArgumentResolver pageableResolver() {
HateoasPageableHandlerM... |
39,884,860 | boot(1.4.0) "Pageable" for pagination.It works fine without any issue.But by default the page value starts from "0" but in the front-end the page value starts from "1". So is there any standard approach to increment value instead of manually increment the page number inside the code?
```
public Page<Device> find(Devic... | 2016/10/05 | [
"https://Stackoverflow.com/questions/39884860",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3656056/"
] | Spring added this future as well. Just make oneIndexed parameter equals to true in your configuration file and pagination will start from page 1.By default its false and pagination starts from 0.
```
spring.data.web.pageable.one-indexed-parameters=true
``` | To get better result, you need to extend RepositoryRestMvcConfiguration, like below
```
@Configuration
public class RespositoryConfiguration extends RepositoryRestMvcConfiguration {
@Override
@Bean
public HateoasPageableHandlerMethodArgumentResolver pageableResolver() {
HateoasPageableHandlerM... |
66,991,986 | I have one pandas dataframe and one geopandas dataframe. In the Pandas dataframe, I have a column *Points* that contains `shapely.geometry` `Point` objects. The *geometry* column in the geopandas frame has `Polygon` objects. What I would like to do is take a `Point` in the Pandas frame and test to see if it is `within`... | 2021/04/07 | [
"https://Stackoverflow.com/questions/66991986",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3934100/"
] | You can calculate the Euclidean distance between all the points of the `Points` and `Polygon`. And, wherever the distance is equal to 0, this would give you an intersection point. My approach is below. Note that, I leave the part of getting all the points and the polygon points from your data frames to you. Probably, a... | I found a solution that works for my purposes. Not the most elegant, but still much faster than looping.
```py
def within_vectorized(array, point):
# Create array of False and True values
_array = np.array([point.within(p) for p in array])
# When the first element of np.where tuple is not empty
if np.where(_a... |
59,370,781 | I built a excel macro using the "Microsoft Outlook 15.0 Object Library" reference, but when I send the file to other people they get this error: "***Can’t find project or library***".
This file will be used by a lot of people, so I have to add it from VBA Code.
I'm using this code that runs when you open the excel fi... | 2019/12/17 | [
"https://Stackoverflow.com/questions/59370781",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7920914/"
] | If you still want to keep the early binding you could use the GUID in order to add the libray, i.e.
```
Sub AddOL_Ref()
Application.VBE.ActiveVBProject.REFERENCES. _
AddFromGuid "{00062FFF-0000-0000-C000-000000000046}", 1, 0
End Sub
```
Advantage of using the GUID is that it is constant and does not change wi... | You will have to remove the references & use late binding
or you can also try this. Send your code to one of the user having 2010MS.
**Goto VBA > Tools > References**
Check for any missing references. You may have ***Microsoft Outlook 15.0 Object Library*** showing as missing. Un-check this, browse down and select ... |
4,926,383 | I am tring to display all my products within their category, so something like:
Category Name1
Product Name1, Product Name2 ...
Category Name2
Product Name3, Product Name4 ...
I am using oscommerce, So the database structure is not my choice. The database tables I need to use are
products\_to\_categories: holds th... | 2011/02/07 | [
"https://Stackoverflow.com/questions/4926383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/420941/"
] | I dont understand fully how you want to display. I hope you like to display like this
```
Category Name1
Product Name1
Product Name2
Category Name2
Product Name3
Product Name4
```
Easiest way i think, get distinct list of category in an array.
with cat id and cat name
Loop that ar... | You'll likely need a `LEFT JOIN` in your SQL, to merge the three tables together, and order the query by `category_name, product_name`.
Something like:
```
SELECT p.product_id, p.product_name, c.category_name FROM `products_description` p
LEFT JOIN `products_to_categories` linker ON linker.product_id=p.product_id
LEF... |
4,926,383 | I am tring to display all my products within their category, so something like:
Category Name1
Product Name1, Product Name2 ...
Category Name2
Product Name3, Product Name4 ...
I am using oscommerce, So the database structure is not my choice. The database tables I need to use are
products\_to\_categories: holds th... | 2011/02/07 | [
"https://Stackoverflow.com/questions/4926383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/420941/"
] | There are two ways of approaching this, and the idea behind is was already given as an answer here, by Zod.
The first way is using category\_description to get **all** categories (whether it's full of products or not), the second way is to only extract categories that are used (i.e., not getting a complete list of cat... | You'll likely need a `LEFT JOIN` in your SQL, to merge the three tables together, and order the query by `category_name, product_name`.
Something like:
```
SELECT p.product_id, p.product_name, c.category_name FROM `products_description` p
LEFT JOIN `products_to_categories` linker ON linker.product_id=p.product_id
LEF... |
4,926,383 | I am tring to display all my products within their category, so something like:
Category Name1
Product Name1, Product Name2 ...
Category Name2
Product Name3, Product Name4 ...
I am using oscommerce, So the database structure is not my choice. The database tables I need to use are
products\_to\_categories: holds th... | 2011/02/07 | [
"https://Stackoverflow.com/questions/4926383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/420941/"
] | There are two ways of approaching this, and the idea behind is was already given as an answer here, by Zod.
The first way is using category\_description to get **all** categories (whether it's full of products or not), the second way is to only extract categories that are used (i.e., not getting a complete list of cat... | I dont understand fully how you want to display. I hope you like to display like this
```
Category Name1
Product Name1
Product Name2
Category Name2
Product Name3
Product Name4
```
Easiest way i think, get distinct list of category in an array.
with cat id and cat name
Loop that ar... |
5,747,820 | How can I change the background color from selected text? Like selecting this question but instead of a blue background and white text, a white background and red, blue, white etc. text.
Thanks, VVW | 2011/04/21 | [
"https://Stackoverflow.com/questions/5747820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665168/"
] | In CSS3, you can use the `::selection` declaration.
```
::selection { background: #00FF00; }
``` | There are many ways, but the easiest all use CSS. Read up on CSS background-color and CSS3 hover. |
5,747,820 | How can I change the background color from selected text? Like selecting this question but instead of a blue background and white text, a white background and red, blue, white etc. text.
Thanks, VVW | 2011/04/21 | [
"https://Stackoverflow.com/questions/5747820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665168/"
] | You can use `::selection` CSS to achieve this.
Eg:
```css
::selection {
background:#fff;
color:red;
}
``` | In CSS3, you can use the `::selection` declaration.
```
::selection { background: #00FF00; }
``` |
5,747,820 | How can I change the background color from selected text? Like selecting this question but instead of a blue background and white text, a white background and red, blue, white etc. text.
Thanks, VVW | 2011/04/21 | [
"https://Stackoverflow.com/questions/5747820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665168/"
] | In CSS3, you can use the `::selection` declaration.
```
::selection { background: #00FF00; }
``` | ```css
html,body{
background-color: #fff;
}
h1,p{
color: #000;
}
::selection{
background-color: #000;
color: #fff;
}
```
```html
<html>
<head>
<title> Trial </title>
</head>
<body>
<h1> This is the trial header</h1>
<p> This is the trial paragraph </p>
</body>
</html>
``` |
5,747,820 | How can I change the background color from selected text? Like selecting this question but instead of a blue background and white text, a white background and red, blue, white etc. text.
Thanks, VVW | 2011/04/21 | [
"https://Stackoverflow.com/questions/5747820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665168/"
] | In CSS3, you can use the `::selection` declaration.
```
::selection { background: #00FF00; }
``` | It can be done with the`::selection` CSS pseudo-element.
for example:
```
p::selection {
background:red;
}
``` |
5,747,820 | How can I change the background color from selected text? Like selecting this question but instead of a blue background and white text, a white background and red, blue, white etc. text.
Thanks, VVW | 2011/04/21 | [
"https://Stackoverflow.com/questions/5747820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665168/"
] | You can use `::selection` CSS to achieve this.
Eg:
```css
::selection {
background:#fff;
color:red;
}
``` | There are many ways, but the easiest all use CSS. Read up on CSS background-color and CSS3 hover. |
5,747,820 | How can I change the background color from selected text? Like selecting this question but instead of a blue background and white text, a white background and red, blue, white etc. text.
Thanks, VVW | 2011/04/21 | [
"https://Stackoverflow.com/questions/5747820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665168/"
] | You can use `::selection` CSS to achieve this.
Eg:
```css
::selection {
background:#fff;
color:red;
}
``` | ```css
html,body{
background-color: #fff;
}
h1,p{
color: #000;
}
::selection{
background-color: #000;
color: #fff;
}
```
```html
<html>
<head>
<title> Trial </title>
</head>
<body>
<h1> This is the trial header</h1>
<p> This is the trial paragraph </p>
</body>
</html>
``` |
5,747,820 | How can I change the background color from selected text? Like selecting this question but instead of a blue background and white text, a white background and red, blue, white etc. text.
Thanks, VVW | 2011/04/21 | [
"https://Stackoverflow.com/questions/5747820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/665168/"
] | You can use `::selection` CSS to achieve this.
Eg:
```css
::selection {
background:#fff;
color:red;
}
``` | It can be done with the`::selection` CSS pseudo-element.
for example:
```
p::selection {
background:red;
}
``` |
1,066,784 | I am really stuck with this problem, and I cannot come out with a solution.
I know that to prove a relation is an equivalence relation we have to prove that it's reflexive, symmetric and transitive, but in this case I don't know how, maybe because I don't much experience (but this exercise should be easy)
This is th... | 2014/12/13 | [
"https://math.stackexchange.com/questions/1066784",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | This is Proposition 9.2 on p. 212 of *Elements of Algebraic Coding Theory* by L. R. Vermani.
>
> **Definiton 9.2**
>
>
> We have shown that linear $[n, 1, n]$, $[n, n- 1, 2]$ and $[n, n, 1]$ codes exist
> over any finite field $F$ and these are MDS codes. These are called trivial MDS
> codes.
>
>
> **Propositio... | The only binary codes that are MDS are the trivial (n, n, 1) universe codes, the (n, n − 1, 2) single-parity-check (SPC) codes, and the (n, 1, n) repetition codes.
<http://web.stanford.edu/class/ee392d/Chap8.pdf> |
1,066,784 | I am really stuck with this problem, and I cannot come out with a solution.
I know that to prove a relation is an equivalence relation we have to prove that it's reflexive, symmetric and transitive, but in this case I don't know how, maybe because I don't much experience (but this exercise should be easy)
This is th... | 2014/12/13 | [
"https://math.stackexchange.com/questions/1066784",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let $G$ be the generator matrix of the code in standard form $[I\_k|A]$ where $A$ is a $k \times (n - k)$ matrix. Since the minimum weight of the code is $d = n - k + 1$, all entries of $A$ are non-zero, and hence $A$ is the all one matrix. If $A$ has only one row, then $k = 1$ and the parameters of the code are $[n, 1... | The only binary codes that are MDS are the trivial (n, n, 1) universe codes, the (n, n − 1, 2) single-parity-check (SPC) codes, and the (n, 1, n) repetition codes.
<http://web.stanford.edu/class/ee392d/Chap8.pdf> |
373,043 | when I open up the terminal and write the command
```
cd Desktop
```
also I have tried
```
cd /Desktop
```
a message appears that no file or directory was found what I suppose to do? I have logged in as a root but still have the same problem any help? | 2013/11/08 | [
"https://askubuntu.com/questions/373043",
"https://askubuntu.com",
"https://askubuntu.com/users/212740/"
] | To enter your user's Desktop directory, run `cd ~/Desktop` (the `~` is expanded into your user's home directory). If your Desktop directory doesn't exist, you can create it via `mkdir ~/Desktop`. | Run this command in terminal,it will help you.
```
cd ~/Desktop
gcc yourfilename.c
``` |
373,043 | when I open up the terminal and write the command
```
cd Desktop
```
also I have tried
```
cd /Desktop
```
a message appears that no file or directory was found what I suppose to do? I have logged in as a root but still have the same problem any help? | 2013/11/08 | [
"https://askubuntu.com/questions/373043",
"https://askubuntu.com",
"https://askubuntu.com/users/212740/"
] | To enter your user's Desktop directory, run `cd ~/Desktop` (the `~` is expanded into your user's home directory). If your Desktop directory doesn't exist, you can create it via `mkdir ~/Desktop`. | `cd Desktop/` Goes to the Desktop directory if you are in your home directory.
`cd -` Goes back to previous directory.
`cd /` Take you to the root directory.
`cd ~/Desktop` Will take you to your Desktop Directory no matter where you are. |
373,043 | when I open up the terminal and write the command
```
cd Desktop
```
also I have tried
```
cd /Desktop
```
a message appears that no file or directory was found what I suppose to do? I have logged in as a root but still have the same problem any help? | 2013/11/08 | [
"https://askubuntu.com/questions/373043",
"https://askubuntu.com",
"https://askubuntu.com/users/212740/"
] | `cd Desktop/` Goes to the Desktop directory if you are in your home directory.
`cd -` Goes back to previous directory.
`cd /` Take you to the root directory.
`cd ~/Desktop` Will take you to your Desktop Directory no matter where you are. | Run this command in terminal,it will help you.
```
cd ~/Desktop
gcc yourfilename.c
``` |
49,693,393 | I can't find out if the below is possible. I want to run an update statement in one database from another database. I know that I can save a query and run that from the master database but I thought the below would be possible
```
UPDATE tblOne
INNER JOIN tblTwo
ON tblOne.[TID] = tblTwo.TID
SET tblTwo.PC = ... | 2018/04/06 | [
"https://Stackoverflow.com/questions/49693393",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1342483/"
] | Per the [MSDN Documentation](https://msdn.microsoft.com/en-us/library/bb177907(v=office.12).aspx), the `IN` clause is only compatible when used in conjunction with the `SELECT` statement (i.e. Select queries), `INSERT INTO` statement (i.e. Append queries), or `SELECT INTO` statement (i.e. Make Table queries) - it canno... | I think you just need to reverse what you’ve written because the table you’re updating needs to be the main table.
Try:
```
UPDATE tblTwo
INNER JOIN tblOne ON tblOne.[TID] = tblTwo.TID
SET tblTwo.PC = [tblOne].[PC] ;
```
Please note without a where clause you will be updating all rows. |
10,838,386 | I have this tables
`ADDS` (1)
```none
+----+--------------+--------------+
| id | name of add | Date |
+----+--------------+--------------+
| 1 | Add01 | March 01 |
| 2 | Add02 | March 02 |
| 3 | Add03 | March 03 |
| 4 | Add04 | March 04 |
+----+--------------... | 2012/05/31 | [
"https://Stackoverflow.com/questions/10838386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1428981/"
] | Today is the 31st next month only has 30 days so it would be 7/12 in 1 month from today
```
assuming that today is May 31 2012
date('m Y') == 05 2012
date('m Y', strtotime('+1 month')) == 07 2012 because june has 30 days
date('m Y', strtotime('+2 month')) == 07 2012
date('m Y', strtotime('+3 month')) == 08 2012
date(... | It is working as intended. In a nutshell, it is because what is "one month" from May 31? June 30? August 1?
My suggestion is that if you need sequential months, calculate the offset from the start of the current month, not the current day. Or compose the date that you're looking for manually using the month, day, and ... |
10,838,386 | I have this tables
`ADDS` (1)
```none
+----+--------------+--------------+
| id | name of add | Date |
+----+--------------+--------------+
| 1 | Add01 | March 01 |
| 2 | Add02 | March 02 |
| 3 | Add03 | March 03 |
| 4 | Add04 | March 04 |
+----+--------------... | 2012/05/31 | [
"https://Stackoverflow.com/questions/10838386",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1428981/"
] | As others have said, it is because today is the 31st and +1 month equals June-31 which changes to Jul-1. If you include the day in the date string, you can see exactly this.
```
<?php
$sP1 = date('m-d-Y');
$sP2 = date('m-d-Y', strtotime('+01 month'));
$sP3 = date('m-d-Y', strtotime('+02 month'));
$sP4 = date('m-d-Y',... | It is working as intended. In a nutshell, it is because what is "one month" from May 31? June 30? August 1?
My suggestion is that if you need sequential months, calculate the offset from the start of the current month, not the current day. Or compose the date that you're looking for manually using the month, day, and ... |
5,062,100 | I have web pages that may or may not need to do some pre-processing before it can be displayed to the user. What I have done is to display this page with a message (e.g. "please wait ..."), then do an http-equiv refresh **to the same page**. When it refreshes to the same page, the pre-processing is done and the actual ... | 2011/02/21 | [
"https://Stackoverflow.com/questions/5062100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253976/"
] | It's a hold over from C++ and C before that. In the C context, one of its meanings was for variables that keep their value between invocations. I presume that's where 'static' comes from - it doesn't reset the value (as opposed to a const where the value cannot change) | >
> Definition of STATIC 1 : exerting
> force by reason of weight alone
> without motion 2 : of or relating to
> bodies at rest or forces in
> equilibrium 3 : showing little change
> 4 a :
> characterized by a lack of movement,
> animation, or progression b :
> producing an effect of repose or
> quiescence 5 ... |
5,062,100 | I have web pages that may or may not need to do some pre-processing before it can be displayed to the user. What I have done is to display this page with a message (e.g. "please wait ..."), then do an http-equiv refresh **to the same page**. When it refreshes to the same page, the pre-processing is done and the actual ... | 2011/02/21 | [
"https://Stackoverflow.com/questions/5062100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253976/"
] | It's a hold over from C++ and C before that. In the C context, one of its meanings was for variables that keep their value between invocations. I presume that's where 'static' comes from - it doesn't reset the value (as opposed to a const where the value cannot change) | In Head First Java, there is a nice explanation of static. Static means stable not changing thats obvious from meaning and its quite obvious that it does not change.
Static mean sharing in Java. There is a nice picture where two child sharing one ice cream and showed static variable analogy. For more info please read ... |
5,062,100 | I have web pages that may or may not need to do some pre-processing before it can be displayed to the user. What I have done is to display this page with a message (e.g. "please wait ..."), then do an http-equiv refresh **to the same page**. When it refreshes to the same page, the pre-processing is done and the actual ... | 2011/02/21 | [
"https://Stackoverflow.com/questions/5062100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253976/"
] | It's a hold over from C++ and C before that. In the C context, one of its meanings was for variables that keep their value between invocations. I presume that's where 'static' comes from - it doesn't reset the value (as opposed to a const where the value cannot change) | I suppose the best way to think of it is that "static" means unchanging, and it is the *location* of the variable that is unchanging when when you switch between the different instances of a class. The main thing is to eradicate any thought from your mind that the *value* of a static variable is unchanging: it may even... |
5,062,100 | I have web pages that may or may not need to do some pre-processing before it can be displayed to the user. What I have done is to display this page with a message (e.g. "please wait ..."), then do an http-equiv refresh **to the same page**. When it refreshes to the same page, the pre-processing is done and the actual ... | 2011/02/21 | [
"https://Stackoverflow.com/questions/5062100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253976/"
] | In Head First Java, there is a nice explanation of static. Static means stable not changing thats obvious from meaning and its quite obvious that it does not change.
Static mean sharing in Java. There is a nice picture where two child sharing one ice cream and showed static variable analogy. For more info please read ... | >
> Definition of STATIC 1 : exerting
> force by reason of weight alone
> without motion 2 : of or relating to
> bodies at rest or forces in
> equilibrium 3 : showing little change
> 4 a :
> characterized by a lack of movement,
> animation, or progression b :
> producing an effect of repose or
> quiescence 5 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.