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 |
|---|---|---|---|---|---|
62,565,188 | I am working on a COVID-19 statistics app with **Ionic** and **Angular**. The data is retrieved from an API. This is the API: <https://covid19api.com/>. I can search up for countries but now I want to be able to make a country a favorite using local storage so that next time I don't have to search for a country when I ... | 2020/06/24 | [
"https://Stackoverflow.com/questions/62565188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11244166/"
] | Interesting. I went through your logs and I don't see anything obvious, and you've already figured out that you can't reach the orderer . . I want to check if this is indeed a TLS issue. Can you try something for me please?
* there should be a monitordocker.sh script in `fabric-samples/commercial-paper/organization/di... | @DanieleChirivì I was looking at a [similar issue on stackoverflow](https://stackoverflow.com/questions/55803125/tls-handshake-failed-with-error-remote-error-tls-bad-certificate-server-ordere) and this might be our issue here, well at least it's worth a shot. Lets try a couple of things,
* Could you go to `test-networ... |
62,565,188 | I am working on a COVID-19 statistics app with **Ionic** and **Angular**. The data is retrieved from an API. This is the API: <https://covid19api.com/>. I can search up for countries but now I want to be able to make a country a favorite using local storage so that next time I don't have to search for a country when I ... | 2020/06/24 | [
"https://Stackoverflow.com/questions/62565188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11244166/"
] | Interesting. I went through your logs and I don't see anything obvious, and you've already figured out that you can't reach the orderer . . I want to check if this is indeed a TLS issue. Can you try something for me please?
* there should be a monitordocker.sh script in `fabric-samples/commercial-paper/organization/di... | Delete all the docker images, including not used and used, and then re-download them. I did that and it works. |
38,115 | I am attempting a castle cake with a dragon on it. I also want to make a tower to stick and stand up on the castle. The general idea to create the tower is to stick Oreo biscuits together and then to fondant the outside to make it look like a stone wall tower.
Can someone please help me figure out how to stick the bi... | 2013/11/03 | [
"https://cooking.stackexchange.com/questions/38115",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/11200/"
] | You are going to have to experiment, if you want to use oreos.
The problem is that you need somethign strong enough to allow you to roll the glued together tower in fondant.
I would try, in order:
* Tempered chocolate, if you can do that; its pretty strong when fully cooled
* Royal icing
* Very thick ganache
* Peanu... | I'd recommend that unless you're just stacking oreos on top of each other, that you use something else for structure and then afix the oreos on using icing as a mastic.
Typically, you'd use one of the following:
* A hollow structure made of gingerbread sheets, fastened together
* A bit of dense cake (eg, pound cake),... |
38,115 | I am attempting a castle cake with a dragon on it. I also want to make a tower to stick and stand up on the castle. The general idea to create the tower is to stick Oreo biscuits together and then to fondant the outside to make it look like a stone wall tower.
Can someone please help me figure out how to stick the bi... | 2013/11/03 | [
"https://cooking.stackexchange.com/questions/38115",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/11200/"
] | You are going to have to experiment, if you want to use oreos.
The problem is that you need somethign strong enough to allow you to roll the glued together tower in fondant.
I would try, in order:
* Tempered chocolate, if you can do that; its pretty strong when fully cooled
* Royal icing
* Very thick ganache
* Peanu... | This type of fancy cakes usually has inedible internal supports, such as wood rods. I wouldn't trust the cookies to remain safely upright even after being glued. My intuition would pronounce a glued tower stable if its height is 2x diameter max, anything above feels problematic. It is a different case if you create a h... |
38,115 | I am attempting a castle cake with a dragon on it. I also want to make a tower to stick and stand up on the castle. The general idea to create the tower is to stick Oreo biscuits together and then to fondant the outside to make it look like a stone wall tower.
Can someone please help me figure out how to stick the bi... | 2013/11/03 | [
"https://cooking.stackexchange.com/questions/38115",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/11200/"
] | I'd recommend that unless you're just stacking oreos on top of each other, that you use something else for structure and then afix the oreos on using icing as a mastic.
Typically, you'd use one of the following:
* A hollow structure made of gingerbread sheets, fastened together
* A bit of dense cake (eg, pound cake),... | This type of fancy cakes usually has inedible internal supports, such as wood rods. I wouldn't trust the cookies to remain safely upright even after being glued. My intuition would pronounce a glued tower stable if its height is 2x diameter max, anything above feels problematic. It is a different case if you create a h... |
47,152,617 | I can right click on a file using the Solution Explorer in Visual Studio 2017 and View History which shows all the history of the changes for that file.
I would like to do the same at the solution or project node and view all the changes for all the files. Is there a way to do this? | 2017/11/07 | [
"https://Stackoverflow.com/questions/47152617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/129001/"
] | In the Changes window, you can view the repo history under the Actions dropdown:
[](https://i.stack.imgur.com/IbLLD.png) | Alternatively to @Jimmy answer you can stay within Solution Explorer by switching it to show the Folders view. Then you can right click on the top of the folder tree and select View History.
[](https://i.stack.imgur.com/uJXuH.png)
[![Right Click - Vie... |
47,152,617 | I can right click on a file using the Solution Explorer in Visual Studio 2017 and View History which shows all the history of the changes for that file.
I would like to do the same at the solution or project node and view all the changes for all the files. Is there a way to do this? | 2017/11/07 | [
"https://Stackoverflow.com/questions/47152617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/129001/"
] | In the Changes window, you can view the repo history under the Actions dropdown:
[](https://i.stack.imgur.com/IbLLD.png) | For Visual Studio 2019, Git features have been moved. You can view all the commits for a repo from the Git branch history window. You can access it from the Git menu in the main menu bar:
```
Git ➔ View Branch History
``` |
67,051,595 | My code does not raise any errors but when i test it in unity it wont work here is the code, i just want to make a simple movement code:
```
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class player : MonoBehaviour
{
private void start()
{
}
void update()
{
if (Walk_righ... | 2021/04/12 | [
"https://Stackoverflow.com/questions/67051595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15377525/"
] | You will need to assure that all of the dependancies for your code are installed in the image in order to be able to use the resulting image (without additional installation). This means that you need to install the libraries and binaries (in your case `libstdc++` and other dependent libraries).
Unfortunately, `bazel` ... | As @JayEye later self answered in @jordanvrtanoski's answer, using `@distroless-cc` as base image should fix this problem.
To give more color on this, we first need to understand "distroless" images and how they are used by the various `<language>_image` rules from [rules\_docker](https://github.com/bazelbuild/rules_d... |
49,759,435 | Each of my indexed documents has a multi valued field `user_ids_ims` that contains user ids to which the document is related. This field may be empty.
```
<types>
<fieldType name="tint" class="solr.IntPointField" omitNorms="true"/>
</types>
<fields>
<dynamicField name="*_ims" type="tint" multiValued="true"/>
</fi... | 2018/04/10 | [
"https://Stackoverflow.com/questions/49759435",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/104219/"
] | The actual answer is that you combine the two requirements:
```
fq=user_ids_ims:(42) OR (*:* -user_ids_ims:[* TO *])
```
The latter `*:*` is important, since you have to have a set of documents to subtract the set returned by `user_ids_ims:[* TO *]` from. This will give you any documents that have `42` in the field,... | The `user_ids_ims` field is populated using values from a MySQL column defined with `AUTO_INCREMENT`, so I know that `0` is not a valid `id`. With this knowledge, I can assign:
```
{ id: 'Page 1', user_ids_ims: [0] }
```
Now I have 2 defined values to search for, which is just fine, i.e. `fq=user_ids_ims:(0 42)` |
61,216,106 | I'm currently struggling to reproduce scan appearance on an image
As discovered throw many days of work - CIFilter CIEdgeWork - is the best (but not good enough for my need) option.
[original image](https://i.stack.imgur.com/KEZE6.jpg)
[current result](https://i.stack.imgur.com/qgqIx.jpg)
[expected image](https://i... | 2020/04/14 | [
"https://Stackoverflow.com/questions/61216106",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13314911/"
] | You have 2 options:
**Parse the input string from properties**
```
var colFromProp = "44, 44, 44";
var rgb = Arrays.stream(colFromProp.split(","))
.map(String::trim)
.mapToInt(Integer::parseInt)
.toArray();
var c = new Color(rgb[0], rgb[1], rgb[2]);
```
**Use another constructor**
Instead of taking a l... | Well if you don't use a library which has some kind of config support you have to do that yourself.
For this purpose I'd recommend you to write a own class (Config.java e.g.) and load the whole config in the constructor (each line consists of key=value, you could use an extra Class "Attribute" for this pair, in which y... |
37,845,968 | I'm attempting to disable the Wordpress Yoast SEO on a single page because it's conflicting with a different plugin.
I tried following this [StackOverflow question](https://stackoverflow.com/questions/24391891/remove-yoast-wordpress-seo-on-a-page), adding this code to **functions.php**:
```
add_action('template_redi... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37845968",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/143895/"
] | Okay, I figured out what I was doing wrong. Here is the corrected code which is working:
```
add_action('template_redirect','remove_wpseo');
function remove_wpseo(){
if (is_page(5526)) {
global $wpseo_front;
if(defined($wpseo_front)){
remove_action('wp_head',array($wpseo_front,... | As of Yoast version 14.0, They have changed the way of disabling Yoast SEO output. This is the new method.
```
add_action( 'template_redirect', 'remove_wpseo' );
function remove_wpseo() {
if ( is_page ( 5526 ) ) {
$front_end = YoastSEO()->classes->get( Yoast\WP\SEO\Integrations\Front_End_Integration::clas... |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | Also, preserve it in a "private" context prior to the cleaning:
```
b = 1;
myCtx`b = b;
Clear["Global`*"];
b = myCtx`b
(* 1 *)
``` | One other alternative is to `Compress[b]` and copy the resulting string to your clipboard, then do the global clear or kernel quit, and then `b=Uncompress["..."]`. This is not the most elegant solution, obviously, but it's a useful technique to be aware of. |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | What I would to is quite simple: simply `Block` the variable you don't want to clear:
```
a=1;b=2;c=3;
Block[{a},
Clear[a,b,c]
]
{a, b, c}
(* {1, b, c} *)
```
This solution allows you to deal with symbols rather than their string names. You can get fancier and create a closure which would encapsulate your orig... | Also, preserve it in a "private" context prior to the cleaning:
```
b = 1;
myCtx`b = b;
Clear["Global`*"];
b = myCtx`b
(* 1 *)
``` |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | An alternative that doesn't require protecting or using private contexts:
```
Clear @@ DeleteCases[Names@"`*", "b"];
```
To keep a few (as suggested in comments) replace `"b"` with `"b"|"g"|"h"`. | One other alternative is to `Compress[b]` and copy the resulting string to your clipboard, then do the global clear or kernel quit, and then `b=Uncompress["..."]`. This is not the most elegant solution, obviously, but it's a useful technique to be aware of. |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | An alternative that doesn't require protecting or using private contexts:
```
Clear @@ DeleteCases[Names@"`*", "b"];
```
To keep a few (as suggested in comments) replace `"b"` with `"b"|"g"|"h"`. | You may want to place your special variable(s) in a separate context and then only clear `Global`*`. This is *not* the same as belisarius' recommendation. Instead create the variable `b` in a different context *to begin with* and append this context to the context path:
```
AppendTo[$ContextPath, "special`"];
special... |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | What I would to is quite simple: simply `Block` the variable you don't want to clear:
```
a=1;b=2;c=3;
Block[{a},
Clear[a,b,c]
]
{a, b, c}
(* {1, b, c} *)
```
This solution allows you to deal with symbols rather than their string names. You can get fancier and create a closure which would encapsulate your orig... | One other alternative is to `Compress[b]` and copy the resulting string to your clipboard, then do the global clear or kernel quit, and then `b=Uncompress["..."]`. This is not the most elegant solution, obviously, but it's a useful technique to be aware of. |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | An alternative that doesn't require protecting or using private contexts:
```
Clear @@ DeleteCases[Names@"`*", "b"];
```
To keep a few (as suggested in comments) replace `"b"` with `"b"|"g"|"h"`. | Also, preserve it in a "private" context prior to the cleaning:
```
b = 1;
myCtx`b = b;
Clear["Global`*"];
b = myCtx`b
(* 1 *)
``` |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | An alternative that doesn't require protecting or using private contexts:
```
Clear @@ DeleteCases[Names@"`*", "b"];
```
To keep a few (as suggested in comments) replace `"b"` with `"b"|"g"|"h"`. | The solution is to first protect `b`, then clear all variables in current context, and then unprotect b again:
```
Protect[b];Clear[Evaluate[$Context<>"*"]];Unprotect[b]
```
By protecting `b`, you prevent it from getting cleared (Mathematica will complain, but do the right thing anyway). Note that the `$Context` con... |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | You may want to place your special variable(s) in a separate context and then only clear `Global`*`. This is *not* the same as belisarius' recommendation. Instead create the variable `b` in a different context *to begin with* and append this context to the context path:
```
AppendTo[$ContextPath, "special`"];
special... | Also, preserve it in a "private" context prior to the cleaning:
```
b = 1;
myCtx`b = b;
Clear["Global`*"];
b = myCtx`b
(* 1 *)
``` |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | The solution is to first protect `b`, then clear all variables in current context, and then unprotect b again:
```
Protect[b];Clear[Evaluate[$Context<>"*"]];Unprotect[b]
```
By protecting `b`, you prevent it from getting cleared (Mathematica will complain, but do the right thing anyway). Note that the `$Context` con... | One other alternative is to `Compress[b]` and copy the resulting string to your clipboard, then do the global clear or kernel quit, and then `b=Uncompress["..."]`. This is not the most elegant solution, obviously, but it's a useful technique to be aware of. |
10,970 | I have a lot of variables: $a,b,c,d, \ldots $
I want to clear the values of all of them except $b$. It's really lengthy to write
```
Clear[a];
Clear[c];
...
```
Is there any command which clears all variables except a chosen one? | 2012/09/22 | [
"https://mathematica.stackexchange.com/questions/10970",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/-1/"
] | You may want to place your special variable(s) in a separate context and then only clear `Global`*`. This is *not* the same as belisarius' recommendation. Instead create the variable `b` in a different context *to begin with* and append this context to the context path:
```
AppendTo[$ContextPath, "special`"];
special... | One other alternative is to `Compress[b]` and copy the resulting string to your clipboard, then do the global clear or kernel quit, and then `b=Uncompress["..."]`. This is not the most elegant solution, obviously, but it's a useful technique to be aware of. |
17,407,842 | Maybe this has been asked before or maybe it's even a question that shouldnt be asked.
I'm using Twitter bootstrap and its responsive css.
My input fields in my app are supposed to be quite small since Im only inputting numbers 0-999.
I've set class="span1" on the inputs which looks correct on highres viewports.
Howev... | 2013/07/01 | [
"https://Stackoverflow.com/questions/17407842",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/317384/"
] | Actually, that's how Bootstrap works. Everything which has one of the `.spanX` classes gets 100% width on resolutions < 768px.
If you want to force a small width, your quicker options are:
* Manually set the width in that input (**isn't** responsive!);
* Use `.input-mini`/`.input-small` (which **aren't** responsive a... | You can use the input-mini or input-small classes on the input:
<http://twitter.github.io/bootstrap/base-css.html#forms> (search for Relative sizing)
```
<input class="input-mini" type="text" placeholder=".input-mini">
<input class="input-small" type="text" placeholder=".input-small">
``` |
8,586,010 | I'm trying to come up with a regular expression which will search for a string and replace with new set of characters.
My string is something like this.
```
(Product=='Partnership - CT'&&State==CT)
```
Here I have to search for the `CT` value for state key and replace with `'CT'` (i.e., add single quotation marks).... | 2011/12/21 | [
"https://Stackoverflow.com/questions/8586010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2090887/"
] | UPDATE: You don't have to hardcode the "CT" in your regular expression. If you know that the "State" parameter will always be a two-letter code you can add quotation marks to *any* state with something like the following:
```
expressionQuery.replace(/State==([A-Z]{2})/g,"State=='$1'");
```
This says to find a the su... | You could use a negative lookahead to ensure that there is no `'` ahead of the pattern you want to replace.
```
expressionQuery.replace(new RegExp('CT(?!\')', "g"),"\'"+val+"\'" );
```
It works for your example, but I don't know if this rule is strict enough to avoid false replacements in all cases. |
10,035,169 | I was reading [an answer to a different question](https://stackoverflow.com/a/4903455/882146) on SO, in which @RomainGuy commented that one could (please correct me if I'm paraphrasing incorrectly) back-port code from later versions of android to earlier versions. Specifically, I am interested in back-porting code for ... | 2012/04/05 | [
"https://Stackoverflow.com/questions/10035169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/882146/"
] | As @hackbod mentioned `BitmapRegionDecoder` is based on external `skia` library. Yet it's may be a benefit.
Let's examine original source:
* `BitmapRegionDecoder.java`. Mostly defines wrappers around native methods:
```
private static native Bitmap nativeDecodeRegion(int lbm,
int start_x, int start_y, int width,... | You can back-port *some* code, if it can exist on top of the SDK you are porting it to.
You can't back-port anything. For example, you couldn't back-port a kernel feature. :)
In this case, there is no easy solution to back-porting it. The implementation of this sits on top of Skia and the jpeg decoder, which are both... |
10,035,169 | I was reading [an answer to a different question](https://stackoverflow.com/a/4903455/882146) on SO, in which @RomainGuy commented that one could (please correct me if I'm paraphrasing incorrectly) back-port code from later versions of android to earlier versions. Specifically, I am interested in back-porting code for ... | 2012/04/05 | [
"https://Stackoverflow.com/questions/10035169",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/882146/"
] | As @hackbod mentioned `BitmapRegionDecoder` is based on external `skia` library. Yet it's may be a benefit.
Let's examine original source:
* `BitmapRegionDecoder.java`. Mostly defines wrappers around native methods:
```
private static native Bitmap nativeDecodeRegion(int lbm,
int start_x, int start_y, int width,... | You should consider [**BitmapRegionDecoderCompat**](https://github.com/bonnyfone/brdcompat), an **API 8+** version of the standard [BitmapRegionDecoder](http://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html) (API 10+).
Features
--------
* It **operates in "compat" mode on devices running AP... |
1,036,338 | To delete files recursively in our IBM GPFS cluster, we use simple unix command like :
`rm /my/directories -fr`
However deletions are very long to be done.
Problem is that our distributed apps (Spark-based) took like `one hour` to be done. But then, it also `took about an other hour` to drop temporary files generate... | 2020/10/04 | [
"https://serverfault.com/questions/1036338",
"https://serverfault.com",
"https://serverfault.com/users/594272/"
] | I don’t think you can speed up this process as “rm” triggers lots of the metadata updates for the distributed file systems, and they take quite some time to complete. What you can try is to issue “mv” to some temp folder within the same file system (!!!) and do an actual “rm” in the background. | You can use gpfs policy which is much faster than 'rm'.
Here is an example, e.g., I want to remove all files under /gpfs2/mysql/performance\_schema/
The policy file is:
RULE 'my\_del' DELETE DIRECTORIES\_PLUS WHERE PATH\_NAME LIKE '/gpfs2/mysql/performance\_schema/%'
Then I can run the policy with:
mmapplypolicy /... |
67,587,342 | I'm trying to replace multiple column based on multiple conditions :
```
test=data.frame(
start=c(1,100,1000,10000),
end=c(10,110,1010,10010),
value=c(-1.2,-1.5,-1.02,-0.5),
substart=c(2,102,NA,NA),
subend=c(8,108,NA,NA)
)
If value is <= -1 and substart == NA :
I want that : substart = start and subend = en... | 2021/05/18 | [
"https://Stackoverflow.com/questions/67587342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6140391/"
] | There isn't really a good, idiomatic C++ solution that would exactly match what you're asking for.
A language where "EmptyIfNull" would work well, is probably one that has either garbage collection, or reference counted objects. So, we can achieve something similar in C++ by using reference counted pointers:
```
// n... | Sadly, but no. There is really no way to fully achieve what you want. Your options are:
* If passed pointer is nullptr, return a reference to static object. This would only be correct if you are returning a `const` reference, otherwise, you are exposing yourself to a huge can of worms;
* Return an `std::optional<std::... |
67,587,342 | I'm trying to replace multiple column based on multiple conditions :
```
test=data.frame(
start=c(1,100,1000,10000),
end=c(10,110,1010,10010),
value=c(-1.2,-1.5,-1.02,-0.5),
substart=c(2,102,NA,NA),
subend=c(8,108,NA,NA)
)
If value is <= -1 and substart == NA :
I want that : substart = start and subend = en... | 2021/05/18 | [
"https://Stackoverflow.com/questions/67587342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6140391/"
] | Yes, but it's going to be ugly:
```
#include <stdio.h>
#include <variant>
template <class T>
struct Proxy {
private:
std::variant<T*, T> m_data = nullptr;
public:
Proxy(T* p) {
if (p)
m_data = p;
else
m_data = T{};
}
T* operator->() {
struct Visitor {
T* operator()(T* t) { r... | Sadly, but no. There is really no way to fully achieve what you want. Your options are:
* If passed pointer is nullptr, return a reference to static object. This would only be correct if you are returning a `const` reference, otherwise, you are exposing yourself to a huge can of worms;
* Return an `std::optional<std::... |
67,587,342 | I'm trying to replace multiple column based on multiple conditions :
```
test=data.frame(
start=c(1,100,1000,10000),
end=c(10,110,1010,10010),
value=c(-1.2,-1.5,-1.02,-0.5),
substart=c(2,102,NA,NA),
subend=c(8,108,NA,NA)
)
If value is <= -1 and substart == NA :
I want that : substart = start and subend = en... | 2021/05/18 | [
"https://Stackoverflow.com/questions/67587342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6140391/"
] | There isn't really a good, idiomatic C++ solution that would exactly match what you're asking for.
A language where "EmptyIfNull" would work well, is probably one that has either garbage collection, or reference counted objects. So, we can achieve something similar in C++ by using reference counted pointers:
```
// n... | If you accept [`std::shared_ptr<T>`](https://en.cppreference.com/w/cpp/memory/shared_ptr), you could use them to achieve this in a rather save and portable way:
```
template<typename T>
std::shared_ptr<T> NullOrDefault(std::shared_ptr<T> value)
{
if(value != nullptr)
{
return value;
}
return st... |
67,587,342 | I'm trying to replace multiple column based on multiple conditions :
```
test=data.frame(
start=c(1,100,1000,10000),
end=c(10,110,1010,10010),
value=c(-1.2,-1.5,-1.02,-0.5),
substart=c(2,102,NA,NA),
subend=c(8,108,NA,NA)
)
If value is <= -1 and substart == NA :
I want that : substart = start and subend = en... | 2021/05/18 | [
"https://Stackoverflow.com/questions/67587342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6140391/"
] | There isn't really a good, idiomatic C++ solution that would exactly match what you're asking for.
A language where "EmptyIfNull" would work well, is probably one that has either garbage collection, or reference counted objects. So, we can achieve something similar in C++ by using reference counted pointers:
```
// n... | If you only want to skip over `nullptrs` easily, you could just use `boost::filter_iterator`.
Now, **this does not return default value on null pointer occurence**, but neither does OP's original code; instead it wraps the container and provides the API to silently skip it in the for loop.
I skipped all the boilerplat... |
67,587,342 | I'm trying to replace multiple column based on multiple conditions :
```
test=data.frame(
start=c(1,100,1000,10000),
end=c(10,110,1010,10010),
value=c(-1.2,-1.5,-1.02,-0.5),
substart=c(2,102,NA,NA),
subend=c(8,108,NA,NA)
)
If value is <= -1 and substart == NA :
I want that : substart = start and subend = en... | 2021/05/18 | [
"https://Stackoverflow.com/questions/67587342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6140391/"
] | There isn't really a good, idiomatic C++ solution that would exactly match what you're asking for.
A language where "EmptyIfNull" would work well, is probably one that has either garbage collection, or reference counted objects. So, we can achieve something similar in C++ by using reference counted pointers:
```
// n... | From the comments:
>
> One solution would be to implement a proxy range type containing a
> pointer. This type would provide the begin and end members which
> either forward the call to the pointed container or provide an empty
> range. The usage would be basically identical to using a NullOrEmpty
> function, in the ... |
67,587,342 | I'm trying to replace multiple column based on multiple conditions :
```
test=data.frame(
start=c(1,100,1000,10000),
end=c(10,110,1010,10010),
value=c(-1.2,-1.5,-1.02,-0.5),
substart=c(2,102,NA,NA),
subend=c(8,108,NA,NA)
)
If value is <= -1 and substart == NA :
I want that : substart = start and subend = en... | 2021/05/18 | [
"https://Stackoverflow.com/questions/67587342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6140391/"
] | Yes, but it's going to be ugly:
```
#include <stdio.h>
#include <variant>
template <class T>
struct Proxy {
private:
std::variant<T*, T> m_data = nullptr;
public:
Proxy(T* p) {
if (p)
m_data = p;
else
m_data = T{};
}
T* operator->() {
struct Visitor {
T* operator()(T* t) { r... | If you accept [`std::shared_ptr<T>`](https://en.cppreference.com/w/cpp/memory/shared_ptr), you could use them to achieve this in a rather save and portable way:
```
template<typename T>
std::shared_ptr<T> NullOrDefault(std::shared_ptr<T> value)
{
if(value != nullptr)
{
return value;
}
return st... |
67,587,342 | I'm trying to replace multiple column based on multiple conditions :
```
test=data.frame(
start=c(1,100,1000,10000),
end=c(10,110,1010,10010),
value=c(-1.2,-1.5,-1.02,-0.5),
substart=c(2,102,NA,NA),
subend=c(8,108,NA,NA)
)
If value is <= -1 and substart == NA :
I want that : substart = start and subend = en... | 2021/05/18 | [
"https://Stackoverflow.com/questions/67587342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6140391/"
] | Yes, but it's going to be ugly:
```
#include <stdio.h>
#include <variant>
template <class T>
struct Proxy {
private:
std::variant<T*, T> m_data = nullptr;
public:
Proxy(T* p) {
if (p)
m_data = p;
else
m_data = T{};
}
T* operator->() {
struct Visitor {
T* operator()(T* t) { r... | If you only want to skip over `nullptrs` easily, you could just use `boost::filter_iterator`.
Now, **this does not return default value on null pointer occurence**, but neither does OP's original code; instead it wraps the container and provides the API to silently skip it in the for loop.
I skipped all the boilerplat... |
67,587,342 | I'm trying to replace multiple column based on multiple conditions :
```
test=data.frame(
start=c(1,100,1000,10000),
end=c(10,110,1010,10010),
value=c(-1.2,-1.5,-1.02,-0.5),
substart=c(2,102,NA,NA),
subend=c(8,108,NA,NA)
)
If value is <= -1 and substart == NA :
I want that : substart = start and subend = en... | 2021/05/18 | [
"https://Stackoverflow.com/questions/67587342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6140391/"
] | Yes, but it's going to be ugly:
```
#include <stdio.h>
#include <variant>
template <class T>
struct Proxy {
private:
std::variant<T*, T> m_data = nullptr;
public:
Proxy(T* p) {
if (p)
m_data = p;
else
m_data = T{};
}
T* operator->() {
struct Visitor {
T* operator()(T* t) { r... | From the comments:
>
> One solution would be to implement a proxy range type containing a
> pointer. This type would provide the begin and end members which
> either forward the call to the pointed container or provide an empty
> range. The usage would be basically identical to using a NullOrEmpty
> function, in the ... |
6,427,724 | I have a piece of code that runs on a variety of databases. It simply runs a configurable sql query which returns a number of rows. From each row, i pull some text and a number to create a new object. Our latest client has decided to put all the text number combinations in a single row of the database i.e
```
text_1... | 2011/06/21 | [
"https://Stackoverflow.com/questions/6427724",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/167516/"
] | ```
SELECT
CASE row.id WHEN 1 THEN field1
WHEN 2 THEN field3
ELSE field5
END AS new_field_1,
CASE row.id WHEN 1 THEN field2
WHEN 2 THEN field4
ELSE field6
END AS ne... | You can create a function/SP to return a ResultSet the way you need. |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | Do something like this:
```
typedef std::map<std::string, std::string> InnerMap;
typedef std::map<std::string, InnerMap> OuterMap;
Outermap mm;
...//set the initial values
for (OuterMap::iterator i = mm.begin(); i != mm.end(); ++i) {
InnerMap &im = i->second;
for (InnerMap::iterator ii = im.begin(); ii != i... | C++11:
```
std::map< std::string, std::map<std::string, std::string> > m;
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "data2";
m["name3"]["value1"] = "data1";
m["name3"]["value2"] = "data2";
for (auto i : m)
for (auto j : i.second)
... |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | With C++17 (or later), you can use the "structured bindings" feature, which lets you define multiple variables, with different names, using a single tuple/pair. Example:
```
for (const auto& [name, description] : planet_descriptions) {
std::cout << "Planet " << name << ":\n" << description << "\n\n";
}
```
The [... | C++11:
```
std::map< std::string, std::map<std::string, std::string> > m;
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "data2";
m["name3"]["value1"] = "data1";
m["name3"]["value2"] = "data2";
for (auto i : m)
for (auto j : i.second)
... |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | You can use an iterator.
```
typedef std::map<std::string, std::map<std::string, std::string>>::iterator it_type;
for(it_type iterator = m.begin(); iterator != m.end(); iterator++) {
// iterator->first = key
// iterator->second = value
// Repeat if you also want to iterate through the second map.
}
``` | ```
for(std::map<std::string, std::map<std::string, std::string> >::iterator outer_iter=map.begin(); outer_iter!=map.end(); ++outer_iter) {
for(std::map<std::string, std::string>::iterator inner_iter=outer_iter->second.begin(); inner_iter!=outer_iter->second.end(); ++inner_iter) {
std::cout << inner_iter->s... |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | As *einpoklum* mentioned in [their answer](https://stackoverflow.com/a/39297926/2675154), since [C++17](https://en.wikipedia.org/wiki/C%2B%2B17) you can also use [structured binding declarations](https://en.cppreference.com/w/cpp/language/structured_binding). I want to extend on that by providing a full solution for it... | use `std::map< std::string, std::map<std::string, std::string> >::const_iterator` when map is const. |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | ```
for(std::map<std::string, std::map<std::string, std::string> >::iterator outer_iter=map.begin(); outer_iter!=map.end(); ++outer_iter) {
for(std::map<std::string, std::string>::iterator inner_iter=outer_iter->second.begin(); inner_iter!=outer_iter->second.end(); ++inner_iter) {
std::cout << inner_iter->s... | With C++17 (or later), you can use the "structured bindings" feature, which lets you define multiple variables, with different names, using a single tuple/pair. Example:
```
for (const auto& [name, description] : planet_descriptions) {
std::cout << "Planet " << name << ":\n" << description << "\n\n";
}
```
The [... |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | Do something like this:
```
typedef std::map<std::string, std::string> InnerMap;
typedef std::map<std::string, InnerMap> OuterMap;
Outermap mm;
...//set the initial values
for (OuterMap::iterator i = mm.begin(); i != mm.end(); ++i) {
InnerMap &im = i->second;
for (InnerMap::iterator ii = im.begin(); ii != i... | First solution is Use range\_based for loop, like:
Note: When `range_expression`’s type is `std::map` then a `range_declaration`’s type is `std::pair`.
```
for ( range_declaration : range_expression )
//loop_statement
```
**Code 1:**
```
typedef std::map<std::string, std::map<std::string, std::string>> Str... |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | You can use an iterator.
```
typedef std::map<std::string, std::map<std::string, std::string>>::iterator it_type;
for(it_type iterator = m.begin(); iterator != m.end(); iterator++) {
// iterator->first = key
// iterator->second = value
// Repeat if you also want to iterate through the second map.
}
``` | First solution is Use range\_based for loop, like:
Note: When `range_expression`’s type is `std::map` then a `range_declaration`’s type is `std::pair`.
```
for ( range_declaration : range_expression )
//loop_statement
```
**Code 1:**
```
typedef std::map<std::string, std::map<std::string, std::string>> Str... |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | Old question but the remaining answers are outdated as of C++11 - you can use a [ranged based for loop](http://en.cppreference.com/w/cpp/language/range-for) and simply do:
```
std::map<std::string, std::map<std::string, std::string>> mymap;
for(auto const &ent1 : mymap) {
// ent1.first is the first key
for(auto c... | ```
for(std::map<std::string, std::map<std::string, std::string> >::iterator outer_iter=map.begin(); outer_iter!=map.end(); ++outer_iter) {
for(std::map<std::string, std::string>::iterator inner_iter=outer_iter->second.begin(); inner_iter!=outer_iter->second.end(); ++inner_iter) {
std::cout << inner_iter->s... |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | Old question but the remaining answers are outdated as of C++11 - you can use a [ranged based for loop](http://en.cppreference.com/w/cpp/language/range-for) and simply do:
```
std::map<std::string, std::map<std::string, std::string>> mymap;
for(auto const &ent1 : mymap) {
// ent1.first is the first key
for(auto c... | Do something like this:
```
typedef std::map<std::string, std::string> InnerMap;
typedef std::map<std::string, InnerMap> OuterMap;
Outermap mm;
...//set the initial values
for (OuterMap::iterator i = mm.begin(); i != mm.end(); ++i) {
InnerMap &im = i->second;
for (InnerMap::iterator ii = im.begin(); ii != i... |
4,844,886 | How can I loop through a `std::map` in C++? My map is defined as:
```
std::map< std::string, std::map<std::string, std::string> >
```
For example, the above container holds data like this:
```
m["name1"]["value1"] = "data1";
m["name1"]["value2"] = "data2";
m["name2"]["value1"] = "data1";
m["name2"]["value2"] = "dat... | 2011/01/30 | [
"https://Stackoverflow.com/questions/4844886",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/354012/"
] | With C++17 (or later), you can use the "structured bindings" feature, which lets you define multiple variables, with different names, using a single tuple/pair. Example:
```
for (const auto& [name, description] : planet_descriptions) {
std::cout << "Planet " << name << ":\n" << description << "\n\n";
}
```
The [... | As *einpoklum* mentioned in [their answer](https://stackoverflow.com/a/39297926/2675154), since [C++17](https://en.wikipedia.org/wiki/C%2B%2B17) you can also use [structured binding declarations](https://en.cppreference.com/w/cpp/language/structured_binding). I want to extend on that by providing a full solution for it... |
26,615,834 | I trying to make a do while loop that will keep looping till x either equals y or x equals 7
Here's the code:
```
else if(y == 4 || y == 5 || y == 6 || y == 8 || y == 9 || y == 10){
System.out.println("Value point is: " + y);
int x = rollDice();
do{
System.out.println("Roll again: " + rollDice());... | 2014/10/28 | [
"https://Stackoverflow.com/questions/26615834",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4166775/"
] | *EDIT:*
Please change the loop to this:
```
do{
x = rollDice();
System.out.println("Roll again: " + x);
}
while(x != y && x != 7);
```
You should only call rollDice() once per iteration. You were calling it 3 times each go-round. Also, the || needed to be changed to &&. | It sounds like where you wrote
```
x != y || rollDice() != 7
```
you wanted
```
x != y && x != 7
```
(If you said you wanted to loop until "x either equals y or x equals 7", then you really want &&, not ||, in your condition.) |
5,041,725 | How to get value from datagridview combobox after selected value is changed? | 2011/02/18 | [
"https://Stackoverflow.com/questions/5041725",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can use:
```
var value = DataGridView.Rows[0].Cells[0].Value
```
NOTE: You would supply the correct row and cell number.
Or you can do something like this if it is bound to an object like ListItem
```
string value = DataGridView.Rows[RowIndex].Cells[ColumnIndex].Value.ToString();
if DataGridView.Rows[RowIndex... | Do not pass to give column name
```
string SelectedText = Convert.ToString((Pass_dataGridView.Rows[0].Cells["Partner"] as DataGridViewComboBoxCell).FormattedValue.ToString());
``` |
304,543 | Is there a 2 dimensional Riemannian manifold $M$ whose curvature is not negative but its geodesic flow is an ergodic flow? | 2018/07/08 | [
"https://mathoverflow.net/questions/304543",
"https://mathoverflow.net",
"https://mathoverflow.net/users/36688/"
] | It was proved by [Donnay](https://mathscinet.ams.org/mathscinet-getitem?mr=970551) that any compact orientable surface can be given a Riemannian metric for which the geodesic flow is ergodic. See [Theorem 1 of this article.](https://link.springer.com/chapter/10.1007%2FBFb0082827) On the other hand, there are no negativ... | Anosov flows are ergodic and a geodesic flow can be Anosov even if the curvature is not strictly negative. This was studied by Eberlein in the seventies, in an article from 1973 entitled *when is a geodesic flow of Anosov type?* and other authors (Klingenberg etc).
A byproduct of this study is the following: on a nonp... |
45,957,026 | I'm writing an application with django and I want to use mongoDB as my database. I have searched around a lot and found mongoengine and Pymongo as possible choices. I have decided to got with PyMongo for the time being. But the thing is that I am unable to connect my app to mongoDB. I have tried following so far:
```
... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45957026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5446435/"
] | Pymongo is not an ORM, is a driver, contains functions tools, to work with MongoDB.
Mongoengine it's a "*Document-Object Mapper (think ORM, but for document databases)*" based on pymongo. That is a better choice since you will use an 'ORM', similar with Django relational ORM.
In my opinion, [django-mongoengine](https... | The Django ORM supports relational databases only, and MongoDB is not a relational database. Therefore, in theory it can't be supported by Django.
Despite that, there exist custom backends such as [mongodb-engine](https://github.com/django-nonrel/mongodb-engine), which pretend to Django that MongoDB is relational. Thi... |
45,957,026 | I'm writing an application with django and I want to use mongoDB as my database. I have searched around a lot and found mongoengine and Pymongo as possible choices. I have decided to got with PyMongo for the time being. But the thing is that I am unable to connect my app to mongoDB. I have tried following so far:
```
... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45957026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5446435/"
] | **How can I connect my django app to mongoDB and use mongoDB as my Django Backend:**
First install djongo:
`pip install djongo`
Then run your migrations:
```
manage.py make migrations
manage.py migrate
```
and finally add to your settings file:
```
DATABASES = {
‘default’: {
‘ENGINE’: ‘djongo’,
‘N... | The Django ORM supports relational databases only, and MongoDB is not a relational database. Therefore, in theory it can't be supported by Django.
Despite that, there exist custom backends such as [mongodb-engine](https://github.com/django-nonrel/mongodb-engine), which pretend to Django that MongoDB is relational. Thi... |
45,957,026 | I'm writing an application with django and I want to use mongoDB as my database. I have searched around a lot and found mongoengine and Pymongo as possible choices. I have decided to got with PyMongo for the time being. But the thing is that I am unable to connect my app to mongoDB. I have tried following so far:
```
... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45957026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5446435/"
] | Pymongo is not an ORM, is a driver, contains functions tools, to work with MongoDB.
Mongoengine it's a "*Document-Object Mapper (think ORM, but for document databases)*" based on pymongo. That is a better choice since you will use an 'ORM', similar with Django relational ORM.
In my opinion, [django-mongoengine](https... | As a less convenient (not auto-plugged to django's features) but valid way, you could deploy MongoDB as a standalone locally on your computer or on a remote server.
Then, initiate the PyMongo object with the URL of your mongoDB service to interface with.
This way you use DB calls outside of Django's features, but str... |
45,957,026 | I'm writing an application with django and I want to use mongoDB as my database. I have searched around a lot and found mongoengine and Pymongo as possible choices. I have decided to got with PyMongo for the time being. But the thing is that I am unable to connect my app to mongoDB. I have tried following so far:
```
... | 2017/08/30 | [
"https://Stackoverflow.com/questions/45957026",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5446435/"
] | **How can I connect my django app to mongoDB and use mongoDB as my Django Backend:**
First install djongo:
`pip install djongo`
Then run your migrations:
```
manage.py make migrations
manage.py migrate
```
and finally add to your settings file:
```
DATABASES = {
‘default’: {
‘ENGINE’: ‘djongo’,
‘N... | As a less convenient (not auto-plugged to django's features) but valid way, you could deploy MongoDB as a standalone locally on your computer or on a remote server.
Then, initiate the PyMongo object with the URL of your mongoDB service to interface with.
This way you use DB calls outside of Django's features, but str... |
57,144,771 | Assume we have a method like this
```
public static void method(string param)
{
** critical section **
// There are a lot of methods calls
// switch cases
// if conditions
// read and write in dictionary
// new class initiations
** critical section **
}
```
how we can make it `threa... | 2019/07/22 | [
"https://Stackoverflow.com/questions/57144771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6071729/"
] | A lot of questions have been asked, but I will try to address all of them.
>
> How we can make it thread safe while thousand of concurrent calls happen?
>
>
>
To make a method entirely thread safe, you can write it so that it has no [side-effects](https://en.wikipedia.org/wiki/Side_effect_(computer_science)). A m... | Here is an example. The `_sharedString` may be accessed by two functions, `MethodAdd` and `MethodDelete` which may be called from different threads. To ensure that access to the `_sharedString` is serialized, that is, one thread at a time, we typically create a lock object, and then use the C# `lock` keyword to get exc... |
57,144,771 | Assume we have a method like this
```
public static void method(string param)
{
** critical section **
// There are a lot of methods calls
// switch cases
// if conditions
// read and write in dictionary
// new class initiations
** critical section **
}
```
how we can make it `threa... | 2019/07/22 | [
"https://Stackoverflow.com/questions/57144771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6071729/"
] | The response by @romen is useful in discussing the overall ideas. In terms of concretely doing the locking, let's look at a few different situations and solutions. I'm assuming that we are using C# here. In addition I will generally take the perspective of writing a class that needs to use locking within itself to make... | Here is an example. The `_sharedString` may be accessed by two functions, `MethodAdd` and `MethodDelete` which may be called from different threads. To ensure that access to the `_sharedString` is serialized, that is, one thread at a time, we typically create a lock object, and then use the C# `lock` keyword to get exc... |
57,144,771 | Assume we have a method like this
```
public static void method(string param)
{
** critical section **
// There are a lot of methods calls
// switch cases
// if conditions
// read and write in dictionary
// new class initiations
** critical section **
}
```
how we can make it `threa... | 2019/07/22 | [
"https://Stackoverflow.com/questions/57144771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6071729/"
] | >
> Is Lock or Mutex faster?
>
>
>
```
using System;
using System.Diagnostics;
using System.Threading;
namespace LockingTest
{
class Program
{
public static object locker = new object();
public static Mutex mutex = new Mutex();
public static ManualResetEvent manualResetEvent = new ... | Here is an example. The `_sharedString` may be accessed by two functions, `MethodAdd` and `MethodDelete` which may be called from different threads. To ensure that access to the `_sharedString` is serialized, that is, one thread at a time, we typically create a lock object, and then use the C# `lock` keyword to get exc... |
57,144,771 | Assume we have a method like this
```
public static void method(string param)
{
** critical section **
// There are a lot of methods calls
// switch cases
// if conditions
// read and write in dictionary
// new class initiations
** critical section **
}
```
how we can make it `threa... | 2019/07/22 | [
"https://Stackoverflow.com/questions/57144771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6071729/"
] | I am taking the liberty of adding a second answer as it now appears that a key part of the question was how to cancel a lock (i.e. release it after a few seconds).
However, it doesn't make sense to cancel a lock (from "outside" of the lock) without cancelling the work that is being done inside the lock. If you do not ... | Here is an example. The `_sharedString` may be accessed by two functions, `MethodAdd` and `MethodDelete` which may be called from different threads. To ensure that access to the `_sharedString` is serialized, that is, one thread at a time, we typically create a lock object, and then use the C# `lock` keyword to get exc... |
57,144,771 | Assume we have a method like this
```
public static void method(string param)
{
** critical section **
// There are a lot of methods calls
// switch cases
// if conditions
// read and write in dictionary
// new class initiations
** critical section **
}
```
how we can make it `threa... | 2019/07/22 | [
"https://Stackoverflow.com/questions/57144771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6071729/"
] | >
> Is Lock or Mutex faster?
>
>
>
```
using System;
using System.Diagnostics;
using System.Threading;
namespace LockingTest
{
class Program
{
public static object locker = new object();
public static Mutex mutex = new Mutex();
public static ManualResetEvent manualResetEvent = new ... | A lot of questions have been asked, but I will try to address all of them.
>
> How we can make it thread safe while thousand of concurrent calls happen?
>
>
>
To make a method entirely thread safe, you can write it so that it has no [side-effects](https://en.wikipedia.org/wiki/Side_effect_(computer_science)). A m... |
57,144,771 | Assume we have a method like this
```
public static void method(string param)
{
** critical section **
// There are a lot of methods calls
// switch cases
// if conditions
// read and write in dictionary
// new class initiations
** critical section **
}
```
how we can make it `threa... | 2019/07/22 | [
"https://Stackoverflow.com/questions/57144771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6071729/"
] | I am taking the liberty of adding a second answer as it now appears that a key part of the question was how to cancel a lock (i.e. release it after a few seconds).
However, it doesn't make sense to cancel a lock (from "outside" of the lock) without cancelling the work that is being done inside the lock. If you do not ... | A lot of questions have been asked, but I will try to address all of them.
>
> How we can make it thread safe while thousand of concurrent calls happen?
>
>
>
To make a method entirely thread safe, you can write it so that it has no [side-effects](https://en.wikipedia.org/wiki/Side_effect_(computer_science)). A m... |
57,144,771 | Assume we have a method like this
```
public static void method(string param)
{
** critical section **
// There are a lot of methods calls
// switch cases
// if conditions
// read and write in dictionary
// new class initiations
** critical section **
}
```
how we can make it `threa... | 2019/07/22 | [
"https://Stackoverflow.com/questions/57144771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6071729/"
] | >
> Is Lock or Mutex faster?
>
>
>
```
using System;
using System.Diagnostics;
using System.Threading;
namespace LockingTest
{
class Program
{
public static object locker = new object();
public static Mutex mutex = new Mutex();
public static ManualResetEvent manualResetEvent = new ... | The response by @romen is useful in discussing the overall ideas. In terms of concretely doing the locking, let's look at a few different situations and solutions. I'm assuming that we are using C# here. In addition I will generally take the perspective of writing a class that needs to use locking within itself to make... |
57,144,771 | Assume we have a method like this
```
public static void method(string param)
{
** critical section **
// There are a lot of methods calls
// switch cases
// if conditions
// read and write in dictionary
// new class initiations
** critical section **
}
```
how we can make it `threa... | 2019/07/22 | [
"https://Stackoverflow.com/questions/57144771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6071729/"
] | I am taking the liberty of adding a second answer as it now appears that a key part of the question was how to cancel a lock (i.e. release it after a few seconds).
However, it doesn't make sense to cancel a lock (from "outside" of the lock) without cancelling the work that is being done inside the lock. If you do not ... | The response by @romen is useful in discussing the overall ideas. In terms of concretely doing the locking, let's look at a few different situations and solutions. I'm assuming that we are using C# here. In addition I will generally take the perspective of writing a class that needs to use locking within itself to make... |
7,635,482 | I have an iPhone application that is based on social networking. I have integrated flurry analytics into it. Now, there is a limitation to the information that my client can send to flurry and I want some other information also to be tracked and only my server can provide thatinformation. Can I integrate them both into... | 2011/10/03 | [
"https://Stackoverflow.com/questions/7635482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2227101/"
] | You should implement this method to know if the user has just pressed the *return key* (that key is called *"return key"*), and don't forget to *return YES* from this method.
```
- (BOOL)textFieldShouldReturn:(UITextField*)textField {
``` | You can set a delegate on your `UITextField` : [UITextFieldDelegate](http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UITextFieldDelegate_Protocol/UITextFieldDelegate/UITextFieldDelegate.html)
Then this method is there for you :
```
- (BOOL)textFieldShouldReturn:(UITextField *)textField
``` |
7,635,482 | I have an iPhone application that is based on social networking. I have integrated flurry analytics into it. Now, there is a limitation to the information that my client can send to flurry and I want some other information also to be tracked and only my server can provide thatinformation. Can I integrate them both into... | 2011/10/03 | [
"https://Stackoverflow.com/questions/7635482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2227101/"
] | You should implement this method to know if the user has just pressed the *return key* (that key is called *"return key"*), and don't forget to *return YES* from this method.
```
- (BOOL)textFieldShouldReturn:(UITextField*)textField {
``` | You should implement next methods in your UITextFieldDelegate class:
*Tells the delegate that editing stopped for the specified text field.*
```
- (void)textFieldDidEndEditing:(UITextField *)textField;
```
*Asks the delegate if the text field should process the pressing of the return button.*
```
- (BOOL)textField... |
7,635,482 | I have an iPhone application that is based on social networking. I have integrated flurry analytics into it. Now, there is a limitation to the information that my client can send to flurry and I want some other information also to be tracked and only my server can provide thatinformation. Can I integrate them both into... | 2011/10/03 | [
"https://Stackoverflow.com/questions/7635482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2227101/"
] | set the delegate of the UITextFieldDelegate ViewController(.h file) class and impliment following method in viewController (.m file) class.
```
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return NO;
}
```
It will work.. | You can set a delegate on your `UITextField` : [UITextFieldDelegate](http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UITextFieldDelegate_Protocol/UITextFieldDelegate/UITextFieldDelegate.html)
Then this method is there for you :
```
- (BOOL)textFieldShouldReturn:(UITextField *)textField
``` |
7,635,482 | I have an iPhone application that is based on social networking. I have integrated flurry analytics into it. Now, there is a limitation to the information that my client can send to flurry and I want some other information also to be tracked and only my server can provide thatinformation. Can I integrate them both into... | 2011/10/03 | [
"https://Stackoverflow.com/questions/7635482",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2227101/"
] | set the delegate of the UITextFieldDelegate ViewController(.h file) class and impliment following method in viewController (.m file) class.
```
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return NO;
}
```
It will work.. | You should implement next methods in your UITextFieldDelegate class:
*Tells the delegate that editing stopped for the specified text field.*
```
- (void)textFieldDidEndEditing:(UITextField *)textField;
```
*Asks the delegate if the text field should process the pressing of the return button.*
```
- (BOOL)textField... |
43,974,382 | Here is my query:
```
User::with([
'roles' => function ($query) {
$query->select('id AS value', 'display_name AS label');
}
])->with([
'followers' => function ($query) {
$query->select('id', 'user_id');
}
])->find($id);
```
This is what is executed in m... | 2017/05/15 | [
"https://Stackoverflow.com/questions/43974382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7477397/"
] | In `with()` function query use `addSelect` instaead select because when you use select other selection remove
try that hope it's help | Into your `with` method from your closures, you should return the Query instance.
Also, if the rendered MySQL query doesn't match what you expect so I think that there is an error with your relationships and/or your MySQL query. |
38,485,123 | ```
>>> class A:
... def foo(self):
... print(self)
...
>>>
>>> a = A()
>>> a.foo()
<__main__.A instance at 0x7f4399136cb0>
>>> def foo(self):
... print(self)
...
>>> a.foo = foo
>>> a.foo()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: foo() takes exactly 1 arg... | 2016/07/20 | [
"https://Stackoverflow.com/questions/38485123",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3646408/"
] | As described in [this SO answer](https://stackoverflow.com/questions/972/adding-a-method-to-an-existing-object-instance), you need to use `types.MethodType` or something similar when doing this, e.g.:
```
a.foo = types.MethodType(foo, a)
```
The reason is that `a.foo = foo` just sets the function `foo` as an attribu... | So the tricky thing here is that what you get depends on where the method lives:
```
class A(object):
def foo(self):
print("Hello world")
def patch(self):
print("patched!")
print(type(A.foo))
a = A()
print(type(a.foo))
```
If you run this, you'll get different results on python2.x and 3.x:
```
$ p... |
19,516,645 | Please, find below my schema:
```
CREATE TABLE reps (
id SERIAL PRIMARY KEY,
rep TEXT NOT NULL UNIQUE
);
CREATE TABLE terms (
id SERIAL PRIMARY KEY,
terms TEXT NOT NULL UNIQUE
);
CREATE TABLE shipVia (
id SERIAL PRIMARY KEY,
ship_via TEXT NOT NULL UNIQUE
);
CREATE TABLE invoices (
id ... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19516645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80002/"
] | PostgreSQL has such an extended interpretation of the `VALUES` clause that it may be used as a subquery by itself.
So you may express your query in this form:
```
WITH new_invoice AS (
INSERT INTO ...
RETURNING id
),
v(a,b,c,d) AS (values
($27,$28,$29,$30),
($31,$32,$33,$34),
...
)
INSERT INTO invoiceIt... | Instead of insert ... values ...., use insert ... select ...:
```
) INSERT INTO invoiceItems (invoice_id, name, qty, price, description)
SELECT new_invoice.id,$27,$28,$29,$30 FROM new_invoice
UNION ALL
...
``` |
19,516,645 | Please, find below my schema:
```
CREATE TABLE reps (
id SERIAL PRIMARY KEY,
rep TEXT NOT NULL UNIQUE
);
CREATE TABLE terms (
id SERIAL PRIMARY KEY,
terms TEXT NOT NULL UNIQUE
);
CREATE TABLE shipVia (
id SERIAL PRIMARY KEY,
ship_via TEXT NOT NULL UNIQUE
);
CREATE TABLE invoices (
id ... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19516645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80002/"
] | ```
WITH new_invoice AS (
INSERT INTO invoices ...
RETURNING id
)
INSERT INTO invoiceItems (invoice_id, name, qty, price, description)
VALUES ((select id from new_invoice), $27 , $28, $29, $30),
((select id from new_invoice), $31 , $32, $33, $34),
((select id from new_invoice), $35 , $36, $37... | Instead of insert ... values ...., use insert ... select ...:
```
) INSERT INTO invoiceItems (invoice_id, name, qty, price, description)
SELECT new_invoice.id,$27,$28,$29,$30 FROM new_invoice
UNION ALL
...
``` |
19,516,645 | Please, find below my schema:
```
CREATE TABLE reps (
id SERIAL PRIMARY KEY,
rep TEXT NOT NULL UNIQUE
);
CREATE TABLE terms (
id SERIAL PRIMARY KEY,
terms TEXT NOT NULL UNIQUE
);
CREATE TABLE shipVia (
id SERIAL PRIMARY KEY,
ship_via TEXT NOT NULL UNIQUE
);
CREATE TABLE invoices (
id ... | 2013/10/22 | [
"https://Stackoverflow.com/questions/19516645",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/80002/"
] | PostgreSQL has such an extended interpretation of the `VALUES` clause that it may be used as a subquery by itself.
So you may express your query in this form:
```
WITH new_invoice AS (
INSERT INTO ...
RETURNING id
),
v(a,b,c,d) AS (values
($27,$28,$29,$30),
($31,$32,$33,$34),
...
)
INSERT INTO invoiceIt... | ```
WITH new_invoice AS (
INSERT INTO invoices ...
RETURNING id
)
INSERT INTO invoiceItems (invoice_id, name, qty, price, description)
VALUES ((select id from new_invoice), $27 , $28, $29, $30),
((select id from new_invoice), $31 , $32, $33, $34),
((select id from new_invoice), $35 , $36, $37... |
11,300,528 | I want to enable a checkbox if the text field has the valid coordinates but it will not work as I want it to work. I'm asking you know, what have I done wrong?
[Demo at jsFiddle](http://jsfiddle.net/S8r8u/10/).
Thanks in advance. | 2012/07/02 | [
"https://Stackoverflow.com/questions/11300528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/718990/"
] | 1. Event types are separated by space not commas
2. I replaced the RegExp constructor with the alternate declaration and it works. Not completely sure why.
<http://jsfiddle.net/S8r8u/31/> | I'm not sure on the RegExp. It doesn't seem to be matching but your event won't fire because the jQuery syntax for multiple events is separation by space not comma.
```
$('input[name="textfield-coordinates"]').on('keyup change paste', function() {
});
```
[jQuery on method](http://api.jquery.com/on/) |
2,819,600 | Environment: VS2005 C++ using STLPort 5.1.4.
Compiling the following code snippet:
```
std::string copied = "asdf";
char ch = 's';
copied.insert(0,1,ch);
```
I receive an error:
```
Error 1 error C2668: 'stlpx_std::basic_string<_CharT,_Traits,_Alloc>::insert' : ambiguous call to overloaded function
```
It... | 2010/05/12 | [
"https://Stackoverflow.com/questions/2819600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3529/"
] | Known issue, ruled "Not A Defect". <http://std.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#84> | If you differentiate the differents integers type, there is no ambiguity *at all*.
Good practices commands to store buffer sizes in `size_t` (or `ssize_t`) types, not `int`.
If you agree with that, calling `insert(int, int, char)` makes no sense since the two first arguments are supposed to be a "buffer sizes".
If t... |
2,819,600 | Environment: VS2005 C++ using STLPort 5.1.4.
Compiling the following code snippet:
```
std::string copied = "asdf";
char ch = 's';
copied.insert(0,1,ch);
```
I receive an error:
```
Error 1 error C2668: 'stlpx_std::basic_string<_CharT,_Traits,_Alloc>::insert' : ambiguous call to overloaded function
```
It... | 2010/05/12 | [
"https://Stackoverflow.com/questions/2819600",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3529/"
] | Known issue, ruled "Not A Defect". <http://std.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#84> | Intentional or not, the problem has more to do with the semantics of `0` than the member functions in question. Perhaps the Microsoft library's designers (they used Dinkumware last time I checked) were more cautious in this respect. |
40,729,599 | I'd like to increase my knowledge of generics and I come to a problem I can't solve. I have two different types (`Int` and `Double`). Both types implement a function `advanced(by:)`. I want to make a generic function to call `advanced(by:)` on a given type.
The benefit would be so that I could replace `intAdvancedByTe... | 2016/11/21 | [
"https://Stackoverflow.com/questions/40729599",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4502544/"
] | >
> After I added new package into system.config.js file, the app runs but "npm test" failed
>
>
>
I'm assuming you are using Karma. What you need to do is add that third-party lib to the `files` array in the `karma.conf.js` file.
How it works is that karma starts a server, and adds all the files listed in the `f... | You should try angular-cli which is the recommended way to work with angular2.
To create a new project you have to install angular-cli with the command
```
npm install -g angular-cli
```
then you can create a new angular2 project with
```
ng new your-new-project-name
```
and finally to add a new global dependency... |
50,390,534 | I am using `firebase` phone auth in react native app with this [docs](https://rnfirebase.io/), I tested it in some different devices. sometimes the phone `auth` works and sometimes it throws this error
>
> firebase phone auth Error: Invalid token. at nativeToJSError
>
>
>
 instead of certificates
Hope you find it helpful. | I think this can happen if the bundle id of the app trying to access firebase doesn't match the bundle id registered in the firebase console. |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | I had same problem.... the problem is that plutil is not in any of the directories in PATH.
My solution was to make a copy from /usr/bin to /user/local/bin which is in the PATH.
No idea if the problem is Xcode, OS X or Apple. | I have gone over the answers provided and none of them worked for me. The problem persisted.
I looked carefully at the error in xcode and notice that it was looking for the image in the wrong place. In my case I had copied and renamed the directory containing my project. None of the references to my images were update... |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | Your PATH variable is screwed up for some reason. You want to look into how exactly that happened. This is yours (colon-separated for emphasis):
```
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
:/Developer/usr/bin
:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
```
T... | I had same problem.... the problem is that plutil is not in any of the directories in PATH.
My solution was to make a copy from /usr/bin to /user/local/bin which is in the PATH.
No idea if the problem is Xcode, OS X or Apple. |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | Your PATH variable is screwed up for some reason. You want to look into how exactly that happened. This is yours (colon-separated for emphasis):
```
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
:/Developer/usr/bin
:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
```
T... | I have gone over the answers provided and none of them worked for me. The problem persisted.
I looked carefully at the error in xcode and notice that it was looking for the image in the wrong place. In my case I had copied and renamed the directory containing my project. None of the references to my images were update... |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | I had same problem.... the problem is that plutil is not in any of the directories in PATH.
My solution was to make a copy from /usr/bin to /user/local/bin which is in the PATH.
No idea if the problem is Xcode, OS X or Apple. | this error will also show if you deleted a file via finder (not in xcode) then try to archive. So make sure that none of your files are listed in red and if they are remove it from your project. |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | Your PATH variable is screwed up for some reason. You want to look into how exactly that happened. This is yours (colon-separated for emphasis):
```
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
:/Developer/usr/bin
:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
```
T... | `plutil` usually resides in `/usr/bin`. Make sure it's there. If it's not, you may have installed your Developer Tools without unchecking (or with unchecking) the System Tools checkbox, which puts the base Mac OS X programmer tools into /usr. |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | Is it possible that your path environment variable is not set somehow?
You have:
>
> setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
> /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources... | `plutil` usually resides in `/usr/bin`. Make sure it's there. If it's not, you may have installed your Developer Tools without unchecking (or with unchecking) the System Tools checkbox, which puts the base Mac OS X programmer tools into /usr. |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | Is it possible that your path environment variable is not set somehow?
You have:
>
> setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
> /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources... | this error will also show if you deleted a file via finder (not in xcode) then try to archive. So make sure that none of your files are listed in red and if they are remove it from your project. |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | I had same problem.... the problem is that plutil is not in any of the directories in PATH.
My solution was to make a copy from /usr/bin to /user/local/bin which is in the PATH.
No idea if the problem is Xcode, OS X or Apple. | I've seen this error before. The issue lies in a corrupted .png file. The error is pretty deceiving. Try deleting the affected .png and replace it back in your project from a backup or clean version of that file. That should clear up the build errors. |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | Is it possible that your path environment variable is not set somehow?
You have:
>
> setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
> /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources... | I have gone over the answers provided and none of them worked for me. The problem persisted.
I looked carefully at the error in xcode and notice that it was looking for the image in the wrong place. In my case I had copied and renamed the directory containing my project. None of the references to my images were update... |
3,020,113 | I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?
```
Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not fo... | 2010/06/11 | [
"https://Stackoverflow.com/questions/3020113",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/133209/"
] | Is it possible that your path environment variable is not set somehow?
You have:
>
> setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
> /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources... | Tried reinstalling the SDK? |
11,768,223 | I have performed Closing morphological operation and I am getting different result with the C and C++ API (OpenCV 2.4.2)
Input:
[](https://i.stack.imgur.com/WX7Mt.png)
**With OpenCV 'C':**
```
//Set ROI
//Perform Gaussian smoothing
//Perform Canny edge analysis
cvMorphol... | 2012/08/01 | [
"https://Stackoverflow.com/questions/11768223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1449669/"
] | Thank you everybody for answering this question. I have found my error. I am going to describe it in brief below. Hope it helps others facing this problem.
1) I had executed the C and C++ commands on a ROI image. Apparently, the way OpenCV 'C' and 'C++' API treat ROI is different.
2) In 'C', a ROI is treated as a com... | The defaults are not the same between C and C++ - especially the structuring element.
In C: the default structuring element is:
`cvCreateStructuringElementEx(3, 3, 1, 1, CV_SHAPE_RECT)`
whereas in C++, the default structuring element is:
`getStructuringElement(MORPH_RECT, Size(1+iterations*2,1+iterations*2));`
Yo... |
11,768,223 | I have performed Closing morphological operation and I am getting different result with the C and C++ API (OpenCV 2.4.2)
Input:
[](https://i.stack.imgur.com/WX7Mt.png)
**With OpenCV 'C':**
```
//Set ROI
//Perform Gaussian smoothing
//Perform Canny edge analysis
cvMorphol... | 2012/08/01 | [
"https://Stackoverflow.com/questions/11768223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1449669/"
] | Thank you everybody for answering this question. I have found my error. I am going to describe it in brief below. Hope it helps others facing this problem.
1) I had executed the C and C++ commands on a ROI image. Apparently, the way OpenCV 'C' and 'C++' API treat ROI is different.
2) In 'C', a ROI is treated as a com... | Check out this **[sample code](http://docs.opencv.org/2.4.2/doc/tutorials/imgproc/opening_closing_hats/opening_closing_hats.html#code)** from the OpenCV v2.4.2 documentation. You might also want to check **[this code](http://docs.opencv.org/2.4.2/doc/tutorials/imgproc/imgtrans/canny_detector/canny_detector.html#code)**... |
915,207 | I have a need for a tool that would monitor and more importantly log requests on IIS. This tool would have to report basic info about requests such as date/time of request, time spent for request, kbytes transferred... etc
What do you people use for such monitoring? | 2009/05/27 | [
"https://Stackoverflow.com/questions/915207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/112132/"
] | You can use IIS's log files and read them using [Log Parser](http://www.microsoft.com/DownLoads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en) (free download from MS).
In response to comment: the format of the IIS log file can be found here: [IIS Log File Format (IIS 6.0)](http://www.micros... | IIS Log files + log analysers.
Log analysers like [webtrends](http://www.webtrends.com/) will give you a lot of information. |
915,207 | I have a need for a tool that would monitor and more importantly log requests on IIS. This tool would have to report basic info about requests such as date/time of request, time spent for request, kbytes transferred... etc
What do you people use for such monitoring? | 2009/05/27 | [
"https://Stackoverflow.com/questions/915207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/112132/"
] | You should extend and add all of the IIS properties you want to log.
To do this, do the following:
1. Go into IIS
2. Select properties on
your website.
3. Under the website tab,
choose properties in the logging
section.
4. Select the Extended
Properties tab.
5. Select extended
properties
6. Select all of the
it... | You can use IIS's log files and read them using [Log Parser](http://www.microsoft.com/DownLoads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en) (free download from MS).
In response to comment: the format of the IIS log file can be found here: [IIS Log File Format (IIS 6.0)](http://www.micros... |
915,207 | I have a need for a tool that would monitor and more importantly log requests on IIS. This tool would have to report basic info about requests such as date/time of request, time spent for request, kbytes transferred... etc
What do you people use for such monitoring? | 2009/05/27 | [
"https://Stackoverflow.com/questions/915207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/112132/"
] | You can use IIS's log files and read them using [Log Parser](http://www.microsoft.com/DownLoads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en) (free download from MS).
In response to comment: the format of the IIS log file can be found here: [IIS Log File Format (IIS 6.0)](http://www.micros... | You have a look on Operations Manager from System Center family. - <http://www.microsoft.com/systemcenter/operationsmanager/en/us/default.aspx> |
915,207 | I have a need for a tool that would monitor and more importantly log requests on IIS. This tool would have to report basic info about requests such as date/time of request, time spent for request, kbytes transferred... etc
What do you people use for such monitoring? | 2009/05/27 | [
"https://Stackoverflow.com/questions/915207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/112132/"
] | You can use IIS's log files and read them using [Log Parser](http://www.microsoft.com/DownLoads/details.aspx?FamilyID=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en) (free download from MS).
In response to comment: the format of the IIS log file can be found here: [IIS Log File Format (IIS 6.0)](http://www.micros... | Please see the eginnovations IIS web server monitoring tool - <http://www.eginnovations.com/web/iismonitor.htm> |
915,207 | I have a need for a tool that would monitor and more importantly log requests on IIS. This tool would have to report basic info about requests such as date/time of request, time spent for request, kbytes transferred... etc
What do you people use for such monitoring? | 2009/05/27 | [
"https://Stackoverflow.com/questions/915207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/112132/"
] | You should extend and add all of the IIS properties you want to log.
To do this, do the following:
1. Go into IIS
2. Select properties on
your website.
3. Under the website tab,
choose properties in the logging
section.
4. Select the Extended
Properties tab.
5. Select extended
properties
6. Select all of the
it... | IIS Log files + log analysers.
Log analysers like [webtrends](http://www.webtrends.com/) will give you a lot of information. |
915,207 | I have a need for a tool that would monitor and more importantly log requests on IIS. This tool would have to report basic info about requests such as date/time of request, time spent for request, kbytes transferred... etc
What do you people use for such monitoring? | 2009/05/27 | [
"https://Stackoverflow.com/questions/915207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/112132/"
] | You should extend and add all of the IIS properties you want to log.
To do this, do the following:
1. Go into IIS
2. Select properties on
your website.
3. Under the website tab,
choose properties in the logging
section.
4. Select the Extended
Properties tab.
5. Select extended
properties
6. Select all of the
it... | You have a look on Operations Manager from System Center family. - <http://www.microsoft.com/systemcenter/operationsmanager/en/us/default.aspx> |
915,207 | I have a need for a tool that would monitor and more importantly log requests on IIS. This tool would have to report basic info about requests such as date/time of request, time spent for request, kbytes transferred... etc
What do you people use for such monitoring? | 2009/05/27 | [
"https://Stackoverflow.com/questions/915207",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/112132/"
] | You should extend and add all of the IIS properties you want to log.
To do this, do the following:
1. Go into IIS
2. Select properties on
your website.
3. Under the website tab,
choose properties in the logging
section.
4. Select the Extended
Properties tab.
5. Select extended
properties
6. Select all of the
it... | Please see the eginnovations IIS web server monitoring tool - <http://www.eginnovations.com/web/iismonitor.htm> |
8,582,565 | I am learning visual basic .net and I am attempting to translate some java source code to a vb.net project. The project reads mp3 details and then splits the file accurately according to the frameheader details etc.
My question relates to reading the frame header of mp3 files. I understand that the frame details are c... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8582565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1108740/"
] | It's actually quite easy (and very useful) to turn this into a simple jQuery plugin. Like so:
JSFiddle: <http://jsfiddle.net/PPvG/huYRL/>
Note that I've added support for moving the slider by entering a value into the `#sliderValue`.
[ Code sample removed ]
You could also choose to remove `#sliderValue` from the HT... | It would be nice to take a look at alternative solutions with jQuery plugins such as:
* <http://craigsworks.com/projects/qtip2/demos/#ui-slider>
* <http://www.filamentgroup.com/lab/update_jquery_ui_slider_from_a_select_element_now_with_aria_support/> |
8,582,565 | I am learning visual basic .net and I am attempting to translate some java source code to a vb.net project. The project reads mp3 details and then splits the file accurately according to the frameheader details etc.
My question relates to reading the frame header of mp3 files. I understand that the frame details are c... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8582565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1108740/"
] | It's actually quite easy (and very useful) to turn this into a simple jQuery plugin. Like so:
JSFiddle: <http://jsfiddle.net/PPvG/huYRL/>
Note that I've added support for moving the slider by entering a value into the `#sliderValue`.
[ Code sample removed ]
You could also choose to remove `#sliderValue` from the HT... | You can just: <http://jsfiddle.net/z3xV3/21/>
```
$(document).ready(function() {
$("#slider").slider({
value:0,
min: 0,
max: 150,
step: 1,
range: 'min',
slide: function( event, ui ) {
var offsetLeft = $(this).find(".ui-slider-handle").offset().left;
... |
8,582,565 | I am learning visual basic .net and I am attempting to translate some java source code to a vb.net project. The project reads mp3 details and then splits the file accurately according to the frameheader details etc.
My question relates to reading the frame header of mp3 files. I understand that the frame details are c... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8582565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1108740/"
] | Here is a working example for a slider with two handles

```
$('#slider').slider({
range: true,
min: 500,
max: 10000,
step: 100,
values: [1000, 2000],
slide: function( event, ui ) {
$('#m... | Taking your jsfiddle.
HTML:
```
<div id="slider"></div>
<input id="sliderValue" />
```
CSS:
`#sliderValue{width:50px;}`
Jquery:
```
$(document).ready(function() {
// Pris slider
$("#slider").slider({value:'',min: 0,max: 150,step: 1, range: 'min',
slide: function( event, ui ) {
$( "#sliderValue" ).v... |
8,582,565 | I am learning visual basic .net and I am attempting to translate some java source code to a vb.net project. The project reads mp3 details and then splits the file accurately according to the frameheader details etc.
My question relates to reading the frame header of mp3 files. I understand that the frame details are c... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8582565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1108740/"
] | I have modifiered your jsfiddle example: <http://jsfiddle.net/Dr5UR/>
```
$("#amount").val("$" + $("#slider").slider({
slide: function(event, ui) {
$('#sliderValue').css('left', event.clientX).val(ui.value);
}
}));
```
I make use of the slide event of the [slider](http://jqueryui.com/demos/slider/#ev... | Taking your jsfiddle.
HTML:
```
<div id="slider"></div>
<input id="sliderValue" />
```
CSS:
`#sliderValue{width:50px;}`
Jquery:
```
$(document).ready(function() {
// Pris slider
$("#slider").slider({value:'',min: 0,max: 150,step: 1, range: 'min',
slide: function( event, ui ) {
$( "#sliderValue" ).v... |
8,582,565 | I am learning visual basic .net and I am attempting to translate some java source code to a vb.net project. The project reads mp3 details and then splits the file accurately according to the frameheader details etc.
My question relates to reading the frame header of mp3 files. I understand that the frame details are c... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8582565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1108740/"
] | It's actually quite easy (and very useful) to turn this into a simple jQuery plugin. Like so:
JSFiddle: <http://jsfiddle.net/PPvG/huYRL/>
Note that I've added support for moving the slider by entering a value into the `#sliderValue`.
[ Code sample removed ]
You could also choose to remove `#sliderValue` from the HT... | HTML:
```
<div id="slider"></div>
```
CSS:
```
#slider {
width: 200px;
}
#sliderValue {
position: absolute;
left: 0;
bottom: -30px;
width: 40px;
}
```
jQuery:
```
$("#slider").slider({
value: '',
min: 0,
max: 100,
range: 'min',
create: function (event, ui) {
$('.ui... |
8,582,565 | I am learning visual basic .net and I am attempting to translate some java source code to a vb.net project. The project reads mp3 details and then splits the file accurately according to the frameheader details etc.
My question relates to reading the frame header of mp3 files. I understand that the frame details are c... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8582565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1108740/"
] | HTML:
```
<div id="slider"></div>
```
CSS:
```
#slider {
width: 200px;
}
#sliderValue {
position: absolute;
left: 0;
bottom: -30px;
width: 40px;
}
```
jQuery:
```
$("#slider").slider({
value: '',
min: 0,
max: 100,
range: 'min',
create: function (event, ui) {
$('.ui... | It would be nice to take a look at alternative solutions with jQuery plugins such as:
* <http://craigsworks.com/projects/qtip2/demos/#ui-slider>
* <http://www.filamentgroup.com/lab/update_jquery_ui_slider_from_a_select_element_now_with_aria_support/> |
8,582,565 | I am learning visual basic .net and I am attempting to translate some java source code to a vb.net project. The project reads mp3 details and then splits the file accurately according to the frameheader details etc.
My question relates to reading the frame header of mp3 files. I understand that the frame details are c... | 2011/12/20 | [
"https://Stackoverflow.com/questions/8582565",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1108740/"
] | Here is a working example for a slider with two handles

```
$('#slider').slider({
range: true,
min: 500,
max: 10000,
step: 100,
values: [1000, 2000],
slide: function( event, ui ) {
$('#m... | You can just: <http://jsfiddle.net/z3xV3/21/>
```
$(document).ready(function() {
$("#slider").slider({
value:0,
min: 0,
max: 150,
step: 1,
range: 'min',
slide: function( event, ui ) {
var offsetLeft = $(this).find(".ui-slider-handle").offset().left;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.