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
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
What you need is called attribute selector. An example, using your html structure, is the following: ``` div.page-search-site[class*='-bundle-medical-group'] { color:red } ``` In the place of `div` you can add any element or remove it altogether, and in the place of `class` you can add any attribute of the sp...
```css div[class|=page-search-site-health-bundle] { color: red; } ``` ```html <div class="page-search-site-health-bundle-medical-group">Some text here</div> <div class="page-search-site-health-bundle-clinic">Some text here</div> <div class="page-search-site-health-bundle-hospital">Some text here</div> ``` Read ...
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
You're looking for a selctor that selects all elements with a list of class names beginning with `health-bundle-` or containing `health-bundle-` preceded by a space so you'll need to use [attribute selectors](https://developer.mozilla.org/en/docs/Web/CSS/Attribute_selectors), rather than [class selectors](https://devel...
Try this ``` div[class*="health-bundle"]{background:red;} ```
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
What you need is called attribute selector. An example, using your html structure, is the following: ``` div.page-search-site[class*='-bundle-medical-group'] { color:red } ``` In the place of `div` you can add any element or remove it altogether, and in the place of `class` you can add any attribute of the sp...
``` <div class="page-search-site-health-bundle type-medical-group">Some text here</div> <div class="page-search-site-health-bundle type-clinic">Some text here</div> <div class="page-search-site-health-bundle type-hospital">Some text here</div> ```
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
```css div[class|=page-search-site-health-bundle] { color: red; } ``` ```html <div class="page-search-site-health-bundle-medical-group">Some text here</div> <div class="page-search-site-health-bundle-clinic">Some text here</div> <div class="page-search-site-health-bundle-hospital">Some text here</div> ``` Read ...
The CSS selector you're looking for looks like this. ```css div.page-search-site[class*=health-bundle] ``` It selects all `div` elements with class `page-search-site` and class attribute containing the substring `health-bundle`.
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
```css div[class|=page-search-site-health-bundle] { color: red; } ``` ```html <div class="page-search-site-health-bundle-medical-group">Some text here</div> <div class="page-search-site-health-bundle-clinic">Some text here</div> <div class="page-search-site-health-bundle-hospital">Some text here</div> ``` Read ...
``` <div class="page-search-site-health-bundle type-medical-group">Some text here</div> <div class="page-search-site-health-bundle type-clinic">Some text here</div> <div class="page-search-site-health-bundle type-hospital">Some text here</div> ```
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
You're looking for a selctor that selects all elements with a list of class names beginning with `health-bundle-` or containing `health-bundle-` preceded by a space so you'll need to use [attribute selectors](https://developer.mozilla.org/en/docs/Web/CSS/Attribute_selectors), rather than [class selectors](https://devel...
``` <div class="page-search-site-health-bundle type-medical-group">Some text here</div> <div class="page-search-site-health-bundle type-clinic">Some text here</div> <div class="page-search-site-health-bundle type-hospital">Some text here</div> ```
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
```css div[class|=page-search-site-health-bundle] { color: red; } ``` ```html <div class="page-search-site-health-bundle-medical-group">Some text here</div> <div class="page-search-site-health-bundle-clinic">Some text here</div> <div class="page-search-site-health-bundle-hospital">Some text here</div> ``` Read ...
Try this ``` div[class*="health-bundle"]{background:red;} ```
38,786,922
I have three `divs` with following class: ``` <div class="page-search-site health-bundle-medical-group">Some text here</div> <div class="health-bundle-clinic">Some text here 2</div> <div class="page-search-site health-bundle-hospital">Some text here 3</div> ``` Here `health-bundle-` text is common for all three cla...
2016/08/05
[ "https://Stackoverflow.com/questions/38786922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6682001/" ]
What you need is called attribute selector. An example, using your html structure, is the following: ``` div.page-search-site[class*='-bundle-medical-group'] { color:red } ``` In the place of `div` you can add any element or remove it altogether, and in the place of `class` you can add any attribute of the sp...
Try this ``` div[class*="health-bundle"]{background:red;} ```
43,313,660
I am trying to use Watson api for sentiment analysis. The code is quite simple. But why do I keep getting this error????? ``` WatsonException: Error: unsupported media type, Code: 415 ``` Nothing about this error in API document. ``` from watson_developer_cloud import AlchemyLanguageV1 alchemy_language = AlchemyLan...
2017/04/10
[ "https://Stackoverflow.com/questions/43313660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4355293/" ]
After reading the comments, I think this is what you may want. ``` private static void ShowMessageBox(){ MessageBox.Show("No such thing", "Warning"); } ``` when you need the messagebox, just use `ShowMessageBox()` you can also extend the method to ``` private static void ShowMessageBox(string msg){ Messag...
**You cannot create a new instance of the MessageBox class.** Look into the remarks section of below MSDN documentation. <https://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(v=vs.110).aspx> More over `show` returns `DialogResult`, which is enum type.
43,313,660
I am trying to use Watson api for sentiment analysis. The code is quite simple. But why do I keep getting this error????? ``` WatsonException: Error: unsupported media type, Code: 415 ``` Nothing about this error in API document. ``` from watson_developer_cloud import AlchemyLanguageV1 alchemy_language = AlchemyLan...
2017/04/10
[ "https://Stackoverflow.com/questions/43313660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4355293/" ]
> > When i make a search and the input doesn't found a match, this message box appears... And i need to use it for multiple exceptions > > > `MessageBox` doesn't have any public constructor so you can't create it and assign to a variable. But if you want to execute same code in different place, you can declare a `...
**You cannot create a new instance of the MessageBox class.** Look into the remarks section of below MSDN documentation. <https://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox(v=vs.110).aspx> More over `show` returns `DialogResult`, which is enum type.
43,313,660
I am trying to use Watson api for sentiment analysis. The code is quite simple. But why do I keep getting this error????? ``` WatsonException: Error: unsupported media type, Code: 415 ``` Nothing about this error in API document. ``` from watson_developer_cloud import AlchemyLanguageV1 alchemy_language = AlchemyLan...
2017/04/10
[ "https://Stackoverflow.com/questions/43313660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4355293/" ]
> > When i make a search and the input doesn't found a match, this message box appears... And i need to use it for multiple exceptions > > > `MessageBox` doesn't have any public constructor so you can't create it and assign to a variable. But if you want to execute same code in different place, you can declare a `...
After reading the comments, I think this is what you may want. ``` private static void ShowMessageBox(){ MessageBox.Show("No such thing", "Warning"); } ``` when you need the messagebox, just use `ShowMessageBox()` you can also extend the method to ``` private static void ShowMessageBox(string msg){ Messag...
14,418,265
I am trying to split up substring charaters from a string from what i have tryed so far has failed even looping within a loop. An example result from string "1234567890" the output could look like as follows ``` 12 345 6 7890 ``` . ``` var randomChar = "" var str = "123456789"; for (var j = 0; j < str.length; j++...
2013/01/19
[ "https://Stackoverflow.com/questions/14418265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904428/" ]
here you go: ``` var substrSize; while (str.length) { substrSize = Math.floor(Math.random()*3)+1; // at most 4? if (substrSize >= str.length) randomChar = str; else randomChar = str.substr(0,substrSize); str = str.substr(randomChar.length); ...
The problem with your code is that you always iterate `str.length` times. After cutting out for example first 3 random characters you should start from 4th, not from 2nd. And here is an elegant recursive solution, much different from yours: ``` function randString(s) { if(s.length > 0) { var pivot = Math.ceil...
14,418,265
I am trying to split up substring charaters from a string from what i have tryed so far has failed even looping within a loop. An example result from string "1234567890" the output could look like as follows ``` 12 345 6 7890 ``` . ``` var randomChar = "" var str = "123456789"; for (var j = 0; j < str.length; j++...
2013/01/19
[ "https://Stackoverflow.com/questions/14418265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904428/" ]
here you go: ``` var substrSize; while (str.length) { substrSize = Math.floor(Math.random()*3)+1; // at most 4? if (substrSize >= str.length) randomChar = str; else randomChar = str.substr(0,substrSize); str = str.substr(randomChar.length); ...
``` var randomChar = "" var str = "123456789"; var j = 0; while (j < str.length) { randomChar = Math.floor(Math.random() * 3) + 1; console.log(str.substr(j, randomChar)); j += randomChar; } ```
14,418,265
I am trying to split up substring charaters from a string from what i have tryed so far has failed even looping within a loop. An example result from string "1234567890" the output could look like as follows ``` 12 345 6 7890 ``` . ``` var randomChar = "" var str = "123456789"; for (var j = 0; j < str.length; j++...
2013/01/19
[ "https://Stackoverflow.com/questions/14418265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/904428/" ]
The problem with your code is that you always iterate `str.length` times. After cutting out for example first 3 random characters you should start from 4th, not from 2nd. And here is an elegant recursive solution, much different from yours: ``` function randString(s) { if(s.length > 0) { var pivot = Math.ceil...
``` var randomChar = "" var str = "123456789"; var j = 0; while (j < str.length) { randomChar = Math.floor(Math.random() * 3) + 1; console.log(str.substr(j, randomChar)); j += randomChar; } ```
16,784
I am currently working on a paper in the field of image reconstruction, or computational biology if you will. Now matter how I slice or dice it, it is one of these stories that cannot be told in 3500 words or so. Not only are there several equally important methodological points that need to be discussed to get a compl...
2014/02/10
[ "https://academia.stackexchange.com/questions/16784", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/11814/" ]
*Plos One* do not have an explicit word count limit, and computational biology should be on-topic for them: > > There are no explicit restrictions for the number of words, figures, or the length of the supporting information, although we encourage a concise and accessible writing style. > > > For further info s...
Have you considered [arXiv](http://arXiv.org)? They are open-access and handle quantitative biology e-prints. Here's an excerpt that may interest you from [their "Oversized Submissions" help page](http://arxiv.org/help/sizes): > > If you have trouble submitting a very long paper, such as a long review article with ma...
18,895,169
On a project Im working on we have a pretty advanced command-line interface to build, test, package and deploy software. Now we want to use jenkins as a front-end to this CLI and we want to be able to generate job configurations. We want the interface simple, the user only supply a couple of parameters and jenkins wil...
2013/09/19
[ "https://Stackoverflow.com/questions/18895169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2273479/" ]
You have to give the reference of the sequence to hibernate. ``` <generator class="sequence"> <param name="sequence">SEQUENCE_NAME</param> </generator> ```
What annotation can i use to do this? i've tried `@GeneratedValue(strategy=GenerationType.SEQUENCE , generator = <SEQUENCE_NAME>")` without any success edit: it seams that the generator have to also be created `@SequenceGenerator(name="<GEN_NAME>", sequenceName="<SEQUENCE_NAME>")`
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
> > 1. How does a reborn stream-winner know that he or she is one? > > > Like a math or music prodigy who can easily recall their skillset through just some basic exposure to music or math, a stream-winner would be like that, if not much quicker or even instantaneous since Path/Fruit are supra-mundane skills, unli...
> > **If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left** > > > For me, this is a very questionable interpretation of the teachings. Suttas such as SN 13.1 say a stream-enterer has around 1/100,000th of the ordinary suffering of an ordinary per...
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
> > 1. How does a reborn stream-winner know that he or she is one? > > > Like a math or music prodigy who can easily recall their skillset through just some basic exposure to music or math, a stream-winner would be like that, if not much quicker or even instantaneous since Path/Fruit are supra-mundane skills, unli...
> > How does a reborn stream-winner know that he or she is one? > > > I think there is no sign or feeling about this. (Is there any sign or feeling when one reach the sotapanna even in this life time?) The person "who attains a clear understanding of Three Marks of Existence and Four Noble Truths - and therefore ...
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
> > 1. How does a reborn stream-winner know that he or she is one? > > > Like a math or music prodigy who can easily recall their skillset through just some basic exposure to music or math, a stream-winner would be like that, if not much quicker or even instantaneous since Path/Fruit are supra-mundane skills, unli...
this sutta explains the mechanism of how one makes progress in dhamma after he/she is reborn in heaven. [AN4.191](https://suttacentral.net/pi/an4.191) (i couldn't find English translation, but you could change language from pali-english text to Russian and then use google translation to English). BAsically the sutta te...
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
> > 1. How does a reborn stream-winner know that he or she is one? > > > Like a math or music prodigy who can easily recall their skillset through just some basic exposure to music or math, a stream-winner would be like that, if not much quicker or even instantaneous since Path/Fruit are supra-mundane skills, unli...
[Sotapanna handbook](http://www.youblisher.com/p/623524-Sotapanna-Handbook-English/) I have posted this book couple of times. The publisher compiled nearly 50 suttas about stream enterer mentioned by Buddha. I'm wondering the same thing about reborn-stream enterer but couldnt find one mentioned by Buddha. IMO, it is li...
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
> > How does a reborn stream-winner know that he or she is one? > > > I think there is no sign or feeling about this. (Is there any sign or feeling when one reach the sotapanna even in this life time?) The person "who attains a clear understanding of Three Marks of Existence and Four Noble Truths - and therefore ...
Ruben2020, and who ever might be interested in answers of you question: Begin a time where the matter of "what makes one a stream-winner" seems to interest many and maybe because many "Noble-Born" are currently remind, meting they reminder, on their old path they have already gone, it's maybe worthy to recollect the t...
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
> > How does a reborn stream-winner know that he or she is one? > > > I think there is no sign or feeling about this. (Is there any sign or feeling when one reach the sotapanna even in this life time?) The person "who attains a clear understanding of Three Marks of Existence and Four Noble Truths - and therefore ...
The suttas seem quiet regarding questions 1 and 2, other than to say that a sotapanna will have no more than seven rebirths in the human and deva realms. Also, I have never heard or read of any teacher who contradicted the suttas in this regard. According to what I've read, beings in the lowest deva realm have lifesp...
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
[Sotapanna handbook](http://www.youblisher.com/p/623524-Sotapanna-Handbook-English/) I have posted this book couple of times. The publisher compiled nearly 50 suttas about stream enterer mentioned by Buddha. I'm wondering the same thing about reborn-stream enterer but couldnt find one mentioned by Buddha. IMO, it is li...
> > **If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left** > > > For me, this is a very questionable interpretation of the teachings. Suttas such as SN 13.1 say a stream-enterer has around 1/100,000th of the ordinary suffering of an ordinary per...
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
> > How does a reborn stream-winner know that he or she is one? > > > I think there is no sign or feeling about this. (Is there any sign or feeling when one reach the sotapanna even in this life time?) The person "who attains a clear understanding of Three Marks of Existence and Four Noble Truths - and therefore ...
> > **If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left** > > > For me, this is a very questionable interpretation of the teachings. Suttas such as SN 13.1 say a stream-enterer has around 1/100,000th of the ordinary suffering of an ordinary per...
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
[Sotapanna handbook](http://www.youblisher.com/p/623524-Sotapanna-Handbook-English/) I have posted this book couple of times. The publisher compiled nearly 50 suttas about stream enterer mentioned by Buddha. I'm wondering the same thing about reborn-stream enterer but couldnt find one mentioned by Buddha. IMO, it is li...
Ruben2020, and who ever might be interested in answers of you question: Begin a time where the matter of "what makes one a stream-winner" seems to interest many and maybe because many "Noble-Born" are currently remind, meting they reminder, on their old path they have already gone, it's maybe worthy to recollect the t...
11,748
If someone enters the stream and becomes a sotapanna (stream winner), then he would have at most, seven lifetimes left. What the stream is, is defined in [this answer](https://buddhism.stackexchange.com/a/11245/471) as: > > This noble eightfold path — right view, right resolve, right speech, > right action, right li...
2015/09/25
[ "https://buddhism.stackexchange.com/questions/11748", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/471/" ]
[Sotapanna handbook](http://www.youblisher.com/p/623524-Sotapanna-Handbook-English/) I have posted this book couple of times. The publisher compiled nearly 50 suttas about stream enterer mentioned by Buddha. I'm wondering the same thing about reborn-stream enterer but couldnt find one mentioned by Buddha. IMO, it is li...
The suttas seem quiet regarding questions 1 and 2, other than to say that a sotapanna will have no more than seven rebirths in the human and deva realms. Also, I have never heard or read of any teacher who contradicted the suttas in this regard. According to what I've read, beings in the lowest deva realm have lifesp...
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
Here is the sentence in question: ``` When I obtained a credit card, I began spending money recklessly. ``` *I began spending money recklessly*--this is the independent clause of a complex sentence. *I* is the subject; *began* is the action verb; *spending money recklessly* is the gerund phrase with the gerund itsel...
"I began spending money" - "began" is the verb, "spending money" is a two-part object with the gerund "spending". "spending" does not look like an infinitive as Stu W guesses. An infinitve would be "(to) spend". We may assume that the special verb construction "began spending money" derives from " began with the spend...
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
Aspectual predicates like *start, begin, continue, remain, finish, end*, and *stop* can take either gerund or infinitive complement clauses, and they can take either [A-Equi or A-Raising](http://www.umich.edu/~jlawler/cliffs-equi-raising.pdf). Here's the Syntax Lab report on *start* > > ***Start*** > > 1-place...
It is common for people to confuse participles with verbs in a sentence. Verbs are the words that express the action. "Spending" is not expressing the action. "Began" is expressing the action. This can be further confusing when you think of a sentence such as "I like spending money." Well, which is it? Do you like extr...
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
It is common for people to confuse participles with verbs in a sentence. Verbs are the words that express the action. "Spending" is not expressing the action. "Began" is expressing the action. This can be further confusing when you think of a sentence such as "I like spending money." Well, which is it? Do you like extr...
In the sentence, "began" is the principal verb. But "spending" is a verbal that is called participle. Here "spending" is serving the noun "money", thus actin the work of an adjective.
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
It isn't obvious what the best analysis is, because a case can be made that "begin" in this construction is not really a verb, but rather expresses an aspect of the following verb -- we could call it the "inceptive" aspect -- as alternative to the progressive or the perfect aspects. Fritz Newmeyer points out in his dis...
I've seen a lot of 500+ word answers on here, and not I don't think that's a bad thing at all, but for most of the answers, the point isn't conveyed until halfway through the answer. Simply put, *began* and *spending* are a Verb+Infinite pair, in which 2 verbs are used one after another to convey additional informatio...
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
It is common for people to confuse participles with verbs in a sentence. Verbs are the words that express the action. "Spending" is not expressing the action. "Began" is expressing the action. This can be further confusing when you think of a sentence such as "I like spending money." Well, which is it? Do you like extr...
I may be confused but isn't aspect still being revealed by the participle in that the finite verb states the action then aspect seems to be projected on to the participle, which is the object functionally, in a way that does demonstrate TAM-like information being conveyed by the verb/object pair on how time flew from t...
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
It is common for people to confuse participles with verbs in a sentence. Verbs are the words that express the action. "Spending" is not expressing the action. "Began" is expressing the action. This can be further confusing when you think of a sentence such as "I like spending money." Well, which is it? Do you like extr...
> > When I obtained a credit card, I began spending money recklessly. > > > Could be rewritten > > ...I began to spend money recklessly > > > so as others have pointed out, began is the finite verb (the verb here in past tense, the to-infinitive has (by definition) no tense/tempus) <http://www.grammaring.co...
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
Here is the sentence in question: ``` When I obtained a credit card, I began spending money recklessly. ``` *I began spending money recklessly*--this is the independent clause of a complex sentence. *I* is the subject; *began* is the action verb; *spending money recklessly* is the gerund phrase with the gerund itsel...
The word 'began' is the `verb`, while 'spending' is the `gerund`. They are separate because the `verb + gerund` and `verb + infinitive` forms are commonly used, and the `verb` is clearly differentiated from the `gerund`/`infinitive`. So "began spending" corresponds to `verb + gerund`, while "began to spend" correspon...
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
There are ***two verbs*** in the sentence. The verb ***began*** is in a form of "***past tense***" indicating the action of "begin" occurred in the unknown past, and the other one is in a form of "***[gerund](https://en.wikipedia.org/wiki/Gerund)***" indicating the object of the *transitive* verb "began" is the ***geru...
"I began spending money" - "began" is the verb, "spending money" is a two-part object with the gerund "spending". "spending" does not look like an infinitive as Stu W guesses. An infinitve would be "(to) spend". We may assume that the special verb construction "began spending money" derives from " began with the spend...
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
Aspectual predicates like *start, begin, continue, remain, finish, end*, and *stop* can take either gerund or infinitive complement clauses, and they can take either [A-Equi or A-Raising](http://www.umich.edu/~jlawler/cliffs-equi-raising.pdf). Here's the Syntax Lab report on *start* > > ***Start*** > > 1-place...
I may be confused but isn't aspect still being revealed by the participle in that the finite verb states the action then aspect seems to be projected on to the participle, which is the object functionally, in a way that does demonstrate TAM-like information being conveyed by the verb/object pair on how time flew from t...
283,665
I need help! Could you please look at this sentence: > > When I obtained a credit card, I began spending money recklessly. > > > I'm doing basic sentence patterns, and I don't know how to analyse this part: *began spending money*. Is *began spending* the verb in the sentence or just *began* without spending? Why...
2015/10/30
[ "https://english.stackexchange.com/questions/283665", "https://english.stackexchange.com", "https://english.stackexchange.com/users/145086/" ]
Aspectual predicates like *start, begin, continue, remain, finish, end*, and *stop* can take either gerund or infinitive complement clauses, and they can take either [A-Equi or A-Raising](http://www.umich.edu/~jlawler/cliffs-equi-raising.pdf). Here's the Syntax Lab report on *start* > > ***Start*** > > 1-place...
I've seen a lot of 500+ word answers on here, and not I don't think that's a bad thing at all, but for most of the answers, the point isn't conveyed until halfway through the answer. Simply put, *began* and *spending* are a Verb+Infinite pair, in which 2 verbs are used one after another to convey additional informatio...
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
There is a simpler way to fix the installation issue than symlinking the header file into PHP sources. When running `pecl install`, you can provide additional compile arguments via the `CFLAGS` environment variable. So, on the Apple Silicon platform, you can use the following command to get the extension to compile: `...
If you use MAMP, Based on [@Kelwin Tantono's answer](https://stackoverflow.com/a/66518746/11729615) follow instructions to install mongodb then, Firstly, check for the location of pcre2.h file by ``` cd /opt/homebrew/Cellar/pcre2/ ``` In this directory find the folder with `ls` command, in my case it was 10.40 . ...
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
I have finally solved my problem. I followed these steps from <https://github.com/mongodb/mongo-php-driver/issues/1159> After installing a newer PHP version where previously I used **7.3.24** and updated to **7.4.16**. Still had the same issue but diffrent file: > > fatal error: 'pcre2.h' file not found #include "p...
I have finally solved my problem. I used PHP 8.1.7 - Mac Pro 2022 - Apple Silicon (M1) My errors: `fatal error: 'pcre2.h' file not found` The solution that I used: ``` 1. brew install pcre2 2. ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/php/8.1.7/include/php/ext/pcre/pcre2.h Please...
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
I had the same issue with PHP 7.3, I solved it just by running the following commands: ``` cp /opt/homebrew/Cellar/pcre2/10.38/include/pcre2.h /opt/homebrew/Cellar/php@7.3/7.3.31/include/php/ext/pcre/pcre2.h ``` Then installed it successfully: ``` sudo pecl install mongodb ```
``` cp /Applications/MAMP/Library/include/pcre2.h /Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre/pcre2.h ``` then run ``` sudo pecl install mongodb ```
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
I had the same issue with PHP 7.3, I solved it just by running the following commands: ``` cp /opt/homebrew/Cellar/pcre2/10.38/include/pcre2.h /opt/homebrew/Cellar/php@7.3/7.3.31/include/php/ext/pcre/pcre2.h ``` Then installed it successfully: ``` sudo pecl install mongodb ```
If you use MAMP, Based on [@Kelwin Tantono's answer](https://stackoverflow.com/a/66518746/11729615) follow instructions to install mongodb then, Firstly, check for the location of pcre2.h file by ``` cd /opt/homebrew/Cellar/pcre2/ ``` In this directory find the folder with `ls` command, in my case it was 10.40 . ...
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
I have finally solved my problem. I used PHP 8.1.7 - Mac Pro 2022 - Apple Silicon (M1) My errors: `fatal error: 'pcre2.h' file not found` The solution that I used: ``` 1. brew install pcre2 2. ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/php/8.1.7/include/php/ext/pcre/pcre2.h Please...
I had the same issue with PHP 7.3, I solved it just by running the following commands: ``` cp /opt/homebrew/Cellar/pcre2/10.38/include/pcre2.h /opt/homebrew/Cellar/php@7.3/7.3.31/include/php/ext/pcre/pcre2.h ``` Then installed it successfully: ``` sudo pecl install mongodb ```
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
I have finally solved my problem. I followed these steps from <https://github.com/mongodb/mongo-php-driver/issues/1159> After installing a newer PHP version where previously I used **7.3.24** and updated to **7.4.16**. Still had the same issue but diffrent file: > > fatal error: 'pcre2.h' file not found #include "p...
``` cp /Applications/MAMP/Library/include/pcre2.h /Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre/pcre2.h ``` then run ``` sudo pecl install mongodb ```
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
I have finally solved my problem. I followed these steps from <https://github.com/mongodb/mongo-php-driver/issues/1159> After installing a newer PHP version where previously I used **7.3.24** and updated to **7.4.16**. Still had the same issue but diffrent file: > > fatal error: 'pcre2.h' file not found #include "p...
There is a simpler way to fix the installation issue than symlinking the header file into PHP sources. When running `pecl install`, you can provide additional compile arguments via the `CFLAGS` environment variable. So, on the Apple Silicon platform, you can use the following command to get the extension to compile: `...
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
There is a simpler way to fix the installation issue than symlinking the header file into PHP sources. When running `pecl install`, you can provide additional compile arguments via the `CFLAGS` environment variable. So, on the Apple Silicon platform, you can use the following command to get the extension to compile: `...
I have finally solved my problem. I used PHP 8.1.7 - Mac Pro 2022 - Apple Silicon (M1) My errors: `fatal error: 'pcre2.h' file not found` The solution that I used: ``` 1. brew install pcre2 2. ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/php/8.1.7/include/php/ext/pcre/pcre2.h Please...
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
I have finally solved my problem. I used PHP 8.1.7 - Mac Pro 2022 - Apple Silicon (M1) My errors: `fatal error: 'pcre2.h' file not found` The solution that I used: ``` 1. brew install pcre2 2. ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/php/8.1.7/include/php/ext/pcre/pcre2.h Please...
If you use MAMP, Based on [@Kelwin Tantono's answer](https://stackoverflow.com/a/66518746/11729615) follow instructions to install mongodb then, Firstly, check for the location of pcre2.h file by ``` cd /opt/homebrew/Cellar/pcre2/ ``` In this directory find the folder with `ls` command, in my case it was 10.40 . ...
66,496,119
I have php 7.4 installed on my macbook pro m1 ``` % php -v PHP 7.4.15 (cli) (built: Feb 26 2021 09:28:23) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.15, Copyright (c), by Zend Technologies ``` I'm trying to install the mongodb driver running: `...
2021/03/05
[ "https://Stackoverflow.com/questions/66496119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4826848/" ]
I have finally solved my problem. I used PHP 8.1.7 - Mac Pro 2022 - Apple Silicon (M1) My errors: `fatal error: 'pcre2.h' file not found` The solution that I used: ``` 1. brew install pcre2 2. ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/php/8.1.7/include/php/ext/pcre/pcre2.h Please...
``` cp /Applications/MAMP/Library/include/pcre2.h /Applications/MAMP/bin/php/php8.0.8/include/php/ext/pcre/pcre2.h ``` then run ``` sudo pecl install mongodb ```
64,553,510
Why is the case so? ------------------- So I have sales data distributed in multiple (.xlsx) files and I am working on a parser which can extract pricing information from all files. Problem is files neither have same names for the columns (e.g. Price, USD Price, $ Price, Wholesale Price, MSRP might be one of the few c...
2020/10/27
[ "https://Stackoverflow.com/questions/64553510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7212929/" ]
I've been struggling with the same for a while, but found this solution, which will check the **first row** with your regex and return only columns, where this regex expression return "true": ``` regex='your_regex_here' df1 = df[df.iloc[0].str.contains(regex, na=False).index[df.iloc[0].str.contains(regex, na=False)]]...
Use [`DataFrame.filter`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.filter.html) with `regex` and joined values by `|` for regex `or`: ``` possible_cols_name_parts = ['MSRP', 'Price', 'USD', '$', 'Wholesale'] df1 = df.filter(regex='|'.join(possible_cols_name_parts)) ``` Alternative: ...
43,015,809
If I try to connect to my MySQL database on my server(hosted on GoDaddy), I get this error: > > Internal Server Error > > > The server encountered an internal error or misconfiguration and was > unable to complete your request. Please contact the server > administrator to inform of the time the error occurred and...
2017/03/25
[ "https://Stackoverflow.com/questions/43015809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2894128/" ]
Don't use mysqli becouse it's old use pdo.Also don't put everything in one file..... Here is a working code,i have organized it into folders. ``` index.php scripts/ dbcon/ dbconfig.php functions start.php functions.php funcs.php ``` **dbconfig.php** ``` <?php...
Problem solved! I had a deconstructor in my class which caused the problem.
60,857,899
I have an ajax call which returns me a 2D array as such: ``` [ { "sweetness": "medium", "calories": 2359, "bitterness": 52 }, { "sweetness": "low", "calories": 4520, "bitterness": 34 }, { "sweetness": "extreme", "calories": 3414, "bitterness": 12 } ] ``` ...
2020/03/25
[ "https://Stackoverflow.com/questions/60857899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10470639/" ]
First of all your HTML is wrong. An id is an identifier that means it has to be unique. Use class instead. Second thing is that you would append this items to any item. You most probably want to append it to the end of the list so you should use `$('#results').append('')`. A nice solution with ES6 would be like (it i...
Wrap data in a $() so it become a jQuery object, then you can use its forEach method. ``` $(data).forEach( function( key, value) { $(".fruit-item").append("<div id='f-sweetness' > "+key.sweetness+"</div>" ); $(".fruit-item").append("<div id='f-calories' > "+key.calories+"</div>" ); $(".fruit-item").append(...
60,857,899
I have an ajax call which returns me a 2D array as such: ``` [ { "sweetness": "medium", "calories": 2359, "bitterness": 52 }, { "sweetness": "low", "calories": 4520, "bitterness": 34 }, { "sweetness": "extreme", "calories": 3414, "bitterness": 12 } ] ``` ...
2020/03/25
[ "https://Stackoverflow.com/questions/60857899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10470639/" ]
So, in HTML,. you shouldn't have duplicate id's... plus, you should actually look into the definition of the function you want to work with if you're new to javascript, for example, `forEach` callback does not have `value` and `key` but rather `currentValue` and `index` as specified in the [documentation](https://devel...
Wrap data in a $() so it become a jQuery object, then you can use its forEach method. ``` $(data).forEach( function( key, value) { $(".fruit-item").append("<div id='f-sweetness' > "+key.sweetness+"</div>" ); $(".fruit-item").append("<div id='f-calories' > "+key.calories+"</div>" ); $(".fruit-item").append(...
60,857,899
I have an ajax call which returns me a 2D array as such: ``` [ { "sweetness": "medium", "calories": 2359, "bitterness": 52 }, { "sweetness": "low", "calories": 4520, "bitterness": 34 }, { "sweetness": "extreme", "calories": 3414, "bitterness": 12 } ] ``` ...
2020/03/25
[ "https://Stackoverflow.com/questions/60857899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10470639/" ]
You can use Template Literals inside the *append* method: ```js data.forEach(i => { $("#results").append(` <div class="fruit-item"> <div id="f-calories">${i.calories}</div> <div id="f-sweetness">${i.sweetness}</div> <div id="f- bitterness">${i.bitterness}</div> </div> `) }) ```
Wrap data in a $() so it become a jQuery object, then you can use its forEach method. ``` $(data).forEach( function( key, value) { $(".fruit-item").append("<div id='f-sweetness' > "+key.sweetness+"</div>" ); $(".fruit-item").append("<div id='f-calories' > "+key.calories+"</div>" ); $(".fruit-item").append(...
60,857,899
I have an ajax call which returns me a 2D array as such: ``` [ { "sweetness": "medium", "calories": 2359, "bitterness": 52 }, { "sweetness": "low", "calories": 4520, "bitterness": 34 }, { "sweetness": "extreme", "calories": 3414, "bitterness": 12 } ] ``` ...
2020/03/25
[ "https://Stackoverflow.com/questions/60857899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10470639/" ]
So, in HTML,. you shouldn't have duplicate id's... plus, you should actually look into the definition of the function you want to work with if you're new to javascript, for example, `forEach` callback does not have `value` and `key` but rather `currentValue` and `index` as specified in the [documentation](https://devel...
First of all your HTML is wrong. An id is an identifier that means it has to be unique. Use class instead. Second thing is that you would append this items to any item. You most probably want to append it to the end of the list so you should use `$('#results').append('')`. A nice solution with ES6 would be like (it i...
60,857,899
I have an ajax call which returns me a 2D array as such: ``` [ { "sweetness": "medium", "calories": 2359, "bitterness": 52 }, { "sweetness": "low", "calories": 4520, "bitterness": 34 }, { "sweetness": "extreme", "calories": 3414, "bitterness": 12 } ] ``` ...
2020/03/25
[ "https://Stackoverflow.com/questions/60857899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10470639/" ]
First of all your HTML is wrong. An id is an identifier that means it has to be unique. Use class instead. Second thing is that you would append this items to any item. You most probably want to append it to the end of the list so you should use `$('#results').append('')`. A nice solution with ES6 would be like (it i...
You can use Template Literals inside the *append* method: ```js data.forEach(i => { $("#results").append(` <div class="fruit-item"> <div id="f-calories">${i.calories}</div> <div id="f-sweetness">${i.sweetness}</div> <div id="f- bitterness">${i.bitterness}</div> </div> `) }) ```
60,857,899
I have an ajax call which returns me a 2D array as such: ``` [ { "sweetness": "medium", "calories": 2359, "bitterness": 52 }, { "sweetness": "low", "calories": 4520, "bitterness": 34 }, { "sweetness": "extreme", "calories": 3414, "bitterness": 12 } ] ``` ...
2020/03/25
[ "https://Stackoverflow.com/questions/60857899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10470639/" ]
So, in HTML,. you shouldn't have duplicate id's... plus, you should actually look into the definition of the function you want to work with if you're new to javascript, for example, `forEach` callback does not have `value` and `key` but rather `currentValue` and `index` as specified in the [documentation](https://devel...
You can use Template Literals inside the *append* method: ```js data.forEach(i => { $("#results").append(` <div class="fruit-item"> <div id="f-calories">${i.calories}</div> <div id="f-sweetness">${i.sweetness}</div> <div id="f- bitterness">${i.bitterness}</div> </div> `) }) ```
41,131,349
Is it possible to save several prints from a for-loop as string variable? E.g. I have a dictionary and that has letters as keys, and each key's value represents how often the key should be printed. The overall printout should just be a string, that is then saved as variable. Simplified example: ``` hand = {'a':1, 'q...
2016/12/13
[ "https://Stackoverflow.com/questions/41131349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7259213/" ]
Multiplication of a string with a integer value say `n` repeats the value of original string by `n` times. For example: ``` >>> hand = {'a':1, 'q':1, 'l':3, 'm':1, 'u':1, 'i':1} >>> for k, v in hand.items(): ... print(k * v) ... a i m lll q u ``` So, in order to get all the results as a single string, you may jo...
You do know the order isn't guaranteed with a `dict` they are unordered. But you can do a `join()` with a generator expression: ``` >>> print(''.join(k for k, v in hand.items() for _ in range(v))) lllmaiuq ```
41,131,349
Is it possible to save several prints from a for-loop as string variable? E.g. I have a dictionary and that has letters as keys, and each key's value represents how often the key should be printed. The overall printout should just be a string, that is then saved as variable. Simplified example: ``` hand = {'a':1, 'q...
2016/12/13
[ "https://Stackoverflow.com/questions/41131349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7259213/" ]
Multiplication of a string with a integer value say `n` repeats the value of original string by `n` times. For example: ``` >>> hand = {'a':1, 'q':1, 'l':3, 'm':1, 'u':1, 'i':1} >>> for k, v in hand.items(): ... print(k * v) ... a i m lll q u ``` So, in order to get all the results as a single string, you may jo...
Or you can simple concatenate letters: ``` hand = {'a':1, 'q':1, 'l':3, 'm':1, 'u':1, 'i':1} new_str = "" for letter in hand.keys(): for j in range(hand[letter]): new_str += letter ``` but use .join() instead is more concise.
23,123,691
I want to join two tables together to get retrieve all the entities in one search. I have a one to many relationship: Jedi and Member. One member group can have many Jedi's. I want to make a form to search by one entity and displays all of the information as a whole. Example: Search for a Jedi by its assigned color ->...
2014/04/17
[ "https://Stackoverflow.com/questions/23123691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3229967/" ]
I think you didn't set the path correctly. [How to set Path in Java](http://www.javatpoint.com/how-to-set-path-in-java) > > The path is required to be set for using tools such as javac, java etc. > > > If you are saving the java source file inside the jdk/bin directory, > path is not required to be set because al...
If you did not do it already, it might help if you remove the package declaration in the java files. If your compiling class uses any other classes, they will not be compiled because of the package declaration. It happened with me once.
71,051,501
During sendmail compilation on Debian (raspberry) I've encountered problem with \_\_res\_querydomain undefinded funtion. How avoid it?
2022/02/09
[ "https://Stackoverflow.com/questions/71051501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12158823/" ]
Your application has thrown an error, not cypress. To avoid this, you will want to add this either to your test file or /support/index.js. This code was pulled from this [example](https://github.com/cypress-io/cypress-example-recipes/tree/master/examples/fundamentals__errors). [Remember `cy.` requires a test or a hook ...
You can catch exceptions globally by writing this under `cypress/support/index.js` ```js Cypress.on('uncaught:exception', (err, runnable) => { return false }) ```
36,966,442
What I want to know is the most code efficient way to convert (in swift 2): * Decimal to Binary * Binary to Decimal * Decimal to Hexadecimal * Hexadecimal to Decimal * Binary to Hexadecimal * Hexadecimal to Binary I already have a rudimentary and long-winded way of achieving this, but I would like to find a more effi...
2016/05/01
[ "https://Stackoverflow.com/questions/36966442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5623347/" ]
Both `String` and `Int` have initializers which take a `radix` (base). Combining those, you can achieve all of the conversions: ``` // Decimal to binary let d1 = 21 let b1 = String(d1, radix: 2) print(b1) // "10101" // Binary to decimal let b2 = "10110" let d2 = Int(b2, radix: 2)! print(d2) // 22 // Decimal to hexad...
**Swift Converter 2, 8, 10, 16** A bunch of `Int` and `String` is used to convert different systems. `Int` is used for working with decimal `String` is used for other types It is safe to convert a string representation of system to decimal and decimal to string representation ``` String -> Int -> String ``` Th...
36,966,442
What I want to know is the most code efficient way to convert (in swift 2): * Decimal to Binary * Binary to Decimal * Decimal to Hexadecimal * Hexadecimal to Decimal * Binary to Hexadecimal * Hexadecimal to Binary I already have a rudimentary and long-winded way of achieving this, but I would like to find a more effi...
2016/05/01
[ "https://Stackoverflow.com/questions/36966442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5623347/" ]
Both `String` and `Int` have initializers which take a `radix` (base). Combining those, you can achieve all of the conversions: ``` // Decimal to binary let d1 = 21 let b1 = String(d1, radix: 2) print(b1) // "10101" // Binary to decimal let b2 = "10110" let d2 = Int(b2, radix: 2)! print(d2) // 22 // Decimal to hexad...
from decimal to binary ``` extension Int { //10 -> "2" func decToBinString() -> String { return String(self, radix: 2, uppercase: true) } } extension String { //"2" -> 10 func binToDec() -> Int { return Int(self, radix: 2)! } } ```
36,966,442
What I want to know is the most code efficient way to convert (in swift 2): * Decimal to Binary * Binary to Decimal * Decimal to Hexadecimal * Hexadecimal to Decimal * Binary to Hexadecimal * Hexadecimal to Binary I already have a rudimentary and long-winded way of achieving this, but I would like to find a more effi...
2016/05/01
[ "https://Stackoverflow.com/questions/36966442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5623347/" ]
**Swift Converter 2, 8, 10, 16** A bunch of `Int` and `String` is used to convert different systems. `Int` is used for working with decimal `String` is used for other types It is safe to convert a string representation of system to decimal and decimal to string representation ``` String -> Int -> String ``` Th...
from decimal to binary ``` extension Int { //10 -> "2" func decToBinString() -> String { return String(self, radix: 2, uppercase: true) } } extension String { //"2" -> 10 func binToDec() -> Int { return Int(self, radix: 2)! } } ```
20,211,687
Only interested in Python 3, this is a lab for school and we aren't using Python2. Tools Python 3 and Ubuntu I want to first be able to download webpages of my choosing, e.g. www.example.com/index.html and save the index.html or what ever page I want. Then do the following bash ``` grep Href cut -d"/" -f3 sort -...
2013/11/26
[ "https://Stackoverflow.com/questions/20211687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3035280/" ]
There is a python package called [BeautifulSoup](http://www.crummy.com/software/BeautifulSoup/ "BeautifulSoup") which does what you need. ``` import urllib2 from bs4 import BeautifulSoup html_doc = urllib2.urlopen('http://www.google.com') soup = BeautifulSoup(html_doc) for link in soup.find_all('a'): print(link.g...
My try. Kept it as simple as I could (thus, not very efficient for an actual crawler) ``` from urllib import request # Fetch the page from the url we want page = request.urlopen('http://www.google.com').read() # print(page) def get_link(page): """ Get the first link from the page provided """ tag = 'href="' ...
20,211,687
Only interested in Python 3, this is a lab for school and we aren't using Python2. Tools Python 3 and Ubuntu I want to first be able to download webpages of my choosing, e.g. www.example.com/index.html and save the index.html or what ever page I want. Then do the following bash ``` grep Href cut -d"/" -f3 sort -...
2013/11/26
[ "https://Stackoverflow.com/questions/20211687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3035280/" ]
My try. Kept it as simple as I could (thus, not very efficient for an actual crawler) ``` from urllib import request # Fetch the page from the url we want page = request.urlopen('http://www.google.com').read() # print(page) def get_link(page): """ Get the first link from the page provided """ tag = 'href="' ...
Here You can read a post where everything you need is explained: - Download a web page - Using beautifulSoup - Extrac something you need Extract HTML code from URL in Python and C# - <http://www.manejandodatos.es/2014/1/extract-html-code-url-python-c>
20,211,687
Only interested in Python 3, this is a lab for school and we aren't using Python2. Tools Python 3 and Ubuntu I want to first be able to download webpages of my choosing, e.g. www.example.com/index.html and save the index.html or what ever page I want. Then do the following bash ``` grep Href cut -d"/" -f3 sort -...
2013/11/26
[ "https://Stackoverflow.com/questions/20211687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3035280/" ]
There is a python package called [BeautifulSoup](http://www.crummy.com/software/BeautifulSoup/ "BeautifulSoup") which does what you need. ``` import urllib2 from bs4 import BeautifulSoup html_doc = urllib2.urlopen('http://www.google.com') soup = BeautifulSoup(html_doc) for link in soup.find_all('a'): print(link.g...
Here You can read a post where everything you need is explained: - Download a web page - Using beautifulSoup - Extrac something you need Extract HTML code from URL in Python and C# - <http://www.manejandodatos.es/2014/1/extract-html-code-url-python-c>
109,241
I often see PhD students and faculty members describe their research interests on their web pages as something like: > > I am broadly interested in applied and computational mathematics. > > > What is the difference between applied math and computational math? Do applied mathematicians not necessarily work on c...
2018/05/06
[ "https://academia.stackexchange.com/questions/109241", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/92328/" ]
"Applied" math is in opposition to "pure" mathematics: that is, applied mathematics is used for a specific ("real-world") problem, such as fluid mechanics, statistical physics, or even the biosciences. This need not be computational: in many cases, it involves the study of differential equations and other analytical to...
It's possible to work on the development theoretical analysis of numerical methods for differential equations (and other mathematical problems) without any immediate application in mind or in response to specific problems posed by other applied mathematicians, scientists, or engineers. Researchers who do this typically...
109,241
I often see PhD students and faculty members describe their research interests on their web pages as something like: > > I am broadly interested in applied and computational mathematics. > > > What is the difference between applied math and computational math? Do applied mathematicians not necessarily work on c...
2018/05/06
[ "https://academia.stackexchange.com/questions/109241", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/92328/" ]
"Applied" math is in opposition to "pure" mathematics: that is, applied mathematics is used for a specific ("real-world") problem, such as fluid mechanics, statistical physics, or even the biosciences. This need not be computational: in many cases, it involves the study of differential equations and other analytical to...
My father worked on algorithms for calculating millions of digits of pi. That's computational, but not applied, since it's hard to find applications that require even twenty digits. I used probability theory to find a strategy for making use of imperfect information in order to sample a rare population as cheaply as p...
109,241
I often see PhD students and faculty members describe their research interests on their web pages as something like: > > I am broadly interested in applied and computational mathematics. > > > What is the difference between applied math and computational math? Do applied mathematicians not necessarily work on c...
2018/05/06
[ "https://academia.stackexchange.com/questions/109241", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/92328/" ]
My father worked on algorithms for calculating millions of digits of pi. That's computational, but not applied, since it's hard to find applications that require even twenty digits. I used probability theory to find a strategy for making use of imperfect information in order to sample a rare population as cheaply as p...
It's possible to work on the development theoretical analysis of numerical methods for differential equations (and other mathematical problems) without any immediate application in mind or in response to specific problems posed by other applied mathematicians, scientists, or engineers. Researchers who do this typically...
67,295,843
Trying to run instrumented tests in Android Studio results in a ``` Test running failed: Process crashed. ``` In greater detail in the logcat ``` E: FATAL EXCEPTION: main Process: com.nikolam.colorme.debug, PID: 19841 java.lang.NoSuchMethodError: No static method registerDefaultInstance(Ljava/lang/Class;Lco...
2021/04/28
[ "https://Stackoverflow.com/questions/67295843", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13440079/" ]
In my case it seems to be caused by `protobuf-lite:3.0.1` dependency from recently updated `androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0'` which I was able to fix with this exclude ``` androidTestImplementation (androidx.test.espresso:espresso-contrib:3.4.0'){ exclude module: "protobuf-...
Completing @Almighty's answer when using ktx: ``` api/implementation/testImplementation('androidx.test.espresso:espresso-contrib:3.4.0') { exclude(module = "protobuf-lite") } ```
5,427,124
I am trying to see if there is any way to invoke/start Outlook compose from a website (html/javascript). In additional, it would need to use a template. For example: I click on a button on a web page, it will start the Outlook compose message window and have a bunch of stuff in the body of the message ready (including...
2011/03/25
[ "https://Stackoverflow.com/questions/5427124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/118379/" ]
Anything other than `mailto`: would be a security risk. Browsers should never launch apps.
If the user has Outlook as default email client you can use a [mailto](http://www.webmonkey.com/2010/02/make_a_mailto_link/) link, don't see any other way right out of the box.
31,099
What happens if a persons unknowingly performs fardh salath, even though he is not clean (ejaculated in the night)? Suppose he does wudhu, performs fajr and also recites quran in the same condition. Only later does he realizes that there was an ejaculation in the night after seeing his clothes.
2016/05/05
[ "https://islam.stackexchange.com/questions/31099", "https://islam.stackexchange.com", "https://islam.stackexchange.com/users/16711/" ]
The short answer is as Laconic said: If you prayed your prayers without noticing that you have ejaculated you should re-do all of them, after performing *ghusl* (having a bath or shower) once you found out that you have been praying in this state. Because cleanliness (*tahara*) is a major condition for the validity of ...
If the person acknowledges that he is unclean after the prayer, he should make Alghosl (الغسل) then re-pray the prayer again (قضاء )
9,531,608
1. **org.sonatype.maven.plugin**:emma-maven-plugin:1.2 2. **org.codehaus.mojo**:emma-maven-plugin:1.0-alpha-3 3. **org.apache.maven.plugins**:maven-emma-plugin:0.5
2012/03/02
[ "https://Stackoverflow.com/questions/9531608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/167745/" ]
Use jacoco - emma in no longer supported. Jacoco supports java 7. ``` <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.5.6.201201232323</version> <executions> <execution> <id>jacoco-initialize</id> <phase>initialize</phase> <goals> <go...
I'm not sure which one is the best. I do know that there is hardly any documentation on the sonatype plugin (other than [this blog](http://www.sonatype.com/people/2009/06/integration-tests-with-maven-part-2-test-coverage-reports)). Also I think the apache one is rather old, so personally I would try the codehaus plugin...
41,614,798
I want to use just single LINQ query to fill nested lists in DB Entities using EntityFramework. I've got 3 Table Entities. First class `Cities` contains `List<Houses>` and `Houses` contains `List<Residents>` . Those classes: ``` class Cities { long CityId {get;set;} string Name {get;set;} List<House> H...
2017/01/12
[ "https://Stackoverflow.com/questions/41614798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3099551/" ]
You just need to include houses and residents into your cities query: ``` var cities = db.Cities.Include(c => c.Houses.Select(h => h.Residents)).ToList(); ```
You should use the navigation properties, not a separate `db` access ``` var Cities = (from city in db.Cities select new // Creating anonymous type to fill List of Houses { CityId = city.CityId, Name = city.Name, Houses = city.Houses.Select( new ...
24,403,832
Like MVC WebApi runs on the asynchronous ASP.NET pipeline, meaning [execution timeout is unsupported](http://forums.asp.net/t/1963799.aspx?MVC%205%20Request%20Timeout). In MVC I use the `[AsyncTimeout]` filter, WebApi doesn't have this. So how do I timeout a request in WebApi?
2014/06/25
[ "https://Stackoverflow.com/questions/24403832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324497/" ]
Building on the suggestion by Mendhak, it is possible to do what you want, though not exactly the way you'd like to do it without jumping through quite a few hoops. Doing it **without** a filter might look something like this: ``` public class ValuesController : ApiController { public async Task<HttpResponseMessag...
With WebAPI, you would generally handle timeouts on the *client* side, rather than the server side. This is because, and [I quote](https://aspnetwebstack.codeplex.com/discussions/358076): > > The way to cancel HTTP requests is to cancel them on the HttpClient directly. The reason being that multiple requests can reus...
24,403,832
Like MVC WebApi runs on the asynchronous ASP.NET pipeline, meaning [execution timeout is unsupported](http://forums.asp.net/t/1963799.aspx?MVC%205%20Request%20Timeout). In MVC I use the `[AsyncTimeout]` filter, WebApi doesn't have this. So how do I timeout a request in WebApi?
2014/06/25
[ "https://Stackoverflow.com/questions/24403832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324497/" ]
With WebAPI, you would generally handle timeouts on the *client* side, rather than the server side. This is because, and [I quote](https://aspnetwebstack.codeplex.com/discussions/358076): > > The way to cancel HTTP requests is to cancel them on the HttpClient directly. The reason being that multiple requests can reus...
Make your life easier, in your base controller add the following method: ``` protected async Task<T> RunTask<T>(Task<T> action, int timeout) { var timeoutTask = Task.Delay(timeout); var firstTaskFinished = await Task.WhenAny(timeoutTask, action); if (firstTaskFinished == timeoutTask) { ...
24,403,832
Like MVC WebApi runs on the asynchronous ASP.NET pipeline, meaning [execution timeout is unsupported](http://forums.asp.net/t/1963799.aspx?MVC%205%20Request%20Timeout). In MVC I use the `[AsyncTimeout]` filter, WebApi doesn't have this. So how do I timeout a request in WebApi?
2014/06/25
[ "https://Stackoverflow.com/questions/24403832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324497/" ]
For each endpoint where you want a timeout, pipe a `CancellationToken` through, e.g.: ``` [HttpGet] public Task<Response> GetAsync() { var tokenSource = new CancellationTokenSource(_timeoutInSec * 1000); return GetResponseAsync(tokenSource.Token); } ```
With WebAPI, you would generally handle timeouts on the *client* side, rather than the server side. This is because, and [I quote](https://aspnetwebstack.codeplex.com/discussions/358076): > > The way to cancel HTTP requests is to cancel them on the HttpClient directly. The reason being that multiple requests can reus...
24,403,832
Like MVC WebApi runs on the asynchronous ASP.NET pipeline, meaning [execution timeout is unsupported](http://forums.asp.net/t/1963799.aspx?MVC%205%20Request%20Timeout). In MVC I use the `[AsyncTimeout]` filter, WebApi doesn't have this. So how do I timeout a request in WebApi?
2014/06/25
[ "https://Stackoverflow.com/questions/24403832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324497/" ]
Building on the suggestion by Mendhak, it is possible to do what you want, though not exactly the way you'd like to do it without jumping through quite a few hoops. Doing it **without** a filter might look something like this: ``` public class ValuesController : ApiController { public async Task<HttpResponseMessag...
Make your life easier, in your base controller add the following method: ``` protected async Task<T> RunTask<T>(Task<T> action, int timeout) { var timeoutTask = Task.Delay(timeout); var firstTaskFinished = await Task.WhenAny(timeoutTask, action); if (firstTaskFinished == timeoutTask) { ...
24,403,832
Like MVC WebApi runs on the asynchronous ASP.NET pipeline, meaning [execution timeout is unsupported](http://forums.asp.net/t/1963799.aspx?MVC%205%20Request%20Timeout). In MVC I use the `[AsyncTimeout]` filter, WebApi doesn't have this. So how do I timeout a request in WebApi?
2014/06/25
[ "https://Stackoverflow.com/questions/24403832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/324497/" ]
For each endpoint where you want a timeout, pipe a `CancellationToken` through, e.g.: ``` [HttpGet] public Task<Response> GetAsync() { var tokenSource = new CancellationTokenSource(_timeoutInSec * 1000); return GetResponseAsync(tokenSource.Token); } ```
Make your life easier, in your base controller add the following method: ``` protected async Task<T> RunTask<T>(Task<T> action, int timeout) { var timeoutTask = Task.Delay(timeout); var firstTaskFinished = await Task.WhenAny(timeoutTask, action); if (firstTaskFinished == timeoutTask) { ...
23,279,420
I have a text string like this: ``` 1398097442.61 INFO Some Name: Some Thing ...9381 ``` I want to convert the number at the beginning into a human readable datetime. What I'm doing is this: ``` input.replace(/^(\d+\.?\d*)/g, new Date(parseFloat("$1") * 1000).toGMTString()); ``` This doesn't work. If I were to j...
2014/04/24
[ "https://Stackoverflow.com/questions/23279420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/602525/" ]
Just make sure you are passing a function to replace (after all, this isn't Scala) :-) ``` input.replace(/^(\d+\.?\d*)/g, function(match, timestamp) { return new Date(parseFloat(timestamp) * 1000).toGMTString(); }); ``` The way you *were* doing it created a date from the result of calling `parseFloat` on the string...
You may need this: ``` var subject = "1398097442.61 INFO Some Name: Some Thing ...9381"; var date = new Date(parseFloat(subject.replace(/(\d+\.\d+)/g, "$1")) * 1000).toGMTString(); console.log(date); ``` ***DEMO:*** <http://jsfiddle.net/tuga/xh2G6/>
11,638,437
I've been merrily using the DesignData in Windows Phone apps, and I was hoping to use it to help visualise designs in a Metro style app in VS2012/Blend for VS. I've tried the hopefully obvious: ``` <common:LayoutAwarePage x:Name="pageRoot" x:Class="MyRootNamespace.Views.EventView" DataContext="{Binding DefaultViewMod...
2012/07/24
[ "https://Stackoverflow.com/questions/11638437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50447/" ]
Is SpecialEvent your ViewModel? If so, can you do something like this in your XAML (directly after your common:LayoutAwarePage opening declaration)? ``` <d:Page.DataContext> <local:SpecialEvent> </d:Page.DataContext> ``` And then remove this line from your common:LayoutAwarePage: ``` d:DataContext="{d:DesignDat...
Try full path to the xaml file instead of relative.
11,638,437
I've been merrily using the DesignData in Windows Phone apps, and I was hoping to use it to help visualise designs in a Metro style app in VS2012/Blend for VS. I've tried the hopefully obvious: ``` <common:LayoutAwarePage x:Name="pageRoot" x:Class="MyRootNamespace.Views.EventView" DataContext="{Binding DefaultViewMod...
2012/07/24
[ "https://Stackoverflow.com/questions/11638437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50447/" ]
In Windows Phone (I believe) the path to the sample data file is relative to the application root. In Windows 8, the path to the sample data file is relative to the *page xaml file* you want to use it in. In your sample above, the *page.xaml* file would need to be in a sub-folder of the project but in a different fold...
Try full path to the xaml file instead of relative.
11,638,437
I've been merrily using the DesignData in Windows Phone apps, and I was hoping to use it to help visualise designs in a Metro style app in VS2012/Blend for VS. I've tried the hopefully obvious: ``` <common:LayoutAwarePage x:Name="pageRoot" x:Class="MyRootNamespace.Views.EventView" DataContext="{Binding DefaultViewMod...
2012/07/24
[ "https://Stackoverflow.com/questions/11638437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50447/" ]
Is SpecialEvent your ViewModel? If so, can you do something like this in your XAML (directly after your common:LayoutAwarePage opening declaration)? ``` <d:Page.DataContext> <local:SpecialEvent> </d:Page.DataContext> ``` And then remove this line from your common:LayoutAwarePage: ``` d:DataContext="{d:DesignDat...
In Windows Phone (I believe) the path to the sample data file is relative to the application root. In Windows 8, the path to the sample data file is relative to the *page xaml file* you want to use it in. In your sample above, the *page.xaml* file would need to be in a sub-folder of the project but in a different fold...
11,638,437
I've been merrily using the DesignData in Windows Phone apps, and I was hoping to use it to help visualise designs in a Metro style app in VS2012/Blend for VS. I've tried the hopefully obvious: ``` <common:LayoutAwarePage x:Name="pageRoot" x:Class="MyRootNamespace.Views.EventView" DataContext="{Binding DefaultViewMod...
2012/07/24
[ "https://Stackoverflow.com/questions/11638437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50447/" ]
Is SpecialEvent your ViewModel? If so, can you do something like this in your XAML (directly after your common:LayoutAwarePage opening declaration)? ``` <d:Page.DataContext> <local:SpecialEvent> </d:Page.DataContext> ``` And then remove this line from your common:LayoutAwarePage: ``` d:DataContext="{d:DesignDat...
This is a touch obscure, but it boils down to the implementation I had of `INotifyPropertyChanged` on my View-Model. In my Windows Phone code, I have to go to a small amount of effort to ensure that the events raised by background worker threads pop out on the UI thread: ``` protected delegate void OnUIThreadDelegate...
11,638,437
I've been merrily using the DesignData in Windows Phone apps, and I was hoping to use it to help visualise designs in a Metro style app in VS2012/Blend for VS. I've tried the hopefully obvious: ``` <common:LayoutAwarePage x:Name="pageRoot" x:Class="MyRootNamespace.Views.EventView" DataContext="{Binding DefaultViewMod...
2012/07/24
[ "https://Stackoverflow.com/questions/11638437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50447/" ]
In Windows Phone (I believe) the path to the sample data file is relative to the application root. In Windows 8, the path to the sample data file is relative to the *page xaml file* you want to use it in. In your sample above, the *page.xaml* file would need to be in a sub-folder of the project but in a different fold...
This is a touch obscure, but it boils down to the implementation I had of `INotifyPropertyChanged` on my View-Model. In my Windows Phone code, I have to go to a small amount of effort to ensure that the events raised by background worker threads pop out on the UI thread: ``` protected delegate void OnUIThreadDelegate...
18,346,875
I've been working on an MVC web application that uses the Ace in-browser code editor provided by Cloud9. The ace.js script and a script that sets up ace's editor are both in a ScriptBundle together on my BundleConfig. The bundle is being loaded perfectly fine. On my local server, with debug set to true in the web.confi...
2013/08/21
[ "https://Stackoverflow.com/questions/18346875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2701739/" ]
I find with Ace and MVC Bundling and Minification, I need to set the basePath in the ace configuration using an absolute reference. ``` ace.config.set("basePath", "/Scripts/FullPathToMy/AceEditorDirectory"); ``` It's probably not the best solution, but it should get you on your way.
The reason why Ace doesn't resolve the base path when you minify is because the minified version is a new unique name that does not match this pattern: `^(.*)\/ace(\-\w+)?\.js(\?|$)/`. Ace uses that pattern to find the script element that created it, and uses the `src` attribute to determine the path. @Paul's answer i...
11,240
I'm using the latest version of `moderncv` from CTAN. When I set : ``` \homepage {homepage: my.homepage.url/~username/} ``` The tilde doesn't show up. So I tried: ``` \usepackage{textcomp} \homepage {homepage: my.homepage.url/{\texttildelow}username/} ``` But.. that causes an infinite loop: ``` Package hyperref ...
2011/02/16
[ "https://tex.stackexchange.com/questions/11240", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/3637/" ]
``` \homepage {homepage: my.homepage.url/\textasciitilde username/} ``` should work.
This happens because this class first saves the `\homepage` argument away and then uses it inside `hyperref`s `\href` macro. The `~` is then already expanded to an unbreakable space and `\href` doesn't like macros like `\texttilde...` inside the URL part. Here a small patch of the internally used `\httplink` macro: ...
23,608,964
I have a list of list as follow: ``` List<List<Integer>> matchedPostions = findTerms(originalEntPos, singularEntPos, singText); ``` Consider this example ``` [ID,StartPostion,EndPostion] ^^^ [1,198,200] [2,50,61] ``` I am trying to sort list using `Collections.sort()`. How can I sort the values inside the `...
2014/05/12
[ "https://Stackoverflow.com/questions/23608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261002/" ]
You'll need to implement a `Comparator` to sort custom data-structures like the one you provided. ``` import static java.util.Arrays.asList; List<List<Integer>> matchedPostions = asList(asList(1, 198, 200), asList(2, 50, 61)); Collections.sort(matchedPostions, new Comparator<List<Integer>>() { @Override publi...
For the inner lists, you can just loop over them: ``` for(List<Integer> inner : outer){ Collections.sort(inner); } ``` For the outer List, you need a custom Comparator.
23,608,964
I have a list of list as follow: ``` List<List<Integer>> matchedPostions = findTerms(originalEntPos, singularEntPos, singText); ``` Consider this example ``` [ID,StartPostion,EndPostion] ^^^ [1,198,200] [2,50,61] ``` I am trying to sort list using `Collections.sort()`. How can I sort the values inside the `...
2014/05/12
[ "https://Stackoverflow.com/questions/23608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261002/" ]
For the inner lists, you can just loop over them: ``` for(List<Integer> inner : outer){ Collections.sort(inner); } ``` For the outer List, you need a custom Comparator.
If you can't define your own specialized classes for ranges, your can call `Collections.sort` with a your own `Comparator`. Example is below: ``` Collections.sort(list, new Comparator<List<Integer>>() { @Override public int compare(List<Integer> l1, List<Integer> l2) { ...
23,608,964
I have a list of list as follow: ``` List<List<Integer>> matchedPostions = findTerms(originalEntPos, singularEntPos, singText); ``` Consider this example ``` [ID,StartPostion,EndPostion] ^^^ [1,198,200] [2,50,61] ``` I am trying to sort list using `Collections.sort()`. How can I sort the values inside the `...
2014/05/12
[ "https://Stackoverflow.com/questions/23608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261002/" ]
You'll need to implement a `Comparator` to sort custom data-structures like the one you provided. ``` import static java.util.Arrays.asList; List<List<Integer>> matchedPostions = asList(asList(1, 198, 200), asList(2, 50, 61)); Collections.sort(matchedPostions, new Comparator<List<Integer>>() { @Override publi...
I would strongly recommend you create a class to hold your list values. This allows you to enjoy the benefits of type safety, including being sure you always have exactly two integer values (rather than a unknown number of items in a list). For instance: ``` public class Range implements Comparable<Range> { privat...
23,608,964
I have a list of list as follow: ``` List<List<Integer>> matchedPostions = findTerms(originalEntPos, singularEntPos, singText); ``` Consider this example ``` [ID,StartPostion,EndPostion] ^^^ [1,198,200] [2,50,61] ``` I am trying to sort list using `Collections.sort()`. How can I sort the values inside the `...
2014/05/12
[ "https://Stackoverflow.com/questions/23608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261002/" ]
You'll need to implement a `Comparator` to sort custom data-structures like the one you provided. ``` import static java.util.Arrays.asList; List<List<Integer>> matchedPostions = asList(asList(1, 198, 200), asList(2, 50, 61)); Collections.sort(matchedPostions, new Comparator<List<Integer>>() { @Override publi...
If you can't define your own specialized classes for ranges, your can call `Collections.sort` with a your own `Comparator`. Example is below: ``` Collections.sort(list, new Comparator<List<Integer>>() { @Override public int compare(List<Integer> l1, List<Integer> l2) { ...
23,608,964
I have a list of list as follow: ``` List<List<Integer>> matchedPostions = findTerms(originalEntPos, singularEntPos, singText); ``` Consider this example ``` [ID,StartPostion,EndPostion] ^^^ [1,198,200] [2,50,61] ``` I am trying to sort list using `Collections.sort()`. How can I sort the values inside the `...
2014/05/12
[ "https://Stackoverflow.com/questions/23608964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/261002/" ]
I would strongly recommend you create a class to hold your list values. This allows you to enjoy the benefits of type safety, including being sure you always have exactly two integer values (rather than a unknown number of items in a list). For instance: ``` public class Range implements Comparable<Range> { privat...
If you can't define your own specialized classes for ranges, your can call `Collections.sort` with a your own `Comparator`. Example is below: ``` Collections.sort(list, new Comparator<List<Integer>>() { @Override public int compare(List<Integer> l1, List<Integer> l2) { ...
16,617,713
I'm trying to fix the values in a field in an access table. The values look like this ``` G45-f1 C43-m1 C6-h1 M90_N9-h1 K9_Y7-h2 ``` I want to slice away everything before the dash "-" and delete the rest, to look like this: ``` G45 C43 C6 M90_N9 K9_Y7 ``` I know I can split the values at the dash `x.split("-")`,...
2013/05/17
[ "https://Stackoverflow.com/questions/16617713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/820088/" ]
`str.split()` always returns a list with at least one element, just select the first element of the result to ignore the rest: ``` x.split('-')[0] ``` You may want to limit the split count, since you are discarding everything but the first part anyway: ``` x.split('-', 1)[0] ```
You could create a new list ``` newlist = [x.split('-')[0] for x in oldlist] ```
16,617,713
I'm trying to fix the values in a field in an access table. The values look like this ``` G45-f1 C43-m1 C6-h1 M90_N9-h1 K9_Y7-h2 ``` I want to slice away everything before the dash "-" and delete the rest, to look like this: ``` G45 C43 C6 M90_N9 K9_Y7 ``` I know I can split the values at the dash `x.split("-")`,...
2013/05/17
[ "https://Stackoverflow.com/questions/16617713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/820088/" ]
`str.split()` always returns a list with at least one element, just select the first element of the result to ignore the rest: ``` x.split('-')[0] ``` You may want to limit the split count, since you are discarding everything but the first part anyway: ``` x.split('-', 1)[0] ```
You can use `str.split`, but you can also use `str.partition` which only splits to the first occurence and is always guaranteed to return a 3-tuple... (*head*, *delimiter*, *tail*): ``` >>> print 'M90_N9-h1'.partition('-')[0] M90_N9 ``` This has the advantage that should you want *tail*, then even if the delimiter i...
16,617,713
I'm trying to fix the values in a field in an access table. The values look like this ``` G45-f1 C43-m1 C6-h1 M90_N9-h1 K9_Y7-h2 ``` I want to slice away everything before the dash "-" and delete the rest, to look like this: ``` G45 C43 C6 M90_N9 K9_Y7 ``` I know I can split the values at the dash `x.split("-")`,...
2013/05/17
[ "https://Stackoverflow.com/questions/16617713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/820088/" ]
You can use `str.split`, but you can also use `str.partition` which only splits to the first occurence and is always guaranteed to return a 3-tuple... (*head*, *delimiter*, *tail*): ``` >>> print 'M90_N9-h1'.partition('-')[0] M90_N9 ``` This has the advantage that should you want *tail*, then even if the delimiter i...
You could create a new list ``` newlist = [x.split('-')[0] for x in oldlist] ```
6,545,654
I have a couple of lists like this: ``` <ul> <li class="list-header">Header</li> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> ``` By some rules I hide and show `<li>` items so sometimes the list has visible `<li>` and sometimes it has no visible `<li>` elements at all except the one with `list-header` class...
2011/07/01
[ "https://Stackoverflow.com/questions/6545654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135829/" ]
What you *could* do ([demo](http://jsfiddle.net/jensgram/8T8t2/5/)): ``` $('ul').each(function() { $ul = $(this); $ul.find('.list-header').toggle($ul.has('li:not(.list-header):visible').length != 0); }); ``` Basically, what the above does is toggling the `.list-header` (I've wrapped it in the `.each()` in or...
~~There is no `lh` element in HTML. References: [HTML5](http://www.w3.org/TR/html5/index.html#elements-1), [HTML4.01](http://www.w3.org/TR/html401/index/elements.html), [HTML 3.2](http://www.w3.org/TR/REC-html32).~~ *(You've removed the `lh` from the question.)* Instead, use an `li` with a class you style as you see f...
6,545,654
I have a couple of lists like this: ``` <ul> <li class="list-header">Header</li> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> ``` By some rules I hide and show `<li>` items so sometimes the list has visible `<li>` and sometimes it has no visible `<li>` elements at all except the one with `list-header` class...
2011/07/01
[ "https://Stackoverflow.com/questions/6545654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135829/" ]
What you *could* do ([demo](http://jsfiddle.net/jensgram/8T8t2/5/)): ``` $('ul').each(function() { $ul = $(this); $ul.find('.list-header').toggle($ul.has('li:not(.list-header):visible').length != 0); }); ``` Basically, what the above does is toggling the `.list-header` (I've wrapped it in the `.each()` in or...
You could use the `:visible` and `:not` selectors to see if there are any elements present when you change the visibility. This example toggles the visibility when clicking the elements, and hides the header if there are no elements present: ``` $('li:not(".list-header")').click(function(){ $(this).toggle(10,funct...
6,545,654
I have a couple of lists like this: ``` <ul> <li class="list-header">Header</li> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul> ``` By some rules I hide and show `<li>` items so sometimes the list has visible `<li>` and sometimes it has no visible `<li>` elements at all except the one with `list-header` class...
2011/07/01
[ "https://Stackoverflow.com/questions/6545654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135829/" ]
What you *could* do ([demo](http://jsfiddle.net/jensgram/8T8t2/5/)): ``` $('ul').each(function() { $ul = $(this); $ul.find('.list-header').toggle($ul.has('li:not(.list-header):visible').length != 0); }); ``` Basically, what the above does is toggling the `.list-header` (I've wrapped it in the `.each()` in or...
try this: ``` $("ul li:not('.list-header')").each(function(index, val) { if ($(this).text() == '') { $(this).hide(); } }); if (! ($('ul').has("li:visible:not('.list-header')").length)) { $('li.list-header').hide(); } ```
23,536,800
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'update\_time' in 'order clause'. The SQL statement executed was: ``` SELECT `t`.`id` AS `t0_c0`, `t`.`title` AS `t0_c1`, `t`.`content` AS `t0_c2`, `t`.`status` AS `t0_c3`, `t`.`tag...
2014/05/08
[ "https://Stackoverflow.com/questions/23536800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3436639/" ]
``` // try this way,hope this will help you... 1. First of all you have create "fonts" directory under "assets" directory and put you custom fonts file on "fonts" directory. 2. now try to apply this code here i used my custom fonts "Helvetica LT 45 Light_0.ttf" XML <LinearLayout xmlns:android="http://schemas.and...
Have a try with ``` mEditText.setTypeface(Typeface.createFromAsset(context.getAssets(),"fonts/DroidSansFallback.ttf")); ```
28,112,991
I am trying to upload a media item(image) using a specified template so I can utilize some extra field properties of the item. However, the image gets uploaded and still continues to use the default image template. Fiddler doesn't show any errors either. What am I doing wrong? Any suggestions? Here is the code snip: ...
2015/01/23
[ "https://Stackoverflow.com/questions/28112991", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4487157/" ]
It's always a good idea to profile and test, but `Math.log` is much more expensive than either `-` or `/`, so `Math.log(a/b)` (which calls `Math.log` only once) will, in principle, be faster than `Math.log(a) - Math.log(b)` (which calls it twice). > > Could the way I calculate `value` have an impact on performance (A...
I think `Math.log(a/b)` is faster. Why? To solve `.log(x)` the compiler first resolves the value of `x` which is `a/b` in this case. Thus, the steps to solve the `log` would be: 1. Solve `x` 2. Solve `a/b` 3. Solve `a` 4. Solve `b` 3. Return `a/b` 4. Return `log(a/b)` On the other hand the substraction of logs...
18,320,787
I am trying to load a class (say Class1:Interface ) without knowing its name from an assembly. My code looks like this: ``` Assembly a = Assembly.LoadFrom("MyDll.dll"); Type t = (Type)a.GetTypes()[0]; (Interface) classInstance = (Interface) (ClasActivator.CreateInstance(t); ``` Based on the articles I found online a...
2013/08/19
[ "https://Stackoverflow.com/questions/18320787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/378160/" ]
The assembly can hold more than one type (you likely have a `Settings.settings` file in the dll, it creates a class under the hood in the `Settings.Designer.cs` file), you only get the first class in your code which in your case turned out to be the `Settings` class, you need to go through all the types and search for ...
Just check to find the first that implements the interface: ``` Type t = a.GetTypes() .FirstOrDefault(type => type.GetInterface(typeof(Interface).FullName) != null); ```
56,966,242
**This is a long question because i try to explain the more i can my problem because it's a recurrent problem for me and i really don't understand so thank you for taking the time to read me** I want to create a sequential dense model which takes as input list with dimension like this: [batch\_size, data\_dimension] ...
2019/07/10
[ "https://Stackoverflow.com/questions/56966242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10168321/" ]
Change this: ``` output = dense_model.predict(state) ``` Into this: ``` output = dense_model.predict(np.array(state)) ``` Seems keras gets confused if you pass a plain list to predict and might not do what you want, this way you make sure that `state` is a numpy array of the shape you expect.
I am not a pro of Keras but I think, as @Matias Valdenegro said and since the algorithm is going to perform matrix multiplications through the network, it is expecting you to give an array. If you have only one state on which you want to perform prediction you can expand the dim of your data as follow : ```py state...