qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
26,014,426 | I config the multi-language setting dynamically using the `locale` filter. Which fetch the sub-domain name to determine the language.
```
function load_custom_language($locale) {
// get the locale code according to the sub-domain name.
// en.mysite.com => return `en`
// zh.mysite.com => return `zh_CN`
... | 2014/09/24 | [
"https://Stackoverflow.com/questions/26014426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2544762/"
] | I've found another pretty way to achieve the work:
After I checked for the source code of the kernel, I found that there are distinct filters called `option_xxx` on each options.
So, for my task, I tried to use the `option_siteurl` and `option_home` filter to hold that options to load, just to prevent the option to l... | To **set dynamically the domain and as well as the protocol** (*http* or *https*), use:
```php
// Identify the relevant protocol for the current request
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http";
// Set SITEURL and HOME using a dynamic ... |
64,941,133 | I read multiple csv files and get a list of 11 data frames. Now I want to use each data frame in the list to get a new table and save it to a csv file with the origin name separately.
I read csv file by
```
path <- "D:/DATA/01/processdata/singlecity"
fileNames = list.files(path, pattern="*.csv$")
filePath <- sapply(f... | 2020/11/21 | [
"https://Stackoverflow.com/questions/64941133",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13631100/"
] | You can try the following :
```
path <- "D:/DATA/01/processdata/singlecity"
fileNames = list.files(path, pattern="*.csv$", full.names = TRUE)
lapply(seq_along(fileNames), function(x){
file <- fileNames[x]
data <- subset(read.csv(file), grepl('2002|2003|2004|2005|2006', V2))
write.csv(data, sprintf('D:/DATA/01/p... | Here's a solution modifying the `for` loop you've shared.
```r
dfs <- list(dataframe1, dataframe2, dataframe3)
for (i in seq_along(dfs)) {
y <- data.table(dfs[[i]])
y <- dplyr::filter(y, grepl('2002|2003|2004|2005|2006', V2))
write.csv(y, paste0("datafram_t", i, ".csv"))
}
```
This will create files with t... |
15,823 | How do we create test packs for the final UAT. We create user stories and associated acceptance criteria which either can pass or fail. This can be done with test team but for business users what would be the format of the test package? | 2015/08/08 | [
"https://pm.stackexchange.com/questions/15823",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/18137/"
] | In addition to the acceptance criteria, I recommend adding "how-to-demo" descriptions to associated User Stories.
The Product Owner should know how to delight the business people. | You want to give guidance to the UAT testers, but not restict them too much. Real users may try things that the developers and testers don't try, so can reveal unexpected bugs.
I would suggest something like the following as a UAT pack:
* A list of the new functionality in the release
* A list of any known issues
* A... |
64,387,126 | I'm trying to make a script in python with selenium that will open a website and click a button.
Problem is that I have to close chrome before I can run the script otherwise I get this error:
```
Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argumen... | 2020/10/16 | [
"https://Stackoverflow.com/questions/64387126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14461751/"
] | Hmm I think you need workaround because cannot allow int at json file.
Something like this:
```
var mySettingsSection =
configuration.GetSection("MySettings").Get<Dictionary<string, string>>().Select(x => new KeyValuePair<int, string>(int.Parse(x.Key), x.Value));
``` | You have two options,
First one is to change the config file to int,string. For example:
```
{
"MySettings": {
"Mapping": {
1: "a",
2: "b"
}
}
}
```
Second possibility is to create another properties in `MySettings` class that will be with correct type (Dictionary<string,string>) and in `Mapp... |
64,387,126 | I'm trying to make a script in python with selenium that will open a website and click a button.
Problem is that I have to close chrome before I can run the script otherwise I get this error:
```
Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argumen... | 2020/10/16 | [
"https://Stackoverflow.com/questions/64387126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14461751/"
] | >
> Is there a way I can tell .NET Core to parse those string keys to integers and fill up the dictionary?
>
>
>
Unfortunately, there is **no** way to achieve that.
**Reason**
First, internally `ConfigurationProvider` use a `IDictionary<string, string>` to hold key-value pair of configuration settings ([source c... | You have two options,
First one is to change the config file to int,string. For example:
```
{
"MySettings": {
"Mapping": {
1: "a",
2: "b"
}
}
}
```
Second possibility is to create another properties in `MySettings` class that will be with correct type (Dictionary<string,string>) and in `Mapp... |
64,387,126 | I'm trying to make a script in python with selenium that will open a website and click a button.
Problem is that I have to close chrome before I can run the script otherwise I get this error:
```
Message: invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argumen... | 2020/10/16 | [
"https://Stackoverflow.com/questions/64387126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14461751/"
] | >
> Is there a way I can tell .NET Core to parse those string keys to integers and fill up the dictionary?
>
>
>
Unfortunately, there is **no** way to achieve that.
**Reason**
First, internally `ConfigurationProvider` use a `IDictionary<string, string>` to hold key-value pair of configuration settings ([source c... | Hmm I think you need workaround because cannot allow int at json file.
Something like this:
```
var mySettingsSection =
configuration.GetSection("MySettings").Get<Dictionary<string, string>>().Select(x => new KeyValuePair<int, string>(int.Parse(x.Key), x.Value));
``` |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | Divide 2 by one less than the number you were thinking of. Is the result an even number?
* Yes: You were thinking of 2 (because 2/(2-1) = 2)
* No: You were thinking of 3 (because 2/(3-1) = 1)
* Unanswerable: You were thinking of 1 (because 2/(1-1) = ∞) | >
> Does your answer have the same number of letters as is your number numeric value?
>
>
>
A little tricky, question seems not to ask for enough information, however:
answer: NO(2) >> 1 ; answer: YES(3) >> 3 ; answer MAYBE(5)/DON'T KNOW(8) >> 2 (two)
If the number is 2, answers YES (3 letters) and NO (2 letter... |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | >
> If you flip that many coins, will you get two the same?
>
>
>
Because
>
> As Doorknob put it... "1 => no, because it's only one, 2 => maybe, because it could be one of TH, HT, TT, or HH, 3 => yes, because a coin flip has only two possible outcomes"
>
>
> | [Soccer World Cup](http://www.fifa.com/worldcup/matches/) is in progress, so that warrants a themed question (though just a bit late, as group stage is over now - oh well):
>
> Is your number both valid and not less than a number of points that a team got after finishing a group stage match in which they scored at le... |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | I would ask
>
> "Is there infinitely many `n` such as `n` and `n + 'your number' -1` are primes?"
>
>
>
Because
1. >
> Yes (Euclid)
>
>
>
2. >
> No, obviously
>
>
>
3. >
> I don't know, still working on twin prime conjecture
>
>
> | would this work?
>
> she is thinking of a number; 1, 2, or 3, and only able to answer yes no or I don't know. I'm given only one question to know her number. so...
>
>
> "using only 1,2, and 3, if you subtract the number preceding the number you are thinking, and add the number following the one you are thinking... |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | Would it work if I ask:
>
> "I'm thinking of a number: either 0 or 1. Is the sum of our numbers greater than 2?" I could figure out the answer if that's a question I'm allowed to ask.
>
>
>
If your number is 3, then you would say "yes" because no matter what you add, it would be true.
If your number is 2, you ... | As is the case with all information puzzles, we have to find away to map each outcome (yes, no, I don't know) to a different number (1, 2, 3). To do this, we need some property that's unknown for exactly one of these three numbers.
There are multiple ways to do this. The most basic (and most reliable) way would be to ... |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | Here's my simple answer:
>
> What word has that many letters? Please answer with yes or no.
>
>
>
Example:
>
> - Yes -> 3
>
> - No -> 2
>
> - Er... I can't. -> 1
>
>
> | >
> Does the number of letters in your answer match the number you are thinking of?
>
>
>
So if thinking of 1, answer is no.
If thinking of 3, answer is yes.
If thinking of 2, can't truthfully answer yes or no |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | Would it work if I ask:
>
> "I'm thinking of a number: either 0 or 1. Is the sum of our numbers greater than 2?" I could figure out the answer if that's a question I'm allowed to ask.
>
>
>
If your number is 3, then you would say "yes" because no matter what you add, it would be true.
If your number is 2, you ... | >
> Does the number of letters in your answer match the number you are thinking of?
>
>
>
So if thinking of 1, answer is no.
If thinking of 3, answer is yes.
If thinking of 2, can't truthfully answer yes or no |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | Here's my thought process on this:
* The three answer possibilities must be "yes," "no," and... something else.
* Perhaps there is a way to get an answer of "maybe" or "sometimes?"
* Therefore, this would have to involve some kind of randomness.
* The question should be in the form of "Either X or Y is true. Is your n... | >
> If I pull your number of socks from a drawer with two different pairs of socks in it, will I have a matching pair? 1 - No, 2 - Maybe, 3 - Yes.
>
>
> |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | I would ask
>
> "Are there at least $N + 27$ days in February, where $N$ is your number?"
>
>
>
Because
* >
> if $(N = 1)$ then $(N + 27 = 28)$ --> Yes
>
>
>
* >
> if $(N = 2)$ then $(N + 27 = 29)$ --> Maybe
>
>
>
* >
> if $(N = 3)$ then $(N + 27 = 30)$ --> No
>
>
> | [Soccer World Cup](http://www.fifa.com/worldcup/matches/) is in progress, so that warrants a themed question (though just a bit late, as group stage is over now - oh well):
>
> Is your number both valid and not less than a number of points that a team got after finishing a group stage match in which they scored at le... |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | Would it work if I ask:
>
> "I'm thinking of a number: either 0 or 1. Is the sum of our numbers greater than 2?" I could figure out the answer if that's a question I'm allowed to ask.
>
>
>
If your number is 3, then you would say "yes" because no matter what you add, it would be true.
If your number is 2, you ... | Slightly tongue-in-cheek, but a variation on the "maybe" option provided the other player interprets it literally enough.
>
> Keep evaluating powers of your number until you reach one that exceeds 6. Is it an odd power? Answer yes = 2, no = 3, infinitely long pause = 1 …
>
>
> |
313 | This is an interesting puzzle which was passed to me by a friend some time ago. I do know the answer, but will refrain from self-answering on this to see where it goes.
I'm thinking of a number: 1, 2, or 3. You may ask me one question, which I will answer to the best of my ability. I may not, however, tell you my numb... | 2014/05/21 | [
"https://puzzling.stackexchange.com/questions/313",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/-1/"
] | Slightly tongue-in-cheek, but a variation on the "maybe" option provided the other player interprets it literally enough.
>
> Keep evaluating powers of your number until you reach one that exceeds 6. Is it an odd power? Answer yes = 2, no = 3, infinitely long pause = 1 …
>
>
> | I would ask
>
> "Is there infinitely many `n` such as `n` and `n + 'your number' -1` are primes?"
>
>
>
Because
1. >
> Yes (Euclid)
>
>
>
2. >
> No, obviously
>
>
>
3. >
> I don't know, still working on twin prime conjecture
>
>
> |
22,268,481 | I am writing a firefox extension, and want the functionality to upload a local json file and read this file to perform further actions. This json file in simple terms contains a list of urls, which on reading by the plugin will help in highlighting these urls if they are present on the webpage.
As suggested [here](ht... | 2014/03/08 | [
"https://Stackoverflow.com/questions/22268481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/769407/"
] | If you really want to use FileReader, here is a working example: [fiddle](http://jsfiddle.net/Noitidart/zTe4j/3/). browse and select a file with json contents and it will parse it and set the global json var to it.
its set up for multiple file select, you can change that easy by removing the `multiple` attribute and a... | You're making a firefox extensions so you have access to more powerful stuff like [OSFile.jsm](https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread)
I would prefer that.
You can use [nsIJSON - decodeFromStream](https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIJS... |
22,268,481 | I am writing a firefox extension, and want the functionality to upload a local json file and read this file to perform further actions. This json file in simple terms contains a list of urls, which on reading by the plugin will help in highlighting these urls if they are present on the webpage.
As suggested [here](ht... | 2014/03/08 | [
"https://Stackoverflow.com/questions/22268481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/769407/"
] | You're making a firefox extensions so you have access to more powerful stuff like [OSFile.jsm](https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread)
I would prefer that.
You can use [nsIJSON - decodeFromStream](https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIJS... | Here is a js module to do just that:
```
let EXPORTED_SYMBOLS = [
'importJSON',
'exportJSON',
'readUTF8File',
'writeUTF8File',
'nsFile'
];
const Cc = Components.classes;
const Ci = Components.interfaces;
//unused here, only exported
let nsFile = Components.Constructor("@mozilla.org/file/local;1",... |
22,268,481 | I am writing a firefox extension, and want the functionality to upload a local json file and read this file to perform further actions. This json file in simple terms contains a list of urls, which on reading by the plugin will help in highlighting these urls if they are present on the webpage.
As suggested [here](ht... | 2014/03/08 | [
"https://Stackoverflow.com/questions/22268481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/769407/"
] | if like @Noitidart , you find sync read-write yucky, here is code for async read-write:
```
/*start - example usage*/
var file = FileUtils.getFile("Desk", ["rawr.txt"]); //this gets file on desktop named 'rawr.txt'
//can also go: var file = FileUtils.File('C:\\Documents and Settings\\My User Name\\Desktop\\rawr.txt');... | You're making a firefox extensions so you have access to more powerful stuff like [OSFile.jsm](https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread)
I would prefer that.
You can use [nsIJSON - decodeFromStream](https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIJS... |
22,268,481 | I am writing a firefox extension, and want the functionality to upload a local json file and read this file to perform further actions. This json file in simple terms contains a list of urls, which on reading by the plugin will help in highlighting these urls if they are present on the webpage.
As suggested [here](ht... | 2014/03/08 | [
"https://Stackoverflow.com/questions/22268481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/769407/"
] | If you really want to use FileReader, here is a working example: [fiddle](http://jsfiddle.net/Noitidart/zTe4j/3/). browse and select a file with json contents and it will parse it and set the global json var to it.
its set up for multiple file select, you can change that easy by removing the `multiple` attribute and a... | Here is a js module to do just that:
```
let EXPORTED_SYMBOLS = [
'importJSON',
'exportJSON',
'readUTF8File',
'writeUTF8File',
'nsFile'
];
const Cc = Components.classes;
const Ci = Components.interfaces;
//unused here, only exported
let nsFile = Components.Constructor("@mozilla.org/file/local;1",... |
22,268,481 | I am writing a firefox extension, and want the functionality to upload a local json file and read this file to perform further actions. This json file in simple terms contains a list of urls, which on reading by the plugin will help in highlighting these urls if they are present on the webpage.
As suggested [here](ht... | 2014/03/08 | [
"https://Stackoverflow.com/questions/22268481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/769407/"
] | If you really want to use FileReader, here is a working example: [fiddle](http://jsfiddle.net/Noitidart/zTe4j/3/). browse and select a file with json contents and it will parse it and set the global json var to it.
its set up for multiple file select, you can change that easy by removing the `multiple` attribute and a... | if like @Noitidart , you find sync read-write yucky, here is code for async read-write:
```
/*start - example usage*/
var file = FileUtils.getFile("Desk", ["rawr.txt"]); //this gets file on desktop named 'rawr.txt'
//can also go: var file = FileUtils.File('C:\\Documents and Settings\\My User Name\\Desktop\\rawr.txt');... |
22,268,481 | I am writing a firefox extension, and want the functionality to upload a local json file and read this file to perform further actions. This json file in simple terms contains a list of urls, which on reading by the plugin will help in highlighting these urls if they are present on the webpage.
As suggested [here](ht... | 2014/03/08 | [
"https://Stackoverflow.com/questions/22268481",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/769407/"
] | if like @Noitidart , you find sync read-write yucky, here is code for async read-write:
```
/*start - example usage*/
var file = FileUtils.getFile("Desk", ["rawr.txt"]); //this gets file on desktop named 'rawr.txt'
//can also go: var file = FileUtils.File('C:\\Documents and Settings\\My User Name\\Desktop\\rawr.txt');... | Here is a js module to do just that:
```
let EXPORTED_SYMBOLS = [
'importJSON',
'exportJSON',
'readUTF8File',
'writeUTF8File',
'nsFile'
];
const Cc = Components.classes;
const Ci = Components.interfaces;
//unused here, only exported
let nsFile = Components.Constructor("@mozilla.org/file/local;1",... |
73,820,256 | I have a type, let's call it T. It can be of different types, and I do not know them in advance:
int, double, bitmap pointer...
Now, I have a class, let's call it C. It should maintain a vector of queues of T.
Each queue has its unique type of elements, but it is possible that C has a vector (or whatever other way of m... | 2022/09/22 | [
"https://Stackoverflow.com/questions/73820256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5079088/"
] | It's actually not that complicated. You don't even need recursion. Just [`std::tuple`](https://en.cppreference.com/w/cpp/utility/tuple)
```
#include <tuple>
#include <queue>
template <class... Args>
struct C
{
std::tuple<std::queue<Args>...> queues_;
template <std::size_t I>
auto& queue_at()
{
... | You can use variadic template with recursive inheritance:
```cpp
#include <queue>
#include <string>
template <typename First, typename... Rest>
struct Base : Base<First>, Base<Rest...> {
};
template <typename First>
struct Base<First> {
std::queue<First> q;
};
int main (){
auto f = Base<int, std::string>{}... |
463,221 | I was reading an article about changes in the English language, and I stumbled upon an example the author used to make an argument, referring to these subtleties that English native speakers learn when they are kids, but to me, they all sound the same, haha
So, colloquially, what are the differences between the expres... | 2018/09/05 | [
"https://english.stackexchange.com/questions/463221",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/128281/"
] | As I'm guessing you already know, the present tense can refer to the future.
[English present tense](https://en.wikipedia.org/wiki/Present_tense#English)
Doing a Google search of the variations, I get:
>
> "I'm going to turn 18 tomorrow" = 9 results
> "I'll turn 18
> tomorrow" = 122 results
> "I turn 18 to... | They are interchangeable and mean the same thing.
However in BrE it’s more idiomatic to say ‘I’ll be 31 tomorrow’.
The ‘turning’ thing is American English, I think.
Maybe others can comment on that. |
615,728 | I have dumped my repository on my old computer to a file with the command.
`svnadmin dump C:\myrepo/ > mydumpfile`
Now I decided to use [VisualSVN Server](http://www.visualsvn.com/server/) on my new computer as opposed to just a baseline subversion. How do I import my repository into VisualSVN Server? | 2009/03/05 | [
"https://Stackoverflow.com/questions/615728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43994/"
] | Figured it out now that Andrew Clark pointed out there is a "All Tasks"
```
Repository -> All Tasks -> Open Command Prompt
svnadmin create repository-name
svnadmin load repository-name < repository-name.dmp
``` | try copying your repository to like C:\Repositories
or use Repositories -> All Tasks -> Import Existing Repository |
615,728 | I have dumped my repository on my old computer to a file with the command.
`svnadmin dump C:\myrepo/ > mydumpfile`
Now I decided to use [VisualSVN Server](http://www.visualsvn.com/server/) on my new computer as opposed to just a baseline subversion. How do I import my repository into VisualSVN Server? | 2009/03/05 | [
"https://Stackoverflow.com/questions/615728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43994/"
] | try copying your repository to like C:\Repositories
or use Repositories -> All Tasks -> Import Existing Repository | Importing from portable dump file implemented in [VisualSVN Server 3.2](https://www.visualsvn.com/server/changes/3.2/):
1. Start the **VisualSVN Server Manager** console.
2. Select **Import Existing Repository** command in the context menu for the **Repositories** node.
3. Select **Load repository from dump file**, cl... |
615,728 | I have dumped my repository on my old computer to a file with the command.
`svnadmin dump C:\myrepo/ > mydumpfile`
Now I decided to use [VisualSVN Server](http://www.visualsvn.com/server/) on my new computer as opposed to just a baseline subversion. How do I import my repository into VisualSVN Server? | 2009/03/05 | [
"https://Stackoverflow.com/questions/615728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43994/"
] | try copying your repository to like C:\Repositories
or use Repositories -> All Tasks -> Import Existing Repository | If you ask this question in context of repository backups, consider this answer, please: <https://stackoverflow.com/a/12444944/761095>.
>
> When you want to import an existing repository to VisualSVN Server,
> read the article [KB10: How can I import my existing repository into
> newly installed VisualSVN Server?](... |
615,728 | I have dumped my repository on my old computer to a file with the command.
`svnadmin dump C:\myrepo/ > mydumpfile`
Now I decided to use [VisualSVN Server](http://www.visualsvn.com/server/) on my new computer as opposed to just a baseline subversion. How do I import my repository into VisualSVN Server? | 2009/03/05 | [
"https://Stackoverflow.com/questions/615728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43994/"
] | Figured it out now that Andrew Clark pointed out there is a "All Tasks"
```
Repository -> All Tasks -> Open Command Prompt
svnadmin create repository-name
svnadmin load repository-name < repository-name.dmp
``` | Importing from portable dump file implemented in [VisualSVN Server 3.2](https://www.visualsvn.com/server/changes/3.2/):
1. Start the **VisualSVN Server Manager** console.
2. Select **Import Existing Repository** command in the context menu for the **Repositories** node.
3. Select **Load repository from dump file**, cl... |
615,728 | I have dumped my repository on my old computer to a file with the command.
`svnadmin dump C:\myrepo/ > mydumpfile`
Now I decided to use [VisualSVN Server](http://www.visualsvn.com/server/) on my new computer as opposed to just a baseline subversion. How do I import my repository into VisualSVN Server? | 2009/03/05 | [
"https://Stackoverflow.com/questions/615728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43994/"
] | Figured it out now that Andrew Clark pointed out there is a "All Tasks"
```
Repository -> All Tasks -> Open Command Prompt
svnadmin create repository-name
svnadmin load repository-name < repository-name.dmp
``` | If you ask this question in context of repository backups, consider this answer, please: <https://stackoverflow.com/a/12444944/761095>.
>
> When you want to import an existing repository to VisualSVN Server,
> read the article [KB10: How can I import my existing repository into
> newly installed VisualSVN Server?](... |
615,728 | I have dumped my repository on my old computer to a file with the command.
`svnadmin dump C:\myrepo/ > mydumpfile`
Now I decided to use [VisualSVN Server](http://www.visualsvn.com/server/) on my new computer as opposed to just a baseline subversion. How do I import my repository into VisualSVN Server? | 2009/03/05 | [
"https://Stackoverflow.com/questions/615728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/43994/"
] | Importing from portable dump file implemented in [VisualSVN Server 3.2](https://www.visualsvn.com/server/changes/3.2/):
1. Start the **VisualSVN Server Manager** console.
2. Select **Import Existing Repository** command in the context menu for the **Repositories** node.
3. Select **Load repository from dump file**, cl... | If you ask this question in context of repository backups, consider this answer, please: <https://stackoverflow.com/a/12444944/761095>.
>
> When you want to import an existing repository to VisualSVN Server,
> read the article [KB10: How can I import my existing repository into
> newly installed VisualSVN Server?](... |
8,315,917 | I develop an app using sqlite database and i need to take single row from a table. I tried this:
```
-(void)getRowFromTableNamed:(NSString *)tableName
whichRow:(NSString *)row
{
NSString *qsql = [NSString stringWithFormat:
@"SELECT %@ FROM %@",
row, ... | 2011/11/29 | [
"https://Stackoverflow.com/questions/8315917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1012793/"
] | TYPE\_ORIENTATION is deprecated
-------------------------------
We cannot use the Orientation Sensor anymore, we can use the Magnetic Field Sensor and Accelerometer Sensors in tandem to get equivalent functionality. It's more work but it does allow to continue to use a callback to handle orientation changes.
Conversi... | Not sure what you mean by according to your camera, but you can get it based on the hardware sensors. See the following links:
[Compass Example](http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Compass.html)
Also check out the Sensor `TYPE_ORIENTATION` on [this](http://dev... |
8,315,917 | I develop an app using sqlite database and i need to take single row from a table. I tried this:
```
-(void)getRowFromTableNamed:(NSString *)tableName
whichRow:(NSString *)row
{
NSString *qsql = [NSString stringWithFormat:
@"SELECT %@ FROM %@",
row, ... | 2011/11/29 | [
"https://Stackoverflow.com/questions/8315917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1012793/"
] | TYPE\_ORIENTATION is deprecated
-------------------------------
We cannot use the Orientation Sensor anymore, we can use the Magnetic Field Sensor and Accelerometer Sensors in tandem to get equivalent functionality. It's more work but it does allow to continue to use a callback to handle orientation changes.
Conversi... | Here's what I have so far that's somewhat working for me, values returned are between 0 - 360 but I don't think north is properly calibrated? I'm using this on an LG G Pad running Android 5.0.1
```
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER)
mGr... |
8,315,917 | I develop an app using sqlite database and i need to take single row from a table. I tried this:
```
-(void)getRowFromTableNamed:(NSString *)tableName
whichRow:(NSString *)row
{
NSString *qsql = [NSString stringWithFormat:
@"SELECT %@ FROM %@",
row, ... | 2011/11/29 | [
"https://Stackoverflow.com/questions/8315917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1012793/"
] | TYPE\_ORIENTATION is deprecated
-------------------------------
We cannot use the Orientation Sensor anymore, we can use the Magnetic Field Sensor and Accelerometer Sensors in tandem to get equivalent functionality. It's more work but it does allow to continue to use a callback to handle orientation changes.
Conversi... | Use the Rotation Vector sensor, which combines the geomagnetic and gravitational sensors. Then use [SensorManager.getOrientation](https://developer.android.com/reference/android/hardware/SensorManager.html#getOrientation(float[],%20float[])) to convert from an array of 5 values to an OpenGL-style rotation matrix. As th... |
30,395,247 | I am making a simple script in Javascript, calculating some stuff like minimum, maximum etc. and I was wondering which of the following would be faster, and mostly, why:
```
var x, y, z;
function test(){
if (x === undefined)
x = Math.min(a, b);
if (y === undefined)
y = a / b;
if (z === undefined)
z = a - b... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30395247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3809561/"
] | Always define your javascript variables at the top, and use them later like:
```
'use strict';
var a, b, c;
a = 1;
if (typeof b === 'undefined') {
b = a || c;
}
// b is now 1
```
It is worth mentioning that if you don't define a variable, it becomes a global when first used (which is very bad).
Defining a va... | If you do not want to change the x,y,z values if they already exist then checking for their existance and then over writing would be a better option.
```
if (x === undefined)
x = Math.min(a, b);
if (y === undefined)
y = a / b;
if (z === undefined)
z = a - b;
```
Since you are working with RGB ,this is th... |
30,395,247 | I am making a simple script in Javascript, calculating some stuff like minimum, maximum etc. and I was wondering which of the following would be faster, and mostly, why:
```
var x, y, z;
function test(){
if (x === undefined)
x = Math.min(a, b);
if (y === undefined)
y = a / b;
if (z === undefined)
z = a - b... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30395247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3809561/"
] | Always define your javascript variables at the top, and use them later like:
```
'use strict';
var a, b, c;
a = 1;
if (typeof b === 'undefined') {
b = a || c;
}
// b is now 1
```
It is worth mentioning that if you don't define a variable, it becomes a global when first used (which is very bad).
Defining a va... | if the variable is not defined use [typeof](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof) . The Condition should be like
```
if(typeof x === 'undefined'){
//do something
}
``` |
30,395,247 | I am making a simple script in Javascript, calculating some stuff like minimum, maximum etc. and I was wondering which of the following would be faster, and mostly, why:
```
var x, y, z;
function test(){
if (x === undefined)
x = Math.min(a, b);
if (y === undefined)
y = a / b;
if (z === undefined)
z = a - b... | 2015/05/22 | [
"https://Stackoverflow.com/questions/30395247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3809561/"
] | Always define your javascript variables at the top, and use them later like:
```
'use strict';
var a, b, c;
a = 1;
if (typeof b === 'undefined') {
b = a || c;
}
// b is now 1
```
It is worth mentioning that if you don't define a variable, it becomes a global when first used (which is very bad).
Defining a va... | It is totally depending on context whether you want to overwrite existing value or not. Irrespective of the existence of variable if you want to perform operation then below ways is best.
```
x = Math.min(a, b);
y = a / b;
z = a - b;
```
This way it faster because in first way you are just check variable is undefine... |
25,634,738 | I'm trying to figure out how to select dates (note: all dates, not just specific dates) in a paragraph using (I'm assuming) jQuery/Javascript.
To give an example, the website gets a bunch of text from a database, and in that text is included a date in the following format: (DD/MM/YYYY). I just want to highlight every... | 2014/09/03 | [
"https://Stackoverflow.com/questions/25634738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4002227/"
] | The problem seems to be fixed by adding the following line before retrieving that data:
```
rs <- dbSendQuery(con, 'set character set "utf8"')
``` | When trying to use utf8/utf8mb4, if you see **Question Marks** (regular ones, not black diamonds),
* The bytes to be stored are not encoded as utf8. Fix this.
* The column in the database is `CHARACTER SET utf8` (or utf8mb4). Fix this.
* Also, check that the connection during reading is utf8. |
25,634,738 | I'm trying to figure out how to select dates (note: all dates, not just specific dates) in a paragraph using (I'm assuming) jQuery/Javascript.
To give an example, the website gets a bunch of text from a database, and in that text is included a date in the following format: (DD/MM/YYYY). I just want to highlight every... | 2014/09/03 | [
"https://Stackoverflow.com/questions/25634738",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4002227/"
] | The problem seems to be fixed by adding the following line before retrieving that data:
```
rs <- dbSendQuery(con, 'set character set "utf8"')
``` | For me just replace `RMySQL::MySQL()` driver to the `RMariaDB::MariaDB()` solved the problem.
Thanks to this [post](https://community.rstudio.com/t/solved-rmysql-mysql-causes-character-encoding-issues-that-are-solved-with-rmariadb-mariadb/3415). |
30,126,153 | I have a C++ interdependence problem and i can not understand where the problem is...
Here are my headers:
json.array.h
```
#ifndef __JSON_ARRAY__
#define __JSON_ARRAY__
#include "json.object.h"
class JSON_OBJECT;
/* JSON_ARRAY */
class JSON_ARRAY {
int size;
custom_list<JSON_OBJECT> * container;
...
};
... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30126153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4442435/"
] | You have a forward declaration here
```
class JSON_TYPE;
class elem_info {
public:
std::string key;
JSON_TYPE value;
...
};
```
But `value` is an instance of `JSON_TYPE`. You can only forward declare if you have members that are pointers or references, not actual instances.
In fact, since you have a full ... | `json.type.h` includes `json.array.h` which includes `json.object.h` which includes `json.type.h`.
That can't work. |
30,126,153 | I have a C++ interdependence problem and i can not understand where the problem is...
Here are my headers:
json.array.h
```
#ifndef __JSON_ARRAY__
#define __JSON_ARRAY__
#include "json.object.h"
class JSON_OBJECT;
/* JSON_ARRAY */
class JSON_ARRAY {
int size;
custom_list<JSON_OBJECT> * container;
...
};
... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30126153",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4442435/"
] | You can't do:
```
class JSON_TYPE;
class elem_info {
public:
std::string key;
JSON_TYPE value;
...
};
```
`JSON_TYPE` is an incomplete type. You can have a pointer or reference but no actual instance since the compiler does not know what it is. | `json.type.h` includes `json.array.h` which includes `json.object.h` which includes `json.type.h`.
That can't work. |
109,458 | Sheet music enables instrumental performers who are able to read music notation (a pianist, orchestral instrument players, a jazz band, etc.) or singers to perform a song or piece.
Presumably some performers are able to "hear" sheet music from reading prior to performance. Particularly music for a single (known) instr... | 2021/01/05 | [
"https://music.stackexchange.com/questions/109458",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/74210/"
] | Training to be a singer includes what is called "ear training" which is the act of hearing the pitch in your "ear" (mind, really) before you phonate (sing) it. This ability keeps you in tune while you sing.
You also learn how to read music and, eventually, you learn how to "sight-read" it. This means you can pick up s... | With enough training and practice you can absolutely "hear" the music in your head as you read the sheet music. And you can judge what it should sound like but that doesn't mean you can judge it as a performance. Humans will inject some of their own "feeling" into it and that adds to the uniqueness of each rendition of... |
109,458 | Sheet music enables instrumental performers who are able to read music notation (a pianist, orchestral instrument players, a jazz band, etc.) or singers to perform a song or piece.
Presumably some performers are able to "hear" sheet music from reading prior to performance. Particularly music for a single (known) instr... | 2021/01/05 | [
"https://music.stackexchange.com/questions/109458",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/74210/"
] | Training to be a singer includes what is called "ear training" which is the act of hearing the pitch in your "ear" (mind, really) before you phonate (sing) it. This ability keeps you in tune while you sing.
You also learn how to read music and, eventually, you learn how to "sight-read" it. This means you can pick up s... | The people most likely to be able to do this are composers and orchestral conductors. It is a mixture of inbuilt talent allied with plenty of practice.
You could argue that composers and conductors become good at this because they practise doing it. In my opinion, it is more likely the other way around. Because they c... |
109,458 | Sheet music enables instrumental performers who are able to read music notation (a pianist, orchestral instrument players, a jazz band, etc.) or singers to perform a song or piece.
Presumably some performers are able to "hear" sheet music from reading prior to performance. Particularly music for a single (known) instr... | 2021/01/05 | [
"https://music.stackexchange.com/questions/109458",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/74210/"
] | Training to be a singer includes what is called "ear training" which is the act of hearing the pitch in your "ear" (mind, really) before you phonate (sing) it. This ability keeps you in tune while you sing.
You also learn how to read music and, eventually, you learn how to "sight-read" it. This means you can pick up s... | Music is a language that can learnt (understood and spoken by almost everyone if it would be trained like our mother language. If you are taught by eartraining and sight reading and you practice it everyday it becomes a part of you like a learnt foreign language. You start to think and combine motifs, chords, chord pro... |
109,458 | Sheet music enables instrumental performers who are able to read music notation (a pianist, orchestral instrument players, a jazz band, etc.) or singers to perform a song or piece.
Presumably some performers are able to "hear" sheet music from reading prior to performance. Particularly music for a single (known) instr... | 2021/01/05 | [
"https://music.stackexchange.com/questions/109458",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/74210/"
] | Training to be a singer includes what is called "ear training" which is the act of hearing the pitch in your "ear" (mind, really) before you phonate (sing) it. This ability keeps you in tune while you sing.
You also learn how to read music and, eventually, you learn how to "sight-read" it. This means you can pick up s... | It depends on the skill of the musician and the complexity of the sheet music, but yes, musicians do totally hear in their heads the music they are reading and about to play. It is a skill that is learned, much the way that we learn to read text.
The skill comes in particularly useful when transposing at sight. It's o... |
109,458 | Sheet music enables instrumental performers who are able to read music notation (a pianist, orchestral instrument players, a jazz band, etc.) or singers to perform a song or piece.
Presumably some performers are able to "hear" sheet music from reading prior to performance. Particularly music for a single (known) instr... | 2021/01/05 | [
"https://music.stackexchange.com/questions/109458",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/74210/"
] | With enough training and practice you can absolutely "hear" the music in your head as you read the sheet music. And you can judge what it should sound like but that doesn't mean you can judge it as a performance. Humans will inject some of their own "feeling" into it and that adds to the uniqueness of each rendition of... | The people most likely to be able to do this are composers and orchestral conductors. It is a mixture of inbuilt talent allied with plenty of practice.
You could argue that composers and conductors become good at this because they practise doing it. In my opinion, it is more likely the other way around. Because they c... |
109,458 | Sheet music enables instrumental performers who are able to read music notation (a pianist, orchestral instrument players, a jazz band, etc.) or singers to perform a song or piece.
Presumably some performers are able to "hear" sheet music from reading prior to performance. Particularly music for a single (known) instr... | 2021/01/05 | [
"https://music.stackexchange.com/questions/109458",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/74210/"
] | With enough training and practice you can absolutely "hear" the music in your head as you read the sheet music. And you can judge what it should sound like but that doesn't mean you can judge it as a performance. Humans will inject some of their own "feeling" into it and that adds to the uniqueness of each rendition of... | Music is a language that can learnt (understood and spoken by almost everyone if it would be trained like our mother language. If you are taught by eartraining and sight reading and you practice it everyday it becomes a part of you like a learnt foreign language. You start to think and combine motifs, chords, chord pro... |
109,458 | Sheet music enables instrumental performers who are able to read music notation (a pianist, orchestral instrument players, a jazz band, etc.) or singers to perform a song or piece.
Presumably some performers are able to "hear" sheet music from reading prior to performance. Particularly music for a single (known) instr... | 2021/01/05 | [
"https://music.stackexchange.com/questions/109458",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/74210/"
] | With enough training and practice you can absolutely "hear" the music in your head as you read the sheet music. And you can judge what it should sound like but that doesn't mean you can judge it as a performance. Humans will inject some of their own "feeling" into it and that adds to the uniqueness of each rendition of... | It depends on the skill of the musician and the complexity of the sheet music, but yes, musicians do totally hear in their heads the music they are reading and about to play. It is a skill that is learned, much the way that we learn to read text.
The skill comes in particularly useful when transposing at sight. It's o... |
109,458 | Sheet music enables instrumental performers who are able to read music notation (a pianist, orchestral instrument players, a jazz band, etc.) or singers to perform a song or piece.
Presumably some performers are able to "hear" sheet music from reading prior to performance. Particularly music for a single (known) instr... | 2021/01/05 | [
"https://music.stackexchange.com/questions/109458",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/74210/"
] | The people most likely to be able to do this are composers and orchestral conductors. It is a mixture of inbuilt talent allied with plenty of practice.
You could argue that composers and conductors become good at this because they practise doing it. In my opinion, it is more likely the other way around. Because they c... | Music is a language that can learnt (understood and spoken by almost everyone if it would be trained like our mother language. If you are taught by eartraining and sight reading and you practice it everyday it becomes a part of you like a learnt foreign language. You start to think and combine motifs, chords, chord pro... |
109,458 | Sheet music enables instrumental performers who are able to read music notation (a pianist, orchestral instrument players, a jazz band, etc.) or singers to perform a song or piece.
Presumably some performers are able to "hear" sheet music from reading prior to performance. Particularly music for a single (known) instr... | 2021/01/05 | [
"https://music.stackexchange.com/questions/109458",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/74210/"
] | It depends on the skill of the musician and the complexity of the sheet music, but yes, musicians do totally hear in their heads the music they are reading and about to play. It is a skill that is learned, much the way that we learn to read text.
The skill comes in particularly useful when transposing at sight. It's o... | Music is a language that can learnt (understood and spoken by almost everyone if it would be trained like our mother language. If you are taught by eartraining and sight reading and you practice it everyday it becomes a part of you like a learnt foreign language. You start to think and combine motifs, chords, chord pro... |
1,664,877 | How do I prove $2 \binom n2 + 4 \binom n4 + 6 \binom n6 + \cdots = n 2^{n-2}$
I thought about using known $\sum k\binom nk = n2^{n-1} $ and then just dividing it by 2. But is it possible you can help me with writing the full solution, because for the first known theorem you need to derivate $(a+b)^n $and also $a=1, b=... | 2016/02/21 | [
"https://math.stackexchange.com/questions/1664877",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/145510/"
] | \begin{align\*}
(1+x)^n & = \sum\_{k=0}^n \binom{n}{k}x^k\\
\frac{d}{dx}(1+x)^n & = \sum\_{k=1}^n k\binom{n}{k}x^{k-1}\\
n(1+x)^{n-1} & = \sum\_{k=1}^n k\binom{n}{k}x^{k-1}
\end{align\*}
Likewise
\begin{align\*}
n(1-x)^{n-1} & = \sum\_{k=1}^n (-1)^kk\binom{n}{k}x^{k-1}
\end{align\*}
Now add
$$n(1+x)^{n-1} +n(1-x)^{n-1... | Hint: For an "algebraic" argument, note that $k \binom{n}{k}=n\binom{n-1}{k-1}$. |
1,664,877 | How do I prove $2 \binom n2 + 4 \binom n4 + 6 \binom n6 + \cdots = n 2^{n-2}$
I thought about using known $\sum k\binom nk = n2^{n-1} $ and then just dividing it by 2. But is it possible you can help me with writing the full solution, because for the first known theorem you need to derivate $(a+b)^n $and also $a=1, b=... | 2016/02/21 | [
"https://math.stackexchange.com/questions/1664877",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/145510/"
] | Hint: For an "algebraic" argument, note that $k \binom{n}{k}=n\binom{n-1}{k-1}$. | For a combinatorial argument, suppose that you have a pool of $n$ candidates, and you want to choose from that pool a team with an even number of members and appoint one of those members captain. Clearly the lefthand side of your identity counts the number of ways to do this, dividing the count up according to the size... |
1,664,877 | How do I prove $2 \binom n2 + 4 \binom n4 + 6 \binom n6 + \cdots = n 2^{n-2}$
I thought about using known $\sum k\binom nk = n2^{n-1} $ and then just dividing it by 2. But is it possible you can help me with writing the full solution, because for the first known theorem you need to derivate $(a+b)^n $and also $a=1, b=... | 2016/02/21 | [
"https://math.stackexchange.com/questions/1664877",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/145510/"
] | Hint: For an "algebraic" argument, note that $k \binom{n}{k}=n\binom{n-1}{k-1}$. | Simple solution:
$(1-x)^n = 1 - \binom n1x + \binom n2 x^2 - \binom n3 x^3+ ...$, now we derivate, and then we enter $ x = 1 $. and then we take all the coefficients with negative signs to $LHS$ and we keep the positive ones in $RHS$. opinions? |
1,664,877 | How do I prove $2 \binom n2 + 4 \binom n4 + 6 \binom n6 + \cdots = n 2^{n-2}$
I thought about using known $\sum k\binom nk = n2^{n-1} $ and then just dividing it by 2. But is it possible you can help me with writing the full solution, because for the first known theorem you need to derivate $(a+b)^n $and also $a=1, b=... | 2016/02/21 | [
"https://math.stackexchange.com/questions/1664877",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/145510/"
] | \begin{align\*}
(1+x)^n & = \sum\_{k=0}^n \binom{n}{k}x^k\\
\frac{d}{dx}(1+x)^n & = \sum\_{k=1}^n k\binom{n}{k}x^{k-1}\\
n(1+x)^{n-1} & = \sum\_{k=1}^n k\binom{n}{k}x^{k-1}
\end{align\*}
Likewise
\begin{align\*}
n(1-x)^{n-1} & = \sum\_{k=1}^n (-1)^kk\binom{n}{k}x^{k-1}
\end{align\*}
Now add
$$n(1+x)^{n-1} +n(1-x)^{n-1... | For a combinatorial argument, suppose that you have a pool of $n$ candidates, and you want to choose from that pool a team with an even number of members and appoint one of those members captain. Clearly the lefthand side of your identity counts the number of ways to do this, dividing the count up according to the size... |
1,664,877 | How do I prove $2 \binom n2 + 4 \binom n4 + 6 \binom n6 + \cdots = n 2^{n-2}$
I thought about using known $\sum k\binom nk = n2^{n-1} $ and then just dividing it by 2. But is it possible you can help me with writing the full solution, because for the first known theorem you need to derivate $(a+b)^n $and also $a=1, b=... | 2016/02/21 | [
"https://math.stackexchange.com/questions/1664877",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/145510/"
] | \begin{align\*}
(1+x)^n & = \sum\_{k=0}^n \binom{n}{k}x^k\\
\frac{d}{dx}(1+x)^n & = \sum\_{k=1}^n k\binom{n}{k}x^{k-1}\\
n(1+x)^{n-1} & = \sum\_{k=1}^n k\binom{n}{k}x^{k-1}
\end{align\*}
Likewise
\begin{align\*}
n(1-x)^{n-1} & = \sum\_{k=1}^n (-1)^kk\binom{n}{k}x^{k-1}
\end{align\*}
Now add
$$n(1+x)^{n-1} +n(1-x)^{n-1... | Simple solution:
$(1-x)^n = 1 - \binom n1x + \binom n2 x^2 - \binom n3 x^3+ ...$, now we derivate, and then we enter $ x = 1 $. and then we take all the coefficients with negative signs to $LHS$ and we keep the positive ones in $RHS$. opinions? |
1,664,877 | How do I prove $2 \binom n2 + 4 \binom n4 + 6 \binom n6 + \cdots = n 2^{n-2}$
I thought about using known $\sum k\binom nk = n2^{n-1} $ and then just dividing it by 2. But is it possible you can help me with writing the full solution, because for the first known theorem you need to derivate $(a+b)^n $and also $a=1, b=... | 2016/02/21 | [
"https://math.stackexchange.com/questions/1664877",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/145510/"
] | For a combinatorial argument, suppose that you have a pool of $n$ candidates, and you want to choose from that pool a team with an even number of members and appoint one of those members captain. Clearly the lefthand side of your identity counts the number of ways to do this, dividing the count up according to the size... | Simple solution:
$(1-x)^n = 1 - \binom n1x + \binom n2 x^2 - \binom n3 x^3+ ...$, now we derivate, and then we enter $ x = 1 $. and then we take all the coefficients with negative signs to $LHS$ and we keep the positive ones in $RHS$. opinions? |
524,506 | I'm trying to write a function to replace the functionality of the `exit` builtin to prevent myself from exiting the terminal.
I have attempted to use the `SHLVL` environment variable but it doesn't seem to change within subshells:
```
$ echo $SHLVL
1
$ ( echo $SHLVL )
1
$ bash -c 'echo $SHLVL'
2
```
My function is... | 2019/06/12 | [
"https://unix.stackexchange.com/questions/524506",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/237982/"
] | In bash, you can compare `$BASHPID` to `$$`
```
$ ( if [ "$$" -eq "$BASHPID" ]; then echo not subshell; else echo subshell; fi )
subshell
$ if [ "$$" -eq "$BASHPID" ]; then echo not subshell; else echo subshell; fi
not subshell
```
If you're not in bash, `$$` should remain the same in a subshell, so you'd need som... | How about `BASH_SUBSHELL`?
>
> BASH\_SUBSHELL
>
> Incremented by one within each subshell or subshell environment when the shell
>
> begins executing in that environment. The initial value is 0.
>
>
>
```
$ echo $BASH_SUBSHELL
0
$ (echo $BASH_SUBSHELL)
1
``` |
524,506 | I'm trying to write a function to replace the functionality of the `exit` builtin to prevent myself from exiting the terminal.
I have attempted to use the `SHLVL` environment variable but it doesn't seem to change within subshells:
```
$ echo $SHLVL
1
$ ( echo $SHLVL )
1
$ bash -c 'echo $SHLVL'
2
```
My function is... | 2019/06/12 | [
"https://unix.stackexchange.com/questions/524506",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/237982/"
] | How about `BASH_SUBSHELL`?
>
> BASH\_SUBSHELL
>
> Incremented by one within each subshell or subshell environment when the shell
>
> begins executing in that environment. The initial value is 0.
>
>
>
```
$ echo $BASH_SUBSHELL
0
$ (echo $BASH_SUBSHELL)
1
``` | [this should've been a comment, but my comments tend to be deleted by moderators, so this will stay as an answer that I could use it as a reference even if deleted]
Using `BASH_SUBSHELL` is completely unreliable as it be only set to 1 in *some* subshells, not in all subshells.
```
$ (echo $BASH_SUBSHELL)
1
$ echo $BA... |
524,506 | I'm trying to write a function to replace the functionality of the `exit` builtin to prevent myself from exiting the terminal.
I have attempted to use the `SHLVL` environment variable but it doesn't seem to change within subshells:
```
$ echo $SHLVL
1
$ ( echo $SHLVL )
1
$ bash -c 'echo $SHLVL'
2
```
My function is... | 2019/06/12 | [
"https://unix.stackexchange.com/questions/524506",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/237982/"
] | In bash, you can compare `$BASHPID` to `$$`
```
$ ( if [ "$$" -eq "$BASHPID" ]; then echo not subshell; else echo subshell; fi )
subshell
$ if [ "$$" -eq "$BASHPID" ]; then echo not subshell; else echo subshell; fi
not subshell
```
If you're not in bash, `$$` should remain the same in a subshell, so you'd need som... | [this should've been a comment, but my comments tend to be deleted by moderators, so this will stay as an answer that I could use it as a reference even if deleted]
Using `BASH_SUBSHELL` is completely unreliable as it be only set to 1 in *some* subshells, not in all subshells.
```
$ (echo $BASH_SUBSHELL)
1
$ echo $BA... |
63,868,635 | By default, Monday is set as the first day of the week. The middle east region, Sunday is considered the first day of the week.
```
var now = DateTime.now();
print("todays date is $now");
print("week day is: ${now.weekday}");
// todays date is 2020-09-13 12:20:02.417210
// week day is: 7
```
since today is Sund... | 2020/09/13 | [
"https://Stackoverflow.com/questions/63868635",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/630238/"
] | [](https://i.stack.imgur.com/jt4Xs.png)You should use `@RequestParam`
```
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public void upload(@RequestParam Map<String, MultipartFile> body) {
}
```
Then post via form-data media ie:
```
fil... | I did not mention I'm using reactive webflux, thus solution posted by @Toàn Nguyễn Hải does not work in my case. I believe it works in non-reactive applications.
For web flux, the following works:
[](https://i.stack.imgur.com/W5e2i.png)
To be fair, ... |
84,711 | I'm interested in the New York City jurisdiction.
Imagine a person is involved, or suspected to be involved, in a crime, yet they are not suspected of having committed any crime. For example, imagine a journalist that has been sent a letter from a serial killer that they wanted them to publish. I assume it would be na... | 2022/09/25 | [
"https://law.stackexchange.com/questions/84711",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/41960/"
] | Police can get a warrant, if the warrant is supported by "probable cause" to believe that evidence of a crime exists. A separate "probable cause" requirement is that to arrest a person, there must be "probable cause" that they committed a crime. However, the [Privacy Protection Act](https://www.law.cornell.edu/uscode/t... | A search warrant does not have to be served on a suspect
--------------------------------------------------------
A search warrant may be issued on probable cause that evidence of a crime will be found - there is no requirement that the person or place searched be suspected of involvement. For example, search warrants... |
84,711 | I'm interested in the New York City jurisdiction.
Imagine a person is involved, or suspected to be involved, in a crime, yet they are not suspected of having committed any crime. For example, imagine a journalist that has been sent a letter from a serial killer that they wanted them to publish. I assume it would be na... | 2022/09/25 | [
"https://law.stackexchange.com/questions/84711",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/41960/"
] | A search warrant does not have to be served on a suspect
--------------------------------------------------------
A search warrant may be issued on probable cause that evidence of a crime will be found - there is no requirement that the person or place searched be suspected of involvement. For example, search warrants... | See *Zurcher v. Stanford Daily*, [436 U.S. 547](https://supreme.justia.com/us/436/547/case.html) (1978) in which the United States Supreme Court held that (in summary):
>
> A State is not prevented by the Fourth and Fourteenth Amendments from issuing a warrant to search for evidence simply because the owner or posses... |
84,711 | I'm interested in the New York City jurisdiction.
Imagine a person is involved, or suspected to be involved, in a crime, yet they are not suspected of having committed any crime. For example, imagine a journalist that has been sent a letter from a serial killer that they wanted them to publish. I assume it would be na... | 2022/09/25 | [
"https://law.stackexchange.com/questions/84711",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/41960/"
] | A search warrant does not have to be served on a suspect
--------------------------------------------------------
A search warrant may be issued on probable cause that evidence of a crime will be found - there is no requirement that the person or place searched be suspected of involvement. For example, search warrants... | **Could law enforcement get a search warrant for this?**
**[england-and-wales](/questions/tagged/england-and-wales "show questions tagged 'england-and-wales'")**
**Yes**
The purpose of this type of search warrant is to locate evidence - regardless of whether or not, for example, the person possessing it or a residen... |
84,711 | I'm interested in the New York City jurisdiction.
Imagine a person is involved, or suspected to be involved, in a crime, yet they are not suspected of having committed any crime. For example, imagine a journalist that has been sent a letter from a serial killer that they wanted them to publish. I assume it would be na... | 2022/09/25 | [
"https://law.stackexchange.com/questions/84711",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/41960/"
] | Police can get a warrant, if the warrant is supported by "probable cause" to believe that evidence of a crime exists. A separate "probable cause" requirement is that to arrest a person, there must be "probable cause" that they committed a crime. However, the [Privacy Protection Act](https://www.law.cornell.edu/uscode/t... | See *Zurcher v. Stanford Daily*, [436 U.S. 547](https://supreme.justia.com/us/436/547/case.html) (1978) in which the United States Supreme Court held that (in summary):
>
> A State is not prevented by the Fourth and Fourteenth Amendments from issuing a warrant to search for evidence simply because the owner or posses... |
84,711 | I'm interested in the New York City jurisdiction.
Imagine a person is involved, or suspected to be involved, in a crime, yet they are not suspected of having committed any crime. For example, imagine a journalist that has been sent a letter from a serial killer that they wanted them to publish. I assume it would be na... | 2022/09/25 | [
"https://law.stackexchange.com/questions/84711",
"https://law.stackexchange.com",
"https://law.stackexchange.com/users/41960/"
] | Police can get a warrant, if the warrant is supported by "probable cause" to believe that evidence of a crime exists. A separate "probable cause" requirement is that to arrest a person, there must be "probable cause" that they committed a crime. However, the [Privacy Protection Act](https://www.law.cornell.edu/uscode/t... | **Could law enforcement get a search warrant for this?**
**[england-and-wales](/questions/tagged/england-and-wales "show questions tagged 'england-and-wales'")**
**Yes**
The purpose of this type of search warrant is to locate evidence - regardless of whether or not, for example, the person possessing it or a residen... |
63,592,787 | This is my code and i get a singleton error. I am trying to build a football database and in this function I try to update teams position based on the result of a match.
```py
@api.multi
@api.depends('gola_home', 'gola_away')
def perditeso_piket(self):
for record in self:
if record.gola... | 2020/08/26 | [
"https://Stackoverflow.com/questions/63592787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You **never check** `D:\AAA` itself.
Just make checking and deletion in the end:
```
function RemoveEmptyDirectory(path: string) : Boolean;
var
MySearch: TSearchRec;
Ended: Boolean;
begin
if FindFirst(path + '\*.*', faDirectory, MySearch) = 0 then
begin
repeat
if ((MySearch.Attr and faDirectory) = f... | You can use [`TDirectory`](http://docwiki.embarcadero.com/Libraries/Sydney/en/System.IOUtils.TDirectory) as
```
TDirectory.Delete('D:\AAA', True);
```
If you need to check if the directories are empty or not, you can use `TDirectory.GetDirectories()` as
```
Var
S: string;
begin
for S in TDirectory.GetDirectorie... |
63,592,787 | This is my code and i get a singleton error. I am trying to build a football database and in this function I try to update teams position based on the result of a match.
```py
@api.multi
@api.depends('gola_home', 'gola_away')
def perditeso_piket(self):
for record in self:
if record.gola... | 2020/08/26 | [
"https://Stackoverflow.com/questions/63592787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You **never check** `D:\AAA` itself.
Just make checking and deletion in the end:
```
function RemoveEmptyDirectory(path: string) : Boolean;
var
MySearch: TSearchRec;
Ended: Boolean;
begin
if FindFirst(path + '\*.*', faDirectory, MySearch) = 0 then
begin
repeat
if ((MySearch.Attr and faDirectory) = f... | I think this is simple and straightforward and should do fine if top performance is not crucial:
```
procedure RemoveEmptyDirs;
var
i,Removed:integer;
Arr:TStringDynArray;
const
TargedDir = 'C:\BunchOfDirs\';
begin
Arr := TDirectory.GetDirectories(TargedDir,'*',TSearchOption.soAllDirectories);
Repeat
Rem... |
63,592,787 | This is my code and i get a singleton error. I am trying to build a football database and in this function I try to update teams position based on the result of a match.
```py
@api.multi
@api.depends('gola_home', 'gola_away')
def perditeso_piket(self):
for record in self:
if record.gola... | 2020/08/26 | [
"https://Stackoverflow.com/questions/63592787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can use [`TDirectory`](http://docwiki.embarcadero.com/Libraries/Sydney/en/System.IOUtils.TDirectory) as
```
TDirectory.Delete('D:\AAA', True);
```
If you need to check if the directories are empty or not, you can use `TDirectory.GetDirectories()` as
```
Var
S: string;
begin
for S in TDirectory.GetDirectorie... | I think this is simple and straightforward and should do fine if top performance is not crucial:
```
procedure RemoveEmptyDirs;
var
i,Removed:integer;
Arr:TStringDynArray;
const
TargedDir = 'C:\BunchOfDirs\';
begin
Arr := TDirectory.GetDirectories(TargedDir,'*',TSearchOption.soAllDirectories);
Repeat
Rem... |
24,965 | What resources would you consider to be essential for an amateur astronomer? | 2011/06/01 | [
"https://physics.stackexchange.com/questions/24965",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | I have found two books particularly useful:
"NightWatch" by Terence Dickinson (Firefly)
The best starting place for a beginner.
"The Backyard Astronomer's Guide" by Terence Dickinson and Alan Dyer (Firefly)
More advanced and complete, with very little overlap with NightWatch. You need both!
An older book which is st... | I am a sub-amateur astronomer but here are my essentials:
* Decent binoculars
* A small, properly aligned spyscope on my telescope
* An [almanac](http://www.pierpaoloricci.it/download/almanacco2011_eng.htm) so I know the where and when of transits, eclipses, planet rises and satellites
* A torch shielded with red cell... |
24,965 | What resources would you consider to be essential for an amateur astronomer? | 2011/06/01 | [
"https://physics.stackexchange.com/questions/24965",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | Several online communities:
* **[CloudyNights](http://www.cloudynights.com/)** - Reviews, articles, and a huge and active forum of amateur backyard astronomers. Amateur telescope making, classic telescope restoration, astrophotography, new equipment discussion, etc.
* **[Astromart](http://www.astromart.com/)** - The q... | I am a sub-amateur astronomer but here are my essentials:
* Decent binoculars
* A small, properly aligned spyscope on my telescope
* An [almanac](http://www.pierpaoloricci.it/download/almanacco2011_eng.htm) so I know the where and when of transits, eclipses, planet rises and satellites
* A torch shielded with red cell... |
2,638,529 | How can I calculate the compound angle when I know two of the angles but don't know what the angle would be where the two intersect?
[](https://i.stack.imgur.com/QgkFG.png)
If "A" and "C" are sitting on a 9.16 degree angle and the are coming together... | 2018/02/06 | [
"https://math.stackexchange.com/questions/2638529",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/32167/"
] | One method would be to construct vectors $n\_A$ and $n\_C$
perpendicular to the two
surfaces $A$ and $C,$ then use the formula
$$
n\_A \cdot n\_C = \|n\_A\| \|n\_C\| \cos \theta\_{AC}.
$$
Solve this for $\theta\_{AC},$ the angle between the surfaces.
This formula works reasonably well in the given example since the a... | If we choose axis $x$ along the separation line between $A$ and $B$, axis $y$ along the separation line between $C$ and $D$, axis $z$ perpendicular to plane $BD$, then it is not difficult to find two unit vectors normal to $A$ and $C$, both directed "inwards":
$$
n\_A=(0,\sin\theta,-\cos\theta),
\quad
n\_C=(\sin\theta,... |
7,204,100 | We are about to build a new company Android app and would like to code using HTML5, CSS3 and Jquery and then compile with PhoneGap. We want to do it this was as we already have strong skill-sets available in these areas.
I wonder if anyone could advise whether this would cause any issues in getting our App listed in t... | 2011/08/26 | [
"https://Stackoverflow.com/questions/7204100",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/385563/"
] | PhoneGap, as I understand it, will not compile the HTML5 code, it will put it inside a nice box.
This is practical because it allows you to use your existing skillset, but it has the inconvenient your still working with a web application, even though you slightly increase your abilities by accessing the native API th... | Android Market will not give you any issue at all. There are, however, downsides and trade-offs.
There is a pretty good comparison chart here: <https://spreadsheets.google.com/pub?key=0AsTInFQpmXDNdEdJU0ZNNGx3dDA3aXAxV3lXYWhXVHc>
My understanding is that the HTML/Javascript/CSS isn't compiled into native code (like T... |
64,461,858 | I am new to openbmc and trying to understand the basic details.
As I am checking docs, I found two docs, REST-cheatsheet.md & REDFISH-cheatsheet.md
They both are using the curl to get and set the entries in openbmc.
But, the path used is different.
REST-cheetsheet.md uses, xyz/openbmc\_project as path but REDFISH-chea... | 2020/10/21 | [
"https://Stackoverflow.com/questions/64461858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9098606/"
] | When OpenBMC first started, Redfish had fairly minimal industry buy-in so OpenBMC made a dection to make a custom REST API to manage itself. This is the "REST-cheatsheet". After a few years, Redfish via the DMTF began to mature and get a lot more industry buy-in. The decision was made within the OpenBMC community to de... | **Redfish** is defined and secure.
The REST API is deprecated, mostly; just go with the future and that is **Redfish**. |
24,513,740 | I have a PHP file that creates a randomized string stored in a variable. I want to access this variable with JavaScript but the methods I've found online doesn't seem to be working. This is the code I have so far:
```
var test = "<?php echo json_encode($myVariable); ?>";
alert(test);
```
$myVariable is just a string... | 2014/07/01 | [
"https://Stackoverflow.com/questions/24513740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3737945/"
] | you can transfer variable contents by this
```
var test = "<?php echo $myVariable; ?>";
alert(test);
``` | `json_encode` produces output ready for javascript, you must not put it into quotes:
```
var test = <?php echo json_encode($myVariable); ?>;
``` |
24,513,740 | I have a PHP file that creates a randomized string stored in a variable. I want to access this variable with JavaScript but the methods I've found online doesn't seem to be working. This is the code I have so far:
```
var test = "<?php echo json_encode($myVariable); ?>";
alert(test);
```
$myVariable is just a string... | 2014/07/01 | [
"https://Stackoverflow.com/questions/24513740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3737945/"
] | There are few way of accessing variables from php with javascript AJAX/Cookies/\_SESSION or echo directly to javascript.
**AJAX**
Is more readable with better separations between layers it also allows for async transfer. BUT it can be very slow adding HTTPrequest can lead the website to slow down alot if there is alo... | `json_encode` produces output ready for javascript, you must not put it into quotes:
```
var test = <?php echo json_encode($myVariable); ?>;
``` |
24,513,740 | I have a PHP file that creates a randomized string stored in a variable. I want to access this variable with JavaScript but the methods I've found online doesn't seem to be working. This is the code I have so far:
```
var test = "<?php echo json_encode($myVariable); ?>";
alert(test);
```
$myVariable is just a string... | 2014/07/01 | [
"https://Stackoverflow.com/questions/24513740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3737945/"
] | you can transfer variable contents by this
```
var test = "<?php echo $myVariable; ?>";
alert(test);
``` | Try it the other way around ...
```
<?php echo "var test = '" . json_encode($myVariable) . "';"; ?>
``` |
24,513,740 | I have a PHP file that creates a randomized string stored in a variable. I want to access this variable with JavaScript but the methods I've found online doesn't seem to be working. This is the code I have so far:
```
var test = "<?php echo json_encode($myVariable); ?>";
alert(test);
```
$myVariable is just a string... | 2014/07/01 | [
"https://Stackoverflow.com/questions/24513740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3737945/"
] | There are few way of accessing variables from php with javascript AJAX/Cookies/\_SESSION or echo directly to javascript.
**AJAX**
Is more readable with better separations between layers it also allows for async transfer. BUT it can be very slow adding HTTPrequest can lead the website to slow down alot if there is alo... | Try it the other way around ...
```
<?php echo "var test = '" . json_encode($myVariable) . "';"; ?>
``` |
46,140,506 | This is probably a beginner question but I'm really pulling my hair out.
I have a very simple Python script "foo":
```
#!/usr/bin/env python
class Foo():
def __init__(self):
self.do_something()
def do_something(self):
print "foo"
def main():
Foo()
if __name__ == '__main__':
main()
```
Script wor... | 2017/09/10 | [
"https://Stackoverflow.com/questions/46140506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3787051/"
] | You shouldn't use the same file name (foo.py) in your module. Change your test module to test\_foo instead. *Explicit is better than implicit.*
When importing a module from a parent directory, you need to use `from <parent_dir> import <module_name>`, so in your case you should state `from <parent_dir> import foo`
You... | Python tests can be disturbing especially with relative imports.
So I got a work around.
First and Foremost: I suggest you install **pytest** which resolves the name in the sys.path that the test module is contained.. Install it by running `pip install pytest`.
For the relative import, you are trying to access the mo... |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | there are [free trial](http://www.rapidssl.com/index_ssl.htm) [ 30 days ] certs - it's very handy for testing.
but for production use - i suggest use buy something. cheapest i've bought were from [namecheap](http://www.namecheap.com/) - 10usd/year. | GoDaddy has cheap SSL certificates.
<http://www.godaddy.com/Compare/gdcompare_ssl.aspx?isc=sslqgo002a> |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | Have a look at Startcom. Free and the root is in most major browser/os's but there are some caveats such as having to re-register/renew every few months.
Tbh whilst I take the point about cost being an issue, for $10 just get a rapidssl from namecheap.com - job done. | Arstechnica had a nice little article on
How to obtain and install an SSL/TLS certificate, for free
<http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars> |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | Arstechnica had a nice little article on
How to obtain and install an SSL/TLS certificate, for free
<http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars> | GoDaddy has cheap SSL certificates.
<http://www.godaddy.com/Compare/gdcompare_ssl.aspx?isc=sslqgo002a> |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | Namecheap.com was our initial low cost SSL supplier (US$ 10/year). Now bought a PositiveSSL cert from <https://comodosslstore.com/> at US$ 6.50/year when buying for 5 years. The 5 years is beneficial to us. Now we only need to execute the renew process once every five years. Note: the optional free upgrade to EV is a s... | GoDaddy has cheap SSL certificates.
<http://www.godaddy.com/Compare/gdcompare_ssl.aspx?isc=sslqgo002a> |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | Namecheap.com was our initial low cost SSL supplier (US$ 10/year). Now bought a PositiveSSL cert from <https://comodosslstore.com/> at US$ 6.50/year when buying for 5 years. The 5 years is beneficial to us. Now we only need to execute the renew process once every five years. Note: the optional free upgrade to EV is a s... | Arstechnica had a nice little article on
How to obtain and install an SSL/TLS certificate, for free
<http://arstechnica.com/security/news/2009/12/how-to-get-set-with-a-secure-sertificate-for-free.ars> |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | Namecheap.com was our initial low cost SSL supplier (US$ 10/year). Now bought a PositiveSSL cert from <https://comodosslstore.com/> at US$ 6.50/year when buying for 5 years. The 5 years is beneficial to us. Now we only need to execute the renew process once every five years. Note: the optional free upgrade to EV is a s... | there are [free trial](http://www.rapidssl.com/index_ssl.htm) [ 30 days ] certs - it's very handy for testing.
but for production use - i suggest use buy something. cheapest i've bought were from [namecheap](http://www.namecheap.com/) - 10usd/year. |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | Have a look at Startcom. Free and the root is in most major browser/os's but there are some caveats such as having to re-register/renew every few months.
Tbh whilst I take the point about cost being an issue, for $10 just get a rapidssl from namecheap.com - job done. | GoDaddy has cheap SSL certificates.
<http://www.godaddy.com/Compare/gdcompare_ssl.aspx?isc=sslqgo002a> |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | Namecheap.com was our initial low cost SSL supplier (US$ 10/year). Now bought a PositiveSSL cert from <https://comodosslstore.com/> at US$ 6.50/year when buying for 5 years. The 5 years is beneficial to us. Now we only need to execute the renew process once every five years. Note: the optional free upgrade to EV is a s... | You should look at :
<http://www.cacert.org/>
It's Free and well recognized by Unix OS. I think it's what you are looking for. |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | I've bought mine from [www.cheapssls.com](http://www.cheapssls.com/) - $US10/year | GoDaddy has cheap SSL certificates.
<http://www.godaddy.com/Compare/gdcompare_ssl.aspx?isc=sslqgo002a> |
101,716 | Is it possible to get a trusted signed ssl certificate for free?
I could create a self signed one using iis7 for example but these normally require the user to accept them as compared to one from a trusted source.
Therefore, is there a very inexpensive way to get one (free?) as cost is definitely an issue. | 2010/01/11 | [
"https://serverfault.com/questions/101716",
"https://serverfault.com",
"https://serverfault.com/users/26561/"
] | Have a look at Startcom. Free and the root is in most major browser/os's but there are some caveats such as having to re-register/renew every few months.
Tbh whilst I take the point about cost being an issue, for $10 just get a rapidssl from namecheap.com - job done. | there are [free trial](http://www.rapidssl.com/index_ssl.htm) [ 30 days ] certs - it's very handy for testing.
but for production use - i suggest use buy something. cheapest i've bought were from [namecheap](http://www.namecheap.com/) - 10usd/year. |
42,247,096 | I have an ASP.Core project (Visual studio 2015) and I installed bootstrap to it by 'Manage Bower packages'
[](https://i.stack.imgur.com/RZQVV.png)
I see package in the project dependencies
[ and I installed bootstrap to it by 'Manage Bower packages'
[](https://i.stack.imgur.com/RZQVV.png)
I see package in the project dependencies
[
* Choose Bower
* Type in Package Name e.g Bootstrap
* Choose the Version and click Install
* Create in root of solution two files
*... |
6,853,419 | each cell in my table has a label, with maximum three lines, so the cell height depends on the label's height, I know the delegate method that returns height for a specific cell(NSIndexPath), but I need to get the actual cell in order to determine the height, and if I call cellForRow:atIndexPath: in heightForCell:, it ... | 2011/07/28 | [
"https://Stackoverflow.com/questions/6853419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/734036/"
] | Google Maps have 22 zoom levels, with 0 being the entire world.
1. Determine the size you want the map to be. (I often use 500 x 500 in my designs, but it all depends on the site)
2. Set your zoom level to anything other than 0. (if it's a section of a city, 12-14 is often good.)
In this way, the only way tiles will... | It depends on your zoom level, not the map size. You can easily have a 100% width and height map without any repeating tiles. |
3,713,221 | I need some code which can be used outside of the mk\* functions. I need to run my custom function to bring the FIRST and LAST markers in an array to the front. (so on top of all the other markers on my screen). I have tried
```
[self.view bringSubviewToFront:[[mapView annotations]objectAtIndex: 0]];
```
I have used... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3713221",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/235267/"
] | You're bringing the wrong things to the front. Namely, the `annotations` array is an array of objects that conform to the `MKAnnotation` protocol (so of type `id<MKAnnotation>`), and they are not views.
Instead, you should be getting the view for the annotations you want, and bring those to the front:
```
id<MKAnnota... | This worked much better for me:
setup annotation view layer's zPosition (annotationView.layer.zPosition) in:
```
- (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation
{
// if it's the user location, just return nil.
if ([annotation isKindOfClass:[MKUserLocation ... |
3,713,221 | I need some code which can be used outside of the mk\* functions. I need to run my custom function to bring the FIRST and LAST markers in an array to the front. (so on top of all the other markers on my screen). I have tried
```
[self.view bringSubviewToFront:[[mapView annotations]objectAtIndex: 0]];
```
I have used... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3713221",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/235267/"
] | You're bringing the wrong things to the front. Namely, the `annotations` array is an array of objects that conform to the `MKAnnotation` protocol (so of type `id<MKAnnotation>`), and they are not views.
Instead, you should be getting the view for the annotations you want, and bring those to the front:
```
id<MKAnnota... | ```
For IOS 11.0 onwards use below solution to bring the Custom Callout above all annotations.
Add z position observer where you are initialising the Custom callout
[self.layer addObserver:self forKeyPath:@"zPosition" options:0 context:nil];
-(void)observeValueForKeyPath:(NSString *)keyPath
of... |
3,713,221 | I need some code which can be used outside of the mk\* functions. I need to run my custom function to bring the FIRST and LAST markers in an array to the front. (so on top of all the other markers on my screen). I have tried
```
[self.view bringSubviewToFront:[[mapView annotations]objectAtIndex: 0]];
```
I have used... | 2010/09/14 | [
"https://Stackoverflow.com/questions/3713221",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/235267/"
] | This worked much better for me:
setup annotation view layer's zPosition (annotationView.layer.zPosition) in:
```
- (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id <MKAnnotation>)annotation
{
// if it's the user location, just return nil.
if ([annotation isKindOfClass:[MKUserLocation ... | ```
For IOS 11.0 onwards use below solution to bring the Custom Callout above all annotations.
Add z position observer where you are initialising the Custom callout
[self.layer addObserver:self forKeyPath:@"zPosition" options:0 context:nil];
-(void)observeValueForKeyPath:(NSString *)keyPath
of... |
12,992,677 | I have a dropdown that allows users to choose certain options. After which it calls a php script for processing. The problem I have is that if I choose only one option, everything works fine, but when I choose more then one option, it doesn't work.
HTML:
```
<select name="select[]" id="the_select">
<option></option>
... | 2012/10/20 | [
"https://Stackoverflow.com/questions/12992677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701398/"
] | Use `serialize()` method to serialize the whole form with one function and let jQuery do the array management and heavy lifting of encoding variables
```
var ajaxData=$('#myForm').serialize()
$.post( url, ajaxData, function(){
/* ajax success code*/
})
```
API refrence: <http://api.jquery.com/serialize/> | Does each element have a unique id=""? If not, this is likely the reason it's not working. Alternatively, you could use class="the\_select", because classes do not need to be unique. The jQuery would need to change to:
```
var form_data = {
select : $(".the_select").val()
};
``` |
12,992,677 | I have a dropdown that allows users to choose certain options. After which it calls a php script for processing. The problem I have is that if I choose only one option, everything works fine, but when I choose more then one option, it doesn't work.
HTML:
```
<select name="select[]" id="the_select">
<option></option>
... | 2012/10/20 | [
"https://Stackoverflow.com/questions/12992677",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1701398/"
] | Use `serialize()` method to serialize the whole form with one function and let jQuery do the array management and heavy lifting of encoding variables
```
var ajaxData=$('#myForm').serialize()
$.post( url, ajaxData, function(){
/* ajax success code*/
})
```
API refrence: <http://api.jquery.com/serialize/> | If you need a multi select make sure you include the multiple attribute:
```
<select name="select[]" id="the_select" multiple>
<option></option>
</select>
```
If you are using more than one select and your are trying to get all of their values, then you will need to select each one individually like so:
```
$('sele... |
28,608,788 | I have a simple test app that connects to a SQL DB and then execute a query in LINQ
When the command is executed I can see when the connection is opened.
But when I issue the
```
db.Connection.Close();
db.Dispose();
```
The connection in SQL is still there until I shut down the app.
I am the only user on the sy... | 2015/02/19 | [
"https://Stackoverflow.com/questions/28608788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/478296/"
] | Are you using connection pooling? This may return the connection back to the pool rather than closing it outright.
Here's a link describing pooling: <https://msdn.microsoft.com/en-us/library/8xx3tyca%28v=vs.110%29.aspx>
From MSDN (link above): "*When the application calls Close on the connection, the pooler returns ... | "The connection in SQL is still there" - you should give more information about this means. I am going to assume that you are monitoring connections from DBMS side.
With connection pooling enabled (which is default behaviour for `SqlClient.SqlConnection`), closing an `SqlConnection` instance does not immediately close... |
28,772,006 | I am looking for a method to restart/reset my linux system from within an init-bottom script\*. At the time my script is executed the system is found under /root and I have access to a busybox.
But the "reboot" command which is part of my busybox does not work. Is there any other possibility?
---
My system is booted... | 2015/02/27 | [
"https://Stackoverflow.com/questions/28772006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2715068/"
] | I have found this:
`echo b >/proc/sysrq-trigger`
(it's like pressing CTRL+ALT+DEL) | If you -are- init (the PID of your process/script is 0), then starting the busybox reboot program won't work since it tries to signal init (which is not started) to reboot.
Instead, as PID 0, you should do what init would do. This is call the correct kernel API for the reboot. See [Man reboot(2)](http://man7.org/linux... |
275,224 | [](https://i.stack.imgur.com/iNkFl.png)
please advise what do i need to change so i can see my full menu bar. is this a bug? or is it my laptop settings? i have already tried maximizing and minimizing the dialogue box but i still cannot find the menu optio... | 2022/09/23 | [
"https://blender.stackexchange.com/questions/275224",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/155107/"
] | Assuming that you actually have the 4 vectors in your diagram:
* V0 - (x0, y0, z0) being the new pivot/world center of your matrix.
* V1 - (x1, y1, z1) being the X axis.
* V2 - (x2, y2, z2) being the Y axis.
* V3 - (x3, y3, z3) being the Z axis.
And that **they're all in the parents space of the given vector**, your ... | Here's what worked for me:
```
# First create the matrix having Z axis aligned to V3
rotmat = V3.to_track_quat().to_matrix()
# Find the rotation diff of X axis of this and V1 (the new X axis)
matX = rotmat @ Vector((1, 0, 0))
rotDiff = matX.rotation_difference(V1)
# rotate the matrix with this difference
rotmat = ro... |
530,504 | I intend to make a circuit which controls a floppy disk drive. I am using the [WD35C65B](http://www.bitsavers.org/components/westernDigital/_dataBooks/1991_SystemLogic_Imaging_Storage/31_WD37C65C.pdf) chip as controller and a PIC32MX250F256 as microcontroller. I have already figured out most of the stuff. My questions ... | 2020/11/03 | [
"https://electronics.stackexchange.com/questions/530504",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/245589/"
] | In fact the voltage at the drain of the MOSFET will begin to "ring" at the resonant frequency of the capacitance and the inductance. The capacitance comes from the MOSFET drain capacitance in parallel with the distributed capacitance of the coil.
The peak will be higher if the capacitance is lower, the on time is very... | "Bigger" depends on how to define this.
Voltage peak, V x t ,[volt-seconds], or power = V²/R = V²(f,t) / (real{Z(f,t)})
There are a few basic rules to electronics.
-------------------------------------------
* All insulators = dielectrics
* this includes the interwinding capacitance of large inductors and the dilect... |
9,600,499 | I got a calendar which I want to take birthday of user. Its `id` is "DatePicker"
```
var tarih = new Date();
tarih =($("#DatePicker").val());
alert(tarih);
```
When I run this code I get the date from calendar. The problem occurs when I try to get year which is selected at calendar:
```
var tarih = new Date();
tar... | 2012/03/07 | [
"https://Stackoverflow.com/questions/9600499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1193477/"
] | You can specify User Settings to store some information. In the Solution Explorer go to your project and in the folder Properties, double-click the settings-file. In here you can set the Name, Type, Scope and Value. Just set the Name to "FileName", Type to "string", scope to "User" and leave the Value empty or set a de... | I think you can use ont of this .NET features:
* [User Settings](http://msdn.microsoft.com/en-us/library/aa730869%28v=vs.80%29.aspx)
* [Application Settings](http://msdn.microsoft.com/en-us/library/aa730869%28v=vs.80%29.aspx)
They save settings with different scope. I guess you can use application settings. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.