qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
45,806,209
Trying to complete a simple node.js exercise, I have tried several variations on this. I suspect I am missing something very simple. The reason I created var Calc was because I wanted to export the 'calculator' function. the error: ``` /Users/alex/zdev/react-project/calc.js:4 var add = function(){ ^^^ Synt...
2017/08/21
[ "https://Stackoverflow.com/questions/45806209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4231932/" ]
You define a new object `Calc` with a function `add`, but the syntax is incorrect. The correct syntax is: ``` var Calc = { add: function() { var num1 = readline.question("num1: "); var num2 = readline.question("num2: "); console.log(num1 + num2); } }; ```
I suggest using [JavaScript classes introduced in ECMAScript 2015](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Classes) ``` class Calculator { constructor() { console.log("[Calc] created!"); } static add(a, b) { return a+b; } } let Calc = new Calculator(); ```
45,806,209
Trying to complete a simple node.js exercise, I have tried several variations on this. I suspect I am missing something very simple. The reason I created var Calc was because I wanted to export the 'calculator' function. the error: ``` /Users/alex/zdev/react-project/calc.js:4 var add = function(){ ^^^ Synt...
2017/08/21
[ "https://Stackoverflow.com/questions/45806209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4231932/" ]
You define a new object `Calc` with a function `add`, but the syntax is incorrect. The correct syntax is: ``` var Calc = { add: function() { var num1 = readline.question("num1: "); var num2 = readline.question("num2: "); console.log(num1 + num2); } }; ```
solution is as follows: call file: ``` var calc = require('./calc'); var Calc = calc.Calc; Calc.add(); ``` calc file: ``` var Calc = { add: function(){ var num1 = readline.question("num1: "); var num2 = readline.question("num2: "); console.log(num1 + num2); ...
19,316,687
I have a kendo grid, it has a date column. I want to show date and time there. I am using below format in column definition, `format: "{0:dd-MMM-yyyy hh:mm:ss tt}"` In modal I used date type `Updated_Date: { type: "date" }` Output date is coming as '10-Oct-2013 12:00:00 AM', but actual date returned via ajax call is...
2013/10/11
[ "https://Stackoverflow.com/questions/19316687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1235024/" ]
There are two fields that are commonly confused: * [format](http://docs.kendoui.com/api/web/datetimepicker#configuration-format) : Specifies the format, which is used to format the value of the DateTimePicker displayed in the input. * [parseFormats](http://docs.kendoui.com/api/web/datetimepicker#configuration-parseFor...
Just had the exact same problem. It is because the grid is not recognising the field as a date. You need to add the "type" as follows: ``` columns : [ ... { field : "Date", title : "Date", type : "date", format : "{0:dd-MMM-yyyy hh:mm:ss tt}", parseFormats: ["yyyy-MM-dd'T'...
253,735
[![enter image description here](https://i.stack.imgur.com/2Ag15.jpg)](https://i.stack.imgur.com/2Ag15.jpg)I have an older outdoor GFCI outlet on a dedicated circuit that trips periodically. I am planning on switching it with a regular outlet and a GFCI breaker in order to get the GFCI circuitry away from the weather. ...
2022/07/28
[ "https://diy.stackexchange.com/questions/253735", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/126129/" ]
> > My main panel is a Siemens G3040B1200. When the subpanel was installed (3" away from the main panel), the installer brought only the hots into the subpanel and left the neutrals in the main panel. Is this OK? > > > No, that is not OK. This was very shabbily done and you should bring in a *competent* electricia...
The part number for the breaker you're searching for is: Eaton/Cutler-Hammer CH115GFI 1 Pole Circuit Breaker. The "CH" is important. ETN makes a "BR" breaker and those will not work in your sub panel. As mentioned in the comments, there might be better ways to do this.
142,215
I have a double-bowl, stainless steel kitchen sink mounted to a granite countertop, with a faucet with a pull-out spray head (pictured). [![faucet](https://i.stack.imgur.com/fgfWe.jpg)](https://i.stack.imgur.com/fgfWe.jpg) The faucet is no longer tightly mounted, so it wobbles back and forth. I'd like to tighten it. ...
2018/07/13
[ "https://diy.stackexchange.com/questions/142215", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/87736/" ]
> > the nut around that brass threaded pipe is how to tighten it? Is tightening that the right way to go? > > > YES and YES > > do you think I can get it tight enough just with that? Or should I expect to have to do something extra (plumber's putty?) > > > YES and NO - you should go ahead and try tightening ...
That brass nut is what I'd try if you can reach it. It looks like some sort of makeshift clamp blocks access to the nut. Is that silicone rubber all over one of the fittings? That is non standard and suggests either there was a leak or someone didn't know what they were doing in the first place. There are *two* corrug...
33,796,615
I have a table with few fields out of which 2 are of Varchar and Blob type. When I'm retrieving them using queryForMap, I'm getting a map instance with two keys(name of the column). I'm able to cast varchar to String simply but getting ClassCast Exception doing the same with Object. ``` file = new File(System.currentT...
2015/11/19
[ "https://Stackoverflow.com/questions/33796615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5036536/" ]
A `Blob` is just a wrapper for a (possibly large) `byte[]`. What you're getting back from Spring here is the interesting raw data, the `byte[]` (or `B[` in the exception's notation). So, just use that instead, it'll be much easier to work with: ``` byte[] blob = (byte[]) map.get("SAMPLE_DOC"); ```
Please check what class it has as this: ``` System.out.println(map.get("SAMPLE_DOC").getClass().getName()); ``` then cast to this type, then you can use the API of this type to do something with it.
24,590,228
I just upgraded angularjs from angularjs 1.2.9 to angularjs 1.2.19 and angularjs bootstrap version .7 upgraded to .11 I am now getting an that I am not sure about. here is the error: > > TypeError: ngModelCtrl.$render is not a function > > > The `$render` error appears to be due to a line in ui-bootstrap-0.11 ...
2014/07/05
[ "https://Stackoverflow.com/questions/24590228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/347644/" ]
In a similar case, I replaced page attribute with ng-model on pagination directive, that fixed my issue. Can you try that too?
Jacob pointed out that there was a discussion that I overlooked on this very issue: <https://github.com/angular-ui/bootstrap/issues/2157> To fix my issue all I did was add an ng-model to the pagination directive. Thanks for your help, everyone.
24,590,228
I just upgraded angularjs from angularjs 1.2.9 to angularjs 1.2.19 and angularjs bootstrap version .7 upgraded to .11 I am now getting an that I am not sure about. here is the error: > > TypeError: ngModelCtrl.$render is not a function > > > The `$render` error appears to be due to a line in ui-bootstrap-0.11 ...
2014/07/05
[ "https://Stackoverflow.com/questions/24590228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/347644/" ]
Jacob pointed out that there was a discussion that I overlooked on this very issue: <https://github.com/angular-ui/bootstrap/issues/2157> To fix my issue all I did was add an ng-model to the pagination directive. Thanks for your help, everyone.
I changed Directive Name 'pagination' to diffrentName. Then problem was solved.
24,590,228
I just upgraded angularjs from angularjs 1.2.9 to angularjs 1.2.19 and angularjs bootstrap version .7 upgraded to .11 I am now getting an that I am not sure about. here is the error: > > TypeError: ngModelCtrl.$render is not a function > > > The `$render` error appears to be due to a line in ui-bootstrap-0.11 ...
2014/07/05
[ "https://Stackoverflow.com/questions/24590228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/347644/" ]
In a similar case, I replaced page attribute with ng-model on pagination directive, that fixed my issue. Can you try that too?
I changed Directive Name 'pagination' to diffrentName. Then problem was solved.
60,579
After reading ["Is *everyone*" singular or plural?"](https://english.stackexchange.com/questions/225/is-everyone-singular-or-plural), I would refrain from asking this question, but the husband of a colleague of mine (English professor, native speaker of British English) stated against it, so I am looking for further en...
2012/03/09
[ "https://english.stackexchange.com/questions/60579", "https://english.stackexchange.com", "https://english.stackexchange.com/users/18424/" ]
***Some*** indeed can be use in this general sense. If you visit [OneLook](http://www.onelook.com/?w=some&ls=a), you'll see several meanings of the word ***some***. One of them reads: > > **some** *used for referring to a person or thing without knowing or without saying exactly which one* > > > So, saying: > ...
*[Some](http://dictionary.cambridge.org/dictionary/british/some_1)* is used to refer to a particular person or thing without stating which. For example, > > **Some** customer called yesterday. > > >
60,579
After reading ["Is *everyone*" singular or plural?"](https://english.stackexchange.com/questions/225/is-everyone-singular-or-plural), I would refrain from asking this question, but the husband of a colleague of mine (English professor, native speaker of British English) stated against it, so I am looking for further en...
2012/03/09
[ "https://english.stackexchange.com/questions/60579", "https://english.stackexchange.com", "https://english.stackexchange.com/users/18424/" ]
***Some*** indeed can be use in this general sense. If you visit [OneLook](http://www.onelook.com/?w=some&ls=a), you'll see several meanings of the word ***some***. One of them reads: > > **some** *used for referring to a person or thing without knowing or without saying exactly which one* > > > So, saying: > ...
You're right, he's right, they're right, everyone's right. Just incomplete. No one has mentioned the important detail. "A non-existent town" - CORRECT "Some non-existent town" - INFORMAL That's all there is to it. "Some" is being used EXACTLY the way "a" is supposed to be used. You can't use "some" in this way in p...
60,579
After reading ["Is *everyone*" singular or plural?"](https://english.stackexchange.com/questions/225/is-everyone-singular-or-plural), I would refrain from asking this question, but the husband of a colleague of mine (English professor, native speaker of British English) stated against it, so I am looking for further en...
2012/03/09
[ "https://english.stackexchange.com/questions/60579", "https://english.stackexchange.com", "https://english.stackexchange.com/users/18424/" ]
*[Some](http://dictionary.cambridge.org/dictionary/british/some_1)* is used to refer to a particular person or thing without stating which. For example, > > **Some** customer called yesterday. > > >
You're right, he's right, they're right, everyone's right. Just incomplete. No one has mentioned the important detail. "A non-existent town" - CORRECT "Some non-existent town" - INFORMAL That's all there is to it. "Some" is being used EXACTLY the way "a" is supposed to be used. You can't use "some" in this way in p...
10,399,488
having some issues upgrading my Sitefinity 4.1.1339.0 installation to 4.3 (and ultimately to Sitefinity 5). It is giving me the following error: > > > > > > Could not load file or assembly 'Telerik.Sitefinity, Version=4.1.1339.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. The loc...
2012/05/01
[ "https://Stackoverflow.com/questions/10399488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1245804/" ]
I'm not sure I understand what's going on here, but are they complaining about the data going from the form to the "http://website/script.asp" without being checked? Because, if so, then that's just ridiculous because even if you *chose* to do some JavaScript / other client-side checking, one should never rely on it. ...
It's a security risk because it's possible to type `<script>cross_site_​scripting.nasl</script>`.asp into a form (or a hidden element), and have it appear on your pages. That lets other websites inject arbitary code into your website. If you're *just* using a contact form and have no user login or cookies, then this is...
10,399,488
having some issues upgrading my Sitefinity 4.1.1339.0 installation to 4.3 (and ultimately to Sitefinity 5). It is giving me the following error: > > > > > > Could not load file or assembly 'Telerik.Sitefinity, Version=4.1.1339.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. The loc...
2012/05/01
[ "https://Stackoverflow.com/questions/10399488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1245804/" ]
I'm not sure I understand what's going on here, but are they complaining about the data going from the form to the "http://website/script.asp" without being checked? Because, if so, then that's just ridiculous because even if you *chose* to do some JavaScript / other client-side checking, one should never rely on it. ...
Your script is immediately at risk because you're blindly using $\_POST for your email headers. This could allow a person to manipulate the header of the email to send to a wildcard email address, or simply use your form on your server to send spam to others. With a content type of HTML, you should run `htmlentities(...
17,341
I'm looking for historical data of the CAC40 components. I looked at these previously asked questions: * [What data sources are available online?](https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online) * [Finding historical data for indices](https://quant.stackexchange.com/questions/146...
2015/04/11
[ "https://quant.stackexchange.com/questions/17341", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/15910/" ]
I'm not sure if you are looking for the components only or if you want more data, like the weights in the index. Unfortunately, unlike most other data on the web, it's hard to get any good financial data for free. The only easy way is to pay for accessing it through a financial data provider such as Bloomberg (with ME...
You can try Quandl. They have a nice API to R and Python which you can use to do the data-wrangling.
17,341
I'm looking for historical data of the CAC40 components. I looked at these previously asked questions: * [What data sources are available online?](https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online) * [Finding historical data for indices](https://quant.stackexchange.com/questions/146...
2015/04/11
[ "https://quant.stackexchange.com/questions/17341", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/15910/" ]
I'm not sure if you are looking for the components only or if you want more data, like the weights in the index. Unfortunately, unlike most other data on the web, it's hard to get any good financial data for free. The only easy way is to pay for accessing it through a financial data provider such as Bloomberg (with ME...
As you said yourself, Yahoo finance provides the historical stock data. The only thing left is to know the historical composition of the CAC40. This information can be extracted from the french [wikipedia site about the CAC40](http://fr.wikipedia.org/wiki/CAC_40#Historique_de_la_composition), or from the source @jean-p...
17,341
I'm looking for historical data of the CAC40 components. I looked at these previously asked questions: * [What data sources are available online?](https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online) * [Finding historical data for indices](https://quant.stackexchange.com/questions/146...
2015/04/11
[ "https://quant.stackexchange.com/questions/17341", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/15910/" ]
I'm not sure if you are looking for the components only or if you want more data, like the weights in the index. Unfortunately, unlike most other data on the web, it's hard to get any good financial data for free. The only easy way is to pay for accessing it through a financial data provider such as Bloomberg (with ME...
This data isn't free obviously, but Euronext (the index provider) might be inclined to give you this information if it's for academic purposes. It's advertised on their website here: <https://www.euronext.com/fr/market-data/products/end-day-index-data>
17,341
I'm looking for historical data of the CAC40 components. I looked at these previously asked questions: * [What data sources are available online?](https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online) * [Finding historical data for indices](https://quant.stackexchange.com/questions/146...
2015/04/11
[ "https://quant.stackexchange.com/questions/17341", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/15910/" ]
I'm not sure if you are looking for the components only or if you want more data, like the weights in the index. Unfortunately, unlike most other data on the web, it's hard to get any good financial data for free. The only easy way is to pay for accessing it through a financial data provider such as Bloomberg (with ME...
Bloomberg or datastream are the only possible sources.
17,341
I'm looking for historical data of the CAC40 components. I looked at these previously asked questions: * [What data sources are available online?](https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online) * [Finding historical data for indices](https://quant.stackexchange.com/questions/146...
2015/04/11
[ "https://quant.stackexchange.com/questions/17341", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/15910/" ]
As you said yourself, Yahoo finance provides the historical stock data. The only thing left is to know the historical composition of the CAC40. This information can be extracted from the french [wikipedia site about the CAC40](http://fr.wikipedia.org/wiki/CAC_40#Historique_de_la_composition), or from the source @jean-p...
You can try Quandl. They have a nice API to R and Python which you can use to do the data-wrangling.
17,341
I'm looking for historical data of the CAC40 components. I looked at these previously asked questions: * [What data sources are available online?](https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online) * [Finding historical data for indices](https://quant.stackexchange.com/questions/146...
2015/04/11
[ "https://quant.stackexchange.com/questions/17341", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/15910/" ]
This data isn't free obviously, but Euronext (the index provider) might be inclined to give you this information if it's for academic purposes. It's advertised on their website here: <https://www.euronext.com/fr/market-data/products/end-day-index-data>
You can try Quandl. They have a nice API to R and Python which you can use to do the data-wrangling.
17,341
I'm looking for historical data of the CAC40 components. I looked at these previously asked questions: * [What data sources are available online?](https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online) * [Finding historical data for indices](https://quant.stackexchange.com/questions/146...
2015/04/11
[ "https://quant.stackexchange.com/questions/17341", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/15910/" ]
As you said yourself, Yahoo finance provides the historical stock data. The only thing left is to know the historical composition of the CAC40. This information can be extracted from the french [wikipedia site about the CAC40](http://fr.wikipedia.org/wiki/CAC_40#Historique_de_la_composition), or from the source @jean-p...
Bloomberg or datastream are the only possible sources.
17,341
I'm looking for historical data of the CAC40 components. I looked at these previously asked questions: * [What data sources are available online?](https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online) * [Finding historical data for indices](https://quant.stackexchange.com/questions/146...
2015/04/11
[ "https://quant.stackexchange.com/questions/17341", "https://quant.stackexchange.com", "https://quant.stackexchange.com/users/15910/" ]
This data isn't free obviously, but Euronext (the index provider) might be inclined to give you this information if it's for academic purposes. It's advertised on their website here: <https://www.euronext.com/fr/market-data/products/end-day-index-data>
Bloomberg or datastream are the only possible sources.
30,834,806
One of the goals of Flux is to make the app more predictable by reducing crazy tangled dependencies. Using the Dispatcher you can define a strict order in which the Stores are updated. That creates a nice tree dependency hierarchy. That's the theory. Consider following situation: I have a game. The store sitting at th...
2015/06/14
[ "https://Stackoverflow.com/questions/30834806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/576997/" ]
In [Flux](https://facebook.github.io/flux/docs/overview.html#content) stores should be as independent from each other as possible and should not read from each other. The only way to change their state is through actions. In your case, if some store decides that the game is over — you should update a StateStore from t...
For those having the same issue, you can read [here](https://github.com/tobice/flux-lumines/wiki/Making-of-Lumines#circular-dependencies) about the actual application I had this problem with and how I approached it. Long story short, I allowed all the stores to arbitrarily read from each other (the suggested solution n...
30,108
I am on SLiM, and I don't like the default login screen. I want a login screen like the one shown below: ![enter image description here](https://i.stack.imgur.com/t9Jgs.png) But instead I have a pretty minimal one which has just one textbox and nothing else on the screen. I can't find a screenshot of it, but that is...
2012/01/26
[ "https://unix.stackexchange.com/questions/30108", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/4605/" ]
I found that this is possible by editing the `slim.conf` file available in `/etc`. You would need admin credentials to open this file. SLiM themes are placed in `/usr/share/slim/themes`: ![enter image description here](https://i.stack.imgur.com/34K7n.png) In the `slim.conf` file, there is a section that mentions ...
The SLiM website has a page detailing how to [create your own theme](http://slim.berlios.de/themes_howto.php). You can find additional themes on a number of sites, including [Gnome Look](http://gnome-look.org/) and in the [Arch User Repository](https://aur.archlinux.org/packages.php?O=0&K=slim-theme&do_Search=Go)...
30,108
I am on SLiM, and I don't like the default login screen. I want a login screen like the one shown below: ![enter image description here](https://i.stack.imgur.com/t9Jgs.png) But instead I have a pretty minimal one which has just one textbox and nothing else on the screen. I can't find a screenshot of it, but that is...
2012/01/26
[ "https://unix.stackexchange.com/questions/30108", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/4605/" ]
I found that this is possible by editing the `slim.conf` file available in `/etc`. You would need admin credentials to open this file. SLiM themes are placed in `/usr/share/slim/themes`: ![enter image description here](https://i.stack.imgur.com/34K7n.png) In the `slim.conf` file, there is a section that mentions ...
Probably the best way would be to install GDM, beacuse the login manager is much more better than slim, Slim has LITERALLY no scrollbars... or anything. You cannot change your window manager or desktop enviroment either. (On slim) I preffer GDM, since its more reliable and easy to use. It does not require editing the c...
30,108
I am on SLiM, and I don't like the default login screen. I want a login screen like the one shown below: ![enter image description here](https://i.stack.imgur.com/t9Jgs.png) But instead I have a pretty minimal one which has just one textbox and nothing else on the screen. I can't find a screenshot of it, but that is...
2012/01/26
[ "https://unix.stackexchange.com/questions/30108", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/4605/" ]
The SLiM website has a page detailing how to [create your own theme](http://slim.berlios.de/themes_howto.php). You can find additional themes on a number of sites, including [Gnome Look](http://gnome-look.org/) and in the [Arch User Repository](https://aur.archlinux.org/packages.php?O=0&K=slim-theme&do_Search=Go)...
Probably the best way would be to install GDM, beacuse the login manager is much more better than slim, Slim has LITERALLY no scrollbars... or anything. You cannot change your window manager or desktop enviroment either. (On slim) I preffer GDM, since its more reliable and easy to use. It does not require editing the c...
36,903,952
I want to create a log file whilst my script extracts 7z I'm using the following: ``` 7z x "*.7z" >> logfile.log 2>&1 ``` But terminal stops displaying output and the log file is blank...
2016/04/28
[ "https://Stackoverflow.com/questions/36903952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6251051/" ]
`doors[k] % j` is nonsense (`"Closed" % 1`). `k % j == 0` will be true for the 0-th door, always. Use `(k + 1) % j` to trigger 2nd, 5th, 8th (i.e. #3, #6, #9 in English)... when `j` is `3`. While it's not an error, it would be easier if you had just Boolean values in the array: say, `false` for closed, `true` for ope...
This is how I solved this problem. I think you dont need "closed" or "open". Instead try to use booleans(true or false) instead. ```js function getFinalOpenedDoors(numDoors) { const array=[]; for(let i=1; i<101;i++){ array[i]=false } let turn=1 while(turn<=100){ for(let i=turn; i<101;i++){ if(i%turn===0){ ...
57,219
I'm trying to pick out the best plants to attract birds to my yard, and have become very interested in serviceberry trees for this purpose. Should I avoid the hybrid varieties of this species (such as *Amelanchier × grandiflora*) in favor of versions like *A. canadensis* which birds and insects may be more familiar wit...
2021/04/07
[ "https://gardening.stackexchange.com/questions/57219", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/24416/" ]
*Amelanchier* × *grandiflora* is an example of a "nativar," that is, a cultivated variety of a native plant. While there's some range of opinions, reputable sources agree that it's best to plant the native species (eg, *A. canadensis*) if you can get them. If you can't get native species, nativars are at least better ...
While this is a natural question to ask, there is no one-size-fits-all answer to this question: it depends on the particular hybrid. **Naturally-occurring Hybrids** Some hybrids are naturally occurring and even fertile. For example, in the Mid-Atlantic, the hybrid oak *Quercus x heterophylla*, which is a cross of wil...
57,219
I'm trying to pick out the best plants to attract birds to my yard, and have become very interested in serviceberry trees for this purpose. Should I avoid the hybrid varieties of this species (such as *Amelanchier × grandiflora*) in favor of versions like *A. canadensis* which birds and insects may be more familiar wit...
2021/04/07
[ "https://gardening.stackexchange.com/questions/57219", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/24416/" ]
*Amelanchier* × *grandiflora* is an example of a "nativar," that is, a cultivated variety of a native plant. While there's some range of opinions, reputable sources agree that it's best to plant the native species (eg, *A. canadensis*) if you can get them. If you can't get native species, nativars are at least better ...
Though this answer doesn't supplant the great and detailed ones that were given when I first asked the question, I recently came across a source which addresses the precise nativar cross I was looking into: <https://www.ecobeneficial.com/ask_ecobeneficial/is-autumn-brilliance-serviceberry-a-good-pollinator-bird-plant/...
48,084,907
For example, I have a column with email addresses and I want to remove everything before the @ sign and everything after the '.' so I can attain the company names. Such as: ``` Emails loo@yahoo.com christina@google.com rachel@espn.com john@apple.com ahmed@microsoft.com ``` I want to create a new column that looks...
2018/01/03
[ "https://Stackoverflow.com/questions/48084907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5578650/" ]
You can easily use Mid and Find functions. Mid gives you the substring from one text with arguments : text from which to find, start and no. of characters to be extracted. And find returns the position of character in the word . Use this formula in A2 cell and A1 cell contains your string ``` =MID(A1,FIND("@",A1)+1...
with data in **A2**, in **B2** enter: ``` =SUBSTITUTE(MID(A2,FIND("@",A2)+1,9999),".com","") ``` [![enter image description here](https://i.stack.imgur.com/nrYL9.png)](https://i.stack.imgur.com/nrYL9.png) This will work for all emails ending in *.com* and if there are some records that do not have *com* at the end,...
48,084,907
For example, I have a column with email addresses and I want to remove everything before the @ sign and everything after the '.' so I can attain the company names. Such as: ``` Emails loo@yahoo.com christina@google.com rachel@espn.com john@apple.com ahmed@microsoft.com ``` I want to create a new column that looks...
2018/01/03
[ "https://Stackoverflow.com/questions/48084907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5578650/" ]
You can easily use Mid and Find functions. Mid gives you the substring from one text with arguments : text from which to find, start and no. of characters to be extracted. And find returns the position of character in the word . Use this formula in A2 cell and A1 cell contains your string ``` =MID(A1,FIND("@",A1)+1...
Select the column (or copy it into a new column) and press `Ctrl`+`H` to go to Find & Replace: 1. Find \*@ and replace with nothing (keep blank). 2. Find .\* and replace with nothing (keep blank). Here \* represents any sequence of characters.
1,407,121
> > Let n be a positive integer with $f(n)= 1! +2! +3!+... +n!$ and P(x), > Q(x) be polynomials in $x$ such that $f(n+2)=P(n)f(n+1)+Q(n)f(n)$ for > all $n \geq 1$, then which of the options **is/are** correct? > > > 1. $P(x)= x+3$ > 2. $Q(x)= -x-2$ > 3. $P(x)= -x-2$ > 4. $Q(x)= x+3$ > > > I managed to get tha...
2015/08/23
[ "https://math.stackexchange.com/questions/1407121", "https://math.stackexchange.com", "https://math.stackexchange.com/users/201608/" ]
$$ \big[1!+2!+\dots+n!+(n+1)!+(n+2)!\big]=\\ \big[1!+2!+\dots+n!+(n+1)!\big]P(n)+\\ \big[1!+2!+\dots+n!\big]Q(n) $$ So an easy way to get this is to have $P(n)+Q(n)=1$ so that all terms $1!+2!+\dots+n!$ come out right. Then we want $P(n)$ so that $$ (n+1)!P(n) = (n+1)!+(n+2)! $$ Divide by $(n+1)!$ to get $$ P(n) = 1+(n...
If $P(x)$ is greater than linear or $Q(x)$ is greater than quadratic you have a delicate cancellation which can not be achieved. You have to have $Q$ one degree higher than $P$. Now look at lots of points for large $n$ and argue the difference cannot have that many roots. I am handwaving, but I believe it. Given that, ...
5,836,329
How many bytes is `unsigned long long`? Is it the same as `unsigned long long int` ?
2011/04/29
[ "https://Stackoverflow.com/questions/5836329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/731638/" ]
Executive summary: it's 64 bits, or larger. `unsigned long long` is the same as `unsigned long long int`. Its size is platform-dependent, but guaranteed by the C standard (ISO C99) to be at least 64 bits. There was no `long long` in C89, but apparently even MSVC supports it, so it's quite portable. In the current C++...
The beauty of C++, like C, is that the sized of these things are implementation-defined, so there's no correct answer without your specifying the compiler you're using. Are those two the same? Yes. "long long" is a synonym for "long long int", for any compiler that will accept both.
5,836,329
How many bytes is `unsigned long long`? Is it the same as `unsigned long long int` ?
2011/04/29
[ "https://Stackoverflow.com/questions/5836329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/731638/" ]
The beauty of C++, like C, is that the sized of these things are implementation-defined, so there's no correct answer without your specifying the compiler you're using. Are those two the same? Yes. "long long" is a synonym for "long long int", for any compiler that will accept both.
Use the operator `sizeof`, it will give you the size of a type expressed in byte. One byte is eight bits. See the following program: ``` #include <iostream> int main(int,char**) { std::cout << "unsigned long long " << sizeof(unsigned long long) << "\n"; std::cout << "unsigned long long int " << sizeof(unsigned long...
5,836,329
How many bytes is `unsigned long long`? Is it the same as `unsigned long long int` ?
2011/04/29
[ "https://Stackoverflow.com/questions/5836329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/731638/" ]
Executive summary: it's 64 bits, or larger. `unsigned long long` is the same as `unsigned long long int`. Its size is platform-dependent, but guaranteed by the C standard (ISO C99) to be at least 64 bits. There was no `long long` in C89, but apparently even MSVC supports it, so it's quite portable. In the current C++...
It must be at least 64 bits. Other than that it's implementation defined. Strictly speaking, `unsigned long long` isn't standard in C++ until the C++0x standard. `unsigned long long` is a 'simple-type-specifier' for the type `unsigned long long int` (so they're synonyms). The `long long` set of types is also in C99 a...
5,836,329
How many bytes is `unsigned long long`? Is it the same as `unsigned long long int` ?
2011/04/29
[ "https://Stackoverflow.com/questions/5836329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/731638/" ]
Executive summary: it's 64 bits, or larger. `unsigned long long` is the same as `unsigned long long int`. Its size is platform-dependent, but guaranteed by the C standard (ISO C99) to be at least 64 bits. There was no `long long` in C89, but apparently even MSVC supports it, so it's quite portable. In the current C++...
Use the operator `sizeof`, it will give you the size of a type expressed in byte. One byte is eight bits. See the following program: ``` #include <iostream> int main(int,char**) { std::cout << "unsigned long long " << sizeof(unsigned long long) << "\n"; std::cout << "unsigned long long int " << sizeof(unsigned long...
5,836,329
How many bytes is `unsigned long long`? Is it the same as `unsigned long long int` ?
2011/04/29
[ "https://Stackoverflow.com/questions/5836329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/731638/" ]
It must be at least 64 bits. Other than that it's implementation defined. Strictly speaking, `unsigned long long` isn't standard in C++ until the C++0x standard. `unsigned long long` is a 'simple-type-specifier' for the type `unsigned long long int` (so they're synonyms). The `long long` set of types is also in C99 a...
Use the operator `sizeof`, it will give you the size of a type expressed in byte. One byte is eight bits. See the following program: ``` #include <iostream> int main(int,char**) { std::cout << "unsigned long long " << sizeof(unsigned long long) << "\n"; std::cout << "unsigned long long int " << sizeof(unsigned long...
193,787
I'm building a compiler for fun, and this is my first pass at the lexer for it. It should handle all tokens for C99, with the exception of the preprocessor tokens. It's very minimal, only grabbing the token and lexeme. Specific areas where I'd like feedback: * I rarely get to use anything beyond C++98. Are there any m...
2018/05/06
[ "https://codereview.stackexchange.com/questions/193787", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/41400/" ]
``` #ifndef __JMCOMP_LEXER_H__ ``` That is a symbol [reserved for use by the implementation](https://timsong-cpp.github.io/cppwp/n4659/lex.name#3). Writing your this in a way that mimics what you see in the compiler-supplied headers is exactly wrong! For this and other reasons I suggest leaving that out completely a...
### Include what you use You use `isdigit`, `isalpha`, etc. -- but you haven't included `ctype.h` or `cctype` to assure that they're declared. ### Broken Code ``` bool startsIdentifier(char character) { return std::isalpha(character) || character == '_'); } ``` I'm not sure if you accidentally messed this up w...
193,787
I'm building a compiler for fun, and this is my first pass at the lexer for it. It should handle all tokens for C99, with the exception of the preprocessor tokens. It's very minimal, only grabbing the token and lexeme. Specific areas where I'd like feedback: * I rarely get to use anything beyond C++98. Are there any m...
2018/05/06
[ "https://codereview.stackexchange.com/questions/193787", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/41400/" ]
``` #ifndef __JMCOMP_LEXER_H__ ``` That is a symbol [reserved for use by the implementation](https://timsong-cpp.github.io/cppwp/n4659/lex.name#3). Writing your this in a way that mimics what you see in the compiler-supplied headers is exactly wrong! For this and other reasons I suggest leaving that out completely a...
Same Lexer writtern in Lex. Lexer.l ------- ``` startsIdentifier [a-zA-Z_] isInIdentifier {startsIdentifier}|[0-9] isHexChar [0-9A-Fa-f] isOctal [0-7] isDigit [0-9] isWhitespace [ \n\t] skipWhitespace {isWhi...
193,787
I'm building a compiler for fun, and this is my first pass at the lexer for it. It should handle all tokens for C99, with the exception of the preprocessor tokens. It's very minimal, only grabbing the token and lexeme. Specific areas where I'd like feedback: * I rarely get to use anything beyond C++98. Are there any m...
2018/05/06
[ "https://codereview.stackexchange.com/questions/193787", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/41400/" ]
``` #ifndef __JMCOMP_LEXER_H__ ``` That is a symbol [reserved for use by the implementation](https://timsong-cpp.github.io/cppwp/n4659/lex.name#3). Writing your this in a way that mimics what you see in the compiler-supplied headers is exactly wrong! For this and other reasons I suggest leaving that out completely a...
Spotted a bug: ``` while (character == '/' && peekChar() == '/') { skipLineComment(); character = skipWhitespace(); } while (character == '/' && peekChar() == '*') { skipBlockComment(); character = skipWhitespace(); } ``` If you get a block comment followed by a line comment then you will hit the res...
193,787
I'm building a compiler for fun, and this is my first pass at the lexer for it. It should handle all tokens for C99, with the exception of the preprocessor tokens. It's very minimal, only grabbing the token and lexeme. Specific areas where I'd like feedback: * I rarely get to use anything beyond C++98. Are there any m...
2018/05/06
[ "https://codereview.stackexchange.com/questions/193787", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/41400/" ]
### Include what you use You use `isdigit`, `isalpha`, etc. -- but you haven't included `ctype.h` or `cctype` to assure that they're declared. ### Broken Code ``` bool startsIdentifier(char character) { return std::isalpha(character) || character == '_'); } ``` I'm not sure if you accidentally messed this up w...
Spotted a bug: ``` while (character == '/' && peekChar() == '/') { skipLineComment(); character = skipWhitespace(); } while (character == '/' && peekChar() == '*') { skipBlockComment(); character = skipWhitespace(); } ``` If you get a block comment followed by a line comment then you will hit the res...
193,787
I'm building a compiler for fun, and this is my first pass at the lexer for it. It should handle all tokens for C99, with the exception of the preprocessor tokens. It's very minimal, only grabbing the token and lexeme. Specific areas where I'd like feedback: * I rarely get to use anything beyond C++98. Are there any m...
2018/05/06
[ "https://codereview.stackexchange.com/questions/193787", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/41400/" ]
Same Lexer writtern in Lex. Lexer.l ------- ``` startsIdentifier [a-zA-Z_] isInIdentifier {startsIdentifier}|[0-9] isHexChar [0-9A-Fa-f] isOctal [0-7] isDigit [0-9] isWhitespace [ \n\t] skipWhitespace {isWhi...
Spotted a bug: ``` while (character == '/' && peekChar() == '/') { skipLineComment(); character = skipWhitespace(); } while (character == '/' && peekChar() == '*') { skipBlockComment(); character = skipWhitespace(); } ``` If you get a block comment followed by a line comment then you will hit the res...
51,851,535
I'd like to pass other arguments to my on\_failure\_callback function but it only seems to want "context". How do I pass other arguments to that function...especially since I'd like to define that function in a separate module so it can be used in all my DAGS. My current default\_args looks like this: ``` default_ar...
2018/08/15
[ "https://Stackoverflow.com/questions/51851535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5428968/" ]
Assuming the args are something you can define at the DAG level, then you can use the partials package. ie: ``` from functools import partial def generic_failure(arg1, arg2, context): # do whatever default_args = { 'owner': 'Me', 'depends_on_past': True, 'start_date': datetime(2016,01,01), 'email': ['me@me...
you can use a nested function for this ``` def generic_failure(arg1, arg2): def failure(context): message = 'we have a function that failed witg args : {ARG1}, {ARG2}'.format(ARG1=arg1,ARG2=arg2) print(message) return message return failure arg1 = 'arg1' arg2 = 'arg2' default_args = {...
69,252,761
I just made the change from Qt 5.12.3 to 6.1.2. Having done this I went ahead and compiled a very simple QML App: ``` import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.0 ApplicationWindow { id: mainWindow visible: true //visibility: Window.Maximized width: 1000 height: 800...
2021/09/20
[ "https://Stackoverflow.com/questions/69252761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/792589/" ]
> > whenever this workflow runs on a PR that was issued by Dependabot - it fails as Dependabot PRs don't have the same secret access as other pull requests do. > > > This should no longer (Nov./Dec. 2021) be the case: > > GitHub Actions: Workflows triggered by Dependabot receive **[dependabot secrets](https://do...
[This issue](https://github.com/dependabot/dependabot-core/issues/3253) describes some options to solve your problem
36,684,006
I checked all around the internet to find out how to check if a tree is a subSet of another. By subset, I mean The `issubset` function should `return 1` if all the elements of the first tree appear in the second tree and `0` otherwise. Note that depending on the insertion order of elements, two trees with same set of e...
2016/04/18
[ "https://Stackoverflow.com/questions/36684006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5890251/" ]
I'm not sure I understand your question, but I still try to give you my answer. From your example I assume that you're working with binary search trees. But I do not know what kind of binary tree you're using, I will assume a general scheme. I guess if the tree is somewhat balanced then maybe you can get a better algor...
Binary search trees support efficient sorted iteration over the elements. Maintain an iterator over the elements of each tree in nondecreasing order. Repeat the following until a result is determined: * If the first iterator has no more elements, return `TRUE`. * If the second iterator has no more elements, return `FA...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
Just to add to Marti's answer: If the recipe was written in the US within the past 30-40 (maybe more) years, "condensed" almost *certainly* means sweetened condensed. Sweetened is just assumed if the milk is described as "condensed". At least in the US, unsweetened condensed milk is never called "condensed", it is call...
No, the two products are different. As the names imply: * *Condensed milk* is strictly reduced milk * *Sweetened condensed milk* is reduced milk with considerable sugar added See [Can evaporated milk be converted to sweetened condensed?](https://cooking.stackexchange.com/questions/4600/can-evaporated-milk-be-converte...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
Technically no, it is not the same thing. Sweetened condensed milk has a very high sugar content, something like 40%, while just condensed milk has no sugar at all. But this still doesn't tell us what the recipe author meant. The availability of different types of condensed and evaporated milks seem to differ a lot i...
No, the two products are different. As the names imply: * *Condensed milk* is strictly reduced milk * *Sweetened condensed milk* is reduced milk with considerable sugar added See [Can evaporated milk be converted to sweetened condensed?](https://cooking.stackexchange.com/questions/4600/can-evaporated-milk-be-converte...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
Technically no, it is not the same thing. Sweetened condensed milk has a very high sugar content, something like 40%, while just condensed milk has no sugar at all. But this still doesn't tell us what the recipe author meant. The availability of different types of condensed and evaporated milks seem to differ a lot i...
As a recipe developer / chef... 'Sweetened Condensed Milk' and 'Condensed Milk' are exactly the same product - just labeled differently by different manufacturers for different markets. Condensed milk is ALWAYS sweetened. Here's the lowdown: Evaporated Milk, is just that. Milk that has been evaporated with 60% of the...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
Just to add to Marti's answer: If the recipe was written in the US within the past 30-40 (maybe more) years, "condensed" almost *certainly* means sweetened condensed. Sweetened is just assumed if the milk is described as "condensed". At least in the US, unsweetened condensed milk is never called "condensed", it is call...
As a recipe developer / chef... 'Sweetened Condensed Milk' and 'Condensed Milk' are exactly the same product - just labeled differently by different manufacturers for different markets. Condensed milk is ALWAYS sweetened. Here's the lowdown: Evaporated Milk, is just that. Milk that has been evaporated with 60% of the...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
In my experience, "condensed" milk refers to the sweetened product, and "evaporated" milk refers to the unsweetened product. People will often say "sweetened condensed" for clarity, but this is not strictly necessary: if your recipe calls for condensed milk, use the syrupy stuff. However, if this is an older recipe, a...
As a recipe developer / chef... 'Sweetened Condensed Milk' and 'Condensed Milk' are exactly the same product - just labeled differently by different manufacturers for different markets. Condensed milk is ALWAYS sweetened. Here's the lowdown: Evaporated Milk, is just that. Milk that has been evaporated with 60% of the...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
Technically no, it is not the same thing. Sweetened condensed milk has a very high sugar content, something like 40%, while just condensed milk has no sugar at all. But this still doesn't tell us what the recipe author meant. The availability of different types of condensed and evaporated milks seem to differ a lot i...
I've found when I run across the phrase "condensed milk" vs. the more specific "sweetened condensed milk," the recipe has its origins in the UK, such as in this recipe: <http://www.saveur.com/article/Recipes/Banoffee-Pie-Classic>. First, look for clues in the recipe: it's not likely 1/2 cup of brown sugar would create ...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
Just to add to Marti's answer: If the recipe was written in the US within the past 30-40 (maybe more) years, "condensed" almost *certainly* means sweetened condensed. Sweetened is just assumed if the milk is described as "condensed". At least in the US, unsweetened condensed milk is never called "condensed", it is call...
I've found when I run across the phrase "condensed milk" vs. the more specific "sweetened condensed milk," the recipe has its origins in the UK, such as in this recipe: <http://www.saveur.com/article/Recipes/Banoffee-Pie-Classic>. First, look for clues in the recipe: it's not likely 1/2 cup of brown sugar would create ...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
I've found when I run across the phrase "condensed milk" vs. the more specific "sweetened condensed milk," the recipe has its origins in the UK, such as in this recipe: <http://www.saveur.com/article/Recipes/Banoffee-Pie-Classic>. First, look for clues in the recipe: it's not likely 1/2 cup of brown sugar would create ...
No, the two products are different. As the names imply: * *Condensed milk* is strictly reduced milk * *Sweetened condensed milk* is reduced milk with considerable sugar added See [Can evaporated milk be converted to sweetened condensed?](https://cooking.stackexchange.com/questions/4600/can-evaporated-milk-be-converte...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
In my experience, "condensed" milk refers to the sweetened product, and "evaporated" milk refers to the unsweetened product. People will often say "sweetened condensed" for clarity, but this is not strictly necessary: if your recipe calls for condensed milk, use the syrupy stuff. However, if this is an older recipe, a...
No, the two products are different. As the names imply: * *Condensed milk* is strictly reduced milk * *Sweetened condensed milk* is reduced milk with considerable sugar added See [Can evaporated milk be converted to sweetened condensed?](https://cooking.stackexchange.com/questions/4600/can-evaporated-milk-be-converte...
40,697
Is condensed milk the same as sweetened condensed milk? I have a fudge recipe that calls for condensed milk and I can not find strictly condensed milk, only sweetened condensed milk or evaporated milk.
2013/12/30
[ "https://cooking.stackexchange.com/questions/40697", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/22232/" ]
In my experience, "condensed" milk refers to the sweetened product, and "evaporated" milk refers to the unsweetened product. People will often say "sweetened condensed" for clarity, but this is not strictly necessary: if your recipe calls for condensed milk, use the syrupy stuff. However, if this is an older recipe, a...
I've found when I run across the phrase "condensed milk" vs. the more specific "sweetened condensed milk," the recipe has its origins in the UK, such as in this recipe: <http://www.saveur.com/article/Recipes/Banoffee-Pie-Classic>. First, look for clues in the recipe: it's not likely 1/2 cup of brown sugar would create ...
4,360,845
If we look at the equation \begin{align} z = \sqrt{ 8 - 6 i }, \end{align} we will find the solutions \begin{align} z\_1 = -3+i \end{align} \begin{align} z\_2 = 3 - i \end{align} How can they be both correct if we can substitute \begin{align} \sqrt{ 8 - 6 i } = -3+i \end{align} \begin{align} \sqrt{ 8 - 6 i } ...
2022/01/19
[ "https://math.stackexchange.com/questions/4360845", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1016571/" ]
This is because taking square roots in the complex plane is not an injective function. In the case of positive real numbers, the square root function is uniquely defined as the positive square root of the number. Here is a quick explanation of branches in the complex plane: <https://plus.maths.org/content/maths-minute-...
Every nonzero complex number $w$ has exactly two distinct square roots (say $z\_1$ and $z\_2$, so that $z\_1^2 = z\_2^2 = w$), and they are opposites (i.e., $z\_2 = -z\_1$). These roots certainly aren't equal; what are equal are their **squares**. Your mistake is calling them both $\sqrt{w}$. It might be more correct t...
4,360,845
If we look at the equation \begin{align} z = \sqrt{ 8 - 6 i }, \end{align} we will find the solutions \begin{align} z\_1 = -3+i \end{align} \begin{align} z\_2 = 3 - i \end{align} How can they be both correct if we can substitute \begin{align} \sqrt{ 8 - 6 i } = -3+i \end{align} \begin{align} \sqrt{ 8 - 6 i } ...
2022/01/19
[ "https://math.stackexchange.com/questions/4360845", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1016571/" ]
This is because taking square roots in the complex plane is not an injective function. In the case of positive real numbers, the square root function is uniquely defined as the positive square root of the number. Here is a quick explanation of branches in the complex plane: <https://plus.maths.org/content/maths-minute-...
This is precisely why the use of the radical function is restricted to *positive real numbers*. When looking for the square **rootS** (notice the plural) of a complex number $a$, you actually look for the solutionS of the following equation : $$ \boxed{z^2 = a}$$ For $a \neq 0$, there are exactly $2$ distinct solution...
4,360,845
If we look at the equation \begin{align} z = \sqrt{ 8 - 6 i }, \end{align} we will find the solutions \begin{align} z\_1 = -3+i \end{align} \begin{align} z\_2 = 3 - i \end{align} How can they be both correct if we can substitute \begin{align} \sqrt{ 8 - 6 i } = -3+i \end{align} \begin{align} \sqrt{ 8 - 6 i } ...
2022/01/19
[ "https://math.stackexchange.com/questions/4360845", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1016571/" ]
It isn't right to write $\sqrt{8-6i}=3-i$ (the same for the other solution). When you ask, $\sqrt{z}=?$ you mean to say " what **thing** multiplied by itself gives $z$". It just so happens that this question will not yield an answer that is a single number, but the "thing" is the elements present in the set comprised o...
Every nonzero complex number $w$ has exactly two distinct square roots (say $z\_1$ and $z\_2$, so that $z\_1^2 = z\_2^2 = w$), and they are opposites (i.e., $z\_2 = -z\_1$). These roots certainly aren't equal; what are equal are their **squares**. Your mistake is calling them both $\sqrt{w}$. It might be more correct t...
4,360,845
If we look at the equation \begin{align} z = \sqrt{ 8 - 6 i }, \end{align} we will find the solutions \begin{align} z\_1 = -3+i \end{align} \begin{align} z\_2 = 3 - i \end{align} How can they be both correct if we can substitute \begin{align} \sqrt{ 8 - 6 i } = -3+i \end{align} \begin{align} \sqrt{ 8 - 6 i } ...
2022/01/19
[ "https://math.stackexchange.com/questions/4360845", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1016571/" ]
It isn't right to write $\sqrt{8-6i}=3-i$ (the same for the other solution). When you ask, $\sqrt{z}=?$ you mean to say " what **thing** multiplied by itself gives $z$". It just so happens that this question will not yield an answer that is a single number, but the "thing" is the elements present in the set comprised o...
This is precisely why the use of the radical function is restricted to *positive real numbers*. When looking for the square **rootS** (notice the plural) of a complex number $a$, you actually look for the solutionS of the following equation : $$ \boxed{z^2 = a}$$ For $a \neq 0$, there are exactly $2$ distinct solution...
4,360,845
If we look at the equation \begin{align} z = \sqrt{ 8 - 6 i }, \end{align} we will find the solutions \begin{align} z\_1 = -3+i \end{align} \begin{align} z\_2 = 3 - i \end{align} How can they be both correct if we can substitute \begin{align} \sqrt{ 8 - 6 i } = -3+i \end{align} \begin{align} \sqrt{ 8 - 6 i } ...
2022/01/19
[ "https://math.stackexchange.com/questions/4360845", "https://math.stackexchange.com", "https://math.stackexchange.com/users/1016571/" ]
This is precisely why the use of the radical function is restricted to *positive real numbers*. When looking for the square **rootS** (notice the plural) of a complex number $a$, you actually look for the solutionS of the following equation : $$ \boxed{z^2 = a}$$ For $a \neq 0$, there are exactly $2$ distinct solution...
Every nonzero complex number $w$ has exactly two distinct square roots (say $z\_1$ and $z\_2$, so that $z\_1^2 = z\_2^2 = w$), and they are opposites (i.e., $z\_2 = -z\_1$). These roots certainly aren't equal; what are equal are their **squares**. Your mistake is calling them both $\sqrt{w}$. It might be more correct t...
27,633,864
I have two tables T1 and T2. I want to select all rows from T2 table where t1\_id not equal to any id in T1 table. This is not working: ``` SELECT t2.id, t2.t1_id, t2.data FROM T2.t2, T1.t1 WHERE t2.t1_id != t1.id ```
2014/12/24
[ "https://Stackoverflow.com/questions/27633864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4159100/" ]
You could use subquery with NOT IN clause as below: ``` SELECT t2.id, t2.t1_id, t2.data FROM T2 t2 WHERE t2.t1_id NOT IN (SELECT DISTINCT id FROM T1) ```
``` SELECT t2.id, t2.t1_id, t2.data FROM T2.t2 LEFT JOIN T1.t1 ON t2.t1_id = t1.id GROUP BY t2.id, t2.t1_id, t2.data HAVING sum(t1.id is not null) = 0 ```
27,633,864
I have two tables T1 and T2. I want to select all rows from T2 table where t1\_id not equal to any id in T1 table. This is not working: ``` SELECT t2.id, t2.t1_id, t2.data FROM T2.t2, T1.t1 WHERE t2.t1_id != t1.id ```
2014/12/24
[ "https://Stackoverflow.com/questions/27633864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4159100/" ]
Use **LEFT JOIN** to fetch all records from left table and add where condition with checking of null value of second table to find unmatched records of left table Try this: ``` SELECT t2.id, t2.t1_id, t2.data FROM T2.t2 LEFT OUTER JOIN T1.t1 ON t2.t1_id = t1.id WHERE t1.id IS NULL ```
``` SELECT t2.id, t2.t1_id, t2.data FROM T2.t2 LEFT JOIN T1.t1 ON t2.t1_id = t1.id GROUP BY t2.id, t2.t1_id, t2.data HAVING sum(t1.id is not null) = 0 ```
27,633,864
I have two tables T1 and T2. I want to select all rows from T2 table where t1\_id not equal to any id in T1 table. This is not working: ``` SELECT t2.id, t2.t1_id, t2.data FROM T2.t2, T1.t1 WHERE t2.t1_id != t1.id ```
2014/12/24
[ "https://Stackoverflow.com/questions/27633864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4159100/" ]
You could use subquery with NOT IN clause as below: ``` SELECT t2.id, t2.t1_id, t2.data FROM T2 t2 WHERE t2.t1_id NOT IN (SELECT DISTINCT id FROM T1) ```
Use **LEFT JOIN** to fetch all records from left table and add where condition with checking of null value of second table to find unmatched records of left table Try this: ``` SELECT t2.id, t2.t1_id, t2.data FROM T2.t2 LEFT OUTER JOIN T1.t1 ON t2.t1_id = t1.id WHERE t1.id IS NULL ```
26,781
I came across with this video in which the Falcon Heavy boosters' landing burn seems to deaccelerate the 1st stage until a point their speed is constant right before touchdown. Can the 1st stage maintain a constant speed, and eventually hover? Did they tweaked the 1D enough to throttle deeper than before?
2018/04/19
[ "https://space.stackexchange.com/questions/26781", "https://space.stackexchange.com", "https://space.stackexchange.com/users/18770/" ]
The falcon 9 first stage **cannot** hover as the thrust of one Merlin engine even at its lowest thrust is able to overcome the mass of the almost-empty first stage. The stage appears to decelerate very slowly in the final moments of the landing as a result of the engine firing pattern SpaceX uses. Per Elon Musk: > >...
The Merlin 1D claims to be able to throttle to 40%, which would be about 350 kN thrust at sea level. The dry mass of a Falcon 9 first stage is about 24 tons, so it can't hover, but it can get pretty close. Thrust to weight would be about 1.3. All data from wikipedia.
6,587,098
What is the best way to reuse code within projects? Let's say I implemented a UI Element and I want it to be used in both my iphone and ipad application without having to copy the code over and have 2 copies of it.
2011/07/05
[ "https://Stackoverflow.com/questions/6587098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/242769/" ]
Just create a project, which includes all your shared code in XCode and reference this project in your iPhone and iPad application project. Plain and simple.
For me I would make a static library project which contains the shared code (UI Element in your example) in Xcode. Then when I need to use the library in the iPhone or iPad app project, then I can just reference the static library project by drag and drop the project to the Project Navigator and configure the correct ...
63,454,223
I had an old Symfony 3.1 site that I upgraded to Symfony 3.4.x then to Symfony 4.4.11 but I didn't upgrade it to symfony flex. I fixed many things and the public sites seem working. I had to rebuild the authentication because the old one was not compatible with sf4. I followed this <https://symfony.com/doc/4.4/securi...
2020/08/17
[ "https://Stackoverflow.com/questions/63454223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5356216/" ]
In HQL you must use properties instead of database column names. Change your HQL to ``` String queryString = "select \r\n" + "cms.myStatusId as 'myStatusId',\r\n" + "cms.statusLabel as 'statusLabel',\r\n" + "csl.status_id as 'companyStatusLabel'\r\n" + "f...
Instead of building JPA queries by hand, I would suggest the [criteria API](https://www.baeldung.com/hibernate-criteria-queries). Your query above would change from: ``` String queryString = "select \r\n" + "cms.my_status_id as 'myStatusId',\r\n" + "cms.status_label as 'statusLa...
18,347,586
**Update: The code works correctly when the `<auth-constraint>` element is removed completely. Can anyone explain why it doesn't work when present?** I'm writing some code to practice securing a servlet in the deployment descriptor, and I'm getting the following in the browser: ``` HTTP Status 403 - Access to the req...
2013/08/21
[ "https://Stackoverflow.com/questions/18347586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2488991/" ]
If you enable security for you web application (as you have done by adding the `<security-constraint>` clause to web.xml), you also need to define corresponding users/roles/passwords in tomcat-user.xml. This file is usually located in the conf folder of the tomcat installation. Here are the sample lines that you can ad...
The two remarks from the other members where correct. To summarize the points of adding a role, a login-config and a corresponding user config of the tomcat you may have a look at this post: [How to fix Tomcat HTTP Status 403: Access to the requested resource has been denied?](https://stackoverflow.com/questions/58082...
18,347,586
**Update: The code works correctly when the `<auth-constraint>` element is removed completely. Can anyone explain why it doesn't work when present?** I'm writing some code to practice securing a servlet in the deployment descriptor, and I'm getting the following in the browser: ``` HTTP Status 403 - Access to the req...
2013/08/21
[ "https://Stackoverflow.com/questions/18347586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2488991/" ]
You need to add the following in your web.xml: ``` <login-config> <auth-method>BASIC</auth-method> </login-config> ``` and then you also edit your `tomcat-user.xml` to add the role and user name. Re-deploy the application after these and this problem should be gone.
The two remarks from the other members where correct. To summarize the points of adding a role, a login-config and a corresponding user config of the tomcat you may have a look at this post: [How to fix Tomcat HTTP Status 403: Access to the requested resource has been denied?](https://stackoverflow.com/questions/58082...
27,080,260
I'm working on a python script to convert full uppercase addresses to Title Case. The issue I'm facing is that when I apply `.title()` to a string like *SOUTH 16TH STREET*, I get *South 16**Th** Street*. The desired conversion would be *South 16**th** Street*, where the abbreviation to the ordinal is lowercase. *What ...
2014/11/22
[ "https://Stackoverflow.com/questions/27080260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105596/" ]
It might be easiest to split the string into a list of separate words, capitalize each word and then join them back together: ``` >>> address = "SOUTH 16TH STREET" >>> " ".join([word.capitalize() for word in address.split()]) 'South 16th Street' ``` The `capitalize()` method sets the first character of a string to u...
Use this Regex-based solution: ``` import re convert = lambda s: " ".join([x.lower() if re.match("^\d+(ST|ND|RD|TH)$", x) is not None else x.title() for x in s.split()]) ``` Basically, I split the string and see for each word if it is an ordinal, then apply the appropriate action.
27,080,260
I'm working on a python script to convert full uppercase addresses to Title Case. The issue I'm facing is that when I apply `.title()` to a string like *SOUTH 16TH STREET*, I get *South 16**Th** Street*. The desired conversion would be *South 16**th** Street*, where the abbreviation to the ordinal is lowercase. *What ...
2014/11/22
[ "https://Stackoverflow.com/questions/27080260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105596/" ]
Use this Regex-based solution: ``` import re convert = lambda s: " ".join([x.lower() if re.match("^\d+(ST|ND|RD|TH)$", x) is not None else x.title() for x in s.split()]) ``` Basically, I split the string and see for each word if it is an ordinal, then apply the appropriate action.
``` >>> str_='SOUTH 16TH STREET' >>> ' '.join([i.title() if i.isalpha() else i.lower() for i in str_.split()]) 'South 16th Street' ```
27,080,260
I'm working on a python script to convert full uppercase addresses to Title Case. The issue I'm facing is that when I apply `.title()` to a string like *SOUTH 16TH STREET*, I get *South 16**Th** Street*. The desired conversion would be *South 16**th** Street*, where the abbreviation to the ordinal is lowercase. *What ...
2014/11/22
[ "https://Stackoverflow.com/questions/27080260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105596/" ]
To solve your stated problem narrowly, I think you may find `string.capwords()` useful. It encapsulates the split -> capitalize -> join sequence into a single command. ``` >>> address = "SOUTH 16TH STREET" >>> capwords(address) 'South 16th Street' ``` See more info on that command in Python 3.4 at... <https://docs....
Use this Regex-based solution: ``` import re convert = lambda s: " ".join([x.lower() if re.match("^\d+(ST|ND|RD|TH)$", x) is not None else x.title() for x in s.split()]) ``` Basically, I split the string and see for each word if it is an ordinal, then apply the appropriate action.
27,080,260
I'm working on a python script to convert full uppercase addresses to Title Case. The issue I'm facing is that when I apply `.title()` to a string like *SOUTH 16TH STREET*, I get *South 16**Th** Street*. The desired conversion would be *South 16**th** Street*, where the abbreviation to the ordinal is lowercase. *What ...
2014/11/22
[ "https://Stackoverflow.com/questions/27080260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105596/" ]
It might be easiest to split the string into a list of separate words, capitalize each word and then join them back together: ``` >>> address = "SOUTH 16TH STREET" >>> " ".join([word.capitalize() for word in address.split()]) 'South 16th Street' ``` The `capitalize()` method sets the first character of a string to u...
``` >>> str_='SOUTH 16TH STREET' >>> ' '.join([i.title() if i.isalpha() else i.lower() for i in str_.split()]) 'South 16th Street' ```
27,080,260
I'm working on a python script to convert full uppercase addresses to Title Case. The issue I'm facing is that when I apply `.title()` to a string like *SOUTH 16TH STREET*, I get *South 16**Th** Street*. The desired conversion would be *South 16**th** Street*, where the abbreviation to the ordinal is lowercase. *What ...
2014/11/22
[ "https://Stackoverflow.com/questions/27080260", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105596/" ]
To solve your stated problem narrowly, I think you may find `string.capwords()` useful. It encapsulates the split -> capitalize -> join sequence into a single command. ``` >>> address = "SOUTH 16TH STREET" >>> capwords(address) 'South 16th Street' ``` See more info on that command in Python 3.4 at... <https://docs....
``` >>> str_='SOUTH 16TH STREET' >>> ' '.join([i.title() if i.isalpha() else i.lower() for i in str_.split()]) 'South 16th Street' ```
24,319,082
Add.cpp ``` int add(int x, int y) { return x + y; } ``` Main.cpp ``` #include <iostream> int main() { using namespace std; cout << "The sum of 3 and 4 is: " << add(3, 4) << endl; return 0; } ``` When I try to compile this program I get an error message for line 6 of main.cpp that states: "error: ...
2014/06/20
[ "https://Stackoverflow.com/questions/24319082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705661/" ]
Create a header file Contents: ``` int add(int x, y); ``` Include that file main.cpp i.e. #include "headerfile.h" Then the rest is up to the compiler environment. Basically need to compile each .cpp to object code and then link them. You need to read up about this as this differs between environment. Also rea...
You need `Add.h` file and include it in your `Main.cpp` **Add.h** ``` int add(int x, int y); ``` **Main.cpp** ``` #include <iostream> #include "Add.h" ... ```
24,319,082
Add.cpp ``` int add(int x, int y) { return x + y; } ``` Main.cpp ``` #include <iostream> int main() { using namespace std; cout << "The sum of 3 and 4 is: " << add(3, 4) << endl; return 0; } ``` When I try to compile this program I get an error message for line 6 of main.cpp that states: "error: ...
2014/06/20
[ "https://Stackoverflow.com/questions/24319082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3705661/" ]
Create a header file Contents: ``` int add(int x, y); ``` Include that file main.cpp i.e. #include "headerfile.h" Then the rest is up to the compiler environment. Basically need to compile each .cpp to object code and then link them. You need to read up about this as this differs between environment. Also rea...
In c++ the scope is all visible functions/methods and variables. In order for it to be seen in the scope in this instance you would have to create a header file that contains your method "add". One way to do this would be to instead of having it in a .cpp file have it in a .h file, then include that .h file in your mai...
10,558,766
I have a question if I may. I have a variable named `$source` and this *should* contain a relative path to a file, for example `./uploads/2012/some-document.pdf` Now, this `$source` variable will contain user input, via $\_GET and $\_POST. I don't want people to enter URLs and I only want to do something if the file e...
2012/05/11
[ "https://Stackoverflow.com/questions/10558766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/128161/" ]
In addition to the other answers, you can deny paths that use a scheme simply with: ``` if (parse_url($path, PHP_URL_SCHEME)) { // has something:// so ignore } ``` This would also work with specialty wrappers such as `php://`, `zlib://`, etc... You can also force a local check on the input variable by prependin...
Go with `realpath()` (in conjunction with `file_exists`). It will filter out URLs for you, and you should get a solid reliable result on whether the file exists or not.
1,199,148
Let $E,F \subset \mathbb{R^n}$ Note that $< . >$ defines the Inner product on $\mathbb{R^n}$ Let $(e\_1,....,e\_k)$ and $(f\_1,.....f\_l$) be Orthonormal bases of E and F respectively. Consider the Matrix $A=(<e\_i,f\_j>)$ of size $k\*l$ Let $\lambda\_i$ be an Eigenvalue of $A^T A$ Prove that $\lambda\_i \in [0, 1...
2015/03/21
[ "https://math.stackexchange.com/questions/1199148", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
If $V$ is any inner product space and $W$ is a subspace, then there is a natural orthogonal projection map $P\_W:V \to W$. These projections have several important properties. Among these we can show that $P\_W$ has operator norm equal to $1$ and is positive-semidefinite. (<http://en.wikipedia.org/wiki/Hilbert_space#Or...
Write $M\_{E}$ as the matrix with the columns $e\_j$ and $M\_{F}$ as the matrix with the columns $f\_j$, then notice that $A = M\_E^T M\_F$. Notice we are searching for $\left\|A \right\| = \sqrt{\lambda\_{max}(A^TA)}$ and trying to show that it is less than $1$. Now $\left\|A\right\| \leq \left\|M\_E \right\| \left\|...
8,961,413
I'm using a VM with the following configuration: * Arch Linux (3.0-ARCH kernel) * GHC 7.0.3 * cabal-install 0.10.2 * Cabal library 1.10.1.0 When I try to build zlib using cabal... ``` $ cabal install zlib ``` I get the following output: ``` Resolving dependencies... Downloading zlib-0.5.3.2... Configuring zlib-0....
2012/01/22
[ "https://Stackoverflow.com/questions/8961413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319002/" ]
For some reason, the `MIN_VERSION_base` macro doesn't get expanded, thus the preprocessor sees the condition `MIN_VERSION_base(4,4,0)` which it of course cannot handle. I've not yet found out why the macro isn't expanded, but workarounds are 1. install zlib-0.5.3.1 instead 2. unpack the tarball and edit `Codec/Compres...
The most likely reason is that the zlib C library headers are missing on your machine. You might instead try to use the Arch Linux "Haskell Platform" or [haskell-zlib](http://www.archlinux.org/packages/extra/i686/haskell-zlib/) packages, which resolve C dependencies for you.
8,961,413
I'm using a VM with the following configuration: * Arch Linux (3.0-ARCH kernel) * GHC 7.0.3 * cabal-install 0.10.2 * Cabal library 1.10.1.0 When I try to build zlib using cabal... ``` $ cabal install zlib ``` I get the following output: ``` Resolving dependencies... Downloading zlib-0.5.3.2... Configuring zlib-0....
2012/01/22
[ "https://Stackoverflow.com/questions/8961413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319002/" ]
On Ubuntu, I fixed (or really, avoided) a similar error with ```sh sudo apt-get install libghc-zlib-dev libghc-zlib-bindings-dev ``` (I don't know if both are needed.)
The most likely reason is that the zlib C library headers are missing on your machine. You might instead try to use the Arch Linux "Haskell Platform" or [haskell-zlib](http://www.archlinux.org/packages/extra/i686/haskell-zlib/) packages, which resolve C dependencies for you.
8,961,413
I'm using a VM with the following configuration: * Arch Linux (3.0-ARCH kernel) * GHC 7.0.3 * cabal-install 0.10.2 * Cabal library 1.10.1.0 When I try to build zlib using cabal... ``` $ cabal install zlib ``` I get the following output: ``` Resolving dependencies... Downloading zlib-0.5.3.2... Configuring zlib-0....
2012/01/22
[ "https://Stackoverflow.com/questions/8961413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319002/" ]
I'm still encountering this with the haskell package zlib-0.5.4.2 on GHC 7.8.4. I think the issue is a non-standard location of the library. I solved it by hand-installing zlib 1.2.8 and then doing: ``` cabal install zlib --extra-lib-dirs=/usr/local/lib --extra-include-dir=/usr/local/include ```
The most likely reason is that the zlib C library headers are missing on your machine. You might instead try to use the Arch Linux "Haskell Platform" or [haskell-zlib](http://www.archlinux.org/packages/extra/i686/haskell-zlib/) packages, which resolve C dependencies for you.
8,961,413
I'm using a VM with the following configuration: * Arch Linux (3.0-ARCH kernel) * GHC 7.0.3 * cabal-install 0.10.2 * Cabal library 1.10.1.0 When I try to build zlib using cabal... ``` $ cabal install zlib ``` I get the following output: ``` Resolving dependencies... Downloading zlib-0.5.3.2... Configuring zlib-0....
2012/01/22
[ "https://Stackoverflow.com/questions/8961413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319002/" ]
For some reason, the `MIN_VERSION_base` macro doesn't get expanded, thus the preprocessor sees the condition `MIN_VERSION_base(4,4,0)` which it of course cannot handle. I've not yet found out why the macro isn't expanded, but workarounds are 1. install zlib-0.5.3.1 instead 2. unpack the tarball and edit `Codec/Compres...
I don't understand this error, but it happened to me also earlier today while trying to install Agda 2.3 using GHC 7.4. Saizan from #agda suggested that I try ```sh cabal unpack zlib cd zlib-0.5.3.2/ runghc Setup configure --user; runghc Setup build; runghc Setup install ``` This proved effective. But I'm still in t...
8,961,413
I'm using a VM with the following configuration: * Arch Linux (3.0-ARCH kernel) * GHC 7.0.3 * cabal-install 0.10.2 * Cabal library 1.10.1.0 When I try to build zlib using cabal... ``` $ cabal install zlib ``` I get the following output: ``` Resolving dependencies... Downloading zlib-0.5.3.2... Configuring zlib-0....
2012/01/22
[ "https://Stackoverflow.com/questions/8961413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319002/" ]
On Ubuntu, I fixed (or really, avoided) a similar error with ```sh sudo apt-get install libghc-zlib-dev libghc-zlib-bindings-dev ``` (I don't know if both are needed.)
I don't understand this error, but it happened to me also earlier today while trying to install Agda 2.3 using GHC 7.4. Saizan from #agda suggested that I try ```sh cabal unpack zlib cd zlib-0.5.3.2/ runghc Setup configure --user; runghc Setup build; runghc Setup install ``` This proved effective. But I'm still in t...
8,961,413
I'm using a VM with the following configuration: * Arch Linux (3.0-ARCH kernel) * GHC 7.0.3 * cabal-install 0.10.2 * Cabal library 1.10.1.0 When I try to build zlib using cabal... ``` $ cabal install zlib ``` I get the following output: ``` Resolving dependencies... Downloading zlib-0.5.3.2... Configuring zlib-0....
2012/01/22
[ "https://Stackoverflow.com/questions/8961413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319002/" ]
I'm still encountering this with the haskell package zlib-0.5.4.2 on GHC 7.8.4. I think the issue is a non-standard location of the library. I solved it by hand-installing zlib 1.2.8 and then doing: ``` cabal install zlib --extra-lib-dirs=/usr/local/lib --extra-include-dir=/usr/local/include ```
I don't understand this error, but it happened to me also earlier today while trying to install Agda 2.3 using GHC 7.4. Saizan from #agda suggested that I try ```sh cabal unpack zlib cd zlib-0.5.3.2/ runghc Setup configure --user; runghc Setup build; runghc Setup install ``` This proved effective. But I'm still in t...
8,961,413
I'm using a VM with the following configuration: * Arch Linux (3.0-ARCH kernel) * GHC 7.0.3 * cabal-install 0.10.2 * Cabal library 1.10.1.0 When I try to build zlib using cabal... ``` $ cabal install zlib ``` I get the following output: ``` Resolving dependencies... Downloading zlib-0.5.3.2... Configuring zlib-0....
2012/01/22
[ "https://Stackoverflow.com/questions/8961413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319002/" ]
For some reason, the `MIN_VERSION_base` macro doesn't get expanded, thus the preprocessor sees the condition `MIN_VERSION_base(4,4,0)` which it of course cannot handle. I've not yet found out why the macro isn't expanded, but workarounds are 1. install zlib-0.5.3.1 instead 2. unpack the tarball and edit `Codec/Compres...
On Ubuntu, I fixed (or really, avoided) a similar error with ```sh sudo apt-get install libghc-zlib-dev libghc-zlib-bindings-dev ``` (I don't know if both are needed.)
8,961,413
I'm using a VM with the following configuration: * Arch Linux (3.0-ARCH kernel) * GHC 7.0.3 * cabal-install 0.10.2 * Cabal library 1.10.1.0 When I try to build zlib using cabal... ``` $ cabal install zlib ``` I get the following output: ``` Resolving dependencies... Downloading zlib-0.5.3.2... Configuring zlib-0....
2012/01/22
[ "https://Stackoverflow.com/questions/8961413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319002/" ]
For some reason, the `MIN_VERSION_base` macro doesn't get expanded, thus the preprocessor sees the condition `MIN_VERSION_base(4,4,0)` which it of course cannot handle. I've not yet found out why the macro isn't expanded, but workarounds are 1. install zlib-0.5.3.1 instead 2. unpack the tarball and edit `Codec/Compres...
I'm still encountering this with the haskell package zlib-0.5.4.2 on GHC 7.8.4. I think the issue is a non-standard location of the library. I solved it by hand-installing zlib 1.2.8 and then doing: ``` cabal install zlib --extra-lib-dirs=/usr/local/lib --extra-include-dir=/usr/local/include ```
8,961,413
I'm using a VM with the following configuration: * Arch Linux (3.0-ARCH kernel) * GHC 7.0.3 * cabal-install 0.10.2 * Cabal library 1.10.1.0 When I try to build zlib using cabal... ``` $ cabal install zlib ``` I get the following output: ``` Resolving dependencies... Downloading zlib-0.5.3.2... Configuring zlib-0....
2012/01/22
[ "https://Stackoverflow.com/questions/8961413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/319002/" ]
On Ubuntu, I fixed (or really, avoided) a similar error with ```sh sudo apt-get install libghc-zlib-dev libghc-zlib-bindings-dev ``` (I don't know if both are needed.)
I'm still encountering this with the haskell package zlib-0.5.4.2 on GHC 7.8.4. I think the issue is a non-standard location of the library. I solved it by hand-installing zlib 1.2.8 and then doing: ``` cabal install zlib --extra-lib-dirs=/usr/local/lib --extra-include-dir=/usr/local/include ```
110,190
On page 19 of the textbook [Introduction to Statistical Learning](http://www-bcf.usc.edu/%7Egareth/ISL/) (by James, Witten, Hastie and Tibshirani--it is freely downloadable on the web, and very good), the following is stated: > > Consider a given estimate $$\hat{Y} = \hat{f}(x)$$ Assume for a moment that both $$\hat{...
2014/07/31
[ "https://stats.stackexchange.com/questions/110190", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/49545/" ]
Simply expand the square ... $$[f(X)- \hat{f}(X) + \epsilon ]^2=[f(X)- \hat{f}(X)]^2 +2 [f(X)- \hat{f}(X)]\epsilon+ \epsilon^2$$ ... and use linearity of expectations: $$\mathrm{E}[f(X)- \hat{f}(X) + \epsilon ]^2=E[f(X)- \hat{f}(X)]^2 +2 E[(f(X)- \hat{f}(X))\epsilon]+ E[\epsilon^2]$$ Can you do it from there? (What...
\begin{equation} \ E[(Y−\hat{Y})^2] = E[(f(X)+\epsilon-\hat{f}(X))^2] = E[(f(X)-\hat{f}(X))^2 + \epsilon^2 + 2\epsilon(f(X)-\hat{f}(X))] = E[(f(X)-\hat{f}(X))^2] + E[\epsilon^2] + E[2\epsilon(f(X)-\hat{f}(X))] = E[(f(X)-\hat{f}(X))^2] + E[\epsilon^2] + 2(f(X)-\hat{f}(X))\*E[\epsilon].......(1)\\ \end{equation} The Las...
37,526,041
I was confronted not so long ago to an algorithmic problem. I needed to find if a value stored in an array was at it "place". An example will be easier to understand. Let's take an Array A = {-10, -3, 3, 5, 7}. The algorithm would return 3, because the number 3 is at A[2] (3rd place). On the contrary, if we take an A...
2016/05/30
[ "https://Stackoverflow.com/questions/37526041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5040228/" ]
Here is an algorithm (based on binary search) to find all matching indices that has a best-case complexity of O(log(n)) and a worst case complexity of O(n): 1- Check the element at position m = array.length / 2 2- if the value array[m] is strictly smaller than m, you can forget about the left half of the array (from ...
If you want the find the first number in the array that is at its own place, you just have to iterate the array: ``` static int find_in_place(int[] a) { for (int i=0; i<a.length; i++) { if (a[i] == i+1) { return a[i]; } } return 0; } ``` It has a complexity of O(n), and an ave...
37,526,041
I was confronted not so long ago to an algorithmic problem. I needed to find if a value stored in an array was at it "place". An example will be easier to understand. Let's take an Array A = {-10, -3, 3, 5, 7}. The algorithm would return 3, because the number 3 is at A[2] (3rd place). On the contrary, if we take an A...
2016/05/30
[ "https://Stackoverflow.com/questions/37526041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5040228/" ]
Since there can be no duplicates, you can use the fact that the function `f(x): A[x] - x` is monotonous and apply binary search to solve the problem in `O(log n)` worst-case complexity. You want to find a point where that function `A[x] - x` takes value zero. This code should work: ``` boolean binarySearch(int[] data...
If you want the find the first number in the array that is at its own place, you just have to iterate the array: ``` static int find_in_place(int[] a) { for (int i=0; i<a.length; i++) { if (a[i] == i+1) { return a[i]; } } return 0; } ``` It has a complexity of O(n), and an ave...
37,526,041
I was confronted not so long ago to an algorithmic problem. I needed to find if a value stored in an array was at it "place". An example will be easier to understand. Let's take an Array A = {-10, -3, 3, 5, 7}. The algorithm would return 3, because the number 3 is at A[2] (3rd place). On the contrary, if we take an A...
2016/05/30
[ "https://Stackoverflow.com/questions/37526041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5040228/" ]
Here is an algorithm (based on binary search) to find all matching indices that has a best-case complexity of O(log(n)) and a worst case complexity of O(n): 1- Check the element at position m = array.length / 2 2- if the value array[m] is strictly smaller than m, you can forget about the left half of the array (from ...
You can skip iterating if there is no such element by adding a special condition ``` if(a[0]>1 && a[a.length-1]>a.length){ //then don't iterate through the array and return false return false; } else { //make a loop here } ```
37,526,041
I was confronted not so long ago to an algorithmic problem. I needed to find if a value stored in an array was at it "place". An example will be easier to understand. Let's take an Array A = {-10, -3, 3, 5, 7}. The algorithm would return 3, because the number 3 is at A[2] (3rd place). On the contrary, if we take an A...
2016/05/30
[ "https://Stackoverflow.com/questions/37526041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5040228/" ]
Here is an algorithm (based on binary search) to find all matching indices that has a best-case complexity of O(log(n)) and a worst case complexity of O(n): 1- Check the element at position m = array.length / 2 2- if the value array[m] is strictly smaller than m, you can forget about the left half of the array (from ...
simply use a binary search for the 0 and use for compare the value in the array minus index of the array. **O(log n)**
37,526,041
I was confronted not so long ago to an algorithmic problem. I needed to find if a value stored in an array was at it "place". An example will be easier to understand. Let's take an Array A = {-10, -3, 3, 5, 7}. The algorithm would return 3, because the number 3 is at A[2] (3rd place). On the contrary, if we take an A...
2016/05/30
[ "https://Stackoverflow.com/questions/37526041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5040228/" ]
Here is an algorithm (based on binary search) to find all matching indices that has a best-case complexity of O(log(n)) and a worst case complexity of O(n): 1- Check the element at position m = array.length / 2 2- if the value array[m] is strictly smaller than m, you can forget about the left half of the array (from ...
Using binary search (or a similar algorithm) you could get better than O(n). Since the array is sorted, we can make the following assumptions: * if the value at index `x` is smaller than `x-1` (`a[x] <= x`), you know that all previous values also must be smaller than their index (because no duplicates are allowed) * i...
37,526,041
I was confronted not so long ago to an algorithmic problem. I needed to find if a value stored in an array was at it "place". An example will be easier to understand. Let's take an Array A = {-10, -3, 3, 5, 7}. The algorithm would return 3, because the number 3 is at A[2] (3rd place). On the contrary, if we take an A...
2016/05/30
[ "https://Stackoverflow.com/questions/37526041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5040228/" ]
Since there can be no duplicates, you can use the fact that the function `f(x): A[x] - x` is monotonous and apply binary search to solve the problem in `O(log n)` worst-case complexity. You want to find a point where that function `A[x] - x` takes value zero. This code should work: ``` boolean binarySearch(int[] data...
You can skip iterating if there is no such element by adding a special condition ``` if(a[0]>1 && a[a.length-1]>a.length){ //then don't iterate through the array and return false return false; } else { //make a loop here } ```
37,526,041
I was confronted not so long ago to an algorithmic problem. I needed to find if a value stored in an array was at it "place". An example will be easier to understand. Let's take an Array A = {-10, -3, 3, 5, 7}. The algorithm would return 3, because the number 3 is at A[2] (3rd place). On the contrary, if we take an A...
2016/05/30
[ "https://Stackoverflow.com/questions/37526041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5040228/" ]
Since there can be no duplicates, you can use the fact that the function `f(x): A[x] - x` is monotonous and apply binary search to solve the problem in `O(log n)` worst-case complexity. You want to find a point where that function `A[x] - x` takes value zero. This code should work: ``` boolean binarySearch(int[] data...
simply use a binary search for the 0 and use for compare the value in the array minus index of the array. **O(log n)**
37,526,041
I was confronted not so long ago to an algorithmic problem. I needed to find if a value stored in an array was at it "place". An example will be easier to understand. Let's take an Array A = {-10, -3, 3, 5, 7}. The algorithm would return 3, because the number 3 is at A[2] (3rd place). On the contrary, if we take an A...
2016/05/30
[ "https://Stackoverflow.com/questions/37526041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5040228/" ]
Since there can be no duplicates, you can use the fact that the function `f(x): A[x] - x` is monotonous and apply binary search to solve the problem in `O(log n)` worst-case complexity. You want to find a point where that function `A[x] - x` takes value zero. This code should work: ``` boolean binarySearch(int[] data...
Using binary search (or a similar algorithm) you could get better than O(n). Since the array is sorted, we can make the following assumptions: * if the value at index `x` is smaller than `x-1` (`a[x] <= x`), you know that all previous values also must be smaller than their index (because no duplicates are allowed) * i...
1,202,551
I'm working with some very basic jquery code and would like to condense what I've done into one function with passed parameters. I have a few of these: ``` $(".about").hover(function() { $(this).attr("src","_img/nav/about_over.gif"); }, function() { $(this).attr("src","_img/nav/about_off.gif"); }); ...
2009/07/29
[ "https://Stackoverflow.com/questions/1202551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141290/" ]
``` function hover(img) { $("."+img).hover(function() { $(this).attr("src","_img/nav/"+img+"_over.gif"); }, function() { $(this).attr("src","_img/nav/"+img+"_off.gif"); }); } ```
I'm not sure what's going on with the second function in the hover function, but you can do something like this: ``` $(".about .artists .help").hover(function(){ $(this).attr('src','_img/nav/' + $(this).attr('class') + '_over.gif') }); ``` you can apply the same principle to your on/off gifs too.
1,202,551
I'm working with some very basic jquery code and would like to condense what I've done into one function with passed parameters. I have a few of these: ``` $(".about").hover(function() { $(this).attr("src","_img/nav/about_over.gif"); }, function() { $(this).attr("src","_img/nav/about_off.gif"); }); ...
2009/07/29
[ "https://Stackoverflow.com/questions/1202551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141290/" ]
``` function hover(img) { $("."+img).hover(function() { $(this).attr("src","_img/nav/"+img+"_over.gif"); }, function() { $(this).attr("src","_img/nav/"+img+"_off.gif"); }); } ```
You could something like this: ``` function ElementHover(class_name, src_over, src_off) { $("."+class_name+"").hover(function() { $(this).attr("src", src_over); }, function() { $(this).attr("src", src_off); }); } ```
1,202,551
I'm working with some very basic jquery code and would like to condense what I've done into one function with passed parameters. I have a few of these: ``` $(".about").hover(function() { $(this).attr("src","_img/nav/about_over.gif"); }, function() { $(this).attr("src","_img/nav/about_off.gif"); }); ...
2009/07/29
[ "https://Stackoverflow.com/questions/1202551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141290/" ]
``` function hover(img) { $("."+img).hover(function() { $(this).attr("src","_img/nav/"+img+"_over.gif"); }, function() { $(this).attr("src","_img/nav/"+img+"_off.gif"); }); } ```
``` function HoverPic(name){ $("."+name).hover(function() { $(this).attr("src","_img/nav/"+name+"_over.gif"); }, function() { $(this).attr("src","_img/nav/"+name+"_off.gif"); }); } ```
1,202,551
I'm working with some very basic jquery code and would like to condense what I've done into one function with passed parameters. I have a few of these: ``` $(".about").hover(function() { $(this).attr("src","_img/nav/about_over.gif"); }, function() { $(this).attr("src","_img/nav/about_off.gif"); }); ...
2009/07/29
[ "https://Stackoverflow.com/questions/1202551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141290/" ]
You could something like this: ``` function ElementHover(class_name, src_over, src_off) { $("."+class_name+"").hover(function() { $(this).attr("src", src_over); }, function() { $(this).attr("src", src_off); }); } ```
I'm not sure what's going on with the second function in the hover function, but you can do something like this: ``` $(".about .artists .help").hover(function(){ $(this).attr('src','_img/nav/' + $(this).attr('class') + '_over.gif') }); ``` you can apply the same principle to your on/off gifs too.
1,202,551
I'm working with some very basic jquery code and would like to condense what I've done into one function with passed parameters. I have a few of these: ``` $(".about").hover(function() { $(this).attr("src","_img/nav/about_over.gif"); }, function() { $(this).attr("src","_img/nav/about_off.gif"); }); ...
2009/07/29
[ "https://Stackoverflow.com/questions/1202551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141290/" ]
``` function HoverPic(name){ $("."+name).hover(function() { $(this).attr("src","_img/nav/"+name+"_over.gif"); }, function() { $(this).attr("src","_img/nav/"+name+"_off.gif"); }); } ```
I'm not sure what's going on with the second function in the hover function, but you can do something like this: ``` $(".about .artists .help").hover(function(){ $(this).attr('src','_img/nav/' + $(this).attr('class') + '_over.gif') }); ``` you can apply the same principle to your on/off gifs too.