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 |
|---|---|---|---|---|---|
63,999 | I'm afraid I know little about breadmaking.
Is there a bread where you could:
-- mix it and I guess knead it **in the evening** (say around 9pm),
-- **leaving it out** overnight (perhaps to rise (?) etc.?)
-- then about 8? hours later (**say around 7am?**) you could put it in an oven
-- and indeed then bake the lo... | 2015/12/01 | [
"https://cooking.stackexchange.com/questions/63999",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/38062/"
] | [Try this (no-knead bread)](http://cooking.nytimes.com/recipes/11376-no-knead-bread).
I have done it a few times, and it is great. One thing to note though is that I used parchment paper inside the dutch oven as per instructions on a different site, and it discolored the enamel. You may not actually need to do anythin... | If you are just wanting to throw together a loaf of bread in the morning without having to deal with the timing on rising, etc. try a beer bread ([example](http://www.food.com/recipe/beer-bread-73440)). I bake one that takes about 45 minutes, and experiment with different craft brews to alter the flavor. I made one the... |
63,999 | I'm afraid I know little about breadmaking.
Is there a bread where you could:
-- mix it and I guess knead it **in the evening** (say around 9pm),
-- **leaving it out** overnight (perhaps to rise (?) etc.?)
-- then about 8? hours later (**say around 7am?**) you could put it in an oven
-- and indeed then bake the lo... | 2015/12/01 | [
"https://cooking.stackexchange.com/questions/63999",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/38062/"
] | The main problem with your method is the fact that leaving bread out to rise at room temperature for 8+ hours almost always leads to overproofing.
Overproofing usually means the gluten formation has been stretched to its very limits and will usually result in the dough collapsing.
Most breads dough made the night be... | [Try this (no-knead bread)](http://cooking.nytimes.com/recipes/11376-no-knead-bread).
I have done it a few times, and it is great. One thing to note though is that I used parchment paper inside the dutch oven as per instructions on a different site, and it discolored the enamel. You may not actually need to do anythin... |
63,999 | I'm afraid I know little about breadmaking.
Is there a bread where you could:
-- mix it and I guess knead it **in the evening** (say around 9pm),
-- **leaving it out** overnight (perhaps to rise (?) etc.?)
-- then about 8? hours later (**say around 7am?**) you could put it in an oven
-- and indeed then bake the lo... | 2015/12/01 | [
"https://cooking.stackexchange.com/questions/63999",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/38062/"
] | The main problem with your method is the fact that leaving bread out to rise at room temperature for 8+ hours almost always leads to overproofing.
Overproofing usually means the gluten formation has been stretched to its very limits and will usually result in the dough collapsing.
Most breads dough made the night be... | There are many bread recipes that can be made up ahead and put into the refrigerator to rise slowly for several hours or overnight. Some standard recipes can be adapted to this method, but you may need to adjust ingredients to prevent over-proofing. You can find plenty of this thing by searching for "easy overnight bre... |
63,999 | I'm afraid I know little about breadmaking.
Is there a bread where you could:
-- mix it and I guess knead it **in the evening** (say around 9pm),
-- **leaving it out** overnight (perhaps to rise (?) etc.?)
-- then about 8? hours later (**say around 7am?**) you could put it in an oven
-- and indeed then bake the lo... | 2015/12/01 | [
"https://cooking.stackexchange.com/questions/63999",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/38062/"
] | There are many bread recipes that can be made up ahead and put into the refrigerator to rise slowly for several hours or overnight. Some standard recipes can be adapted to this method, but you may need to adjust ingredients to prevent over-proofing. You can find plenty of this thing by searching for "easy overnight bre... | If you are just wanting to throw together a loaf of bread in the morning without having to deal with the timing on rising, etc. try a beer bread ([example](http://www.food.com/recipe/beer-bread-73440)). I bake one that takes about 45 minutes, and experiment with different craft brews to alter the flavor. I made one the... |
63,999 | I'm afraid I know little about breadmaking.
Is there a bread where you could:
-- mix it and I guess knead it **in the evening** (say around 9pm),
-- **leaving it out** overnight (perhaps to rise (?) etc.?)
-- then about 8? hours later (**say around 7am?**) you could put it in an oven
-- and indeed then bake the lo... | 2015/12/01 | [
"https://cooking.stackexchange.com/questions/63999",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/38062/"
] | The main problem with your method is the fact that leaving bread out to rise at room temperature for 8+ hours almost always leads to overproofing.
Overproofing usually means the gluten formation has been stretched to its very limits and will usually result in the dough collapsing.
Most breads dough made the night be... | If you are just wanting to throw together a loaf of bread in the morning without having to deal with the timing on rising, etc. try a beer bread ([example](http://www.food.com/recipe/beer-bread-73440)). I bake one that takes about 45 minutes, and experiment with different craft brews to alter the flavor. I made one the... |
63,999 | I'm afraid I know little about breadmaking.
Is there a bread where you could:
-- mix it and I guess knead it **in the evening** (say around 9pm),
-- **leaving it out** overnight (perhaps to rise (?) etc.?)
-- then about 8? hours later (**say around 7am?**) you could put it in an oven
-- and indeed then bake the lo... | 2015/12/01 | [
"https://cooking.stackexchange.com/questions/63999",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/38062/"
] | It seems the main thing you're trying to do is avoid any work in the morning before bake. As suggested in comments, the easiest way to do that is to get a mechanical bread-maker. Since you say you're inexperienced in bread-making, you can dump everything in the night before, program it with a time, and voila -- fresh b... | Yes, this is the oldest way to make bread for the morning - you just need to use less yeast to avoid "over proving". My recipe below is for an enriched loaf but for a "traditional" more sourdough-tasting bread just leave out the sugar/oil. I make a batch of this every week so it's tried and tested. I use 3/4 wholemeal ... |
63,999 | I'm afraid I know little about breadmaking.
Is there a bread where you could:
-- mix it and I guess knead it **in the evening** (say around 9pm),
-- **leaving it out** overnight (perhaps to rise (?) etc.?)
-- then about 8? hours later (**say around 7am?**) you could put it in an oven
-- and indeed then bake the lo... | 2015/12/01 | [
"https://cooking.stackexchange.com/questions/63999",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/38062/"
] | It seems the main thing you're trying to do is avoid any work in the morning before bake. As suggested in comments, the easiest way to do that is to get a mechanical bread-maker. Since you say you're inexperienced in bread-making, you can dump everything in the night before, program it with a time, and voila -- fresh b... | If you are just wanting to throw together a loaf of bread in the morning without having to deal with the timing on rising, etc. try a beer bread ([example](http://www.food.com/recipe/beer-bread-73440)). I bake one that takes about 45 minutes, and experiment with different craft brews to alter the flavor. I made one the... |
16,982,580 | Recently i've been investigating possibilities for the creation of the HUD for a game. I found out that Riot Games, for League of Legends, apparently uses Adobe Air for their Heads up Display.
Firstly, how could i go about doing this? I own a copy of Flash professional, so it's more a matter of getting it out of flash... | 2013/06/07 | [
"https://Stackoverflow.com/questions/16982580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/840954/"
] | There is a general solution to nearly all "negative regex" matching questions: turn it into a positive matching problem using some logic.
This is usually easier than trying to construct a regex that matches "everything but this pattern".
In this case, that is quite simple:
```
select * from table
where column_na... | You can add a `FULLTEXT` index on that column and use [Boolean Full-Text Searches](http://dev.mysql.com/doc//refman/5.5/en/fulltext-boolean.html) |
16,982,580 | Recently i've been investigating possibilities for the creation of the HUD for a game. I found out that Riot Games, for League of Legends, apparently uses Adobe Air for their Heads up Display.
Firstly, how could i go about doing this? I own a copy of Flash professional, so it's more a matter of getting it out of flash... | 2013/06/07 | [
"https://Stackoverflow.com/questions/16982580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/840954/"
] | You can just use [`NOT REGEX`](http://dev.mysql.com/doc/refman/5.7/en/regexp.html#operator_not-regexp):
```
SELECT * FROM table
WHERE column_name NOT REGEX '^your[[:space:]]pattern here'
```
Stolen from [Erick Jimenez's comment](https://stackoverflow.com/questions/16982570/negate-regex-pattern-in-mysql#comment53826... | You can add a `FULLTEXT` index on that column and use [Boolean Full-Text Searches](http://dev.mysql.com/doc//refman/5.5/en/fulltext-boolean.html) |
16,982,580 | Recently i've been investigating possibilities for the creation of the HUD for a game. I found out that Riot Games, for League of Legends, apparently uses Adobe Air for their Heads up Display.
Firstly, how could i go about doing this? I own a copy of Flash professional, so it's more a matter of getting it out of flash... | 2013/06/07 | [
"https://Stackoverflow.com/questions/16982580",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/840954/"
] | There is a general solution to nearly all "negative regex" matching questions: turn it into a positive matching problem using some logic.
This is usually easier than trying to construct a regex that matches "everything but this pattern".
In this case, that is quite simple:
```
select * from table
where column_na... | You can just use [`NOT REGEX`](http://dev.mysql.com/doc/refman/5.7/en/regexp.html#operator_not-regexp):
```
SELECT * FROM table
WHERE column_name NOT REGEX '^your[[:space:]]pattern here'
```
Stolen from [Erick Jimenez's comment](https://stackoverflow.com/questions/16982570/negate-regex-pattern-in-mysql#comment53826... |
1,825 | I wonder whether it's worth tagging questions as [confirmed](https://skeptics.stackexchange.com/questions/tagged/confirmed "show questions tagged 'confirmed'") (the evidence supports the notable claim doubted), [rebutted](https://skeptics.stackexchange.com/questions/tagged/rebutted "show questions tagged 'rebutted'") (... | 2012/06/07 | [
"https://skeptics.meta.stackexchange.com/questions/1825",
"https://skeptics.meta.stackexchange.com",
"https://skeptics.meta.stackexchange.com/users/2916/"
] | Nah, we need **`[busted]`**.
Seriously though, while I potentially like the idea, I’m not sure it works because – even with things like “partially busted” etc. – it’s not nearly nuanced enough to capture reality, which is complex, and this is what Skeptics is all about.
Furthermore, that’s not really what tags are *f... | I think this may be creating a gateway to tag edit wars that would be better to just avoid, in addition to the other reasons meta tags are discouraged. |
1,825 | I wonder whether it's worth tagging questions as [confirmed](https://skeptics.stackexchange.com/questions/tagged/confirmed "show questions tagged 'confirmed'") (the evidence supports the notable claim doubted), [rebutted](https://skeptics.stackexchange.com/questions/tagged/rebutted "show questions tagged 'rebutted'") (... | 2012/06/07 | [
"https://skeptics.meta.stackexchange.com/questions/1825",
"https://skeptics.meta.stackexchange.com",
"https://skeptics.meta.stackexchange.com/users/2916/"
] | Nah, we need **`[busted]`**.
Seriously though, while I potentially like the idea, I’m not sure it works because – even with things like “partially busted” etc. – it’s not nearly nuanced enough to capture reality, which is complex, and this is what Skeptics is all about.
Furthermore, that’s not really what tags are *f... | No.
This would be a [meta tag](http://blog.stackoverflow.com/2010/08/the-death-of-meta-tags/) and the consensus around StackExchange is they are generally a bad thing.
A few more reasons why this is a bad idea:
* There are sometimes too many caveats that need to be explained to say if the
question is confirmed or ... |
1,825 | I wonder whether it's worth tagging questions as [confirmed](https://skeptics.stackexchange.com/questions/tagged/confirmed "show questions tagged 'confirmed'") (the evidence supports the notable claim doubted), [rebutted](https://skeptics.stackexchange.com/questions/tagged/rebutted "show questions tagged 'rebutted'") (... | 2012/06/07 | [
"https://skeptics.meta.stackexchange.com/questions/1825",
"https://skeptics.meta.stackexchange.com",
"https://skeptics.meta.stackexchange.com/users/2916/"
] | Nah, we need **`[busted]`**.
Seriously though, while I potentially like the idea, I’m not sure it works because – even with things like “partially busted” etc. – it’s not nearly nuanced enough to capture reality, which is complex, and this is what Skeptics is all about.
Furthermore, that’s not really what tags are *f... | I think tags belong to the question alone. The tags suggested here would be changing depending on answers, which I do not think is desirable. Who would be responsible to keep tags in sync with answers? While unlikely, it might even happen the accepted answer says No and the most voted answer says Yes, or that the most ... |
3,928,235 | I use Visual C++ (7.1 and 8.0) on huge C++ project. The solution contains thousands of files. Visual Assist helps in jumping to function and class definitions. The problem is that it sometimes becomes too slow. I just can't edit a single letter without delay.
Is there some alternative to this environment? I mean somet... | 2010/10/13 | [
"https://Stackoverflow.com/questions/3928235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194635/"
] | It seems there is no alternative to MS Visual studio. I've added separate HDD for source files and it works much better. | Currently i left Visual studio because c++ support just sucks (still using Visual studio 2013 but only for C# projects)
i use NetBeans right now, and really enjoy the refactoring part.
The visual C++ compiler support can be added using a free plugin ([VCC4N - Visual C++ Compiler For NetBeans](http://plugins.netbeans.o... |
22,040,623 | I have this currently working:
```
sub first_sub
{
my @my_array;
## The second sub will return my_array filled out!
second_sub (\@my_array);
## Array ok ... filled out!
}
```
But what about if I want/need to pass the array from second\_sub to another subroutine? For example:
```
sub first_sub
{
... | 2014/02/26 | [
"https://Stackoverflow.com/questions/22040623",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1306011/"
] | You make a mistake by calling the subroutine
```
second_sub (my_array); # By the way, use miss there the $ or @`
```
You overgive it by reference, not by value. When there is a missing $.
If you want to overgive it by value then use:
```
second_sub (@{$my_array});
```
When you need the reference, treat it like a... | Use:
```
sub first_sub {
my @my_array;
## The second sub will return my_array filled out!
second_sub (\@my_array);
## ...
}
sub second_sub {
my $my_array = shift;
## The second sub will return my_array filled out!
foreach my $newvar (@$my_array) {
push (@new_array, $newvar);
... |
22,040,623 | I have this currently working:
```
sub first_sub
{
my @my_array;
## The second sub will return my_array filled out!
second_sub (\@my_array);
## Array ok ... filled out!
}
```
But what about if I want/need to pass the array from second\_sub to another subroutine? For example:
```
sub first_sub
{
... | 2014/02/26 | [
"https://Stackoverflow.com/questions/22040623",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1306011/"
] | Once you have an *array reference* in a scalar variable you can pass it between subroutines as you wish.
Your example code is badly broken, but I assume you mean something like this
```
first_sub();
sub first_sub {
my @my_array;
## second_sub will fill out @my_array
second_sub (\@my_array); ## passed by re... | You make a mistake by calling the subroutine
```
second_sub (my_array); # By the way, use miss there the $ or @`
```
You overgive it by reference, not by value. When there is a missing $.
If you want to overgive it by value then use:
```
second_sub (@{$my_array});
```
When you need the reference, treat it like a... |
22,040,623 | I have this currently working:
```
sub first_sub
{
my @my_array;
## The second sub will return my_array filled out!
second_sub (\@my_array);
## Array ok ... filled out!
}
```
But what about if I want/need to pass the array from second\_sub to another subroutine? For example:
```
sub first_sub
{
... | 2014/02/26 | [
"https://Stackoverflow.com/questions/22040623",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1306011/"
] | Once you have an *array reference* in a scalar variable you can pass it between subroutines as you wish.
Your example code is badly broken, but I assume you mean something like this
```
first_sub();
sub first_sub {
my @my_array;
## second_sub will fill out @my_array
second_sub (\@my_array); ## passed by re... | Use:
```
sub first_sub {
my @my_array;
## The second sub will return my_array filled out!
second_sub (\@my_array);
## ...
}
sub second_sub {
my $my_array = shift;
## The second sub will return my_array filled out!
foreach my $newvar (@$my_array) {
push (@new_array, $newvar);
... |
12,766,917 | i have 20 picturebox in a C# form and rename this controls to p1,p2,p3
now i should show/hide this controls in same time.
now i need a idea for change this controls perperty faster than it same array.
advance me for this | 2012/10/07 | [
"https://Stackoverflow.com/questions/12766917",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1706829/"
] | The first matches one `[a-zA-Z]` followed by zero or more `[a-zA-Z]`.
The second matches zero or more `[a-zA-Z]`.
---
The first can also be written as `[a-zA-Z]+`. | The regex `[a-zA-Z][a-zA-Z]*` means that you are mandating that there should be one alpabetic character **optionally** followed by **any** number of alphabets. On the other hand, `[a-zA-Z]*` means that the alphabet mandate is entirely off.
For example, your first regex matches the strings `azxxx`, `abccdef` but fails... |
40,395,246 | I am adding layers to a layergroup "drawnitems" using the leaflet [draw library](https://github.com/Leaflet/Leaflet.draw)
```
drawnItems.addLayer(L.polygon(polygon));
```
I need to find the leaflet ID of the layer created using the above code immediately upon it's creation. This happens in a loop. I am adding multip... | 2016/11/03 | [
"https://Stackoverflow.com/questions/40395246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4841821/"
] | Okey to simply get the ID of the latest layer added you can do the following:
```
for(layer of polyLayers) {
drawnItems.addLayer(layer);
var leafletId = layer._leaflet_id
};
```
But I think for your approach that would not be the best solution, because leaflet ID are not stable. It would b... | I solved this. I created a "hashmap" between the database id and the leaflet shapes id (leaflet\_id) while loading shapes on the map. Then in the "draw:edited" I found the database id of the object edited by the user with the help of the "key" = leaflet\_id. Thus, I was able to save changes made by the user in the same... |
40,395,246 | I am adding layers to a layergroup "drawnitems" using the leaflet [draw library](https://github.com/Leaflet/Leaflet.draw)
```
drawnItems.addLayer(L.polygon(polygon));
```
I need to find the leaflet ID of the layer created using the above code immediately upon it's creation. This happens in a loop. I am adding multip... | 2016/11/03 | [
"https://Stackoverflow.com/questions/40395246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4841821/"
] | Okey to simply get the ID of the latest layer added you can do the following:
```
for(layer of polyLayers) {
drawnItems.addLayer(layer);
var leafletId = layer._leaflet_id
};
```
But I think for your approach that would not be the best solution, because leaflet ID are not stable. It would b... | ```
var polygon = new L.Polygon([
[51.51, -0.1],
[51.5, -0.06],
[51.52, -0.03]
]);
polygon.options.id = 1;
drawnItems.addLayer(polygon);
``` |
40,395,246 | I am adding layers to a layergroup "drawnitems" using the leaflet [draw library](https://github.com/Leaflet/Leaflet.draw)
```
drawnItems.addLayer(L.polygon(polygon));
```
I need to find the leaflet ID of the layer created using the above code immediately upon it's creation. This happens in a loop. I am adding multip... | 2016/11/03 | [
"https://Stackoverflow.com/questions/40395246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4841821/"
] | Okey to simply get the ID of the latest layer added you can do the following:
```
for(layer of polyLayers) {
drawnItems.addLayer(layer);
var leafletId = layer._leaflet_id
};
```
But I think for your approach that would not be the best solution, because leaflet ID are not stable. It would b... | As simple as get `_leaflet_id` of your latest layer created, for example as you if I am drawing polygons, for example:
```
let polygon = L.polygon([<my coords>], {color: 'red'});
// Added this way
let layer = polygon.addTo(this.drawElementsLayer);
// or this way (is the same)
this.drawElementsLayer.addLayer(polygon);... |
40,395,246 | I am adding layers to a layergroup "drawnitems" using the leaflet [draw library](https://github.com/Leaflet/Leaflet.draw)
```
drawnItems.addLayer(L.polygon(polygon));
```
I need to find the leaflet ID of the layer created using the above code immediately upon it's creation. This happens in a loop. I am adding multip... | 2016/11/03 | [
"https://Stackoverflow.com/questions/40395246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4841821/"
] | I solved this. I created a "hashmap" between the database id and the leaflet shapes id (leaflet\_id) while loading shapes on the map. Then in the "draw:edited" I found the database id of the object edited by the user with the help of the "key" = leaflet\_id. Thus, I was able to save changes made by the user in the same... | ```
var polygon = new L.Polygon([
[51.51, -0.1],
[51.5, -0.06],
[51.52, -0.03]
]);
polygon.options.id = 1;
drawnItems.addLayer(polygon);
``` |
40,395,246 | I am adding layers to a layergroup "drawnitems" using the leaflet [draw library](https://github.com/Leaflet/Leaflet.draw)
```
drawnItems.addLayer(L.polygon(polygon));
```
I need to find the leaflet ID of the layer created using the above code immediately upon it's creation. This happens in a loop. I am adding multip... | 2016/11/03 | [
"https://Stackoverflow.com/questions/40395246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4841821/"
] | I solved this. I created a "hashmap" between the database id and the leaflet shapes id (leaflet\_id) while loading shapes on the map. Then in the "draw:edited" I found the database id of the object edited by the user with the help of the "key" = leaflet\_id. Thus, I was able to save changes made by the user in the same... | As simple as get `_leaflet_id` of your latest layer created, for example as you if I am drawing polygons, for example:
```
let polygon = L.polygon([<my coords>], {color: 'red'});
// Added this way
let layer = polygon.addTo(this.drawElementsLayer);
// or this way (is the same)
this.drawElementsLayer.addLayer(polygon);... |
9,456,376 | I want to create a dropdown list in Yii framework and I have the problem generating it automatically
so there is what I have now:
```
function getYear($value1 = 1900, $value2 = 2008)
{
$data = array();
for ($i=value1; $i++; $i<=value2){
array_push($data,(string)$i);
}
return data();
}
<?php... | 2012/02/26 | [
"https://Stackoverflow.com/questions/9456376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/939421/"
] | You really don't need a separate function - just use the PHP range() function as Joe showed.
```
<?php echo $form->dropDownList($model, 'field_name', range(1900,2008);?>
```
As ThiefMaster said - best not to hardcode these values, so perhaps:
```
<?php
$thisyear = date("Y");
echo $form->dropDownList($model, 'field... | I'm not familiar with the YII framework but it looks like your function has some major syntactical issues. First, the parameters in your `for()` loop are in the wrong order. Additionally, you are missing `$` in front of the `$value1` and `$value2` variables so they are being interpreted as empty constants.
If you want... |
9,456,376 | I want to create a dropdown list in Yii framework and I have the problem generating it automatically
so there is what I have now:
```
function getYear($value1 = 1900, $value2 = 2008)
{
$data = array();
for ($i=value1; $i++; $i<=value2){
array_push($data,(string)$i);
}
return data();
}
<?php... | 2012/02/26 | [
"https://Stackoverflow.com/questions/9456376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/939421/"
] | I'm not familiar with the YII framework but it looks like your function has some major syntactical issues. First, the parameters in your `for()` loop are in the wrong order. Additionally, you are missing `$` in front of the `$value1` and `$value2` variables so they are being interpreted as empty constants.
If you want... | Put your function in a class and define it a static function so that you can use it in other places also. And then call the function statically.
```
class example{
public static function getYear($value1 = 1900, $value2 = 2008)
{
$data = array();
for ($i=value1; $i++; $i<=value2){
array_push($da... |
9,456,376 | I want to create a dropdown list in Yii framework and I have the problem generating it automatically
so there is what I have now:
```
function getYear($value1 = 1900, $value2 = 2008)
{
$data = array();
for ($i=value1; $i++; $i<=value2){
array_push($data,(string)$i);
}
return data();
}
<?php... | 2012/02/26 | [
"https://Stackoverflow.com/questions/9456376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/939421/"
] | You really don't need a separate function - just use the PHP range() function as Joe showed.
```
<?php echo $form->dropDownList($model, 'field_name', range(1900,2008);?>
```
As ThiefMaster said - best not to hardcode these values, so perhaps:
```
<?php
$thisyear = date("Y");
echo $form->dropDownList($model, 'field... | Put your function in a class and define it a static function so that you can use it in other places also. And then call the function statically.
```
class example{
public static function getYear($value1 = 1900, $value2 = 2008)
{
$data = array();
for ($i=value1; $i++; $i<=value2){
array_push($da... |
38,914 | Attached below is some code I wrote to solve a basic problem: finding the node displacements of a cube with two vertices constrained (vertices 6 and 7 with coordinates `[1,1,1], [1,-1,1]`), and the rest of the vertices loaded with point loads in the `y` direction. What I expect is for the displacement at vertex 0, with... | 2021/08/16 | [
"https://scicomp.stackexchange.com/questions/38914",
"https://scicomp.stackexchange.com",
"https://scicomp.stackexchange.com/users/32988/"
] | Your intuition is right, the stiffness matrix should be singular. Actually, as pointed by @BillGreene, it has an eigenvalue that is zero.
Ordering the nodes as follows (-1, -1, -1,), (1, -1, -1), (1, 1, 1), (-1, 1, -1), (-1, -1, 1,), (1, -1, 1), (1, 1, 1), (-1, 1, 1) and constraining the nodes 0 and 1, we get the foll... | Each node has only 3 degrees of freedom: UX, UY and UZ. As you constrained nodes 6 and 7 in all three directions, there is no rigid body motion. Your problem is well-posed. This is why the stiffness matrix should not be singular. In other words, its determinant should be non-zero.
Since there are no rotational DOFs, y... |
1,528,858 | Attempt: since the center of any abelian group is the group itself we need to show by contrapositive that if the sequence $Z(G)\subset H\leq G $ (where $Z(G)\neq H\neq G$) fails to hold then $G$ must be abelian. Though I'm not sure how to express the the hypothesis "such $H$ doesn't exist" algebraically. | 2015/11/14 | [
"https://math.stackexchange.com/questions/1528858",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/212937/"
] | This is kind of lazy, but you could prove it directly if you know that the centralizer of a group element is always a subgroup. Since $G$ is non-abelian, it has some element $g$ such that $g$ does not commute with some other element, say $h$. Then $C(g)$, the centralizer of $g$, meaning the group of elements that commu... | In a nonabelian group $G$, we know that $G/Z(G)$ is not cyclic. In particular, $G/Z(G)$ has a proper nontrivial cyclic subgroup: just take any element different from the identity. Such a subgroup can be seen as $H/Z(G)$ for a unique subgroup $H$ of $G$ containing $Z(G)$. |
45,208,869 | sorry for question, I cant figure it out.
If:
```
<body onclick="myFunction(event)">
<p>Paragraph</p>
<h1>This is a heading</h1>
<button>This is a button</button>
<p id="demo"></p>
<script>
function myFunction(event) {
var x = event.target;
document.getElementById("demo").innerHTML = x.tagName;
}
</script>
... | 2017/07/20 | [
"https://Stackoverflow.com/questions/45208869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7719929/"
] | Hope you have done with `event.target.nodeName`
```
<body onclick="myFunction(event)">
<p>Paragraph</p>
<h1>This is a heading</h1>
<button>This is a button</button>
<p id="demo"></p>
<script>
function myFunction(event) {
var x = event.target;
x.innerHTML = x.nodeName;
}
</script>
</body>
``` | The function doesn't have a result in the sense that it doesn't return anything. But in general, if you are trying to set the innerHTML of the object that you just clicked to 'something' you should be able to do
```
event.target.innerHTML = 'something'
``` |
45,208,869 | sorry for question, I cant figure it out.
If:
```
<body onclick="myFunction(event)">
<p>Paragraph</p>
<h1>This is a heading</h1>
<button>This is a button</button>
<p id="demo"></p>
<script>
function myFunction(event) {
var x = event.target;
document.getElementById("demo").innerHTML = x.tagName;
}
</script>
... | 2017/07/20 | [
"https://Stackoverflow.com/questions/45208869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7719929/"
] | You have to change your HTML Code To be :
```
onclick="myFunction(this);"
```
In Your Case it will be :
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<t... | The function doesn't have a result in the sense that it doesn't return anything. But in general, if you are trying to set the innerHTML of the object that you just clicked to 'something' you should be able to do
```
event.target.innerHTML = 'something'
``` |
45,208,869 | sorry for question, I cant figure it out.
If:
```
<body onclick="myFunction(event)">
<p>Paragraph</p>
<h1>This is a heading</h1>
<button>This is a button</button>
<p id="demo"></p>
<script>
function myFunction(event) {
var x = event.target;
document.getElementById("demo").innerHTML = x.tagName;
}
</script>
... | 2017/07/20 | [
"https://Stackoverflow.com/questions/45208869",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7719929/"
] | You have to change your HTML Code To be :
```
onclick="myFunction(this);"
```
In Your Case it will be :
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<t... | Hope you have done with `event.target.nodeName`
```
<body onclick="myFunction(event)">
<p>Paragraph</p>
<h1>This is a heading</h1>
<button>This is a button</button>
<p id="demo"></p>
<script>
function myFunction(event) {
var x = event.target;
x.innerHTML = x.nodeName;
}
</script>
</body>
``` |
155,447 | I'm in the sciences in the USA, and a very relevant to my field, well respected journal just advertised. I have been encouraged to apply. The workload is advertised as not egregious. I already sit on several editorial boards.
I worry that this kind of service may be better left for post tenure. My personal advisors ar... | 2020/09/17 | [
"https://academia.stackexchange.com/questions/155447",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/9181/"
] | Being an editor-in-chief is a rewarding position that most departments value on someone's CV.
So much for that. But I cannot stress enough how bad an idea it would be to take on such a role while being an assistant professor without tenure. As the EiC, your workload consists of 50% assigning papers to associate editor... | This depends on what your institution values in its faculty. It also depends on what you would need to give up that might be more important to obtaining tenure. If it comes at the expense of "a few" papers at a place, such as an R1, that highly values papers, the risky. If it comes at the expense of grant proposals at ... |
47,818,687 | I want to send a POST request with JQuery to a Spring Controller but i keep getting this error from jquery
```
Could not read document: Unrecognized token 'contactForm': was expecting ('true', 'false' or 'null')
at [Source: java.io.PushbackInputStream@38220bcd; line: 1, column: 13]; nested exception is com.fasterxml.... | 2017/12/14 | [
"https://Stackoverflow.com/questions/47818687",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5550833/"
] | In your jQuery ajax call adjust your data value:
```
$.ajax({
type: 'POST',
url: '/checkContact.json',
contentType : 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify(contactForm),
success: function(response){
console.log(response)... | If you're manually set the ObjectMapper class in the controller as below.
```
ObjectMapper obj = new ObjectMapper();
obj.setSerializationInclusion(JsonInclude.Include.NON_NULL);
obj.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
```
Or
1. Add a dependency to **javax.validation:validation-api*... |
14,165 | I have heard that the Prodigal Son was not truly repentant because in [Luke 15:17-19](https://www.biblegateway.com/passage/?search=Luke+15%3A17-19&version=NIVUK) he was still making demands of his father such as *"make me like one of your hired servants"*:
>
> ‘When he came to his senses, he said, “How many of my fat... | 2014/12/18 | [
"https://hermeneutics.stackexchange.com/questions/14165",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/150/"
] | **Short Answer:** The prodigal son appears to have been repentant.
---
A Disrespectful Demand?
-----------------------
I don't think the explanation you heard holds water, for two reasons. First, the imperative mood has a "grammatical range" (similar to how vocabulary words have a semantic range); it ***can*** be us... | The point of this story is the contrast between the joyless elder son and the joyful father. It was spoken in response to the way the Pharisees and scribes begrudged the welcome that Jesus gave to sinners who out of destitution resorted to Jesus:
>
> Luk 15:1 And all the tax-gatherers and the sinners were coming near... |
14,165 | I have heard that the Prodigal Son was not truly repentant because in [Luke 15:17-19](https://www.biblegateway.com/passage/?search=Luke+15%3A17-19&version=NIVUK) he was still making demands of his father such as *"make me like one of your hired servants"*:
>
> ‘When he came to his senses, he said, “How many of my fat... | 2014/12/18 | [
"https://hermeneutics.stackexchange.com/questions/14165",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/150/"
] | **Short Answer:** The prodigal son appears to have been repentant.
---
A Disrespectful Demand?
-----------------------
I don't think the explanation you heard holds water, for two reasons. First, the imperative mood has a "grammatical range" (similar to how vocabulary words have a semantic range); it ***can*** be us... | I've always believed this parable should have been titled the "Gracious Father" and not the "Prodigal Son." Why? Well, let Scripture interpret Scripture. Luke 15:17 NIV states: “When he came to his senses, he said, ‘How many of my father’s hired servants ***have food to spare***, and here I am starving to death!"
Can... |
14,165 | I have heard that the Prodigal Son was not truly repentant because in [Luke 15:17-19](https://www.biblegateway.com/passage/?search=Luke+15%3A17-19&version=NIVUK) he was still making demands of his father such as *"make me like one of your hired servants"*:
>
> ‘When he came to his senses, he said, “How many of my fat... | 2014/12/18 | [
"https://hermeneutics.stackexchange.com/questions/14165",
"https://hermeneutics.stackexchange.com",
"https://hermeneutics.stackexchange.com/users/150/"
] | I've always believed this parable should have been titled the "Gracious Father" and not the "Prodigal Son." Why? Well, let Scripture interpret Scripture. Luke 15:17 NIV states: “When he came to his senses, he said, ‘How many of my father’s hired servants ***have food to spare***, and here I am starving to death!"
Can... | The point of this story is the contrast between the joyless elder son and the joyful father. It was spoken in response to the way the Pharisees and scribes begrudged the welcome that Jesus gave to sinners who out of destitution resorted to Jesus:
>
> Luk 15:1 And all the tax-gatherers and the sinners were coming near... |
12,897,220 | I think this will have a simple answer, but I can't work it out! Here is an example using the `iris` dataset:
```
a <- table(iris[,2])
b <- table(iris[,3])
```
How do I add these two tables together? For example, the variable 3 would have a value of 27 (26+1) and variable 3.3 a value of 8 (6+2) in the new output ta... | 2012/10/15 | [
"https://Stackoverflow.com/questions/12897220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1303502/"
] | This will work if you want to use the variables which are present in both `a` and `b`:
```
n <- intersect(names(a), names(b))
a[n] + b[n]
# 3 3.3 3.5 3.6 3.7 3.8 3.9 4 4.1 4.2 4.4
# 27 8 8 5 4 7 5 6 4 5 5
```
---
If you want to use all variables:
```
n <- intersect(names(a), names(b))
re... | ```
temp<-merge(a,b,by='Var1')
temp$sum<-temp$Freq.x + temp$Freq.y
Var1 Freq.x Freq.y sum
1 3 26 1 27
2 3.3 6 2 8
3 3.5 6 2 8
4 3.6 4 1 5
5 3.7 3 1 4
6 3.8 6 1 7
7 3.9 2 3 5
8 4 1 5 6
9 4.1 1 ... |
12,897,220 | I think this will have a simple answer, but I can't work it out! Here is an example using the `iris` dataset:
```
a <- table(iris[,2])
b <- table(iris[,3])
```
How do I add these two tables together? For example, the variable 3 would have a value of 27 (26+1) and variable 3.3 a value of 8 (6+2) in the new output ta... | 2012/10/15 | [
"https://Stackoverflow.com/questions/12897220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1303502/"
] | This will work if you want to use the variables which are present in both `a` and `b`:
```
n <- intersect(names(a), names(b))
a[n] + b[n]
# 3 3.3 3.5 3.6 3.7 3.8 3.9 4 4.1 4.2 4.4
# 27 8 8 5 4 7 5 6 4 5 5
```
---
If you want to use all variables:
```
n <- intersect(names(a), names(b))
re... | Here is another one:
```
transform(merge(a,b, by="Var1"), sum=Freq.x + Freq.y)
Var1 Freq.x Freq.y sum
1 3 26 1 27
2 3.3 6 2 8
3 3.5 6 2 8
4 3.6 4 1 5
5 3.7 3 1 4
6 3.8 6 1 7
7 3.9 2 3 5
8 4 1 5 6
9 4.... |
12,897,220 | I think this will have a simple answer, but I can't work it out! Here is an example using the `iris` dataset:
```
a <- table(iris[,2])
b <- table(iris[,3])
```
How do I add these two tables together? For example, the variable 3 would have a value of 27 (26+1) and variable 3.3 a value of 8 (6+2) in the new output ta... | 2012/10/15 | [
"https://Stackoverflow.com/questions/12897220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1303502/"
] | This will work if you want to use the variables which are present in both `a` and `b`:
```
n <- intersect(names(a), names(b))
a[n] + b[n]
# 3 3.3 3.5 3.6 3.7 3.8 3.9 4 4.1 4.2 4.4
# 27 8 8 5 4 7 5 6 4 5 5
```
---
If you want to use all variables:
```
n <- intersect(names(a), names(b))
re... | Here's a slightly tortured one-liner version of the `merge()` solution:
```
do.call(function(Var1, Freq.x, Freq.y) data.frame(Var1=Var1, Freq=rowSums(cbind(Freq.x, Freq.y))), merge(a, b, by="Var1"))
```
Here's the one if you want to use all variables:
```
do.call(function(Var1, Freq.x, Freq.y) data.frame(Var1=Var1,... |
12,897,220 | I think this will have a simple answer, but I can't work it out! Here is an example using the `iris` dataset:
```
a <- table(iris[,2])
b <- table(iris[,3])
```
How do I add these two tables together? For example, the variable 3 would have a value of 27 (26+1) and variable 3.3 a value of 8 (6+2) in the new output ta... | 2012/10/15 | [
"https://Stackoverflow.com/questions/12897220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1303502/"
] | This will work if you want to use the variables which are present in both `a` and `b`:
```
n <- intersect(names(a), names(b))
a[n] + b[n]
# 3 3.3 3.5 3.6 3.7 3.8 3.9 4 4.1 4.2 4.4
# 27 8 8 5 4 7 5 6 4 5 5
```
---
If you want to use all variables:
```
n <- intersect(names(a), names(b))
re... | The merge function of the data.table package may be what you want: <https://rpubs.com/ronasta/join_data_tables> |
12,897,220 | I think this will have a simple answer, but I can't work it out! Here is an example using the `iris` dataset:
```
a <- table(iris[,2])
b <- table(iris[,3])
```
How do I add these two tables together? For example, the variable 3 would have a value of 27 (26+1) and variable 3.3 a value of 8 (6+2) in the new output ta... | 2012/10/15 | [
"https://Stackoverflow.com/questions/12897220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1303502/"
] | ```
temp<-merge(a,b,by='Var1')
temp$sum<-temp$Freq.x + temp$Freq.y
Var1 Freq.x Freq.y sum
1 3 26 1 27
2 3.3 6 2 8
3 3.5 6 2 8
4 3.6 4 1 5
5 3.7 3 1 4
6 3.8 6 1 7
7 3.9 2 3 5
8 4 1 5 6
9 4.1 1 ... | The merge function of the data.table package may be what you want: <https://rpubs.com/ronasta/join_data_tables> |
12,897,220 | I think this will have a simple answer, but I can't work it out! Here is an example using the `iris` dataset:
```
a <- table(iris[,2])
b <- table(iris[,3])
```
How do I add these two tables together? For example, the variable 3 would have a value of 27 (26+1) and variable 3.3 a value of 8 (6+2) in the new output ta... | 2012/10/15 | [
"https://Stackoverflow.com/questions/12897220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1303502/"
] | Here is another one:
```
transform(merge(a,b, by="Var1"), sum=Freq.x + Freq.y)
Var1 Freq.x Freq.y sum
1 3 26 1 27
2 3.3 6 2 8
3 3.5 6 2 8
4 3.6 4 1 5
5 3.7 3 1 4
6 3.8 6 1 7
7 3.9 2 3 5
8 4 1 5 6
9 4.... | The merge function of the data.table package may be what you want: <https://rpubs.com/ronasta/join_data_tables> |
12,897,220 | I think this will have a simple answer, but I can't work it out! Here is an example using the `iris` dataset:
```
a <- table(iris[,2])
b <- table(iris[,3])
```
How do I add these two tables together? For example, the variable 3 would have a value of 27 (26+1) and variable 3.3 a value of 8 (6+2) in the new output ta... | 2012/10/15 | [
"https://Stackoverflow.com/questions/12897220",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1303502/"
] | Here's a slightly tortured one-liner version of the `merge()` solution:
```
do.call(function(Var1, Freq.x, Freq.y) data.frame(Var1=Var1, Freq=rowSums(cbind(Freq.x, Freq.y))), merge(a, b, by="Var1"))
```
Here's the one if you want to use all variables:
```
do.call(function(Var1, Freq.x, Freq.y) data.frame(Var1=Var1,... | The merge function of the data.table package may be what you want: <https://rpubs.com/ronasta/join_data_tables> |
31,956,594 | I have gone through the similar question in stackoverflow but couldn't find the answer close to my problem. In the code below the 3 line before the last line is giving Error -
>
> `NameError: name '_name_' is not defined`
>
>
>
I have copied the below code from the University Lab guide instruction. Not really sur... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31956594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/837642/"
] | The issue is in line -
```
if _name_==’_main_’:
```
My guess is you have that line so that the code only runs when run as a script, and not when importing, if so, you need double underscore on both sides of `name` as well as `main`. And looks like the quotes are wrong, you need to use `'` . Example -
```
if __name_... | In the
```
if _name_==’_main_’:
```
you haven't written the code by using double underscore, it should be like following
```
if __name__==’__main__’:
```
thank you for above answer, they pointed the error for me yet it was not clear. I have make it clear by answering my own question. |
31,956,594 | I have gone through the similar question in stackoverflow but couldn't find the answer close to my problem. In the code below the 3 line before the last line is giving Error -
>
> `NameError: name '_name_' is not defined`
>
>
>
I have copied the below code from the University Lab guide instruction. Not really sur... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31956594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/837642/"
] | The issue is in line -
```
if _name_==’_main_’:
```
My guess is you have that line so that the code only runs when run as a script, and not when importing, if so, you need double underscore on both sides of `name` as well as `main`. And looks like the quotes are wrong, you need to use `'` . Example -
```
if __name_... | You need two underscores instead of one:
`if __name__ == "__main__"`
Python executes that directly. If its left out it will execute all the code from the 0th level of indention. |
31,956,594 | I have gone through the similar question in stackoverflow but couldn't find the answer close to my problem. In the code below the 3 line before the last line is giving Error -
>
> `NameError: name '_name_' is not defined`
>
>
>
I have copied the below code from the University Lab guide instruction. Not really sur... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31956594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/837642/"
] | You need two underscores instead of one:
`if __name__ == "__main__"`
Python executes that directly. If its left out it will execute all the code from the 0th level of indention. | In the
```
if _name_==’_main_’:
```
you haven't written the code by using double underscore, it should be like following
```
if __name__==’__main__’:
```
thank you for above answer, they pointed the error for me yet it was not clear. I have make it clear by answering my own question. |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | I had the same problem. It was because my JSON response contains some special characters and the server file was not encoded with UTF-8, so the Ajax call considered that this was not a valid JSON response. | Your script demands a return in JSON data type.
Try this:
```
private string test() {
JavaScriptSerializer js = new JavaScriptSerializer();
return js.Serialize("hello world");
}
``` |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | [`jQuery.ajax`](http://api.jquery.com/jQuery.ajax/) attempts to convert the response body depending on the specified `dataType` parameter or the `Content-Type` header sent by the server. If the conversion fails (e.g. if the JSON/XML is invalid), the error callback is fired.
---
Your AJAX code contains:
```
dataType:... | This is just for the record since I bumped into this post when looking for a solution to my problem which was similar to the OP's.
In my case my jQuery Ajax request was prevented from succeeding due to [same-origin policy](https://en.wikipedia.org/wiki/Same-origin_policy) in Chrome. All was resolved when I modified my... |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | You simply have to remove the **dataType: "json"** in your AJAX call
```
$.ajax({
type: 'POST',
url: 'Jqueryoperation.aspx?Operation=DeleteRow',
contentType: 'application/json; charset=utf-8',
data: json,
dataType: 'json', //**** REMOVE THIS LINE ****//
cache: false,
success: AjaxSucceeded,... | I had the same issue. My problem was my controller was returning a status code instead of JSON. Make sure that your controller returns something like:
```
public JsonResult ActionName(){
// Your code
return Json(new { });
}
``` |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | I reckon your aspx page doesn't return a JSON object.
Your page should do something like this (page\_load)
```
var jSon = new JavaScriptSerializer();
var OutPut = jSon.Serialize(<your object>);
Response.Write(OutPut);
```
Also, try to change your AjaxFailed:
```
function AjaxFailed (XMLHttpRequest, textStatus) {
... | Another thing that messed things up for me was using `localhost` instead of 127.0.0.1 or vice versa. Apparently, JavaScript can't handle requests from one to the other. |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | I've had some good luck with using multiple, space-separated `dataType`s ([jQuery 1.5+](http://api.jquery.com/jQuery.ajax/)). As in:
```
$.ajax({
type: 'POST',
url: 'Jqueryoperation.aspx?Operation=DeleteRow',
contentType: 'application/json; charset=utf-8',
data: json,
dataType: 'text json',
cac... | Your script demands a return in JSON data type.
Try this:
```
private string test() {
JavaScriptSerializer js = new JavaScriptSerializer();
return js.Serialize("hello world");
}
``` |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | [`jQuery.ajax`](http://api.jquery.com/jQuery.ajax/) attempts to convert the response body depending on the specified `dataType` parameter or the `Content-Type` header sent by the server. If the conversion fails (e.g. if the JSON/XML is invalid), the error callback is fired.
---
Your AJAX code contains:
```
dataType:... | Your script demands a return in JSON data type.
Try this:
```
private string test() {
JavaScriptSerializer js = new JavaScriptSerializer();
return js.Serialize("hello world");
}
``` |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | [See this](https://stackoverflow.com/a/9985307/6936747). It's also a similar problem. Working I tried.
Dont remove `dataType: 'JSON',`
**Note: Your response data should be in json format** | Another thing that messed things up for me was using `localhost` instead of 127.0.0.1 or vice versa. Apparently, JavaScript can't handle requests from one to the other. |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | You simply have to remove the **dataType: "json"** in your AJAX call
```
$.ajax({
type: 'POST',
url: 'Jqueryoperation.aspx?Operation=DeleteRow',
contentType: 'application/json; charset=utf-8',
data: json,
dataType: 'json', //**** REMOVE THIS LINE ****//
cache: false,
success: AjaxSucceeded,... | You just have to remove `dataType: 'json'` from your header if your implemented Web service method is void.
In this case, the Ajax call don't expect to have a JSON return datatype. |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | I reckon your aspx page doesn't return a JSON object.
Your page should do something like this (page\_load)
```
var jSon = new JavaScriptSerializer();
var OutPut = jSon.Serialize(<your object>);
Response.Write(OutPut);
```
Also, try to change your AjaxFailed:
```
function AjaxFailed (XMLHttpRequest, textStatus) {
... | If you always return JSON from the server (no empty responses), `dataType: 'json'` should work and `contentType` is not needed. However make sure the JSON output...
* is valid ([JSONLint](https://jsonlint.com/))
* **is serialized** ([JSONMinify](https://www.cleancss.com/json-minify/))
jQuery AJAX will throw a 'parsee... |
6,186,770 | I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns **200 OK**, but **jQuery** executes the error event.
I tried a lot of things, but I could not figure out the problem. I am adding my code below:
### jQuery Code
```
var row = "1";
var json = "{'Twitter... | 2011/05/31 | [
"https://Stackoverflow.com/questions/6186770",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/165107/"
] | I have faced this issue with an updated jQuery library. If the service method is not returning anything it means that the return type is `void`.
Then in your Ajax call please mention `dataType='text'`.
It will resolve the problem. | [See this](https://stackoverflow.com/a/9985307/6936747). It's also a similar problem. Working I tried.
Dont remove `dataType: 'JSON',`
**Note: Your response data should be in json format** |
14,685,231 | ```
new Something({
events:{
load: (function loopsiloop(){
console.log(this); // firstime this will be Something, but next call what its
setTimeout(function(){
console.log(this);
$.ajax({
url: 'foo.htm',
conte... | 2013/02/04 | [
"https://Stackoverflow.com/questions/14685231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1225190/"
] | Your recursive call can be written like this:
```
complete: function() {
loopsiloop.call(this);
}
```
to ensure that the context is correctly set the second time around.
It could also be written like this, but it's not recommended as it'll call `.bind` over and over on each pass:
```
complete: loopsiloop().bin... | Don't bind and don't use `this`. Set `var someVariable = this;` before you call `setTimeout` and let it remain in scope for the recursion (using it instead of `this` inside the function). |
22,258,464 | I have the following code in which what I actually want is that when I click the button, the jLabel should show '1' and then click an image of it and save and then for '2', '3' and so on...
```
private void StartActionPerformed(java.awt.event.ActionEvent evt) {
for(int i=0... | 2014/03/07 | [
"https://Stackoverflow.com/questions/22258464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2806163/"
] | This transformation works
```
dtype1=[('latitude', 'f8'), ('longitude', 'f8'), ('location_id', 'f4')]
data1=data[list(data.dtype.names[:3])].astype(dtype1)
```
But `data1.view(float)` still gives the error
```
dtype2=[('latitude', 'f8'), ('longitude', 'f8'), ('location_id', 'f8')]
data2=data[list(data.dtype.names[:... | Hmm. Maybe you will have luck with this.
```
f_latlon = latlon.astype(np.float)
``` |
2,603,576 | I'm trying to prove $\frac 10 \notin \Bbb R $ by contradiction.
That means by supposing $\frac 10 \in \mathbb R.$
Is there a way to do this?
Thanks. | 2018/01/13 | [
"https://math.stackexchange.com/questions/2603576",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/479583/"
] | To prove that $\frac{1}{0}$ does not exist, it is perhaps best to start by reviewing the definition of division.
By definition, $\frac{a}{b}$ is the unique solution to the equation $a=bx$. So $\frac{1}{0}$, if it exists, is equal to the unique solution to the equation $1=0x$.
However, that equation has no solution:... | If by $\Bbb R$ you mean the usual real line then the division by zero is not defined because it is not defined either for the field of rational numbers $\Bbb Q$, what is contained in $\Bbb R$.
The rational numbers are generally constructed formally through two operations defined over the set $\Bbb Z\times\Bbb Z\setmin... |
116,040 | In the following sentence
>
> Bill promised Mary to fix her car.
>
>
>
Maybe I can write this sentence like this:
>
> Bill promised Mary **(for Bill) to fix her car**.
>
>
>
Bill is the subject of the verb `fix`, and also the verb `promised`. So, `promised` will have two objects: *`Mary`* and the clause *`... | 2013/06/07 | [
"https://english.stackexchange.com/questions/116040",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/43273/"
] | ***Promise*** is a very troublesome verb, syntactically speaking.
Most bitransitive communicational verbs, like *tell*, *order*, or *ask*, take infinitive complements with B-Equi from the Indirect Object, thus:
* `Su` *told/ordered/asked* `IO` [(*for* `IO`) *to* `VP`], as in
*They told him to prune the peaches. ... | A dictionary actually helps here. This is part of the OED's definition for *promise*:
>
> **1.** *trans.* To make a promise of (something), to give verbal assurance of; to undertake or commit oneself to do or refrain from (a specified thing or act) or to give or bestow (a specified thing). Freq. with indirect object ... |
67,908,110 | I'm following the Page Object model approach. I’m working on implementing a `SearchResultsPage` where a bunch of search results are displayed. In thinking about this page, I would like to implement it in such a way that it would support a `getSearchResultByIndex(int index)` method. Ideally, I would like the return type... | 2021/06/09 | [
"https://Stackoverflow.com/questions/67908110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/124641/"
] | After getting your DNS server policy configured, follow these steps to ensure that DNS logging is enabled:
1. Click on ‘DNS server policy’ in Cloud DNS.
2. Click on the name of the policy that you want to get logs from, then click ‘Edit Policy’.
3. Under Logs, select the ‘on’ option and then click on save. (If the ‘on... | I don't know about GCP logs but you can diagnose where/how DNS requests are handled/directed:
```
dig -t A a.root-servers.net.
```
This command asks for an IPv4 address (record `-t`ype `A`) for the host `a.root-servers.net` (a well known DNS server IIRC - see <https://www.iana.org/domains/root/servers>)
result:
``... |
5,379,791 | How do you configure the [Hibernate](http://www.hibernate.org/) class mappings of class [org.springframework.orm.hibernate3.LocalSessionFactoryBean](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/orm/hibernate3/LocalSessionFactoryBean.html) in the [Spring](http://www.springsource.org/) [applic... | 2011/03/21 | [
"https://Stackoverflow.com/questions/5379791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107158/"
] | If you're using JPA-annotated classes, you can use `AnnotationSessionFactoryBean` instead of `LocalSessionFactoryBean`, and inject the classes directly into the Spring bean:
```
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource"... | As a slight variation on skaffman's [answer](https://stackoverflow.com/questions/5379791/how-do-you-translate-hibernate-class-mappings-to-a-spring-application-context/5379927#5379927), I used property [`packagesToScan`](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/orm/hibernate3/annotation/A... |
5,379,791 | How do you configure the [Hibernate](http://www.hibernate.org/) class mappings of class [org.springframework.orm.hibernate3.LocalSessionFactoryBean](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/orm/hibernate3/LocalSessionFactoryBean.html) in the [Spring](http://www.springsource.org/) [applic... | 2011/03/21 | [
"https://Stackoverflow.com/questions/5379791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107158/"
] | If you're using JPA-annotated classes, you can use `AnnotationSessionFactoryBean` instead of `LocalSessionFactoryBean`, and inject the classes directly into the Spring bean:
```
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource"... | I was also facing the same issue, and this worked for me -
```
<bean id="auditCoreSessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="auditCoreDataSource" />
</property>
<property name="packagesToScan" valu... |
5,379,791 | How do you configure the [Hibernate](http://www.hibernate.org/) class mappings of class [org.springframework.orm.hibernate3.LocalSessionFactoryBean](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/orm/hibernate3/LocalSessionFactoryBean.html) in the [Spring](http://www.springsource.org/) [applic... | 2011/03/21 | [
"https://Stackoverflow.com/questions/5379791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/107158/"
] | As a slight variation on skaffman's [answer](https://stackoverflow.com/questions/5379791/how-do-you-translate-hibernate-class-mappings-to-a-spring-application-context/5379927#5379927), I used property [`packagesToScan`](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/orm/hibernate3/annotation/A... | I was also facing the same issue, and this worked for me -
```
<bean id="auditCoreSessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="auditCoreDataSource" />
</property>
<property name="packagesToScan" valu... |
34,914,434 | As we all know, single colon ":" can be used as a label and referred by "GOTO" statement, but in the following code I don't know what does ":" mean here, can you help me :)
```
set "str=!str:Mode_1=%_MODE%!" 2>nul
```
Thank you! | 2016/01/21 | [
"https://Stackoverflow.com/questions/34914434",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5815056/"
] | From the `set /?` help message:
>
> Environment variable substitution has been enhanced as follows:
>
>
>
> ```
> %PATH:str1=str2%
>
> ```
>
> would expand the PATH environment variable, substituting each
> occurrence of "str1" in the expanded result with "str2". "str2" can
> be the empty string to effectively... | The colon in the `set` command is used for string substitution. See [this](http://blogs.msdn.com/b/joshpoley/archive/2011/06/03/batch-file-string-substitution-with-nested-environment-variables.aspx). The line that you gave still seems quite cryptic and doesn't quite match the examples of string substitution that I was ... |
54,123,112 | I'm rendering a list of items using their index and would like to set and retrieve the state of those items individually. For instance, if the specific item I'm rendering is not active, I render the duration text.
My questions is in the following example: how can I evaluate something like `this.state.[index]'started'`... | 2019/01/10 | [
"https://Stackoverflow.com/questions/54123112",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/134788/"
] | Try accessing object's property using bracket notation:
```
this.state[`${index + 1}started`]
``` | You can concatenate the string in bracket notation
eg:
```
var obj = { '1started': '2:30', '2started': '3:30' }
for (i = 1; i < 3; i++ ) {
console.log(obj[i +'started']) // 2:30 3:30
}
```
so, you can use `this.state[index + 1 +'started']` |
48,115,464 | I am trying to use scipy.odr to get a best fit plane for some x, y, z points.
I define the plane equation implicitly as ax + by + cz + d = 0 and I perform a least squares (with scipy.linalg.lstsq) to provide the odr with an initial estimation.
The components of the beta vector (where beta = [a, b, c, d]) returned by ... | 2018/01/05 | [
"https://Stackoverflow.com/questions/48115464",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7101698/"
] | ODR is completely fine with multidimensional data, you were going the correct direction.
You just chose bad to use the implicit version of ODR with your `f_3` definition. The problem is you have a function `A*X=0` which you try to minimize without any additional constraints. Of course, the best the optimizer can do is... | As far as I understand the `odr` it is not made for 3D data, but I might be wrong here. As this is a simple plane fit, I suggest to use simple `leastsq`. Moreover, note that you do not really have 4 free parameters as you can divide `a * x + b * y + c * z + d = 0` e.g. by `d` providing `a' * x + b' * y + c' * z + 1 = 0... |
9,222,710 | I am using a regex pattern to find instances of [code][/code] BB tags. (This is in PHP with pearl-type regex using preg\_match / preg\_relace / etc)
```
'~\[code\](.*?)\[\/code\]~is'
```
Well, my question is how can I make it so somebody could type something like:
```
[code][code]code here[/code][/code]
```
The p... | 2012/02/10 | [
"https://Stackoverflow.com/questions/9222710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856987/"
] | you can try for this pattern
```
'~\[code\](.*?)(\[\/code\])+~is'
``` | All you are looking at is removing the `?` in the `(.*?)`
With the `?`, it is a lazy match and will match few characters as possible and that is why it stops when it sees the first `[/code]`
Without the `?`, it is a greedy match and will match as many characters as possible and will match till the outer end tag. |
9,222,710 | I am using a regex pattern to find instances of [code][/code] BB tags. (This is in PHP with pearl-type regex using preg\_match / preg\_relace / etc)
```
'~\[code\](.*?)\[\/code\]~is'
```
Well, my question is how can I make it so somebody could type something like:
```
[code][code]code here[/code][/code]
```
The p... | 2012/02/10 | [
"https://Stackoverflow.com/questions/9222710",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/856987/"
] | If you want to cover also the case that there can be more code between the two closing tags you can try this one
```
\[code\].*?\[\/code\](?:(?:(?!\[code\]).)*\[\/code\])?
```
See it [here on Regexr](http://regexr.com?3005q)
The first part `\[code\].*?\[\/code\]` is matching from the first opening tag to the first ... | All you are looking at is removing the `?` in the `(.*?)`
With the `?`, it is a lazy match and will match few characters as possible and that is why it stops when it sees the first `[/code]`
Without the `?`, it is a greedy match and will match as many characters as possible and will match till the outer end tag. |
39,931,552 | I get an Error in Handling
```
job.setInputFormatClass(TextInputFormat.class);
job.setOutputFormatClass(TextOutputFormat.class);
```
How to handle it ? Can Anyone please help me...!
```
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.had... | 2016/10/08 | [
"https://Stackoverflow.com/questions/39931552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6941071/"
] | You are using few packages from updated Hadoop version[mapreduce] but few of them (TextInputFormat & TextOutputFormat) are form older version[mapred package].
It's always good to use packages from map reduce so you have to do below mention change.
```
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
impo... | TextInputFormat and TextOutputFormat classes are from different version of hadoop as compared to other classes.Fix the imports for TextInputFormat and TextOutputFormat. |
58,279,511 | I have generated certificates with `cryptogen`.
And inspected generated certificates with `openssl` and noticed that it lacks information that can be used to distinguish peer and client roles. I believe `admin` can be distinguished because admincerts are written in blockchain, but there's no information about client a... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58279511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5406471/"
] | admin's certificate is stored in `admincerts` directory of `msp`. If a signature of a transaction can be verified by it, we can say that the sender of the transaction is `admincerts`. In short, fabric gets to know the certificate role from not certificate itself but msp. | This is some thing which hyperledger fabric platform handle by its self. we just need to handle client certificate hyperledger fabric support attribute based certificate. so you can identify different certificate via their attribute.
in Fabric network each component has its own identity. which means each component ha... |
58,279,511 | I have generated certificates with `cryptogen`.
And inspected generated certificates with `openssl` and noticed that it lacks information that can be used to distinguish peer and client roles. I believe `admin` can be distinguished because admincerts are written in blockchain, but there's no information about client a... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58279511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5406471/"
] | Its is very straight forward, nothing much complex or hidden mechanism, its a PKI as you know.
Every entity peer, orderer has its own MSP
so what is present in the MSP
```
.
├── admincerts
├── cacerts
├── keystore
├── signcerts
└── tlscacerts
```
as you see every peer will generate trust because of local MSP, ab... | This is some thing which hyperledger fabric platform handle by its self. we just need to handle client certificate hyperledger fabric support attribute based certificate. so you can identify different certificate via their attribute.
in Fabric network each component has its own identity. which means each component ha... |
58,279,511 | I have generated certificates with `cryptogen`.
And inspected generated certificates with `openssl` and noticed that it lacks information that can be used to distinguish peer and client roles. I believe `admin` can be distinguished because admincerts are written in blockchain, but there's no information about client a... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58279511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5406471/"
] | My answer is based on Fabric 1.4.3 and later.
The specific error you are seeing means that you are not invoking the JoinChannel API using an identity (key/cert pair) which is considered to be an admin for the peer. Prior to 1.4.3, admins were defined by explicitly putting certs in the *admincerts* folder in the local ... | This is some thing which hyperledger fabric platform handle by its self. we just need to handle client certificate hyperledger fabric support attribute based certificate. so you can identify different certificate via their attribute.
in Fabric network each component has its own identity. which means each component ha... |
58,279,511 | I have generated certificates with `cryptogen`.
And inspected generated certificates with `openssl` and noticed that it lacks information that can be used to distinguish peer and client roles. I believe `admin` can be distinguished because admincerts are written in blockchain, but there's no information about client a... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58279511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5406471/"
] | Its is very straight forward, nothing much complex or hidden mechanism, its a PKI as you know.
Every entity peer, orderer has its own MSP
so what is present in the MSP
```
.
├── admincerts
├── cacerts
├── keystore
├── signcerts
└── tlscacerts
```
as you see every peer will generate trust because of local MSP, ab... | admin's certificate is stored in `admincerts` directory of `msp`. If a signature of a transaction can be verified by it, we can say that the sender of the transaction is `admincerts`. In short, fabric gets to know the certificate role from not certificate itself but msp. |
58,279,511 | I have generated certificates with `cryptogen`.
And inspected generated certificates with `openssl` and noticed that it lacks information that can be used to distinguish peer and client roles. I believe `admin` can be distinguished because admincerts are written in blockchain, but there's no information about client a... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58279511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5406471/"
] | My answer is based on Fabric 1.4.3 and later.
The specific error you are seeing means that you are not invoking the JoinChannel API using an identity (key/cert pair) which is considered to be an admin for the peer. Prior to 1.4.3, admins were defined by explicitly putting certs in the *admincerts* folder in the local ... | admin's certificate is stored in `admincerts` directory of `msp`. If a signature of a transaction can be verified by it, we can say that the sender of the transaction is `admincerts`. In short, fabric gets to know the certificate role from not certificate itself but msp. |
58,279,511 | I have generated certificates with `cryptogen`.
And inspected generated certificates with `openssl` and noticed that it lacks information that can be used to distinguish peer and client roles. I believe `admin` can be distinguished because admincerts are written in blockchain, but there's no information about client a... | 2019/10/08 | [
"https://Stackoverflow.com/questions/58279511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5406471/"
] | My answer is based on Fabric 1.4.3 and later.
The specific error you are seeing means that you are not invoking the JoinChannel API using an identity (key/cert pair) which is considered to be an admin for the peer. Prior to 1.4.3, admins were defined by explicitly putting certs in the *admincerts* folder in the local ... | Its is very straight forward, nothing much complex or hidden mechanism, its a PKI as you know.
Every entity peer, orderer has its own MSP
so what is present in the MSP
```
.
├── admincerts
├── cacerts
├── keystore
├── signcerts
└── tlscacerts
```
as you see every peer will generate trust because of local MSP, ab... |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | 1. The `&` operator, like the `*` operator1 can be used for two different things depending on whether it's used as a *binary* or *unary* operator.
1. Unary `&` like `&var` takes the address of `var`. This is necessary to pass it to `scanf`.
2. Binary `&` like `var & var` is a bitwise AND, like item #2.
* Notice tha... | `printf` is a formatted output function, in which `%i` means that the argument is an integer. More information is availible [here](http://www.cplusplus.com/reference/clibrary/cstdio/printf/) for instance.
The `%` operator is indeed modulus. `&` is bitwise AND, and `|` is bitwise OR. |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | `&` and `|` are bitwise operators (respectively, AND and OR operators).
```
0101 (decimal 5)
& 0011 (decimal 3)
------
= 0001 (decimal 1)
0101 (decimal 5)
| 0011 (decimal 3)
------
= 0111 (decimal 7)
```
Since the substraction operator's precedence is higher than bitwise operators' precedence :
```
(x&x-1) = ... | More informations : <http://en.wikipedia.org/wiki/Boolean_algebra> |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | >
> What do things like (x&x-1) and (x|x-1)+1 mean?
>
>
>
`(x&x-1)` is equivalent to `(x & (x-1))`. `&` is the *bitwise-AND* operator. Similarly for the second example, where `|` is the *bitwise-OR* operator.
>
> I figure the % is doing modulus.
>
>
>
[Yes](http://en.wikipedia.org/wiki/Operators_in_C_and_C%2... | * `|` is [bitwise OR](http://en.wikipedia.org/wiki/Bitwise_operation#OR).
* `&` is [bitwise AND](http://en.wikipedia.org/wiki/Bitwise_operation#AND).
* `<<` is [bitwise shift](http://en.wikipedia.org/wiki/Bitwise_operation#Shifts_in_C.2C_C.2B.2B.2C_C.23).
* `%` is modulus.
* `%i` format string prints an integer. |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | >
> What do things like (x&x-1) and (x|x-1)+1 mean?
>
>
>
`(x&x-1)` is equivalent to `(x & (x-1))`. `&` is the *bitwise-AND* operator. Similarly for the second example, where `|` is the *bitwise-OR* operator.
>
> I figure the % is doing modulus.
>
>
>
[Yes](http://en.wikipedia.org/wiki/Operators_in_C_and_C%2... | `&` and `|` are bitwise operators (respectively, AND and OR operators).
```
0101 (decimal 5)
& 0011 (decimal 3)
------
= 0001 (decimal 1)
0101 (decimal 5)
| 0011 (decimal 3)
------
= 0111 (decimal 7)
```
Since the substraction operator's precedence is higher than bitwise operators' precedence :
```
(x&x-1) = ... |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | >
> What do things like (x&x-1) and (x|x-1)+1 mean?
>
>
>
`(x&x-1)` is equivalent to `(x & (x-1))`. `&` is the *bitwise-AND* operator. Similarly for the second example, where `|` is the *bitwise-OR* operator.
>
> I figure the % is doing modulus.
>
>
>
[Yes](http://en.wikipedia.org/wiki/Operators_in_C_and_C%2... | 1. The `&` operator, like the `*` operator1 can be used for two different things depending on whether it's used as a *binary* or *unary* operator.
1. Unary `&` like `&var` takes the address of `var`. This is necessary to pass it to `scanf`.
2. Binary `&` like `var & var` is a bitwise AND, like item #2.
* Notice tha... |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | * `|` is [bitwise OR](http://en.wikipedia.org/wiki/Bitwise_operation#OR).
* `&` is [bitwise AND](http://en.wikipedia.org/wiki/Bitwise_operation#AND).
* `<<` is [bitwise shift](http://en.wikipedia.org/wiki/Bitwise_operation#Shifts_in_C.2C_C.2B.2B.2C_C.23).
* `%` is modulus.
* `%i` format string prints an integer. | `&` and `|` are bitwise operators (respectively, AND and OR operators).
```
0101 (decimal 5)
& 0011 (decimal 3)
------
= 0001 (decimal 1)
0101 (decimal 5)
| 0011 (decimal 3)
------
= 0111 (decimal 7)
```
Since the substraction operator's precedence is higher than bitwise operators' precedence :
```
(x&x-1) = ... |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | * `|` is [bitwise OR](http://en.wikipedia.org/wiki/Bitwise_operation#OR).
* `&` is [bitwise AND](http://en.wikipedia.org/wiki/Bitwise_operation#AND).
* `<<` is [bitwise shift](http://en.wikipedia.org/wiki/Bitwise_operation#Shifts_in_C.2C_C.2B.2B.2C_C.23).
* `%` is modulus.
* `%i` format string prints an integer. | `printf` is a formatted output function, in which `%i` means that the argument is an integer. More information is availible [here](http://www.cplusplus.com/reference/clibrary/cstdio/printf/) for instance.
The `%` operator is indeed modulus. `&` is bitwise AND, and `|` is bitwise OR. |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | >
> What do things like (x&x-1) and (x|x-1)+1 mean?
>
>
>
`(x&x-1)` is equivalent to `(x & (x-1))`. `&` is the *bitwise-AND* operator. Similarly for the second example, where `|` is the *bitwise-OR* operator.
>
> I figure the % is doing modulus.
>
>
>
[Yes](http://en.wikipedia.org/wiki/Operators_in_C_and_C%2... | `printf` is a formatted output function, in which `%i` means that the argument is an integer. More information is availible [here](http://www.cplusplus.com/reference/clibrary/cstdio/printf/) for instance.
The `%` operator is indeed modulus. `&` is bitwise AND, and `|` is bitwise OR. |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | 1. The `&` operator, like the `*` operator1 can be used for two different things depending on whether it's used as a *binary* or *unary* operator.
1. Unary `&` like `&var` takes the address of `var`. This is necessary to pass it to `scanf`.
2. Binary `&` like `var & var` is a bitwise AND, like item #2.
* Notice tha... | `&` and `|` are bitwise operators (respectively, AND and OR operators).
```
0101 (decimal 5)
& 0011 (decimal 3)
------
= 0001 (decimal 1)
0101 (decimal 5)
| 0011 (decimal 3)
------
= 0111 (decimal 7)
```
Since the substraction operator's precedence is higher than bitwise operators' precedence :
```
(x&x-1) = ... |
7,230,974 | Quick question. I've never had experience with C.
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n, x;
printf( "How many disks? " );
scanf( "%d", &n );
printf("\n");
for (x=1; x < (1 << n); x++)
printf( "move from tower %i to tower %i.\n",(x&x-1)%3, ((x|x-1)+1)%3 );
return 0;
}
... | 2011/08/29 | [
"https://Stackoverflow.com/questions/7230974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/803954/"
] | >
> What do things like (x&x-1) and (x|x-1)+1 mean?
>
>
>
`(x&x-1)` is equivalent to `(x & (x-1))`. `&` is the *bitwise-AND* operator. Similarly for the second example, where `|` is the *bitwise-OR* operator.
>
> I figure the % is doing modulus.
>
>
>
[Yes](http://en.wikipedia.org/wiki/Operators_in_C_and_C%2... | More informations : <http://en.wikipedia.org/wiki/Boolean_algebra> |
21,651,078 | I'm having an issue getting the height to adjust so that the map will actually appear - I know that I have to set the html and body height to 100% (which I did) and the parent div to 100% (hence the .info div having 100% height) but for some reason it's still not rendering the map properly - the width works fine, but t... | 2014/02/08 | [
"https://Stackoverflow.com/questions/21651078",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2467270/"
] | Actually you've a syntax error in your CSS selector: `}.mapWrapper { ... }` Remove the first closing curly brace before the `.mapWrapper` class, And it would work.
So the CSS engine ignores the `.mapWrapper { ... }` rules and `.mapWrapper` element *(which is the parent of `.map-canvas`)*, wont't have an explicit `heig... | For anyone else wondering - using em's over percentages did in fact allow the height to properly adjust. Not entirely sure if that requires you to set the height of parent elements, but all I did was change 100% to an em value, and it worked. |
1,352,721 | Is it possible to express (mathematical) infinity, positive or negative, in C#? If so, how? | 2009/08/30 | [
"https://Stackoverflow.com/questions/1352721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | double.PositiveInfinity
double.NegativeInfinity
```
float zero = 0;
float positive = 1 / zero;
Console.WriteLine(positive); // Outputs "Infinity"
float negative = -1 / zero;
Console.WriteLine(negative); // Outputs "-Infinity"
``` | ```
public const double NegativeInfinity = -1.0 / 0.0;
public const double PositiveInfinity = 1.0 / 0.0;
``` |
1,352,721 | Is it possible to express (mathematical) infinity, positive or negative, in C#? If so, how? | 2009/08/30 | [
"https://Stackoverflow.com/questions/1352721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | Use the `PositiveInfinity` and `NegativeInfinity` constants:
```
double positive = double.PositiveInfinity;
double negative = double.NegativeInfinity;
``` | ```
public const double NegativeInfinity = -1.0 / 0.0;
public const double PositiveInfinity = 1.0 / 0.0;
``` |
1,352,721 | Is it possible to express (mathematical) infinity, positive or negative, in C#? If so, how? | 2009/08/30 | [
"https://Stackoverflow.com/questions/1352721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | ```
public const double NegativeInfinity = -1.0 / 0.0;
public const double PositiveInfinity = 1.0 / 0.0;
``` | look this (just return Positive-infinity ∞)
>
> Remarks :
>
>
> The value of this constant is the result of dividing a positive number
> by zero. **This constant is returned when the result of an operation is
> greater than MaxValue.** Use IsPositiveInfinity to determine whether a
> value evaluates to positive i... |
1,352,721 | Is it possible to express (mathematical) infinity, positive or negative, in C#? If so, how? | 2009/08/30 | [
"https://Stackoverflow.com/questions/1352721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | double.PositiveInfinity
double.NegativeInfinity
```
float zero = 0;
float positive = 1 / zero;
Console.WriteLine(positive); // Outputs "Infinity"
float negative = -1 / zero;
Console.WriteLine(negative); // Outputs "-Infinity"
``` | Yes, check constants values of types `float` and `double`, like:
`float.PositiveInfinity`
`float.NegativeInfinity`
Those values are compliant with IEEE-754, so you might want to check out how this works exactly, so you will be aware, when and how you can get those values while making calculations. More info [h... |
1,352,721 | Is it possible to express (mathematical) infinity, positive or negative, in C#? If so, how? | 2009/08/30 | [
"https://Stackoverflow.com/questions/1352721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | double.PositiveInfinity
double.NegativeInfinity
```
float zero = 0;
float positive = 1 / zero;
Console.WriteLine(positive); // Outputs "Infinity"
float negative = -1 / zero;
Console.WriteLine(negative); // Outputs "-Infinity"
``` | Use the `PositiveInfinity` and `NegativeInfinity` constants:
```
double positive = double.PositiveInfinity;
double negative = double.NegativeInfinity;
``` |
1,352,721 | Is it possible to express (mathematical) infinity, positive or negative, in C#? If so, how? | 2009/08/30 | [
"https://Stackoverflow.com/questions/1352721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | double.PositiveInfinity
double.NegativeInfinity
```
float zero = 0;
float positive = 1 / zero;
Console.WriteLine(positive); // Outputs "Infinity"
float negative = -1 / zero;
Console.WriteLine(negative); // Outputs "-Infinity"
``` | look this (just return Positive-infinity ∞)
>
> Remarks :
>
>
> The value of this constant is the result of dividing a positive number
> by zero. **This constant is returned when the result of an operation is
> greater than MaxValue.** Use IsPositiveInfinity to determine whether a
> value evaluates to positive i... |
1,352,721 | Is it possible to express (mathematical) infinity, positive or negative, in C#? If so, how? | 2009/08/30 | [
"https://Stackoverflow.com/questions/1352721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | Use the `PositiveInfinity` and `NegativeInfinity` constants:
```
double positive = double.PositiveInfinity;
double negative = double.NegativeInfinity;
``` | Yes, check constants values of types `float` and `double`, like:
`float.PositiveInfinity`
`float.NegativeInfinity`
Those values are compliant with IEEE-754, so you might want to check out how this works exactly, so you will be aware, when and how you can get those values while making calculations. More info [h... |
1,352,721 | Is it possible to express (mathematical) infinity, positive or negative, in C#? If so, how? | 2009/08/30 | [
"https://Stackoverflow.com/questions/1352721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | Yes, check constants values of types `float` and `double`, like:
`float.PositiveInfinity`
`float.NegativeInfinity`
Those values are compliant with IEEE-754, so you might want to check out how this works exactly, so you will be aware, when and how you can get those values while making calculations. More info [h... | look this (just return Positive-infinity ∞)
>
> Remarks :
>
>
> The value of this constant is the result of dividing a positive number
> by zero. **This constant is returned when the result of an operation is
> greater than MaxValue.** Use IsPositiveInfinity to determine whether a
> value evaluates to positive i... |
1,352,721 | Is it possible to express (mathematical) infinity, positive or negative, in C#? If so, how? | 2009/08/30 | [
"https://Stackoverflow.com/questions/1352721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/114916/"
] | Use the `PositiveInfinity` and `NegativeInfinity` constants:
```
double positive = double.PositiveInfinity;
double negative = double.NegativeInfinity;
``` | look this (just return Positive-infinity ∞)
>
> Remarks :
>
>
> The value of this constant is the result of dividing a positive number
> by zero. **This constant is returned when the result of an operation is
> greater than MaxValue.** Use IsPositiveInfinity to determine whether a
> value evaluates to positive i... |
21,732,556 | I have found 'TomcatEmbeddedServletContainerFactory' from the Spring Boot project which can create a Tomcat embedded instance.
I already have a set of "traditional" Spring (Java based) configuration classes plus a 'AbstractAnnotationConfigDispatcherServletInitializer' implementation for setting up a root application co... | 2014/02/12 | [
"https://Stackoverflow.com/questions/21732556",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/119925/"
] | The `EmbeddedServletContainerFactory` really pairs with `EmbeddedWebApplicationContext` (not the `AnnotationConfigWebApplicationContext` you get from `AbstractAnnotationConfigDispatcherServletInitializer`). If you want to build a WAR file then your best option given the simple nature of the initializer is to use `Sprin... | With some more debugging and some more input from Dave the right approach is to explicitly get the child builder instance and invoke it's run() method. This will start the context properly.
```
SpringApplicationBuilder builder = new SpringApplicationBuilder();
builder.sources(ServiceModuleConfiguration.class);... |
15,781,433 | I want to write a regex that checks if the left and right part (relative to some pivot character) is equal, e.g.
`m2/m2` -> yes
`m3/m2` -> no
How do I write a regex that checks if a capture on the left side of the pivot character is equal to the right? | 2013/04/03 | [
"https://Stackoverflow.com/questions/15781433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/167251/"
] | The example below illustrates dynamic polymorphism. Both a and d are declared to be Animals, but d is actually a dog.
Notice that when I call makeNoise on the Animal d, java will know that d is actually a dog and not just any animal.
```
class Test {
public static void main(String[] args) {
Animal a = ne... | ```
class Account {
public static void main(String[] args) {
Animal a = new Dog();
Dog d = new Dog();
d.makeNoise();
a.makeNoise();
a = new Cat();
a.makeNoise();
}
}
abstract class Animal {
public void makeNoise() {
System.out.println("Super");
}
... |
15,781,433 | I want to write a regex that checks if the left and right part (relative to some pivot character) is equal, e.g.
`m2/m2` -> yes
`m3/m2` -> no
How do I write a regex that checks if a capture on the left side of the pivot character is equal to the right? | 2013/04/03 | [
"https://Stackoverflow.com/questions/15781433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/167251/"
] | The example below illustrates dynamic polymorphism. Both a and d are declared to be Animals, but d is actually a dog.
Notice that when I call makeNoise on the Animal d, java will know that d is actually a dog and not just any animal.
```
class Test {
public static void main(String[] args) {
Animal a = ne... | Your simplified example does not present the case well enough.
```
Collection<Animal> caged = getCagedAnimals();
for (Animal a : caged)
a.makeNoise();
```
As there are many types of animals (classes), each makes a different noise. We do not need any typecasting to obtain different behavior, so to say. Imagine the ... |
15,781,433 | I want to write a regex that checks if the left and right part (relative to some pivot character) is equal, e.g.
`m2/m2` -> yes
`m3/m2` -> no
How do I write a regex that checks if a capture on the left side of the pivot character is equal to the right? | 2013/04/03 | [
"https://Stackoverflow.com/questions/15781433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/167251/"
] | The example below illustrates dynamic polymorphism. Both a and d are declared to be Animals, but d is actually a dog.
Notice that when I call makeNoise on the Animal d, java will know that d is actually a dog and not just any animal.
```
class Test {
public static void main(String[] args) {
Animal a = ne... | consider there are 3 classes
1. animal
2. dog
3. cat
cat and dog are sub classes of animal.
---
```js
class Test {
public static void main(String[] args) {
Animal a = new Animal();
int user_input=userinput(); //returns 1 for cat and 2for dog
switch(user_input)
{
case 1:Animal d=n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.