qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
98,575 | I know that light can be affected by gravity. But what if there was a planet where if you shone a light in a direction and it could hit your back. I'm talking about a planet where light is bent around the diameter of the planet and back to the starting point. But I am not incredibly good at math so I need help.
The pl... | 2017/11/23 | [
"https://worldbuilding.stackexchange.com/questions/98575",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/45020/"
] | Something similar to what you are asking is theoretically possible (see this [answer](https://physics.stackexchange.com/questions/350805/seeing-something-from-only-one-angle-means-you-have-only-seen-what-of-its-su/350814#350814))
>
> Consider a neutron star. If the radius falls below 1.76 times the Schwarzschild radi... | You can’t do it with gravity, but you could have an atmosphere that refracts the light. Long ago, I once heard that Venus’s atmosphere would do this, if it were transparent. In reality, the refraction needs to bend it in the proper direction and that direction only, so you need a gradient of density or different layers... |
28,320,820 | I'm trying to make requests to a private Docker registry but it requires me to login and responds with a 401 response. I've tried checking the [docs](https://docs.docker.com/reference/api/registry_api/#authorization) but it doesn't say anything about the authorization process. So my questions is how to successfully mak... | 2015/02/04 | [
"https://Stackoverflow.com/questions/28320820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/398441/"
] | <https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04>
That article was extremely helpful for me in setting up a secure private Docker registry. Goes through everything you'll need.
(This part, <https://www.digitalocean.com/community/tutorials/how-to-set-up-a-privat... | docker registry requires ssl to be set up; you will have to configure ssl to get it to work.
I tried following the tutorial on digitalocean (<https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-docker-registry-on-ubuntu-14-04>)
But there are a number of little problems with it and I feel it doesn... |
159,935 | I'm trying to get demographic data in the US at a level more specific than census block groups, so am going to try out using the zillow api and other similar apis to get home price and rental data for individual homes.
So far, I can't find a way to get the zillow api to return a list of every datapoint it has in its d... | 2015/08/27 | [
"https://gis.stackexchange.com/questions/159935",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/20514/"
] | What geographic scope are you looking for? If it's local (your city or county) check with your local government. Often times planning/zoning departments, building departments, or GIS departments have such a list, and it is probably considered public information and would most likely be in a digital format. Other local ... | I worked at a 911 center doing addressing for a while. You should know there is a difference in some areas of the physical (911) address and the mailing address. Assessment departments using mailing for tax bills, and the address assigned to the property may be to some property management agency. Not to mention some pe... |
2,770,222 | There are two image sprite techniques.
The "classic" version uses the background and the background-position css properties.
(as it's described here <http://www.alistapart.com/articles/sprites>)
The "second" version uses an image tag and its clip css property.
( <http://css-tricks.com/css-sprites-with-inline-images/>)... | 2010/05/05 | [
"https://Stackoverflow.com/questions/2770222",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/209333/"
] | The difference comes mainly down to the semantics of the document: You should still only use backgrounds for decorative and layout graphics, and only use image tags for graphics that are part of the content of your page.
Remember that pages should still be useful and usable without any CSS: with the second technique, ... | There is a use case when you want to print a page with icons on it (for example an organization contacts card with phone/skype/etc). So you have two options:
```
- use separate img elements
- use sprite via pseudo(:after) elements with 'content' and 'clip' property
``` |
2,770,222 | There are two image sprite techniques.
The "classic" version uses the background and the background-position css properties.
(as it's described here <http://www.alistapart.com/articles/sprites>)
The "second" version uses an image tag and its clip css property.
( <http://css-tricks.com/css-sprites-with-inline-images/>)... | 2010/05/05 | [
"https://Stackoverflow.com/questions/2770222",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/209333/"
] | The difference comes mainly down to the semantics of the document: You should still only use backgrounds for decorative and layout graphics, and only use image tags for graphics that are part of the content of your page.
Remember that pages should still be useful and usable without any CSS: with the second technique, ... | Remember to specify dimensions in the img tag too when using the second method (clip) so that the whole sprite won't be displayed even when CSS is disabled. One advantage of that method is that with clip the images are displayed even when high contrast themes are enabled in Windows, which is not the case with backgroun... |
2,770,222 | There are two image sprite techniques.
The "classic" version uses the background and the background-position css properties.
(as it's described here <http://www.alistapart.com/articles/sprites>)
The "second" version uses an image tag and its clip css property.
( <http://css-tricks.com/css-sprites-with-inline-images/>)... | 2010/05/05 | [
"https://Stackoverflow.com/questions/2770222",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/209333/"
] | There is a use case when you want to print a page with icons on it (for example an organization contacts card with phone/skype/etc). So you have two options:
```
- use separate img elements
- use sprite via pseudo(:after) elements with 'content' and 'clip' property
``` | Remember to specify dimensions in the img tag too when using the second method (clip) so that the whole sprite won't be displayed even when CSS is disabled. One advantage of that method is that with clip the images are displayed even when high contrast themes are enabled in Windows, which is not the case with backgroun... |
20,975,490 | I'm having trouble aligning my h1 tag in the center of my div. The div just displays a block of color and the h1 should fit in the center and right now its sitting at the top.
<http://jsfiddle.net/ha632/>
**HTML**
```
<div id='title' align="center">
<h1>ExpressWay</h1>
</div>
```
**CSS**
```
#title{
backg... | 2014/01/07 | [
"https://Stackoverflow.com/questions/20975490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2965362/"
] | Your [margins are collapsing](https://developer.mozilla.org/en-US/docs/Web/CSS/margin_collapsing). You can fix this by adding `overflow:auto` (or a border like `border:1px solid #f5f82e`) to your div:
```
#title{
background-color: #f5f82e;
height: 20%;
text-align: center;
overflow:auto;
}
```
**[jsFi... | Give your `h1` a line-height or add padding to it.
A better solution would be to just remove the `div` altogether and apply your styles to the `h1` tag instead, unless you have a good reason for the `div`?
Example: <http://jsfiddle.net/Y6zew/2/> |
20,975,490 | I'm having trouble aligning my h1 tag in the center of my div. The div just displays a block of color and the h1 should fit in the center and right now its sitting at the top.
<http://jsfiddle.net/ha632/>
**HTML**
```
<div id='title' align="center">
<h1>ExpressWay</h1>
</div>
```
**CSS**
```
#title{
backg... | 2014/01/07 | [
"https://Stackoverflow.com/questions/20975490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2965362/"
] | Your [margins are collapsing](https://developer.mozilla.org/en-US/docs/Web/CSS/margin_collapsing). You can fix this by adding `overflow:auto` (or a border like `border:1px solid #f5f82e`) to your div:
```
#title{
background-color: #f5f82e;
height: 20%;
text-align: center;
overflow:auto;
}
```
**[jsFi... | Try with this css:
```
#title{
background-color: #f5f82e;
height: 20%;
text-align: center;
padding: 10px;
}
h1 {
margin: 0;
padding: 0;
}
```
You can play with padding value of #title. |
20,975,490 | I'm having trouble aligning my h1 tag in the center of my div. The div just displays a block of color and the h1 should fit in the center and right now its sitting at the top.
<http://jsfiddle.net/ha632/>
**HTML**
```
<div id='title' align="center">
<h1>ExpressWay</h1>
</div>
```
**CSS**
```
#title{
backg... | 2014/01/07 | [
"https://Stackoverflow.com/questions/20975490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2965362/"
] | Try with this css:
```
#title{
background-color: #f5f82e;
height: 20%;
text-align: center;
padding: 10px;
}
h1 {
margin: 0;
padding: 0;
}
```
You can play with padding value of #title. | Give your `h1` a line-height or add padding to it.
A better solution would be to just remove the `div` altogether and apply your styles to the `h1` tag instead, unless you have a good reason for the `div`?
Example: <http://jsfiddle.net/Y6zew/2/> |
2,139,196 | I'm having problems getting [thin](http://code.macournoyer.com/thin/) working on my Windows 7 machine (I've already installed eventmachine v0.8.1):
>
> `>`gem install thin --ignore-dependencies
>
> checking for main() in -lc... no
>
> creating Makefile
>
>
> make
>
> 'make' is not recognized as an inter... | 2010/01/26 | [
"https://Stackoverflow.com/questions/2139196",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/113141/"
] | Apparently, there aren't any pre-built binaries.
You will need a C compiler installed. If you installed Ruby via the RubyInstaller, that is going to be really easy, if you used the One-Click Installer, it's goint to be a PITA.
See also: [problems installing thin on Windows](http://StackOverflow.Com/questions/2100213/... | I've worked around the lack of precompiled binaries by installing a compiler:
1. I iInstalled [MinGW](http://www.mingw.org/) to C:\MinGW (see [here](http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite) for installation instructions)
2. I then installed [MSYS](http://www.mingw.org/wiki/MSYS) to C:\msys... |
2,139,196 | I'm having problems getting [thin](http://code.macournoyer.com/thin/) working on my Windows 7 machine (I've already installed eventmachine v0.8.1):
>
> `>`gem install thin --ignore-dependencies
>
> checking for main() in -lc... no
>
> creating Makefile
>
>
> make
>
> 'make' is not recognized as an inter... | 2010/01/26 | [
"https://Stackoverflow.com/questions/2139196",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/113141/"
] | Apparently, there aren't any pre-built binaries.
You will need a C compiler installed. If you installed Ruby via the RubyInstaller, that is going to be really easy, if you used the One-Click Installer, it's goint to be a PITA.
See also: [problems installing thin on Windows](http://StackOverflow.Com/questions/2100213/... | A binary for thin is in fact available (and apparently one has been since ver 1.2.2).
However, I couldn't install thin on Windows 7 with Ruby 1.9.2 (p290) because of its dependency on EventMachine.
Running `gem install thin --ignore-dependencies` was what was needed to get thin itself installed.
Just wanted to add t... |
2,139,196 | I'm having problems getting [thin](http://code.macournoyer.com/thin/) working on my Windows 7 machine (I've already installed eventmachine v0.8.1):
>
> `>`gem install thin --ignore-dependencies
>
> checking for main() in -lc... no
>
> creating Makefile
>
>
> make
>
> 'make' is not recognized as an inter... | 2010/01/26 | [
"https://Stackoverflow.com/questions/2139196",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/113141/"
] | Apparently, there aren't any pre-built binaries.
You will need a C compiler installed. If you installed Ruby via the RubyInstaller, that is going to be really easy, if you used the One-Click Installer, it's goint to be a PITA.
See also: [problems installing thin on Windows](http://StackOverflow.Com/questions/2100213/... | There actually are pre-built binaries for particular versions of Thin but you need to know which ones. To get the latest pre-built win32 version do the following:
1. Go to the [RubyGems Thin page](http://rubygems.org/gems/thin)
2. Look under the "Versions" section for a version that has "x86-mswin32" to the right of i... |
2,139,196 | I'm having problems getting [thin](http://code.macournoyer.com/thin/) working on my Windows 7 machine (I've already installed eventmachine v0.8.1):
>
> `>`gem install thin --ignore-dependencies
>
> checking for main() in -lc... no
>
> creating Makefile
>
>
> make
>
> 'make' is not recognized as an inter... | 2010/01/26 | [
"https://Stackoverflow.com/questions/2139196",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/113141/"
] | I've worked around the lack of precompiled binaries by installing a compiler:
1. I iInstalled [MinGW](http://www.mingw.org/) to C:\MinGW (see [here](http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite) for installation instructions)
2. I then installed [MSYS](http://www.mingw.org/wiki/MSYS) to C:\msys... | A binary for thin is in fact available (and apparently one has been since ver 1.2.2).
However, I couldn't install thin on Windows 7 with Ruby 1.9.2 (p290) because of its dependency on EventMachine.
Running `gem install thin --ignore-dependencies` was what was needed to get thin itself installed.
Just wanted to add t... |
2,139,196 | I'm having problems getting [thin](http://code.macournoyer.com/thin/) working on my Windows 7 machine (I've already installed eventmachine v0.8.1):
>
> `>`gem install thin --ignore-dependencies
>
> checking for main() in -lc... no
>
> creating Makefile
>
>
> make
>
> 'make' is not recognized as an inter... | 2010/01/26 | [
"https://Stackoverflow.com/questions/2139196",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/113141/"
] | There actually are pre-built binaries for particular versions of Thin but you need to know which ones. To get the latest pre-built win32 version do the following:
1. Go to the [RubyGems Thin page](http://rubygems.org/gems/thin)
2. Look under the "Versions" section for a version that has "x86-mswin32" to the right of i... | A binary for thin is in fact available (and apparently one has been since ver 1.2.2).
However, I couldn't install thin on Windows 7 with Ruby 1.9.2 (p290) because of its dependency on EventMachine.
Running `gem install thin --ignore-dependencies` was what was needed to get thin itself installed.
Just wanted to add t... |
67,843,980 | I'm supposed to be using a constructor to accept the radius of a circle as an argument then using various accessor and mutator methods to display the area, circumference, and diameter. When I input the value for radius, say 4, it says that the radius and all other values (area, circumference, diameter ) are 0.0. I'm ne... | 2021/06/04 | [
"https://Stackoverflow.com/questions/67843980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15965537/"
] | If you use flexbox, you can use `flex wrap` property to solve your proble.,
But i try to get the same result with grid
```html
<div class="container py-10">
<section class="grid grid-cols-3 gap-4 p-5 border border-gray-400 rounded-lg">
<div class="w-full h-20 bg-orange-200 border border-orange-400 rounded-md"><... | By adding `flex-wrap` class in the parent(section tag in your case) will fix the issue.
Read more about flex-wrap <https://tailwindcss.com/docs/flex-wrap> |
46,462,841 | Typescript 2.3.4, react 15.5.4 and react-bootstrap 0.31.0.
I have a `FormControl` and I want to do something when the user presses enter.
The control:
```
<FormControl
name="keyword"
type="text"
value={this.state.keyword}
onKeyPress={this.handleKeywordKeypress}
onChange={(event: FormEvent<FormControlProps>... | 2017/09/28 | [
"https://Stackoverflow.com/questions/46462841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/924597/"
] | This seems to work:
```
handleKeywordKeyPress = (e: React.KeyboardEvent<FormControl>) =>{
if( e.key == 'Enter' ){
if( this.isFormValid() ){
this.handleCreateClicked();
}
}
};
```
The key(Ha ha) here, for me, was to specify `React.KeyboardEvent`, rather than `KeyboardEvent`.
Trolling around the Rea... | The type of `onKeyPress` should be `KeyboardEventHandler<T>`, which can be written in either of the following ways:
```
handleKeywordKeypress: KeyboardEventHandler<FormControl> = e => {
// use e.keyCode in here
}
```
or
```
import { KeyboardEvent } from "react";
handleKeywordKeypress = (e: KeyboardEvent<FormCon... |
46,462,841 | Typescript 2.3.4, react 15.5.4 and react-bootstrap 0.31.0.
I have a `FormControl` and I want to do something when the user presses enter.
The control:
```
<FormControl
name="keyword"
type="text"
value={this.state.keyword}
onKeyPress={this.handleKeywordKeypress}
onChange={(event: FormEvent<FormControlProps>... | 2017/09/28 | [
"https://Stackoverflow.com/questions/46462841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/924597/"
] | This seems to work:
```
handleKeywordKeyPress = (e: React.KeyboardEvent<FormControl>) =>{
if( e.key == 'Enter' ){
if( this.isFormValid() ){
this.handleCreateClicked();
}
}
};
```
The key(Ha ha) here, for me, was to specify `React.KeyboardEvent`, rather than `KeyboardEvent`.
Trolling around the Rea... | Both of the answers above didnt solve my issue, it should be pretty simple and straightforward:
```
import { KeyboardEvent } from 'react';
const handleKeyPress = (e: KeyboardEvent<HTMLInputElement>) => {
// do stuff
};
``` |
25,619,840 | ```
var x = 2;
var y=x+2<<2;
Console.WriteLine(y);
output = 16
```
my doubt is that how 16 is come.i know about bitwise shift left operator.what kind of operation is done. | 2014/09/02 | [
"https://Stackoverflow.com/questions/25619840",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3999730/"
] | Pay attention to operator precedence. `2 + 2 << 2` is *not* `2 + (2 << 2)`. | its same as below :-
```
x + 2 = 4;
4 << 2 ////it means 16 if you perform bitwise on this.
```
Desciption to understand Let shift operation :-
>
> Shifts bits to the left. The number to the left of the operator is
> shifted the number of places specified by the number to the right.
> Each shift to the left doub... |
70,771,392 | I have a multi-line array value setup in existing code (written by an former team member) as follows:
```
$array1['Alpha'] = "New York,Los Angeles,Washington";
$array1['Beta'] = "New York,Los Angeles,Honolulu";
$array1['Gamma'] = "New York,Los Angeles,Washington";
....
....
and so on....
```
My need is that I have t... | 2022/01/19 | [
"https://Stackoverflow.com/questions/70771392",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6337701/"
] | Here is another snippet delivering 6 date options, starting with today:
```js
const td=new Date(); // set Date object td to today
const opts=[...Array(7)].map(_=>{ // generate an Array of 7 (empty) elements
let r=td.toLocaleString("en-us",{weekday:"long",month:"short",day:"numeric"}); // format date td... | Here some codes, that loops through next 7 days and eliminates the Sundays, hope it helps !
```js
let today = new Date(); // get Today date
let dropDownMenu = document.getElementById('day');
for(let i = 0; i < 7; i++){ // Looping through 7 next days
let newDate = new Date()
newDate.setDate(today.getDate() + i... |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | You look in the source code and find the type; since there's no dynamic types in C the static type is all there is. | Good luck with that. C will cast any block of memory to any data type you like. It doesn't really understand types per se. |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | As the other answers have said, C provides no dynamic, runtime type inspection - all typing is performed at compile time. If you need runtime type determination in C, them you'll need to build that yourself somehow.
Some examples,
* putting a tag in a structure that indicates the type.
* using other data like the fo... | Since it is impossible\* to have a variable of unknown type in C, there is no need for this. There is no equivalent of `id` for C types. It's possible to have a void-pointer to memory whose intended type you don't know, but it has to be cast to a pointer to a specific type in order to actually have any specific type — ... |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | You look in the source code and find the type; since there's no dynamic types in C the static type is all there is. | One way you can do it is to use the `sizeof` operator to get the size of the variable, and then based on this, you can make "assumptions" about what the variable is.
I don't think this would help you with pointers though, since my intuition is that all pointers have the same size, no matter what they are referencing... |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | One way you can do it is to use the `sizeof` operator to get the size of the variable, and then based on this, you can make "assumptions" about what the variable is.
I don't think this would help you with pointers though, since my intuition is that all pointers have the same size, no matter what they are referencing... | Since it is impossible\* to have a variable of unknown type in C, there is no need for this. There is no equivalent of `id` for C types. It's possible to have a void-pointer to memory whose intended type you don't know, but it has to be cast to a pointer to a specific type in order to actually have any specific type — ... |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | You can't do it. C provides absolutely no way to get to the type of a variable. | One way you can do it is to use the `sizeof` operator to get the size of the variable, and then based on this, you can make "assumptions" about what the variable is.
I don't think this would help you with pointers though, since my intuition is that all pointers have the same size, no matter what they are referencing... |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | You look in the source code and find the type; since there's no dynamic types in C the static type is all there is. | You can't do it. C provides absolutely no way to get to the type of a variable. |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | You can't do it. C provides absolutely no way to get to the type of a variable. | Since it is impossible\* to have a variable of unknown type in C, there is no need for this. There is no equivalent of `id` for C types. It's possible to have a void-pointer to memory whose intended type you don't know, but it has to be cast to a pointer to a specific type in order to actually have any specific type — ... |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | You look in the source code and find the type; since there's no dynamic types in C the static type is all there is. | As the other answers have said, C provides no dynamic, runtime type inspection - all typing is performed at compile time. If you need runtime type determination in C, them you'll need to build that yourself somehow.
Some examples,
* putting a tag in a structure that indicates the type.
* using other data like the fo... |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | You look in the source code and find the type; since there's no dynamic types in C the static type is all there is. | Since it is impossible\* to have a variable of unknown type in C, there is no need for this. There is no equivalent of `id` for C types. It's possible to have a void-pointer to memory whose intended type you don't know, but it has to be cast to a pointer to a specific type in order to actually have any specific type — ... |
2,748,085 | How do I get a variable's type in c? Objective c has className, php has get\_class(), etc... | 2010/04/30 | [
"https://Stackoverflow.com/questions/2748085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/251420/"
] | You can't do it. C provides absolutely no way to get to the type of a variable. | As the other answers have said, C provides no dynamic, runtime type inspection - all typing is performed at compile time. If you need runtime type determination in C, them you'll need to build that yourself somehow.
Some examples,
* putting a tag in a structure that indicates the type.
* using other data like the fo... |
14,441,600 | My app is written 99% in C with just some Java helper functions for things not available in the NDK. As a file chooser I'm using a ListActivity that I'm starting like this from the Java side:
```
Intent myIntent = new Intent(this, FileChooser.class);
startActivity(myIntent);
```
While this ListActivity is running, m... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14441600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1197719/"
] | Change the friend declaration to:
```
template <class T> friend T fun( const T & );
```
or to:
```
friend A fun<A>( const A & );
``` | Normal functions are prefered over function templates during overload resoulution. The declaration of a free friend function inside `A` is an exact match for the call in `main`. The declaration is all that compiler needs to pick it up, so it compiles fine, but the linker can't find a definition because, well, you never... |
38,532,968 | We have a cloud service using a worker role to process messages it receives from a Topic set up on Azure Service Bus.
The message itself seems to arrive intact and is usually received and processed correctly. In some instances however, the message seems to stop processing (Logging abruptly ends and no more references... | 2016/07/22 | [
"https://Stackoverflow.com/questions/38532968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2253002/"
] | Change code to:
```
if (bmark.isChecked()){
status = true;
Toast.makeText(getActivity(), "Post Bookmarked..!",Toast.LENGTH_SHORT).show();
}
else {
status = false;
Toast.makeText(getActivity(), "Bookmark removed!", Toast.LENGTH_SHORT).show();
}
```
Toggle changes self checked status, You done that again so status wa... | The problem is you're inverting the state of your button by the `setChecked()` calls in `onClick()`.
Use an `OnCheckedChangeListener` instead of an `OnClickListener`, so you don't have to bother with keeping track of the status:
```
bmark.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@... |
38,532,968 | We have a cloud service using a worker role to process messages it receives from a Topic set up on Azure Service Bus.
The message itself seems to arrive intact and is usually received and processed correctly. In some instances however, the message seems to stop processing (Logging abruptly ends and no more references... | 2016/07/22 | [
"https://Stackoverflow.com/questions/38532968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2253002/"
] | Change code to:
```
if (bmark.isChecked()){
status = true;
Toast.makeText(getActivity(), "Post Bookmarked..!",Toast.LENGTH_SHORT).show();
}
else {
status = false;
Toast.makeText(getActivity(), "Bookmark removed!", Toast.LENGTH_SHORT).show();
}
```
Toggle changes self checked status, You done that again so status wa... | You seem to be switching the button *back* to what it was previously in your statements. If you stop changing the button's state in the onClickListener, it should work just fine.
```
private boolean bmarkStatus = false;
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInst... |
38,532,968 | We have a cloud service using a worker role to process messages it receives from a Topic set up on Azure Service Bus.
The message itself seems to arrive intact and is usually received and processed correctly. In some instances however, the message seems to stop processing (Logging abruptly ends and no more references... | 2016/07/22 | [
"https://Stackoverflow.com/questions/38532968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2253002/"
] | The problem is you're inverting the state of your button by the `setChecked()` calls in `onClick()`.
Use an `OnCheckedChangeListener` instead of an `OnClickListener`, so you don't have to bother with keeping track of the status:
```
bmark.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@... | You seem to be switching the button *back* to what it was previously in your statements. If you stop changing the button's state in the onClickListener, it should work just fine.
```
private boolean bmarkStatus = false;
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInst... |
34,165,841 | After searching around here for over two hours, I still can't get the code I pieced together from here to work due to a missing reference I believe.
The error I am getting is from the part below in which Request does not exist in the current context.
```
return Request.CreateResponse(HttpStatusCode.BadRequest);
```... | 2015/12/08 | [
"https://Stackoverflow.com/questions/34165841",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2800102/"
] | As far as I know there is no Request object without IIS and your code clearly doesn't run on IIS server | If this is an application calling the web to get a file, then you can use a WebClient to get the file <https://msdn.microsoft.com/en-us/library/system.net.webclient(v=vs.110).aspx>
It has built in methods for downloading files synchronously or asynchronously |
6,422,931 | I'm using `setUndecorated(true);` and `getRootPane().setWindowDecorationStyle(JRootPane.FRAME);` in my jFrame. This works great but now when I maximized my frame it spreads all over the window even taskbar is not visible. What can I do to make frame not to hide taskbar?
Also when I maximize minimize my frame multiple ... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6422931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559070/"
] | This is a known bug: <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4737788>
Quote from this link:
>
> A workaround is to subclass JFrame and
> override the setExtendedState method,
> catching any maximize events before
> they happen and setting the maximum
> bounds of the frame appropriately
> before call... | Maybe you can set the maximum size of the jFrame and restrict it according to the screen size.
**EDIT**
Also check out [setExtendedState](http://docs.oracle.com/javase/7/docs/api/java/awt/Frame.html#setExtendedState(int)) |
6,422,931 | I'm using `setUndecorated(true);` and `getRootPane().setWindowDecorationStyle(JRootPane.FRAME);` in my jFrame. This works great but now when I maximized my frame it spreads all over the window even taskbar is not visible. What can I do to make frame not to hide taskbar?
Also when I maximize minimize my frame multiple ... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6422931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559070/"
] | Fortega answer worked however, some part is not needed (or no longer needed with Java 8):
* The `Rectangle` does not need to be saved.
* The code does not take into account dual screen configuration. In particular, the `GraphicsConfiguration` will change if the window change screen.
* As far as I tested, the only requ... | Maybe you can set the maximum size of the jFrame and restrict it according to the screen size.
**EDIT**
Also check out [setExtendedState](http://docs.oracle.com/javase/7/docs/api/java/awt/Frame.html#setExtendedState(int)) |
6,422,931 | I'm using `setUndecorated(true);` and `getRootPane().setWindowDecorationStyle(JRootPane.FRAME);` in my jFrame. This works great but now when I maximized my frame it spreads all over the window even taskbar is not visible. What can I do to make frame not to hide taskbar?
Also when I maximize minimize my frame multiple ... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6422931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559070/"
] | This is a known bug: <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4737788>
Quote from this link:
>
> A workaround is to subclass JFrame and
> override the setExtendedState method,
> catching any maximize events before
> they happen and setting the maximum
> bounds of the frame appropriately
> before call... | Fortega answer worked however, some part is not needed (or no longer needed with Java 8):
* The `Rectangle` does not need to be saved.
* The code does not take into account dual screen configuration. In particular, the `GraphicsConfiguration` will change if the window change screen.
* As far as I tested, the only requ... |
6,422,931 | I'm using `setUndecorated(true);` and `getRootPane().setWindowDecorationStyle(JRootPane.FRAME);` in my jFrame. This works great but now when I maximized my frame it spreads all over the window even taskbar is not visible. What can I do to make frame not to hide taskbar?
Also when I maximize minimize my frame multiple ... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6422931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559070/"
] | This is a known bug: <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4737788>
Quote from this link:
>
> A workaround is to subclass JFrame and
> override the setExtendedState method,
> catching any maximize events before
> they happen and setting the maximum
> bounds of the frame appropriately
> before call... | Starting from Fortega answer, you can make it work even with 125% screen sizi adding
```
Rectangle screenSize = getGraphicsConfiguration().getBounds();
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
screenSize.setSize(new Dimension(gd.getDisplayMode().getWidth(), gd.get... |
6,422,931 | I'm using `setUndecorated(true);` and `getRootPane().setWindowDecorationStyle(JRootPane.FRAME);` in my jFrame. This works great but now when I maximized my frame it spreads all over the window even taskbar is not visible. What can I do to make frame not to hide taskbar?
Also when I maximize minimize my frame multiple ... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6422931",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/559070/"
] | Fortega answer worked however, some part is not needed (or no longer needed with Java 8):
* The `Rectangle` does not need to be saved.
* The code does not take into account dual screen configuration. In particular, the `GraphicsConfiguration` will change if the window change screen.
* As far as I tested, the only requ... | Starting from Fortega answer, you can make it work even with 125% screen sizi adding
```
Rectangle screenSize = getGraphicsConfiguration().getBounds();
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
screenSize.setSize(new Dimension(gd.getDisplayMode().getWidth(), gd.get... |
49,964,294 | I am building an app in which when the user first installs it, In the MainActivity(Launcher Activity) the app asks what type of user he is(Let's say Driver or Rider)? Based on the user selection he is directed to the corresponding login screen. After the user is logged in he directed to HomeActivity. If he closes the a... | 2018/04/22 | [
"https://Stackoverflow.com/questions/49964294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8516801/"
] | Create one login screen, in that screen the user can choose work type(two buttons or radio buttons).
If he chooses Driver, then create a Driver node in the database with the information he wrote and direct him to the home activity:
```
FirebaseUser user=FirebaseAuth.getInstance().getCurrentUser();
DatabaseReference r... | use this code in manifest
and also
you should save user type with user ID in database and at start app check this first and then show home page.
```
<activity android:name=".MainActivity/>
<activity android:name=".DriverHomeActivity">
<intent-filter>
<action android:name="android.intent.ac... |
49,964,294 | I am building an app in which when the user first installs it, In the MainActivity(Launcher Activity) the app asks what type of user he is(Let's say Driver or Rider)? Based on the user selection he is directed to the corresponding login screen. After the user is logged in he directed to HomeActivity. If he closes the a... | 2018/04/22 | [
"https://Stackoverflow.com/questions/49964294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8516801/"
] | Create one login screen, in that screen the user can choose work type(two buttons or radio buttons).
If he chooses Driver, then create a Driver node in the database with the information he wrote and direct him to the home activity:
```
FirebaseUser user=FirebaseAuth.getInstance().getCurrentUser();
DatabaseReference r... | Your issue can be solved by the usage of `SharedPreference` mechanism.
Here you can keep the login status in `SharedPreference` like below:-.
```
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences();
prefs.edit().putBoolean("login", true).commit();
```
when the user won't logged out and coming... |
49,964,294 | I am building an app in which when the user first installs it, In the MainActivity(Launcher Activity) the app asks what type of user he is(Let's say Driver or Rider)? Based on the user selection he is directed to the corresponding login screen. After the user is logged in he directed to HomeActivity. If he closes the a... | 2018/04/22 | [
"https://Stackoverflow.com/questions/49964294",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8516801/"
] | Create one login screen, in that screen the user can choose work type(two buttons or radio buttons).
If he chooses Driver, then create a Driver node in the database with the information he wrote and direct him to the home activity:
```
FirebaseUser user=FirebaseAuth.getInstance().getCurrentUser();
DatabaseReference r... | You might consider keeping a `LauncherActivity` in your android application which will decide which activity to launch further. A sample `LauncherActivity` might look like the following.
```
public class LauncherActivity extends AppCompatActivity {
private boolean loggedIn = false;
@Override
protected v... |
5,131,068 | I'm not sure how to put this best into a title, but this is what i want. Say i'm creating a number of UIlabels programmatically, and i want them to have the names label1, label2, label3 ect.
How do i name a new label the next one. And say i know i want to refer to label3 at this point, but i might want to refer to ano... | 2011/02/27 | [
"https://Stackoverflow.com/questions/5131068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/561395/"
] | Don't confuse yourself! It's tempting to think:
```
for (int i=1; i<5; i++){
UILabel ([NSString stringWithFormat@"label%d", i]) = [[UILabel alloc] init];}
```
Or something like that would work. The names we use are for our convenience, the compiler uses the pointer to the object instead of the label.
What could... | ```
Label myLabel = label5;
myLabel.text = ...
myLabel = label7;
myLabel.text = ...
``` |
5,131,068 | I'm not sure how to put this best into a title, but this is what i want. Say i'm creating a number of UIlabels programmatically, and i want them to have the names label1, label2, label3 ect.
How do i name a new label the next one. And say i know i want to refer to label3 at this point, but i might want to refer to ano... | 2011/02/27 | [
"https://Stackoverflow.com/questions/5131068",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/561395/"
] | Don't confuse yourself! It's tempting to think:
```
for (int i=1; i<5; i++){
UILabel ([NSString stringWithFormat@"label%d", i]) = [[UILabel alloc] init];}
```
Or something like that would work. The names we use are for our convenience, the compiler uses the pointer to the object instead of the label.
What could... | This is a job for an NSMutableArray of UILabels. use addObject to append to the array. Use objectAtIndex: to refer to the i'Th. |
50,411,012 | I'm new to everything, so have mercy.
So for my first app I wanted to do a simple scoreboard app for the upcoming world cup. I used a `TableLayout` and put `TextViews` in each row (for example Pts, Wins etc.). I've set everything to 0 for the time except names. There are around 280 TextViews. Now to update the stats f... | 2018/05/18 | [
"https://Stackoverflow.com/questions/50411012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8393787/"
] | If i am understanding you correctly , you are saying that you have 280 textViews in TableLayout. I would recommend using the recyclerview for this since its much more efficient and dynamic compared to TableLayout. Here is a [tutorial](https://developer.android.com/guide/topics/ui/layout/recyclerview) for RecyclerView. | You need to avoid displaying so many views which are not recycled because you'll end up having very slow app. I also recommend you using a `RecyclerView` and for that, if you are interested, **[this](https://stackoverflow.com/questions/49277797/how-to-display-data-from-firestore-in-a-recyclerview-with-android/49277842)... |
450,050 | Is it possible to copy a directory in a team build target? | 2009/01/16 | [
"https://Stackoverflow.com/questions/450050",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/41291/"
] | ```
<Copy SourceFiles="@(SourceItemGroup)" DestinationFolder="$(YourDir\SubDir\%(RecursiveDir)" />
``` | I've found the easiest way (if you want to be a bit more stringent about what to include/ exclude) is with some custom MSBuild tasks I've written: <http://www.aaron-powell.com/blog.aspx?cat=AaronPowell.MSBuild.Tasks>
You provide a source directory, a destination direction (support for network shares is provided) and f... |
34,644,181 | In a word count example below:
```
(Hello,1)
(Hello,1)
(Hello,1)
(Hello,1)
(Hello,1)
```
The reducer function of Hadoop would collect all 5 elements with key "Hello", and then do the aggregation in the reducer function.
However, in Spark, it is actually reduces 2 elements each time. For example, it combines first a... | 2016/01/06 | [
"https://Stackoverflow.com/questions/34644181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3993270/"
] | It doesn't necessarily aggregate values that way. How do you think a mapper in MapReduce works?
You can think of it like a hashmap. If it sees the key is already in the hashmap, it increments the value, if not, it inserts the key into the hashmap and then initializes the value.
You cant add 1+1+1+1+1 with out adding ... | Terminology is same as Map Reduce. Only difference is unlike Map Reduce which only provides map and reduce functions to implement logic such as filtering, joins and aggregations, Spark have many out of the functions. For map in map reduce we have map, flatMap, filter etc in spark, for reduce in map reduce we have reduc... |
34,644,181 | In a word count example below:
```
(Hello,1)
(Hello,1)
(Hello,1)
(Hello,1)
(Hello,1)
```
The reducer function of Hadoop would collect all 5 elements with key "Hello", and then do the aggregation in the reducer function.
However, in Spark, it is actually reduces 2 elements each time. For example, it combines first a... | 2016/01/06 | [
"https://Stackoverflow.com/questions/34644181",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3993270/"
] | Spark does it in more functional way, so functional programming terminology should be applicable here.
```
rdd.reduce(_ + _)
```
is a **reduce** (fold/accumulate) **function**:
There are some good explanations available [here](http://blogs.msdn.com/b/csliu/archive/2009/11/10/map-reduce-in-functional-programming-par... | Terminology is same as Map Reduce. Only difference is unlike Map Reduce which only provides map and reduce functions to implement logic such as filtering, joins and aggregations, Spark have many out of the functions. For map in map reduce we have map, flatMap, filter etc in spark, for reduce in map reduce we have reduc... |
23,558,197 | I have a system where employees enter their daily log details.
I want a mysql query which gives report of one week and also returns null if someone havent entered their log.
Here is what I have tried.
```
select employee_log.*,employee.* from employee_log
left join employee on (employee_log.employee_id = employee.id... | 2014/05/09 | [
"https://Stackoverflow.com/questions/23558197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1835912/"
] | `$_FILES['file']['name']` contains the name of the file that was uploaded, for instance `myImage.jpg`. In other words, this is the name given by the user that uploaded the file.
`$_FILES['file']['tmp_name']` contains the temporary file location. This is where PHP is keeping the file, until you move it somewhere else. ... | You need to read the file contents after you've uploaded the file, NOT before (and not using `$_FILES['file']['tmp_name']`).
And place it after `move_uploaded_file`, like this:
```
if (move_uploaded_file($_FILES["file"]["tmp_name"],$path)) {
$imagedata = addslashes(file_get_contents($path));
// save to DB
``... |
13,051,944 | Been awhile since I've programmed in C++ however I have a slight problem that I'm trying to figure out.
Is it possible to make a 2 by 2 dynamic array where 1 dimension is not dynamic?
For example
array[2][Dynamic]?
It seems like a waste to make array[dynamic][dynamic] and when I only need to use the first [0][dynam... | 2012/10/24 | [
"https://Stackoverflow.com/questions/13051944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1308976/"
] | Arrays and pointers are basically equivalent, so you can achieve this with an array of pointers:
```
int* array[2];
array[0] = new int[x];
array[1] = new int[y];
```
You can still access it as you would multidimensional array:
```
array[0][x-1] = z;
``` | Sure but it has to be dynamic in the first dimension.
Like this for instance
```
typedef int two_int_array[2];
two_int_array* a = new two_int_array[n];
for (int i = 0; i < n; ++i)
{
a[i][0] = 1;
a[i][1] = 2;
}
```
Of course the better way in general is to use vectors. Since you can't have a vector of array... |
13,051,944 | Been awhile since I've programmed in C++ however I have a slight problem that I'm trying to figure out.
Is it possible to make a 2 by 2 dynamic array where 1 dimension is not dynamic?
For example
array[2][Dynamic]?
It seems like a waste to make array[dynamic][dynamic] and when I only need to use the first [0][dynam... | 2012/10/24 | [
"https://Stackoverflow.com/questions/13051944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1308976/"
] | Arrays and pointers are basically equivalent, so you can achieve this with an array of pointers:
```
int* array[2];
array[0] = new int[x];
array[1] = new int[y];
```
You can still access it as you would multidimensional array:
```
array[0][x-1] = z;
``` | This works in C++11:
```
std::array<std::vector<MyClass>,2> arr;
```
Or you could use a c-style array of vectors
```
std::vector<MyClass> arr[2];
``` |
13,051,944 | Been awhile since I've programmed in C++ however I have a slight problem that I'm trying to figure out.
Is it possible to make a 2 by 2 dynamic array where 1 dimension is not dynamic?
For example
array[2][Dynamic]?
It seems like a waste to make array[dynamic][dynamic] and when I only need to use the first [0][dynam... | 2012/10/24 | [
"https://Stackoverflow.com/questions/13051944",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1308976/"
] | This works in C++11:
```
std::array<std::vector<MyClass>,2> arr;
```
Or you could use a c-style array of vectors
```
std::vector<MyClass> arr[2];
``` | Sure but it has to be dynamic in the first dimension.
Like this for instance
```
typedef int two_int_array[2];
two_int_array* a = new two_int_array[n];
for (int i = 0; i < n; ++i)
{
a[i][0] = 1;
a[i][1] = 2;
}
```
Of course the better way in general is to use vectors. Since you can't have a vector of array... |
14,829 | Is there a way to view a list of open buffers and close several buffers without leaving that list?
The best I know of for closing multiple buffers is using `:ls` to get a list of buffers, memorizing the numbers of the buffers you want to close, and then using `:bdelete`/`:bd` with a prefix to close those buffers, e.g.... | 2018/01/17 | [
"https://vi.stackexchange.com/questions/14829",
"https://vi.stackexchange.com",
"https://vi.stackexchange.com/users/268/"
] | There is a popular mapping that will show the `:ls` result above a prompt:
```
:nnoremap <leader>ls :ls<cr>:b<space>
```
Instead of showing `:b`, as in that mapping, we'll show `:bd` instead:
```
:nnoremap <leader>lsd :ls<cr>:bd<space>
```
(If you prefer a different mapping than `lsd`, heh, feel free to change it... | A really cool trick I picked up somewhere is to write Ex commands in a regular buffer and then use a keymap to execute those commands:
```
" Execute current line or current selection as Vim ex commands:
nnoremap <F2> :exe getline(".")<CR>
vnoremap <F2> :<C-w>exe join(getline("'<","'>"),'<Bar>')<CR>
```
I asked [a qu... |
280,479 | Given $X\subseteq \Bbb R^m, f:X\to\Bbb R$ and $x\in X$, we say $f$ is lower semicontinous (l.s.c for short) at x if
$\forall \varepsilon>0\ \exists\ \delta >0\ \forall \in B(\delta,x), \ f(x)\le f(y)+\varepsilon$.
I wish to show:
If $X$ is closed, then $f$ is l.s.c if and only if the set $f^{-1}((-\infty,r]):=\{... | 2013/01/17 | [
"https://math.stackexchange.com/questions/280479",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/40071/"
] | Let's begin with the "if" part: I'm gonna show that if $y\_n\rightarrow y$ then $f(y)\leq\liminf f(y\_n)$. Let $\epsilon\_n=\frac{1}{n}$; by hypothesis, for each $n$ we can find some $\delta\_n$ such that $f(y)\leq f(y\_n)+\epsilon\_n$. Now you take the inferior limit.
To finish, take a sequence $(y\_n)\subset f^{-1}(... | First Direction: Suppose that $f$ is l.s.c. To show that $A\_r = \{a\in X:f(a)\le r\}$ is closed, let $\{a\_n\}$ be a sequence in $A\_r$, converging to $a\_\infty$, which we want to show is in $A\_r$. Since $f$ is l.s.c.,
$$
f(a\_\infty) \leq \liminf f(a\_n) \leq a,
$$
since $a\_n \in A\_r$. Therefore, $a\_\infty \in ... |
17,147 | Boosting is a sequential technique in which, the first algorithm is trained on the entire dataset and the subsequent algorithms are built by fitting the residuals of the first algorithm, thus giving higher weight to those observations that were poorly predicted by the previous model. Examples are adaboost and GBM, etc.... | 2017/02/23 | [
"https://datascience.stackexchange.com/questions/17147",
"https://datascience.stackexchange.com",
"https://datascience.stackexchange.com/users/29204/"
] | You can use any base learner for boosting (Adaboost requires sample weighting though). Keep in mind however that the original idea is to use weak learners with strong bias and reducing that bias through boosting.
If it is a classification problem, usually logarithmic loss is used to calculating the residual/gradient f... | To extend to Alex's answer, boosting learning has several distinct features, compared to bagging,
1. It is performed in a sequential steps.
2. At each step, it uses the residual rather than label to learn.
The residual function for classification could be logloss, for regression could be MSE.
3. At each step, no samp... |
2,886,931 | I saw a problem of this kind sometime ago. It was solved using the coefficient of something in binomial theorem. I'm not sure. I am unable solve this. Thanks in advance. | 2018/08/18 | [
"https://math.stackexchange.com/questions/2886931",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/585278/"
] | Imagine that we don't have our usual digits -- we still want to use base-10 notation, but have to write each *digit* by tally marks, with some spacer such as a colon between different powers of ten. So 123 would be written `I:II:III` and 307 would be written `III::IIIIIII`.
Now you're looking for 3-digit number -- so ... | Try to solve the following question:
How many two digit integers are there such that the sum of the digits is $k$, where $2\leq k\leq 10$? (Hint: after you choose the first digit, how many choices do you have for the second?)
Next, using the previous idea, how many 3 digit integers meeting your requirement are there... |
2,886,931 | I saw a problem of this kind sometime ago. It was solved using the coefficient of something in binomial theorem. I'm not sure. I am unable solve this. Thanks in advance. | 2018/08/18 | [
"https://math.stackexchange.com/questions/2886931",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/585278/"
] | Imagine that we don't have our usual digits -- we still want to use base-10 notation, but have to write each *digit* by tally marks, with some spacer such as a colon between different powers of ten. So 123 would be written `I:II:III` and 307 would be written `III::IIIIIII`.
Now you're looking for 3-digit number -- so ... | Think of a three digit number as picking a number one through nine for the first digit, then any number zero through next two. So there are $9\cdot 10\cdot 10$ three digit numbers, and the number of these whose coefficients add to $11$ is the coefficient of $x^{11}$ in the expression
$$(x+x^2+\cdots+x^9)(1+x+\cdots+x^... |
8,796,288 | I want to make a simple validation system for certain class of objects, basically
```
public interface IMyClassRule {
bool IsValid(MyClass obj, Context someAdditionalData)
}
```
The list of rules is auto-discovered using DI framework and not fixed in advance.
Let's say I have a `VeryGeneralDefaultRuleAboutAllO... | 2012/01/09 | [
"https://Stackoverflow.com/questions/8796288",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/39068/"
] | I think a lot of this will depend on the scope of the project and just how loosely coupled you need to be. I do a lot of work around business rules, and they need to be about as extensible as possible. I would not tie yourself to an ordinal rule system if there is even the slightest volume of rules, or the ordering of ... | How about adding the ability to inject some conditions into the rule instances, for example, instances of an `IRuleApplicability` interface. You could combine that with something similar to #2, and use a base class of all rules to check for applicability before applying the rule. |
42,558,476 | I've a simple main layout:
```
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
@yield('style')
</head>
<body>
@include('layouts.frontend.partials.slider')
@yield('javascript')
</body>
</html>
```
**layouts.frontend.partials.slider**
```
@section('style')
<link rel="stylesheet" type="text/css" href="... | 2017/03/02 | [
"https://Stackoverflow.com/questions/42558476",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4165710/"
] | Here is another way to do, it's good because you have some flexibility.
You create a master template, put your main files
**master.blade.php**
```
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="">
@section('css'... | Did you try extending your child blade file to use the master template?
At the top of `layouts.frontend.partials.slider` did you put `@extends('layout.master')` (or whatever the path to your master template is?)
It could be an issue caused by the order in which you are including files. Wouldn't a simpler solution be ... |
25,295,917 | I have a provider that outputs something like this
```
<Result rawScore="623">
<Target>http://myUrl.com/test1</Target>
<Domain name="myUrl.search.com" />
<Property name="Language">en</Property>
<Property name="Teaser">This is the description</Property>
<Property name="LVCategory">Help</Property>
... | 2014/08/13 | [
"https://Stackoverflow.com/questions/25295917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1202482/"
] | You could do something like the following:
```
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<element name="Result">
<complexType>
<sequence>
...
<element name="Property" minOccurs="0" maxOccurs="unbounded">
... | Declare the type of `Result` using something like this:
```
<xsd:complexType name="ResultType">
<xsd:sequence>
<xsd:element ref="Target"/>
<xsd:element ref="Domain"/>
<xsd:element ref="Property"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute n... |
25,295,917 | I have a provider that outputs something like this
```
<Result rawScore="623">
<Target>http://myUrl.com/test1</Target>
<Domain name="myUrl.search.com" />
<Property name="Language">en</Property>
<Property name="Teaser">This is the description</Property>
<Property name="LVCategory">Help</Property>
... | 2014/08/13 | [
"https://Stackoverflow.com/questions/25295917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1202482/"
] | This is a complete XML Schema, and compiles to Java code
```
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="2.0">
<xsd:element name="Result" type="ResultType"/>
<xsd:complexType name="ResultType">
<xsd:sequence>
<xsd:element name="Target" type="xsd:string"/>
<xsd:element name="Domain" ty... | Declare the type of `Result` using something like this:
```
<xsd:complexType name="ResultType">
<xsd:sequence>
<xsd:element ref="Target"/>
<xsd:element ref="Domain"/>
<xsd:element ref="Property"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute n... |
25,295,917 | I have a provider that outputs something like this
```
<Result rawScore="623">
<Target>http://myUrl.com/test1</Target>
<Domain name="myUrl.search.com" />
<Property name="Language">en</Property>
<Property name="Teaser">This is the description</Property>
<Property name="LVCategory">Help</Property>
... | 2014/08/13 | [
"https://Stackoverflow.com/questions/25295917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1202482/"
] | This is a complete XML Schema, and compiles to Java code
```
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="2.0">
<xsd:element name="Result" type="ResultType"/>
<xsd:complexType name="ResultType">
<xsd:sequence>
<xsd:element name="Target" type="xsd:string"/>
<xsd:element name="Domain" ty... | You could do something like the following:
```
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<element name="Result">
<complexType>
<sequence>
...
<element name="Property" minOccurs="0" maxOccurs="unbounded">
... |
54,211,750 | I just want to get div element height and hide another div if it contains given max height. if not show the div. So I tried this way.
[Jsfiddle](https://jsfiddle.net/fpw187L5/)
assigned my max height to a variable with if else conditions.
```
var tallest = 60;
if (height > tallest) {
$('van-page-read-more')... | 2019/01/16 | [
"https://Stackoverflow.com/questions/54211750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5774848/"
] | You have 2 issues
1) you did not set height variable
2) and you for got to add `.` before
```
$('.van-page-read-more').hide();
```
```js
$('.van-page-read-more').click(function() {
$(".campervan-info-list").toggleClass("campervan-info-expand");
});
var tallest = 60;
if ($(".campervan-info-list").height() >... | You can use this code.
```
$("div.class").each(function() {
if($(this).height() > tallest) {
$(this).hide();
}
else {
$(this).show();
}
});
``` |
54,211,750 | I just want to get div element height and hide another div if it contains given max height. if not show the div. So I tried this way.
[Jsfiddle](https://jsfiddle.net/fpw187L5/)
assigned my max height to a variable with if else conditions.
```
var tallest = 60;
if (height > tallest) {
$('van-page-read-more')... | 2019/01/16 | [
"https://Stackoverflow.com/questions/54211750",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5774848/"
] | You have 2 issues
1) you did not set height variable
2) and you for got to add `.` before
```
$('.van-page-read-more').hide();
```
```js
$('.van-page-read-more').click(function() {
$(".campervan-info-list").toggleClass("campervan-info-expand");
});
var tallest = 60;
if ($(".campervan-info-list").height() >... | Don't have enought reputation to comment @Just code solution.
You need to wrap it to function
```js
$('.van-page-read-more').click( function() {
$(".campervan-info-list").toggleClass("campervan-info-expand");
showOrhide();
} );
var tallest = 60;
function showOrhide(){
if ($(".campervan-info-list").h... |
26,836,947 | I'm using this command:
```
find -type f -printf "%s %p\n" | sort -nr | head -n 4
```
And I'm getting output like this:
```
374266 lecture04/address-translation.png
2629 lecture04/lecture04-display.txt
1880 lecture04/lecture04-class16.txt
1828 lecture04/quiz-participation-04.zip
```
How can I use grep, sed, or aw... | 2014/11/10 | [
"https://Stackoverflow.com/questions/26836947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045519/"
] | This the the job `cut` was invented to do:
```
cut -d' ' -f2-
man cut
```
To populate a shell array named `arr` with the result of a command would be
```
arr=( $(find ... | cut -d' ' -f2-) )
```
If you have file names with spaces:
```
$ cat file
374266 /path to /the file
12345 /path to another/file
$ cat fil... | **Using `sed`**
A simple solution using `sed`
Test:
```
$ cat inputFile
374266 lecture04/address-translation.png
2629 lecture04/lecture04-display.txt
1880 lecture04/lecture04-class16.txt
1828 lecture04/quiz-participation-04.zip
$ sed -r 's/^[0-9]+\s//g' inputFile
lecture04/address-transla... |
26,836,947 | I'm using this command:
```
find -type f -printf "%s %p\n" | sort -nr | head -n 4
```
And I'm getting output like this:
```
374266 lecture04/address-translation.png
2629 lecture04/lecture04-display.txt
1880 lecture04/lecture04-class16.txt
1828 lecture04/quiz-participation-04.zip
```
How can I use grep, sed, or aw... | 2014/11/10 | [
"https://Stackoverflow.com/questions/26836947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045519/"
] | This the the job `cut` was invented to do:
```
cut -d' ' -f2-
man cut
```
To populate a shell array named `arr` with the result of a command would be
```
arr=( $(find ... | cut -d' ' -f2-) )
```
If you have file names with spaces:
```
$ cat file
374266 /path to /the file
12345 /path to another/file
$ cat fil... | Pipe your command with any of these :
1) With cut
```
cut -d " " -f 2-
```
2) With sed
```
sed -r 's/^[0-9]+ //g'
```
3) With awk
```
awk '{print $2}' /* willnot work if whitespace in filename */
awk 'sub($1,"")' /* will work always */
``` |
26,836,947 | I'm using this command:
```
find -type f -printf "%s %p\n" | sort -nr | head -n 4
```
And I'm getting output like this:
```
374266 lecture04/address-translation.png
2629 lecture04/lecture04-display.txt
1880 lecture04/lecture04-class16.txt
1828 lecture04/quiz-participation-04.zip
```
How can I use grep, sed, or aw... | 2014/11/10 | [
"https://Stackoverflow.com/questions/26836947",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045519/"
] | This the the job `cut` was invented to do:
```
cut -d' ' -f2-
man cut
```
To populate a shell array named `arr` with the result of a command would be
```
arr=( $(find ... | cut -d' ' -f2-) )
```
If you have file names with spaces:
```
$ cat file
374266 /path to /the file
12345 /path to another/file
$ cat fil... | Another solution using `cut`
```
find -type f -printf "%s %p\n" | sort -nr | head -n 4 | cut -d ' ' -f 2
```
the option '-d' of `cut` means delimeter, here use space as delimeter. But this solution has limitation. If the file-paths contain spaces, it fails.
Also you can use `awk`
```
find -type f -printf "%s %p\n"... |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | It sure sounds like a bug. Here's a (pretty wild) guess about what reasoning might have lead to it...
After inlining, it sees:
```
while (q.m_first == q.m_last) /* do nothing */ ;
do_something();
```
and any sequence of `do nothing repeatedly ; do something` can be translated to simply "do something". This falls do... | As a slight aside, this version of icc does what you want. That is, it never calls `doSomething()`.
```
[9:41am][wlynch@computer /tmp] icc --version
icc (ICC) 11.0 20081105
``` |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | As a slight aside, this version of icc does what you want. That is, it never calls `doSomething()`.
```
[9:41am][wlynch@computer /tmp] icc --version
icc (ICC) 11.0 20081105
``` | I think it may have been your version of gcc. I compiled your prog under 4.4.2 and it worked exactly as it should have. |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | As a slight aside, this version of icc does what you want. That is, it never calls `doSomething()`.
```
[9:41am][wlynch@computer /tmp] icc --version
icc (ICC) 11.0 20081105
``` | Your best bet is to take the resulting binary step into it and dis-assemble the main function and see what assembly was generated. Not saying you will be able to see a bug, but you can see if something was optimized out. |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | The C++ standard allows loops without side-effects to be removed, even if they don't terminate:
>
> It is generally felt that it is
> important to allow the transformation
> of potentially non-terminating loops
> (e.g. by merging two loops that
> iterate over the same potentially
> infinite set, or by eliminatin... | I think it may have been your version of gcc. I compiled your prog under 4.4.2 and it worked exactly as it should have. |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | Because the `while (q.isEmpty()) ;` loop contains no statements that can ever cause an externally-visible side-effect, the entire loop is being optimised out of existence. It's the same reason that:
```
for (int i = 0; i < 10; i++)
;
```
could be optimised out of existence, as long as `i` was not `volatile` (sto... | Your best bet is to take the resulting binary step into it and dis-assemble the main function and see what assembly was generated. Not saying you will be able to see a bug, but you can see if something was optimized out. |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | It sure sounds like a bug. Here's a (pretty wild) guess about what reasoning might have lead to it...
After inlining, it sees:
```
while (q.m_first == q.m_last) /* do nothing */ ;
do_something();
```
and any sequence of `do nothing repeatedly ; do something` can be translated to simply "do something". This falls do... | I think it may have been your version of gcc. I compiled your prog under 4.4.2 and it worked exactly as it should have. |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | The C++ standard allows loops without side-effects to be removed, even if they don't terminate:
>
> It is generally felt that it is
> important to allow the transformation
> of potentially non-terminating loops
> (e.g. by merging two loops that
> iterate over the same potentially
> infinite set, or by eliminatin... | Your best bet is to take the resulting binary step into it and dis-assemble the main function and see what assembly was generated. Not saying you will be able to see a bug, but you can see if something was optimized out. |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | It sure sounds like a bug. Here's a (pretty wild) guess about what reasoning might have lead to it...
After inlining, it sees:
```
while (q.m_first == q.m_last) /* do nothing */ ;
do_something();
```
and any sequence of `do nothing repeatedly ; do something` can be translated to simply "do something". This falls do... | Any chance the actual code that you built and ran was missing the semicolon after `while(q.isEmpty())` ? That would certainly result in the next line being called infinitely. |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | Because the `while (q.isEmpty()) ;` loop contains no statements that can ever cause an externally-visible side-effect, the entire loop is being optimised out of existence. It's the same reason that:
```
for (int i = 0; i < 10; i++)
;
```
could be optimised out of existence, as long as `i` was not `volatile` (sto... | It sure sounds like a bug. Here's a (pretty wild) guess about what reasoning might have lead to it...
After inlining, it sees:
```
while (q.m_first == q.m_last) /* do nothing */ ;
do_something();
```
and any sequence of `do nothing repeatedly ; do something` can be translated to simply "do something". This falls do... |
3,527,829 | The following testing code does correctly in VS either with debug or release, and also in GCC. It also does correctly for ICC with debug, but not when optimization enabled (`-O2`).
```
#include <cstdio>
class tClassA{
public:
int m_first, m_last;
tClassA() : m_first(0), m_last(0) {}
~tClassA() {}
bool isEm... | 2010/08/20 | [
"https://Stackoverflow.com/questions/3527829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/425949/"
] | It sure sounds like a bug. Here's a (pretty wild) guess about what reasoning might have lead to it...
After inlining, it sees:
```
while (q.m_first == q.m_last) /* do nothing */ ;
do_something();
```
and any sequence of `do nothing repeatedly ; do something` can be translated to simply "do something". This falls do... | The C++ standard allows loops without side-effects to be removed, even if they don't terminate:
>
> It is generally felt that it is
> important to allow the transformation
> of potentially non-terminating loops
> (e.g. by merging two loops that
> iterate over the same potentially
> infinite set, or by eliminatin... |
50,183,128 | I have a problem with my system.
Basically, I have an entity:
```
import { Produto } from "./produto.model";
import { Empresa } from "./empresa.model";
import { Mensagem } from "./mensagem.model";
export class Nfe{
public codNfe: number;
public numeroNfe: number;
public dataEmissao: Date;
public va... | 2018/05/04 | [
"https://Stackoverflow.com/questions/50183128",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8686548/"
] | What I have found after debugging on the user's machine and digging through the code is that the server telemetry channel uses this function `NetworkInterface.GetIsNetworkAvailable();` which always returns true for my users even when they are offline because they have some extra network adapters that think they are con... | Did you check <https://learn.microsoft.com/en-us/azure/application-insights/app-insights-asp-net-troubleshoot-no-data> or tried to run your app using other machine?
Looks like it can be a firewall issue or something like that. |
167,588 | I have a virtualbox VM that is broken. It won't boot normally. I don't want to bother trying to fix it but I do want to get some files off it that I need.
If I hold down the shift key I can get to a prompt allowing me to boot into recovery mode and from there I can select the option netroot and I'm in. I can get to th... | 2012/07/24 | [
"https://askubuntu.com/questions/167588",
"https://askubuntu.com",
"https://askubuntu.com/users/27645/"
] | An easy way would be to enable SSH on your host, then mount a folder via SSH on your VM.
On the host:
```
sudo apt-get install openssh-server
mkdir ~/vm_backup
```
On the VM:
```
apt-get install sshfs
mkdir /mnt/host
sshfs [username]@[host]:/home/[username]/vm_backup /mnt/host
```
*NOTE:*
* Replace [username] w... | I do this regularly and you don't even have to start the virtual machine itself. The idea is to mount the disk image on your host machine.
To do this, you'll need virtualbox-fuse:
```
$ sudo apt-get install virtualbox-fuse
```
You can then mount the image using `vdfuse`. Per example, mounting a VDI image (VMDK and ... |
23,697 | We use both tomato ketchup and curry ketchup as condiments in Belgium. On the curry ketchup label, amongst other ingredients is "curry (1%)".
So I tried adding curry powder to regular ketchup to see whether I could end up with curry ketchup, but I think the taste was off. The colour was close though.
I know "curry po... | 2012/05/10 | [
"https://cooking.stackexchange.com/questions/23697",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/4580/"
] | I suppose the Belgian "curry ketchup" is similar to the German varieties and no, they are usually not only seasoned with curry powder, but also other spices. There is no standard seasoning mix for curry ketchup, but common additional spices are ginger, black pepper, paprika, cayenne or other chili powders. I also think... | This article seems to suggest that this is the case.
<http://www.thekitchn.com/ketchup-with-a-kick-add-curry-87686> |
23,697 | We use both tomato ketchup and curry ketchup as condiments in Belgium. On the curry ketchup label, amongst other ingredients is "curry (1%)".
So I tried adding curry powder to regular ketchup to see whether I could end up with curry ketchup, but I think the taste was off. The colour was close though.
I know "curry po... | 2012/05/10 | [
"https://cooking.stackexchange.com/questions/23697",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/4580/"
] | Curry Ketchup is made with a Ketchup base, but then adds Curry, vinegar, a small amount of spices like pepprika, and two little known ingredients... apples and soy sauce... if you make it to this recipe then you can get close. See the following from Hienz
Water, sugar, tomato paste (17%), vinegar, apples, modified sta... | This article seems to suggest that this is the case.
<http://www.thekitchn.com/ketchup-with-a-kick-add-curry-87686> |
23,697 | We use both tomato ketchup and curry ketchup as condiments in Belgium. On the curry ketchup label, amongst other ingredients is "curry (1%)".
So I tried adding curry powder to regular ketchup to see whether I could end up with curry ketchup, but I think the taste was off. The colour was close though.
I know "curry po... | 2012/05/10 | [
"https://cooking.stackexchange.com/questions/23697",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/4580/"
] | Not likely.
Standard curry powders are really not good if they are added to anything and left raw (some brands might not even be safe!), they tend to taste raw, unharmonic, floury, bitter then ...
Adding them while MAKING the ketchup, or adding it to the ketchup then cooking the resulting sauce, or blooming it in hot... | This article seems to suggest that this is the case.
<http://www.thekitchn.com/ketchup-with-a-kick-add-curry-87686> |
23,697 | We use both tomato ketchup and curry ketchup as condiments in Belgium. On the curry ketchup label, amongst other ingredients is "curry (1%)".
So I tried adding curry powder to regular ketchup to see whether I could end up with curry ketchup, but I think the taste was off. The colour was close though.
I know "curry po... | 2012/05/10 | [
"https://cooking.stackexchange.com/questions/23697",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/4580/"
] | I suppose the Belgian "curry ketchup" is similar to the German varieties and no, they are usually not only seasoned with curry powder, but also other spices. There is no standard seasoning mix for curry ketchup, but common additional spices are ginger, black pepper, paprika, cayenne or other chili powders. I also think... | Curry Ketchup is made with a Ketchup base, but then adds Curry, vinegar, a small amount of spices like pepprika, and two little known ingredients... apples and soy sauce... if you make it to this recipe then you can get close. See the following from Hienz
Water, sugar, tomato paste (17%), vinegar, apples, modified sta... |
23,697 | We use both tomato ketchup and curry ketchup as condiments in Belgium. On the curry ketchup label, amongst other ingredients is "curry (1%)".
So I tried adding curry powder to regular ketchup to see whether I could end up with curry ketchup, but I think the taste was off. The colour was close though.
I know "curry po... | 2012/05/10 | [
"https://cooking.stackexchange.com/questions/23697",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/4580/"
] | I suppose the Belgian "curry ketchup" is similar to the German varieties and no, they are usually not only seasoned with curry powder, but also other spices. There is no standard seasoning mix for curry ketchup, but common additional spices are ginger, black pepper, paprika, cayenne or other chili powders. I also think... | Not likely.
Standard curry powders are really not good if they are added to anything and left raw (some brands might not even be safe!), they tend to taste raw, unharmonic, floury, bitter then ...
Adding them while MAKING the ketchup, or adding it to the ketchup then cooking the resulting sauce, or blooming it in hot... |
23,697 | We use both tomato ketchup and curry ketchup as condiments in Belgium. On the curry ketchup label, amongst other ingredients is "curry (1%)".
So I tried adding curry powder to regular ketchup to see whether I could end up with curry ketchup, but I think the taste was off. The colour was close though.
I know "curry po... | 2012/05/10 | [
"https://cooking.stackexchange.com/questions/23697",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/4580/"
] | Curry Ketchup is made with a Ketchup base, but then adds Curry, vinegar, a small amount of spices like pepprika, and two little known ingredients... apples and soy sauce... if you make it to this recipe then you can get close. See the following from Hienz
Water, sugar, tomato paste (17%), vinegar, apples, modified sta... | Not likely.
Standard curry powders are really not good if they are added to anything and left raw (some brands might not even be safe!), they tend to taste raw, unharmonic, floury, bitter then ...
Adding them while MAKING the ketchup, or adding it to the ketchup then cooking the resulting sauce, or blooming it in hot... |
29,472,731 | I have three tables User, office and a role map. The user Id will be FK to the office table against the Office manager and office head. The role and the user Id will be mapped in the role map table as shown below.
When an office is deleted, the office table's Active column will be updated to 'N'.
When an office is del... | 2015/04/06 | [
"https://Stackoverflow.com/questions/29472731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3876145/"
] | I think that it would be safer to not use `merge` in this case. After deleting office or updating it's status to inactive
just run this `update`:
```
update role_map set active = 'N'
where (user_role = 'Office Head'
and not exists (
select 1 from office
where office_head = role_map.user_id and ac... | If you have already deleted the row from the OFFICE table, you can just check if the employees that exist in the OFFICE table have an active role or not and just do a simple update like this -
```
UPDATE ROLE_MAP
SET active='N'
where user_id not in
(SELECT office_manager from office
UNION ALL
SE... |
29,472,731 | I have three tables User, office and a role map. The user Id will be FK to the office table against the Office manager and office head. The role and the user Id will be mapped in the role map table as shown below.
When an office is deleted, the office table's Active column will be updated to 'N'.
When an office is del... | 2015/04/06 | [
"https://Stackoverflow.com/questions/29472731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3876145/"
] | I think that it would be safer to not use `merge` in this case. After deleting office or updating it's status to inactive
just run this `update`:
```
update role_map set active = 'N'
where (user_role = 'Office Head'
and not exists (
select 1 from office
where office_head = role_map.user_id and ac... | >
> PLSQL Merge - Update while row not existing
>
>
>
I don't think you could do an **UPDATE** using **WHEN NOT MATCHED** in a **MERGE** statement.
**To avoid doing a manual update every time after the delete**, you could create a **AFTER DELETE trigger** on `office` table such that whenever you delete a row from... |
34,487 | **Phrase:**
>
> お [飲]{の}み[物]{もの} は [何]{なに} が いい です か
>
>
> O nomimono wa nani ga ii desu ka?
>
>
> *What would you like to drink?*
>
>
>
What I would like to know is what いい です (ii des) does for the sentence here? I've read that いい can translate to "good", but I don't see how that fits here.
I'm *very* new t... | 2016/05/30 | [
"https://japanese.stackexchange.com/questions/34487",
"https://japanese.stackexchange.com",
"https://japanese.stackexchange.com/users/14587/"
] | Well, your reaction is not that wrong actually. You just need to think about the context in which the sentence is being asked.
いい means indeed *good* and here the topic of the sentence are the drinks, marked by the particle は. So, a very literal translation could be: "talking about drinks, what is good?".
This cons... | You are correct with "What beverages are good?" in terms of word-for-word translation. However, いい (ii) and いいですか (ii desu ka) have different meanings.
>
> いい (ii) = good
>
>
> ~いいですか (ii desu ka) = Can I ~ , May I ~ (if you use the polity form),
> would you like ~, are you okay with ~
>
>
>
If we directly tr... |
38,369,871 | I'm connecting to 2 different DB, and their JDBC client both requires the package `org.apache.calcite.avatica`, one is using version 1.6, and another is using version 1.8, so I need to install both the versions (1.6 and 1.8), and seems that the version 1.8 is not compatible with version 1.6, when I'm using the version ... | 2016/07/14 | [
"https://Stackoverflow.com/questions/38369871",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1608276/"
] | You can't. This isn't an issue with Maven, it's an issue with the standard Java classloading infrastructure.
Theoretically, you could use something like OSGi, which partitions off classloaders and permits multiple imports of classes with the same fully-qualified name, but that adds *substantial* complication.
I would... | I can't explain how to make Avatica 1.6 and 1.8 work alongside each other in maven. It looks as it we broke backwards compatibility in Avatica in either [CALCITE-836](https://issues.apache.org/jira/browse/CALCITE-836) or [CALCITE-1213](https://issues.apache.org/jira/browse/CALCITE-1213), and on behalf of the Apache Cal... |
22,855,615 | I'm trying to make the tabs in a tabs widget fixed to an absolute position.
See <http://jsfiddle.net/5umRd/3/>
```
<div id="houseBar">
<ul>
<li><a href="#Hnew">New Households</a></li>
<li><a href="#Hactive">Active Routes</a></li>
<li><a href="#Hinactive">Inactive Routes</a></li>
<li... | 2014/04/04 | [
"https://Stackoverflow.com/questions/22855615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1500015/"
] | Try this
```
tabHost = getTabHost();
tabHost.getTabWidget().getChildAt(1).setBackgroundColor(Color.parseColor("#FF0001"));
tabHost.getTabWidget().getChildAt(2).setBackgroundColor(Color.parseColor("#FF0002"));
tabHost.getTabWidget().getChildAt(3).setBackgroundColor(Color.parseColor("#FF0003"));
.......................... | Your Tab Host XML file
**TabHost**
```
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
... |
18,518,538 | I have a code that's suppose to move a `<div>` from 94% left to, aproximetly, 4% left, but it doesn't seem to work. I believe the flaw is in the CSS part of the code, because the console reports no errors.
HTML:
```
<body id="page_body">
<div class="header_wrap">
<div class="header_main_title">
... | 2013/08/29 | [
"https://Stackoverflow.com/questions/18518538",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2074153/"
] | I shouldn't be getting downvoted. Here is a working fiddle: <http://jsfiddle.net/NmcZj/>
```
$('#scroll').click(function() {
$('.rightslide').animate({left: "-=100%"});
});
```
That should do it. (the difference is the "-=") | Fixed everything by changing:
```
$('#scroll').click(function() {
$('.rightslide').animate({left: '4%'});
});
```
**TO:**
```
$(document).ready(function() {
$('#scroll').click(function() {
$('.rightslide').animate({left: '4%'});
});
});
``` |
181,576 | I have a short stack of hard drives (4 or 5) that I have been pulling from my old and broken machines over the past number of years with the notion that at some point in the future I will somehow connect them into a new machine to get the data. And I guess the time is now.
My question is, what's the best way to go abo... | 2010/08/27 | [
"https://superuser.com/questions/181576",
"https://superuser.com",
"https://superuser.com/users/35578/"
] | I prefer using one of [these](http://www.iguanamicro.com/vaneunstadwi.html) to get a hard drive connected to my computer. If the drive spins, you can generally use windows to read the data off of it. I know windows will read most anything that isn't corrupted. If the data is corrupted your only real choice is [Spinrite... | [GetDataBack](http://www.runtime.org/) is the best data recovery program out there. It costs a few dollars. It's about 70 I believe for just the NTFS version, and 120 for both FAT and NTFS. But it's well worth the money in my opinion. I use an external hard drive enclosure to connect any hard drive for data recovery. T... |
1,238,064 | Please help me to solve this problem. I can find almost no clue regarding the log part. I tried to break the $\binom{2n}{n}$ part, but in vague...will the breaking help me in anyway? | 2015/04/16 | [
"https://math.stackexchange.com/questions/1238064",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | $$\log\binom{2n}{n}=\log\prod\_{k=1}^{n}\frac{n+k}{k}=\sum\_{k=1}^{n}\log\frac{1+\frac{k}{n}}{\frac{k}{n}}\approx n\int\_{0}^{1}\log\left(\frac{x+1}{x}\right)\,dx = 2n\log 2.$$ | **Hint** You can use the following inequality: $$\frac{4^n}{n}\leq{2n \choose n}\leq 4^n$$ for large $n\geq 4$ ([this is the proof](http://en.wikipedia.org/wiki/Proof_of_Bertrand%27s_postulate#Proof_by_Shigenori_Tochiori) for the left inequality) |
1,238,064 | Please help me to solve this problem. I can find almost no clue regarding the log part. I tried to break the $\binom{2n}{n}$ part, but in vague...will the breaking help me in anyway? | 2015/04/16 | [
"https://math.stackexchange.com/questions/1238064",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | There are $2^{2n}=4^n$ subsets of a set of size $2n$, each of which has between $0$ and $2n$ elements. Of these, ${2n}\choose{n}$ have exactly $n$ elements, and ${{2n}\choose{n}} > {{2n}\choose{k}}$ for any $k\neq n$. Therefore,
$$
\frac{4^n}{2n+1} < {{2n}\choose{n}} \le 4^n,
$$
so
$$
n\log 4-\log(2n+1) < \log{{2n}\cho... | **Hint** You can use the following inequality: $$\frac{4^n}{n}\leq{2n \choose n}\leq 4^n$$ for large $n\geq 4$ ([this is the proof](http://en.wikipedia.org/wiki/Proof_of_Bertrand%27s_postulate#Proof_by_Shigenori_Tochiori) for the left inequality) |
1,238,064 | Please help me to solve this problem. I can find almost no clue regarding the log part. I tried to break the $\binom{2n}{n}$ part, but in vague...will the breaking help me in anyway? | 2015/04/16 | [
"https://math.stackexchange.com/questions/1238064",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | $$\log\binom{2n}{n}=\log\prod\_{k=1}^{n}\frac{n+k}{k}=\sum\_{k=1}^{n}\log\frac{1+\frac{k}{n}}{\frac{k}{n}}\approx n\int\_{0}^{1}\log\left(\frac{x+1}{x}\right)\,dx = 2n\log 2.$$ | There are $2^{2n}=4^n$ subsets of a set of size $2n$, each of which has between $0$ and $2n$ elements. Of these, ${2n}\choose{n}$ have exactly $n$ elements, and ${{2n}\choose{n}} > {{2n}\choose{k}}$ for any $k\neq n$. Therefore,
$$
\frac{4^n}{2n+1} < {{2n}\choose{n}} \le 4^n,
$$
so
$$
n\log 4-\log(2n+1) < \log{{2n}\cho... |
4,765 | I've bought that famous Receiver/Transmitter RWS-375 and TWS 375. I want to clone the remote control of my garage door.
So I connected the RWS-375 in my Arduino, and build a program to receive the sinal that the remote control send.
However every time I press the button the program writes differente sequence of cha... | 2010/10/02 | [
"https://electronics.stackexchange.com/questions/4765",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/1416/"
] | I would have a look at [Modbus](http://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b.pdf) and [HDLC](http://en.wikipedia.org/wiki/HDLC) [Asynchronous framing](http://en.wikipedia.org/wiki/High-Level_Data_Link_Control#Asynchronous%5Fframing) for examples of how to transfer packets over a serial bus. I would also... | I believe SD card SPI mode has a checksum. |
41,219,697 | I have folder `C:\Folder`. In this folder I have thousands of subfolders. I want to target only those ending in `cv`. In these subfolders I have a file and another subfolder. `C:\Folder\SubFoldercv\cv`. I would like to move all the files in those subfolders to the second subfolder using CMD in Windows 10.
(So from `C:... | 2016/12/19 | [
"https://Stackoverflow.com/questions/41219697",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6839389/"
] | Use [`for /D`](http://ss64.com/nt/for_d.html) to find the directories ending with `cv`, and use [`robocopy`](http://ss64.com/nt/robocopy.html) to copy (or `robocopy /mov` to move) all files from a folder to another:
```
@echo off
FOR /D %%G IN ("C:\Folder\*cv") DO robocopy /mov "%%~G" "%%~G\cv" "*"
```
I'm currently... | How to do?
```
subfolderHolder = uploads
FOR /D %%i IN ("%MoveDirSource%\*\%subfolderHolder%\*") DO ROBOCOPY /MOV /E "%%i" "%MoveDirDestination%\%%~nxi"
```
but the wild card is not working |
44,599 | >
> **Possible Duplicate:**
>
> [Is fire matter or energy?](https://physics.stackexchange.com/questions/9708/is-fire-matter-or-energy)
>
>
>
What is the basic form of fire? physics defines every entity by a basic form either solid or liquid or as a gas,
example: water is liquid,
ice as solid,
water vapor: gas... | 2012/11/19 | [
"https://physics.stackexchange.com/questions/44599",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/16106/"
] | The basic form of fire is what we perceive which is simply heat and visible light (as we can't see IR). It's not *itself* a matter... But, instead it's a natural process. Perhaps, it will not completely convert matter into energy because some will be left as the products of the flame. [Fire](http://en.wikipedia.org/wik... | The part of fire that you can see is light, which can't exactly be described as matter in and of itself, so it doesn't have a fully defined material state. It's akin to asking whether a radio wave is a solid, liquid or gas - it doesn't fit that model at all.
However, if we are to relax the semantics a little, the matt... |
44,599 | >
> **Possible Duplicate:**
>
> [Is fire matter or energy?](https://physics.stackexchange.com/questions/9708/is-fire-matter-or-energy)
>
>
>
What is the basic form of fire? physics defines every entity by a basic form either solid or liquid or as a gas,
example: water is liquid,
ice as solid,
water vapor: gas... | 2012/11/19 | [
"https://physics.stackexchange.com/questions/44599",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/16106/"
] | Fire is a reaction between molecules in gases. It may look as if a piece of wood is burning, but actually the burning happens in gases given off by the wood as it is heated.
Burning wood, paper etc is a complicated business, so let's take a relatively simple system like burning the gas in your cooker (assuming you use... | The part of fire that you can see is light, which can't exactly be described as matter in and of itself, so it doesn't have a fully defined material state. It's akin to asking whether a radio wave is a solid, liquid or gas - it doesn't fit that model at all.
However, if we are to relax the semantics a little, the matt... |
44,599 | >
> **Possible Duplicate:**
>
> [Is fire matter or energy?](https://physics.stackexchange.com/questions/9708/is-fire-matter-or-energy)
>
>
>
What is the basic form of fire? physics defines every entity by a basic form either solid or liquid or as a gas,
example: water is liquid,
ice as solid,
water vapor: gas... | 2012/11/19 | [
"https://physics.stackexchange.com/questions/44599",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/16106/"
] | Fire usually consists of something that burns (often solid - wood or coal, say) and the flames accompanying the burning. The flames consist of hot reacting gases, which emit light in the frequencies from the emission spectrum of the hot molecules and radicals, giving rise to colors depending on the chemical composition... | The part of fire that you can see is light, which can't exactly be described as matter in and of itself, so it doesn't have a fully defined material state. It's akin to asking whether a radio wave is a solid, liquid or gas - it doesn't fit that model at all.
However, if we are to relax the semantics a little, the matt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.