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 |
|---|---|---|---|---|---|
66,909,492 | ```
trv_last = []
for i in range(0,len(trv)):
if (trv_name_split.iloc[i,3] != None):
trv_last = trv_name_split.iloc[i,3]
elif (trv_name_split.iloc[i,2] != None):
trv_last = trv_name_split.iloc[i,2]
else:
trv_last = trv_name_split.iloc[i,1]
trv_last
```
This returns 'Campo' which ... | 2021/04/01 | [
"https://Stackoverflow.com/questions/66909492",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12270675/"
] | You just need a simple left-outer join,
```
Select t1.TaxCode, sum(coalesce(Payment,0)) Payment
from Table1 t1
left join Table2 t2 on t2.Taxcode=t1.Taxcode
group by t1.Taxcode
``` | ```
Select t1.TaxCode,t1.FillingCode, sum(nvl(Payment,0)) as Payment
from Table1 t1
left outer join Table2 t2 on t1.Taxcode=t2.Taxcode
group by t1.Taxcode,t1.FillingCode;
``` |
66,909,492 | ```
trv_last = []
for i in range(0,len(trv)):
if (trv_name_split.iloc[i,3] != None):
trv_last = trv_name_split.iloc[i,3]
elif (trv_name_split.iloc[i,2] != None):
trv_last = trv_name_split.iloc[i,2]
else:
trv_last = trv_name_split.iloc[i,1]
trv_last
```
This returns 'Campo' which ... | 2021/04/01 | [
"https://Stackoverflow.com/questions/66909492",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12270675/"
] | You just need a simple left-outer join,
```
Select t1.TaxCode, sum(coalesce(Payment,0)) Payment
from Table1 t1
left join Table2 t2 on t2.Taxcode=t1.Taxcode
group by t1.Taxcode
``` | For anyone looking for a solution to something like this, my query that worked is below
```
SELECT
T.TRAN_CODE,
SUM(ISNULL(TF.PAYMENT, 0)) AS PrePayment
FROM
Tranctl AS T
LEFT OUTER JOIN (
SELECT
T.TRAN_CODE,
0 AS PAYMENT
FROM
Tranctl A... |
34,089,354 | <http://mymagentohost.com/index.php/rest/V1/products/(productID)/media>
This url is used to get the media for a particular product.
The response does not have the full image URL.
Response:
```
{
"id": 14,
"media_type": "image",
"label": "",
"position": 1,
"disabled": false,
"types": [
... | 2015/12/04 | [
"https://Stackoverflow.com/questions/34089354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1364053/"
] | You should use the `u` modifier for regular expressions to set the engine into unicode mode:
```
<?php
$subject = "Onun äöüß Mesajı";
$pattern = '/\w+\s*?$/u';
echo preg_replace($pattern, '<span>\\0</span>', $subject);
```
The output is:
```
Onun äöüß <span>Mesajı</span>
``` | This regex will do the trick for you, and is a lot shorter then the other solutions:
```
[ ](.*?$)
```
Here is an example of it:
```
$string = "Onun Mes*ÇŞĞÜÖİçşğüöıajı";
echo preg_replace('~[ ](.*?$)~', ' <span>' .'${1}'. '</span>', $string);
```
Will echo out:
```
Onun <span>Mes*ÇŞĞÜÖİçşğüöıajı</span>
`... |
34,089,354 | <http://mymagentohost.com/index.php/rest/V1/products/(productID)/media>
This url is used to get the media for a particular product.
The response does not have the full image URL.
Response:
```
{
"id": 14,
"media_type": "image",
"label": "",
"position": 1,
"disabled": false,
"types": [
... | 2015/12/04 | [
"https://Stackoverflow.com/questions/34089354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1364053/"
] | You need to use `/u` modifier to allow processing Unicode characters in the pattern and input string.
```
preg_replace('~\w+\s*$~u', '<span>$0</span>', $string);
^
```
[Full PHP demo](http://ideone.com/F0dmM6):
```
$string = "Onun Mesajı";
echo preg_replace("~\w+\s*$~u", '<span>$0</span>', $... | This regex will do the trick for you, and is a lot shorter then the other solutions:
```
[ ](.*?$)
```
Here is an example of it:
```
$string = "Onun Mes*ÇŞĞÜÖİçşğüöıajı";
echo preg_replace('~[ ](.*?$)~', ' <span>' .'${1}'. '</span>', $string);
```
Will echo out:
```
Onun <span>Mes*ÇŞĞÜÖİçşğüöıajı</span>
`... |
34,089,354 | <http://mymagentohost.com/index.php/rest/V1/products/(productID)/media>
This url is used to get the media for a particular product.
The response does not have the full image URL.
Response:
```
{
"id": 14,
"media_type": "image",
"label": "",
"position": 1,
"disabled": false,
"types": [
... | 2015/12/04 | [
"https://Stackoverflow.com/questions/34089354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1364053/"
] | You need to use `/u` modifier to allow processing Unicode characters in the pattern and input string.
```
preg_replace('~\w+\s*$~u', '<span>$0</span>', $string);
^
```
[Full PHP demo](http://ideone.com/F0dmM6):
```
$string = "Onun Mesajı";
echo preg_replace("~\w+\s*$~u", '<span>$0</span>', $... | You should use the `u` modifier for regular expressions to set the engine into unicode mode:
```
<?php
$subject = "Onun äöüß Mesajı";
$pattern = '/\w+\s*?$/u';
echo preg_replace($pattern, '<span>\\0</span>', $subject);
```
The output is:
```
Onun äöüß <span>Mesajı</span>
``` |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | I think that you want all words, not characters.
```
result = re.findall(r"(?i)\b[a-z]+\b", subject)
```
**Explanation:**
```
"
\b # Assert position at a word boundary
[a-z] # Match a single character in the range between “a” and “z”
+ # Between one and unlimited times, as many times as possible,... | Or if you want all characters regardless of words or empty spaces
```
a = "Some57 996S/tr::--!!ing"
q = ""
for i in a:
if i.isalpha():
q = "".join([q,i])
```
print q
'SomeString' |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | I think that you want all words, not characters.
```
result = re.findall(r"(?i)\b[a-z]+\b", subject)
```
**Explanation:**
```
"
\b # Assert position at a word boundary
[a-z] # Match a single character in the range between “a” and “z”
+ # Between one and unlimited times, as many times as possible,... | What about doing this?
```
>>> import ast
>>> " ".join([k[0] for k in ast.literal_eval("{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}").keys()])
'case mini year money ipod players'
``` |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | What about doing this?
```
>>> import ast
>>> " ".join([k[0] for k in ast.literal_eval("{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}").keys()])
'case mini year money ipod players'
``` | Or if you want all characters regardless of words or empty spaces
```
a = "Some57 996S/tr::--!!ing"
q = ""
for i in a:
if i.isalpha():
q = "".join([q,i])
```
print q
'SomeString' |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | You could do it with re, but the string split method doesnt take a regex, it takes a string.
Heres one way to do it with re:
```
import re
word1 = " ".join(re.findall("[a-zA-Z]+", st))
``` | You can take the approach of iterating through the string, and using the `isalpha` function to determine if it's a alpha character or not. If it is you can append it to the output string.
```py
a = "Some57 996S/tr::--!!ing"
q = ""
for i in a:
if i.isalpha():
q = "".join([q,i])
``` |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | string.split() doesn't take regular expressions.
You want something like:
```
re.split("[^a-zA-Z]*", "your string")
```
and to get a string:
```
" ".join(re.split("[^a-zA-Z]*", "your string"))
``` | Or if you want all characters regardless of words or empty spaces
```
a = "Some57 996S/tr::--!!ing"
q = ""
for i in a:
if i.isalpha():
q = "".join([q,i])
```
print q
'SomeString' |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | You could do it with re, but the string split method doesnt take a regex, it takes a string.
Heres one way to do it with re:
```
import re
word1 = " ".join(re.findall("[a-zA-Z]+", st))
``` | string.split() doesn't take regular expressions.
You want something like:
```
re.split("[^a-zA-Z]*", "your string")
```
and to get a string:
```
" ".join(re.split("[^a-zA-Z]*", "your string"))
``` |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | string.split() doesn't take regular expressions.
You want something like:
```
re.split("[^a-zA-Z]*", "your string")
```
and to get a string:
```
" ".join(re.split("[^a-zA-Z]*", "your string"))
``` | What about doing this?
```
>>> import ast
>>> " ".join([k[0] for k in ast.literal_eval("{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}").keys()])
'case mini year money ipod players'
``` |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | I think that you want all words, not characters.
```
result = re.findall(r"(?i)\b[a-z]+\b", subject)
```
**Explanation:**
```
"
\b # Assert position at a word boundary
[a-z] # Match a single character in the range between “a” and “z”
+ # Between one and unlimited times, as many times as possible,... | ```
import re
string = ''.join([i for i in re.findall('[\w +/.]', string) if i.isalpha()])
#'[\w +/.]' -> it will give characters numbers and punctuation, then 'if i.isalpha()' this condition will only get alphabets out of it and then join list to get expected result.
# It will remove spaces also.
``` |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | Or if you want all characters regardless of words or empty spaces
```
a = "Some57 996S/tr::--!!ing"
q = ""
for i in a:
if i.isalpha():
q = "".join([q,i])
```
print q
'SomeString' | ```
import re
string = ''.join([i for i in re.findall('[\w +/.]', string) if i.isalpha()])
#'[\w +/.]' -> it will give characters numbers and punctuation, then 'if i.isalpha()' this condition will only get alphabets out of it and then join list to get expected result.
# It will remove spaces also.
``` |
8,199,398 | In Python, I want to extract only the characters from a string.
Consider I have the following string,
```
input = "{('players',): 24, ('year',): 28, ('money',): 19, ('ipod',): 36, ('case',): 23, ('mini',): 46}"
```
I want the result as,
```
output = "players year money ipod case mini"
```
I tried to split con... | 2011/11/20 | [
"https://Stackoverflow.com/questions/8199398",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/73137/"
] | You could do it with re, but the string split method doesnt take a regex, it takes a string.
Heres one way to do it with re:
```
import re
word1 = " ".join(re.findall("[a-zA-Z]+", st))
``` | ```
import re
string = ''.join([i for i in re.findall('[\w +/.]', string) if i.isalpha()])
#'[\w +/.]' -> it will give characters numbers and punctuation, then 'if i.isalpha()' this condition will only get alphabets out of it and then join list to get expected result.
# It will remove spaces also.
``` |
65,206,214 | The thing is I need to pass a random variable to optional parameter. Anyone? :)
Something like this:
```
static void Creature(string optionalParam = randomVariable) {}
``` | 2020/12/08 | [
"https://Stackoverflow.com/questions/65206214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13477903/"
] | Optional parameters are compile time constants, so you can't have a random (runtime generated) value as an optional parameter value.
What you could do, as @madreflection eludes to, is create 2 overloaded methods: one that will accept the randomValue you pass it and second one without that parameter that generates a Ra... | You can do the below with [optional] keyword.
by default optionalParam value will be Null if you do not pass anything else it will hold the passing value.
I hope it will clear about optional parameter.
Reference: <https://www.geeksforgeeks.org/different-ways-to-make-method-parameter-optional-in-c-sharp/> |
65,206,214 | The thing is I need to pass a random variable to optional parameter. Anyone? :)
Something like this:
```
static void Creature(string optionalParam = randomVariable) {}
``` | 2020/12/08 | [
"https://Stackoverflow.com/questions/65206214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13477903/"
] | You can only do this with overloads
```
class Foo
{
static Random rng = new Random();
static string RandomString()=> $"A{rng.Next(0,1000)}";
static void Creature() => Creature(RandomString())
static void Creature(string argument) {}
}
``` | You can do the below with [optional] keyword.
by default optionalParam value will be Null if you do not pass anything else it will hold the passing value.
I hope it will clear about optional parameter.
Reference: <https://www.geeksforgeeks.org/different-ways-to-make-method-parameter-optional-in-c-sharp/> |
9,131,408 | The code below has alot of outputting strings at the end i try to push the back onto avector and the append it to a string so then i can return it, but it only gets the last string which is outputted i need to get all of them.
What am i doign wrong so that i can push back all the strings
```
DCS_LOG_DEBUG("----------... | 2012/02/03 | [
"https://Stackoverflow.com/questions/9131408",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1037361/"
] | Assigning more than once to `a` will *replace*, not concatenate. What you are looking for, is more likely *output streaming* (or output iterators).
Propose to simplify:
```
DCS_LOG_DEBUG("--------------- Validating .X/ ---------------")
std::string str = el[i].substr(3);
std::vector<std::string> st;
split(st,str,boos... | Are you sure that the result you are getting is not just the first string?
That said, it is not entirely clear what you are trying to do, but assuming that there is some looping code above what you posted it seems that your problem is with the positioning of the for loop.
```
while( i < el.size() ) //Assu... |
43,106,735 | I had a working app that uses Dexie. After upgrading to iOS 10.3, lookups by key are not working. (This is actually an indexeddb problem, not Dexie per se, I'm sure.) I'm still in shock but I have been able to confirm that the data is there by doing db.table.each(function(p) {}, and the fields used in keys are there an... | 2017/03/30 | [
"https://Stackoverflow.com/questions/43106735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7536385/"
] | This seems to be an upgrade bug in Safari and should really be filed on bugs.webkit.org. Assume this is something that will be fixed there as the Safari team is very responsive when it comes to critical bugs. Please file it!
As for a workaround, I would suggest to recreate the database. Copy the database to a new data... | I ran into the same issue, using the [db.js](https://aaronpowell.github.io/db.js/) library. All of my app data is wiped on upgrade.
Based on my tests, it looks like the 10.2 -> 10.3 upgrade is wiping any data in tables that have autoIncrement set to false. Data saved in autoIncrement=true tables is still accessible af... |
28,726 | I recently submitted an abstract to a talk as a contributed paper. I was informed, through email, that the paper was scheduled to be presented *in person* on XXX date. The email also said that I could look for my name on a link mentioned in the email; going to the link, I found that my name was not on the list at all. ... | 2014/09/19 | [
"https://academia.stackexchange.com/questions/28726",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/-1/"
] | I do not think this usual. How big is the conference? If it is small, it is possible that the organizers made a mistake without realizing it. Inquiring over the email was absolutely the right thing to do. I would follow up a week from your original inquiry if you don't hear back from them sooner. | You should definitely call the Conference organizing committee three days after sending an e-mail. They have to clarify this situation.
Be sure to have the e-mail in front of you when calling.
Your message could be lost in tons of those other complain emails from other members.
I have organized a few congresses m... |
28,726 | I recently submitted an abstract to a talk as a contributed paper. I was informed, through email, that the paper was scheduled to be presented *in person* on XXX date. The email also said that I could look for my name on a link mentioned in the email; going to the link, I found that my name was not on the list at all. ... | 2014/09/19 | [
"https://academia.stackexchange.com/questions/28726",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/-1/"
] | I do not think this usual. How big is the conference? If it is small, it is possible that the organizers made a mistake without realizing it. Inquiring over the email was absolutely the right thing to do. I would follow up a week from your original inquiry if you don't hear back from them sooner. | Don't run! Walk!
----------------
Keep in mind that organizing conferences usually involves a huge amount of work including organizing the received abstracts and papers, managing their reviewers, managing the conference place and preparing packages, etc. They have to solve your problem but don't expect them to answer ... |
28,726 | I recently submitted an abstract to a talk as a contributed paper. I was informed, through email, that the paper was scheduled to be presented *in person* on XXX date. The email also said that I could look for my name on a link mentioned in the email; going to the link, I found that my name was not on the list at all. ... | 2014/09/19 | [
"https://academia.stackexchange.com/questions/28726",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/-1/"
] | Now that you've identified the conference as the AMS Western Section meeting in San Francisco, I looked at [the conference's program web site](http://www.ams.org/meetings/sectional/2214_progfull.html) and your talk is definitely listed. It's in the Session for Contributed Papers I, Saturday October 25 at 10:30 AM in Th... | I do not think this usual. How big is the conference? If it is small, it is possible that the organizers made a mistake without realizing it. Inquiring over the email was absolutely the right thing to do. I would follow up a week from your original inquiry if you don't hear back from them sooner. |
28,726 | I recently submitted an abstract to a talk as a contributed paper. I was informed, through email, that the paper was scheduled to be presented *in person* on XXX date. The email also said that I could look for my name on a link mentioned in the email; going to the link, I found that my name was not on the list at all. ... | 2014/09/19 | [
"https://academia.stackexchange.com/questions/28726",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/-1/"
] | Don't run! Walk!
----------------
Keep in mind that organizing conferences usually involves a huge amount of work including organizing the received abstracts and papers, managing their reviewers, managing the conference place and preparing packages, etc. They have to solve your problem but don't expect them to answer ... | You should definitely call the Conference organizing committee three days after sending an e-mail. They have to clarify this situation.
Be sure to have the e-mail in front of you when calling.
Your message could be lost in tons of those other complain emails from other members.
I have organized a few congresses m... |
28,726 | I recently submitted an abstract to a talk as a contributed paper. I was informed, through email, that the paper was scheduled to be presented *in person* on XXX date. The email also said that I could look for my name on a link mentioned in the email; going to the link, I found that my name was not on the list at all. ... | 2014/09/19 | [
"https://academia.stackexchange.com/questions/28726",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/-1/"
] | Now that you've identified the conference as the AMS Western Section meeting in San Francisco, I looked at [the conference's program web site](http://www.ams.org/meetings/sectional/2214_progfull.html) and your talk is definitely listed. It's in the Session for Contributed Papers I, Saturday October 25 at 10:30 AM in Th... | You should definitely call the Conference organizing committee three days after sending an e-mail. They have to clarify this situation.
Be sure to have the e-mail in front of you when calling.
Your message could be lost in tons of those other complain emails from other members.
I have organized a few congresses m... |
28,726 | I recently submitted an abstract to a talk as a contributed paper. I was informed, through email, that the paper was scheduled to be presented *in person* on XXX date. The email also said that I could look for my name on a link mentioned in the email; going to the link, I found that my name was not on the list at all. ... | 2014/09/19 | [
"https://academia.stackexchange.com/questions/28726",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/-1/"
] | Now that you've identified the conference as the AMS Western Section meeting in San Francisco, I looked at [the conference's program web site](http://www.ams.org/meetings/sectional/2214_progfull.html) and your talk is definitely listed. It's in the Session for Contributed Papers I, Saturday October 25 at 10:30 AM in Th... | Don't run! Walk!
----------------
Keep in mind that organizing conferences usually involves a huge amount of work including organizing the received abstracts and papers, managing their reviewers, managing the conference place and preparing packages, etc. They have to solve your problem but don't expect them to answer ... |
3,412,004 | i am using c# language to build a console application. My target is i have to build a custom command like "do pfizer.text" and it'll create a file "phizer.text" on desktop.
I know i can do this with existing commands but i want to make my custom command ( "do" in this case).
Can anyone tell me how to do this ??? I wi... | 2010/08/05 | [
"https://Stackoverflow.com/questions/3412004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/385205/"
] | Just create your own console application with the name of command. Place this application on any folder included in `%PATH%` OR add your folder path to the `%PATH%`.
To check current paths -
1. Open cmd
2. Type `path`
To add new path -
1. Open cmd
2. Type `set path="%path%;c:\mypath\"` | The command line (not DOS for a long while now) will search for executables or scripts in all folders defined on the `%Path%` system variable. By adding the path of your program to that variable you can start it from anywhere.
You can find these variables at the System Properties dialog:
[
{
//I'm not a designer :)
this.Backgroun... | You can define a CSS style and when you define the gridview just add the property cssclass="css\_style\_name" this should work.
```
<asp:GridView ID="`GridOne" runat="server" CssClass="style_name">
</asp:GridView>
``` |
440,018 | >
> If $L$ is a complex linear transformation with $L(z)=Az+B$, $A \neq 0$, $B \in \mathbb{C}$ and $L$ maps the circle $C\_1$ onto the circle $C\_2$ where
> $$C\_1=\{z \in \mathbb{C}:|z-z\_0|=R\_1>0\} \text{ and } C\_2=\{w \in \mathbb{C}:|w-w\_0|=R\_2>0\}$$
> then $L(z\_0)=w\_0$.
>
>
>
This is part of a problem ... | 2013/07/09 | [
"https://math.stackexchange.com/questions/440018",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | For a circle, $z=z\_0+R\_1 e^{i \phi}$. Then
$$L(z) = A z+B = (A z\_0 +B) + A R\_1 e^{i \phi}$$
Accordingly, $R\_2 = |A| R\_1$ and $w\_0 = A z\_0 + B = L(z\_0)$. | For posterity and in the hopes of further clarification or improvements I can make to understanding some of these things and to make my reasoning stronger I submit my solution.
As Ron Gordon points out, each $z \in C\_1$ can be written as
$$z=z\_0+R\_1e^{it} \text{ for some $t \in [0,2\pi)$}.$$
Hence if we let $f=L|\_... |
408,840 | I have a list of street\_names
`['SH-701', 'SH-67', ' ABC', 'Dharampur Road', 'Kailash Road', 'Tithal Road', 'SH-6', 'Halar Road', 'SH-183', 'Ramji Tekra Road', 'Mahatma Gandhi Road', 'Bandar Road', 'M G Road', 'M Road', 'Station Road', 'Azad Chowk', 'Golden Quadrilateral', 'Service Road', 'NH-48', 'NH-8', 'Baldev Str... | 2021/08/21 | [
"https://gis.stackexchange.com/questions/408840",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/165663/"
] | Debugging your `query` assembly math with a fixed `item` of `'Named Road'` using:
```py
parts = query.split('Or')
print("Expression members:\n\t{:s}".format('OR\n\t'.join(parts)))
```
I got output:
```py
"ST_NAME1 = 'Named Road' OR
Remark1 = 'Named Road' OR
ST_NAME2 = 'Named Road' OR
Remark2 = 'N... | This approach helped.
for item in street\_names:
in\_data = arcpy.management.SelectLayerByAttribute(self.street, "ADD\_TO\_SELECTION",
"ST\_NAME1 ='{}'".format(item) or "Remark1 ='{}'".format(item) or "ST\_NAME2 ='{}'".format(item) or "Remark2 ='{}'".format(item) or "ST\_NAME3 ='{}'".format(item) or "Remark3 ='{}'".fo... |
45,994 | Is my approach for creating a melody over this harmony I have written theoretically correct?
Harmony: (KEY OF A) F#m F#sus4 C#m C#msus4 Bm Bsus4 AMaj7
Now lets just take a really straight approach to the melody.
Melody:
F# Aeolian.
C# Phrygian
B Dorian
A Ionian (or maybe A lydian because it's a Maj 7th chord)
Now... | 2016/07/08 | [
"https://music.stackexchange.com/questions/45994",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/30867/"
] | That is totally a matter of style, given the combination you have there. If you wanted a Spanish guitar sound and kind of dark, use phrygian. If you want a jazzy/blues feeling, use Dorian. However, if you use Dorian with the minor chords toward the beginning of the progression, I would probably give Mixolydian a try on... | A melody is comprised of notes, usually from a particular key. Those notes could and often do, add up to the scale of that key, when put in order, with root first.
Thus, in A, there'll be A,B,C#,D,E,F# and G#.So, a tune in A will use those notes in the main.Take any of those notes, and stack the next but one and the n... |
45,994 | Is my approach for creating a melody over this harmony I have written theoretically correct?
Harmony: (KEY OF A) F#m F#sus4 C#m C#msus4 Bm Bsus4 AMaj7
Now lets just take a really straight approach to the melody.
Melody:
F# Aeolian.
C# Phrygian
B Dorian
A Ionian (or maybe A lydian because it's a Maj 7th chord)
Now... | 2016/07/08 | [
"https://music.stackexchange.com/questions/45994",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/30867/"
] | That is totally a matter of style, given the combination you have there. If you wanted a Spanish guitar sound and kind of dark, use phrygian. If you want a jazzy/blues feeling, use Dorian. However, if you use Dorian with the minor chords toward the beginning of the progression, I would probably give Mixolydian a try on... | All diatonic modes are the same scale starting on different notes. While you can think of different modes for each chord, I find that approach to be way too complicated for live performance. Moreover, that approach tends to lead to playing scales rather than creating interesting and catchy melodies. Take the chord tone... |
484,619 | If I consider a voltmeter and connect it across a battery , which is in such a circuit, that no current is flowing in that branch (Before Voltmeter is connected), will the voltmeter, show the EMF of the battery or the potential difference? Considering both ideal and non-ideal cases. | 2019/06/06 | [
"https://physics.stackexchange.com/questions/484619",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | An ideal voltmeter has infinite input impedance and therefore will draw no current and the reading will be the battery emf.
A real voltmeter has a finite impedance. So it will draw current. It will not read the battery emf. But the greater the ratio of the voltmeter impedance to the battery internal resistance, the cl... | An ideal voltmeter has an infinite resistance.therefore no current will be flowing through it.since there is no current flowing through the branch of the circuit to which it is connected across then none of the energy given to electrons due to chemical reaction in the cell will be used to overcome the internal resistan... |
53,854,486 | For third party authentication, I need a custom `Authorize` attribute. Here a repository (`SessionManager`) class is required to check if the user is logged in.
```
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class VBAuthorizeAttribute : AuthorizeA... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53854486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3276634/"
] | It seems that the usage of `async` cause problems. When I change `OnAuthorization` to a sync method like this, I don't get any errors:
```
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class VBAuthorizeAttribute : AuthorizeAttribute, IAuthorizati... | The `OnAuthorization` method is not supposed to be used for verifying authorization. It's just a notification that "hey, authorization is happening now".
That said, [some have used it for this](https://stackoverflow.com/a/41348219/1202807). But since you declared it as `async void`, nothing is waiting for this method ... |
53,854,486 | For third party authentication, I need a custom `Authorize` attribute. Here a repository (`SessionManager`) class is required to check if the user is logged in.
```
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class VBAuthorizeAttribute : AuthorizeA... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53854486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3276634/"
] | >
>
> ```
> public async void OnAuthorization(AuthorizationFilterContext context) {
>
> ```
>
>
Of importance here is the use of `async void`, which is, [according to David Fowler](https://github.com/davidfowl/AspNetCoreDiagnosticScenarios/blob/master/AsyncGuidance.md#async-void), **ALWAYS** bad. With the setup y... | The `OnAuthorization` method is not supposed to be used for verifying authorization. It's just a notification that "hey, authorization is happening now".
That said, [some have used it for this](https://stackoverflow.com/a/41348219/1202807). But since you declared it as `async void`, nothing is waiting for this method ... |
53,854,486 | For third party authentication, I need a custom `Authorize` attribute. Here a repository (`SessionManager`) class is required to check if the user is logged in.
```
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public class VBAuthorizeAttribute : AuthorizeA... | 2018/12/19 | [
"https://Stackoverflow.com/questions/53854486",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3276634/"
] | ```
public class VBAuthorizeAttribute : AuthorizeAttribute, IAuthorizationFilter
{
public async void OnAuthorization(AuthorizationFilterContext context)
{
// …
await something;
// …
}
}
```
Having a method `async void` is [almost always a bad idea](https://stackoverflow.com/quest... | The `OnAuthorization` method is not supposed to be used for verifying authorization. It's just a notification that "hey, authorization is happening now".
That said, [some have used it for this](https://stackoverflow.com/a/41348219/1202807). But since you declared it as `async void`, nothing is waiting for this method ... |
76,738 | Environment: WSS 3.0 SP2 running on Server 2008 Standard R2
We recently have been experiencing an issue whereby a Word or Excel doc containing links to other files on a network share gets uploaded into a document list, after which, the links in the document get changed.
For example, a document contains links to other... | 2013/09/06 | [
"https://sharepoint.stackexchange.com/questions/76738",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/19391/"
] | UPS isn't required for workflows. That being said, what you'll want to do to debug the workflow is attach your Visual Studio instance that has your WF loaded up to the following processes:
* w3wp.exe (the one running the right app pool account; if you're not sure which one it is, just attach to all of them)
* owstimer... | In SharePoint 2013 UPS is used for Workflow authentication, because SP2013 Workflow acts as a SharePoint App. Thus not-configured UPS could be the cause of the issue.
TechNet reference:
* [Install and configure workflow for SharePoint Server 2013](http://technet.microsoft.com/en-us/library/jj658588.aspx) (Section **T... |
536,038 | How I do a caption in Tikz? e.g.
```
\begin{tikzpicture}
\draw (0,0) -- (4,0) -- (4,4) -- (0,4) -- (0,0);
\caption{Cuadrado}
\end{tikzpicture}
```
is an error. | 2020/03/30 | [
"https://tex.stackexchange.com/questions/536038",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/211276/"
] | A `caption` is a thing you attach to a `figure`; a `tikzpicture` is like an image, or a block of text, or whatever you want to put *into* a picture.
Try:
```
\begin{figure}
\begin{tikzpicture}
\draw (0,0) -- (4,0) -- (4,4) -- (0,4) -- (0,0);
\end{tikzpicture}
\caption{Un cuadrado}
\end{figure}
`... | To be clear, [Rmano's answer](https://tex.stackexchange.com/a/536039/194703) is the way to go in almost all realistic cases. However, exceptionally there can be good reasons to just add a caption to some `tikzpicture`, e.g. when you arrange them in a tabular. In this case you can do
```
\documentclass{article}
\usepac... |
54,772,990 | I've created a fresh new component via:
```
ng g mytest1
```
Then I changed the constructor line to this:
```
constructor(private dialogRef: MatDialogRef<Mytest1Component>) { }
```
, and added the required import:
```
import { MatDialogRef } from '@angular/material';
```
After that I ran the Karma unit test pr... | 2019/02/19 | [
"https://Stackoverflow.com/questions/54772990",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7107533/"
] | You are injecting `MatDialogRef` in component:
```
constructor(private dialogRef: MatDialogRef<Mytest1Component>) { }
```
So the testBed expects the same to be injected as `provider` to the TestBed. Or you can also provide a `MockDialogueService` to it.
```
beforeEach(async(() => {
TestBed.configureTestingModul... | use:
```
imports: [MatDialogModule],
```
instead |
4,692,381 | In general, I am wondering when to use custom controls vs integrating the control directly into your form.
In particular, I have a form that contains a tab page, with 6 tabs each containing a number of .net framework controls. Currently, I have in my project 6 user defined controls that I dock onto each of those tab ... | 2011/01/14 | [
"https://Stackoverflow.com/questions/4692381",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/423709/"
] | You want [CCLabelBMFont](http://www.cocos2d-iphone.org/api-ref/0.99.5/interface_c_c_label_b_m_font.html) instead of CCBitmapFontAtlas.
```
startNewGameLabel = [CCLabelBMFont
labelWithString:@"New Game"
fntFile:@"bitmapfont.fnt"];
``` | Use CCLabelBMFont instead. Will be removed 1.0.1 |
68,438,630 | How can I find which query is being executed from an Oracle ADF 12c Form? We have ADF applications integrated with Oracle EBS 12.2 which make several calls to the database; I want to track the queries executed by these ADF forms. E.g., when I press a popup button a SQL query is executed from the backend, etc. | 2021/07/19 | [
"https://Stackoverflow.com/questions/68438630",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16478967/"
] | Run your application with `-Djbo.debugoutput=console` java key and watch console output. | You can overwrite the ViewObjectImpl class and add a command to dump the query and its parameters to a special logger or the console.
The advantage over the debugoutput=console is that you do not get every debug message, and there are many of them.
You can look at <https://blog.virtual7.de/adf-dump-query-and-all-vo-que... |
68,241,625 | My project must comply by contract with all the sonarqube static analyzer rules (to my *immense* delight).
As shown in the picture I have a base class which is derived n time, and each derived class is derived a second time.
[](https://i.stack.imgur.c... | 2021/07/04 | [
"https://Stackoverflow.com/questions/68241625",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9746867/"
] | So, The data you are fetching is in JSON ENCODED FORMAT. so you need to parse it to a JS Object. like this: `data = JSON.parse(data)` in your `success` function. | (1) Since you only have one data item returned, please change the success block from:
```
success: function(data) {
var student = '';
// ITERATING THROUGH OBJECTS
$.each(data, function (key, value) {
// DATA FROM JSON OBJECT
student += '<video height="603"';
student += 'src="' +
value.videoName + '" autoplay loop ... |
319,422 | i'm generating controls dynamically on my asp.net page by xslt transformation from an xml file. i will need to reference these controls from code behind later. i would like to add these references to the list/hashtable/whatever during creation (in xslt file i suppose) so that i could reach them later and i have no idea... | 2008/11/26 | [
"https://Stackoverflow.com/questions/319422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40872/"
] | Once you have transformed your XML using XSLT, you could pass the output to the ASP.Net [ParseControl](http://msdn.microsoft.com/en-us/library/kz3ffe28.aspx) method and it will return your controls ready to use. For example this code will place two buttons on the page:
```
protected void Page_Load(object sender, Event... | Can you give a better idea of what you are trying to do?
XML > XSLT > produces aspx page
Sounds close to reinventing the windows presentation framework or XUL
Or is it
ASPX reads xml > uses XSLT to add DOM elements to page...
Sounds like AJAX
You want to write out a unique ID using the attribute transform
<http://w... |
319,422 | i'm generating controls dynamically on my asp.net page by xslt transformation from an xml file. i will need to reference these controls from code behind later. i would like to add these references to the list/hashtable/whatever during creation (in xslt file i suppose) so that i could reach them later and i have no idea... | 2008/11/26 | [
"https://Stackoverflow.com/questions/319422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40872/"
] | Once you have transformed your XML using XSLT, you could pass the output to the ASP.Net [ParseControl](http://msdn.microsoft.com/en-us/library/kz3ffe28.aspx) method and it will return your controls ready to use. For example this code will place two buttons on the page:
```
protected void Page_Load(object sender, Event... | Could be tricky with a pure XSL solution.
You might be able to call a template which iterates the xml nodes you are using generate the controls, and writes out a c#/VB script block which adds them to a container of your choice.
Another option could be to add msxsl:script to your template, and use c# or another lang... |
319,422 | i'm generating controls dynamically on my asp.net page by xslt transformation from an xml file. i will need to reference these controls from code behind later. i would like to add these references to the list/hashtable/whatever during creation (in xslt file i suppose) so that i could reach them later and i have no idea... | 2008/11/26 | [
"https://Stackoverflow.com/questions/319422",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/40872/"
] | Once you have transformed your XML using XSLT, you could pass the output to the ASP.Net [ParseControl](http://msdn.microsoft.com/en-us/library/kz3ffe28.aspx) method and it will return your controls ready to use. For example this code will place two buttons on the page:
```
protected void Page_Load(object sender, Event... | Thanks for all the answers.
This is what i do (it's not my code, but i'm doing it the same way):
private void CreateControls()
{
XPathDocument surveyDoc = new XPathDocument(Server.MapPath("ExSurvey.xml"));
```
// Load the xslt to do the transformations
XslTransform transform = new XslTransform();
transform.Load(Ser... |
54,109,008 | I have configured CloudFront in front of my web application that uses JSP pages, but it will not cache my page because the Content-Length header is not set.
Is there a way that I can get JSP to include the Content-Length, or do I need to do something ugly like have a filter than streams the content to determine it's l... | 2019/01/09 | [
"https://Stackoverflow.com/questions/54109008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/583616/"
] | Try going without `JSON.stringify()` before sending the data. I believe Ajax will serialize it for you. | instead of trying
```
var sendBody = JSON.stringify(req.body);
```
try
```
var sendBody = JSON.parse(req.body);
```
you will get the answer |
54,109,008 | I have configured CloudFront in front of my web application that uses JSP pages, but it will not cache my page because the Content-Length header is not set.
Is there a way that I can get JSP to include the Content-Length, or do I need to do something ugly like have a filter than streams the content to determine it's l... | 2019/01/09 | [
"https://Stackoverflow.com/questions/54109008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/583616/"
] | I investigated a bit the parsing in express. Without having checked all details, the reason is, that if you pass the data as the string:
```
{"add":{"id":"T1088","name":"Zynula","books":[{"id":"1"},{"id":"2"}]}}
```
Then the header that the content should be interpreted as JSON is missing, and the parser interprets ... | instead of trying
```
var sendBody = JSON.stringify(req.body);
```
try
```
var sendBody = JSON.parse(req.body);
```
you will get the answer |
54,109,008 | I have configured CloudFront in front of my web application that uses JSP pages, but it will not cache my page because the Content-Length header is not set.
Is there a way that I can get JSP to include the Content-Length, or do I need to do something ugly like have a filter than streams the content to determine it's l... | 2019/01/09 | [
"https://Stackoverflow.com/questions/54109008",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/583616/"
] | Try going without `JSON.stringify()` before sending the data. I believe Ajax will serialize it for you. | I investigated a bit the parsing in express. Without having checked all details, the reason is, that if you pass the data as the string:
```
{"add":{"id":"T1088","name":"Zynula","books":[{"id":"1"},{"id":"2"}]}}
```
Then the header that the content should be interpreted as JSON is missing, and the parser interprets ... |
610,962 | In java swing I can insert panels into panels and so on, and not have to build a brand new window for every view of my applicaiton, or mess around removing and adding controls.
Theres a panel clas sin C# however I cant see any way of creating a 'panel form' or basically just a form in form designer thats a panel and i... | 2009/03/04 | [
"https://Stackoverflow.com/questions/610962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57482/"
] | Usually i just dock different forms within eachother setting the IsMdiContainer Property to true on the parent window. Then i create subforms that i dock using the following function:
```
static class FormUtil
{
static public void showForm(Form sender, Control reciever)
{
sender.ControlBox = false;
... | Actually, you can use the panel control and set it's Dock property to Fill. That way, your panel will be the entire canvas of the form. Then, you can add child panels as needed either through code behind or through forms designer. |
610,962 | In java swing I can insert panels into panels and so on, and not have to build a brand new window for every view of my applicaiton, or mess around removing and adding controls.
Theres a panel clas sin C# however I cant see any way of creating a 'panel form' or basically just a form in form designer thats a panel and i... | 2009/03/04 | [
"https://Stackoverflow.com/questions/610962",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/57482/"
] | Usually i just dock different forms within eachother setting the IsMdiContainer Property to true on the parent window. Then i create subforms that i dock using the following function:
```
static class FormUtil
{
static public void showForm(Form sender, Control reciever)
{
sender.ControlBox = false;
... | There's the concept of user controls which basicly provides you with a panel like designer surface , not to mention that you can create atomic forms (which can be reused) and register them as inheritable, that way you can provide inheritance too. |
559,366 | To keep it simple, I have created a custom table of contents for LaTeX,
```
% ===TOC (Alphabetical)===
% - - - - - - - - - - - - - - - -
\makeatletter
\newcommand\tableofcontentsalphabetical{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
... | 2020/08/20 | [
"https://tex.stackexchange.com/questions/559366",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/203429/"
] | A PSTricks solution only for either fun or comparison purposes.
```
\documentclass[pstricks,border=\dimexpr355pt/113\relax]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}[algebraic,plotpoints=500](-5,-1.5)(5.5,3)
\psaxes{->}(0,0)(-5,-1.5)(5,2.5)[$x$,0][$y$,90]
\psplot[linecolor=red]{-4.5... | This is not an exact answer but an explanation of how it has to be done
In simple terms the answer here -- <https://stackoverflow.com/questions/59880248/precise-and-smooth-curve-with-tikz?fbclid=IwAR09VVJs9oYgp96-kg-Iq1EEfa5rBnm30zHFQp_YXcZJg4sTT0rzk7X20hI> -- pushes in additional coordinates/ points for fine `control... |
14,552,488 | I want to submit my first app to the windows market place but while trying to find out the certification process I become confused if I need an about page (that contains support information) or not. | 2013/01/27 | [
"https://Stackoverflow.com/questions/14552488",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/179678/"
] | Yes you do need to include some information which is probably best to have on an about page. See [5.6.1 in certification requirments](http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh184840%28v=vs.105%29.aspx)
>
> An app must include the app name, version information, and technical
> support contact in... | And if you don't want to spend to much time on your about page and still want it to look great, take a look at this opensource project!
<http://ylad.codeplex.com/>
It comes as a nuget, so easy to add in your wp7 project! <http://nuget.org/packages/YLAD> |
66,893,022 | I am using Node Redis with this config:
```
import redis from "redis";
import { promisify } from "util";
import config from "../../appConfig";
const redisUrl = config.REDIS_URL;
const [host, port] = redisUrl.substr(8).split(":");
const RedisClient = redis.createClient({ host: host, port: Number(port) });
RedisClient.... | 2021/03/31 | [
"https://Stackoverflow.com/questions/66893022",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3903244/"
] | For anyone using this in 2022, the configuration name is now `disableOfflineQueue`. It is set to false by default, so you have to set it to true in `creatClient`.
This is how I do it in my code
```js
import { createClient } from 'redis';
const client = createClient({
url: redisHost, // redisHost is something lik... | Setting `enable_offline_queue` to `false` did the trick. Found lots of similar questions but none mentioned this:
[Nodejs set timeout for Redis requests](https://stackoverflow.com/questions/54975234/nodejs-set-timeout-for-redis-requests)
[What's the default timeout of ioredis send command for any redis call](https://... |
58,030,300 | I commanded 'vagrant up' on my terminal, to login my virtual CentoOS7 server then,I got these errors.
Just before I tried to up vagrant, I was customizing my vim editor on CentOS7 server on my vagrant. and then, I sat some important document.
maybe it caused this error...
and I found similar question on the web but I ... | 2019/09/20 | [
"https://Stackoverflow.com/questions/58030300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12095934/"
] | Try running
`vagrant reload --provision`
then
`vagrant up`
This cheatsheet can you help you more. <https://gist.github.com/wpscholar/a49594e2e2b918f4d0c4> | I would try to run the following command in CMD as administrator:
```
sc start vboxdrv
```
According to this forum post: <https://github.com/hashicorp/vagrant/issues/9318>
A complete reinstall of VirtualBox fixed the issue for some users. |
58,030,300 | I commanded 'vagrant up' on my terminal, to login my virtual CentoOS7 server then,I got these errors.
Just before I tried to up vagrant, I was customizing my vim editor on CentOS7 server on my vagrant. and then, I sat some important document.
maybe it caused this error...
and I found similar question on the web but I ... | 2019/09/20 | [
"https://Stackoverflow.com/questions/58030300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12095934/"
] | It should solve the problem
```
VBoxManage startvm "6f113832-832d-4fd6-ba87-af003b3dddce" --type headless
``` | I would try to run the following command in CMD as administrator:
```
sc start vboxdrv
```
According to this forum post: <https://github.com/hashicorp/vagrant/issues/9318>
A complete reinstall of VirtualBox fixed the issue for some users. |
58,030,300 | I commanded 'vagrant up' on my terminal, to login my virtual CentoOS7 server then,I got these errors.
Just before I tried to up vagrant, I was customizing my vim editor on CentOS7 server on my vagrant. and then, I sat some important document.
maybe it caused this error...
and I found similar question on the web but I ... | 2019/09/20 | [
"https://Stackoverflow.com/questions/58030300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12095934/"
] | The error is showing because vagrant cannot find the virtual box file which is associated with the project's virtual machine. Maybe it was deleted by accident.
In order to solve the issue open the Virtual Box GUI and then right click on the virtual box which is associated with the issue and click on `remove`.
This wi... | I would try to run the following command in CMD as administrator:
```
sc start vboxdrv
```
According to this forum post: <https://github.com/hashicorp/vagrant/issues/9318>
A complete reinstall of VirtualBox fixed the issue for some users. |
58,030,300 | I commanded 'vagrant up' on my terminal, to login my virtual CentoOS7 server then,I got these errors.
Just before I tried to up vagrant, I was customizing my vim editor on CentOS7 server on my vagrant. and then, I sat some important document.
maybe it caused this error...
and I found similar question on the web but I ... | 2019/09/20 | [
"https://Stackoverflow.com/questions/58030300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12095934/"
] | The error is showing because vagrant cannot find the virtual box file which is associated with the project's virtual machine. Maybe it was deleted by accident.
In order to solve the issue open the Virtual Box GUI and then right click on the virtual box which is associated with the issue and click on `remove`.
This wi... | Try running
`vagrant reload --provision`
then
`vagrant up`
This cheatsheet can you help you more. <https://gist.github.com/wpscholar/a49594e2e2b918f4d0c4> |
58,030,300 | I commanded 'vagrant up' on my terminal, to login my virtual CentoOS7 server then,I got these errors.
Just before I tried to up vagrant, I was customizing my vim editor on CentOS7 server on my vagrant. and then, I sat some important document.
maybe it caused this error...
and I found similar question on the web but I ... | 2019/09/20 | [
"https://Stackoverflow.com/questions/58030300",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12095934/"
] | The error is showing because vagrant cannot find the virtual box file which is associated with the project's virtual machine. Maybe it was deleted by accident.
In order to solve the issue open the Virtual Box GUI and then right click on the virtual box which is associated with the issue and click on `remove`.
This wi... | It should solve the problem
```
VBoxManage startvm "6f113832-832d-4fd6-ba87-af003b3dddce" --type headless
``` |
5,219,030 | I have `div` of fixed width containing only `input` text box and `width` of that `input` is set to `100%`. I expect it to fill the `div` but instead it is slightly longer.
Demonstration code:
HTML:
```
<div class="container">
<input class="content" id="Text1" type="text" />
</div>
```
CSS:
```
.container
{
... | 2011/03/07 | [
"https://Stackoverflow.com/questions/5219030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/311865/"
] | You need to reset the paddings, margins and the borders. If you want to apply it sitewide, you can use a reset css like Eric Meyer's : <http://meyerweb.com/eric/tools/css/reset/>
Or you can write your own. Just default it to your own values | Also add a CSS reset to you page. the input may have some padding added! |
5,219,030 | I have `div` of fixed width containing only `input` text box and `width` of that `input` is set to `100%`. I expect it to fill the `div` but instead it is slightly longer.
Demonstration code:
HTML:
```
<div class="container">
<input class="content" id="Text1" type="text" />
</div>
```
CSS:
```
.container
{
... | 2011/03/07 | [
"https://Stackoverflow.com/questions/5219030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/311865/"
] | [`box-sizing: border-box`](https://developer.mozilla.org/en/CSS/box-sizing) is a quick, easy way to fix it:
This [will work in all modern browsers](http://caniuse.com/box-sizing), and IE8+.
Here's a demo: <http://jsfiddle.net/thirtydot/QkmSk/301/>
```css
.content {
width: 100%;
box-sizing: border-box;
}
```... | Also add a CSS reset to you page. the input may have some padding added! |
5,219,030 | I have `div` of fixed width containing only `input` text box and `width` of that `input` is set to `100%`. I expect it to fill the `div` but instead it is slightly longer.
Demonstration code:
HTML:
```
<div class="container">
<input class="content" id="Text1" type="text" />
</div>
```
CSS:
```
.container
{
... | 2011/03/07 | [
"https://Stackoverflow.com/questions/5219030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/311865/"
] | [`box-sizing: border-box`](https://developer.mozilla.org/en/CSS/box-sizing) is a quick, easy way to fix it:
This [will work in all modern browsers](http://caniuse.com/box-sizing), and IE8+.
Here's a demo: <http://jsfiddle.net/thirtydot/QkmSk/301/>
```css
.content {
width: 100%;
box-sizing: border-box;
}
```... | You need to reset the paddings, margins and the borders. If you want to apply it sitewide, you can use a reset css like Eric Meyer's : <http://meyerweb.com/eric/tools/css/reset/>
Or you can write your own. Just default it to your own values |
5,219,030 | I have `div` of fixed width containing only `input` text box and `width` of that `input` is set to `100%`. I expect it to fill the `div` but instead it is slightly longer.
Demonstration code:
HTML:
```
<div class="container">
<input class="content" id="Text1" type="text" />
</div>
```
CSS:
```
.container
{
... | 2011/03/07 | [
"https://Stackoverflow.com/questions/5219030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/311865/"
] | You need to reset the paddings, margins and the borders. If you want to apply it sitewide, you can use a reset css like Eric Meyer's : <http://meyerweb.com/eric/tools/css/reset/>
Or you can write your own. Just default it to your own values | When I use your code, it shows fine here on Firefox. I suspect you have an issue with specifity: <http://htmldog.com/guides/cssadvanced/specificity/>
Or, there is a problem with the surrounding html. I.e. unclosed tag.
Try putting that CSS and HTML into a plain file to see if it displays correctly. If it does, I sugg... |
5,219,030 | I have `div` of fixed width containing only `input` text box and `width` of that `input` is set to `100%`. I expect it to fill the `div` but instead it is slightly longer.
Demonstration code:
HTML:
```
<div class="container">
<input class="content" id="Text1" type="text" />
</div>
```
CSS:
```
.container
{
... | 2011/03/07 | [
"https://Stackoverflow.com/questions/5219030",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/311865/"
] | [`box-sizing: border-box`](https://developer.mozilla.org/en/CSS/box-sizing) is a quick, easy way to fix it:
This [will work in all modern browsers](http://caniuse.com/box-sizing), and IE8+.
Here's a demo: <http://jsfiddle.net/thirtydot/QkmSk/301/>
```css
.content {
width: 100%;
box-sizing: border-box;
}
```... | When I use your code, it shows fine here on Firefox. I suspect you have an issue with specifity: <http://htmldog.com/guides/cssadvanced/specificity/>
Or, there is a problem with the surrounding html. I.e. unclosed tag.
Try putting that CSS and HTML into a plain file to see if it displays correctly. If it does, I sugg... |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | Add this to header defining MyEnumClass:
```
namespace std {
template <> struct hash<MyEnumClass> {
size_t operator() (const MyEnumClass &t) const { return size_t(t); }
};
}
``` | I met similar issues when I wanted to get a unordered\_map from enum type to string.
You most probably don't need unordered\_map. Because you use enum class as your key, I assume that you don't need operations like insert or remove: simple lookup will be sufficient.
That being said, why not just use a function instea... |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | This was considered a defect in the standard, and was fixed in C++14: <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148>
This is fixed in the version of libstdc++ shipping with gcc as of 6.1: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970>.
It was fixed in clang's libc++ in 2013: <http://lists.c... | Try
```
std::unordered_map<Shader::Type, Shader, std::hash<std::underlying_type<Shader::Type>::type>> shaders;
``` |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | A very simple solution would be to provide a hash function object like this:
```
std::unordered_map<Shader::Type, Shader, std::hash<int> > shaders;
```
That's all for an enum key, no need to provide a specialization of std::hash. | When you use `std::unordered_map`, you know you need a hash function. For built-in or `STL` types, there are defaults available, but not for user-defined ones. If you just need a map, why don't you try `std::map`? |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | As KerrekSB pointed out, you need to provide a specialization of `std::hash` if you want to use `std::unordered_map`, something like:
```
namespace std
{
template<>
struct hash< ::Shader::Type >
{
typedef ::Shader::Type argument_type;
typedef std::underlying_type< argument_type >::type unde... | I met similar issues when I wanted to get a unordered\_map from enum type to string.
You most probably don't need unordered\_map. Because you use enum class as your key, I assume that you don't need operations like insert or remove: simple lookup will be sufficient.
That being said, why not just use a function instea... |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | A very simple solution would be to provide a hash function object like this:
```
std::unordered_map<Shader::Type, Shader, std::hash<int> > shaders;
```
That's all for an enum key, no need to provide a specialization of std::hash. | Add this to header defining MyEnumClass:
```
namespace std {
template <> struct hash<MyEnumClass> {
size_t operator() (const MyEnumClass &t) const { return size_t(t); }
};
}
``` |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | I use a functor object to calculate hash of `enum class`:
```cpp
struct EnumClassHash
{
template <typename T>
std::size_t operator()(T t) const
{
return static_cast<std::size_t>(t);
}
};
```
Now you can use it as 3rd template-parameter of `std::unordered_map`:
```
enum class MyEnum {};
std:... | As KerrekSB pointed out, you need to provide a specialization of `std::hash` if you want to use `std::unordered_map`, something like:
```
namespace std
{
template<>
struct hash< ::Shader::Type >
{
typedef ::Shader::Type argument_type;
typedef std::underlying_type< argument_type >::type unde... |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | When you use `std::unordered_map`, you know you need a hash function. For built-in or `STL` types, there are defaults available, but not for user-defined ones. If you just need a map, why don't you try `std::map`? | Try
```
std::unordered_map<Shader::Type, Shader, std::hash<std::underlying_type<Shader::Type>::type>> shaders;
``` |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | When you use `std::unordered_map`, you know you need a hash function. For built-in or `STL` types, there are defaults available, but not for user-defined ones. If you just need a map, why don't you try `std::map`? | I met similar issues when I wanted to get a unordered\_map from enum type to string.
You most probably don't need unordered\_map. Because you use enum class as your key, I assume that you don't need operations like insert or remove: simple lookup will be sufficient.
That being said, why not just use a function instea... |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | Add this to header defining MyEnumClass:
```
namespace std {
template <> struct hash<MyEnumClass> {
size_t operator() (const MyEnumClass &t) const { return size_t(t); }
};
}
``` | When you use `std::unordered_map`, you know you need a hash function. For built-in or `STL` types, there are defaults available, but not for user-defined ones. If you just need a map, why don't you try `std::map`? |
18,837,857 | I have a class containing an enum class.
```
class Shader {
public:
enum class Type {
Vertex = GL_VERTEX_SHADER,
Geometry = GL_GEOMETRY_SHADER,
Fragment = GL_FRAGMENT_SHADER
};
//...
```
Then, when I implement the following code in another class...
```
std::unordered_map<Shader... | 2013/09/16 | [
"https://Stackoverflow.com/questions/18837857",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1930535/"
] | I met similar issues when I wanted to get a unordered\_map from enum type to string.
You most probably don't need unordered\_map. Because you use enum class as your key, I assume that you don't need operations like insert or remove: simple lookup will be sufficient.
That being said, why not just use a function instea... | Try
```
std::unordered_map<Shader::Type, Shader, std::hash<std::underlying_type<Shader::Type>::type>> shaders;
``` |
3,768,482 | I uploaded 1 file and name it "test-test-test-test-test.php".
It create problem in my layout.
my layout is mess up.
so if i upload file name up to 10 char then its fine. | 2010/09/22 | [
"https://Stackoverflow.com/questions/3768482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/454951/"
] | Rename it before uploading.
In PHP:
```
<?php
$filename = 'test-test-test-test-test.php';
rename($filename, substr($filename, 0, 10) . '.php'));
?>
``` | ```
$filename = 'testtesttesttesttesttest.php';
$filename = basename($path, ".php");
$filename = substr($filename, 0, 10);
$filename .= '.php';
``` |
3,768,482 | I uploaded 1 file and name it "test-test-test-test-test.php".
It create problem in my layout.
my layout is mess up.
so if i upload file name up to 10 char then its fine. | 2010/09/22 | [
"https://Stackoverflow.com/questions/3768482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/454951/"
] | Rename it before uploading.
In PHP:
```
<?php
$filename = 'test-test-test-test-test.php';
rename($filename, substr($filename, 0, 10) . '.php'));
?>
``` | I found the solution.
Its using jquery.
```
jQuery("div.files .view-content .views-field-field-file-file-fid .filefield-file a")
.each(function(){
var file_text = jQuery(this).text();
if(file_text.length > 10){
file_sub_text = file_text.substring(0,10);
jQuery(this).text(file_sub_text+ "...... |
3,768,482 | I uploaded 1 file and name it "test-test-test-test-test.php".
It create problem in my layout.
my layout is mess up.
so if i upload file name up to 10 char then its fine. | 2010/09/22 | [
"https://Stackoverflow.com/questions/3768482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/454951/"
] | **Single line solution**
```
<?
$filename="test.php";
$filename=str_pad(trim($filename), 10, "123456789", STR_PAD_LEFT);
echo $filename;
//12test.php
$filename="test.php";
$filename=str_pad(trim($filename), 14, "123456789", STR_PAD_LEFT);
echo $filename;
//123456test.php
?>
``` | ```
$filename = 'testtesttesttesttesttest.php';
$filename = basename($path, ".php");
$filename = substr($filename, 0, 10);
$filename .= '.php';
``` |
3,768,482 | I uploaded 1 file and name it "test-test-test-test-test.php".
It create problem in my layout.
my layout is mess up.
so if i upload file name up to 10 char then its fine. | 2010/09/22 | [
"https://Stackoverflow.com/questions/3768482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/454951/"
] | **Single line solution**
```
<?
$filename="test.php";
$filename=str_pad(trim($filename), 10, "123456789", STR_PAD_LEFT);
echo $filename;
//12test.php
$filename="test.php";
$filename=str_pad(trim($filename), 14, "123456789", STR_PAD_LEFT);
echo $filename;
//123456test.php
?>
``` | I found the solution.
Its using jquery.
```
jQuery("div.files .view-content .views-field-field-file-file-fid .filefield-file a")
.each(function(){
var file_text = jQuery(this).text();
if(file_text.length > 10){
file_sub_text = file_text.substring(0,10);
jQuery(this).text(file_sub_text+ "...... |
54,302,680 | Hi everyone is there any way we can get list of all failed packages on any particular date , can we do this with a SQL query ?
We are using SSIS 2017 . | 2019/01/22 | [
"https://Stackoverflow.com/questions/54302680",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4227525/"
] | Assuming the package is deployed to SSISDB and ran from the catalog, query the `SSISDB.CATALOG.EXECUTIONS` DMV for executions with a status of 4. Packages with a status of 4 resulted in failure, as specified in the [documentation](https://learn.microsoft.com/en-us/sql/integration-services/system-views/catalog-execution... | Hi try this sql query for sql agents jobs [Link](https://learn.microsoft.com/en-us/sql/relational-databases/system-tables/dbo-sysjobhistory-transact-sql?view=sql-server-2017):
```
SELECT sj.name,
sh.run_date,
sh.step_name,
STUFF(STUFF(RIGHT(REPLICATE('0', 6) + CAST(sh.run_time as varchar(6)), ... |
33,806,983 | I've got a class with only static members, designed like that:
```
public class Clazz {
public static final Foo foo = FooFactory.createFoo();
private static Bar bar;
public static void prepare() {
bar = new Bar(foo);
}
}
```
When calling Clazz.prepare(), I can see that foo is null at bar i... | 2015/11/19 | [
"https://Stackoverflow.com/questions/33806983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4942545/"
] | `FooFactory.createFoo()` must be returning a `null` value | Actually, initializer of Foo calls Clazz.prepare() too. That's the reason. Thanks @biziclop for the idea. |
19,392,892 | I am an amateur to Python, I have made a program that will encode a long string of characters and output 6 characters.
```
def token (n):
if n < 10:
return chr( ord( '0' ) + (n) )
if n in range (10, 36):
return chr( ord( 'A' ) - 10 + (n))
if n in range (37, 62):
return chr( ord( 'a... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19392892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2884458/"
] | If you just want to reverse the list, just call the `reverse` method or `reversed` function:
```
>>> mylist = ['a','b','c','d','e','f']
>>> list(reversed(mylist))
['f', 'e', 'd', 'c', 'b', 'a']
```
If you want to do it the hard way, you can, but you have to use indices that are actually in the list:
```
>>> [i for ... | Lists in python are indexed starting from `0`, not from `1`. If you want to reorder an `n`-element list with the method you show, you therefore need to have a list containing the numbers `0,1,...,n - 1`, as trying to access element `n` of an `n`-element list will give an
error, as the index will be outside of the expec... |
19,392,892 | I am an amateur to Python, I have made a program that will encode a long string of characters and output 6 characters.
```
def token (n):
if n < 10:
return chr( ord( '0' ) + (n) )
if n in range (10, 36):
return chr( ord( 'A' ) - 10 + (n))
if n in range (37, 62):
return chr( ord( 'a... | 2013/10/15 | [
"https://Stackoverflow.com/questions/19392892",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2884458/"
] | If you just want to reverse the list, just call the `reverse` method or `reversed` function:
```
>>> mylist = ['a','b','c','d','e','f']
>>> list(reversed(mylist))
['f', 'e', 'd', 'c', 'b', 'a']
```
If you want to do it the hard way, you can, but you have to use indices that are actually in the list:
```
>>> [i for ... | The order has to be zero-indexed. That's how python lists work - the first element is `mylist[0]`, the second element is `mylist[1]`, etc. Therefore, it should be `[5,4,3,2,1,0]`. |
65,570 | By knowing each data point's coordinate, it is easy to apply them with clustering methods as k-means etc. By if the case is we only know the distances between each pair of data points without knowing the definite location coordinate of every data point, is it possible to apply any clustering methods in this case? | 2019/12/29 | [
"https://datascience.stackexchange.com/questions/65570",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/66068/"
] | K-Medoids
=========
It would be possible with an **adapted semi-supervised K-Means**, also known as [K-Medoids](https://en.wikipedia.org/wiki/K-medoids).
The tricky part with K-Means is that you do not know the centroids. However, you could hot start by assuming that some of your data points are centroids. Then, when... | Yes it is possible however not all algorithms support this. For example, k-means will not be able to do this, because k-means use centroid which is an "imaginary" point on the space, hence inferring distance from this point to another point on the dataset is not possible without knowing the location of every datapoints... |
74,312,314 | I have a data table and I want to show it by a directed graph. My table is following:
```
point,previous_point
"A","-"
"B","-"
"C","A"
"D","B"
"E","C"
"F","C"
"G","D,E"
"H","F,G"
```
And I need a graph drawn using by the above data. The graph I want is:
[
G.add_edges_from(
[('Start','A'),('Start','B'),
('A','C'),('B','D'),('C','E'),('C','F'),
('D','G'),('E','G'),('F','H'),('G','... | Instead of `networkx` one could use `mermaid`. Here's a chart generated online at `https://mermaid.live`:
```
graph LR
A --> C --> E --> G --> H
C --> F --> H
B --> D --> G
```
[](https://i.stack.imgur.com/eKzMx.png)
Of course, there is... |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | I found another solution for renaming a package in the entire project:
1. Open a file in the package.
2. IntelliJ displays the breadcrumbs of the file, above the opened file.
3. On the package you want renamed: Right click > Refactor > Rename.
This renames the package/directory throughout the entire project. | Most of the answers even the most voted answers didn't do the job properly, they seem to work and the builds work however, a closer look at the file structure and references will show you that not much was done. IntelliJ actually does this whole process automatically.
1) Go to Project Tab and make sure Packages is the... |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | 1. Goto your AndroidManifest.xml.
2. place your cursor in the package name like shown below **don't select it just place it.**
[](https://i.stack.imgur.com/ox5XT.png)
3. Then press `shift+F6` you will get a popup window as shown below select
**Renam... | Lets address the two use cases
\*\*Rename a package name or Trim a package \*\*
*com.mycompany.mystupidapplicationname* to *com.mycompany.brandname*
or
*com.someothercompany.mystupidapplicationname* to *com.someothercompany.mystupidapplicationname*
or
*com.someothercompany.mystupidapplicationname* to
*someother... |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | Deselect Hide Empty Middle Packages in Project Explorer Windows settings menu than you will be able to refactor each directory | Most of the answers even the most voted answers didn't do the job properly, they seem to work and the builds work however, a closer look at the file structure and references will show you that not much was done. IntelliJ actually does this whole process automatically.
1) Go to Project Tab and make sure Packages is the... |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | In Android Studio 1.1, the simplest way is to open your project `manifest file`, then point to each part of the `package name` that you want to change it and press
`SHIFT` + `F6` , then choose `rename package` and write the new name in the dialog box. That's all. | **Super simple** approach:
1. **Find** `R.java` in the build/generated directory
2. **Create** new package directories, again under build/generated/etc
3. **Move** `R.java` to the newly created package.
4. A dialog will appear. Choose to **refactor** the existing code with the new package name.
5. **Clean** and **Rebu... |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | Lets address the two use cases
\*\*Rename a package name or Trim a package \*\*
*com.mycompany.mystupidapplicationname* to *com.mycompany.brandname*
or
*com.someothercompany.mystupidapplicationname* to *com.someothercompany.mystupidapplicationname*
or
*com.someothercompany.mystupidapplicationname* to
*someother... | This modification needs three steps :
1. Change the package name in the manifest
2. Refactor the name of your package with right click -> refactor -> rename in the tree view, then Android studio will display a window, select "rename package"
3. Change manually the application Id in the build.gradle file :
android / de... |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | Eclipse:
Right click on the project > Android tools > Rename application package.
As simple as that...

In Android Studio:
open the build.gradle file > rename the applicationId under defaultConfig > synchronize | Deselect Hide Empty Middle Packages in Project Explorer Windows settings menu than you will be able to refactor each directory |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | Eclipse:
Right click on the project > Android tools > Rename application package.
As simple as that...

In Android Studio:
open the build.gradle file > rename the applicationId under defaultConfig > synchronize | In Android Studio 1.1, the simplest way is to open your project `manifest file`, then point to each part of the `package name` that you want to change it and press
`SHIFT` + `F6` , then choose `rename package` and write the new name in the dialog box. That's all. |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | The best way to solve this is going to the AndroidManifest.xml: `package="com.foocomp.fooapp`:
* Set the cursor on *"foocomp"*
* Press `Shift+F6`
* *Rename Package* to whatever you want
* Repeat for *"fooapp*".
Works for me.
Also, replace in Path in Whole Project as it didn't change everything. Then Clean, Rebuild a... | I found a good work around for this problem. Taking the example mentioned in the question, following are the steps for changing the package name from `com.example.test` to `com.example2.test` :
1. create a temporary directory, say `temp` inside the directory `example` (alongside directory `test`).
2. Go back to the In... |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | If you want to rename full android package, this is the best way to do that:
1. Mark as checked - Comapct Emty Middle Packages
2. Right click on the packcage you want to change, and then
Refactor->Rename->Rename all
You can find video tutorial on this link:
<https://www.youtube.com/watch?v=A-rITYZQj0A> | **Super simple** approach:
1. **Find** `R.java` in the build/generated directory
2. **Create** new package directories, again under build/generated/etc
3. **Move** `R.java` to the newly created package.
4. A dialog will appear. Choose to **refactor** the existing code with the new package name.
5. **Clean** and **Rebu... |
6,600,347 | Our app supports android 2.2 up. The app works on android 3.0 emulator. However we received report from honey comb device users that they do not see the app showing up in Market on their device. When they use Market website on PC and select their device to install, they got message of "App not compatible with your devi... | 2011/07/06 | [
"https://Stackoverflow.com/questions/6600347",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/651888/"
] | You can do this:
1. Change the package name manually in the manifest file.
2. Click on your `R.java` class and the press `F6` (**Refactor->Move...**). It will allow you to move the class to another package, and all references to that class will be updated. | This modification needs three steps :
1. Change the package name in the manifest
2. Refactor the name of your package with right click -> refactor -> rename in the tree view, then Android studio will display a window, select "rename package"
3. Change manually the application Id in the build.gradle file :
android / de... |
12,742,726 | Is there a way of getting the name of the currently running test?
Some (heavily simplified) code may help explain. I want to avoid the duplication of `"test1" / "test2"` in the calls to `performTest`:
```
describe("My test category", function () {
function performTest(uniqueName, speed) {
var result = fu... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12742726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/144486/"
] | ```
jasmine.getEnv().currentSpec.description
``` | For anyone attempting to do this in Jasmine 2: You can introduce a subtle change to your declarations however that fix it. Instead of just doing:
```
it("name for it", function() {});
```
Define the `it` as a variable:
```
var spec = it("name for it", function() {
console.log(spec.description); // prints "name f... |
12,742,726 | Is there a way of getting the name of the currently running test?
Some (heavily simplified) code may help explain. I want to avoid the duplication of `"test1" / "test2"` in the calls to `performTest`:
```
describe("My test category", function () {
function performTest(uniqueName, speed) {
var result = fu... | 2012/10/05 | [
"https://Stackoverflow.com/questions/12742726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/144486/"
] | ```
jasmine.getEnv().currentSpec.description
``` | It's not pretty (introduces a global variable) but you can do it with a custom reporter:
```
// current-spec-reporter.js
global.currentSpec = null;
class CurrentSpecReporter {
specStarted(spec) {
global.currentSpec = spec;
}
specDone() {
global.currentSpec = null;
}
}
module.exports = CurrentSpec... |
81,049 | I was thinking of exploring Lovecraftian horror the other day, and the thought occurred to me: say a couple decades after the American civil war, there was a certain city in New England of 10,000 people whose inhabitants committed atrocities, summoned beings so heinous and devolved into creatures themselves over time t... | 2017/05/16 | [
"https://worldbuilding.stackexchange.com/questions/81049",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/-1/"
] | **Absolutely**
In fact, there are multiple Reverse [Bielefeld Conspiracies](https://en.wikipedia.org/wiki/Bielefeld_Conspiracy) going on right now, across multiple locations in the US, and many more abroad. There are 3 locations in Maine, 1 in Washington and 1 in Arizona that I am currently aware of. (shh, don't tell... | It can be done, but it is hard. It should be masked *by a different activity*.
For example, it can be some factory, next to the Mexican border, working with many legal and illegal migrants.
Below the factory, you can have your hidden city. It shouldn't even have to be dug in the ground. The black & dirty activites c... |
81,049 | I was thinking of exploring Lovecraftian horror the other day, and the thought occurred to me: say a couple decades after the American civil war, there was a certain city in New England of 10,000 people whose inhabitants committed atrocities, summoned beings so heinous and devolved into creatures themselves over time t... | 2017/05/16 | [
"https://worldbuilding.stackexchange.com/questions/81049",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/-1/"
] | **Absolutely**
In fact, there are multiple Reverse [Bielefeld Conspiracies](https://en.wikipedia.org/wiki/Bielefeld_Conspiracy) going on right now, across multiple locations in the US, and many more abroad. There are 3 locations in Maine, 1 in Washington and 1 in Arizona that I am currently aware of. (shh, don't tell... | Cover it up with something else... Something scary
--------------------------------------------------
Do you really know what's going on at the Hanford Site? Supposedly all the riverside reactors are shutdown with all the auxiliary buildings torn down. But there are still vast complexes, many underground (e.g. the 200... |
81,049 | I was thinking of exploring Lovecraftian horror the other day, and the thought occurred to me: say a couple decades after the American civil war, there was a certain city in New England of 10,000 people whose inhabitants committed atrocities, summoned beings so heinous and devolved into creatures themselves over time t... | 2017/05/16 | [
"https://worldbuilding.stackexchange.com/questions/81049",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/-1/"
] | **Absolutely**
In fact, there are multiple Reverse [Bielefeld Conspiracies](https://en.wikipedia.org/wiki/Bielefeld_Conspiracy) going on right now, across multiple locations in the US, and many more abroad. There are 3 locations in Maine, 1 in Washington and 1 in Arizona that I am currently aware of. (shh, don't tell... | This is going to be tricky, but maybe not impossible.
Start by dealing with the physical evidence. Depending on where the nearby villages are, you might torch it, or just bring in a bunch of draft horses and pull everything down. Break down as much evidence as you can of human habitations. Splinter up any worked wood,... |
81,049 | I was thinking of exploring Lovecraftian horror the other day, and the thought occurred to me: say a couple decades after the American civil war, there was a certain city in New England of 10,000 people whose inhabitants committed atrocities, summoned beings so heinous and devolved into creatures themselves over time t... | 2017/05/16 | [
"https://worldbuilding.stackexchange.com/questions/81049",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/-1/"
] | **Absolutely**
In fact, there are multiple Reverse [Bielefeld Conspiracies](https://en.wikipedia.org/wiki/Bielefeld_Conspiracy) going on right now, across multiple locations in the US, and many more abroad. There are 3 locations in Maine, 1 in Washington and 1 in Arizona that I am currently aware of. (shh, don't tell... | The US has closed off towns before
----------------------------------
Adapt the model used for [Hanford](https://en.wikipedia.org/wiki/Hanford,_Washington) during the Manhattan Project. Or maybe you model it after [Centralia](https://en.wikipedia.org/wiki/Centralia,_Pennsylvania), which was condemned in the 1990s due ... |
81,049 | I was thinking of exploring Lovecraftian horror the other day, and the thought occurred to me: say a couple decades after the American civil war, there was a certain city in New England of 10,000 people whose inhabitants committed atrocities, summoned beings so heinous and devolved into creatures themselves over time t... | 2017/05/16 | [
"https://worldbuilding.stackexchange.com/questions/81049",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/-1/"
] | Cover it up with something else... Something scary
--------------------------------------------------
Do you really know what's going on at the Hanford Site? Supposedly all the riverside reactors are shutdown with all the auxiliary buildings torn down. But there are still vast complexes, many underground (e.g. the 200... | It can be done, but it is hard. It should be masked *by a different activity*.
For example, it can be some factory, next to the Mexican border, working with many legal and illegal migrants.
Below the factory, you can have your hidden city. It shouldn't even have to be dug in the ground. The black & dirty activites c... |
81,049 | I was thinking of exploring Lovecraftian horror the other day, and the thought occurred to me: say a couple decades after the American civil war, there was a certain city in New England of 10,000 people whose inhabitants committed atrocities, summoned beings so heinous and devolved into creatures themselves over time t... | 2017/05/16 | [
"https://worldbuilding.stackexchange.com/questions/81049",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/-1/"
] | 1. Cities are in no way, shape or form self-sufficient. Thus, if you sealed it off, enterprising residents (pseudo-blockade runners) would soon travel cross-country to get food and other supplies from others.
2. The people that these pseudo-blockade runners buy from would ask where they came from, and... most important... | This is going to be tricky, but maybe not impossible.
Start by dealing with the physical evidence. Depending on where the nearby villages are, you might torch it, or just bring in a bunch of draft horses and pull everything down. Break down as much evidence as you can of human habitations. Splinter up any worked wood,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.