qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
15,481,759 | I am trying to convert a nested JSON object on an ASP.NET server. The incoming JSON string looks something like this -
```js
data: {
user_id: 1,
taskid: "1234",
list: {
"item-1": { one: 1, two: 2 },
"item-2": { one: 1, two: 2 }
//.. where number of items is unknown
}
}
```
I have ... | 2013/03/18 | [
"https://Stackoverflow.com/questions/15481759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95055/"
] | Your example is not [valid json](http://jsonlint.com/). You should have a collection `[]` for list:
```
data: {
"user_id": 1,
"taskid": "1234",
"list": [
{
"one": 1,
"two": 2
},
{
"one": 1,
"two": 2
}
]
}
``` | You can try decoding the JSON into an array of Data objects, and then calling the ToList() extension method on that array.
```
var dataArray = JSON.Decode<Data[]>(Request["data"]);
var list = dataArray.ToList();
``` |
15,481,759 | I am trying to convert a nested JSON object on an ASP.NET server. The incoming JSON string looks something like this -
```js
data: {
user_id: 1,
taskid: "1234",
list: {
"item-1": { one: 1, two: 2 },
"item-2": { one: 1, two: 2 }
//.. where number of items is unknown
}
}
```
I have ... | 2013/03/18 | [
"https://Stackoverflow.com/questions/15481759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95055/"
] | ```
List<Data> decodedData = JSON.Decode<DataList>(Request["data"])
```
Should Be
```
var decodedData = JSON.Decode<List<Data>>(Request["data"])
var myDataList = new DataList() { data = decodedData; }
``` | The first error you are getting is quite right, your class `DataList` does not contain a definition for `GetEnumerator` which is required for a foreach statement. You will need to iterate over the property, so iterate over decodedData.data.
The second error is again correct, as you are trying to cast DataList to a typ... |
15,481,759 | I am trying to convert a nested JSON object on an ASP.NET server. The incoming JSON string looks something like this -
```js
data: {
user_id: 1,
taskid: "1234",
list: {
"item-1": { one: 1, two: 2 },
"item-2": { one: 1, two: 2 }
//.. where number of items is unknown
}
}
```
I have ... | 2013/03/18 | [
"https://Stackoverflow.com/questions/15481759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95055/"
] | The first error you are getting is quite right, your class `DataList` does not contain a definition for `GetEnumerator` which is required for a foreach statement. You will need to iterate over the property, so iterate over decodedData.data.
The second error is again correct, as you are trying to cast DataList to a typ... | You can try decoding the JSON into an array of Data objects, and then calling the ToList() extension method on that array.
```
var dataArray = JSON.Decode<Data[]>(Request["data"]);
var list = dataArray.ToList();
``` |
15,481,759 | I am trying to convert a nested JSON object on an ASP.NET server. The incoming JSON string looks something like this -
```js
data: {
user_id: 1,
taskid: "1234",
list: {
"item-1": { one: 1, two: 2 },
"item-2": { one: 1, two: 2 }
//.. where number of items is unknown
}
}
```
I have ... | 2013/03/18 | [
"https://Stackoverflow.com/questions/15481759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/95055/"
] | ```
List<Data> decodedData = JSON.Decode<DataList>(Request["data"])
```
Should Be
```
var decodedData = JSON.Decode<List<Data>>(Request["data"])
var myDataList = new DataList() { data = decodedData; }
``` | You can try decoding the JSON into an array of Data objects, and then calling the ToList() extension method on that array.
```
var dataArray = JSON.Decode<Data[]>(Request["data"]);
var list = dataArray.ToList();
``` |
6,990,667 | I have a page app/views/new/news.html.erb and I simply want to link to this page from within my layouts/application.html.erb. Can someone please help! I have been struggling with this all morning.
I have tried things like <%= link\_to "News", ... But I'm not really sure where to go from there. | 2011/08/09 | [
"https://Stackoverflow.com/questions/6990667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852974/"
] | If you have it setup correctly you should have a plural for your controller (i.e. news instead of new) and the following should work:
```
<%= link_to 'News', :controller => "news", :action => :news %>
```
This is assuming you are using scaffold.
If are adding this folder and page manually: for dynamic page, you hav... | You don't "link" to a view, you link to a controller which renders that view. Then, you'll need an entry in your routes.rb to wire up the url routing for that controller. If you have a controller named NewsController with a method called index and an entry in your routes.rb that looks like `resources :news` the followi... |
6,990,667 | I have a page app/views/new/news.html.erb and I simply want to link to this page from within my layouts/application.html.erb. Can someone please help! I have been struggling with this all morning.
I have tried things like <%= link\_to "News", ... But I'm not really sure where to go from there. | 2011/08/09 | [
"https://Stackoverflow.com/questions/6990667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852974/"
] | You don't "link" to a view, you link to a controller which renders that view. Then, you'll need an entry in your routes.rb to wire up the url routing for that controller. If you have a controller named NewsController with a method called index and an entry in your routes.rb that looks like `resources :news` the followi... | You can always run
```
rake routes > routes.txt
```
in your application directory, which will dump a list of all routes into a txt file. Choose path that leads to action and controller you want, and then supply it as a param for link\_to method :) |
6,990,667 | I have a page app/views/new/news.html.erb and I simply want to link to this page from within my layouts/application.html.erb. Can someone please help! I have been struggling with this all morning.
I have tried things like <%= link\_to "News", ... But I'm not really sure where to go from there. | 2011/08/09 | [
"https://Stackoverflow.com/questions/6990667",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/852974/"
] | If you have it setup correctly you should have a plural for your controller (i.e. news instead of new) and the following should work:
```
<%= link_to 'News', :controller => "news", :action => :news %>
```
This is assuming you are using scaffold.
If are adding this folder and page manually: for dynamic page, you hav... | You can always run
```
rake routes > routes.txt
```
in your application directory, which will dump a list of all routes into a txt file. Choose path that leads to action and controller you want, and then supply it as a param for link\_to method :) |
63,180,246 | Is there a way that I can read multiple partitioned parquet files having different basePath in one go, by using wildcard(\*) when using basePath option with spark read? E.g.:
```
spark.read.option("basePath","s3://latest/data/*/").parquet(*dir)
```
Error gotten:
```
error: pyspark.sql.utils.IllegalArgumentExcepti... | 2020/07/30 | [
"https://Stackoverflow.com/questions/63180246",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5370631/"
] | No. You can have multiple `paths` in combination with a single base path for getting partitioning columns in the DF schema, but you cannot specify multiple `base paths` or use a wildcard as part of that base path.string. | You can simply give the root path,
```
spark.read.parquet("s3://latest/data/")
```
with the options.
```
spark.hive.mapred.supports.subdirectories true
spark.hadoop.mapreduce.input.fileinputformat.input.dir.recursive true
```
Then, the spark will look for the parquet files recursively from the `/data/` fold... |
22,290,320 | I have a list loaded through `ng-repeat` where each element contains an `img` tag. I'd like to show some sort of loading indicator (occluding the list items) until every image within every item has finished loading.
I guess I would need to hook into some event broadcast by the angular `back-img` directive but I don't... | 2014/03/10 | [
"https://Stackoverflow.com/questions/22290320",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/831862/"
] | Okay, so I solved my problem. First of all, @Vladimir, you're totally right -- `back-img` was a directive my colleague wrote, which obscured the solution to me for a while.
What I've done is write a really simple directive that calls a `$scope`-bound function on the `img`'s `load` event. My controller counts the numbe... | I am not aware of any back-img directive, but image loading is asynchronous and you cant generally guarantee that your 3rd image will load before your 8th image.
WHat I would do is add an 'onload' listener to every img tag that gets added by ng-repeat and simply figure out when all of your images have loaded by keepin... |
931,845 | Running this code:
```
_foo = MockRepository.GenerateStub<IBar>();
_foo.Stub(x => x.Foo()).Return("sdf");
```
When
```
public interface IBar
{
string Foo();
}
public class Bar : IBar
{
public string Foo()
{
throw new NotImplementedException();
}
}
```
throws NotSupportedException - "Can't creat... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | Rhino Mocks appears to be catching and handling this exception. You only see it in the VS.NET Debugger if you've enabled exceptions as breakpoints. It appears that you can safely continue running past this exception breakpoint and it all works as expected. | Your code works properly. You likely have some other code not shown which is causing the problem. Post your whole unit test here and we'll diagnose the issue for you. |
931,845 | Running this code:
```
_foo = MockRepository.GenerateStub<IBar>();
_foo.Stub(x => x.Foo()).Return("sdf");
```
When
```
public interface IBar
{
string Foo();
}
public class Bar : IBar
{
public string Foo()
{
throw new NotImplementedException();
}
}
```
throws NotSupportedException - "Can't creat... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | This happens when you have NOT got "Just my code" enabled under Tools->Options->Debugging->General, and you have CLR exceptions, "Thrown" selected under Debug->Exceptions. Easiest way to fix it is enable "just my code" under Tools->Options->Debugging->General.
;
_foo.Stub(x => x.Foo()).Return("sdf");
```
When
```
public interface IBar
{
string Foo();
}
public class Bar : IBar
{
public string Foo()
{
throw new NotImplementedException();
}
}
```
throws NotSupportedException - "Can't creat... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | Your code works properly. You likely have some other code not shown which is causing the problem. Post your whole unit test here and we'll diagnose the issue for you. | I second that - It's not an issue with code.
It is VS debug setting.
I get the same exception while on debug on the code below, while trying to send Arg.Is.Anything as a parameter to a stub.
```
mockPermissionManager.Stub(item => item.HasAccess(Arg<string>.Is.Anything)).Return(true);
```
The exception is handled a... |
931,845 | Running this code:
```
_foo = MockRepository.GenerateStub<IBar>();
_foo.Stub(x => x.Foo()).Return("sdf");
```
When
```
public interface IBar
{
string Foo();
}
public class Bar : IBar
{
public string Foo()
{
throw new NotImplementedException();
}
}
```
throws NotSupportedException - "Can't creat... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | Rhino Mocks appears to be catching and handling this exception. You only see it in the VS.NET Debugger if you've enabled exceptions as breakpoints. It appears that you can safely continue running past this exception breakpoint and it all works as expected. | I have the same problem, it has to be some VS studio debug setting or some insufficient access rights for rhino mocks i guess.
I am pretty sure that its not the code that is causing this. |
931,845 | Running this code:
```
_foo = MockRepository.GenerateStub<IBar>();
_foo.Stub(x => x.Foo()).Return("sdf");
```
When
```
public interface IBar
{
string Foo();
}
public class Bar : IBar
{
public string Foo()
{
throw new NotImplementedException();
}
}
```
throws NotSupportedException - "Can't creat... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | This happens when you have NOT got "Just my code" enabled under Tools->Options->Debugging->General, and you have CLR exceptions, "Thrown" selected under Debug->Exceptions. Easiest way to fix it is enable "just my code" under Tools->Options->Debugging->General.
;
_foo.Stub(x => x.Foo()).Return("sdf");
```
When
```
public interface IBar
{
string Foo();
}
public class Bar : IBar
{
public string Foo()
{
throw new NotImplementedException();
}
}
```
throws NotSupportedException - "Can't creat... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | I have the same problem, it has to be some VS studio debug setting or some insufficient access rights for rhino mocks i guess.
I am pretty sure that its not the code that is causing this. | I second that - It's not an issue with code.
It is VS debug setting.
I get the same exception while on debug on the code below, while trying to send Arg.Is.Anything as a parameter to a stub.
```
mockPermissionManager.Stub(item => item.HasAccess(Arg<string>.Is.Anything)).Return(true);
```
The exception is handled a... |
931,845 | Running this code:
```
_foo = MockRepository.GenerateStub<IBar>();
_foo.Stub(x => x.Foo()).Return("sdf");
```
When
```
public interface IBar
{
string Foo();
}
public class Bar : IBar
{
public string Foo()
{
throw new NotImplementedException();
}
}
```
throws NotSupportedException - "Can't creat... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | Rhino Mocks appears to be catching and handling this exception. You only see it in the VS.NET Debugger if you've enabled exceptions as breakpoints. It appears that you can safely continue running past this exception breakpoint and it all works as expected. | This happens when you have NOT got "Just my code" enabled under Tools->Options->Debugging->General, and you have CLR exceptions, "Thrown" selected under Debug->Exceptions. Easiest way to fix it is enable "just my code" under Tools->Options->Debugging->General.
;
_foo.Stub(x => x.Foo()).Return("sdf");
```
When
```
public interface IBar
{
string Foo();
}
public class Bar : IBar
{
public string Foo()
{
throw new NotImplementedException();
}
}
```
throws NotSupportedException - "Can't creat... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | Rhino Mocks appears to be catching and handling this exception. You only see it in the VS.NET Debugger if you've enabled exceptions as breakpoints. It appears that you can safely continue running past this exception breakpoint and it all works as expected. | I second that - It's not an issue with code.
It is VS debug setting.
I get the same exception while on debug on the code below, while trying to send Arg.Is.Anything as a parameter to a stub.
```
mockPermissionManager.Stub(item => item.HasAccess(Arg<string>.Is.Anything)).Return(true);
```
The exception is handled a... |
931,845 | Running this code:
```
_foo = MockRepository.GenerateStub<IBar>();
_foo.Stub(x => x.Foo()).Return("sdf");
```
When
```
public interface IBar
{
string Foo();
}
public class Bar : IBar
{
public string Foo()
{
throw new NotImplementedException();
}
}
```
throws NotSupportedException - "Can't creat... | 2009/05/31 | [
"https://Stackoverflow.com/questions/931845",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11236/"
] | This happens when you have NOT got "Just my code" enabled under Tools->Options->Debugging->General, and you have CLR exceptions, "Thrown" selected under Debug->Exceptions. Easiest way to fix it is enable "just my code" under Tools->Options->Debugging->General.
).Return(true);
```
The exception is handled a... |
58,096 | In my personal budget, I allocate a fixed amount £x per month to mortgage repayments. This amount includes a sum which is going towards overpaying the mortgage so that I can get the thing over with as soon as possible. Each of these overpayments is above the threshold for reducing the subsequent monthly regular payment... | 2016/01/14 | [
"https://money.stackexchange.com/questions/58096",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/36597/"
] | Happy to share my personal spreadsheet for this purpose. Go here:
[Mortgage overpayment comparison sheet (.xlsx) on Scribd](https://www.scribd.com/doc/294640994/Mortgage-Amortization-Sheet-Mortgage-Overpayment-Comparison)
- download it and modify freely in Excel.
This assumes:
* interest is calculated monthly
* paym... | You didn't say how you setup your test spreadsheet, but since IPMT is defined as "calculates the interest payment, during a specific period of a loan or investment that is paid in **constant periodic payments**, with a constant interest rate," (emphasis added) I think you could be making mistakes in how you use it. Are... |
58,096 | In my personal budget, I allocate a fixed amount £x per month to mortgage repayments. This amount includes a sum which is going towards overpaying the mortgage so that I can get the thing over with as soon as possible. Each of these overpayments is above the threshold for reducing the subsequent monthly regular payment... | 2016/01/14 | [
"https://money.stackexchange.com/questions/58096",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/36597/"
] | You didn't say how you setup your test spreadsheet, but since IPMT is defined as "calculates the interest payment, during a specific period of a loan or investment that is paid in **constant periodic payments**, with a constant interest rate," (emphasis added) I think you could be making mistakes in how you use it. Are... | Further to the previous answers, there's nothing sacred about the lender's ideas about what the regular payment is for any particular month, and what is the "extra" amount" that you are paying.
You have debt balance, it's growing each month because of interest at some rate, and you're reducing it each month by throwin... |
58,096 | In my personal budget, I allocate a fixed amount £x per month to mortgage repayments. This amount includes a sum which is going towards overpaying the mortgage so that I can get the thing over with as soon as possible. Each of these overpayments is above the threshold for reducing the subsequent monthly regular payment... | 2016/01/14 | [
"https://money.stackexchange.com/questions/58096",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/36597/"
] | You didn't say how you setup your test spreadsheet, but since IPMT is defined as "calculates the interest payment, during a specific period of a loan or investment that is paid in **constant periodic payments**, with a constant interest rate," (emphasis added) I think you could be making mistakes in how you use it. Are... | It is a little unclear to me exactly what feature you are looking for in a calculator. However, check out this calculator [here](http://mortgagevista.com/#m=2), it might offer what you are looking for.
It allows you to define an extra payment amount that will be applied each month in addition to your "regular" paymen... |
58,096 | In my personal budget, I allocate a fixed amount £x per month to mortgage repayments. This amount includes a sum which is going towards overpaying the mortgage so that I can get the thing over with as soon as possible. Each of these overpayments is above the threshold for reducing the subsequent monthly regular payment... | 2016/01/14 | [
"https://money.stackexchange.com/questions/58096",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/36597/"
] | Happy to share my personal spreadsheet for this purpose. Go here:
[Mortgage overpayment comparison sheet (.xlsx) on Scribd](https://www.scribd.com/doc/294640994/Mortgage-Amortization-Sheet-Mortgage-Overpayment-Comparison)
- download it and modify freely in Excel.
This assumes:
* interest is calculated monthly
* paym... | Further to the previous answers, there's nothing sacred about the lender's ideas about what the regular payment is for any particular month, and what is the "extra" amount" that you are paying.
You have debt balance, it's growing each month because of interest at some rate, and you're reducing it each month by throwin... |
58,096 | In my personal budget, I allocate a fixed amount £x per month to mortgage repayments. This amount includes a sum which is going towards overpaying the mortgage so that I can get the thing over with as soon as possible. Each of these overpayments is above the threshold for reducing the subsequent monthly regular payment... | 2016/01/14 | [
"https://money.stackexchange.com/questions/58096",
"https://money.stackexchange.com",
"https://money.stackexchange.com/users/36597/"
] | Happy to share my personal spreadsheet for this purpose. Go here:
[Mortgage overpayment comparison sheet (.xlsx) on Scribd](https://www.scribd.com/doc/294640994/Mortgage-Amortization-Sheet-Mortgage-Overpayment-Comparison)
- download it and modify freely in Excel.
This assumes:
* interest is calculated monthly
* paym... | It is a little unclear to me exactly what feature you are looking for in a calculator. However, check out this calculator [here](http://mortgagevista.com/#m=2), it might offer what you are looking for.
It allows you to define an extra payment amount that will be applied each month in addition to your "regular" paymen... |
5,028 | In English when a man is in a relationship with another man, he can say he's his boyfriend. In German, saying "Freund" when both are of the same sex is usually understood to mean the equivalent of "friend", not implying a relationship. Same goes for women.
Is there a german word for this? | 2012/08/15 | [
"https://german.stackexchange.com/questions/5028",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/293/"
] | Basically there is no distinction, which sometimes makes it difficult to understand.
So when I say `Das ist meine Freundin` it's not obvious whether she is my girlfriend or just a friend.
Usually people then say something like `Das ist eine Freundin (von mir)` for the 2nd case.
Concerning the same sex - a colleague ... | The only correct answer is: no. Both friend and boyfriend are "Freund" in German, and this often causes confusion. |
5,028 | In English when a man is in a relationship with another man, he can say he's his boyfriend. In German, saying "Freund" when both are of the same sex is usually understood to mean the equivalent of "friend", not implying a relationship. Same goes for women.
Is there a german word for this? | 2012/08/15 | [
"https://german.stackexchange.com/questions/5028",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/293/"
] | Basically there is no distinction, which sometimes makes it difficult to understand.
So when I say `Das ist meine Freundin` it's not obvious whether she is my girlfriend or just a friend.
Usually people then say something like `Das ist eine Freundin (von mir)` for the 2nd case.
Concerning the same sex - a colleague ... | As a gay man who has close German relatives I refer to my boyfriend with them (so for introductions or clarification) as *Liebesfreund* (implying a romantic relationship) versus referring to male friends of mine as *ein Freund.* |
5,028 | In English when a man is in a relationship with another man, he can say he's his boyfriend. In German, saying "Freund" when both are of the same sex is usually understood to mean the equivalent of "friend", not implying a relationship. Same goes for women.
Is there a german word for this? | 2012/08/15 | [
"https://german.stackexchange.com/questions/5028",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/293/"
] | Basically there is no distinction, which sometimes makes it difficult to understand.
So when I say `Das ist meine Freundin` it's not obvious whether she is my girlfriend or just a friend.
Usually people then say something like `Das ist eine Freundin (von mir)` for the 2nd case.
Concerning the same sex - a colleague ... | German does not have a single word for this - and in fact, this isn't as easy to express as in english.
In german, when you say
>
> Das ist *mein(e)* Freund(in)
>
>
>
most people will assume its your *boyfriend/girlfriend*.
However, if you say
>
> Das ist *ein(e)* Freund(in) (von mir)
>
>
>
then most peo... |
5,028 | In English when a man is in a relationship with another man, he can say he's his boyfriend. In German, saying "Freund" when both are of the same sex is usually understood to mean the equivalent of "friend", not implying a relationship. Same goes for women.
Is there a german word for this? | 2012/08/15 | [
"https://german.stackexchange.com/questions/5028",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/293/"
] | A boyfriend could be called »*fester* Freund«, a girlfriend »*feste* Freundin«.
There is also the term *Partner* (*Partnerin*) or, to clarify that it’s not a business partner, *Lebenspartner* (*Lebenspartnerin*).
Another term is *Lebensgefährte* (*Lebensgefährtin*). | The only correct answer is: no. Both friend and boyfriend are "Freund" in German, and this often causes confusion. |
5,028 | In English when a man is in a relationship with another man, he can say he's his boyfriend. In German, saying "Freund" when both are of the same sex is usually understood to mean the equivalent of "friend", not implying a relationship. Same goes for women.
Is there a german word for this? | 2012/08/15 | [
"https://german.stackexchange.com/questions/5028",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/293/"
] | A boyfriend could be called »*fester* Freund«, a girlfriend »*feste* Freundin«.
There is also the term *Partner* (*Partnerin*) or, to clarify that it’s not a business partner, *Lebenspartner* (*Lebenspartnerin*).
Another term is *Lebensgefährte* (*Lebensgefährtin*). | As a gay man who has close German relatives I refer to my boyfriend with them (so for introductions or clarification) as *Liebesfreund* (implying a romantic relationship) versus referring to male friends of mine as *ein Freund.* |
5,028 | In English when a man is in a relationship with another man, he can say he's his boyfriend. In German, saying "Freund" when both are of the same sex is usually understood to mean the equivalent of "friend", not implying a relationship. Same goes for women.
Is there a german word for this? | 2012/08/15 | [
"https://german.stackexchange.com/questions/5028",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/293/"
] | A boyfriend could be called »*fester* Freund«, a girlfriend »*feste* Freundin«.
There is also the term *Partner* (*Partnerin*) or, to clarify that it’s not a business partner, *Lebenspartner* (*Lebenspartnerin*).
Another term is *Lebensgefährte* (*Lebensgefährtin*). | German does not have a single word for this - and in fact, this isn't as easy to express as in english.
In german, when you say
>
> Das ist *mein(e)* Freund(in)
>
>
>
most people will assume its your *boyfriend/girlfriend*.
However, if you say
>
> Das ist *ein(e)* Freund(in) (von mir)
>
>
>
then most peo... |
5,028 | In English when a man is in a relationship with another man, he can say he's his boyfriend. In German, saying "Freund" when both are of the same sex is usually understood to mean the equivalent of "friend", not implying a relationship. Same goes for women.
Is there a german word for this? | 2012/08/15 | [
"https://german.stackexchange.com/questions/5028",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/293/"
] | The only correct answer is: no. Both friend and boyfriend are "Freund" in German, and this often causes confusion. | As a gay man who has close German relatives I refer to my boyfriend with them (so for introductions or clarification) as *Liebesfreund* (implying a romantic relationship) versus referring to male friends of mine as *ein Freund.* |
5,028 | In English when a man is in a relationship with another man, he can say he's his boyfriend. In German, saying "Freund" when both are of the same sex is usually understood to mean the equivalent of "friend", not implying a relationship. Same goes for women.
Is there a german word for this? | 2012/08/15 | [
"https://german.stackexchange.com/questions/5028",
"https://german.stackexchange.com",
"https://german.stackexchange.com/users/293/"
] | German does not have a single word for this - and in fact, this isn't as easy to express as in english.
In german, when you say
>
> Das ist *mein(e)* Freund(in)
>
>
>
most people will assume its your *boyfriend/girlfriend*.
However, if you say
>
> Das ist *ein(e)* Freund(in) (von mir)
>
>
>
then most peo... | As a gay man who has close German relatives I refer to my boyfriend with them (so for introductions or clarification) as *Liebesfreund* (implying a romantic relationship) versus referring to male friends of mine as *ein Freund.* |
20,304,453 | I want to make a search, but I need to bring the registers that have status Canceled or modified.
I thought that this would work but It didn't
```
citasotras = citas_agendarcita.objects.filter(cita_agendar_status="Modificada" or "",citas_tipodepaciente="mediexcel")
``` | 2013/11/30 | [
"https://Stackoverflow.com/questions/20304453",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2712575/"
] | In your example, The expression `"Modificada" or ""` evaluates to `"Modificada"`.
```
>>> "Modificada" or ""
'Modificada'
```
Therefore, your example is as if you simply had:
```
citasotras = citas_agendarcita.objects.filter(cita_agendar_status="Modificada", citas_tipodepaciente="mediexcel")
```
You want any obje... | For AND/OR conditions [Q objects](https://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects) can be used:
```
citas_agendarcita.objects.filter(Q(cita_agendar_status="Modificada")|Q(cita_agendar_status=""), \
citas_tipodepacie... |
50,382,346 | I have 2 application servers, which are connecting to a replicaSet (Primary, Secondary and Arbitrer).
Issue i'm facing is
```
[ 'MongoError: no primary found in replicaset',
' at ../server/node_modules/mongodb-core/lib/topologies/replset.js:524:28',
' at null.<anonymous> (../server/node_modules/mongodb-co... | 2018/05/17 | [
"https://Stackoverflow.com/questions/50382346",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6312882/"
] | Found the issue to be not using fully qualified DNS names, while adding members to replicaSet. Thanks to @Neil Lunn. | 1)Please check your connection string contain all DB sever names following bellow link
<https://docs.mongodb.com/manual/reference/connection-string/#standard-connection-string-format>
2) Do a fail-over
To do that log into primary node and execute below command
```
rs.stepDown()
``` |
34,085,256 | I'm new to d3 js. I'm looking for a chart like [this](http://www.highcharts.com/demo/columnrange) one done in highcharts. In highcharts it is called column range graph. Is there any way to achieve this.
When I search in google the best thing I can get is a [basic bar chart](http://localhost:8088/Bar%20graph%20test/). ... | 2015/12/04 | [
"https://Stackoverflow.com/questions/34085256",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1958114/"
] | Imagine I have dataset like this:
```
//these are the various categories
var categories = ['', 'Accessories', 'Audiophile', 'Camera & Photo', 'Cell Phones', 'Computers', 'eBook Readers', 'Gadgets', 'GPS & Navigation', 'Home Audio', 'Office Electronics', 'Portable Audio', 'Portable Video', 'Security & Surveillance... | Your link to a basic bar chart does not work. That just looks like a horizontal bar chart, of which there are many exapmles. Here is one: <http://bl.ocks.org/mbostock/2368837> |
48,878,418 | I'm getting a **'Circular dependency detected'** error when I'm trying to install **Akavache 6.0.0-alpha0038** into my Xamarin.IOs project in Visual Studio 2017.
This is the error in detail,
```
Error Circular dependency detected 'akavache 6.0.0-alpha0038 => akavache.core 6.0.0-alpha0038 => System.Reactive 3.1.... | 2018/02/20 | [
"https://Stackoverflow.com/questions/48878418",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4294275/"
] | In your visual studio, open **Options Menu** (Tools > Options),
Then, Under, **NuGet Package Manager > General**, choose ***PackageReference*** as the *Default package management format* for Package Management *(refer image)*
[](https://i.stack.imgur... | Open nuget manager
select package
open options and select dropdown from 'install and update optoins' -'Ignore Dependency'
Same way for uninstall
[](https://i.stack.imgur.com/ea1Wt.jpg) |
44,602,646 | Let's assume:
```
CREATE TABLE Client(
ID_Client int primary key,
Name varchar(20));
CREATE TABLE Sale(
X int primary key,
ID_Client int REFERENCES Client(ID_Client));
INSERT INTO Client VALUES(123456, 'Sam');
INSERT INTO Sale VALUES(1, 123456);
```
How do I delete 'Sam' without deleting the Sale, and without los... | 2017/06/17 | [
"https://Stackoverflow.com/questions/44602646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7231775/"
] | You can use an overlay to add some invisible edge on the side of the map that does capture the gesture for opening the drawer.
looks something like this:
```
const Screen = {
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
};
class Foo extends React.Component<Props, object> {
rend... | Do not use ...StyleSheet.absoluteFillObject on your map styles.
Doing this will resolve your issue
```html
const React = require("react-native");
const { StyleSheet, Dimensions } = React;
const { width, height } = Dimensions.get("window");
export default {
map: {
width: width,
height: height
}
};... |
44,602,646 | Let's assume:
```
CREATE TABLE Client(
ID_Client int primary key,
Name varchar(20));
CREATE TABLE Sale(
X int primary key,
ID_Client int REFERENCES Client(ID_Client));
INSERT INTO Client VALUES(123456, 'Sam');
INSERT INTO Sale VALUES(1, 123456);
```
How do I delete 'Sam' without deleting the Sale, and without los... | 2017/06/17 | [
"https://Stackoverflow.com/questions/44602646",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7231775/"
] | You can use an overlay to add some invisible edge on the side of the map that does capture the gesture for opening the drawer.
looks something like this:
```
const Screen = {
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
};
class Foo extends React.Component<Props, object> {
rend... | You need to activate ToggleDrawer() when you hit the side of the map which is covered by a thin TouchableOpacity window. here is the example code in homeview. make sure to bring in props as a variable to your function.
```
import React from 'react';
import {View, Text, SafeAreaView, StyleSheet, Dimensions, TouchableOp... |
70,437,884 | To prepare my upgrade from mysql 5.7 to mysql 8, I want to run the [upgrade utility checker](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-upgrade.html). Here's what I did so far:
1. installed [mysqlsh](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install.html) on my machine
2. started... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70437884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2679757/"
] | At its root I believe you're asking a style question, which means you're unlikely to get a definitive answer. Opinions on style are, well, opinions.
Some people believe that you should use C's "natural" types — `char`, `short`, `int`, `long`, and their `unsigned` variants — most of the time, and that you should use ex... | What you have posted is an implementation-defined form of `main()`. It is only allowed in two cases:
* Either it is 100% compatible with `int main (int argc, char** argv)`, or
* It is an implementation-defined form that the compiler documentation have told you is fine to use.
It is the C standard and the compiler whi... |
70,437,884 | To prepare my upgrade from mysql 5.7 to mysql 8, I want to run the [upgrade utility checker](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-upgrade.html). Here's what I did so far:
1. installed [mysqlsh](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install.html) on my machine
2. started... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70437884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2679757/"
] | At its root I believe you're asking a style question, which means you're unlikely to get a definitive answer. Opinions on style are, well, opinions.
Some people believe that you should use C's "natural" types — `char`, `short`, `int`, `long`, and their `unsigned` variants — most of the time, and that you should use ex... | >
> What is the best practice to use int8\_t?
>
>
>
When you need a very small signed integer. That's not the same as `char`. `char` comes in three flavours:
```
signed char
unsigned char
char
```
If you *know* you want a signed `int8_t`, use it. If you are dealing with standard string API:s, like `main`, use `... |
70,437,884 | To prepare my upgrade from mysql 5.7 to mysql 8, I want to run the [upgrade utility checker](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-upgrade.html). Here's what I did so far:
1. installed [mysqlsh](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-install.html) on my machine
2. started... | 2021/12/21 | [
"https://Stackoverflow.com/questions/70437884",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2679757/"
] | At its root I believe you're asking a style question, which means you're unlikely to get a definitive answer. Opinions on style are, well, opinions.
Some people believe that you should use C's "natural" types — `char`, `short`, `int`, `long`, and their `unsigned` variants — most of the time, and that you should use ex... | Your approach has many drawbacks:
* the prototype for `main()` is not compatible with any of the standard ones, even if `int` has 32 bits and if `char` is signed because `char` and `signed char` are different yet compatible types but `char *` and `signed char *` are incompatible types.
* if `int` is not the same as `i... |
73,922,977 | ALL,
I finally moved away from the bitmaps and trying to use SVG in my C++ code.
I made an SVG using an InkScape and saved it as Compressed.
Then I edited the resulting file by adding the
```
static const char data[] =
```
in front of the XML and place every single line of XML inside double quotes.
The resulting... | 2022/10/02 | [
"https://Stackoverflow.com/questions/73922977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/945871/"
] | You may want raw string literal introduced in C++ 11.
```
static const char data[] = R"xxx(<?xml version="1.0"...)xxx";
```
This is equivalent to
```
static const char data[] = "<?xml version=\"1.0\"...";
``` | You need to format the data properly. To aid with this, please use an IDE or a good text editor such as Visual studio, Visual Studio Code or something similar. This would help you visualize the problem and fix it yourself
But to answer your question...
Use `' '` in place of `" "` to break the lines up.
Example:
`'<... |
73,922,977 | ALL,
I finally moved away from the bitmaps and trying to use SVG in my C++ code.
I made an SVG using an InkScape and saved it as Compressed.
Then I edited the resulting file by adding the
```
static const char data[] =
```
in front of the XML and place every single line of XML inside double quotes.
The resulting... | 2022/10/02 | [
"https://Stackoverflow.com/questions/73922977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/945871/"
] | I'm not sure if it's still fashionable, but a well known technique is to use a program called a *Resource Compiler* which can accept the file you give it and transform it into the encoded textual form that can be embedded into the code. Often these will produce a header file that creates a `char[]` object (or a `string... | You need to format the data properly. To aid with this, please use an IDE or a good text editor such as Visual studio, Visual Studio Code or something similar. This would help you visualize the problem and fix it yourself
But to answer your question...
Use `' '` in place of `" "` to break the lines up.
Example:
`'<... |
73,922,977 | ALL,
I finally moved away from the bitmaps and trying to use SVG in my C++ code.
I made an SVG using an InkScape and saved it as Compressed.
Then I edited the resulting file by adding the
```
static const char data[] =
```
in front of the XML and place every single line of XML inside double quotes.
The resulting... | 2022/10/02 | [
"https://Stackoverflow.com/questions/73922977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/945871/"
] | You may want raw string literal introduced in C++ 11.
```
static const char data[] = R"xxx(<?xml version="1.0"...)xxx";
```
This is equivalent to
```
static const char data[] = "<?xml version=\"1.0\"...";
``` | I'm not sure if it's still fashionable, but a well known technique is to use a program called a *Resource Compiler* which can accept the file you give it and transform it into the encoded textual form that can be embedded into the code. Often these will produce a header file that creates a `char[]` object (or a `string... |
10,911,976 | I'm doing a project in JSP. I am using IDE and tomcat 6.0.35.
When I click on my first .jsp and say run on server, it runs fine. But if I only type the URL `localhost:8080` on the server it cannot display the homepage of tomcat.
Also when I start tomcat using the command line, it displays the tomcat home page but can... | 2012/06/06 | [
"https://Stackoverflow.com/questions/10911976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1372442/"
] | There's no such type as "a var type". A declaration using `var` just makes the compiler *infer* the type of the variable. It's still statically typed, and works as if you'd explicitly declared it - although it allows you to declare variables which use an *anonymous type*.
In your case we don't know what any of the met... | It looks as though you're you're mixing up your classes `AccessPoint` and `AccessPointItem`. Try this:
```
public static AccessPoint[] getAllAps()
{
return tsvc.CreateQuery<AccessPoint>("AccessPointTable").ToArray();
}
```
or this:
```
public static AccessPointItem[] getAllAps()
{
return tsvc.CreateQuery<A... |
10,911,976 | I'm doing a project in JSP. I am using IDE and tomcat 6.0.35.
When I click on my first .jsp and say run on server, it runs fine. But if I only type the URL `localhost:8080` on the server it cannot display the homepage of tomcat.
Also when I start tomcat using the command line, it displays the tomcat home page but can... | 2012/06/06 | [
"https://Stackoverflow.com/questions/10911976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1372442/"
] | There's no such type as "a var type". A declaration using `var` just makes the compiler *infer* the type of the variable. It's still statically typed, and works as if you'd explicitly declared it - although it allows you to declare variables which use an *anonymous type*.
In your case we don't know what any of the met... | There is something wrong with the types involved.
First you read `AccessPointItem`:
```
var Query = from APs in tsvc.CreateQuery<AccessPointItem>(...)
```
Then you try to cast it to `AccessPoint`:
```
return Query.Cast<AccessPoint>()
```
You're gonna need to implement some kind of conversion method in order for ... |
32,329,611 | The [hibernate documentation](https://docs.jboss.org/hibernate/orm/4.0/devguide/en-US/html/ch02.html#d0e1472) says:
>
> With CMT, transaction demarcation is declared in session bean deployment descriptors, rather than performed in a programmatic manner.
>
>
>
but I can't find any complete example on how to do thi... | 2015/09/01 | [
"https://Stackoverflow.com/questions/32329611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2965883/"
] | In JavaEE environments Hibernate can use the CMT (Container Managed Transaction) strategy which will bind hibernate transactions with the underlying JTA transaction eliminating the need to manually begin, commit and rollback transactions. Example [here](http://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibe... | EJB methods are transactional by default.
You can tweak their behavior using the [TransactionAttribute](http://docs.oracle.com/javaee/7/api/javax/ejb/TransactionAttribute.html) annotation.
You can read more about CMT here:
<https://docs.oracle.com/javaee/7/tutorial/transactions003.htm#BNCIJ>
<https://docs.oracle.co... |
32,329,611 | The [hibernate documentation](https://docs.jboss.org/hibernate/orm/4.0/devguide/en-US/html/ch02.html#d0e1472) says:
>
> With CMT, transaction demarcation is declared in session bean deployment descriptors, rather than performed in a programmatic manner.
>
>
>
but I can't find any complete example on how to do thi... | 2015/09/01 | [
"https://Stackoverflow.com/questions/32329611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2965883/"
] | In JavaEE environments Hibernate can use the CMT (Container Managed Transaction) strategy which will bind hibernate transactions with the underlying JTA transaction eliminating the need to manually begin, commit and rollback transactions. Example [here](http://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibe... | Your Typical example would be like--
```
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.ejb.TransactionManagement;
import javax.ejb.TransactionManagementType;
@TransactionManagement(TransactionManagementType.CONTAINER)
@Stateless(..)... |
7,415,960 | I am working in selenium webdriver.I have few text boxes whose ids are going to change all the time.
e.g `id=ctl00_SPWebPartManager1_g_ad39b78c_a97b_4431_aedb_c9e6270134c6_ctl00_wizNotification_ucChangeData_txtAddress1`
but last part remains same always. in above example `wizNotification_ucChangeData_txtAddress1`
i h... | 2011/09/14 | [
"https://Stackoverflow.com/questions/7415960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/944554/"
] | Xpaths are slow in IE because IE does not have native Xpath engine. You should instead use CSS Selector for better performance. As for your case, you can try below css selector which finds an input for which the id ends with txtAddress1
**E[foo$="bar"] an E element whose "foo" attribute value ends exactly with the st... | Try:
.//input[@id[contains(.,'txtAddress1')]]
Be careful, if is a textarea it won't be detected as an input. |
7,415,960 | I am working in selenium webdriver.I have few text boxes whose ids are going to change all the time.
e.g `id=ctl00_SPWebPartManager1_g_ad39b78c_a97b_4431_aedb_c9e6270134c6_ctl00_wizNotification_ucChangeData_txtAddress1`
but last part remains same always. in above example `wizNotification_ucChangeData_txtAddress1`
i h... | 2011/09/14 | [
"https://Stackoverflow.com/questions/7415960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/944554/"
] | Try:
.//input[@id[contains(.,'txtAddress1')]]
Be careful, if is a textarea it won't be detected as an input. | In case of webelements with dynamic Ids, instead of going for Xpath with Ids we can go for other way of finding elements like 'by tagname', CSSlocator,.. it worked for me. |
7,415,960 | I am working in selenium webdriver.I have few text boxes whose ids are going to change all the time.
e.g `id=ctl00_SPWebPartManager1_g_ad39b78c_a97b_4431_aedb_c9e6270134c6_ctl00_wizNotification_ucChangeData_txtAddress1`
but last part remains same always. in above example `wizNotification_ucChangeData_txtAddress1`
i h... | 2011/09/14 | [
"https://Stackoverflow.com/questions/7415960",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/944554/"
] | Xpaths are slow in IE because IE does not have native Xpath engine. You should instead use CSS Selector for better performance. As for your case, you can try below css selector which finds an input for which the id ends with txtAddress1
**E[foo$="bar"] an E element whose "foo" attribute value ends exactly with the st... | In case of webelements with dynamic Ids, instead of going for Xpath with Ids we can go for other way of finding elements like 'by tagname', CSSlocator,.. it worked for me. |
51,865,604 | I was trying `USART` using a [`STM32F407VGT6`](https://www.st.com/en/microcontrollers/stm32f407vg.html) and `CubeMX`.
I am able to send and receive data using Interrupts. But I am getting a problem which I am not able to understand:
I am using `HAL_UART_Transmit_IT` to send the data.
I have enabled `__HAL_UART_ENA... | 2018/08/15 | [
"https://Stackoverflow.com/questions/51865604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10231078/"
] | You need to wait for the callback, which indicates the end of transmission . It is the interrupt function which is executed asynchronously. It does not have a chance to send even a single byte.
You just override the buffer and start the transmission over.
For this kind of messages, use blocking functions. Use DMA or ... | ```
if(HAL_UART_Transmit(&huart2, (uint8_t*)aTxBuffer, TXBUFFERSIZE, 5000)!= HAL_OK)
{
Error_Handler();
}
```
use this HAL function without callback interrupt. |
51,865,604 | I was trying `USART` using a [`STM32F407VGT6`](https://www.st.com/en/microcontrollers/stm32f407vg.html) and `CubeMX`.
I am able to send and receive data using Interrupts. But I am getting a problem which I am not able to understand:
I am using `HAL_UART_Transmit_IT` to send the data.
I have enabled `__HAL_UART_ENA... | 2018/08/15 | [
"https://Stackoverflow.com/questions/51865604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10231078/"
] | You need to wait for the callback, which indicates the end of transmission . It is the interrupt function which is executed asynchronously. It does not have a chance to send even a single byte.
You just override the buffer and start the transmission over.
For this kind of messages, use blocking functions. Use DMA or ... | I created my account just to say thanks to P\_\_J\_\_.
I struggled to send multiple HAL\_UART\_Transmit\_IT in a row as below.
HAL\_UART\_Transmit\_IT(&huart1,(uint8\_t\*) Test\_Buffer1, length1);
HAL\_Delay (1000);
HAL\_UART\_Transmit\_IT(&huart1,(uint8\_t\*) Test\_Buffer2, length2);
P\_\_J\_\_ solution above by us... |
2,641,858 | I have a program in C using Solaris with VERY ancient compatibility it seems. Many examples, even here on SO, don't work, as well as lots of code I've written on Mac OS X.
**So when using very strict C, what is the safest way to pass strings?**
I'm currently using char pointers all over the place, due to what I thoug... | 2010/04/15 | [
"https://Stackoverflow.com/questions/2641858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/158740/"
] | Well-written C code adheres to the following convention:
* All functions return a status code of type **int**, where a return value of 0 indicates success, and a -1 indicates failure. On failure, the function should set `errno` with an appropriate value (e.g. EINVAL).
* Values that are "reported" by a function should ... | You can't return a pointer to an array that's allocated locally within the function. As soon as the function returns, that array is going to be clobbered.
Also, when you put
```
char localstr[MAX_STRLENGTH] = strcpy(localstr, somestr);
```
what happens is that strcpy() will copy the bytes into the localstr[] array,... |
2,641,858 | I have a program in C using Solaris with VERY ancient compatibility it seems. Many examples, even here on SO, don't work, as well as lots of code I've written on Mac OS X.
**So when using very strict C, what is the safest way to pass strings?**
I'm currently using char pointers all over the place, due to what I thoug... | 2010/04/15 | [
"https://Stackoverflow.com/questions/2641858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/158740/"
] | You can't return a pointer to an array that's allocated locally within the function. As soon as the function returns, that array is going to be clobbered.
Also, when you put
```
char localstr[MAX_STRLENGTH] = strcpy(localstr, somestr);
```
what happens is that strcpy() will copy the bytes into the localstr[] array,... | Is your "update" example complete? I wouldn't think that would compile: it calls for a return value but you never return anything. You never do anything will fullpath, but perhaps that's deliberate, maybe your point is just to say that when you do the malloc, other things break.
Without seeing the caller, it's impossi... |
2,641,858 | I have a program in C using Solaris with VERY ancient compatibility it seems. Many examples, even here on SO, don't work, as well as lots of code I've written on Mac OS X.
**So when using very strict C, what is the safest way to pass strings?**
I'm currently using char pointers all over the place, due to what I thoug... | 2010/04/15 | [
"https://Stackoverflow.com/questions/2641858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/158740/"
] | Well-written C code adheres to the following convention:
* All functions return a status code of type **int**, where a return value of 0 indicates success, and a -1 indicates failure. On failure, the function should set `errno` with an appropriate value (e.g. EINVAL).
* Values that are "reported" by a function should ... | Is your "update" example complete? I wouldn't think that would compile: it calls for a return value but you never return anything. You never do anything will fullpath, but perhaps that's deliberate, maybe your point is just to say that when you do the malloc, other things break.
Without seeing the caller, it's impossi... |
4,692,805 | I have an int id column that I need to do a one-time maintenance/fix update on.
```
For example, currently the values look like this:
1
2
3
I need to make the following change:
1=3
2=1
3=2
```
Is there a way to do this in one statement? I keep imagining that the update will get confused if say the change from 1=3 t... | 2011/01/14 | [
"https://Stackoverflow.com/questions/4692805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139698/"
] | All of the assignments within an UPDATE statement (both the assignments within the SET clause, and the assignments on individual rows) are made as if they all occurred simultaneously.
So
```
UPDATE Table Set ID = ((ID + 1) % 3) + 1
```
(or whatever the right logic is, since I can't work out what "direction" is need... | In the past, I've done stuff like this by creating a temp table (whose structure is the same as the target table) with an extra column to hold the new value. Once I have all the new values, I'll then copy them to the target column in the target table, and delete the temp table. |
4,692,805 | I have an int id column that I need to do a one-time maintenance/fix update on.
```
For example, currently the values look like this:
1
2
3
I need to make the following change:
1=3
2=1
3=2
```
Is there a way to do this in one statement? I keep imagining that the update will get confused if say the change from 1=3 t... | 2011/01/14 | [
"https://Stackoverflow.com/questions/4692805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139698/"
] | This is how I usually do it
```
DECLARE @Update Table (@oldvalue int, @newvalue int)
INSERT INTO @Update Values (1,3)
INSERT INTO @Update Values (2,1)
INSERT INTO @Update Values (3,2)
Update Table
SET
yourField = NewValue
FROM
table t
INNER JOIN @Update
on t.yourField = @update.oldvalue
``` | In the past, I've done stuff like this by creating a temp table (whose structure is the same as the target table) with an extra column to hold the new value. Once I have all the new values, I'll then copy them to the target column in the target table, and delete the temp table. |
4,692,805 | I have an int id column that I need to do a one-time maintenance/fix update on.
```
For example, currently the values look like this:
1
2
3
I need to make the following change:
1=3
2=1
3=2
```
Is there a way to do this in one statement? I keep imagining that the update will get confused if say the change from 1=3 t... | 2011/01/14 | [
"https://Stackoverflow.com/questions/4692805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139698/"
] | What about a sql case statement (something like this)?
```
UPDATE table SET intID = CASE
WHEN intID = 3 THEN 2
WHEN intID = 1 THEN 3
WHEN intID = 2 THEN 1
END
``` | In the past, I've done stuff like this by creating a temp table (whose structure is the same as the target table) with an extra column to hold the new value. Once I have all the new values, I'll then copy them to the target column in the target table, and delete the temp table. |
4,692,805 | I have an int id column that I need to do a one-time maintenance/fix update on.
```
For example, currently the values look like this:
1
2
3
I need to make the following change:
1=3
2=1
3=2
```
Is there a way to do this in one statement? I keep imagining that the update will get confused if say the change from 1=3 t... | 2011/01/14 | [
"https://Stackoverflow.com/questions/4692805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139698/"
] | All of the assignments within an UPDATE statement (both the assignments within the SET clause, and the assignments on individual rows) are made as if they all occurred simultaneously.
So
```
UPDATE Table Set ID = ((ID + 1) % 3) + 1
```
(or whatever the right logic is, since I can't work out what "direction" is need... | This is how I usually do it
```
DECLARE @Update Table (@oldvalue int, @newvalue int)
INSERT INTO @Update Values (1,3)
INSERT INTO @Update Values (2,1)
INSERT INTO @Update Values (3,2)
Update Table
SET
yourField = NewValue
FROM
table t
INNER JOIN @Update
on t.yourField = @update.oldvalue
``` |
4,692,805 | I have an int id column that I need to do a one-time maintenance/fix update on.
```
For example, currently the values look like this:
1
2
3
I need to make the following change:
1=3
2=1
3=2
```
Is there a way to do this in one statement? I keep imagining that the update will get confused if say the change from 1=3 t... | 2011/01/14 | [
"https://Stackoverflow.com/questions/4692805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/139698/"
] | What about a sql case statement (something like this)?
```
UPDATE table SET intID = CASE
WHEN intID = 3 THEN 2
WHEN intID = 1 THEN 3
WHEN intID = 2 THEN 1
END
``` | This is how I usually do it
```
DECLARE @Update Table (@oldvalue int, @newvalue int)
INSERT INTO @Update Values (1,3)
INSERT INTO @Update Values (2,1)
INSERT INTO @Update Values (3,2)
Update Table
SET
yourField = NewValue
FROM
table t
INNER JOIN @Update
on t.yourField = @update.oldvalue
``` |
66,439,731 | I try to display all values of tab but only 8 first elements are displayed no more
```
int tab[] = {0,2,5,3,9,0,8,9,2,0,4,3,0};
printf("taille %d: \n", sizeof(tab));
for (int i=0; i<sizeof(tab); i++)
{
printf("indice : %d et valeur :%d \n", i, *(tab + i ));
}
``` | 2021/03/02 | [
"https://Stackoverflow.com/questions/66439731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8051903/"
] | `sizeof(tab)` yields the size in bytes of all the array `tab` that contains `13` elements each of them having the size equal to `sizeof( int )` (that is the same as `sizeof( *tab )`). That is
`sizeof(tab)` is equal to `13 * sizeof( int )` that in turn can be equal to `52` provided that `sizeof( int )` is equal to `4`.... | The line
```
printf("taille %d: \n", sizeof(tab));
```
invokes *undefined behavior*, allowing anything to happen, by passind data having wrong type to `printf()`. `%d` expects `int`, but `sizeof` returns `size_t`. The correct format specifier to print `size_t` in decimal is `%zu`.
Then, `sizeof(tab)` is the size of... |
14,422,193 | I was trying to convert the content scraped into a list for data manipulation, but got the following error: TypeError: 'NoneType' object is not callable
```
#! /usr/bin/python
from urllib import urlopen
from BeautifulSoup import BeautifulSoup
import os
import re
# Copy all of the content from the provided web page
w... | 2013/01/20 | [
"https://Stackoverflow.com/questions/14422193",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1906046/"
] | The problem is the default hash value you give is a mutable value (partially, at least—see below), you need to instead use `Hash.new`’s block parameter:
```
hash = Hash.new { |h, k| h[k] = [] }
```
You get the correct result:
```
function ['cars', 'for', 'potatoes', 'racs', 'four']
#=> {"acrs"=>["cars", "racs"],
# ... | ### Assign Values to Hash Keys With `=`
You can fix your code easily by replacing `hash[sorted] << word` with the following:
```rb
hash[sorted] = word
```
That's the only change you actually needed to make your original code work. Consider:
```rb
def function(words)
hash = Hash.new([])
words.each do |word|
... |
34,482,928 | Happy Holidays! How do i get this function running? I can see the console.log running on the mouse wheel, however the function set to run once does not run. On the start i have also made sure that the body contains both the required classes.
```
var $body = $('body');
//using index
if(index ==... | 2015/12/27 | [
"https://Stackoverflow.com/questions/34482928",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4917079/"
] | ```
var something = (function() {
var secret = false;
return function () {
if(!secret) {
console.log('call me once please an1');
secret = true;
}
};
})();
```
You have the above block which is an IIFE. I believe what it's doing is assigning the below function to the... | ```
var something = (function() {
var secret = false;
return function () {
if(!secret){
console.log('call me once please an1');
secret = true;
}
};
});
var something2 = (function() {
var secret = false;
return function () {
if(!secret){
con... |
10,568 | [As we are making the Minecraft mod technical questions ban super-duper official](https://gaming.meta.stackexchange.com/questions/10564/what-should-an-off-topic-close-reason-for-minecraft-crash-dumps-look-like) with a close-reason and everything, I feel that this question remains in dire need of a satisfactory answer:
... | 2015/05/22 | [
"https://gaming.meta.stackexchange.com/questions/10568",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/23/"
] | Short Answer
------------
Because modded Minecraft tech support questions are a problem, similar questions for other games are not. 99% of the time we can't provide a fix, even with a crash dump, and the best we can do is identify what's breaking.
Long Answer
-----------
There's a few factors which mean that Minecra... | We need answerable questions. Many Minecraft questions, featuring complications from mods, do not meet the [Real Questions Have Answers](http://blog.stackoverflow.com/2011/01/real-questions-have-answers/) criteria.
From the end of that article, there is this:
>
> real questions have answers, not items or ideas or op... |
10,568 | [As we are making the Minecraft mod technical questions ban super-duper official](https://gaming.meta.stackexchange.com/questions/10564/what-should-an-off-topic-close-reason-for-minecraft-crash-dumps-look-like) with a close-reason and everything, I feel that this question remains in dire need of a satisfactory answer:
... | 2015/05/22 | [
"https://gaming.meta.stackexchange.com/questions/10568",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/23/"
] | **Good question**. I think the main reason the discussion centered around Minecraft is because it has been the most active and most problematic category of technical issues questions by several orders of magnitude. But the notion that Minecraft technical support in particular is problematic as a category is... troublin... | We need answerable questions. Many Minecraft questions, featuring complications from mods, do not meet the [Real Questions Have Answers](http://blog.stackoverflow.com/2011/01/real-questions-have-answers/) criteria.
From the end of that article, there is this:
>
> real questions have answers, not items or ideas or op... |
10,568 | [As we are making the Minecraft mod technical questions ban super-duper official](https://gaming.meta.stackexchange.com/questions/10564/what-should-an-off-topic-close-reason-for-minecraft-crash-dumps-look-like) with a close-reason and everything, I feel that this question remains in dire need of a satisfactory answer:
... | 2015/05/22 | [
"https://gaming.meta.stackexchange.com/questions/10568",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/23/"
] | Ok, I've thought about this a bit more:
We're not banning Minecraft mod tech support
============================================
We're discussing what the close reason should be for unanswerable Minecraft mod crash questions - which we get a lot of - and are *nearly* all unanswerable.
With that in mind...
---------... | We need answerable questions. Many Minecraft questions, featuring complications from mods, do not meet the [Real Questions Have Answers](http://blog.stackoverflow.com/2011/01/real-questions-have-answers/) criteria.
From the end of that article, there is this:
>
> real questions have answers, not items or ideas or op... |
10,568 | [As we are making the Minecraft mod technical questions ban super-duper official](https://gaming.meta.stackexchange.com/questions/10564/what-should-an-off-topic-close-reason-for-minecraft-crash-dumps-look-like) with a close-reason and everything, I feel that this question remains in dire need of a satisfactory answer:
... | 2015/05/22 | [
"https://gaming.meta.stackexchange.com/questions/10568",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/23/"
] | I think Mods, and even Minecraft are a red herring - they produce most of our issues, simply because of the sheer quantity of Minecraft questions, and because of the specific kinds of ways in which Minecraft fails, which are uniquely problematic, but not unique to Minecraft.
What kind of Tech Support questions are we ... | We need answerable questions. Many Minecraft questions, featuring complications from mods, do not meet the [Real Questions Have Answers](http://blog.stackoverflow.com/2011/01/real-questions-have-answers/) criteria.
From the end of that article, there is this:
>
> real questions have answers, not items or ideas or op... |
10,568 | [As we are making the Minecraft mod technical questions ban super-duper official](https://gaming.meta.stackexchange.com/questions/10564/what-should-an-off-topic-close-reason-for-minecraft-crash-dumps-look-like) with a close-reason and everything, I feel that this question remains in dire need of a satisfactory answer:
... | 2015/05/22 | [
"https://gaming.meta.stackexchange.com/questions/10568",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/23/"
] | Ok, I've thought about this a bit more:
We're not banning Minecraft mod tech support
============================================
We're discussing what the close reason should be for unanswerable Minecraft mod crash questions - which we get a lot of - and are *nearly* all unanswerable.
With that in mind...
---------... | Short Answer
------------
Because modded Minecraft tech support questions are a problem, similar questions for other games are not. 99% of the time we can't provide a fix, even with a crash dump, and the best we can do is identify what's breaking.
Long Answer
-----------
There's a few factors which mean that Minecra... |
10,568 | [As we are making the Minecraft mod technical questions ban super-duper official](https://gaming.meta.stackexchange.com/questions/10564/what-should-an-off-topic-close-reason-for-minecraft-crash-dumps-look-like) with a close-reason and everything, I feel that this question remains in dire need of a satisfactory answer:
... | 2015/05/22 | [
"https://gaming.meta.stackexchange.com/questions/10568",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/23/"
] | I think Mods, and even Minecraft are a red herring - they produce most of our issues, simply because of the sheer quantity of Minecraft questions, and because of the specific kinds of ways in which Minecraft fails, which are uniquely problematic, but not unique to Minecraft.
What kind of Tech Support questions are we ... | Short Answer
------------
Because modded Minecraft tech support questions are a problem, similar questions for other games are not. 99% of the time we can't provide a fix, even with a crash dump, and the best we can do is identify what's breaking.
Long Answer
-----------
There's a few factors which mean that Minecra... |
10,568 | [As we are making the Minecraft mod technical questions ban super-duper official](https://gaming.meta.stackexchange.com/questions/10564/what-should-an-off-topic-close-reason-for-minecraft-crash-dumps-look-like) with a close-reason and everything, I feel that this question remains in dire need of a satisfactory answer:
... | 2015/05/22 | [
"https://gaming.meta.stackexchange.com/questions/10568",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/23/"
] | Ok, I've thought about this a bit more:
We're not banning Minecraft mod tech support
============================================
We're discussing what the close reason should be for unanswerable Minecraft mod crash questions - which we get a lot of - and are *nearly* all unanswerable.
With that in mind...
---------... | **Good question**. I think the main reason the discussion centered around Minecraft is because it has been the most active and most problematic category of technical issues questions by several orders of magnitude. But the notion that Minecraft technical support in particular is problematic as a category is... troublin... |
10,568 | [As we are making the Minecraft mod technical questions ban super-duper official](https://gaming.meta.stackexchange.com/questions/10564/what-should-an-off-topic-close-reason-for-minecraft-crash-dumps-look-like) with a close-reason and everything, I feel that this question remains in dire need of a satisfactory answer:
... | 2015/05/22 | [
"https://gaming.meta.stackexchange.com/questions/10568",
"https://gaming.meta.stackexchange.com",
"https://gaming.meta.stackexchange.com/users/23/"
] | I think Mods, and even Minecraft are a red herring - they produce most of our issues, simply because of the sheer quantity of Minecraft questions, and because of the specific kinds of ways in which Minecraft fails, which are uniquely problematic, but not unique to Minecraft.
What kind of Tech Support questions are we ... | **Good question**. I think the main reason the discussion centered around Minecraft is because it has been the most active and most problematic category of technical issues questions by several orders of magnitude. But the notion that Minecraft technical support in particular is problematic as a category is... troublin... |
22,076,269 | (I believe) I know about overloading functions based on const-ness: if the instant is const, the const method is called, otherwise the non-const one.
Example (also at [ideone](http://ideone.com/E9AIXV)):
```
#include <iostream>
struct S
{
void print() const { std::cout << "const method" <<std::endl };
void prin... | 2014/02/27 | [
"https://Stackoverflow.com/questions/22076269",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1984137/"
] | >
> *Is there a way to get some sort of "fall back" to a const-function if a non-const function is not accessible?*
>
>
>
No; overload resolution occurs before access check.
This is not just bad style; it is bad design. A public getter function is *conceptually different* from a protected function that lets code ... | You may use `const_cast` to allow to call the const version as:
```
int main()
{
S s2;
const_cast<const S&>(s2).print(); // prints "const method"
return 0;
};
```
But it would be better/simpler to rename one of the method. |
50,116,383 | Say I have the following array:
```
$n[5] = "hello";
$n[10]= "goodbye";`
```
I would like to find out the highest index of this array.
In Javascript, I could do `$n.length - 1` which would return `10`.
In PHP, though, `count($n)` returns 2, which is the number of elements in the array.
So how to get the highest ind... | 2018/05/01 | [
"https://Stackoverflow.com/questions/50116383",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4821689/"
] | Use [max()](http://php.net/manual/en/function.max.php) and [array\_keys()](http://php.net/manual/en/function.array-keys.php)
```
echo max(array_keys($n));
```
Output:-<https://eval.in/997652> | ```
$n = [];
$n[5] = "hello";
$n[10]= "goodbye";
// get the list of key
$keyList = array_keys($n);
// get the biggest key
$maxIndex = max($keyList);
echo $n[$maxIndex];
```
output
```
goodbye
``` |
9,165 | I have found a conflict in how I want to UV unwrap my model for cloth modeling:
For material patches, it seems natural to make use of the seams the real thing would have (easier to paint the texture correctly).
For making seams look like seams I need to be able to paint over the real seam, making it hard if I use the... | 2014/05/06 | [
"https://blender.stackexchange.com/questions/9165",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/3258/"
] | I really wish Blender supported this out the box and it could be as easy as enabling/disabling 3D manipulator. But the simplest way I found is the following. Assuming you started with default scene with a cube:
1. Enable Rigid Body for the cube in *Properties > Physics* and select the first Cube and *Properties > Phys... | In the latest version of Blender, right now it is 2.71, there is a selection called mesh in the collision tab. This seems to work very well for most active rigid body objects.
There is a tutorial by PHYMEC on YouTube addressing this very issue and he goes into great depth about the sphere of influence of an object on ... |
57,367,558 | I'm trying to set up a google cloud function to use a cloud storage SDK. That cloud storage SDK requires a JSON formated configuration file that it generates when you register your application with your account. I am using Node.js 10
How I import a JSON object into a google cloud function?
So far I've already tried u... | 2019/08/06 | [
"https://Stackoverflow.com/questions/57367558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8196400/"
] | One of the best practice is to put the file in a bucket, to allow the function service account (the default one or a specific identity) to read this bucket and to load the file at runtime.
One of the main reason is that you don't have to commit your security file, you just have to keep a reference to a bucket. | You can place your JSON strings in environment variables. Maybe you have to remove line breaks.
Usage in Cloud Functions code (Python):
```
import os
import json
foobar_json_string = os.environ.get('foobar_json_string', '{}')
foobar_dict = json.loads(foobar_json_string)
``` |
39,898 | I have info path form with three text boxes (tb1, tb2, tb3) and have calculated value field with (tb1+tb2+tb3).
Eg: If 1,2,3 are entered then it shows 6 in the calculated value field.
My Requirement:
If calculated value field is between 1-4 then it should show Low
If calculated value field is between 5-10 then it s... | 2012/06/29 | [
"https://sharepoint.stackexchange.com/questions/39898",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/6531/"
] | It is more correct to realize it with rules but it is a lot of typing so I made it with custom C# code.
In Infopath Designer 2010 create a form naming controls accordingly:


On... | just add 3 calculated fields with text low, medium and high. on each calculated field add a formatting rule. the formatting rule hides the calculted field if it's not a low/medium/high value.
Calculated Field A: Value = Low, rule: hide when calculatedValue > 4 or calculatedValue < 1
Calculated Field B: Value = Medium,... |
57,611 | In the list view, I want to display the 3 most important attributes of the product below the productname.
What is the best way to fix this?
Is there a way to highlight some attribute, so that these can be displayed there? | 2015/02/18 | [
"https://magento.stackexchange.com/questions/57611",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | You issue with product image or product is not exiting in magento catalog
on items.phtml you call product image.it may this product is not this in magento.it delete but it details is in sales.
before before call the image you needcheck product is exit not
```
$prod=Mage::getModel('catalog/product')->load($_item->get... | Try to enable error printing by renaming `local.xml`.sample file to `local.xml` in errors directory and uncomment `ini_set('display_errors', 1);` in `index.php` in root. |
57,611 | In the list view, I want to display the 3 most important attributes of the product below the productname.
What is the best way to fix this?
Is there a way to highlight some attribute, so that these can be displayed there? | 2015/02/18 | [
"https://magento.stackexchange.com/questions/57611",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/16894/"
] | You issue with product image or product is not exiting in magento catalog
on items.phtml you call product image.it may this product is not this in magento.it delete but it details is in sales.
before before call the image you needcheck product is exit not
```
$prod=Mage::getModel('catalog/product')->load($_item->get... | You should see a long number on the screen along with the error message.
Look in the var/report folder for a file with the same name as the long number. That one contains the error message and stacktrace.
But without knowing what the file contains I will shoot in the dark and say that you had a certain payment me... |
278,999 | There are lots of answers to the question 'Can I email a SharePoint document', but they often seem to suffer from two defects:
```
1. They assume the recipient has access to my SharePoint site
2. Many are years’ old and are obsolete.
```
I often need to send documents to an external contact, so they must be an attac... | 2020/04/15 | [
"https://sharepoint.stackexchange.com/questions/278999",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/62819/"
] | You can use a state object to toggle what is rendered. When a state object is updated it will force a re-render of the component:
```
<div>
{
this.state.showNewForm ?
<NewFormComponent onCompleted={()=>this.setState({ showNewForm: false})} />
:
<ListComponent />
}
<button onClick={this.setState({ sh... | I will highly recommend using [react-router-dom](https://www.npmjs.com/package/react-router-dom). Below is a sample code from [here](https://codeburst.io/getting-started-with-react-router-5c978f70df91).
```
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import { Route, Link, BrowserRou... |
39,006,341 | I'm trying to do the following thing:
[](https://i.stack.imgur.com/Mlo14.png)
The red zone is an `AbsoluteLayout` that I want to move out of the screen as it's shown. I currently use `{Layout}.TranslateTo();` but it uses absolutes position so I don't... | 2016/08/17 | [
"https://Stackoverflow.com/questions/39006341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6093604/"
] | `AbsoluteLayout` accepts proportional size between 0 to 1. So you can assign like:
```
AbsoluteLayout.LayoutBounds="0,0,1,1"
AbsoluteLayout.LayoutFlags="SizeProportional"
```
which means that starts from (0,0) point and fill entire screen.
Your translating call should be like:
**Xaml**
```
<AbsoluteLayout x:Na... | Given you are in a forms project I would read in the screen height and width when app is launched and store it in a global variable. Something like this.
Android onCreate of MainActivity
```
//Get Screen Size of Phone for Android
var metrics = Resources.DisplayMetrics;
var widthInDp = ConvertPi... |
96,490 | Below are some puzzles you need to solve to make a **4 letter** word.
1.
>
>
> ```
> 105 35
> 315 ?
> ```
>
>
2.
>
>
> ```
> I am the most important element in your surrounding.
> I was found by a Scottish physician.
> Who am I?
> ```
>
>
3.
>
>
> ```
> I am made up of 3 digits.
> When you add the digi... | 2020/03/30 | [
"https://puzzling.stackexchange.com/questions/96490",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/66237/"
] | 1. >
> Traversing diagonals of the square, we can get from a 3-digit number to a 2-digit number by removing the middle digit: $315$ to $35$ and $105$ to $15$. So the answer could be $15$.
>
>
>
2. >
> As Shivansh Sharma found, the answer is Nitrogen, a chemical element with number $7$ in the periodic table.
>
> ... | Partial Answer
1.
>
> Could be **105** or **945**
>
>
>
2.
>
> The most important element in our surroundings is **Nitrogen**, discovered by Rutherford, a Scottish Physician.
>
>
>
3.
>
> The 3 numbers are 9, 1, 1 together making **911**. (9 + 1 + 1 = 11, 9 \* 1 \* 1 = 9)
>
>
>
So overall I think
... |
96,490 | Below are some puzzles you need to solve to make a **4 letter** word.
1.
>
>
> ```
> 105 35
> 315 ?
> ```
>
>
2.
>
>
> ```
> I am the most important element in your surrounding.
> I was found by a Scottish physician.
> Who am I?
> ```
>
>
3.
>
>
> ```
> I am made up of 3 digits.
> When you add the digi... | 2020/03/30 | [
"https://puzzling.stackexchange.com/questions/96490",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/66237/"
] | The answer to the puzzle is:
>
> **JAVA**
>
>
>
Puzzle 1:
>
> This is a puzzle of the form '105:315::35:?', i.e. '105 is to 315 as 35 is to ?' In this case, we see that we get 315 by tripling 105; do the same to 35 and we get the answer **105**. Note that the value of ASCII-105 is the letter '**I**'.
>
>
> ... | Partial Answer
1.
>
> Could be **105** or **945**
>
>
>
2.
>
> The most important element in our surroundings is **Nitrogen**, discovered by Rutherford, a Scottish Physician.
>
>
>
3.
>
> The 3 numbers are 9, 1, 1 together making **911**. (9 + 1 + 1 = 11, 9 \* 1 \* 1 = 9)
>
>
>
So overall I think
... |
96,490 | Below are some puzzles you need to solve to make a **4 letter** word.
1.
>
>
> ```
> 105 35
> 315 ?
> ```
>
>
2.
>
>
> ```
> I am the most important element in your surrounding.
> I was found by a Scottish physician.
> Who am I?
> ```
>
>
3.
>
>
> ```
> I am made up of 3 digits.
> When you add the digi... | 2020/03/30 | [
"https://puzzling.stackexchange.com/questions/96490",
"https://puzzling.stackexchange.com",
"https://puzzling.stackexchange.com/users/66237/"
] | The answer to the puzzle is:
>
> **JAVA**
>
>
>
Puzzle 1:
>
> This is a puzzle of the form '105:315::35:?', i.e. '105 is to 315 as 35 is to ?' In this case, we see that we get 315 by tripling 105; do the same to 35 and we get the answer **105**. Note that the value of ASCII-105 is the letter '**I**'.
>
>
> ... | 1. >
> Traversing diagonals of the square, we can get from a 3-digit number to a 2-digit number by removing the middle digit: $315$ to $35$ and $105$ to $15$. So the answer could be $15$.
>
>
>
2. >
> As Shivansh Sharma found, the answer is Nitrogen, a chemical element with number $7$ in the periodic table.
>
> ... |
2,110,455 | Consider $f(x) = \frac{1}{1+ \cos(x)}$ . I want to find $\lim \_{x\to \infty} f(x)$ using appropriate method.
My try : I'm really confused about limit of $\sin(x)$ and $\cos(x)$. Therefore I can't solve this problem. | 2017/01/23 | [
"https://math.stackexchange.com/questions/2110455",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/325808/"
] | $\lim\_{x\rightarrow \infty}f(x)=\lim\_{x\rightarrow \infty}\frac{1}{1+cosx}=\lim\_{x\rightarrow \infty}\frac{1}{2\times cos^2(\frac{x}{2})}=\frac{1}{2}\lim\_{x\rightarrow \infty}\frac{1}{cos^2(\frac{x}{2})}$
which has liminf $=\frac{1}{2}$ and limsup $=\infty$ ( because $0\leq cos^2 \frac{x}{2}\leq 1$ ). So doesn't ... | Okay lets take $x=t+\pi$ then we have that
$$\lim\_{x\to \infty}\frac{1}{1+\cos x}=\lim\_{t\to \infty}\frac{1}{1+\cos (t+\pi)}=\lim\_{t\to\infty}\frac{1}{1-\cos t}$$
So
$$\lim\_{x\to\infty}\frac{1}{1+\cos x}=\lim\_{x\to \infty}\frac{1}{1-\cos x}$$
This happens only if $\cos x\to 0$,now take $x=t-\pi/2$ and $x=t+\pi/2$ ... |
37,480 | I was wondering if Nautilus has undo/redo features for basic file operations. To be specific, I want to be able to undo moving, renaming or deleting a file. | 2011/04/28 | [
"https://askubuntu.com/questions/37480",
"https://askubuntu.com",
"https://askubuntu.com/users/15192/"
] | That's something that would be handled by Nautilus. I don't have it installed so I can't check (currently running Xubuntu) but I don't believe they have implemented it yet. [They are working on adding that feature](http://www.webupd8.org/2010/05/default-nautilus-will-soon-look-lot.html), and I believe [Nautilus Element... | Tried searching for undo option with an out-of-the box 11.04 Unity, seems like if you keep it stock, there is no option to undo changes. |
37,480 | I was wondering if Nautilus has undo/redo features for basic file operations. To be specific, I want to be able to undo moving, renaming or deleting a file. | 2011/04/28 | [
"https://askubuntu.com/questions/37480",
"https://askubuntu.com",
"https://askubuntu.com/users/15192/"
] | That's something that would be handled by Nautilus. I don't have it installed so I can't check (currently running Xubuntu) but I don't believe they have implemented it yet. [They are working on adding that feature](http://www.webupd8.org/2010/05/default-nautilus-will-soon-look-lot.html), and I believe [Nautilus Element... | Nautilus just recently got this feature to undo changes in GNOME 3.4. You can read about this feature in this [bug report](https://bugzilla.gnome.org/show_bug.cgi?id=648658.) which discussed the feature before implementing it.
But, what this means is that you can only undo your changes if you are using 12.04 as the N... |
37,480 | I was wondering if Nautilus has undo/redo features for basic file operations. To be specific, I want to be able to undo moving, renaming or deleting a file. | 2011/04/28 | [
"https://askubuntu.com/questions/37480",
"https://askubuntu.com",
"https://askubuntu.com/users/15192/"
] | Nautilus just recently got this feature to undo changes in GNOME 3.4. You can read about this feature in this [bug report](https://bugzilla.gnome.org/show_bug.cgi?id=648658.) which discussed the feature before implementing it.
But, what this means is that you can only undo your changes if you are using 12.04 as the N... | Tried searching for undo option with an out-of-the box 11.04 Unity, seems like if you keep it stock, there is no option to undo changes. |
15,634,445 | I am developing a camera app. I want to display a text view on the camera preview. If I add the text view, the app will show the text view with the default text. When I do setText, the app is crashing. Can any body tell what might be the reason for this?
```
<TextView android:layout_width="wrap_content" android:id="@... | 2013/03/26 | [
"https://Stackoverflow.com/questions/15634445",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2060617/"
] | There are a few tools to help you:
To get the history of a file you can just use `hg log FILE` which is probably the best starting point.
You can also use `hg annotate FILE` which lists every line in the file and says which revision changed it to be like it currently is. It can also take a revision using the `--rev R... | hg bisect lets you find the changeset that intoduced a problem. To start the search run the `hg bisect --reset` command. It is well document in **Mercurial: The Definitive Guide**. |
29,179,197 | I have Office 365 Developer account & tenant in windows azure to manage office 365 users.
using consent framework "prompt=admin\_consent", i granted access rights to one of my web application already registered in Azure AD (which is managed by me) to use office 365 API services, After granting access using admin consen... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29179197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4549055/"
] | Let me check with our Azure folks, but I believe if you granted admin consent you can remove it from the Azure Management Portal. When you navigate to apps, you will see apps that you've consented to along with apps that you've developed. You can remove it there. | After logging into your Microsoft user account, navigate to <https://account.live.com/consent/Manage>. This will display all the apps you've authorised to access resources on your behalf. Here select the application you want to revoke access for.
[](h... |
29,179,197 | I have Office 365 Developer account & tenant in windows azure to manage office 365 users.
using consent framework "prompt=admin\_consent", i granted access rights to one of my web application already registered in Azure AD (which is managed by me) to use office 365 API services, After granting access using admin consen... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29179197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4549055/"
] | Let me check with our Azure folks, but I believe if you granted admin consent you can remove it from the Azure Management Portal. When you navigate to apps, you will see apps that you've consented to along with apps that you've developed. You can remove it there. | If you have an organisation account with Microsoft you should be able to access this page: <https://portal.office.com/account>
From there click either `App permissions` on the left, or `Change app permission` in the middle.
[](https://i.stack.imgur.com/AeRwV... |
29,179,197 | I have Office 365 Developer account & tenant in windows azure to manage office 365 users.
using consent framework "prompt=admin\_consent", i granted access rights to one of my web application already registered in Azure AD (which is managed by me) to use office 365 API services, After granting access using admin consen... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29179197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4549055/"
] | Let me check with our Azure folks, but I believe if you granted admin consent you can remove it from the Azure Management Portal. When you navigate to apps, you will see apps that you've consented to along with apps that you've developed. You can remove it there. | if you have an admin rights go straight to: <https://portal.azure.com/#blade/Microsoft_AAD_IAM/StartboardApplicationsMenuBlade/AllApps/menuId/>
and remove it there |
29,179,197 | I have Office 365 Developer account & tenant in windows azure to manage office 365 users.
using consent framework "prompt=admin\_consent", i granted access rights to one of my web application already registered in Azure AD (which is managed by me) to use office 365 API services, After granting access using admin consen... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29179197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4549055/"
] | After logging into your Microsoft user account, navigate to <https://account.live.com/consent/Manage>. This will display all the apps you've authorised to access resources on your behalf. Here select the application you want to revoke access for.
[](h... | If you have an organisation account with Microsoft you should be able to access this page: <https://portal.office.com/account>
From there click either `App permissions` on the left, or `Change app permission` in the middle.
[](https://i.stack.imgur.com/AeRwV... |
29,179,197 | I have Office 365 Developer account & tenant in windows azure to manage office 365 users.
using consent framework "prompt=admin\_consent", i granted access rights to one of my web application already registered in Azure AD (which is managed by me) to use office 365 API services, After granting access using admin consen... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29179197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4549055/"
] | After logging into your Microsoft user account, navigate to <https://account.live.com/consent/Manage>. This will display all the apps you've authorised to access resources on your behalf. Here select the application you want to revoke access for.
[](h... | if you have an admin rights go straight to: <https://portal.azure.com/#blade/Microsoft_AAD_IAM/StartboardApplicationsMenuBlade/AllApps/menuId/>
and remove it there |
29,179,197 | I have Office 365 Developer account & tenant in windows azure to manage office 365 users.
using consent framework "prompt=admin\_consent", i granted access rights to one of my web application already registered in Azure AD (which is managed by me) to use office 365 API services, After granting access using admin consen... | 2015/03/21 | [
"https://Stackoverflow.com/questions/29179197",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4549055/"
] | if you have an admin rights go straight to: <https://portal.azure.com/#blade/Microsoft_AAD_IAM/StartboardApplicationsMenuBlade/AllApps/menuId/>
and remove it there | If you have an organisation account with Microsoft you should be able to access this page: <https://portal.office.com/account>
From there click either `App permissions` on the left, or `Change app permission` in the middle.
[](https://i.stack.imgur.com/AeRwV... |
26,818,142 | I have a silent post made when completing a paypal payflow. It returns a long string like:
&AVSZIP=X&TYPE=S&BILLTOEMAIL=no%40one.com
I inserted the bold part of the following script, which I had found searching around and thought it would do the trick. Perhaps I am completely misunderstanding how this works, but I t... | 2014/11/08 | [
"https://Stackoverflow.com/questions/26818142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4181428/"
] | ```
$result = preg_replace('/\(.+?\)/sm', 'Put your text here', $string);
```
Try this code
Or to save () add them to replacement
```
$page = preg_replace('/\(.+?\)/sm', '(Put your text here)', $page);
``` | This should work for you:
```
<?php
$string = "This is a (string)";
echo preg_replace("/\([^)]+\)/","",$string);
?>
```
Output:
```
This is a
``` |
26,818,142 | I have a silent post made when completing a paypal payflow. It returns a long string like:
&AVSZIP=X&TYPE=S&BILLTOEMAIL=no%40one.com
I inserted the bold part of the following script, which I had found searching around and thought it would do the trick. Perhaps I am completely misunderstanding how this works, but I t... | 2014/11/08 | [
"https://Stackoverflow.com/questions/26818142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4181428/"
] | ```
$result = preg_replace('/\(.+?\)/sm', 'Put your text here', $string);
```
Try this code
Or to save () add them to replacement
```
$page = preg_replace('/\(.+?\)/sm', '(Put your text here)', $page);
``` | Just change that:
```
$search = "/ *\(.*?\)/";
``` |
26,818,142 | I have a silent post made when completing a paypal payflow. It returns a long string like:
&AVSZIP=X&TYPE=S&BILLTOEMAIL=no%40one.com
I inserted the bold part of the following script, which I had found searching around and thought it would do the trick. Perhaps I am completely misunderstanding how this works, but I t... | 2014/11/08 | [
"https://Stackoverflow.com/questions/26818142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4181428/"
] | This should work for you:
```
<?php
$string = "This is a (string)";
echo preg_replace("/\([^)]+\)/","",$string);
?>
```
Output:
```
This is a
``` | Just change that:
```
$search = "/ *\(.*?\)/";
``` |
1,181,457 | The lifetimes of batteries are independent exponential random variables , each having parameter $\lambda$. A flashlight needs two batteries to work. If one has a flashlight and a stockpile of n batteries, What is the distribution of time that the flashlight can operate?
What I have so far:
Let $Y$ be the lifetime of ... | 2015/03/08 | [
"https://math.stackexchange.com/questions/1181457",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/128422/"
] | First, we need to be clear that in your problem $\lambda$ is the failure *rate* of each battery, not the mean time until failure. (Both parameterizations of the exponential distribution are in use.)
Second, we need to assume that all the batteries are subject to failure
from the start. Also, your flashlight is
useless ... | This is not an answer, but will not fit in a comment.
Given $n$ batteries with run times $x\_1,...,x\_n$ (unknown to the user), just computing the operating time is moderately complex.
For example, suppose we have 3 batteries.
One starts with batteries $1,2$, then replaces $1$ by $3$ if $x\_1<x\_2$ in which case the... |
1,181,457 | The lifetimes of batteries are independent exponential random variables , each having parameter $\lambda$. A flashlight needs two batteries to work. If one has a flashlight and a stockpile of n batteries, What is the distribution of time that the flashlight can operate?
What I have so far:
Let $Y$ be the lifetime of ... | 2015/03/08 | [
"https://math.stackexchange.com/questions/1181457",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/128422/"
] | **Second answer,** for a different interpretation: Batteries cannot die before they go into the flashlight. Because this interpretation involves both the
minimum of two exponentials and the sum of several exponentials, it makes a
more interesting problem than did the assumptions in my first answer. It is the interpreta... | First, we need to be clear that in your problem $\lambda$ is the failure *rate* of each battery, not the mean time until failure. (Both parameterizations of the exponential distribution are in use.)
Second, we need to assume that all the batteries are subject to failure
from the start. Also, your flashlight is
useless ... |
1,181,457 | The lifetimes of batteries are independent exponential random variables , each having parameter $\lambda$. A flashlight needs two batteries to work. If one has a flashlight and a stockpile of n batteries, What is the distribution of time that the flashlight can operate?
What I have so far:
Let $Y$ be the lifetime of ... | 2015/03/08 | [
"https://math.stackexchange.com/questions/1181457",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/128422/"
] | **Second answer,** for a different interpretation: Batteries cannot die before they go into the flashlight. Because this interpretation involves both the
minimum of two exponentials and the sum of several exponentials, it makes a
more interesting problem than did the assumptions in my first answer. It is the interpreta... | This is not an answer, but will not fit in a comment.
Given $n$ batteries with run times $x\_1,...,x\_n$ (unknown to the user), just computing the operating time is moderately complex.
For example, suppose we have 3 batteries.
One starts with batteries $1,2$, then replaces $1$ by $3$ if $x\_1<x\_2$ in which case the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.