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 |
|---|---|---|---|---|---|
31,845,426 | I have install "Squid for windows" server on my network to provide shared Internet access to about 6 users and it is work fine.
My main purpose to setup squid is save bans width of my 4G Internet connection, but I do not find any traffic monitoring tool, to monitor users activity, hit rate and miss rate of server.
I ... | 2015/08/06 | [
"https://Stackoverflow.com/questions/31845426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207103/"
] | You can use a for loop to iterate through the dictionary key/value pairs to construct your array:
```
var myDict: [String : Int] = ["attack" : 1, "defend" : 5, "block" : 12]
var arr = [String]()
for (key, value) in myDict {
arr.append("\(key) \(value)")
}
```
**Note:** Dictionaries are *unordered*, so the orde... | If you like concise code and prefer a functional approach, you can use the `map` method executed on the keys collection:
```
let array = Array(myDict.keys.map { "\($0) \(myDict[$0]!)" })
```
or, as suggested by @vacawama:
```
let array = myDict.keys.array.map { "\($0) \(myDict[$0]!)" }
```
which is functionally e... |
31,845,426 | I have install "Squid for windows" server on my network to provide shared Internet access to about 6 users and it is work fine.
My main purpose to setup squid is save bans width of my 4G Internet connection, but I do not find any traffic monitoring tool, to monitor users activity, hit rate and miss rate of server.
I ... | 2015/08/06 | [
"https://Stackoverflow.com/questions/31845426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207103/"
] | You can use a for loop to iterate through the dictionary key/value pairs to construct your array:
```
var myDict: [String : Int] = ["attack" : 1, "defend" : 5, "block" : 12]
var arr = [String]()
for (key, value) in myDict {
arr.append("\(key) \(value)")
}
```
**Note:** Dictionaries are *unordered*, so the orde... | The general case for creating an array out of **ONLY VALUES** of a dictionary in Swift 3 is (I assume it also works in older versions of swift):
```
let arrayFromDic = Array(dic.values.map{ $0 })
```
Example:
```
let dic = ["1":"a", "2":"b","3":"c"]
let ps = Array(dic.values.map{ $0 })
print("\(ps)")
for p in p... |
31,845,426 | I have install "Squid for windows" server on my network to provide shared Internet access to about 6 users and it is work fine.
My main purpose to setup squid is save bans width of my 4G Internet connection, but I do not find any traffic monitoring tool, to monitor users activity, hit rate and miss rate of server.
I ... | 2015/08/06 | [
"https://Stackoverflow.com/questions/31845426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207103/"
] | You can use a for loop to iterate through the dictionary key/value pairs to construct your array:
```
var myDict: [String : Int] = ["attack" : 1, "defend" : 5, "block" : 12]
var arr = [String]()
for (key, value) in myDict {
arr.append("\(key) \(value)")
}
```
**Note:** Dictionaries are *unordered*, so the orde... | With Swift 5
```
var myDict:[String : Int] = ["attack" : 1, "defend" : 5, "block" : 12]
let arrayValues = myDict.values.map({$0})
let arrayKeys = myDict.keys.map({$0})
``` |
31,845,426 | I have install "Squid for windows" server on my network to provide shared Internet access to about 6 users and it is work fine.
My main purpose to setup squid is save bans width of my 4G Internet connection, but I do not find any traffic monitoring tool, to monitor users activity, hit rate and miss rate of server.
I ... | 2015/08/06 | [
"https://Stackoverflow.com/questions/31845426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207103/"
] | The general case for creating an array out of **ONLY VALUES** of a dictionary in Swift 3 is (I assume it also works in older versions of swift):
```
let arrayFromDic = Array(dic.values.map{ $0 })
```
Example:
```
let dic = ["1":"a", "2":"b","3":"c"]
let ps = Array(dic.values.map{ $0 })
print("\(ps)")
for p in p... | If you like concise code and prefer a functional approach, you can use the `map` method executed on the keys collection:
```
let array = Array(myDict.keys.map { "\($0) \(myDict[$0]!)" })
```
or, as suggested by @vacawama:
```
let array = myDict.keys.array.map { "\($0) \(myDict[$0]!)" }
```
which is functionally e... |
31,845,426 | I have install "Squid for windows" server on my network to provide shared Internet access to about 6 users and it is work fine.
My main purpose to setup squid is save bans width of my 4G Internet connection, but I do not find any traffic monitoring tool, to monitor users activity, hit rate and miss rate of server.
I ... | 2015/08/06 | [
"https://Stackoverflow.com/questions/31845426",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1207103/"
] | The general case for creating an array out of **ONLY VALUES** of a dictionary in Swift 3 is (I assume it also works in older versions of swift):
```
let arrayFromDic = Array(dic.values.map{ $0 })
```
Example:
```
let dic = ["1":"a", "2":"b","3":"c"]
let ps = Array(dic.values.map{ $0 })
print("\(ps)")
for p in p... | With Swift 5
```
var myDict:[String : Int] = ["attack" : 1, "defend" : 5, "block" : 12]
let arrayValues = myDict.values.map({$0})
let arrayKeys = myDict.keys.map({$0})
``` |
81,638 | This is a newbie question.
It is clear that if you put two (or more) DC voltage sources in series like this:

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fywR1q.png) – Schematic created using [CircuitLab](https://www.circuitlab.co... | 2013/09/08 | [
"https://electronics.stackexchange.com/questions/81638",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/27953/"
] | For this case you can visualize Voltage not as the amount of electrons flowing but the pressure behind them. In this analogy the electrons are like air, pumped around by the batteries. Note that in this case the batteries are constant-pressure-adding pumps, not constant-flow pumps.
In your case battery 1 pumps electro... | It's not really a difference in charge, it's a difference in the *energy* of the charge. An increase in voltage between two points means that the charge (electrons, usually) at the point of higher voltage have more energy than those at a lower voltage. As an electron moves through a battery from the - terminal to the +... |
81,638 | This is a newbie question.
It is clear that if you put two (or more) DC voltage sources in series like this:

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fywR1q.png) – Schematic created using [CircuitLab](https://www.circuitlab.co... | 2013/09/08 | [
"https://electronics.stackexchange.com/questions/81638",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/27953/"
] | It's not really a difference in charge, it's a difference in the *energy* of the charge. An increase in voltage between two points means that the charge (electrons, usually) at the point of higher voltage have more energy than those at a lower voltage. As an electron moves through a battery from the - terminal to the +... | This is because you are referencing a potential difference. A battery will have a given potential difference. Assuming we are dealing with small potentials, you will not change the potential difference from one side of a battery to another. If you place the positive side of a battery (anode) at some positive potential ... |
81,638 | This is a newbie question.
It is clear that if you put two (or more) DC voltage sources in series like this:

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fywR1q.png) – Schematic created using [CircuitLab](https://www.circuitlab.co... | 2013/09/08 | [
"https://electronics.stackexchange.com/questions/81638",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/27953/"
] | For this case you can visualize Voltage not as the amount of electrons flowing but the pressure behind them. In this analogy the electrons are like air, pumped around by the batteries. Note that in this case the batteries are constant-pressure-adding pumps, not constant-flow pumps.
In your case battery 1 pumps electro... | This is because you are referencing a potential difference. A battery will have a given potential difference. Assuming we are dealing with small potentials, you will not change the potential difference from one side of a battery to another. If you place the positive side of a battery (anode) at some positive potential ... |
33,127,460 | I want to use Doctrine for data persistence in a Domain Driven Design approach. But what are bothering me is the fact that the association mapping should be inside the entity. Isn't that a bad practice in terms of a pure DDD? Because until I get into the persistence issue, my domain entities were so clean, and now they... | 2015/10/14 | [
"https://Stackoverflow.com/questions/33127460",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4503142/"
] | Yes, this is bad from a DDD perspective. There are two solutions:
* Use an external mapping mechanism, such as the one described by @Cerad. This frees the domain model from persistence concerns, but it may also be a pain to manage. After all, many projects moved away from XML-based persistence configuration for a reas... | Onion Architecture has the answer to your question and is one of the recommended architecture approaches for DDD. The idea I that you keep Domain Layer only contains business logic. The infrasctruture layer will have the repository. It the job of the repository to persist the changes made in the domain objects. Hence, ... |
22,321,247 | I have two hashes which have similar keys but different values.
I want to build a third hash with all the keys of the first hash and all the values of the second.
If the second hash doesn't have an element for any given key then the corresponding value for the resultant hash should be blank or `undef`.
For example, ... | 2014/03/11 | [
"https://Stackoverflow.com/questions/22321247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2118804/"
] | All you need is
```
my %hash3 = map { $_ => $hash2{$_} } keys %hash1;
```
which takes the every key from `%hash` and pairs it with the corresponding value from `%hash2` to form `%hash3`. Accessing non-existent elements in `%hash2` will return `undef` without further code.
**output**
```
(
BLUE => ["command1", ... | A comma is missing between the arguments of `push`.
```
push @{$hash3{$key}}, @{$hash2{$key}};
``` |
22,321,247 | I have two hashes which have similar keys but different values.
I want to build a third hash with all the keys of the first hash and all the values of the second.
If the second hash doesn't have an element for any given key then the corresponding value for the resultant hash should be blank or `undef`.
For example, ... | 2014/03/11 | [
"https://Stackoverflow.com/questions/22321247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2118804/"
] | A comma is missing between the arguments of `push`.
```
push @{$hash3{$key}}, @{$hash2{$key}};
``` | I just wrote the following piece of code and it worked.
```
foreach my $key (keys %hash1) {
if (exists ($hash2{$key})) {
push @{$hash3{$key}}, @{$hash2{$key}};
}
else {
$hash3{$key} = [ ];
}
}
``` |
22,321,247 | I have two hashes which have similar keys but different values.
I want to build a third hash with all the keys of the first hash and all the values of the second.
If the second hash doesn't have an element for any given key then the corresponding value for the resultant hash should be blank or `undef`.
For example, ... | 2014/03/11 | [
"https://Stackoverflow.com/questions/22321247",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2118804/"
] | All you need is
```
my %hash3 = map { $_ => $hash2{$_} } keys %hash1;
```
which takes the every key from `%hash` and pairs it with the corresponding value from `%hash2` to form `%hash3`. Accessing non-existent elements in `%hash2` will return `undef` without further code.
**output**
```
(
BLUE => ["command1", ... | I just wrote the following piece of code and it worked.
```
foreach my $key (keys %hash1) {
if (exists ($hash2{$key})) {
push @{$hash3{$key}}, @{$hash2{$key}};
}
else {
$hash3{$key} = [ ];
}
}
``` |
18,306,767 | after remove item selected check box auto check next item.
i try to override getcount method but no result
>
> CountryAdapter.java
>
>
>
```
CountryAdapter extends ArrayAdapter<MyCountry>{
Context context; int layoutResourceId; ArrayList<MyCountry> countries; ContextualActionMode activity;
public CountryAdapter(... | 2013/08/19 | [
"https://Stackoverflow.com/questions/18306767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2666406/"
] | Try this:
Just add this line before your onCheckChanged() event like this.
```
viewHolder.nameEn.setText(countries.get(position).getNameEn());
viewHolder.nameVi.setText(countries.get(position).getNameVi());
viewHolder.flag.setImageDrawable(countries.get(position).getFlag());
viewHolder.check.setChecked(fa... | Try to use `android:checked="false"` to `CheckBox` in your xml file please |
18,306,767 | after remove item selected check box auto check next item.
i try to override getcount method but no result
>
> CountryAdapter.java
>
>
>
```
CountryAdapter extends ArrayAdapter<MyCountry>{
Context context; int layoutResourceId; ArrayList<MyCountry> countries; ContextualActionMode activity;
public CountryAdapter(... | 2013/08/19 | [
"https://Stackoverflow.com/questions/18306767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2666406/"
] | You have to just set your listview before notifyDataSetChanged();
public void dellistview() {
listviewdata.setChoiceMode(ListView.CHOICE\_MODE\_MULTIPLE);
```
SparseBooleanArray selected = listAdapterData.getCheckedItemPositions();
if (selected != null) {
try {
for (int i = (selected.si... | Try to use `android:checked="false"` to `CheckBox` in your xml file please |
18,306,767 | after remove item selected check box auto check next item.
i try to override getcount method but no result
>
> CountryAdapter.java
>
>
>
```
CountryAdapter extends ArrayAdapter<MyCountry>{
Context context; int layoutResourceId; ArrayList<MyCountry> countries; ContextualActionMode activity;
public CountryAdapter(... | 2013/08/19 | [
"https://Stackoverflow.com/questions/18306767",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2666406/"
] | Try this:
Just add this line before your onCheckChanged() event like this.
```
viewHolder.nameEn.setText(countries.get(position).getNameEn());
viewHolder.nameVi.setText(countries.get(position).getNameVi());
viewHolder.flag.setImageDrawable(countries.get(position).getFlag());
viewHolder.check.setChecked(fa... | You have to just set your listview before notifyDataSetChanged();
public void dellistview() {
listviewdata.setChoiceMode(ListView.CHOICE\_MODE\_MULTIPLE);
```
SparseBooleanArray selected = listAdapterData.getCheckedItemPositions();
if (selected != null) {
try {
for (int i = (selected.si... |
34,066 | I have attempted a few searches for a list of origins of replication for plasmids in *E. coli*, but I was only able to find a list of origins, but not their individual sequences. The available plasmid maps are often extremely vague on where exactly do the origins start or end, and in any case it would be extremely tedi... | 2015/05/07 | [
"https://biology.stackexchange.com/questions/34066",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/10456/"
] | [Plasmapper](http://wishart.biology.ualberta.ca/PlasMapper/) Is quite good a recognizing common origins of replication. You will have to look up compatibility yourself. It is what I usually use when confronted with unnannotated plasmids. | There must be some such information, because at the lab we are using the SnapGene software, and it is able to recognize the Ori sequences (and all other sequences). Since it is proprietary software, I doubt they would disclose their list, but others might have the same information.
If you really need to find your ori... |
34,066 | I have attempted a few searches for a list of origins of replication for plasmids in *E. coli*, but I was only able to find a list of origins, but not their individual sequences. The available plasmid maps are often extremely vague on where exactly do the origins start or end, and in any case it would be extremely tedi... | 2015/05/07 | [
"https://biology.stackexchange.com/questions/34066",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/10456/"
] | [Plasmapper](http://wishart.biology.ualberta.ca/PlasMapper/) Is quite good a recognizing common origins of replication. You will have to look up compatibility yourself. It is what I usually use when confronted with unnannotated plasmids. | Try [this](http://www.ncbi.nlm.nih.gov/nuccore/K00042.1). I would suggest [OriDB](http://pombe.oridb.org/) also, because it's precisely what you asked for. Getting the sequences out for easy blasting might be a chore, depending. |
34,066 | I have attempted a few searches for a list of origins of replication for plasmids in *E. coli*, but I was only able to find a list of origins, but not their individual sequences. The available plasmid maps are often extremely vague on where exactly do the origins start or end, and in any case it would be extremely tedi... | 2015/05/07 | [
"https://biology.stackexchange.com/questions/34066",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/10456/"
] | [Plasmapper](http://wishart.biology.ualberta.ca/PlasMapper/) Is quite good a recognizing common origins of replication. You will have to look up compatibility yourself. It is what I usually use when confronted with unnannotated plasmids. | Go this [URL](https://www.addgene.org/browse/sequence/79022/)
And click pBR322 origin in the map. Then, the corresponding sequence will be highlighted.
2248-2867: pBR322\_origin
2201 cccttaacgt gagttttcgt tccactgagc gtcagacccc gtagaaa**aga** 2250
2251 **tcaaaggatc ttcttgagat cctttttttc tgcgcgtaat ctgctgcttg** 2300
... |
56,766,876 | I want to return two arrays in a single function in the model and post the result in view but it gives an error.
And also I want to output a certain element of an array.
```
public function index(){
$this->load->model("model");
$array['thisarray'] = $this->model->Hello();
$arrayy['... | 2019/06/26 | [
"https://Stackoverflow.com/questions/56766876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8912569/"
] | this is impossible
a possible solution would be
**your model**
```
public function Hello()
{
return
[
'yep' => ['title' => 'My Title','heading' => 'My Heading'],
'thisarray' => ['a'=> "helo",'b' =>"yello", 'c' =>"mello"]
];
}
```
**your controller**
```
public function... | you need to just change just your controller like this and you are all set.
```
public function index()
{
$this->load->model("model");
$array['thisarray'] = $this->model->Hello();
$array['yep'] = $this->model->Hello();
$this->load->view("viewfile", $array);
}
```
After modify... |
7,444,451 | How do I get the actual font face and font size of an element when the CSS `font-face` and `font-size` properties are not defined?
For example, the JavaScript snippet
```
object.style.fontFamily
```
does not return any value. That's pretty obvious, assuming CSS hasn't applied a style to `object` anywhere. But, of c... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7444451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507738/"
] | I suggest this function:
```
function css( element, property ) {
return window.getComputedStyle( element, null ).getPropertyValue( property );
}
```
Usage:
```
css( object, 'font-size' ) // returns '16px' for instance
```
Note: `getComputedStyle` doesn't work in IE8.
**Live demo:** <http://jsfiddle.net/4mxzE... | There is no standard, reliable method for determining the actual font being used. The previous answers here will report the styled **fontFamily** style value, but that can be a list of font names and doesn't specifically identify the *actual* font rendered (which was the *actual* question posed here).
(As mentioned in... |
7,444,451 | How do I get the actual font face and font size of an element when the CSS `font-face` and `font-size` properties are not defined?
For example, the JavaScript snippet
```
object.style.fontFamily
```
does not return any value. That's pretty obvious, assuming CSS hasn't applied a style to `object` anywhere. But, of c... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7444451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507738/"
] | I suggest this function:
```
function css( element, property ) {
return window.getComputedStyle( element, null ).getPropertyValue( property );
}
```
Usage:
```
css( object, 'font-size' ) // returns '16px' for instance
```
Note: `getComputedStyle` doesn't work in IE8.
**Live demo:** <http://jsfiddle.net/4mxzE... | You can find the information about the rendered font in Chrome/Firefox Developer Tools. Try inspecting the paragraph in the following code snippet:
```css
p { font-family: sans-serif; }
```
```html
<p>Some text and <span title="an emoji"></span></p>
```
---
In Chrome Developer Tools (tested on 55.0.2883.75 m 64-bi... |
7,444,451 | How do I get the actual font face and font size of an element when the CSS `font-face` and `font-size` properties are not defined?
For example, the JavaScript snippet
```
object.style.fontFamily
```
does not return any value. That's pretty obvious, assuming CSS hasn't applied a style to `object` anywhere. But, of c... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7444451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507738/"
] | I suggest this function:
```
function css( element, property ) {
return window.getComputedStyle( element, null ).getPropertyValue( property );
}
```
Usage:
```
css( object, 'font-size' ) // returns '16px' for instance
```
Note: `getComputedStyle` doesn't work in IE8.
**Live demo:** <http://jsfiddle.net/4mxzE... | I found a way (for all browsers which support `<canvas>`), by checking pixel for pixel if the font rendering has changed
```
function renderedfont(ele) {
var getDefaultFonts = function () {
var iframe = document.createElement('iframe');
var html = '<html><body>';
var fonts;
document... |
7,444,451 | How do I get the actual font face and font size of an element when the CSS `font-face` and `font-size` properties are not defined?
For example, the JavaScript snippet
```
object.style.fontFamily
```
does not return any value. That's pretty obvious, assuming CSS hasn't applied a style to `object` anywhere. But, of c... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7444451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507738/"
] | I suggest this function:
```
function css( element, property ) {
return window.getComputedStyle( element, null ).getPropertyValue( property );
}
```
Usage:
```
css( object, 'font-size' ) // returns '16px' for instance
```
Note: `getComputedStyle` doesn't work in IE8.
**Live demo:** <http://jsfiddle.net/4mxzE... | Being a bit late here, but having had to solve the same problem...
Šime Vidas's answer is basically correct, but nowadays, you can get creative, and have your answer.
Basically, define your own font-face, which you are *sure* does not match any existing font.
Then, add your font after each computedstyle font, and see ... |
7,444,451 | How do I get the actual font face and font size of an element when the CSS `font-face` and `font-size` properties are not defined?
For example, the JavaScript snippet
```
object.style.fontFamily
```
does not return any value. That's pretty obvious, assuming CSS hasn't applied a style to `object` anywhere. But, of c... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7444451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507738/"
] | There is no standard, reliable method for determining the actual font being used. The previous answers here will report the styled **fontFamily** style value, but that can be a list of font names and doesn't specifically identify the *actual* font rendered (which was the *actual* question posed here).
(As mentioned in... | I found a way (for all browsers which support `<canvas>`), by checking pixel for pixel if the font rendering has changed
```
function renderedfont(ele) {
var getDefaultFonts = function () {
var iframe = document.createElement('iframe');
var html = '<html><body>';
var fonts;
document... |
7,444,451 | How do I get the actual font face and font size of an element when the CSS `font-face` and `font-size` properties are not defined?
For example, the JavaScript snippet
```
object.style.fontFamily
```
does not return any value. That's pretty obvious, assuming CSS hasn't applied a style to `object` anywhere. But, of c... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7444451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507738/"
] | There is no standard, reliable method for determining the actual font being used. The previous answers here will report the styled **fontFamily** style value, but that can be a list of font names and doesn't specifically identify the *actual* font rendered (which was the *actual* question posed here).
(As mentioned in... | Being a bit late here, but having had to solve the same problem...
Šime Vidas's answer is basically correct, but nowadays, you can get creative, and have your answer.
Basically, define your own font-face, which you are *sure* does not match any existing font.
Then, add your font after each computedstyle font, and see ... |
7,444,451 | How do I get the actual font face and font size of an element when the CSS `font-face` and `font-size` properties are not defined?
For example, the JavaScript snippet
```
object.style.fontFamily
```
does not return any value. That's pretty obvious, assuming CSS hasn't applied a style to `object` anywhere. But, of c... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7444451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507738/"
] | You can find the information about the rendered font in Chrome/Firefox Developer Tools. Try inspecting the paragraph in the following code snippet:
```css
p { font-family: sans-serif; }
```
```html
<p>Some text and <span title="an emoji"></span></p>
```
---
In Chrome Developer Tools (tested on 55.0.2883.75 m 64-bi... | I found a way (for all browsers which support `<canvas>`), by checking pixel for pixel if the font rendering has changed
```
function renderedfont(ele) {
var getDefaultFonts = function () {
var iframe = document.createElement('iframe');
var html = '<html><body>';
var fonts;
document... |
7,444,451 | How do I get the actual font face and font size of an element when the CSS `font-face` and `font-size` properties are not defined?
For example, the JavaScript snippet
```
object.style.fontFamily
```
does not return any value. That's pretty obvious, assuming CSS hasn't applied a style to `object` anywhere. But, of c... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7444451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507738/"
] | You can find the information about the rendered font in Chrome/Firefox Developer Tools. Try inspecting the paragraph in the following code snippet:
```css
p { font-family: sans-serif; }
```
```html
<p>Some text and <span title="an emoji"></span></p>
```
---
In Chrome Developer Tools (tested on 55.0.2883.75 m 64-bi... | Being a bit late here, but having had to solve the same problem...
Šime Vidas's answer is basically correct, but nowadays, you can get creative, and have your answer.
Basically, define your own font-face, which you are *sure* does not match any existing font.
Then, add your font after each computedstyle font, and see ... |
7,444,451 | How do I get the actual font face and font size of an element when the CSS `font-face` and `font-size` properties are not defined?
For example, the JavaScript snippet
```
object.style.fontFamily
```
does not return any value. That's pretty obvious, assuming CSS hasn't applied a style to `object` anywhere. But, of c... | 2011/09/16 | [
"https://Stackoverflow.com/questions/7444451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/507738/"
] | I found a way (for all browsers which support `<canvas>`), by checking pixel for pixel if the font rendering has changed
```
function renderedfont(ele) {
var getDefaultFonts = function () {
var iframe = document.createElement('iframe');
var html = '<html><body>';
var fonts;
document... | Being a bit late here, but having had to solve the same problem...
Šime Vidas's answer is basically correct, but nowadays, you can get creative, and have your answer.
Basically, define your own font-face, which you are *sure* does not match any existing font.
Then, add your font after each computedstyle font, and see ... |
91,222 | Is there any way of customizing the behaviour of the search bar in the Start menu? It'd be useful to tell it to search particular directories or for particular file types.
I used to use [Launchy](http://www.launchy.net/) for this, but it's unreasonably harsh on the CPU and HDD while it updates its index (which happens... | 2010/01/04 | [
"https://superuser.com/questions/91222",
"https://superuser.com",
"https://superuser.com/users/23475/"
] | Use a negative PID which will cause a process group to be killed. The `--` tells kill that the rest of the arguments are not option switches so the hyphen (minus) before the PID won't confuse it.
```
kill -- -12345
```
Also, `-9` is a last resort. Don't use it until you've tried at least `-15` (SIGTERM, which is the... | `killall` might give you better results.
**Warning**: killall behaves differently on the different \*nix's. On Linux, it will kill the processes with the titles matching the argument. **On Solaris, it will kill EVERY process**, not just the ones you specify. So on Solaris, running killall as root will effectively shut... |
22,850 | I am in my first year studying German, and I couldn't not notice that some adjectives form from nouns with *-ig* (e.g. *salzig, vorsichtig*), others with *-lich* (*monatlich, sommerlich* etc.), and others with *-isch* (*typisch, telefonisch*). Is there a rule defining which ending to use when? | 2015/04/14 | [
"https://german.stackexchange.com/questions/22850",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/15593/"
] | There is no clear-cut rule. Any rule I am about to lay out now has a dozen exceptions to it. But a few similarities do stike me once I try to think about the suffixes.
First, *-isch* is the only element in your list that can be added to geographical places:
>
> *türkisch, italienisch, europäisch, wienerisch, hessisc... | The answer by Jan is already very good.
For the sake of completeness, I’d like to translate / summarize / quote what the Duden has to say on this exact topic ([Adjektive auf -ig, -isch, -lich](https://www.duden.de/sprachwissen/sprachratgeber/Adjektive-auf-ig-isch-lich)):
The ending *-ig* means that the denoted charact... |
19,939,655 | I need to push the results from SQL Server query into an XML document I have currently have stored in string labelled xmlpush.
The SQL data is raw text data delimited with a pipe but with no xml tags. I can bring this out of SQL into a DataSet without the pipes if necessary.
What is the best way of inserting it into... | 2013/11/12 | [
"https://Stackoverflow.com/questions/19939655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2497790/"
] | Icons Section:
--------------
```
[Icons]
Name: "{group}\MyApp"; Filename: "{app}\MyApp.exe"; IconFilename: "{app}\MyApp.exe"
Name: "{group}\{cm:UninstallProgram,MyApp}"; Filename: "{uninstallexe}"; IconFilename: E:\Continuous Integration\InnoSetup Files\icon.ico
Name: "{code:GetDesktopFolder}\MyApp"; Filename: "{... | You can use a `Check:` function that returns the "all users" variable to control whether the icon is created or not:
```
[Icons]
Name: "{commondesktop}\MyApp"; Filename: "{app}\MyApp.exe"; IconFilename: "{app}\MyApp.exe"; Check: Not CheckPerUserInstall;
Name: "{userdesktop}\MyApp"; Filename: "{app}\MyApp.exe"; IconFil... |
42,220 | What are the current progressive battlegrounds for “rights” in the UK?
The reason I ask is that all of the areas I can think of could be said to already be relatively “progressive.”
* The Abortion Act 1967 makes abortion legal until the end of the 24th week.
* The wage gap is close to zero (and negative in some age g... | 2019/06/17 | [
"https://politics.stackexchange.com/questions/42220",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/6116/"
] | >
> Abortion is legal until the end of the 24th week.
>
>
>
Not in Northern Ireland. UK progressiveness really ought to remember to look at the whole UK.
I would say that the big areas at the moment are:
* Preventing a regression of rights, especially in relation to Brexit; this might include employment rights, ... | Access to [legal aid](https://www.theguardian.com/commentisfree/2018/aug/12/the-guardian-view-on-legal-aid-cuts-have-caused-chaos-and-must-be-reversed), which is currently going backwards. While pjc50's answer is great, almost all of them will end up in court and without access to legal aid, anyone without significant ... |
21,649,711 | I am attempting to convert my app to fragments vs activities in order to better follow the android design guidlines with a navigation drawer.
I have a fragment with a button, that when pressed executes this code to launch a new fragment:
```
FragmentManager man=getFragmentManager();
FragmentTransaction tran=... | 2014/02/08 | [
"https://Stackoverflow.com/questions/21649711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1637374/"
] | Try this, you need to get root view and use findViewById by using root view.
```
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.toptaste_layout, container, false);
// rest of the code
... | Change onCreateView() to this-
```
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View view = inflater.inflate(R.layout.toptaste_layout, container, false);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getA... |
56,487,608 | I struggled a bit to build primeng from source, after checking the doc of angular-cli (spoiler: didn't help, they don't follow the standard)
I tried all these
```
ng build
ng build -c production
... --aot
... --prod
...
```
then read the code, and some forum questions, I found the following | 2019/06/07 | [
"https://Stackoverflow.com/questions/56487608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1928596/"
] | EDIT:
@ShaneCoder is the correct one now
Old answer: < 9.x.x
Here are the steps:
```
gulp clean
gulp build-assets
gulp build-exports
tsc --build tsconfig-release.json
npm pack
```
you can the create a release on github, and refrence it using it's URL in your package.json instead of the version number:
ex: `ht... | ```
ng build --project primeng-library
```
and add these two lines to the [production] section in the .browserslistrc file:
```
not ios_saf 15.2-15.3
not safari 15.2-15.3
``` |
56,487,608 | I struggled a bit to build primeng from source, after checking the doc of angular-cli (spoiler: didn't help, they don't follow the standard)
I tried all these
```
ng build
ng build -c production
... --aot
... --prod
...
```
then read the code, and some forum questions, I found the following | 2019/06/07 | [
"https://Stackoverflow.com/questions/56487608",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1928596/"
] | The build process has changed to use `ng-packagr` in primeng 9. This method was confirmed in primeng 10. To build:
```
npm install ng-packager --save-dev
npm run build-lib
```
I haven't built version 9 using `ng-packagr`. Should be the same according to this [link](https://github.com/primefaces/primeng/issues/8057). | ```
ng build --project primeng-library
```
and add these two lines to the [production] section in the .browserslistrc file:
```
not ios_saf 15.2-15.3
not safari 15.2-15.3
``` |
17,124,600 | I am writing a little demo web server delivering static html,css and javascript.
The server looks like
```
(function () {
"use strict";
var http = require("http");
var connect = require('connect');
var app = connect()
.use(connect.logger('dev'))
.use(connect.static('home'));
var s... | 2013/06/15 | [
"https://Stackoverflow.com/questions/17124600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1359398/"
] | Had a bit of trouble figuring this one out since [express](http://expressjs.com/) has spoiled me.
Take a look at [enable cors](http://enable-cors.org/server_expressjs.html). Basically what you need to be doing is add `Access-Control-Allow-Origin` to the domain you want to enable cors on. [response.setHeaders](http://... | I hope this will help:
```
//CORS middleware
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', config.allowedDomains);
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type');
next();
}
//.... |
17,124,600 | I am writing a little demo web server delivering static html,css and javascript.
The server looks like
```
(function () {
"use strict";
var http = require("http");
var connect = require('connect');
var app = connect()
.use(connect.logger('dev'))
.use(connect.static('home'));
var s... | 2013/06/15 | [
"https://Stackoverflow.com/questions/17124600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1359398/"
] | Had a bit of trouble figuring this one out since [express](http://expressjs.com/) has spoiled me.
Take a look at [enable cors](http://enable-cors.org/server_expressjs.html). Basically what you need to be doing is add `Access-Control-Allow-Origin` to the domain you want to enable cors on. [response.setHeaders](http://... | The easiest method, if you are using gulp would be to use gulp plugin called "gulp-connect" and "connect-modrewrite" and define a new gulptask to redirect a particular api.
This is to make the apache act as a Proxy for the particular api, to bypass the pre-flight request, inorder to avoid CORs issue.
I used the follow... |
17,124,600 | I am writing a little demo web server delivering static html,css and javascript.
The server looks like
```
(function () {
"use strict";
var http = require("http");
var connect = require('connect');
var app = connect()
.use(connect.logger('dev'))
.use(connect.static('home'));
var s... | 2013/06/15 | [
"https://Stackoverflow.com/questions/17124600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1359398/"
] | Had a bit of trouble figuring this one out since [express](http://expressjs.com/) has spoiled me.
Take a look at [enable cors](http://enable-cors.org/server_expressjs.html). Basically what you need to be doing is add `Access-Control-Allow-Origin` to the domain you want to enable cors on. [response.setHeaders](http://... | [`express.static`](http://expressjs.com/en/api.html#express.static) takes a configuration object. You can provide the property [`setHeaders`](http://expressjs.com/en/api.html#setHeaders) and from that function you can set headers for the response:
```
app.use(express.static('public', {
setHeaders: function s... |
17,124,600 | I am writing a little demo web server delivering static html,css and javascript.
The server looks like
```
(function () {
"use strict";
var http = require("http");
var connect = require('connect');
var app = connect()
.use(connect.logger('dev'))
.use(connect.static('home'));
var s... | 2013/06/15 | [
"https://Stackoverflow.com/questions/17124600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1359398/"
] | I hope this will help:
```
//CORS middleware
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', config.allowedDomains);
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type');
next();
}
//.... | The easiest method, if you are using gulp would be to use gulp plugin called "gulp-connect" and "connect-modrewrite" and define a new gulptask to redirect a particular api.
This is to make the apache act as a Proxy for the particular api, to bypass the pre-flight request, inorder to avoid CORs issue.
I used the follow... |
17,124,600 | I am writing a little demo web server delivering static html,css and javascript.
The server looks like
```
(function () {
"use strict";
var http = require("http");
var connect = require('connect');
var app = connect()
.use(connect.logger('dev'))
.use(connect.static('home'));
var s... | 2013/06/15 | [
"https://Stackoverflow.com/questions/17124600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1359398/"
] | I hope this will help:
```
//CORS middleware
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', config.allowedDomains);
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type');
next();
}
//.... | [`express.static`](http://expressjs.com/en/api.html#express.static) takes a configuration object. You can provide the property [`setHeaders`](http://expressjs.com/en/api.html#setHeaders) and from that function you can set headers for the response:
```
app.use(express.static('public', {
setHeaders: function s... |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | It depends what you mean by "safe" and "suppress".
I'd be tempted to catch the exception and throw an unchecked exception (or `AssertionError`) in its place. The chances are that your application will never experience this. But who knows ... someone might run it on some non-conformant platform in which UTF-8 was not a... | i Have used the below line of code and it worked for me
Old code
========
byte[] hash = digest.digest(input.getBytes("UFT-8"));
Updated Code
============
byte[] hash = digest.digest(input.getBytes(StandardCharsets.UTF\_8)); |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | As McDowell noted in a comment to [templatetypdef's answer](https://stackoverflow.com/questions/5049524/is-java-utf-8-charset-exception-possible/5049540#5049540): If you use a `Charset` object when you instantiate a new `String` instead of passing the name of the charset, you don't have to deal with an `UnsupportedEnco... | i Have used the below line of code and it worked for me
Old code
========
byte[] hash = digest.digest(input.getBytes("UFT-8"));
Updated Code
============
byte[] hash = digest.digest(input.getBytes(StandardCharsets.UTF\_8)); |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | As McDowell noted in a comment to [templatetypdef's answer](https://stackoverflow.com/questions/5049524/is-java-utf-8-charset-exception-possible/5049540#5049540): If you use a `Charset` object when you instantiate a new `String` instead of passing the name of the charset, you don't have to deal with an `UnsupportedEnco... | It's supposed to be present in every Java runtime, so it is reasonable to re-throw a runtime exception if it is missing. I wouldn't call that "suppressing," though. To me, suppressing means catching the exception and pretending it didn't happen; not sure how you'd proceed if the encoding is missing. |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | The most simple way is to create a UTF-8 charset constant. Then you don't have to catch the UnsupportedEncodingException again and again:
```
public class Charsets {
public static final Charset UTF_8 = Charset.forName("UTF-8");
}
```
Edit (2014-04):
With Java 7 you don't have to create your own constant. You ca... | i Have used the below line of code and it worked for me
Old code
========
byte[] hash = digest.digest(input.getBytes("UFT-8"));
Updated Code
============
byte[] hash = digest.digest(input.getBytes(StandardCharsets.UTF\_8)); |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | According to [the Javadoc for `Charset`](http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html), every Java implementation must support UTF-8, along with a few other charsets. Therefore, I think you can safely suppress the exception; unless you have a non-compliant Java implementation, this shouldn... | The most simple way is to create a UTF-8 charset constant. Then you don't have to catch the UnsupportedEncodingException again and again:
```
public class Charsets {
public static final Charset UTF_8 = Charset.forName("UTF-8");
}
```
Edit (2014-04):
With Java 7 you don't have to create your own constant. You ca... |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | As McDowell noted in a comment to [templatetypdef's answer](https://stackoverflow.com/questions/5049524/is-java-utf-8-charset-exception-possible/5049540#5049540): If you use a `Charset` object when you instantiate a new `String` instead of passing the name of the charset, you don't have to deal with an `UnsupportedEnco... | It depends what you mean by "safe" and "suppress".
I'd be tempted to catch the exception and throw an unchecked exception (or `AssertionError`) in its place. The chances are that your application will never experience this. But who knows ... someone might run it on some non-conformant platform in which UTF-8 was not a... |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | As McDowell noted in a comment to [templatetypdef's answer](https://stackoverflow.com/questions/5049524/is-java-utf-8-charset-exception-possible/5049540#5049540): If you use a `Charset` object when you instantiate a new `String` instead of passing the name of the charset, you don't have to deal with an `UnsupportedEnco... | According to [the Javadoc for `Charset`](http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html), every Java implementation must support UTF-8, along with a few other charsets. Therefore, I think you can safely suppress the exception; unless you have a non-compliant Java implementation, this shouldn... |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | According to [the Javadoc for `Charset`](http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html), every Java implementation must support UTF-8, along with a few other charsets. Therefore, I think you can safely suppress the exception; unless you have a non-compliant Java implementation, this shouldn... | It's supposed to be present in every Java runtime, so it is reasonable to re-throw a runtime exception if it is missing. I wouldn't call that "suppressing," though. To me, suppressing means catching the exception and pretending it didn't happen; not sure how you'd proceed if the encoding is missing. |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | It's supposed to be present in every Java runtime, so it is reasonable to re-throw a runtime exception if it is missing. I wouldn't call that "suppressing," though. To me, suppressing means catching the exception and pretending it didn't happen; not sure how you'd proceed if the encoding is missing. | i Have used the below line of code and it worked for me
Old code
========
byte[] hash = digest.digest(input.getBytes("UFT-8"));
Updated Code
============
byte[] hash = digest.digest(input.getBytes(StandardCharsets.UTF\_8)); |
5,049,524 | Can Java possibly throw `UnsupportedEncodingException` when using `"UTF-8"` encoding, or I can safely suppress it's throwing? | 2011/02/19 | [
"https://Stackoverflow.com/questions/5049524",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/466646/"
] | According to [the Javadoc for `Charset`](http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html), every Java implementation must support UTF-8, along with a few other charsets. Therefore, I think you can safely suppress the exception; unless you have a non-compliant Java implementation, this shouldn... | It depends what you mean by "safe" and "suppress".
I'd be tempted to catch the exception and throw an unchecked exception (or `AssertionError`) in its place. The chances are that your application will never experience this. But who knows ... someone might run it on some non-conformant platform in which UTF-8 was not a... |
20,342 | I want to put my .spacemacs into Github, so I cloned it to a local directory. How to let Emacs use the .spacemacs in that directory instead of from the default ~/.spacemacs? | 2016/02/16 | [
"https://emacs.stackexchange.com/questions/20342",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/6697/"
] | In much the same way as Emacs loads `~/.emacs.d/init.el` if it can't find a `~/.emacs` file, so does Spacemacs load `~/.spacemacs.d/init.el` if it can't find a `~/.spacemacs` file.
This means you can create a `~/.spacemacs.d` directory and rename the `~/.spacemacs` file to `~/.spacemacs.d/init.el`. Then you put the `~... | You can symlink your `.spacemacs` file. From a bash prompt:
```
$ ln -s /path/to/your/spacemacs-directory/.spacemacs ~/.spacemacs
```
You might find it easier to symlink the entire directory to a "dot directory," i.e. `~/.spacemacs.d`, in which case you would do this:
```
$ mv /path/to/your/spacemacs-directory/.spa... |
4,541,425 | I have observed an interesting property which could be wrong as it seems completely absurd but the motivation behind it makes me inclined to believe it is true (or at least in some cases). I do not have any pure mathematical background so I do not know what I am talking about but I wish this kind community would get th... | 2022/09/29 | [
"https://math.stackexchange.com/questions/4541425",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1034908/"
] | Yes, this ought to be true with appropriate hypotheses. Here is a sloppy argument ignoring convergence issues etc.; maybe a real analyst can tell us what hypotheses and bounds are needed. The integral $\int f(t) g(wt) \, dt$ is the inner product $\langle f(t), g(wt) \rangle$ on $L^2(\mathbb{R})$. Pass to Fourier transf... | Lets say we have:
$$\int f(t)g(\omega t)dt=\int\_0^t f(x)g(\omega x)dx$$
we can break down $t$ into various different regions as so:
$$t=kT+\varepsilon$$
where:
$$\varepsilon\in[0,T)\quad k\in\mathbb{Z}^+$$
now we can instead represent our integral as:
$$\int\_0^t f(x)g(\omega x)dx=\sum\_{i=0}^{k-1}\int\_{iT}^{(i+1)T}f... |
44,794,231 | I am trying to get data from my local database using Django and Ajax.
I set up a view where the user can get data and can pass in arguments to filter the data: start date, end date and site id.
Basically I want to pass arguments to views.py in order to filter data, but at the moment I don't really care if the params ar... | 2017/06/28 | [
"https://Stackoverflow.com/questions/44794231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6037054/"
] | You try to open '/acoustic\_viz/get-data/' but in urls.py all urls don't have `/acoustic_viz/` prefix. Try to change url in `index.html` template file
```
$.getJSON('/get-data/')
```
or add `acoustic_viz` to urls inside urls.py file:
```
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^acoustic_viz/get-data... | I think you forgot to end your url pattern with the **$** sign
You should have this
```
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^get-data/$', queries.views.get_data),
url(r'^get-sites/$', queries.views.get_sites),
url(r'^$', queries.views.hello_peeg),
]+ static(settings.STATIC_URL, doc... |
49,467,579 | Due to the bug mentioned in [I can not adjust the edittext linespacing](https://stackoverflow.com/q/42687621) and <https://issuetracker.google.com/issues/37009353#comment17>
I tried the following workaround, by having custom `onTextChanged`
`LinedEditText.java`:
```
import android.content.Context;
import android.gra... | 2018/03/24 | [
"https://Stackoverflow.com/questions/49467579",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72437/"
] | I'm using LIS3DH as well, and after a few hours of reading and trying, I've finally figured it out. Though my code is for AVR microcontroller, the method is still the same.
The accelerometer presents its readings as a *left-justified* 16-bit values, divided to 2-byte registers for each axis: `OUT_X_L`, `OUT_X_H`, `OUT... | According to the description on LIS3DH (ADC have 10-bit), you should do the following:
```
unsigned int result = ((acc_h & 0x03)<<8) + (acc_l & 0xFF);
```
for 12-bit you need next code:
```
unsigned int result = ((acc_h & 0x0F)<<8) + (acc_l & 0xFF);
``` |
5,934 | Hy just a "stupid" question, I bought a technisat skystar s2 pci card.
Can any body tell me why this thing has a mac address printed on it? ^^
And the mac address can even been looked up. (00-08-c9-xx-xx-xx)
Is it possible to receive/transmitt ethernet packets and if so is it possible to use this data link via atv(HAM... | 2016/03/14 | [
"https://ham.stackexchange.com/questions/5934",
"https://ham.stackexchange.com",
"https://ham.stackexchange.com/users/6257/"
] | Because Skystar card works as a network device. Physical layer is DVB-S signal on 1.2 GHz band comming from parabolic antenna converting from Ku or C band via LNB. Data stream is only downlink (no uplink or packet acknowlegment) and there are used error-correction codes based on Reed-Solomon which help to recover data ... | The DVB-T2 standard specifies (many things and ) an ethernet controler, that's all ... |
13,425,093 | I am trying to learn C++ and so far i have been on the right but i have been have a simple problem and i am getting confused on the case statement i have known how to deal with the if statement and i understand it very well,i working classes and methods in my code below which works perfectly i want to know how i can ch... | 2012/11/16 | [
"https://Stackoverflow.com/questions/13425093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806672/"
] | ```
switch(i) {
case 1:
Type="Technical literature";
break;
case 2:
Type="Fiction literature";
break;
case 3:
Type="Textbook";
break;
default:
cout << "Erorr you entered a wrong choice" << endl;
goto Choice;
}
``` | ```
void SetType(){
cout<<"Book SetType"<<endl;
Choice:
cout<<"Please Select from the list: \n 1- Technical literature \n 2- Fiction literature \n 3- Textbook"<<endl;
int i;
cin >> i;
switch(i)
{
case 1:
{
Type="Technical li... |
13,425,093 | I am trying to learn C++ and so far i have been on the right but i have been have a simple problem and i am getting confused on the case statement i have known how to deal with the if statement and i understand it very well,i working classes and methods in my code below which works perfectly i want to know how i can ch... | 2012/11/16 | [
"https://Stackoverflow.com/questions/13425093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806672/"
] | ```
switch(i) {
case 1:
Type="Technical literature";
break;
case 2:
Type="Fiction literature";
break;
case 3:
Type="Textbook";
break;
default:
cout << "Erorr you entered a wrong choice" << endl;
goto Choice;
}
``` | A `switch` / `case` is totally fit for your situation. Use a `switch` / `case` when you have discrete values you can test on a single variable, in your case `i`.
It works by defining each `case` and a `default` one in case the variable doesn't match with any case. Here's what your code would look like with a `switch` ... |
13,425,093 | I am trying to learn C++ and so far i have been on the right but i have been have a simple problem and i am getting confused on the case statement i have known how to deal with the if statement and i understand it very well,i working classes and methods in my code below which works perfectly i want to know how i can ch... | 2012/11/16 | [
"https://Stackoverflow.com/questions/13425093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806672/"
] | ```
switch(i) {
case 1:
Type="Technical literature";
break;
case 2:
Type="Fiction literature";
break;
case 3:
Type="Textbook";
break;
default:
cout << "Erorr you entered a wrong choice" << endl;
goto Choice;
}
``` | ```
void SetType(){
cout<<"Book SetType"<<endl;
Choice:
cout<<"Please Select from the list: \n 1- Technical literature \n 2- Fiction literature \n 3- Textbook"<<endl;
int i;
cin >> i;
switch(i) {
case 1: Type="Technical literature"; break;
case 2: Type="Fiction literature"; break;
... |
13,425,093 | I am trying to learn C++ and so far i have been on the right but i have been have a simple problem and i am getting confused on the case statement i have known how to deal with the if statement and i understand it very well,i working classes and methods in my code below which works perfectly i want to know how i can ch... | 2012/11/16 | [
"https://Stackoverflow.com/questions/13425093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806672/"
] | A `switch` / `case` is totally fit for your situation. Use a `switch` / `case` when you have discrete values you can test on a single variable, in your case `i`.
It works by defining each `case` and a `default` one in case the variable doesn't match with any case. Here's what your code would look like with a `switch` ... | ```
void SetType(){
cout<<"Book SetType"<<endl;
Choice:
cout<<"Please Select from the list: \n 1- Technical literature \n 2- Fiction literature \n 3- Textbook"<<endl;
int i;
cin >> i;
switch(i)
{
case 1:
{
Type="Technical li... |
13,425,093 | I am trying to learn C++ and so far i have been on the right but i have been have a simple problem and i am getting confused on the case statement i have known how to deal with the if statement and i understand it very well,i working classes and methods in my code below which works perfectly i want to know how i can ch... | 2012/11/16 | [
"https://Stackoverflow.com/questions/13425093",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1806672/"
] | A `switch` / `case` is totally fit for your situation. Use a `switch` / `case` when you have discrete values you can test on a single variable, in your case `i`.
It works by defining each `case` and a `default` one in case the variable doesn't match with any case. Here's what your code would look like with a `switch` ... | ```
void SetType(){
cout<<"Book SetType"<<endl;
Choice:
cout<<"Please Select from the list: \n 1- Technical literature \n 2- Fiction literature \n 3- Textbook"<<endl;
int i;
cin >> i;
switch(i) {
case 1: Type="Technical literature"; break;
case 2: Type="Fiction literature"; break;
... |
27,872,107 | The question <https://stackoverflow.com/questions/2797806/what-tricks-can-be-used-to-type-and-edit-code-faster> was closed for not being constructive, so I will try to make this have a specific answer.
My question is specific to Android/Java but it applies to any programming language.
I have some code that looks like... | 2015/01/10 | [
"https://Stackoverflow.com/questions/27872107",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3681880/"
] | You don't need excel or calc, you need to structure your programming right.
```
private static Map<Integer, Integer> idToColor = new Map<Integer, Integer>();
//at init time
void initMap(){
idToColor.add(R.id.v_white, R.color.v_white);
//1 line per color
}
```
Then your switch becomes:
```
Integer color = ... | First you need to isolate the color names that you have already written. They are currently in the following format:
```
<color name="COLOR_NAME">#80deea</color>
```
Copy the whole list and paste it into a spreadsheet program as **unformatted text** (Ctrl+Shift+V). (I am using LibreOffice Calc for my answer. I imagi... |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | The square root $\sqrt{y}$ of a non-negative real number $y$ is, by definition, the unique non-negative real number $x$ such that $x^2=y$. So what does this imply for $\sqrt{x^2}$?
If $x$ is not negative, then obviously the non-negative number whose square is the square of $x$ is $x$ itself.
If $x$ is negative, then ... | This follows from the definition of absolute value: If $0\leq a$, then $\sqrt{a}$ is defined as the non-negative unique solution of the equation $x^2=a$. Now, since the solutions of the equation $x^2=a^2$ are $x=|a|$ and $a=-|a|$, it follows by the definition that $\sqrt{a^2}=|a|$. |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | No. $\sqrt a$ conventionally denotes the `non-negative` square root of a non-negative real number, and $x^2\ge 0$ even if $x <0$. Remember a positive real number has two (opposite) square roots. | Consider the three cases where $x<0$, $x=0$ and $x>0$ separately. In each case, you'll find that $\sqrt{x^2}=\vert x \vert$. |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | Remember that every (positive) number has *two* numbers which square to it: e.g., $$4=2^2=(-2)^2.$$ In order to be a function, the square root operator has to *pick one* (a function can't be multivalued).
We make the convention that $\sqrt{a}$ is always the *nonnegative* square root of $a$, so e.g. $\sqrt{4}=2$ and n... | This follows from the definition of absolute value: If $0\leq a$, then $\sqrt{a}$ is defined as the non-negative unique solution of the equation $x^2=a$. Now, since the solutions of the equation $x^2=a^2$ are $x=|a|$ and $a=-|a|$, it follows by the definition that $\sqrt{a^2}=|a|$. |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | Remember that every (positive) number has *two* numbers which square to it: e.g., $$4=2^2=(-2)^2.$$ In order to be a function, the square root operator has to *pick one* (a function can't be multivalued).
We make the convention that $\sqrt{a}$ is always the *nonnegative* square root of $a$, so e.g. $\sqrt{4}=2$ and n... | No. $\sqrt a$ conventionally denotes the `non-negative` square root of a non-negative real number, and $x^2\ge 0$ even if $x <0$. Remember a positive real number has two (opposite) square roots. |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | No. $\sqrt a$ conventionally denotes the `non-negative` square root of a non-negative real number, and $x^2\ge 0$ even if $x <0$. Remember a positive real number has two (opposite) square roots. | This follows from the definition of absolute value: If $0\leq a$, then $\sqrt{a}$ is defined as the non-negative unique solution of the equation $x^2=a$. Now, since the solutions of the equation $x^2=a^2$ are $x=|a|$ and $a=-|a|$, it follows by the definition that $\sqrt{a^2}=|a|$. |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | The square root $\sqrt{y}$ of a non-negative real number $y$ is, by definition, the unique non-negative real number $x$ such that $x^2=y$. So what does this imply for $\sqrt{x^2}$?
If $x$ is not negative, then obviously the non-negative number whose square is the square of $x$ is $x$ itself.
If $x$ is negative, then ... | Consider the three cases where $x<0$, $x=0$ and $x>0$ separately. In each case, you'll find that $\sqrt{x^2}=\vert x \vert$. |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | Remember that every (positive) number has *two* numbers which square to it: e.g., $$4=2^2=(-2)^2.$$ In order to be a function, the square root operator has to *pick one* (a function can't be multivalued).
We make the convention that $\sqrt{a}$ is always the *nonnegative* square root of $a$, so e.g. $\sqrt{4}=2$ and n... | The square root $\sqrt{y}$ of a non-negative real number $y$ is, by definition, the unique non-negative real number $x$ such that $x^2=y$. So what does this imply for $\sqrt{x^2}$?
If $x$ is not negative, then obviously the non-negative number whose square is the square of $x$ is $x$ itself.
If $x$ is negative, then ... |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | Here's the basic principle of a function: for every input, you get **only one** output.
Consider $(-9)^2$. This is $81$. If $\sqrt{x^2} = x$, then $\sqrt{81} = \sqrt{(-9)^2} = -9.$
Consider $(9)^2$. This is also $81$. If $\sqrt{x^2} = x$, then $\sqrt{81} = \sqrt{9^2} = 9$.
When I write $\sqrt{81}$, it should unambig... | The square root $\sqrt{y}$ of a non-negative real number $y$ is, by definition, the unique non-negative real number $x$ such that $x^2=y$. So what does this imply for $\sqrt{x^2}$?
If $x$ is not negative, then obviously the non-negative number whose square is the square of $x$ is $x$ itself.
If $x$ is negative, then ... |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | Here's the basic principle of a function: for every input, you get **only one** output.
Consider $(-9)^2$. This is $81$. If $\sqrt{x^2} = x$, then $\sqrt{81} = \sqrt{(-9)^2} = -9.$
Consider $(9)^2$. This is also $81$. If $\sqrt{x^2} = x$, then $\sqrt{81} = \sqrt{9^2} = 9$.
When I write $\sqrt{81}$, it should unambig... | This follows from the definition of absolute value: If $0\leq a$, then $\sqrt{a}$ is defined as the non-negative unique solution of the equation $x^2=a$. Now, since the solutions of the equation $x^2=a^2$ are $x=|a|$ and $a=-|a|$, it follows by the definition that $\sqrt{a^2}=|a|$. |
2,068,883 | This equality keeps coming up in my algebra course and I don't understand why this is true. $$ \sqrt{x^2} = |x| $$ shouldn't it just be $$ \sqrt{x^2} = x $$? | 2016/12/22 | [
"https://math.stackexchange.com/questions/2068883",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/401334/"
] | Remember that every (positive) number has *two* numbers which square to it: e.g., $$4=2^2=(-2)^2.$$ In order to be a function, the square root operator has to *pick one* (a function can't be multivalued).
We make the convention that $\sqrt{a}$ is always the *nonnegative* square root of $a$, so e.g. $\sqrt{4}=2$ and n... | Consider the three cases where $x<0$, $x=0$ and $x>0$ separately. In each case, you'll find that $\sqrt{x^2}=\vert x \vert$. |
51,678,249 | I've got a problem, I need to wait until the component shows in the screen, sometimes the components delays too long to show up. I need to wait until some field, or variable becomes true. Someone knows how to do this?
```
element(by.id('nextStage-button')).isPresent().then(function (visible) {
let i = 0;
while... | 2018/08/03 | [
"https://Stackoverflow.com/questions/51678249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8260728/"
] | You're setting everything up (almost) correctly - but you're never **actually executing** the stored procedure!
Try this code:
```
protected void Button_Save_Click(object sender, EventArgs e)
{
string connectionStr = ConfigurationManager.ConnectionStrings["ORAProjectConnectionString"].ConnectionString;
// the... | Your query line should just be:
```
string query = "sp_UpdateProj";
```
You already have the parameters as objects below that.
Then add
```
cmd.ExecuteNonQuery();
```
to execute |
51,678,249 | I've got a problem, I need to wait until the component shows in the screen, sometimes the components delays too long to show up. I need to wait until some field, or variable becomes true. Someone knows how to do this?
```
element(by.id('nextStage-button')).isPresent().then(function (visible) {
let i = 0;
while... | 2018/08/03 | [
"https://Stackoverflow.com/questions/51678249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8260728/"
] | There are some errors in the `Button_Save_Click` event handler:
1. When you use `commandType` is `StoredProcedure` you have to pass just the stored procedure name
2. With having a stored procedure with `sp_` prefix create performance issue ([Using sp\_ as prefix for user stored procedures in SQL server causing perform... | Your query line should just be:
```
string query = "sp_UpdateProj";
```
You already have the parameters as objects below that.
Then add
```
cmd.ExecuteNonQuery();
```
to execute |
51,678,249 | I've got a problem, I need to wait until the component shows in the screen, sometimes the components delays too long to show up. I need to wait until some field, or variable becomes true. Someone knows how to do this?
```
element(by.id('nextStage-button')).isPresent().then(function (visible) {
let i = 0;
while... | 2018/08/03 | [
"https://Stackoverflow.com/questions/51678249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8260728/"
] | You're setting everything up (almost) correctly - but you're never **actually executing** the stored procedure!
Try this code:
```
protected void Button_Save_Click(object sender, EventArgs e)
{
string connectionStr = ConfigurationManager.ConnectionStrings["ORAProjectConnectionString"].ConnectionString;
// the... | Here is the brief info bout executing stored procedure using C#
[Call a stored procedure with parameter in c#](https://stackoverflow.com/questions/7542517/call-a-stored-procedure-with-parameter-in-c-sharp?answertab=active#tab-top) |
51,678,249 | I've got a problem, I need to wait until the component shows in the screen, sometimes the components delays too long to show up. I need to wait until some field, or variable becomes true. Someone knows how to do this?
```
element(by.id('nextStage-button')).isPresent().then(function (visible) {
let i = 0;
while... | 2018/08/03 | [
"https://Stackoverflow.com/questions/51678249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8260728/"
] | You're setting everything up (almost) correctly - but you're never **actually executing** the stored procedure!
Try this code:
```
protected void Button_Save_Click(object sender, EventArgs e)
{
string connectionStr = ConfigurationManager.ConnectionStrings["ORAProjectConnectionString"].ConnectionString;
// the... | There are some errors in the `Button_Save_Click` event handler:
1. When you use `commandType` is `StoredProcedure` you have to pass just the stored procedure name
2. With having a stored procedure with `sp_` prefix create performance issue ([Using sp\_ as prefix for user stored procedures in SQL server causing perform... |
51,678,249 | I've got a problem, I need to wait until the component shows in the screen, sometimes the components delays too long to show up. I need to wait until some field, or variable becomes true. Someone knows how to do this?
```
element(by.id('nextStage-button')).isPresent().then(function (visible) {
let i = 0;
while... | 2018/08/03 | [
"https://Stackoverflow.com/questions/51678249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8260728/"
] | There are some errors in the `Button_Save_Click` event handler:
1. When you use `commandType` is `StoredProcedure` you have to pass just the stored procedure name
2. With having a stored procedure with `sp_` prefix create performance issue ([Using sp\_ as prefix for user stored procedures in SQL server causing perform... | Here is the brief info bout executing stored procedure using C#
[Call a stored procedure with parameter in c#](https://stackoverflow.com/questions/7542517/call-a-stored-procedure-with-parameter-in-c-sharp?answertab=active#tab-top) |
48,710,691 | Hi Guys this is my function, i am using laravel 5.3
```
public function search(Request $request){
$word = $request->search;
$status = explode(",", $request->status);
$type = explode(",", $request->type);
$beds = $request->beds;
$baths = $request->baths;
$amenities = explode(",", $request->amen... | 2018/02/09 | [
"https://Stackoverflow.com/questions/48710691",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4691808/"
] | The logic inside the closure will always return one `where()` which is `return $query->where('st.title', $v);`
Also, you should just use `whereIn()` instead of reinventing the wheel by building multiple `orWhere()` clauses:
```
->when($status, function ($query) use ($status) {
return $query->whereIn('st.title', $... | If you want all the condition in the query to be true to get the answer and use multiple `where` clause and if you want any or some of the condition to be true to get the answer then use `whereOr` clause
```
$query = DB::table('properties as pr')
->where("condition " : "? ")
->... |
25,798 | Vowel harmony and Umlaut are widely attested, whereby vowels are affected by other vowels in the sense of making them closer in features to other vowels in the same word. **Is there a comparable phenomenon that leads to regular dissimilation of vowels?**
This effect could work as an inverse form of vowel harmony, wher... | 2017/08/28 | [
"https://linguistics.stackexchange.com/questions/25798",
"https://linguistics.stackexchange.com",
"https://linguistics.stackexchange.com/users/14883/"
] | Sound shifts are not in general “regular”, but there are sound laws that work with a fair degree of predictability. One example is the phenomenon in Semitic known as Barth’s law. As originally formulated it dictates that in Hebrew and Aramaic
>
> the prefix vowel of the prefix or imperfect(ive) conjugation in the
> ... | Yes. In Patricia Donegan's [theory of vowels](http://www.ling.hawaii.edu/faculty/donegan/Papers/1978phd.pdf), contextual conditions on vowel fortitions are generally dissimilatory. (Vowel harmony and umlaut, which you mention, are lenitions rather than fortitions.) |
25,798 | Vowel harmony and Umlaut are widely attested, whereby vowels are affected by other vowels in the sense of making them closer in features to other vowels in the same word. **Is there a comparable phenomenon that leads to regular dissimilation of vowels?**
This effect could work as an inverse form of vowel harmony, wher... | 2017/08/28 | [
"https://linguistics.stackexchange.com/questions/25798",
"https://linguistics.stackexchange.com",
"https://linguistics.stackexchange.com/users/14883/"
] | In the realm of regular synchronic processes, vowel dissimilation is relatively uncommon (dissimilation itself is uncommon, and vowel-to-vowel dissimilation is most uncommon); however, it does exist. Examples are low-vowel dissimilation in Woleaian where /a/ becomes [e] before *a* in the next syllable (described in Soh... | Yes. In Patricia Donegan's [theory of vowels](http://www.ling.hawaii.edu/faculty/donegan/Papers/1978phd.pdf), contextual conditions on vowel fortitions are generally dissimilatory. (Vowel harmony and umlaut, which you mention, are lenitions rather than fortitions.) |
25,798 | Vowel harmony and Umlaut are widely attested, whereby vowels are affected by other vowels in the sense of making them closer in features to other vowels in the same word. **Is there a comparable phenomenon that leads to regular dissimilation of vowels?**
This effect could work as an inverse form of vowel harmony, wher... | 2017/08/28 | [
"https://linguistics.stackexchange.com/questions/25798",
"https://linguistics.stackexchange.com",
"https://linguistics.stackexchange.com/users/14883/"
] | In the realm of regular synchronic processes, vowel dissimilation is relatively uncommon (dissimilation itself is uncommon, and vowel-to-vowel dissimilation is most uncommon); however, it does exist. Examples are low-vowel dissimilation in Woleaian where /a/ becomes [e] before *a* in the next syllable (described in Soh... | Sound shifts are not in general “regular”, but there are sound laws that work with a fair degree of predictability. One example is the phenomenon in Semitic known as Barth’s law. As originally formulated it dictates that in Hebrew and Aramaic
>
> the prefix vowel of the prefix or imperfect(ive) conjugation in the
> ... |
52,441,665 | I am using `Doctrine` within a `Symfony 2.8` project. One of the entities uses an array field:
```
/**
* @ORM\Column(name="raw_data", type="array", nullable=true)
*/
protected $data;
```
Due to a bug some entities stored a string within this property instead of an array:
```
$entity->setData('some string');
// ==... | 2018/09/21 | [
"https://Stackoverflow.com/questions/52441665",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/777861/"
] | This is mostly the wrong approach. For a start, there is no need to create `user1`; if you wanted to update an existing object, you should just set the values directly there.
But the way to do this in Django is to use a ModelForm. That has many advantages, especially in that it will validate your input, checking that ... | You can do it in one line like this:
```
User.objects.filter(pk=user1.pk).update(fullname=user1.fullname,
username=user1.username)
```
The other way to update models is to use forms like this:
```
# You can get user based on your logic
user = request.user
# 'EditUserForm' is the custom form, read more about djang... |
21,969,044 | I want to know when should I exactly use the `prototype` scope in Spring? I have understood that `singleton` returns the same object instance if the bean is requested for.
Then why should we consider `prototype`?
Explanations with examples would help a lot to understand the need for it. | 2014/02/23 | [
"https://Stackoverflow.com/questions/21969044",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3343398/"
] | To be clear simple definitions:
* Prototype scope = A new object is created each time it is injected/looked up. It will use new `SomeBean()` each time.
* Singleton scope = The same object is returned each time it is injected/looked up. Here it will instantiate one instance of `SomeBean` and then return it each time.
... | There are some interesting use cases by using scope **prototype** you will build a better and reliable application design/architecture, for example, a real-time system.
Imagine that you must build a real-time system for vehicle tracking, and you will have 2.000.000 cars sharing information every 5 seconds,
In the serv... |
21,969,044 | I want to know when should I exactly use the `prototype` scope in Spring? I have understood that `singleton` returns the same object instance if the bean is requested for.
Then why should we consider `prototype`?
Explanations with examples would help a lot to understand the need for it. | 2014/02/23 | [
"https://Stackoverflow.com/questions/21969044",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3343398/"
] | To be clear simple definitions:
* Prototype scope = A new object is created each time it is injected/looked up. It will use new `SomeBean()` each time.
* Singleton scope = The same object is returned each time it is injected/looked up. Here it will instantiate one instance of `SomeBean` and then return it each time.
... | As the documentation says, creating a bean Foo with prototype scope is same as calling:
```
Foo foo = new Foo(dependency1, dependency2, ...);
foo.initialize(dependency7, dependency8...);
```
The only good reason to use a prototype scope bean instead of `new` that is when the dependencies used for creation and initia... |
21,969,044 | I want to know when should I exactly use the `prototype` scope in Spring? I have understood that `singleton` returns the same object instance if the bean is requested for.
Then why should we consider `prototype`?
Explanations with examples would help a lot to understand the need for it. | 2014/02/23 | [
"https://Stackoverflow.com/questions/21969044",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3343398/"
] | There are some interesting use cases by using scope **prototype** you will build a better and reliable application design/architecture, for example, a real-time system.
Imagine that you must build a real-time system for vehicle tracking, and you will have 2.000.000 cars sharing information every 5 seconds,
In the serv... | As the documentation says, creating a bean Foo with prototype scope is same as calling:
```
Foo foo = new Foo(dependency1, dependency2, ...);
foo.initialize(dependency7, dependency8...);
```
The only good reason to use a prototype scope bean instead of `new` that is when the dependencies used for creation and initia... |
63,916,509 | I wrote some simple code while I was trying to understand pointer stuff in c++. And I found out that a constructor does not work.
I have no idea what is happening here.
```
template <typename T>
class Node
{
public:
T* Data;
Node<T>* right;
Node<T>* left;
};
class SimpleClass
{
public:
SimpleClas... | 2020/09/16 | [
"https://Stackoverflow.com/questions/63916509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13927099/"
] | Because you create an object for Class Node and not create any object of class SimpleClass so the constructor of this class is not called.
```
int main(void)
{
Node<SimpleClass>* A = new Node<SimpleClass>[1];
Node<SimpleClass>* temp = new Node<SimpleClass>[1];
A->Data = new SimpleClass();
... | You are creating 2 objects of type `Node<SimpleClass>` and the constructor for this class is called twice. You can verify with:
```
#include <iostream>
template <typename T>
class Node
{
public:
Node() { std::cout << "Node constructor\n"; }
T* Data;
Node<T>* right;
Node<T>* left;
};
class SimpleClass... |
63,916,509 | I wrote some simple code while I was trying to understand pointer stuff in c++. And I found out that a constructor does not work.
I have no idea what is happening here.
```
template <typename T>
class Node
{
public:
T* Data;
Node<T>* right;
Node<T>* left;
};
class SimpleClass
{
public:
SimpleClas... | 2020/09/16 | [
"https://Stackoverflow.com/questions/63916509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13927099/"
] | Because you create an object for Class Node and not create any object of class SimpleClass so the constructor of this class is not called.
```
int main(void)
{
Node<SimpleClass>* A = new Node<SimpleClass>[1];
Node<SimpleClass>* temp = new Node<SimpleClass>[1];
A->Data = new SimpleClass();
... | Your `Node` does not contain a `T` (or in this case a `SimpleClass`) - it contains a pointer to a `T`. So the `Node` is constructed and the pointers it contains is constructed, but the `T` (`SimpleClass`) is not.
You can change `T* Data;` to `T Data;` and you will see your `SimpleClass` be constructed, or give `Node` ... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | You can deploy your flutter web app in a shared hosting with **Nodejs** or in **VPS** server with **Python** Follow this Medium Blog [Post](https://medium.com/firebits/deploy-flutter-web-app-in-a-shared-hosting-with-nodejs-5f7bc820b18d)
[](https://i.s... | If it's a Firebase project you can use **Firebase Hosting**.
It will ask you to install **Firebase Tools** on your system and you will have to initialize it on the root folder of your project.
Then you just have to:
```
flutter build web
firebase deploy
```
and refresh browser (maybe with *ctrl + F5* or *ctrl + sh... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | **[UPDATE]**
To create a production build for web, you can now directly run `flutter build web` command similar to other platforms (android and ios)
and you will see **`build/web`** folder generated with the assets folder and you can simply deploy it on your server.
**[OLD ANSWER STEP 1 & 2 No longer required ]**
yo... | You can deploy your flutter web app in a shared hosting with **Nodejs** or in **VPS** server with **Python** Follow this Medium Blog [Post](https://medium.com/firebits/deploy-flutter-web-app-in-a-shared-hosting-with-nodejs-5f7bc820b18d)
[](https://i.s... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | **[UPDATE]**
To create a production build for web, you can now directly run `flutter build web` command similar to other platforms (android and ios)
and you will see **`build/web`** folder generated with the assets folder and you can simply deploy it on your server.
**[OLD ANSWER STEP 1 & 2 No longer required ]**
yo... | If it's a Firebase project you can use **Firebase Hosting**.
It will ask you to install **Firebase Tools** on your system and you will have to initialize it on the root folder of your project.
Then you just have to:
```
flutter build web
firebase deploy
```
and refresh browser (maybe with *ctrl + F5* or *ctrl + sh... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | **[UPDATE]**
To create a production build for web, you can now directly run `flutter build web` command similar to other platforms (android and ios)
and you will see **`build/web`** folder generated with the assets folder and you can simply deploy it on your server.
**[OLD ANSWER STEP 1 & 2 No longer required ]**
yo... | >
> **Nota Bene** - Using flutter 2.0 as of today, I am seeing a bug where the images are not uploaded. Performance is also not the best as of
> today. Bookmark this and I will update with workarounds.
>
>
>
One solution for those who use VPS/Shared hosting of any kind:
* Open the local build folder
* Compress (z... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | **[UPDATE]**
To create a production build for web, you can now directly run `flutter build web` command similar to other platforms (android and ios)
and you will see **`build/web`** folder generated with the assets folder and you can simply deploy it on your server.
**[OLD ANSWER STEP 1 & 2 No longer required ]**
yo... | if you want to use your own server over web e.q your virtual private host or other host over net :
go to the root folder of your project and do a build in release mode `flutter build web`,then
upload `(/build/web)`directory to your server ,
you can follow [this link](https://learn.microsoft.com/en-us/iis/manage/creat... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | Here is the simple way to deploy your flutter web application on amazon web server.
Following is the simple process i follow.
1. Build flutter web: `flutter build web —release`
2. [Create instance on aws ec2 server](https://console.aws.amazon.com/ec2): mean allocate some memory for
your website on server. Instance is... | >
> **Nota Bene** - Using flutter 2.0 as of today, I am seeing a bug where the images are not uploaded. Performance is also not the best as of
> today. Bookmark this and I will update with workarounds.
>
>
>
One solution for those who use VPS/Shared hosting of any kind:
* Open the local build folder
* Compress (z... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | if you want to use your own server over web e.q your virtual private host or other host over net :
go to the root folder of your project and do a build in release mode `flutter build web`,then
upload `(/build/web)`directory to your server ,
you can follow [this link](https://learn.microsoft.com/en-us/iis/manage/creat... | If it's a Firebase project you can use **Firebase Hosting**.
It will ask you to install **Firebase Tools** on your system and you will have to initialize it on the root folder of your project.
Then you just have to:
```
flutter build web
firebase deploy
```
and refresh browser (maybe with *ctrl + F5* or *ctrl + sh... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | **[UPDATE]**
To create a production build for web, you can now directly run `flutter build web` command similar to other platforms (android and ios)
and you will see **`build/web`** folder generated with the assets folder and you can simply deploy it on your server.
**[OLD ANSWER STEP 1 & 2 No longer required ]**
yo... | Here is the simple way to deploy your flutter web application on amazon web server.
Following is the simple process i follow.
1. Build flutter web: `flutter build web —release`
2. [Create instance on aws ec2 server](https://console.aws.amazon.com/ec2): mean allocate some memory for
your website on server. Instance is... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | You can deploy your flutter web app in a shared hosting with **Nodejs** or in **VPS** server with **Python** Follow this Medium Blog [Post](https://medium.com/firebits/deploy-flutter-web-app-in-a-shared-hosting-with-nodejs-5f7bc820b18d)
[](https://i.s... | >
> **Nota Bene** - Using flutter 2.0 as of today, I am seeing a bug where the images are not uploaded. Performance is also not the best as of
> today. Bookmark this and I will update with workarounds.
>
>
>
One solution for those who use VPS/Shared hosting of any kind:
* Open the local build folder
* Compress (z... |
56,066,484 | I was learning Flutter web. Now I want to deploy this code in the real server.
The flutter code here: in the lib folder
```
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter layout demo',
... | 2019/05/09 | [
"https://Stackoverflow.com/questions/56066484",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7585327/"
] | if you want to use your own server over web e.q your virtual private host or other host over net :
go to the root folder of your project and do a build in release mode `flutter build web`,then
upload `(/build/web)`directory to your server ,
you can follow [this link](https://learn.microsoft.com/en-us/iis/manage/creat... | >
> **Nota Bene** - Using flutter 2.0 as of today, I am seeing a bug where the images are not uploaded. Performance is also not the best as of
> today. Bookmark this and I will update with workarounds.
>
>
>
One solution for those who use VPS/Shared hosting of any kind:
* Open the local build folder
* Compress (z... |
42,760,059 | We are sucessfully using pytest (Python 3) to run a test suite testing some hardware devices (electronics).
For a subset of these tests, we need the tester to change the hardware arrangement, and afterwards change it back.
My approach was to use a module-level fixture attached to the tests in question (which are all ... | 2017/03/13 | [
"https://Stackoverflow.com/questions/42760059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599884/"
] | So, I found a [hint](https://github.com/pytest-dev/pytest/issues/1599#issuecomment-261964636) by a pytest dev, based on which I basically do what the `capsys.disable()` function does:
```
@pytest.fixture(scope="module")
def disconnect_component(pytestconfig):
capmanager = pytestconfig.pluginmanager.getplugin('capt... | Maybe it's worth noting that above solution doesn't have to be in a fixture. I've made a helper function for that:
```
import pytest
def ask_user_input(msg=''):
""" Asks user to check something manually and answer a question
"""
notification = "\n\n???\tANSWER NEEDED\t???\n\n{}".format(msg)
# suspend... |
42,760,059 | We are sucessfully using pytest (Python 3) to run a test suite testing some hardware devices (electronics).
For a subset of these tests, we need the tester to change the hardware arrangement, and afterwards change it back.
My approach was to use a module-level fixture attached to the tests in question (which are all ... | 2017/03/13 | [
"https://Stackoverflow.com/questions/42760059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599884/"
] | So, I found a [hint](https://github.com/pytest-dev/pytest/issues/1599#issuecomment-261964636) by a pytest dev, based on which I basically do what the `capsys.disable()` function does:
```
@pytest.fixture(scope="module")
def disconnect_component(pytestconfig):
capmanager = pytestconfig.pluginmanager.getplugin('capt... | For future reference, if you need to use `input` with `pytest`. You can do this in any part of your pytest, `setup_class`, `test_...`, `teardown_method`, etc. This is for `pytest > 3.3.x`
```
import pytest
capture_manager = pytest.config.pluginmanager.getplugin('capturemanager')
capture_manager.suspend_global_capture... |
42,760,059 | We are sucessfully using pytest (Python 3) to run a test suite testing some hardware devices (electronics).
For a subset of these tests, we need the tester to change the hardware arrangement, and afterwards change it back.
My approach was to use a module-level fixture attached to the tests in question (which are all ... | 2017/03/13 | [
"https://Stackoverflow.com/questions/42760059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599884/"
] | So, I found a [hint](https://github.com/pytest-dev/pytest/issues/1599#issuecomment-261964636) by a pytest dev, based on which I basically do what the `capsys.disable()` function does:
```
@pytest.fixture(scope="module")
def disconnect_component(pytestconfig):
capmanager = pytestconfig.pluginmanager.getplugin('capt... | Solutions that use the global `pytest.config` object no longer work. For my use case, using `--capture=sys` together with a custom `input()` that uses `stdin` and `stdout` directly works well.
```py
def fd_input(prompt):
with os.fdopen(os.dup(1), "w") as stdout:
stdout.write("\n{}? ".format(prompt))
... |
42,760,059 | We are sucessfully using pytest (Python 3) to run a test suite testing some hardware devices (electronics).
For a subset of these tests, we need the tester to change the hardware arrangement, and afterwards change it back.
My approach was to use a module-level fixture attached to the tests in question (which are all ... | 2017/03/13 | [
"https://Stackoverflow.com/questions/42760059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599884/"
] | So, I found a [hint](https://github.com/pytest-dev/pytest/issues/1599#issuecomment-261964636) by a pytest dev, based on which I basically do what the `capsys.disable()` function does:
```
@pytest.fixture(scope="module")
def disconnect_component(pytestconfig):
capmanager = pytestconfig.pluginmanager.getplugin('capt... | As of pytest 5, as a fixture, you can use this:
```
@pytest.fixture
def suspend_capture(pytestconfig):
class suspend_guard:
def __init__(self):
self.capmanager = pytestconfig.pluginmanager.getplugin('capturemanager')
def __enter__(self):
self.capmanager.suspend_global_captur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.