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 |
|---|---|---|---|---|---|
191,981 | Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture?
They have a culture-religion that is fully integrated with nature, and th... | 2020/12/14 | [
"https://worldbuilding.stackexchange.com/questions/191981",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/81238/"
] | Maybe in the sea
----------------
I think it is possible, with aquatic species. Ocean is different from land in all the ways that makes rise of sapience possible (hello dolphins), but limits severely what kind of technology they can use. There's no fire, no metals, so your species population density might reach those ... | Yes, technology and advanced civilisation are not related. The most advanced civilisations may have no recognisable technology and be completely integrated with nature, working with it instead of against it, without war, crime, poverty or hatred.
Other cultures will sneer at them as mere hippies, or decry the entire c... |
191,981 | Can a civilization be highly evolved as far as culture, ethics, societal norms, laws, language, literature and arts, but not ever come to develop any sort of advanced technology besides main practical techniques for construction and agriculture?
They have a culture-religion that is fully integrated with nature, and th... | 2020/12/14 | [
"https://worldbuilding.stackexchange.com/questions/191981",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/81238/"
] | **Maybe, if they can overcome population density issues.**
The key way to develop all of those civilization issues is to have a very high density of people working together on shared ideas, without them needing to mine the landscape and so gaining greater technology as they get better at mining.
As such, you need nat... | ### Maybe, in a magically-powered fantasy universe with inconsistent physics.
In fantasy world where the laws of physics behave in an inconsistent fashion but there is sufficient amounts of magic to allow life to function despite that, it might be possible that a society doesn't develop much if any technology if it re... |
52,199,086 | I am working with sas to manipulate some dataset.
I am using the data step to apply some condition to keep columns and filter on some values.
The problem is that I would like to filter on columns that in the end I will not need, so I would like to apply, first, the where clause, and then the keep clause.
The problem is... | 2018/09/06 | [
"https://Stackoverflow.com/questions/52199086",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4332914/"
] | This can be achieved by using the `keep` data set option on the output data set, e.g.(untested):
```
data newtable(keep=var2);
set mytable(where=(var1<value));
end;
```
Alternatively a `keep` statement can be used, e.g. (untested):
```
data newtable;
set mytable(where=(var1<value));
keep var2;
end;
``` | @Amir has the right of it. @Quentin is worried about the efficiency of it all. Unless your where clause is highly involved, then this will be your most efficient method.
```
data newtable;
set mytable(where=(var1<value) keep=var1 var2);
keep var2;
end;
```
Yes, `var1` is read into the PDV, but you have limited t... |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | It is `Input` and not `input`.
[This commit](https://github.com/laravel/laravel/commit/2adbbbd91e9d6e2d569cc56f138b7273efe25651) removed `Input` facade definition from `config/app.php` hence you have to manually add that in to `aliases` array as below,
```
'Input' => Illuminate\Support\Facades\Input::class,
```
Or Y... | It's changed in laravel 6. [See for more info here](https://laravel.com/docs/6.x/upgrade#the-input-facade)
Don't do anything in app.php and anywhere else, just replace
input::get() with Request::input()
and
on top where you declare Input,Validator,Hash etc., remove **Input** and add **Request**
use something like ... |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | In first your problem is about the spelling of the input class, should be Input instead of input. And you have to import the class with the good namespace.
```
use Illuminate\Support\Facades\Input;
```
If you want it called 'input' not 'Input', add this :
```
use Illuminate\Support\Facades\Input as input;
```
Se... | Declaration in config/app.php under aliases:-
```
'Input' => Illuminate\Support\Facades\Input::class,
```
Or You can import Input facade directly as required,
```
use Illuminate\Support\Facades\Input;
```
or
```
use Illuminate\Support\Facades\Input as input;
``` |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | In first your problem is about the spelling of the input class, should be Input instead of input. And you have to import the class with the good namespace.
```
use Illuminate\Support\Facades\Input;
```
If you want it called 'input' not 'Input', add this :
```
use Illuminate\Support\Facades\Input as input;
```
Se... | ```
#config/app.php
'aliases' => [
...
'Input' => Illuminate\Support\Facades\Input::class,
...
],
#Use Controller file
use Illuminate\Support\Facades\Input;
==OR==
use Input;
```
Read full example: <https://devnote.in/laravel-class-input-not-found> |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | **In larvel => 6 Version:**
Input no longer exists In larvel 6,7,8 Version. Use `Request` instead of `Input`.
**Based on the Laravel [docs](https://laravel.com/docs/6.x/upgrade#the-input-facade), since version 6.x Input has been removed.**
**The Input Facade**
*Likelihood Of Impact: Medium*
>
> The `Input` facade... | `'Input' => Illuminate\Support\Facades\Input::class`, add it to App.php. |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | You can add a facade in your `folder\config\app.php`
```
'Input' => Illuminate\Support\Facades\Input::class,
``` | ```
#config/app.php
'aliases' => [
...
'Input' => Illuminate\Support\Facades\Input::class,
...
],
#Use Controller file
use Illuminate\Support\Facades\Input;
==OR==
use Input;
```
Read full example: <https://devnote.in/laravel-class-input-not-found> |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | Declaration in config/app.php under aliases:-
```
'Input' => Illuminate\Support\Facades\Input::class,
```
Or You can import Input facade directly as required,
```
use Illuminate\Support\Facades\Input;
```
or
```
use Illuminate\Support\Facades\Input as input;
``` | Add this in config/app.php under aliases:-
```
'Input' => Illuminate\Support\Facades\Input::class,
``` |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | For laravel `<` **5.2**:
Open `config/app.php` and add the `Input` class to `aliases`:
```
'aliases' => [
// ...
'Input' => Illuminate\Support\Facades\Input::class,
// ...
],
```
---
For laravel `>=` **5.2**
Change `Input::` to `Request::` | Miscall of Class it should be `Input` not `input` |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | if You use Laravel version 5.2 Review this: <https://laravel.com/docs/5.2/requests#accessing-the-request>
```
use Illuminate\Http\Request;//Access able for All requests
...
class myController extends Controller{
public function myfunction(Request $request){
$name = $request->input('username');
}
}
``` | `'Input' => Illuminate\Support\Facades\Input::class`, add it to App.php. |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | **In larvel => 6 Version:**
Input no longer exists In larvel 6,7,8 Version. Use `Request` instead of `Input`.
**Based on the Laravel [docs](https://laravel.com/docs/6.x/upgrade#the-input-facade), since version 6.x Input has been removed.**
**The Input Facade**
*Likelihood Of Impact: Medium*
>
> The `Input` facade... | Miscall of Class it should be `Input` not `input` |
31,696,681 | In mathematics we can assume that `sin(t1)` is equal to `t1` for very small angles. How to do that in Matlab?
```
syms t1;
res = sin(t1);
res2= MAGIC(res,t1);
```
I need `MAGIC`to change `res`, such that it becomes `t1`.
Thanks | 2015/07/29 | [
"https://Stackoverflow.com/questions/31696681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5168730/"
] | In Laravel 5.2 Input:: is replaced with Request::
use
```
Request::
```
Add to the top of Controller or any other Class
```
use Illuminate\Http\Request;
``` | `'Input' => Illuminate\Support\Facades\Input::class`, add it to App.php. |
58,370,647 | I am using Windows 10 and Windows subsystem for linux.
I have started creating my own Operating System in Assembly and C.
I am following a tutorial.
I got stuck into 2 problems.
Error 1:
When I Link and create bin files, i am getting a warning:
"ld: warning: cannot find entry symbol \_start; defaulting to 000000000000... | 2019/10/14 | [
"https://Stackoverflow.com/questions/58370647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | try the following code:
```
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
if textField.text?.count ?? 0 <= 7{
if textField.text?.count ?? 0 == 7{
DispatchQueue.main.async {
textField.... | What happen if you try this code?
```
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool
{
if range.location < 8 {
return true
}
// return NO to not change text
return false
}
``` |
58,370,647 | I am using Windows 10 and Windows subsystem for linux.
I have started creating my own Operating System in Assembly and C.
I am following a tutorial.
I got stuck into 2 problems.
Error 1:
When I Link and create bin files, i am getting a warning:
"ld: warning: cannot find entry symbol \_start; defaulting to 000000000000... | 2019/10/14 | [
"https://Stackoverflow.com/questions/58370647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I solved the problem by changing the kern after the last character. So now, instead of jumping 40pt, cursor jumps only 1pt (or whatever you set on below method)
```
@objc private func textFieldDidChange() {
guard let text = textField.text else { return }
if text.count == Constant.deviceCodeCharacterCount {
... | What happen if you try this code?
```
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool
{
if range.location < 8 {
return true
}
// return NO to not change text
return false
}
``` |
58,370,647 | I am using Windows 10 and Windows subsystem for linux.
I have started creating my own Operating System in Assembly and C.
I am following a tutorial.
I got stuck into 2 problems.
Error 1:
When I Link and create bin files, i am getting a warning:
"ld: warning: cannot find entry symbol \_start; defaulting to 000000000000... | 2019/10/14 | [
"https://Stackoverflow.com/questions/58370647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I solved the problem by changing the kern after the last character. So now, instead of jumping 40pt, cursor jumps only 1pt (or whatever you set on below method)
```
@objc private func textFieldDidChange() {
guard let text = textField.text else { return }
if text.count == Constant.deviceCodeCharacterCount {
... | try the following code:
```
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
if textField.text?.count ?? 0 <= 7{
if textField.text?.count ?? 0 == 7{
DispatchQueue.main.async {
textField.... |
4,605,722 | What does the notation $[G : H]$ mean in group theory? Does it mean the same as quotient group? I have seen the above notation a lot while studying group theory but it still remains unclear to me about the meaning of this notation? | 2022/12/26 | [
"https://math.stackexchange.com/questions/4605722",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1129649/"
] | The index $[G:H]$ is the number of left cosets of $H$ in $G$ and it is the number of right cosets of $H$ in $G$. That those numbers are equal is obvious when $G$ is abelian, but it is true for all groups and this does *not* require $G$ to be finite, so the equality is not fully explained by relying on Lagrange’s theore... | We understand mathematics through examples, we appropriate notions through examples that we construct.
Let's take an example that is simple enough to be understood by everyone.
Let $G:=(\mathbb Z/6\mathbb Z,+)=(\{\bar0,\bar1,\bar2,\bar3,\bar4,\bar5,\},+)$ and $H:=\{\bar0,\bar3\}$.
$G/H=\{H,\bar1+H,\bar2+H\}=\{\{\bar0... |
4,605,722 | What does the notation $[G : H]$ mean in group theory? Does it mean the same as quotient group? I have seen the above notation a lot while studying group theory but it still remains unclear to me about the meaning of this notation? | 2022/12/26 | [
"https://math.stackexchange.com/questions/4605722",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1129649/"
] | The index $[G:H]$ is the number of left cosets of $H$ in $G$ and it is the number of right cosets of $H$ in $G$. That those numbers are equal is obvious when $G$ is abelian, but it is true for all groups and this does *not* require $G$ to be finite, so the equality is not fully explained by relying on Lagrange’s theore... | The notation is about a subgroup $H$ of $G$. It is the number of cosets of $H$ in $G$, called the *index of $H$ in $G$*. For example, in $G=\Bbb Z\_6$, we have a subgroup $H=\{ [0]\_6, [2]\_6, [4]\_6\}$; then $H$ and $[1]\_6+H$ are the only cosets (exercise), so $[G:H]=2$. |
4,605,722 | What does the notation $[G : H]$ mean in group theory? Does it mean the same as quotient group? I have seen the above notation a lot while studying group theory but it still remains unclear to me about the meaning of this notation? | 2022/12/26 | [
"https://math.stackexchange.com/questions/4605722",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/1129649/"
] | The index $[G:H]$ is the number of left cosets of $H$ in $G$ and it is the number of right cosets of $H$ in $G$. That those numbers are equal is obvious when $G$ is abelian, but it is true for all groups and this does *not* require $G$ to be finite, so the equality is not fully explained by relying on Lagrange’s theore... | $[G:H]$ is very similar to the usual notation of a division. It kind of stands for the number of how many times $H$ fits into $G.$ It is the number of elements of $\left|G/H\right|$ and
\begin{align\*}
G/H=\{g\cdot H\,|\,g\in G\}&=\{1\cdot H, g\_2\cdot H, g\_3\cdot H, g\_4\cdot H,\ldots,g\_{[G:H]}H\}\\
&=H\,\dot\cup\, ... |
32,774,235 | My customers are not receiving SMS to verify their OTP. We have integrated Twilio with Parse and is using it for OTP Authentication. We are based out of India.
We faced this during test account. It never used to send SMS in the night and received all SMS next day morning. Now we are using a paid account and still the... | 2015/09/25 | [
"https://Stackoverflow.com/questions/32774235",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5373344/"
] | India is difficult to get text messages to, there are lots of rules and restrictions
Completed a project recently using a Twilio competitor (Clickatell) and it was the very same problem.
Frow Twilio's website:
**Are there limitations on sending SMS messages to Indian mobile devices?**
>
> **3. They are only delive... | As E.J. said above, India has a lot of regulations to follow when sending SMS.
This is not a Twilio specific issue.. Other SMS APIs will have the same outcome.
For example, as stated on Nexmo's Country Specific Rules & Regulations webpage:
"We can only guarantee message delivery between 9am to 9pm. Messages submitt... |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | I found a good detailed tutorial on how to allow your lambda to connect to both VPC ressources and the internet here: <https://gist.github.com/reggi/dc5f2620b7b4f515e68e46255ac042a7>
A quick walk-through:
* setup new subnets for your lambda (with CIDRs not overlapping your existing subnets). You need:
+ one subnet w... | You need two different subnets. It sounds as if you only have one.
Lambda can only use *private* subnets inside VPC.
Definition of a private subnet: the default route is a NAT instance (which most be on a different, public subnet) or a NAT Gateway, and *no* machines in the subnet have a public IP address. Machines w... |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | Hey guys I developed a step by step tutorial with explicit screenshots about it:
Part I
1. Create a lambda function in AWS
2. Create an API Gateway to redirect all the requests to your AWS Lambda Function
<https://medium.com/@shontauro/how-can-i-turn-my-restful-api-into-a-serverless-application-and-deploy-it-to-aws-l... | You actually don't need to create Internet and NAT gateways anymore:<https://aws.amazon.com/blogs/security/how-to-connect-to-aws-secrets-manager-service-within-a-virtual-private-cloud/> |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | You need both the IGW and the NAT gateway for this to work.
In the public subnets (ones you want to reach from outside) point the 0.0.0.0/0 traffic to the IGW gateway. The NAT gateway itself needs to sit in one of these public subnets.
In the private subnets that you want to NAT point 0.0.0.0/0 traffic to the NAT ga... | You actually don't need to create Internet and NAT gateways anymore:<https://aws.amazon.com/blogs/security/how-to-connect-to-aws-secrets-manager-service-within-a-virtual-private-cloud/> |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | For using your Lambda inside of your VPC and internet access:
I believe, most of you already have IGW ,that you're working with inside of your VPC and working with internet,so no need create a new one.
Steps worked for me:
1. Create a new subnets (recommended 2 or more) under your main VPC. Give it new CIDR with ... | You actually don't need to create Internet and NAT gateways anymore:<https://aws.amazon.com/blogs/security/how-to-connect-to-aws-secrets-manager-service-within-a-virtual-private-cloud/> |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | You need both the IGW and the NAT gateway for this to work.
In the public subnets (ones you want to reach from outside) point the 0.0.0.0/0 traffic to the IGW gateway. The NAT gateway itself needs to sit in one of these public subnets.
In the private subnets that you want to NAT point 0.0.0.0/0 traffic to the NAT ga... | For using your Lambda inside of your VPC and internet access:
I believe, most of you already have IGW ,that you're working with inside of your VPC and working with internet,so no need create a new one.
Steps worked for me:
1. Create a new subnets (recommended 2 or more) under your main VPC. Give it new CIDR with ... |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | You need two different subnets. It sounds as if you only have one.
Lambda can only use *private* subnets inside VPC.
Definition of a private subnet: the default route is a NAT instance (which most be on a different, public subnet) or a NAT Gateway, and *no* machines in the subnet have a public IP address. Machines w... | You actually don't need to create Internet and NAT gateways anymore:<https://aws.amazon.com/blogs/security/how-to-connect-to-aws-secrets-manager-service-within-a-virtual-private-cloud/> |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | You need both the IGW and the NAT gateway for this to work.
In the public subnets (ones you want to reach from outside) point the 0.0.0.0/0 traffic to the IGW gateway. The NAT gateway itself needs to sit in one of these public subnets.
In the private subnets that you want to NAT point 0.0.0.0/0 traffic to the NAT ga... | I found a good detailed tutorial on how to allow your lambda to connect to both VPC ressources and the internet here: <https://gist.github.com/reggi/dc5f2620b7b4f515e68e46255ac042a7>
A quick walk-through:
* setup new subnets for your lambda (with CIDRs not overlapping your existing subnets). You need:
+ one subnet w... |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | Hey guys I developed a step by step tutorial with explicit screenshots about it:
Part I
1. Create a lambda function in AWS
2. Create an API Gateway to redirect all the requests to your AWS Lambda Function
<https://medium.com/@shontauro/how-can-i-turn-my-restful-api-into-a-serverless-application-and-deploy-it-to-aws-l... | For using your Lambda inside of your VPC and internet access:
I believe, most of you already have IGW ,that you're working with inside of your VPC and working with internet,so no need create a new one.
Steps worked for me:
1. Create a new subnets (recommended 2 or more) under your main VPC. Give it new CIDR with ... |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | I found a good detailed tutorial on how to allow your lambda to connect to both VPC ressources and the internet here: <https://gist.github.com/reggi/dc5f2620b7b4f515e68e46255ac042a7>
A quick walk-through:
* setup new subnets for your lambda (with CIDRs not overlapping your existing subnets). You need:
+ one subnet w... | For using your Lambda inside of your VPC and internet access:
I believe, most of you already have IGW ,that you're working with inside of your VPC and working with internet,so no need create a new one.
Steps worked for me:
1. Create a new subnets (recommended 2 or more) under your main VPC. Give it new CIDR with ... |
35,455,281 | As per [this document](http://docs.aws.amazon.com/lambda/latest/dg/vpc.html), if I need to access internet resources from my Lambda function with VPC access, I need to set up a NAT gateway.
So I followed [this guide](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html) to set up a NAT gateway. ... | 2016/02/17 | [
"https://Stackoverflow.com/questions/35455281",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3097807/"
] | You need two different subnets. It sounds as if you only have one.
Lambda can only use *private* subnets inside VPC.
Definition of a private subnet: the default route is a NAT instance (which most be on a different, public subnet) or a NAT Gateway, and *no* machines in the subnet have a public IP address. Machines w... | For using your Lambda inside of your VPC and internet access:
I believe, most of you already have IGW ,that you're working with inside of your VPC and working with internet,so no need create a new one.
Steps worked for me:
1. Create a new subnets (recommended 2 or more) under your main VPC. Give it new CIDR with ... |
40,823,052 | I need to create the spacing between the two `<i>` tags, and make a vertical line in between them.
Here is my code:
```css
#wrap {
width: 650px;
margin: 0 auto;
}
#left_col {
float: left;
width: 300px;
}
#right_col {
float: right;
width: 300px;
padding-left: 20px;
}
```
```html
<div id="w... | 2016/11/26 | [
"https://Stackoverflow.com/questions/40823052",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7183476/"
] | Like this is one way. I think you want a **vertical** line like this :
```css
#wrap {
width: 650px;
margin: 0 auto;
}
#left_col {
float: left;
width: 300px;
}
#right_col {
float: right;
width: 300px;
padding-left: 20px;
}
.cont i {
text-align: center;
margin: 5px;
padding:5px;
li... | You can add a line-height to the i and then to get the line under you add a
```
hr
```
tag.
```css
i, cite, em, var, address, dfn {
line-height: 30px;
}
#wrap {
width: 650px;
margin: 0 auto;
}
#left_col {
float: left;
width: 300px;
}
#right_col {
float: right;
width: 300px;
padding-l... |
32,190,870 | I have an AngularJS app that is using node.js and Loopbackjs to communicate with a mysql database. I am able to properly show my GET request on the `partial-home.html` aspect of the page, but when I create a new user it returns the following error:
```
POST http://localhost:3000/api/se_users 422 (Unprocessable Entity)... | 2015/08/24 | [
"https://Stackoverflow.com/questions/32190870",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5240486/"
] | Change your create line from
```
Se_user
.create($scope.user);
```
to
```
Se_user
.create($scope.user,
function(newUser) {
console.log(newUser);
// only set pristine here, this
// callback fires on success
$scope.create.$setPristine();
},
function(err) {
console.log(err); // will log the ... | Try changing the content type of the header:
```
header: { 'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8;application/json' }
``` |
414,324 | I have a cloud masked Landsat 7 image collection. For each image I want to [unmask](https://developers.google.com/earth-engine/apidocs/ee-image-unmask) the bands with their respective mean value.
This works fine, unless an image is completely cloud masked and therefore contains no data.
I tried adapting this [related... | 2021/10/19 | [
"https://gis.stackexchange.com/questions/414324",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/128665/"
] | Yes, it is absolutely possible using `GDAL/OGR` through `ogr2ogr` by using `-simplify` option. You should pass a `<tolerance>` value as it is described [on their website.](https://gdal.org/programs/ogr2ogr.html#cmdoption-ogr2ogr-simplify)
Another way is to use `osgeo.ogr.Geometry.Buffer(self, *args, **kwargs)` on whic... | You could use GRASS GIS:
Create `grass_batch_job.sh` file for GRASS GIS:
```
v.in.ogr min_area=0.0001 snap=-1.0 input="input_file.shp" output="my_vector" --overwrite -o
v.generalize input=my_vector type="line,boundary,area" method="chaiken" threshold=1 look_ahead=7 reduction=50 slide=0.5 angle_thresh=3 degree_thresh=... |
45,241 | I am really unsure about how to go about this question and which circuits to consider.
Here's the question:
Determine the value of the current labeled \$i\$ and the voltage labeled \$v\$ at \$t=0+\$, \$t=1.5ms\$, and \$t = 3.0ms\$.
The circuit is as follows:

[sim... | 2012/10/22 | [
"https://electronics.stackexchange.com/questions/45241",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/15477/"
] | The voltage across a capacitor discharging into a fixed resistance decays exponentially. The time constant is RC, where C is the capacitance, and R is the resistance between the terminals of the resistor.
$$
V(t)=V(0)e^{\frac{-t}{RC}} \\
$$
You're right that the capacitor starts at 20V, because that's the voltage acr... | When solving problems like this, it is helpful to draw the two *different* circuits that exist before and after \$t=0\$.
Before, with the switch open, since the circuit is in DC steady state, replace the capacitor with an open circuit and then it is easy to solve for \$v\_C(0)\$, the initial condition.
After, with th... |
45,241 | I am really unsure about how to go about this question and which circuits to consider.
Here's the question:
Determine the value of the current labeled \$i\$ and the voltage labeled \$v\$ at \$t=0+\$, \$t=1.5ms\$, and \$t = 3.0ms\$.
The circuit is as follows:

[sim... | 2012/10/22 | [
"https://electronics.stackexchange.com/questions/45241",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/15477/"
] | When solving problems like this, it is helpful to draw the two *different* circuits that exist before and after \$t=0\$.
Before, with the switch open, since the circuit is in DC steady state, replace the capacitor with an open circuit and then it is easy to solve for \$v\_C(0)\$, the initial condition.
After, with th... | Current in an inductor cannot change suddenly (i.e in zero time). Similarly voltage across a capacitor cannot change suddenly.So \$Vc(0+) = Vc(0-)\$. At \$0-\$ time capacitor is an open circuit (because after a long duration capacitor cannot charge anymore and takes 0 current). So \$Vc(0-)\$ is \$20V\$ which is equal t... |
45,241 | I am really unsure about how to go about this question and which circuits to consider.
Here's the question:
Determine the value of the current labeled \$i\$ and the voltage labeled \$v\$ at \$t=0+\$, \$t=1.5ms\$, and \$t = 3.0ms\$.
The circuit is as follows:

[sim... | 2012/10/22 | [
"https://electronics.stackexchange.com/questions/45241",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/15477/"
] | When solving problems like this, it is helpful to draw the two *different* circuits that exist before and after \$t=0\$.
Before, with the switch open, since the circuit is in DC steady state, replace the capacitor with an open circuit and then it is easy to solve for \$v\_C(0)\$, the initial condition.
After, with th... | at t=0 the equivalent circuit is very simple.

Since the switch is ideal, it will have 0V drop circulating all the current source and thus closing the path out of the circuit.
Thus the 20V initial condition discharges with an RC time constant of 20u... |
45,241 | I am really unsure about how to go about this question and which circuits to consider.
Here's the question:
Determine the value of the current labeled \$i\$ and the voltage labeled \$v\$ at \$t=0+\$, \$t=1.5ms\$, and \$t = 3.0ms\$.
The circuit is as follows:

[sim... | 2012/10/22 | [
"https://electronics.stackexchange.com/questions/45241",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/15477/"
] | When solving problems like this, it is helpful to draw the two *different* circuits that exist before and after \$t=0\$.
Before, with the switch open, since the circuit is in DC steady state, replace the capacitor with an open circuit and then it is easy to solve for \$v\_C(0)\$, the initial condition.
After, with th... | The original post mentions current 'i' etc, but the current 'i' etc is not shown in the original circuit diagram. Also, the question is not clearly defined because for these kinds of problems, it's necessary to state the position of the switch (open or closed) at time t < 0. If assuming the switch is open at t < 0, the... |
45,241 | I am really unsure about how to go about this question and which circuits to consider.
Here's the question:
Determine the value of the current labeled \$i\$ and the voltage labeled \$v\$ at \$t=0+\$, \$t=1.5ms\$, and \$t = 3.0ms\$.
The circuit is as follows:

[sim... | 2012/10/22 | [
"https://electronics.stackexchange.com/questions/45241",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/15477/"
] | The voltage across a capacitor discharging into a fixed resistance decays exponentially. The time constant is RC, where C is the capacitance, and R is the resistance between the terminals of the resistor.
$$
V(t)=V(0)e^{\frac{-t}{RC}} \\
$$
You're right that the capacitor starts at 20V, because that's the voltage acr... | Current in an inductor cannot change suddenly (i.e in zero time). Similarly voltage across a capacitor cannot change suddenly.So \$Vc(0+) = Vc(0-)\$. At \$0-\$ time capacitor is an open circuit (because after a long duration capacitor cannot charge anymore and takes 0 current). So \$Vc(0-)\$ is \$20V\$ which is equal t... |
45,241 | I am really unsure about how to go about this question and which circuits to consider.
Here's the question:
Determine the value of the current labeled \$i\$ and the voltage labeled \$v\$ at \$t=0+\$, \$t=1.5ms\$, and \$t = 3.0ms\$.
The circuit is as follows:

[sim... | 2012/10/22 | [
"https://electronics.stackexchange.com/questions/45241",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/15477/"
] | The voltage across a capacitor discharging into a fixed resistance decays exponentially. The time constant is RC, where C is the capacitance, and R is the resistance between the terminals of the resistor.
$$
V(t)=V(0)e^{\frac{-t}{RC}} \\
$$
You're right that the capacitor starts at 20V, because that's the voltage acr... | at t=0 the equivalent circuit is very simple.

Since the switch is ideal, it will have 0V drop circulating all the current source and thus closing the path out of the circuit.
Thus the 20V initial condition discharges with an RC time constant of 20u... |
45,241 | I am really unsure about how to go about this question and which circuits to consider.
Here's the question:
Determine the value of the current labeled \$i\$ and the voltage labeled \$v\$ at \$t=0+\$, \$t=1.5ms\$, and \$t = 3.0ms\$.
The circuit is as follows:

[sim... | 2012/10/22 | [
"https://electronics.stackexchange.com/questions/45241",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/15477/"
] | The voltage across a capacitor discharging into a fixed resistance decays exponentially. The time constant is RC, where C is the capacitance, and R is the resistance between the terminals of the resistor.
$$
V(t)=V(0)e^{\frac{-t}{RC}} \\
$$
You're right that the capacitor starts at 20V, because that's the voltage acr... | The original post mentions current 'i' etc, but the current 'i' etc is not shown in the original circuit diagram. Also, the question is not clearly defined because for these kinds of problems, it's necessary to state the position of the switch (open or closed) at time t < 0. If assuming the switch is open at t < 0, the... |
37,726,210 | My app simply is not showing for Android 6 devices on the Play Store. I tried Google support and they didn't know the problem either.
My manifest doesn't have any specific limitations on API 23 and only GPS for uses-feature, however no device manages to be able to install the app.
```
<?xml version="1.0" encoding="utf... | 2016/06/09 | [
"https://Stackoverflow.com/questions/37726210",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3335648/"
] | After chatting with the Google support team, they shared with me the problem.
Their report gave this on a Samsung S5 phone:
```
Missing device feature:
android.hardware.telephony
```
Google Play is marking Android 6.0.x phones as not compatible when using the *android.hardware.telephony*, even if the device has it;... | Make sure the right SDK version is defined in build.gradle as well.
```
defaultConfig {
/**
* applicationId uniquely identifies the package for publishing.
* However, your source code should still reference the package name
* defined by the package attribute in the main/AndroidManifest.xml file.
... |
48,256,681 | I use a open API get the bellow information using its access key:
```
HTTPConnectionPool(host='freeipapi.17mon.cn', port=80): Max retries exceeded with url: /183.11.178.118 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x103780780>: Failed to establish a new connection: [Errno 8] nodename... | 2018/01/15 | [
"https://Stackoverflow.com/questions/48256681",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6523163/"
] | Your data is actually returned by `result.json()`.
Perhaps you are confused by the extra `HTTPConnectionPool` details.
That could be an indicator that `result.json()` has a custom representation (as in, it implements `__repr__` or `__str__`) and appends that data behind the scenes when printing. | Use requests. Much easier. `pip install requests`
Then:
```
import requests
ak_url="http://api.map.baidu.com/location/ip"
BAIDU_IPADDR_AK = 'test'
result = requests.get(ak_url,{"ip":"183.11.178.1","ak":BAIDU_IPADDR_AK})
print(result.json())
```
I get this result:
```
{'status': 200, 'message': 'APP不存在,AK有误请检查再重试'... |
25,615,609 | I tried `[[UIScreen mainScreen] bounds]` to get the screen size of a resizable iPhone on `Xcode 6` simulator. But it doesn't take into account the new screen width and screen height I assign to it.
Is there a better way to get the screen size? Even if I set the screen size to **320x800** the `[[UIScreen mainScreen] bo... | 2014/09/02 | [
"https://Stackoverflow.com/questions/25615609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3256150/"
] | Do following
**CGRect Rect=[[UIScreen mainScreen] bounds];**
So it will preserves the bounds in the rect.
try once. | This gets in iOS8 and iOS9. Not sure about 7 haven't tested:
```
var screenWidth: CGFloat {
if UIInterfaceOrientationIsPortrait(screenOrientation) {
return UIScreen.mainScreen().bounds.size.width
} else {
return UIScreen.mainScreen().bounds.size.height
}
}
var screenHeight: CGFloat {
if... |
25,615,609 | I tried `[[UIScreen mainScreen] bounds]` to get the screen size of a resizable iPhone on `Xcode 6` simulator. But it doesn't take into account the new screen width and screen height I assign to it.
Is there a better way to get the screen size? Even if I set the screen size to **320x800** the `[[UIScreen mainScreen] bo... | 2014/09/02 | [
"https://Stackoverflow.com/questions/25615609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3256150/"
] | Do following
**CGRect Rect=[[UIScreen mainScreen] bounds];**
So it will preserves the bounds in the rect.
try once. | In Swift 4.0, 3.0
```
let screenRect:CGRect = UIScreen.main.bounds
``` |
25,615,609 | I tried `[[UIScreen mainScreen] bounds]` to get the screen size of a resizable iPhone on `Xcode 6` simulator. But it doesn't take into account the new screen width and screen height I assign to it.
Is there a better way to get the screen size? Even if I set the screen size to **320x800** the `[[UIScreen mainScreen] bo... | 2014/09/02 | [
"https://Stackoverflow.com/questions/25615609",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3256150/"
] | In Swift 4.0, 3.0
```
let screenRect:CGRect = UIScreen.main.bounds
``` | This gets in iOS8 and iOS9. Not sure about 7 haven't tested:
```
var screenWidth: CGFloat {
if UIInterfaceOrientationIsPortrait(screenOrientation) {
return UIScreen.mainScreen().bounds.size.width
} else {
return UIScreen.mainScreen().bounds.size.height
}
}
var screenHeight: CGFloat {
if... |
3,214,701 | Determine the conditions on $b\_1$, $b\_2$, $b\_3$, if any, in order to guarantee that the linear system is consistent.
$x + 3y − 2z = b\_1$
$5x − 5y + 4z = b\_2$
$−3x + 11y − 8z = b\_3$.
Consider the system of equations
$x + y + 2z = a $
$x + z = b$
$2x + y + 3z = c$.
Show that in order for this system to b... | 2019/05/05 | [
"https://math.stackexchange.com/questions/3214701",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/656407/"
] | In general, the condition you are looking for is known (more often than not) as the [Rouché-Capelli theorem](https://en.m.wikipedia.org/wiki/Rouch%C3%A9%E2%80%93Capelli_theorem).
You construct the matrix of the coefficients of the equations $A$; in the first case:
$$ A = \begin{bmatrix}
1 &3& -2\\
5 &-5&4\\
-3&11&-8
\... | Supplementing [this other answer](https://math.stackexchange.com/a/3214716/265466), a different way of characterizing the equal-rank condition is that $(b\_1,b\_2,b\_3)^T$ must lie in the column space of the coefficient matrix $A$ for there to be any solution at all, so what you’re really looking for is a description o... |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | This code could leak memory in the presence of an initializer that throws an exception.
Note that this could be made to work correctly if the members of `Test` were smart -- rather than raw -- pointers. | There's no problem with your initialization -- they are guaranteed by the standard to be done in order, however, do remember that if any of those allocations fails, the former ones won't be freed.
So the only downside is if you want to keep safe against a failed allocation -- then you'd rather want to initialize them ... |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | You are allocating memory in your initialiser-list; this is totally fine, but you are then assigning the pointers to that memory to raw pointers.
These raw pointers do not imply any sort of memory ownership or deletion of the pointers that they point to, and as a result, the code contains several memory leaks, does no... | Steve Jessop's answer presents pitfalls.
About the order, which I think is what your question addressed:
>
> 12.6.2/4
>
>
> Initialization shall proceed in the following order:
>
>
> [...]
>
>
> * Then, nonstatic data members shall be initialized in the order they were declared in the class definition (again ... |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | It's not exception-safe. If the `new` for `j` throws an exception then the destructor for `Test` is not called, and so the memory for `i` is not freed.
The destructor of `i` is called if the initializer for `j` throws, it's just that a raw pointer has no destructor. So you could make it exception-safe by replacing `i`... | You are allocating memory in your initialiser-list; this is totally fine, but you are then assigning the pointers to that memory to raw pointers.
These raw pointers do not imply any sort of memory ownership or deletion of the pointers that they point to, and as a result, the code contains several memory leaks, does no... |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | It's not exception-safe. If the `new` for `j` throws an exception then the destructor for `Test` is not called, and so the memory for `i` is not freed.
The destructor of `i` is called if the initializer for `j` throws, it's just that a raw pointer has no destructor. So you could make it exception-safe by replacing `i`... | This code could leak memory in the presence of an initializer that throws an exception.
Note that this could be made to work correctly if the members of `Test` were smart -- rather than raw -- pointers. |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | It's not exception-safe. If the `new` for `j` throws an exception then the destructor for `Test` is not called, and so the memory for `i` is not freed.
The destructor of `i` is called if the initializer for `j` throws, it's just that a raw pointer has no destructor. So you could make it exception-safe by replacing `i`... | There's no specific issue with calling `new` from the initializer list.
However, if you do it for multiple members, it won't be exception-safe, and you risk leaking memory (what if the first `new` call succeeds, but the second throws an exception? Then the first allocation is leaked).
As for relying on the initializa... |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | This code could leak memory in the presence of an initializer that throws an exception.
Note that this could be made to work correctly if the members of `Test` were smart -- rather than raw -- pointers. | There's no specific issue with calling `new` from the initializer list.
However, if you do it for multiple members, it won't be exception-safe, and you risk leaking memory (what if the first `new` call succeeds, but the second throws an exception? Then the first allocation is leaked).
As for relying on the initializa... |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | It's not exception-safe. If the `new` for `j` throws an exception then the destructor for `Test` is not called, and so the memory for `i` is not freed.
The destructor of `i` is called if the initializer for `j` throws, it's just that a raw pointer has no destructor. So you could make it exception-safe by replacing `i`... | There's no problem with your initialization -- they are guaranteed by the standard to be done in order, however, do remember that if any of those allocations fails, the former ones won't be freed.
So the only downside is if you want to keep safe against a failed allocation -- then you'd rather want to initialize them ... |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | There's no specific issue with calling `new` from the initializer list.
However, if you do it for multiple members, it won't be exception-safe, and you risk leaking memory (what if the first `new` call succeeds, but the second throws an exception? Then the first allocation is leaked).
As for relying on the initializa... | Suppose that you have:
```
class Foo
{
public:
T* p1;
T* p2;
Foo()
: p1(new T),
p2(new T)
{
}
};
```
If initializing `p2` fails (either because `new` throws an out of memory exception or because the `T` constructor fails), then `p1` will be leaked. To combat this, C++ allows using `try... |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | This code could leak memory in the presence of an initializer that throws an exception.
Note that this could be made to work correctly if the members of `Test` were smart -- rather than raw -- pointers. | Suppose that you have:
```
class Foo
{
public:
T* p1;
T* p2;
Foo()
: p1(new T),
p2(new T)
{
}
};
```
If initializing `p2` fails (either because `new` throws an out of memory exception or because the `T` constructor fails), then `p1` will be leaked. To combat this, C++ allows using `try... |
9,064,298 | I have used initialization lists a great deal in my C++ programs but wasn't aware that you could allocate memory within them.
So you can do something (as a contrived example) like this:
```
class Test
{
private:
int* i;
int* j;
int count;
int* k;
public:
Test(void) : i(new int), j(new int[10]), c... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9064298",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/928502/"
] | This code could leak memory in the presence of an initializer that throws an exception.
Note that this could be made to work correctly if the members of `Test` were smart -- rather than raw -- pointers. | You are allocating memory in your initialiser-list; this is totally fine, but you are then assigning the pointers to that memory to raw pointers.
These raw pointers do not imply any sort of memory ownership or deletion of the pointers that they point to, and as a result, the code contains several memory leaks, does no... |
59,357,350 | I have list of codes which are separated by comma, the code contains min of 3 and max of 6 characters including numbers. I have written regex for this. How can I expand my regex to work with 1 or more codes as array or list?
Here is my regex for codes
```
const checkCodes = new RegExp('^[A-Z]+[A-Z0-9]{2,5}$');
```
... | 2019/12/16 | [
"https://Stackoverflow.com/questions/59357350",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11671255/"
] | ```js
const checkCodes = new RegExp('^[A-Z]+[A-Z0-9]{2,5}$');
let input = ["CODE1", "NOT.A.CODE", "CODE42"];
console.log(input.filter(str => checkCodes.test(str)))
``` | ```js
const checkCodesMulti = /^([A-Z]+[A-Z0-9]{2,5})(?:\s*,\s*([A-Z]+[A-Z0-9]{2,5}))*$/
let input = "BCD, VOC123, ETC";
let array_of_codes = checkCodesMulti.exec(input).splice(1)
``` |
3,403 | I'm developing a dashboard for a client, and we have some users who fit into multiple roles within the company, ie. a Project Manager and a Department Manager. In this case they function as two separate roles in the company.
Screen real estate is at a premium, so it is getting VERY difficult to squeeze the dashboard s... | 2011/02/08 | [
"https://ux.stackexchange.com/questions/3403",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/3473/"
] | If it is possible in this case I would try to use tab navigation with which these users can change the view between PM or DM view.
So they only have 1 user, with acces to more dashboard styles.
I wouldn't really try to mix them. If there are only two available

But ever since the preference value isn't updated upon change,
I even tried using :
```
SharedPreferences sharedPreferences = getSharedPreferences("myCustomSharedPrefs",
Activity... | 2013/04/05 | [
"https://Stackoverflow.com/questions/15838495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1405268/"
] | You need to return true to get the value updated, see the [Android documentation](http://developer.android.com/reference/android/preference/Preference.OnPreferenceChangeListener.html). | Can you see if preference.getKey() is giving the correct name? Can you print in your console and see. Code looks clean to me. May be the name is different than what is expected.
Also make sure that the value is also having the correct value. |
61,456,647 | I am using the code below:
```
$global:accountArray = New-Object -TypeName "System.Collections.ArrayList"
$global:accountArray.Add("0001")
$global:accountArray.Add("0002")
$global:accountArray.Add("0003")
$global:accountArray.Add("0004")
$global:accountArray.Add("0005")
Function Remove-Numbers
{
// This loop on... | 2020/04/27 | [
"https://Stackoverflow.com/questions/61456647",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6818685/"
] | You cannot change a collection like ArrayList while iterating its items like that.
If all you want to do is empty the list, use `$global:accountArray.Clear()`
If you want to use a loop, do that by using the element index and go from bottom to top:
```
Function Remove-Numbers {
# use a loop to remove the items. g... | You can't modify a list you are iterating through. The collection is modified so it's not the same one it started with. You can call ToArray() on the list to fix this.
```bsh
Function Remove-Numbers
{
foreach ($n in $global:accountArray.ToArray()) {
$global:accountArray.Remove($n)
}
}
``` |
65,283,926 | I'm working on ejs-grid and I want to toggle(Expand/Collapse) a **child grid** when I click on a row in the grid.
I was able to get the row click functionality working using (rowSelected) attribute but I don't really know how to get the **current state** of a child grid(collapsed or expanded).
My Current Code
```htm... | 2020/12/14 | [
"https://Stackoverflow.com/questions/65283926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14821156/"
] | Looks like you need to track answers for each monster, and if the are incorrect, do not allow the user to click the monster again. To do this with your current architecture, below I setup an array of answers initially set to null, meaning no answer has been given. Within the click event, we will set the monsterAnswer t... | Maybe you can just return in the click listener when the "answer\_input" !== "user\_answer". |
47,431,649 | I am a deep learning and Tensorflow beginner and I am trying to implement the algorithm in this [paper](https://arxiv.org/abs/1611.06345) using Tensorflow. This paper uses Matconvnet+Matlab to implement it, and I am curious if Tensorflow has the equivalent functions to achieve the same thing. The paper said:
>
> The ... | 2017/11/22 | [
"https://Stackoverflow.com/questions/47431649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2910704/"
] | Other answers are very detailed and helpful. Here is a code example that uses placeholder to decay learning rate at log scale. HTH.
```
import tensorflow as tf
import numpy as np
# data simulation
N = 10000
D = 10
x = np.random.rand(N, D)
w = np.random.rand(D,1)
y = np.dot(x, w)
print y.shape
#modeling
batch_size ... | Q1. How should I initialize the variables? Is the code below correct?
=====================================================================
That's correct (although missing an opening parentheses). You could also look into `tf.get_variable` if the variables are going to be reused.
Q2: Is it possible to set the learni... |
47,431,649 | I am a deep learning and Tensorflow beginner and I am trying to implement the algorithm in this [paper](https://arxiv.org/abs/1611.06345) using Tensorflow. This paper uses Matconvnet+Matlab to implement it, and I am curious if Tensorflow has the equivalent functions to achieve the same thing. The paper said:
>
> The ... | 2017/11/22 | [
"https://Stackoverflow.com/questions/47431649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2910704/"
] | Other answers are very detailed and helpful. Here is a code example that uses placeholder to decay learning rate at log scale. HTH.
```
import tensorflow as tf
import numpy as np
# data simulation
N = 10000
D = 10
x = np.random.rand(N, D)
w = np.random.rand(D,1)
y = np.dot(x, w)
print y.shape
#modeling
batch_size ... | Q1. How should I initialize the variables? Is the code below correct?
=====================================================================
Use tf.get\_variable or switch to slim (it does the initialization automatically for you). [example](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/slim)
... |
35,444,952 | I'm currently doing my first steps with SAP HANA Vora on Cloudera Express 5.5.0.
The Vora server is up and running and I would now like to use the Vora spark shell but this is what I get:
```
sh start-spark-shell.sh
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/spark/launcher/Main
Caused by: ... | 2016/02/16 | [
"https://Stackoverflow.com/questions/35444952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1867854/"
] | The cron job has been running for a while now without any issues, and it is keeping the space usage under control.
I have reduced the parameter to 15 days.
My crontab looks like this:
```
# clean up old files from working directory
0 20 * * * find /<path_to>/bamboo-home/xml-data/build-dir/ -depth -not -path *reposit... | While the cron idea works well - the thing that I've also done in the past with Bamboo is to "Clean working directory after each build" options. Basically, for any given job, there's a config option that will clean up the appropriate `build-dir/<build_plan_job>` directory for a given plan/job:
Actions -> Configure Pla... |
171,748 | I am trying to plot the solid formed by the intersection of the surface between
```
p1 = Plot3D[1 + x^2 - y^2, {x, -1.2, 1.2}, {y, -1.2, 1.2}]
```
and
```
p2 = Plot3D[3 Log[1 + x^2], {x, -1.4, 1.4}, {y, -1, 1}]
```
I am also trying to get the volume of said solid. I've tried the solution given in [How to plot ... | 2018/04/23 | [
"https://mathematica.stackexchange.com/questions/171748",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/57777/"
] | Clearly the maximum x extent will be when y==0. Use `Reduce` to find the x extent.
```
Reduce[1+x^2-0^2==3 Log[1+x^2],x]
```
Use `Reduce` to find the y extent for a given x.
```
Reduce[1+x^2-y^2==3 Log[1+x^2],y]
```
Then `Integrate` over the y extent for each x to find the volume.
```
NIntegrate[1+x^2-y^2-3 Log[... | per comment:
```
r = ImplicitRegion[
3 Log[1 + x^2] < z <
1 + x^2 - y^2, {{x, -1.4, 1.4},y,z}];
Volume[r]
```
>
> 1.2471664022353517
>
>
>
`DiscretizRegion` and `RegionPlot` have a hard time with it though.
```
DiscretizeRegion[r, MaxCellMeasure -> .0001, MeshQualityGoal -> 1]
```
[![enter image ... |
171,748 | I am trying to plot the solid formed by the intersection of the surface between
```
p1 = Plot3D[1 + x^2 - y^2, {x, -1.2, 1.2}, {y, -1.2, 1.2}]
```
and
```
p2 = Plot3D[3 Log[1 + x^2], {x, -1.4, 1.4}, {y, -1, 1}]
```
I am also trying to get the volume of said solid. I've tried the solution given in [How to plot ... | 2018/04/23 | [
"https://mathematica.stackexchange.com/questions/171748",
"https://mathematica.stackexchange.com",
"https://mathematica.stackexchange.com/users/57777/"
] | Clearly the maximum x extent will be when y==0. Use `Reduce` to find the x extent.
```
Reduce[1+x^2-0^2==3 Log[1+x^2],x]
```
Use `Reduce` to find the y extent for a given x.
```
Reduce[1+x^2-y^2==3 Log[1+x^2],y]
```
Then `Integrate` over the y extent for each x to find the volume.
```
NIntegrate[1+x^2-y^2-3 Log[... | A different way to discretize is to work with each surface separately and take their intersection.
```
ToBMR[g_Graphics3D] := With[{s = DiscretizeGraphics[g]},
BoundaryMeshRegion[MeshCoordinates[s], MeshCells[s, 2]]
];
p1 = Plot3D[1 + x^2 - y^2, {x, -1.5, 1.5}, {y, -1.5, 1.5},
Filling -> Bottom, PlotRange -> {-2... |
30,044,954 | My develop H/W environment is Raspberry Pi2 & VX-1000 camera
My develop S/W environment is Arch linux & c++ & opencv
I could stream on webpage by using mjpg-streamer
with this command `mjpg_streamer -i "./input_uvc.so -d /dev/video0 -n -f 30 -r 320x240" -o "./output_http.so -n -w ./www"`
This run is good. (turns on c... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30044954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864919/"
] | wrap this util method into a Utility class build the jar and put it in classpath of your iReport and whenever you are compiling this jrxml | Using Java 8 you can do this in single line:
```
System.out.println(LocalDate.now().minusMonths(6).format(DateTimeFormatter.ofPattern("yyyy/MM/dd")));
```
If you cannot use Java 8 consider using [Joda Time](http://www.joda.org/joda-time/) library. |
30,044,954 | My develop H/W environment is Raspberry Pi2 & VX-1000 camera
My develop S/W environment is Arch linux & c++ & opencv
I could stream on webpage by using mjpg-streamer
with this command `mjpg_streamer -i "./input_uvc.so -d /dev/video0 -n -f 30 -r 320x240" -o "./output_http.so -n -w ./www"`
This run is good. (turns on c... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30044954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864919/"
] | wrap this util method into a Utility class build the jar and put it in classpath of your iReport and whenever you are compiling this jrxml | Use Joda library because of various shortcomings of the `Date` and `Calendar` classes
```
new DateTime().minusMonths(6).toDate();
```
In **Java 8** update following also will be good.
```
LocalDateTime.from(referenceDate.toInstant()).minusMonths(6);
``` |
30,044,954 | My develop H/W environment is Raspberry Pi2 & VX-1000 camera
My develop S/W environment is Arch linux & c++ & opencv
I could stream on webpage by using mjpg-streamer
with this command `mjpg_streamer -i "./input_uvc.so -d /dev/video0 -n -f 30 -r 320x240" -o "./output_http.so -n -w ./www"`
This run is good. (turns on c... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30044954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864919/"
] | wrap this util method into a Utility class build the jar and put it in classpath of your iReport and whenever you are compiling this jrxml | To calculate the previous date just do something like below where **total number of previous days are multiplied with `24 * 60 * 60 * 1000`**
```
new Date(System.currentTimeMillis() - 7 * 24 * 60 * 60 * 1000);
```
Where, *7 days are subtracted from the current date.*
Calculate the number of days in service side & ... |
30,044,954 | My develop H/W environment is Raspberry Pi2 & VX-1000 camera
My develop S/W environment is Arch linux & c++ & opencv
I could stream on webpage by using mjpg-streamer
with this command `mjpg_streamer -i "./input_uvc.so -d /dev/video0 -n -f 30 -r 320x240" -o "./output_http.so -n -w ./www"`
This run is good. (turns on c... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30044954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864919/"
] | Using Java 8 you can do this in single line:
```
System.out.println(LocalDate.now().minusMonths(6).format(DateTimeFormatter.ofPattern("yyyy/MM/dd")));
```
If you cannot use Java 8 consider using [Joda Time](http://www.joda.org/joda-time/) library. | Use Joda library because of various shortcomings of the `Date` and `Calendar` classes
```
new DateTime().minusMonths(6).toDate();
```
In **Java 8** update following also will be good.
```
LocalDateTime.from(referenceDate.toInstant()).minusMonths(6);
``` |
30,044,954 | My develop H/W environment is Raspberry Pi2 & VX-1000 camera
My develop S/W environment is Arch linux & c++ & opencv
I could stream on webpage by using mjpg-streamer
with this command `mjpg_streamer -i "./input_uvc.so -d /dev/video0 -n -f 30 -r 320x240" -o "./output_http.so -n -w ./www"`
This run is good. (turns on c... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30044954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864919/"
] | Using Java 8 you can do this in single line:
```
System.out.println(LocalDate.now().minusMonths(6).format(DateTimeFormatter.ofPattern("yyyy/MM/dd")));
```
If you cannot use Java 8 consider using [Joda Time](http://www.joda.org/joda-time/) library. | To calculate the previous date just do something like below where **total number of previous days are multiplied with `24 * 60 * 60 * 1000`**
```
new Date(System.currentTimeMillis() - 7 * 24 * 60 * 60 * 1000);
```
Where, *7 days are subtracted from the current date.*
Calculate the number of days in service side & ... |
30,044,954 | My develop H/W environment is Raspberry Pi2 & VX-1000 camera
My develop S/W environment is Arch linux & c++ & opencv
I could stream on webpage by using mjpg-streamer
with this command `mjpg_streamer -i "./input_uvc.so -d /dev/video0 -n -f 30 -r 320x240" -o "./output_http.so -n -w ./www"`
This run is good. (turns on c... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30044954",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4864919/"
] | To calculate the previous date just do something like below where **total number of previous days are multiplied with `24 * 60 * 60 * 1000`**
```
new Date(System.currentTimeMillis() - 7 * 24 * 60 * 60 * 1000);
```
Where, *7 days are subtracted from the current date.*
Calculate the number of days in service side & ... | Use Joda library because of various shortcomings of the `Date` and `Calendar` classes
```
new DateTime().minusMonths(6).toDate();
```
In **Java 8** update following also will be good.
```
LocalDateTime.from(referenceDate.toInstant()).minusMonths(6);
``` |
39,556,519 | I want to create a sass file that the selectors will be attribute selectors.
When I work with class selectors, in most of the cases I will do
```
.parent {
&-child {
}
}
```
which gives me the following css: `.parent-child {}`.
I want to achieve the same thing with attribute selectors:
```
[data-parent] ... | 2016/09/18 | [
"https://Stackoverflow.com/questions/39556519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1926936/"
] | You can use this `mixin` as a workaround to get the desired result.
```
@mixin child-attribute($child) {
$string: inspect(&);
$original: str-slice($string, 3, -4);
@at-root #{ selector-replace(&, &, "[#{$original}#{$child}]" ) } {
@content;
}
}
```
The code simply does the following
1. **$string** vari... | You can create `mixin` that will set styles for elements with data attribytes.
Scss:
```
@mixin data($name) {
[data-#{$name}] {
@content;
}
}
* {
@include data('lol') {
color: red;
};
}
```
Css output:
```
* [data-lol] {
color: red;
}
```
**[DEMO](http://www.sassmeister.com/gist/b71cba8f388f20... |
39,556,519 | I want to create a sass file that the selectors will be attribute selectors.
When I work with class selectors, in most of the cases I will do
```
.parent {
&-child {
}
}
```
which gives me the following css: `.parent-child {}`.
I want to achieve the same thing with attribute selectors:
```
[data-parent] ... | 2016/09/18 | [
"https://Stackoverflow.com/questions/39556519",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1926936/"
] | You can use this `mixin` as a workaround to get the desired result.
```
@mixin child-attribute($child) {
$string: inspect(&);
$original: str-slice($string, 3, -4);
@at-root #{ selector-replace(&, &, "[#{$original}#{$child}]" ) } {
@content;
}
}
```
The code simply does the following
1. **$string** vari... | I would go down a slightly different route of having a `class` on your elements that contain the `data` attributes.
`<div class="data-obj" data-parent="true"></div>`
`<div class="data-obj" data-parent-child="true"></div>`
then in your SASS do
```
.data-obj {
...
&[data-parent] { ... }
&[data-parent-chi... |
65,198,438 | We have an application in Asp.net Webform. We must use passwordless sign-in using Microsoft Authenticator App. Basically, the user enters samAccountName, and the system must check Microsoft Authenticator App for approval, and based on the response we have to redirect to change the password screen.
We have a login modu... | 2020/12/08 | [
"https://Stackoverflow.com/questions/65198438",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8152735/"
] | The Raw Database returns correct time because DBMS time zone is correct.
but in Eloquent, `created_at` field converts into an `Carbon::class` instance by default.
and `Carbon::class` will use timezone configuration of your app to convert to real time.
so change in laravel `./config/app.php` :
```
'timezone' => 'Asi... | You can add a mutator to change format returned by eloquent
```
public function getCreatedAtAttribute($value) {
return date('Y-m-d H:i:s',strtotime($value));
}
```
add this function in your Timeline model.
you can also modify function by using carbon methods
for more info you can refer to laravel docs.
<https... |
6,034,883 | I'm just wondering if it is possible..
I have a base class, with a variable called Level. I then derive a class from it, but here Level should be called Points.
Is there any way to rename the Level variable in the derived class?
**Edit** - Excuse me for calling a property a variable. I'm quite new to programming, an... | 2011/05/17 | [
"https://Stackoverflow.com/questions/6034883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/719392/"
] | The closest you could get with inheritance would be:
```
class BaseClass
{
protected int Level { get; set; }
}
class SubClass : BaseClass
{
public int Points { get { return Level; } set { Level = value; } }
}
```
But that doesn't actually *expose* BaseClass.Level, since a protected property is only visible to s... | No, that's not possible. You can override the behavior using virtual properties, but not rename it. |
6,034,883 | I'm just wondering if it is possible..
I have a base class, with a variable called Level. I then derive a class from it, but here Level should be called Points.
Is there any way to rename the Level variable in the derived class?
**Edit** - Excuse me for calling a property a variable. I'm quite new to programming, an... | 2011/05/17 | [
"https://Stackoverflow.com/questions/6034883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/719392/"
] | The closest you could get with inheritance would be:
```
class BaseClass
{
protected int Level { get; set; }
}
class SubClass : BaseClass
{
public int Points { get { return Level; } set { Level = value; } }
}
```
But that doesn't actually *expose* BaseClass.Level, since a protected property is only visible to s... | >
> Is there any way to rename the Level variable in the derived class?
>
>
>
No, stop and think about why for a second. If you have an instance of `Base`, you could refer to the property `Level`. Now if you have an instance of `Derived`, it is also a `Base`, and therefore it should have property named `Level`. It... |
6,034,883 | I'm just wondering if it is possible..
I have a base class, with a variable called Level. I then derive a class from it, but here Level should be called Points.
Is there any way to rename the Level variable in the derived class?
**Edit** - Excuse me for calling a property a variable. I'm quite new to programming, an... | 2011/05/17 | [
"https://Stackoverflow.com/questions/6034883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/719392/"
] | The closest you could get with inheritance would be:
```
class BaseClass
{
protected int Level { get; set; }
}
class SubClass : BaseClass
{
public int Points { get { return Level; } set { Level = value; } }
}
```
But that doesn't actually *expose* BaseClass.Level, since a protected property is only visible to s... | Classes do not contain variables; they contain fields and properties (and methods, indexers, etc.)
I assume you're referring to properties, because fields shouldn't be public anyway.
There is no way to change the name of a property inherited from a base class.
What you can do:
**Option 1**
Add a property `Points` ... |
6,034,883 | I'm just wondering if it is possible..
I have a base class, with a variable called Level. I then derive a class from it, but here Level should be called Points.
Is there any way to rename the Level variable in the derived class?
**Edit** - Excuse me for calling a property a variable. I'm quite new to programming, an... | 2011/05/17 | [
"https://Stackoverflow.com/questions/6034883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/719392/"
] | >
> Is there any way to rename the Level variable in the derived class?
>
>
>
No, stop and think about why for a second. If you have an instance of `Base`, you could refer to the property `Level`. Now if you have an instance of `Derived`, it is also a `Base`, and therefore it should have property named `Level`. It... | No, that's not possible. You can override the behavior using virtual properties, but not rename it. |
6,034,883 | I'm just wondering if it is possible..
I have a base class, with a variable called Level. I then derive a class from it, but here Level should be called Points.
Is there any way to rename the Level variable in the derived class?
**Edit** - Excuse me for calling a property a variable. I'm quite new to programming, an... | 2011/05/17 | [
"https://Stackoverflow.com/questions/6034883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/719392/"
] | Classes do not contain variables; they contain fields and properties (and methods, indexers, etc.)
I assume you're referring to properties, because fields shouldn't be public anyway.
There is no way to change the name of a property inherited from a base class.
What you can do:
**Option 1**
Add a property `Points` ... | No, that's not possible. You can override the behavior using virtual properties, but not rename it. |
6,034,883 | I'm just wondering if it is possible..
I have a base class, with a variable called Level. I then derive a class from it, but here Level should be called Points.
Is there any way to rename the Level variable in the derived class?
**Edit** - Excuse me for calling a property a variable. I'm quite new to programming, an... | 2011/05/17 | [
"https://Stackoverflow.com/questions/6034883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/719392/"
] | Classes do not contain variables; they contain fields and properties (and methods, indexers, etc.)
I assume you're referring to properties, because fields shouldn't be public anyway.
There is no way to change the name of a property inherited from a base class.
What you can do:
**Option 1**
Add a property `Points` ... | >
> Is there any way to rename the Level variable in the derived class?
>
>
>
No, stop and think about why for a second. If you have an instance of `Base`, you could refer to the property `Level`. Now if you have an instance of `Derived`, it is also a `Base`, and therefore it should have property named `Level`. It... |
54,847,976 | **What happened:**
1. I have multiple objects saved in an arraylist that is saved in a gson string.
2. I change the class of the object (to include more variables and getter/setter methods)
3. Now I run into errors when trying to load the older objects (saved in step 1)
**Things to consider:**
I use gson/json to sto... | 2019/02/24 | [
"https://Stackoverflow.com/questions/54847976",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8539070/"
] | See [Android release APK crash with java.lang.AssertionError: impossible in java.lang.Enum](https://stackoverflow.com/questions/20651575/android-release-apk-crash-with-java-lang-assertionerror-impossible-in-java-lang/20651744), [AssertionError in Gson EnumTypeAdapter when using Proguard Obfuscation](https://stackoverfl... | Some of the new Data I was including were Firebase DocumentReferences & CollectionReferences, I noticed that these data types don't play nicely with gson/json and therefore I excluded them. I am thinking about using a string to save the Document and Collection Reference instead.
```
// private CollectionReference m... |
39,774,940 | I wrote a data using influx command (CLI) as follows:
```
CREATE DATABASE mydb
USE mydb
insert test value=1234567890123456789i
```
Then, I read the data using influx command (CLI)
```
> select * from test
name: test
time value
1475129299322514085 1234567890123456789
```
OK. No Problem.
But... | 2016/09/29 | [
"https://Stackoverflow.com/questions/39774940",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6900431/"
] | use MSGPACK Format, on influxdb-java-2.15.jar
```
OkHttpClient.Builder client = new OkHttpClient.Builder();
InfluxDB jsonInfluxDB = InfluxDBFactory.connect(URL, USER, PASSWORD, client, ResponseFormat.JSON);
InfluxDB msgpackInfluxDB = InfluxDBFactory.connect(URL, USER, PASSWORD, client, ResponseFormat.MSGPACK);
//infl... | Unfortunately there is no proper solution for you. This library designed that way.
Workaround is to cast to `long`:
```
System.out.println(series.getColumns().get(0) + "=" + (long)(double)series.getValues().get(0).get(0) + " " + series.getValues().get(0).get(0).getClass().getName());
```
or
```
System.out.println(... |
57,472,014 | This is the jsp page I'm using.I wrote javascript inside jsp. I have done some validation on form and then ajax call is used. Please check whether I have done something wrong in jsp.
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Register page</title>
</head>
<body>
<script src="https:... | 2019/08/13 | [
"https://Stackoverflow.com/questions/57472014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11920605/"
] | you can chnage the class of `white-text` to `text-white` and for background-color add `bg-primary` and also add code for custom color.
```css
.bg-custom{
background-color:#33b5e5 !important;
}
```
```html
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css... | Please use bg-primary class.
```html
<h5 class="card-header info-color white-text text-center py-4 bg-primary">Sign in</h5>
``` |
57,472,014 | This is the jsp page I'm using.I wrote javascript inside jsp. I have done some validation on form and then ajax call is used. Please check whether I have done something wrong in jsp.
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Register page</title>
</head>
<body>
<script src="https:... | 2019/08/13 | [
"https://Stackoverflow.com/questions/57472014",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11920605/"
] | you can chnage the class of `white-text` to `text-white` and for background-color add `bg-primary` and also add code for custom color.
```css
.bg-custom{
background-color:#33b5e5 !important;
}
```
```html
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css... | You need to add `bg-info text-white` instead of `info-color white-text`
```html
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<p class="h4 mb-4">Sign in... |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | $\int\sin^3xdx=\int\sin^2x\sin(x)dx=-\int(1-\cos^2x)d\cos x$ | $\sin 3x$=$3\sin x$-$4\sin^3 x$ and
$\cos 3x=4\cos^3 x -3\cos x$
.use this formula to subtitute $\sin^3x$ and $\cos^3 x$ and use simple integration |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | Hint: $\sin^3 x dx = -\sin^2 xd(\cos x) = (\cos^2 x - 1)d(\cos x)$. Do the same for $\cos^3 x dx$. | **Hint:** Use partial integration a couple of times. |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | $a^3+b^3 = (a+b)(a^2+b^2 -ab)$, applying this to $a=\sin x, b=\cos x$, produces (noting that $a^2 + b^2 =1$),
$$I= \int (\sin x +\cos x )dx - \int (\sin x + \cos x)\sin x \cos x dx.$$
The second integral can be further expanded and solved with simple substitutions for $\sin x$ and $\cos x$. | $\sin 3x$=$3\sin x$-$4\sin^3 x$ and
$\cos 3x=4\cos^3 x -3\cos x$
.use this formula to subtitute $\sin^3x$ and $\cos^3 x$ and use simple integration |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | $\int\sin^3xdx=\int\sin^2x\sin(x)dx=-\int(1-\cos^2x)d\cos x$ | The curve of $sinx$ and $cosx$ in the interval $(0,\frac{\pi}{2})$ is symmetric. So the curve of $sin^3x$ and $cos^3x$ are symmetric too. Hence the area enclosed under the curves are also equal. So the expression can be re-written as,
$2\int\_0^\frac{\pi}{2}sin^3x~dx$ or $2\int\_0^\frac{\pi}{2}cos^3x~dx$ whichever you... |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | $\int\sin^3xdx=\int\sin^2x\sin(x)dx=-\int(1-\cos^2x)d\cos x$ | **Hint:** Use partial integration a couple of times. |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | Applying **[this](https://en.wikipedia.org/wiki/Integration_by_reduction_formulae)** should give you your answer in no time! | $\sin 3x$=$3\sin x$-$4\sin^3 x$ and
$\cos 3x=4\cos^3 x -3\cos x$
.use this formula to subtitute $\sin^3x$ and $\cos^3 x$ and use simple integration |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | Applying **[this](https://en.wikipedia.org/wiki/Integration_by_reduction_formulae)** should give you your answer in no time! | **Hint:** Use partial integration a couple of times. |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | $a^3+b^3 = (a+b)(a^2+b^2 -ab)$, applying this to $a=\sin x, b=\cos x$, produces (noting that $a^2 + b^2 =1$),
$$I= \int (\sin x +\cos x )dx - \int (\sin x + \cos x)\sin x \cos x dx.$$
The second integral can be further expanded and solved with simple substitutions for $\sin x$ and $\cos x$. | The curve of $sinx$ and $cosx$ in the interval $(0,\frac{\pi}{2})$ is symmetric. So the curve of $sin^3x$ and $cos^3x$ are symmetric too. Hence the area enclosed under the curves are also equal. So the expression can be re-written as,
$2\int\_0^\frac{\pi}{2}sin^3x~dx$ or $2\int\_0^\frac{\pi}{2}cos^3x~dx$ whichever you... |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | Applying **[this](https://en.wikipedia.org/wiki/Integration_by_reduction_formulae)** should give you your answer in no time! | The curve of $sinx$ and $cosx$ in the interval $(0,\frac{\pi}{2})$ is symmetric. So the curve of $sin^3x$ and $cos^3x$ are symmetric too. Hence the area enclosed under the curves are also equal. So the expression can be re-written as,
$2\int\_0^\frac{\pi}{2}sin^3x~dx$ or $2\int\_0^\frac{\pi}{2}cos^3x~dx$ whichever you... |
546,986 | $$\int\_0^\frac{\pi}{2}(\sin^3x +\cos^3x) \, \mathrm{d}x$$
How do I compute this? I tried to do the trigonometric manupulation but I can't get the answer. | 2013/10/31 | [
"https://math.stackexchange.com/questions/546986",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/101194/"
] | Hint: $\sin^3 x dx = -\sin^2 xd(\cos x) = (\cos^2 x - 1)d(\cos x)$. Do the same for $\cos^3 x dx$. | $\sin 3x$=$3\sin x$-$4\sin^3 x$ and
$\cos 3x=4\cos^3 x -3\cos x$
.use this formula to subtitute $\sin^3x$ and $\cos^3 x$ and use simple integration |
50,256,184 | This is just a small portion of the data frame I am working with:
```
id drug start stop dose unit route
2010003 Amlodipine 2009-02-04 2009-11-19 1.5 mg Oral
2010003 Amlodipine 2009-11-19 2010-01-11 1.5 mg Oral
2010004 Cefprozil 2004-03... | 2018/05/09 | [
"https://Stackoverflow.com/questions/50256184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Change the code with:
```
[Unit]
Description=Atlassian Bamboo Agent
After=syslog.target network.target
[Service]
Type=forking
User=apps
Group=apps
ExecStart=/apps/bamboo-agent/bin/bamboo-agent.sh start
ExecStop=/apps/bamboo-agent/bin/bamboo-agent.sh stop
[Install]
WantedBy=multi-user.target
```
Then reload and sta... | Have you installed the agent? Atlassian's Documentation sucks in this one.
You should install the agent as bamboo user with the word "**install**" at the end.
```
java -jar atlassian-bamboo-agent-installer-6.7.2.jar https://my.bamboo-server.com/agentServer/ install
```
Replace with the address of your Server of cou... |
50,256,184 | This is just a small portion of the data frame I am working with:
```
id drug start stop dose unit route
2010003 Amlodipine 2009-02-04 2009-11-19 1.5 mg Oral
2010003 Amlodipine 2009-11-19 2010-01-11 1.5 mg Oral
2010004 Cefprozil 2004-03... | 2018/05/09 | [
"https://Stackoverflow.com/questions/50256184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Change the code with:
```
[Unit]
Description=Atlassian Bamboo Agent
After=syslog.target network.target
[Service]
Type=forking
User=apps
Group=apps
ExecStart=/apps/bamboo-agent/bin/bamboo-agent.sh start
ExecStop=/apps/bamboo-agent/bin/bamboo-agent.sh stop
[Install]
WantedBy=multi-user.target
```
Then reload and sta... | We have a shell script to start the remote agent that is called in a cron job that runs on reboot
launchRemoteAgent.sh
java -jar /home/bamboo/bamboo-agent-home/atlassian-bamboo-agent-installer-6.6.3.jar http://:8085/agentServer/ > /home/bamboo/bamboo.log 2>&1 &
crontab
@reboot /home/bamboo/bin/launchRemoteAgent.sh > ... |
50,256,184 | This is just a small portion of the data frame I am working with:
```
id drug start stop dose unit route
2010003 Amlodipine 2009-02-04 2009-11-19 1.5 mg Oral
2010003 Amlodipine 2009-11-19 2010-01-11 1.5 mg Oral
2010004 Cefprozil 2004-03... | 2018/05/09 | [
"https://Stackoverflow.com/questions/50256184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Change the code with:
```
[Unit]
Description=Atlassian Bamboo Agent
After=syslog.target network.target
[Service]
Type=forking
User=apps
Group=apps
ExecStart=/apps/bamboo-agent/bin/bamboo-agent.sh start
ExecStop=/apps/bamboo-agent/bin/bamboo-agent.sh stop
[Install]
WantedBy=multi-user.target
```
Then reload and sta... | Once you've run the agent for the first time it will create control scripts to install and manage the service.
So after running:
```
java -jar atlassian-bamboo-agent-installer-6.10.4.jar ...
```
Stop the agent and run:
```
sudo ./bamboo-agent-home/bin/bamboo-agent.sh install
```
Then you can control it with:
``... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.