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 |
|---|---|---|---|---|---|
49,064,157 | I am having difficulty running the below simple script from crontab:
```
#!/bin/bash
notify-send "battery.sh working"
```
The permissions of the file are `rwxr-xr-x` and its running fine with either of the commands `bash battery.sh` and `sh battery.sh`.
In my crontab, I have tried running it with both `bash` and `s... | 2018/03/02 | [
"https://Stackoverflow.com/questions/49064157",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7116413/"
] | It's not legit, but browsers are extremely forgiving and will still try to render something as best as they can, even if the HTML you give it is technically wrong. | **Is this legit?** No.
Although browser show perfectly but W3C Validator will not permit you write this way. You will get error if you go with your code in validation engine. Validator will show you message like following.
"**Error:** Element div not allowed as child of element ol in this context."
Also see here: `h... |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | If you are using SQL Server 2008 or later, you can leverage the hierarchyID data type:
```
select * from @tblVersion
order by CAST('/'+REPLACE(VersionNumber,'.','/')+'/' as hierarchyID)
``` | Implementation of Brain's Solution
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.4.3.109.1... |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | If you are on SQL Server 2005 or later and the number of possible fields in version numbers is fixed, you could try the following approach:
```
SELECT t.*
FROM @tblVersion t
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.VersionNumber, 1), 0)) v1
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.... | I cannot see the solution using standard sorting etc, but I think you need the UDF that adds the "0" symbols before each symbol, like
```
001.003.001
001.003.002.005
001.004.001.007.012
001.004.011.014.007
001.004.003.109.001
001.004.008.066
```
and then sort by these changed values |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | Implementation of Brain's Solution
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.4.3.109.1... | If you are on SQL Server 2005 or later and the number of possible fields in version numbers is fixed, you could try the following approach:
```
SELECT t.*
FROM @tblVersion t
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.VersionNumber, 1), 0)) v1
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.... |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | If you are on SQL Server 2005 or later and the number of possible fields in version numbers is fixed, you could try the following approach:
```
SELECT t.*
FROM @tblVersion t
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.VersionNumber, 1), 0)) v1
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.... | Check these helps you
Select \* From @tblVersion order by replace(VersionNumber,'.','') |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | If you are using SQL Server 2008 or later, you can leverage the hierarchyID data type:
```
select * from @tblVersion
order by CAST('/'+REPLACE(VersionNumber,'.','/')+'/' as hierarchyID)
``` | Check these helps you
Select \* From @tblVersion order by replace(VersionNumber,'.','') |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | If you are using SQL Server 2008 or later, you can leverage the hierarchyID data type:
```
select * from @tblVersion
order by CAST('/'+REPLACE(VersionNumber,'.','/')+'/' as hierarchyID)
``` | If you are on SQL Server 2005 or later and the number of possible fields in version numbers is fixed, you could try the following approach:
```
SELECT t.*
FROM @tblVersion t
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.VersionNumber, 1), 0)) v1
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.... |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | This is generally called natural sort and there is no easy way to do it in SQL Server. Generally the data needs to be broken into fields or to fixed length segments of a field. It can be sorted on those field(s) for the desired order.
```
VersionNumber VersionSort
1.3.1 0001.0003.0001
1.3.2.5 0001.0003.... | If you are on SQL Server 2005 or later and the number of possible fields in version numbers is fixed, you could try the following approach:
```
SELECT t.*
FROM @tblVersion t
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.VersionNumber, 1), 0)) v1
CROSS APPLY (SELECT v = NULLIF(CHARINDEX('.', '.' + t.... |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | Implementation of Brain's Solution
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.4.3.109.1... | Check these helps you
Select \* From @tblVersion order by replace(VersionNumber,'.','') |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | This is generally called natural sort and there is no easy way to do it in SQL Server. Generally the data needs to be broken into fields or to fixed length segments of a field. It can be sorted on those field(s) for the desired order.
```
VersionNumber VersionSort
1.3.1 0001.0003.0001
1.3.2.5 0001.0003.... | Check these helps you
Select \* From @tblVersion order by replace(VersionNumber,'.','') |
7,870,945 | I have a table that stores the versions as under
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.... | 2011/10/24 | [
"https://Stackoverflow.com/questions/7870945",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/111663/"
] | Implementation of Brain's Solution
```
Declare @tblVersion table(VersionNumber varchar(100))
Insert into @tblVersion Values('1.3.1')
Insert into @tblVersion Values('1.3.2.5')
Insert into @tblVersion Values('1.4.1.7.12')
Insert into @tblVersion Values('1.4.11.14.7')
Insert into @tblVersion Values('1.4.3.109.1... | I cannot see the solution using standard sorting etc, but I think you need the UDF that adds the "0" symbols before each symbol, like
```
001.003.001
001.003.002.005
001.004.001.007.012
001.004.011.014.007
001.004.003.109.001
001.004.008.066
```
and then sort by these changed values |
2,865,662 | So I know that set $S=\{(x,y,z)| x,y,z\in \mathbb{Z}\}$ is a subset of vector space $\mathbb{R}^3$.
Specifically, it is worded in our lecture that it is a " subset of $(\mathbb{R}^3, \oplus, \odot)$ , where $\oplus$ and $\odot$ are the usual vector addition and scalar multiplication."
My teacher has stated in our lec... | 2018/07/28 | [
"https://math.stackexchange.com/questions/2865662",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/580225/"
] | $(1,0,0)$ belongs to $S$. Scale this by the real scalar $1/2$ and obtain $(1/2,0,0)$ which is not in $S$. Hence $S$ is not a subspace. | It is not closed under multiplication.
Take $\lambda=\sqrt{2}$ and any vector $v=(a,b,c)\in S$. Since $a,b,c\in \Bbb Z$ then $a\sqrt{2}, b\sqrt{2}, c\sqrt{2}\notin \Bbb Z$. Then $\lambda\cdot v \notin S$. |
2,865,662 | So I know that set $S=\{(x,y,z)| x,y,z\in \mathbb{Z}\}$ is a subset of vector space $\mathbb{R}^3$.
Specifically, it is worded in our lecture that it is a " subset of $(\mathbb{R}^3, \oplus, \odot)$ , where $\oplus$ and $\odot$ are the usual vector addition and scalar multiplication."
My teacher has stated in our lec... | 2018/07/28 | [
"https://math.stackexchange.com/questions/2865662",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/580225/"
] | It is not closed under multiplication.
Take $\lambda=\sqrt{2}$ and any vector $v=(a,b,c)\in S$. Since $a,b,c\in \Bbb Z$ then $a\sqrt{2}, b\sqrt{2}, c\sqrt{2}\notin \Bbb Z$. Then $\lambda\cdot v \notin S$. | Edit: User Randall pointed out that I misread the question. (I assumed S was under some invalid field.)
First lets look at the definition of a subspace:
1. All products and sums composed of elements within the subspace also are in the subspace.
2. All elements in the subspace must be able to be scaled by the vector s... |
2,865,662 | So I know that set $S=\{(x,y,z)| x,y,z\in \mathbb{Z}\}$ is a subset of vector space $\mathbb{R}^3$.
Specifically, it is worded in our lecture that it is a " subset of $(\mathbb{R}^3, \oplus, \odot)$ , where $\oplus$ and $\odot$ are the usual vector addition and scalar multiplication."
My teacher has stated in our lec... | 2018/07/28 | [
"https://math.stackexchange.com/questions/2865662",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/580225/"
] | $(1,0,0)$ belongs to $S$. Scale this by the real scalar $1/2$ and obtain $(1/2,0,0)$ which is not in $S$. Hence $S$ is not a subspace. | Edit: User Randall pointed out that I misread the question. (I assumed S was under some invalid field.)
First lets look at the definition of a subspace:
1. All products and sums composed of elements within the subspace also are in the subspace.
2. All elements in the subspace must be able to be scaled by the vector s... |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | I was getting the same error but I could not even start the hive shell. After trying the very useful hive debug command:
```
hive -hiveconf hive.root.logger=DEBUG,console
```
I was able to see that Hive could not find a valid Kerberos TGT. You will see in the debug info something about SASL negotiation failed and n... | If it is in local machine, looks like you have another terminal opened with hive shell/session. You can have only one session using embedded derby data base. Close all other hive sessions and try. |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | Looks like problem with your metastore. If you are using the default hive metastore embedded derby. Lock file would be there in case of abnormal exit. if you remove that lock file this issue would be solved
```
rm metastore_db/*.lck
``` | Restarting the virtual machine or system should also release the lock. |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | Being a newbie i got the same set of errors.
It was found that one of the daemons in my case namenode was not initiated.
On installing hadoop it would be wise to make it a habit to hit he following commands :
ps -ef | grep "namenode"
ps -ef | grep "datanode"
ps -ef | grep "tracker"
One needs to check th... | I was facing the same issue--used the below steps to resolve it:
1. Create an file hive-site.xml and input the details (for Local/Prod mode). Make sure the below location exist /home/hadoop/bhishm/warehouse
Example:
```
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>... |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | ```
hive> show databases;
FAILED: Error in metadata: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask
```
To resolve this issue start the hadoop services first.
```
$ start-all.sh
... | When I used jdk 11, I deploymented hive on my master node and then those exceptions were thrown. Many methods I have tried but useless. Eventually I changed the version of jdk from 11 to 8, which used in master node. Then I started the hive successfully. |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | I was getting the same error but I could not even start the hive shell. After trying the very useful hive debug command:
```
hive -hiveconf hive.root.logger=DEBUG,console
```
I was able to see that Hive could not find a valid Kerberos TGT. You will see in the debug info something about SASL negotiation failed and n... | I was facing the same issue--used the below steps to resolve it:
1. Create an file hive-site.xml and input the details (for Local/Prod mode). Make sure the below location exist /home/hadoop/bhishm/warehouse
Example:
```
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>... |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | Looks like problem with your metastore. If you are using the default hive metastore embedded derby. Lock file would be there in case of abnormal exit. if you remove that lock file this issue would be solved
```
rm metastore_db/*.lck
``` | I was facing the same issue there are some important point's that could be resolve this problem.
**1.Put the following at the beginning of hive-site.xml**
```
<property>
<name>system:java.io.tmpdir</name>
<value>/tmp/hive/java</value>
</property>
<property>
<name>system:user.name</name>
<value>$... |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | The answer is located in <http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/5.0/CDH5-Installation-Guide/cdh5ig_hive_schema_tool.html>
To suppress the schema check and allow the metastore to implicitly modify the schema, you need to set the hive.metastore.schema.verification configuration property to ... | I was facing the same issue there are some important point's that could be resolve this problem.
**1.Put the following at the beginning of hive-site.xml**
```
<property>
<name>system:java.io.tmpdir</name>
<value>/tmp/hive/java</value>
</property>
<property>
<name>system:user.name</name>
<value>$... |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | ```
rm metastore_db/*.lck
```
It works for me, too.
It can be found in your `home/user` directory. You can use the `locate` command to find it:
`locate metastore_db`
After removing the lock files, close the current session.
Call hive shell in new session | this could due to more than one "metastore\_db". Remove "metastore\_db", restart hadoop cluster and open hive shell from $HIVE\_HOME/bin folder |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | This could be an issue with the metastore like sachinjose described or a connection issue. Run hive console in debug mode like so:
`hive -hiveconf hive.root.logger=DEBUG,console`
Then execute a simple query like `show tables;` and see what happens. I ran into this issue after restarting a namenode and it was due to t... | If it is in local machine, looks like you have another terminal opened with hive shell/session. You can have only one session using embedded derby data base. Close all other hive sessions and try. |
22,711,375 | I started learning C++ using a ebook and got interupted by a few lines, which I think are a bit outdated. Anyway, what I am trying to do is using a preprocessor directive as a function parameter which isnt working:
```
#define TitleLabelId 1000;
//....
hTitleText = CreateWindow(L"STATIC",
L... | 2014/03/28 | [
"https://Stackoverflow.com/questions/22711375",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/985798/"
] | The answer is located in <http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH5/5.0/CDH5-Installation-Guide/cdh5ig_hive_schema_tool.html>
To suppress the schema check and allow the metastore to implicitly modify the schema, you need to set the hive.metastore.schema.verification configuration property to ... | I was facing the same issue--used the below steps to resolve it:
1. Create an file hive-site.xml and input the details (for Local/Prod mode). Make sure the below location exist /home/hadoop/bhishm/warehouse
Example:
```
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>... |
5,175,810 | >
> **Possible Duplicate:**
>
> [How to avoid scientific notation for large numbers in javascript?](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript)
>
>
>
Hi All,
Doing something like this
```
alert(999999999999999999999999999999999999999999999999);... | 2011/03/03 | [
"https://Stackoverflow.com/questions/5175810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | You're close:
```
validates_length_of :some_field, :within => 0..10, :allow_blank => true
```
You can change the zero minimum size, since it will only be triggered when there is some input.
See also the validation [docs](http://apidock.com/rails/ActiveModel/Validations/HelperMethods/validates_length_of). | Maybe it's a nil value instead of an empty string that it gets validated against ?
```
irb(main):006:0> ''.length
=> 0
irb(main):007:0> nil.length
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.length
from (irb):... |
5,175,810 | >
> **Possible Duplicate:**
>
> [How to avoid scientific notation for large numbers in javascript?](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript)
>
>
>
Hi All,
Doing something like this
```
alert(999999999999999999999999999999999999999999999999);... | 2011/03/03 | [
"https://Stackoverflow.com/questions/5175810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | You can pass `:allow_blank` as an option to allow this:
```
validates_length_of :some_field, :within => 0..10, :allow_blank => true
``` | Maybe it's a nil value instead of an empty string that it gets validated against ?
```
irb(main):006:0> ''.length
=> 0
irb(main):007:0> nil.length
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.length
from (irb):... |
5,175,810 | >
> **Possible Duplicate:**
>
> [How to avoid scientific notation for large numbers in javascript?](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript)
>
>
>
Hi All,
Doing something like this
```
alert(999999999999999999999999999999999999999999999999);... | 2011/03/03 | [
"https://Stackoverflow.com/questions/5175810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | try:
validates\_length\_of :some\_field, :within => [0..10], :if => :some\_field? | Maybe it's a nil value instead of an empty string that it gets validated against ?
```
irb(main):006:0> ''.length
=> 0
irb(main):007:0> nil.length
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.length
from (irb):... |
5,175,810 | >
> **Possible Duplicate:**
>
> [How to avoid scientific notation for large numbers in javascript?](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript)
>
>
>
Hi All,
Doing something like this
```
alert(999999999999999999999999999999999999999999999999);... | 2011/03/03 | [
"https://Stackoverflow.com/questions/5175810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | You're close:
```
validates_length_of :some_field, :within => 0..10, :allow_blank => true
```
You can change the zero minimum size, since it will only be triggered when there is some input.
See also the validation [docs](http://apidock.com/rails/ActiveModel/Validations/HelperMethods/validates_length_of). | You can pass `:allow_blank` as an option to allow this:
```
validates_length_of :some_field, :within => 0..10, :allow_blank => true
``` |
5,175,810 | >
> **Possible Duplicate:**
>
> [How to avoid scientific notation for large numbers in javascript?](https://stackoverflow.com/questions/1685680/how-to-avoid-scientific-notation-for-large-numbers-in-javascript)
>
>
>
Hi All,
Doing something like this
```
alert(999999999999999999999999999999999999999999999999);... | 2011/03/03 | [
"https://Stackoverflow.com/questions/5175810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/531746/"
] | You're close:
```
validates_length_of :some_field, :within => 0..10, :allow_blank => true
```
You can change the zero minimum size, since it will only be triggered when there is some input.
See also the validation [docs](http://apidock.com/rails/ActiveModel/Validations/HelperMethods/validates_length_of). | try:
validates\_length\_of :some\_field, :within => [0..10], :if => :some\_field? |
6,884,690 | Is there a PHP function that replaces `-` with `_` (underscores) ?
Like
```
my-name
```
with
```
my_name
``` | 2011/07/30 | [
"https://Stackoverflow.com/questions/6884690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/870873/"
] | `str_replace('-', '_', $name)` | There's, but it's not called replace\_hyphen, it's str\_replace
`str_replace('-', '_', $str);` |
6,884,690 | Is there a PHP function that replaces `-` with `_` (underscores) ?
Like
```
my-name
```
with
```
my_name
``` | 2011/07/30 | [
"https://Stackoverflow.com/questions/6884690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/870873/"
] | You need to use the return of str\_replace!
```
$name = str_replace('-', '_', $name);
``` | There's, but it's not called replace\_hyphen, it's str\_replace
`str_replace('-', '_', $str);` |
6,884,690 | Is there a PHP function that replaces `-` with `_` (underscores) ?
Like
```
my-name
```
with
```
my_name
``` | 2011/07/30 | [
"https://Stackoverflow.com/questions/6884690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/870873/"
] | `str_replace('-', '_', $name)` | Use this
```
str_replace("-", "_", "my-name");
``` |
6,884,690 | Is there a PHP function that replaces `-` with `_` (underscores) ?
Like
```
my-name
```
with
```
my_name
``` | 2011/07/30 | [
"https://Stackoverflow.com/questions/6884690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/870873/"
] | `str_replace('-', '_', $name)` | You need to use the return of str\_replace!
```
$name = str_replace('-', '_', $name);
``` |
6,884,690 | Is there a PHP function that replaces `-` with `_` (underscores) ?
Like
```
my-name
```
with
```
my_name
``` | 2011/07/30 | [
"https://Stackoverflow.com/questions/6884690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/870873/"
] | You need to use the return of str\_replace!
```
$name = str_replace('-', '_', $name);
``` | Use this
```
str_replace("-", "_", "my-name");
``` |
68,763,252 | I've built an ASP.net core Single tenant Web API that requires a token from Azure, I have also built a single tenant SPA via react that uses Azure to login Via MSAL-Brower. I want to use the token provided from azure when I log in to authenticate my client SPA to call my API.
The token request comes back successfully b... | 2021/08/12 | [
"https://Stackoverflow.com/questions/68763252",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3576722/"
] | This will work only in the recent versions of python
```
y = { key: y[key] for key in x if key in y}
```
For earlier versions you can check [collections.OrderedDict](https://docs.python.org/3/library/collections.html#collections.OrderedDict) | Iterate over the keys and values of x and check if the key exists within y.
```
y = {key: y[key] for key, value in x.items() if key in y}
``` |
13,499,817 | I have a few buttons in my app whose alpha is currently set to zero. These buttons are completely non-responsive, but as soon as I increase their alpha, they begin to respond. Is this expected behavior? | 2012/11/21 | [
"https://Stackoverflow.com/questions/13499817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199882/"
] | As per [Apple's documentation](http://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html#//apple_ref/occ/instm/UIView/hitTest:withEvent:) for `UIView`'s `hitTest:withEvent:` method:
>
> This method ignores view objects that are hidden, that have disabled
> user interactions... | When the alpha is 0 they are unresponsive, as alpha = 0 is like hidden = YES and you can't click a hidden button. |
13,499,817 | I have a few buttons in my app whose alpha is currently set to zero. These buttons are completely non-responsive, but as soon as I increase their alpha, they begin to respond. Is this expected behavior? | 2012/11/21 | [
"https://Stackoverflow.com/questions/13499817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199882/"
] | I'm a little late to the game but you could always set the UIButton background color to clearcolor. This would keep them active. In my case, I am pulsating a button to give it a glowing effect but to do this, I must set it's background to clear, then add a UIIMageView as a subview and add the effect to the image, NOT t... | When the alpha is 0 they are unresponsive, as alpha = 0 is like hidden = YES and you can't click a hidden button. |
13,499,817 | I have a few buttons in my app whose alpha is currently set to zero. These buttons are completely non-responsive, but as soon as I increase their alpha, they begin to respond. Is this expected behavior? | 2012/11/21 | [
"https://Stackoverflow.com/questions/13499817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199882/"
] | As per [Apple's documentation](http://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html#//apple_ref/occ/instm/UIView/hitTest:withEvent:) for `UIView`'s `hitTest:withEvent:` method:
>
> This method ignores view objects that are hidden, that have disabled
> user interactions... | I'm a little late to the game but you could always set the UIButton background color to clearcolor. This would keep them active. In my case, I am pulsating a button to give it a glowing effect but to do this, I must set it's background to clear, then add a UIIMageView as a subview and add the effect to the image, NOT t... |
13,499,817 | I have a few buttons in my app whose alpha is currently set to zero. These buttons are completely non-responsive, but as soon as I increase their alpha, they begin to respond. Is this expected behavior? | 2012/11/21 | [
"https://Stackoverflow.com/questions/13499817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199882/"
] | As per [Apple's documentation](http://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html#//apple_ref/occ/instm/UIView/hitTest:withEvent:) for `UIView`'s `hitTest:withEvent:` method:
>
> This method ignores view objects that are hidden, that have disabled
> user interactions... | Yes, the least alpha amount should be `3.0 / 255.0` for touch event to not be ignored. |
13,499,817 | I have a few buttons in my app whose alpha is currently set to zero. These buttons are completely non-responsive, but as soon as I increase their alpha, they begin to respond. Is this expected behavior? | 2012/11/21 | [
"https://Stackoverflow.com/questions/13499817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1199882/"
] | I'm a little late to the game but you could always set the UIButton background color to clearcolor. This would keep them active. In my case, I am pulsating a button to give it a glowing effect but to do this, I must set it's background to clear, then add a UIIMageView as a subview and add the effect to the image, NOT t... | Yes, the least alpha amount should be `3.0 / 255.0` for touch event to not be ignored. |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | I had this error with a clean install on MacOS X (Mojave), and after trial and error discovered that the main user who is running flutter debug needs to be an admin user.
Clue was the line:
```
log: Must be admin to run 'stream' command
```
when running from command line.
After this VS Code and command line work. | Try to change flutter channel to beta using "flutter channel beta". it worked for me to fix issue which is because flutter version is updated to "v1.12.13+hotfix.5". |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | I ended reinstalling flutter sdk.
Ubuntu 16.04
VSCODE | Try to downgrade the libglvnd package to version 1.2.0 in arch linux. |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | Run `flutter clean`.
This works for me. | Started with Flutter 12. It seems that the user must be admin now.
Rolling back to a previous Flutter version will do for now.
```
flutter version v1.9.1+hotfix.6
``` |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | Run `flutter clean`.
This works for me. | I ended reinstalling flutter sdk.
Ubuntu 16.04
VSCODE |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | I ended reinstalling flutter sdk.
Ubuntu 16.04
VSCODE | Started with Flutter 12. It seems that the user must be admin now.
Rolling back to a previous Flutter version will do for now.
```
flutter version v1.9.1+hotfix.6
``` |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | Run `flutter clean`.
This works for me. | I had this error with a clean install on MacOS X (Mojave), and after trial and error discovered that the main user who is running flutter debug needs to be an admin user.
Clue was the line:
```
log: Must be admin to run 'stream' command
```
when running from command line.
After this VS Code and command line work. |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | Build always works on my VS code normally. Updating to the latest Flutter 1.12 also started showing this and most times, my code either shows up on my device first before showing that debug has started or the program just quits. Any fix with VS code because I am not an Android Studio fan. | This started occuring after i updated xcode to 14.1.
Simple Restarting mac works with `flutter clean` |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | I had this error with a clean install on MacOS X (Mojave), and after trial and error discovered that the main user who is running flutter debug needs to be an admin user.
Clue was the line:
```
log: Must be admin to run 'stream' command
```
when running from command line.
After this VS Code and command line work. | I ended reinstalling flutter sdk.
Ubuntu 16.04
VSCODE |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | Build always works on my VS code normally. Updating to the latest Flutter 1.12 also started showing this and most times, my code either shows up on my device first before showing that debug has started or the program just quits. Any fix with VS code because I am not an Android Studio fan. | Try to change flutter channel to beta using "flutter channel beta". it worked for me to fix issue which is because flutter version is updated to "v1.12.13+hotfix.5". |
59,212,771 | I am creating two docker containers one front end and another one is .net core API. But when i call the API from the front end, I am getting an exception as follows,
>
> SocketException: Cannot assign requested address
> System.Net.Http.ConnectHelper.ConnectAsync(string host, int port, CancellationToken cancellation... | 2019/12/06 | [
"https://Stackoverflow.com/questions/59212771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5945784/"
] | I had this error with a clean install on MacOS X (Mojave), and after trial and error discovered that the main user who is running flutter debug needs to be an admin user.
Clue was the line:
```
log: Must be admin to run 'stream' command
```
when running from command line.
After this VS Code and command line work. | Try to downgrade the libglvnd package to version 1.2.0 in arch linux. |
18,126,683 | So I have a Bing Map control, a GeoCordWatcher getting gps lat and lon, a timer for position intervals and a RouteQuery maker turning the GPS cords into a path for the map.
The points are correct, +- a couple of meters. The problem is that if I am near an intersection or a side street it when the route query runs it ... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18126683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051392/"
] | >
> but I'd like to use the android java std lib for a project of mine
>
>
>
I have no idea why you think that would work, any more than trying to use a Windows DLL on Linux.
>
> Is there any way to get the source code (in a jar or otherwise) for the android.jar so I can hook it up to the IDE so I can nicely bro... | As you use eclipse, use
>
> jadclipse
>
>
>
which extrach any jar that in eclipse, u can view any source code with out download and also without internet. It has also export source code, As a developer It help u most times. :->
[link to download](http://marketplace.eclipse.org/content/jadclipse) |
18,126,683 | So I have a Bing Map control, a GeoCordWatcher getting gps lat and lon, a timer for position intervals and a RouteQuery maker turning the GPS cords into a path for the map.
The points are correct, +- a couple of meters. The problem is that if I am near an intersection or a side street it when the route query runs it ... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18126683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051392/"
] | >
> but I'd like to use the android java std lib for a project of mine
>
>
>
I have no idea why you think that would work, any more than trying to use a Windows DLL on Linux.
>
> Is there any way to get the source code (in a jar or otherwise) for the android.jar so I can hook it up to the IDE so I can nicely bro... | Unpacking the *jar* is way more than you need to worry about. Android is *open source*, so you can get everything you need online. To start, you can browse most of the source on [Android's GitHub account](https://github.com/android), or download the source tree on the [Android Open Source Project website](http://source... |
18,126,683 | So I have a Bing Map control, a GeoCordWatcher getting gps lat and lon, a timer for position intervals and a RouteQuery maker turning the GPS cords into a path for the map.
The points are correct, +- a couple of meters. The problem is that if I am near an intersection or a side street it when the route query runs it ... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18126683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051392/"
] | In your Android SDK root directory, go to the `sources` folder. Here you will find the source files for the different platforms you have downloaded.
Note: This gives you the Java code for Android libraries such as `Activity` | As you use eclipse, use
>
> jadclipse
>
>
>
which extrach any jar that in eclipse, u can view any source code with out download and also without internet. It has also export source code, As a developer It help u most times. :->
[link to download](http://marketplace.eclipse.org/content/jadclipse) |
18,126,683 | So I have a Bing Map control, a GeoCordWatcher getting gps lat and lon, a timer for position intervals and a RouteQuery maker turning the GPS cords into a path for the map.
The points are correct, +- a couple of meters. The problem is that if I am near an intersection or a side street it when the route query runs it ... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18126683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051392/"
] | In your Android SDK root directory, go to the `sources` folder. Here you will find the source files for the different platforms you have downloaded.
Note: This gives you the Java code for Android libraries such as `Activity` | Unpacking the *jar* is way more than you need to worry about. Android is *open source*, so you can get everything you need online. To start, you can browse most of the source on [Android's GitHub account](https://github.com/android), or download the source tree on the [Android Open Source Project website](http://source... |
18,126,683 | So I have a Bing Map control, a GeoCordWatcher getting gps lat and lon, a timer for position intervals and a RouteQuery maker turning the GPS cords into a path for the map.
The points are correct, +- a couple of meters. The problem is that if I am near an intersection or a side street it when the route query runs it ... | 2013/08/08 | [
"https://Stackoverflow.com/questions/18126683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2051392/"
] | Unpacking the *jar* is way more than you need to worry about. Android is *open source*, so you can get everything you need online. To start, you can browse most of the source on [Android's GitHub account](https://github.com/android), or download the source tree on the [Android Open Source Project website](http://source... | As you use eclipse, use
>
> jadclipse
>
>
>
which extrach any jar that in eclipse, u can view any source code with out download and also without internet. It has also export source code, As a developer It help u most times. :->
[link to download](http://marketplace.eclipse.org/content/jadclipse) |
20,448,337 | I have an Excel sheet with data only in the first column, where each cell *starts* with the character H, G, I, B, H, E, S, C, or none of the above.
I would like to write a command so that in the second column, one of four things will happen:
1. If the cell in the first column starts with H, G, or I, then the cell in ... | 2013/12/08 | [
"https://Stackoverflow.com/questions/20448337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Maybe the "LEFT()"-Function is what you are looking for.
Something like "LEFT(A1,1)" should give you the first Character of the String in Cell A1.
More information:
<http://office.microsoft.com/en-us/excel-help/left-leftb-functions-HP005209153.aspx>
EDIT: Wow, this community is always impressing me. (Too fast for m... | try this:
`=IF(OR(LEFT(AB25,1)="H"; LEFT(AB25,1)="G"; LEFT(AB25,1)="I");"H";"") & IF(OR(LEFT(AB25,1)="B"; LEFT(AB25,1)="E");"E";"") & IF(OR(LEFT(AB25,1)="T"; LEFT(AB25,1)="S"; LEFT(AB25,1)="C");"C";"")` |
20,448,337 | I have an Excel sheet with data only in the first column, where each cell *starts* with the character H, G, I, B, H, E, S, C, or none of the above.
I would like to write a command so that in the second column, one of four things will happen:
1. If the cell in the first column starts with H, G, or I, then the cell in ... | 2013/12/08 | [
"https://Stackoverflow.com/questions/20448337",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Maybe the "LEFT()"-Function is what you are looking for.
Something like "LEFT(A1,1)" should give you the first Character of the String in Cell A1.
More information:
<http://office.microsoft.com/en-us/excel-help/left-leftb-functions-HP005209153.aspx>
EDIT: Wow, this community is always impressing me. (Too fast for m... | Create a small table elsewhere in in the workbook. Let's give it the named range "MyLookup" for the sake of example. This table simply maps the input values to the desired output values, like so:
```
MyLookup:
Input Output
H H
G H
I H
B E
E E
etc...
```
Now use this very simple ... |
602,200 | Let's consider that we have a Newton's cradle in vacuum:
[](https://i.stack.imgur.com/NPea6.jpg)
Considering that each ball has a mass of 100g or 0.1 kg we release the ball and at the time of contact, the ball has a final velocity of 1 m/s. So the mo... | 2020/12/22 | [
"https://physics.stackexchange.com/questions/602200",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/281732/"
] | I think that to understand your misunderstanding we have to consider the conditions for conservation of momentum: momentum is conserved so long as there is no net external force acting on the system in question. Considering the simple case in a vacuum, even friction between balls or between the strings and the post is ... | You seem to dismiss the fact that conservation of momentum means conservation of momentum **vector**. If you consider the initial state right before the first collision, on the left hand side, the initial momentum is 0.1 kg m/s in the direction horizonatl to the right. Once the last ball on the right is moving up the m... |
602,200 | Let's consider that we have a Newton's cradle in vacuum:
[](https://i.stack.imgur.com/NPea6.jpg)
Considering that each ball has a mass of 100g or 0.1 kg we release the ball and at the time of contact, the ball has a final velocity of 1 m/s. So the mo... | 2020/12/22 | [
"https://physics.stackexchange.com/questions/602200",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/281732/"
] | I think that to understand your misunderstanding we have to consider the conditions for conservation of momentum: momentum is conserved so long as there is no net external force acting on the system in question. Considering the simple case in a vacuum, even friction between balls or between the strings and the post is ... | Let's simplify a bit more. Suppose there are only two balls, and they are made of wet clay. One balls swings toward the other and sticks - totally inelastic.
You have probably already done the math for collisions like this. Momentum is conserved, kinetic energy is not. Both balls have the same velocity afterward. The ... |
602,200 | Let's consider that we have a Newton's cradle in vacuum:
[](https://i.stack.imgur.com/NPea6.jpg)
Considering that each ball has a mass of 100g or 0.1 kg we release the ball and at the time of contact, the ball has a final velocity of 1 m/s. So the mo... | 2020/12/22 | [
"https://physics.stackexchange.com/questions/602200",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/281732/"
] | I don't think this is a bad question at all - I don't understand the down votes. Issues like this used to confuse me too, and I don't feel that any of the comments or answers so far have really got to the bottom of the issue.
Let's think about your setup a bit. You have a Newton's cradle toy in a vacuum, so it's isola... | I think that to understand your misunderstanding we have to consider the conditions for conservation of momentum: momentum is conserved so long as there is no net external force acting on the system in question. Considering the simple case in a vacuum, even friction between balls or between the strings and the post is ... |
602,200 | Let's consider that we have a Newton's cradle in vacuum:
[](https://i.stack.imgur.com/NPea6.jpg)
Considering that each ball has a mass of 100g or 0.1 kg we release the ball and at the time of contact, the ball has a final velocity of 1 m/s. So the mo... | 2020/12/22 | [
"https://physics.stackexchange.com/questions/602200",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/281732/"
] | Let's simplify a bit more. Suppose there are only two balls, and they are made of wet clay. One balls swings toward the other and sticks - totally inelastic.
You have probably already done the math for collisions like this. Momentum is conserved, kinetic energy is not. Both balls have the same velocity afterward. The ... | You seem to dismiss the fact that conservation of momentum means conservation of momentum **vector**. If you consider the initial state right before the first collision, on the left hand side, the initial momentum is 0.1 kg m/s in the direction horizonatl to the right. Once the last ball on the right is moving up the m... |
602,200 | Let's consider that we have a Newton's cradle in vacuum:
[](https://i.stack.imgur.com/NPea6.jpg)
Considering that each ball has a mass of 100g or 0.1 kg we release the ball and at the time of contact, the ball has a final velocity of 1 m/s. So the mo... | 2020/12/22 | [
"https://physics.stackexchange.com/questions/602200",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/281732/"
] | I don't think this is a bad question at all - I don't understand the down votes. Issues like this used to confuse me too, and I don't feel that any of the comments or answers so far have really got to the bottom of the issue.
Let's think about your setup a bit. You have a Newton's cradle toy in a vacuum, so it's isola... | You seem to dismiss the fact that conservation of momentum means conservation of momentum **vector**. If you consider the initial state right before the first collision, on the left hand side, the initial momentum is 0.1 kg m/s in the direction horizonatl to the right. Once the last ball on the right is moving up the m... |
602,200 | Let's consider that we have a Newton's cradle in vacuum:
[](https://i.stack.imgur.com/NPea6.jpg)
Considering that each ball has a mass of 100g or 0.1 kg we release the ball and at the time of contact, the ball has a final velocity of 1 m/s. So the mo... | 2020/12/22 | [
"https://physics.stackexchange.com/questions/602200",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/281732/"
] | I don't think this is a bad question at all - I don't understand the down votes. Issues like this used to confuse me too, and I don't feel that any of the comments or answers so far have really got to the bottom of the issue.
Let's think about your setup a bit. You have a Newton's cradle toy in a vacuum, so it's isola... | Let's simplify a bit more. Suppose there are only two balls, and they are made of wet clay. One balls swings toward the other and sticks - totally inelastic.
You have probably already done the math for collisions like this. Momentum is conserved, kinetic energy is not. Both balls have the same velocity afterward. The ... |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | I have heard someone use
>
> I am a prophet, not a saint.
>
>
>
A *prophet* is one who comes to the world to give us a message. Here it refers to how he criticizes others for their wrongdoings.
A *saint* is one who does good things. Here it refers to how he does the same bad thing that he criticizes others for. | If you don't mind using a Biblical allusion which may not be immediately obvious to your audience, you could go with *whitewashed tomb*. |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | If you don't mind it as an adjective, this person is either:
**insincere**
or
**disingenuous** | >
> Nixonian?
>
> As in "Well, when the President does it that means that it is not illegal." [via Wikipedia](http://en.wikiquote.org/wiki/Richard_Nixon)
>
>
> |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | I have heard someone use
>
> I am a prophet, not a saint.
>
>
>
A *prophet* is one who comes to the world to give us a message. Here it refers to how he criticizes others for their wrongdoings.
A *saint* is one who does good things. Here it refers to how he does the same bad thing that he criticizes others for. | >
> Nixonian?
>
> As in "Well, when the President does it that means that it is not illegal." [via Wikipedia](http://en.wikiquote.org/wiki/Richard_Nixon)
>
>
> |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | I have heard someone use
>
> I am a prophet, not a saint.
>
>
>
A *prophet* is one who comes to the world to give us a message. Here it refers to how he criticizes others for their wrongdoings.
A *saint* is one who does good things. Here it refers to how he does the same bad thing that he criticizes others for. | This sounds like a person who is making a *rationalization*. The noun form would be *rationalizer* (one who rationalizes), but I can't think of any times I've seen or heard that word used. |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | The idiom that describes this behavior is: "Do as I say and not as I do." However, it's usually said by the person exhibiting the contradictory behavior and not those categorizing them. | I have heard someone use
>
> I am a prophet, not a saint.
>
>
>
A *prophet* is one who comes to the world to give us a message. Here it refers to how he criticizes others for their wrongdoings.
A *saint* is one who does good things. Here it refers to how he does the same bad thing that he criticizes others for. |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | If you don't mind it as an adjective, this person is either:
**insincere**
or
**disingenuous** | Does it have to be one word? I suggest some sort of compound phrase:
>
> *open hypocrite*
>
>
>
The implication being that a normal hypocrite is closed because they hide their hypocrisy either intentionally or unintentionally.
>
> *apathetic hypocrite*
>
>
>
This person knows and communicates that they are ... |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | If you don't mind using a Biblical allusion which may not be immediately obvious to your audience, you could go with *whitewashed tomb*. | >
> Nixonian?
>
> As in "Well, when the President does it that means that it is not illegal." [via Wikipedia](http://en.wikiquote.org/wiki/Richard_Nixon)
>
>
> |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | If you don't mind using a Biblical allusion which may not be immediately obvious to your audience, you could go with *whitewashed tomb*. | Does it have to be one word? I suggest some sort of compound phrase:
>
> *open hypocrite*
>
>
>
The implication being that a normal hypocrite is closed because they hide their hypocrisy either intentionally or unintentionally.
>
> *apathetic hypocrite*
>
>
>
This person knows and communicates that they are ... |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | The idiom that describes this behavior is: "Do as I say and not as I do." However, it's usually said by the person exhibiting the contradictory behavior and not those categorizing them. | This sounds like a person who is making a *rationalization*. The noun form would be *rationalizer* (one who rationalizes), but I can't think of any times I've seen or heard that word used. |
6,961 | I'm trying to accurately describe a person who acts in one way and does another but knowingly and openly accepts that his actions also include him in the same group he criticizes.
This differs from a hypocrite who condemns those who perform an action but justifies his own actions by unrelated means and does not accept... | 2010/12/17 | [
"https://english.stackexchange.com/questions/6961",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/2871/"
] | I have heard someone use
>
> I am a prophet, not a saint.
>
>
>
A *prophet* is one who comes to the world to give us a message. Here it refers to how he criticizes others for their wrongdoings.
A *saint* is one who does good things. Here it refers to how he does the same bad thing that he criticizes others for. | If you don't mind it as an adjective, this person is either:
**insincere**
or
**disingenuous** |
4,610,120 | I have jquery function:
```
function handleSplittingPrices() {
var customerId = $(this).val();
loadSplittingPrices(customerId);
}
```
I want to execute it with elem as "this":
```
var elem=$('...');
handleSplittingPrices() <-- here elem will be this
```
How can I do it? | 2011/01/05 | [
"https://Stackoverflow.com/questions/4610120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289246/"
] | You're looking for the [`call` method](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call):
```
handleSplittingPrices.call(elem);
```
Note that `elem` is a jQuery object, not a DOM element, so you won't need to call `$` inside the function. | Use [`call`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call):
```
handleSplittingPrices.call(elem);
``` |
4,610,120 | I have jquery function:
```
function handleSplittingPrices() {
var customerId = $(this).val();
loadSplittingPrices(customerId);
}
```
I want to execute it with elem as "this":
```
var elem=$('...');
handleSplittingPrices() <-- here elem will be this
```
How can I do it? | 2011/01/05 | [
"https://Stackoverflow.com/questions/4610120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289246/"
] | You're looking for the [`call` method](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call):
```
handleSplittingPrices.call(elem);
```
Note that `elem` is a jQuery object, not a DOM element, so you won't need to call `$` inside the function. | You can't. Obviously you don't know what "this" is for.
function handleSplittingPrices(elem) {
var customerId = $(elem).val();
loadSplittingPrices(customerId);
}
var elem=$('...');
handleSplittingPrices(elem);
Wow. Now wasn't that simpler than trying to define the whole concept of Object Oriented programming? |
4,610,120 | I have jquery function:
```
function handleSplittingPrices() {
var customerId = $(this).val();
loadSplittingPrices(customerId);
}
```
I want to execute it with elem as "this":
```
var elem=$('...');
handleSplittingPrices() <-- here elem will be this
```
How can I do it? | 2011/01/05 | [
"https://Stackoverflow.com/questions/4610120",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289246/"
] | Use [`call`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call):
```
handleSplittingPrices.call(elem);
``` | You can't. Obviously you don't know what "this" is for.
function handleSplittingPrices(elem) {
var customerId = $(elem).val();
loadSplittingPrices(customerId);
}
var elem=$('...');
handleSplittingPrices(elem);
Wow. Now wasn't that simpler than trying to define the whole concept of Object Oriented programming? |
85,440 | I've moved my blogs from SP2010 to SP2013, and the original **Posts** Web Part doesn't render correctly, it shows the error
>
> Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the pro... | 2013/12/18 | [
"https://sharepoint.stackexchange.com/questions/85440",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/3384/"
] | Make sure first that the selected view is "Summary View".
The inline, Basic and Boxed styles work only with "Summary View" | The easiest solution is to reactivate `BlogHomePage` feature `{E4639BB7-6E95-4E2F-B562-03B832DD4793}`. It will re-populate the homepage with new `default.aspx` with all webparts. |
85,440 | I've moved my blogs from SP2010 to SP2013, and the original **Posts** Web Part doesn't render correctly, it shows the error
>
> Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the pro... | 2013/12/18 | [
"https://sharepoint.stackexchange.com/questions/85440",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/3384/"
] | If you want to see the blogs with date image and other summary details, You need to select the view as "**Summary View**" for the webpart by "**Edit Web Part**" option. It is working as expected for me. | The easiest solution is to reactivate `BlogHomePage` feature `{E4639BB7-6E95-4E2F-B562-03B832DD4793}`. It will re-populate the homepage with new `default.aspx` with all webparts. |
78,745 | I know the basic difference between Arminianism and Calvinism in the soteriology subject, but when Molinism comes I can't grasp the core doctrines that it teaches. I'm not asking for which is better, just a concise, easy, and helpful definition of each one without too much philosophical blather. | 2020/08/06 | [
"https://christianity.stackexchange.com/questions/78745",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/46961/"
] | ***I found an article*** that explains Molinism in simple, easy to understand language. The second part of the article asks whether it is biblical, but I have left that part out since this is not what you ask. Here is a partial quote:
>
> Molinism is named for the 16th-century Jesuit, Luis de Molina. Molinism is a sy... | Extract from [William Lane Craig](https://www.reasonablefaith.org/writings/question-answer/molinism-vs.-calvinism/) answering a question on the complexity of Molinism :
>
> Actually, I have no problem with certain classic statements of the Reformed view. For example, the Westminster Confession (Sect. III) declares th... |
78,745 | I know the basic difference between Arminianism and Calvinism in the soteriology subject, but when Molinism comes I can't grasp the core doctrines that it teaches. I'm not asking for which is better, just a concise, easy, and helpful definition of each one without too much philosophical blather. | 2020/08/06 | [
"https://christianity.stackexchange.com/questions/78745",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/46961/"
] | Extract from [William Lane Craig](https://www.reasonablefaith.org/writings/question-answer/molinism-vs.-calvinism/) answering a question on the complexity of Molinism :
>
> Actually, I have no problem with certain classic statements of the Reformed view. For example, the Westminster Confession (Sect. III) declares th... | TL;DR: Calvinists and Arminians disagree about whether man is able and/or free to choose God, Molinism is to do with God's knowledge and not salvation, so can fit with either.
Molinist here - Molinism isn't technically a view of soteriology (meaning to do with man's salvation), but is a view of God's knowledge, summed... |
78,745 | I know the basic difference between Arminianism and Calvinism in the soteriology subject, but when Molinism comes I can't grasp the core doctrines that it teaches. I'm not asking for which is better, just a concise, easy, and helpful definition of each one without too much philosophical blather. | 2020/08/06 | [
"https://christianity.stackexchange.com/questions/78745",
"https://christianity.stackexchange.com",
"https://christianity.stackexchange.com/users/46961/"
] | ***I found an article*** that explains Molinism in simple, easy to understand language. The second part of the article asks whether it is biblical, but I have left that part out since this is not what you ask. Here is a partial quote:
>
> Molinism is named for the 16th-century Jesuit, Luis de Molina. Molinism is a sy... | TL;DR: Calvinists and Arminians disagree about whether man is able and/or free to choose God, Molinism is to do with God's knowledge and not salvation, so can fit with either.
Molinist here - Molinism isn't technically a view of soteriology (meaning to do with man's salvation), but is a view of God's knowledge, summed... |
30,561,195 | I have an app in which the main view is a `PopupWindow` with a couple of `ImageViews` and an `EditText` on top of them. My problem is when I enter a very long text and the text box expands down and pushing the image views out of the view and I can't see them, and in order to see them back I need to delete some text.
W... | 2015/05/31 | [
"https://Stackoverflow.com/questions/30561195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2162550/"
] | There is a difference, and it has to do with whether that list is referenced from multiple places/names.
```
>>> a = [1, 2, 3]
>>> b = a
>>> del a[:]
>>> print(b)
[]
>>> a = [1, 2, 3]
>>> b = a
>>> a = []
>>> print(b)
[1, 2, 3]
```
Using `del a[:]` clears the *existing* list, which means anywhere it's referenced wi... | This can probably best be shown:
```
>>> a = [1, 2, 3]
>>> id(a)
45556280
>>> del a[:]
>>> id(a)
45556280
>>> b = [4, 5, 6]
>>> id(b)
45556680
>>> b = []
>>> id(b)
45556320
```
When you do `a[:]` you are referring to all elements within the list "assigned" to `a`. The `del` statement removes references to objects. S... |
30,561,195 | I have an app in which the main view is a `PopupWindow` with a couple of `ImageViews` and an `EditText` on top of them. My problem is when I enter a very long text and the text box expands down and pushing the image views out of the view and I can't see them, and in order to see them back I need to delete some text.
W... | 2015/05/31 | [
"https://Stackoverflow.com/questions/30561195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2162550/"
] | There is a difference, and it has to do with whether that list is referenced from multiple places/names.
```
>>> a = [1, 2, 3]
>>> b = a
>>> del a[:]
>>> print(b)
[]
>>> a = [1, 2, 3]
>>> b = a
>>> a = []
>>> print(b)
[1, 2, 3]
```
Using `del a[:]` clears the *existing* list, which means anywhere it's referenced wi... | ```
>>> list1 = [1,2,3,4,5]
>>> list2 = list1
```
**To get a better understanding, let us see with the help of pictures what happens internally.**
```
>>> list1 = [1,2,3,4,5]
```
This creates a list object and assigns it to `list1`.

```
>... |
30,561,195 | I have an app in which the main view is a `PopupWindow` with a couple of `ImageViews` and an `EditText` on top of them. My problem is when I enter a very long text and the text box expands down and pushing the image views out of the view and I can't see them, and in order to see them back I need to delete some text.
W... | 2015/05/31 | [
"https://Stackoverflow.com/questions/30561195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2162550/"
] | There is a difference, and it has to do with whether that list is referenced from multiple places/names.
```
>>> a = [1, 2, 3]
>>> b = a
>>> del a[:]
>>> print(b)
[]
>>> a = [1, 2, 3]
>>> b = a
>>> a = []
>>> print(b)
[1, 2, 3]
```
Using `del a[:]` clears the *existing* list, which means anywhere it's referenced wi... | Well, del uses just a little less space in the computer as the person above me implied. The computer still accepts the variable as the same code, except with a different value. However, when you variable is assigned something else, the computer assigns a completely different code ID to it in order to account for the ch... |
30,561,195 | I have an app in which the main view is a `PopupWindow` with a couple of `ImageViews` and an `EditText` on top of them. My problem is when I enter a very long text and the text box expands down and pushing the image views out of the view and I can't see them, and in order to see them back I need to delete some text.
W... | 2015/05/31 | [
"https://Stackoverflow.com/questions/30561195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2162550/"
] | This can probably best be shown:
```
>>> a = [1, 2, 3]
>>> id(a)
45556280
>>> del a[:]
>>> id(a)
45556280
>>> b = [4, 5, 6]
>>> id(b)
45556680
>>> b = []
>>> id(b)
45556320
```
When you do `a[:]` you are referring to all elements within the list "assigned" to `a`. The `del` statement removes references to objects. S... | ```
>>> list1 = [1,2,3,4,5]
>>> list2 = list1
```
**To get a better understanding, let us see with the help of pictures what happens internally.**
```
>>> list1 = [1,2,3,4,5]
```
This creates a list object and assigns it to `list1`.

```
>... |
30,561,195 | I have an app in which the main view is a `PopupWindow` with a couple of `ImageViews` and an `EditText` on top of them. My problem is when I enter a very long text and the text box expands down and pushing the image views out of the view and I can't see them, and in order to see them back I need to delete some text.
W... | 2015/05/31 | [
"https://Stackoverflow.com/questions/30561195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2162550/"
] | This can probably best be shown:
```
>>> a = [1, 2, 3]
>>> id(a)
45556280
>>> del a[:]
>>> id(a)
45556280
>>> b = [4, 5, 6]
>>> id(b)
45556680
>>> b = []
>>> id(b)
45556320
```
When you do `a[:]` you are referring to all elements within the list "assigned" to `a`. The `del` statement removes references to objects. S... | Well, del uses just a little less space in the computer as the person above me implied. The computer still accepts the variable as the same code, except with a different value. However, when you variable is assigned something else, the computer assigns a completely different code ID to it in order to account for the ch... |
30,561,195 | I have an app in which the main view is a `PopupWindow` with a couple of `ImageViews` and an `EditText` on top of them. My problem is when I enter a very long text and the text box expands down and pushing the image views out of the view and I can't see them, and in order to see them back I need to delete some text.
W... | 2015/05/31 | [
"https://Stackoverflow.com/questions/30561195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2162550/"
] | ```
>>> list1 = [1,2,3,4,5]
>>> list2 = list1
```
**To get a better understanding, let us see with the help of pictures what happens internally.**
```
>>> list1 = [1,2,3,4,5]
```
This creates a list object and assigns it to `list1`.

```
>... | Well, del uses just a little less space in the computer as the person above me implied. The computer still accepts the variable as the same code, except with a different value. However, when you variable is assigned something else, the computer assigns a completely different code ID to it in order to account for the ch... |
55,559,336 | I've got a stored procedure that i'm having some issues with.
I'm trying to lookup against my table `GOTWVotes` and if `VotedBy` hasn't voted before write the vote to the table(this is working) however if `VotedBy` has voted before not to write to the table and return `VoteCount` as 1.
Although it doesn't write to th... | 2019/04/07 | [
"https://Stackoverflow.com/questions/55559336",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11041621/"
] | Spring uses `jakarta.annotation.PostConstruct`. As a contributor in `spring-cloud-kubernetes`, I have used it and included it in that project numerous times. As a matter of fact we favor *dropping* `InitializingBean`. | Ref <https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-postconstruct-and-predestroy-annotations>
>
> Like @Resource, the @PostConstruct and @PreDestroy annotation types were a part of the standard Java libraries from JDK 6 to 8. However, the entire javax.annotation package got separa... |
27,913,144 | Is there a way to specify which bold or italic variations to use in a font like Avenir Next?
Here's an example. By default a Avenir Next will choose Avenir Next Bold for bold but I would like it to use Avenir Next Demi Bold instead. [Here is fiddle.](http://jsfiddle.net/pdtk1rjt/)
```
<span style="font-family:'Avenir... | 2015/01/13 | [
"https://Stackoverflow.com/questions/27913144",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/284714/"
] | CSS dosen't let you change font-family for different weights of the same font, unless you start providing your own font files, which is a lot of work for a better looking bold...
However, if you can avoid using inline styles, and instead use the `<strong>` tag to mark bold text, you'll be able to get the exact result ... | The solution is to use the @font-face rule.
***Update: This seems broken now on OS X 10.10.2.***
```css
@font-face {
font-family: 'Avenir Next';
src: local('AvenirNext-DemiBold');
font-weight: bold;
font-style: normal;
}
```
```html
<span style="font-family:'Avenir Next'">
Normal
<span s... |
13,411,779 | I have a table of representative in some schema in "mysql" and the table has a column named "userName". now for log in to program, i need to get data from text field in frame and check it with all usernames in in that column (username column has more than one row!) and if text of in username jtextfield equals with one ... | 2012/11/16 | [
"https://Stackoverflow.com/questions/13411779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1828782/"
] | I think you should try this
```
....
if (user.equals(rs.getString("passWord"))
....
``` | The problem is with the string equality check in your if.Always check string equality using `equals` method. `==` operator checks if two reference variables point the same object. it checksif both the reference variables are identical. equals method checksif both objects are considered meaningfully equal.
```
if(user ... |
13,411,779 | I have a table of representative in some schema in "mysql" and the table has a column named "userName". now for log in to program, i need to get data from text field in frame and check it with all usernames in in that column (username column has more than one row!) and if text of in username jtextfield equals with one ... | 2012/11/16 | [
"https://Stackoverflow.com/questions/13411779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1828782/"
] | Your query should be more specific like `"SELECT * FROM representative where user=? and passWord =?";`
And in `prepareStatement` should set those dynamic values
```
st = con.prepareStatement(sql);
st.setString(1,user);
st.setString(2,pass);
```
And you need to check result like -
```
//no while
if(rs.next()){
... | The problem is with the string equality check in your if.Always check string equality using `equals` method. `==` operator checks if two reference variables point the same object. it checksif both the reference variables are identical. equals method checksif both objects are considered meaningfully equal.
```
if(user ... |
13,411,779 | I have a table of representative in some schema in "mysql" and the table has a column named "userName". now for log in to program, i need to get data from text field in frame and check it with all usernames in in that column (username column has more than one row!) and if text of in username jtextfield equals with one ... | 2012/11/16 | [
"https://Stackoverflow.com/questions/13411779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1828782/"
] | Your query should be more specific like `"SELECT * FROM representative where user=? and passWord =?";`
And in `prepareStatement` should set those dynamic values
```
st = con.prepareStatement(sql);
st.setString(1,user);
st.setString(2,pass);
```
And you need to check result like -
```
//no while
if(rs.next()){
... | I think you should try this
```
....
if (user.equals(rs.getString("passWord"))
....
``` |
1,674,980 | I really can't believe I couldn't find a clear answer to this...
How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.:
```
class Blah
{
public:
Blah()
{
throw "oops";
}
};
void main()
{
Blah* b = NULL;
... | 2009/11/04 | [
"https://Stackoverflow.com/questions/1674980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31760/"
] | If the Constructor throws the memory allocated for the object is auto-magically returned to the system.
Note the destructor of the class that threw will not be called.
But the destructor of any base class (where the base constructor has completed) will also be called.
Note:
As most other people have noted membe... | The problem described is as old as the road to Rome, to use a Dutch saying. I have worked out the problem and a memory allocation for an object that might throw an exception looks as follows:
```
try
{
std::string *l_string =
(_heap_cleanup_tpl<std::string>(&l_string),
new std::string(0xf0000000, '... |
1,674,980 | I really can't believe I couldn't find a clear answer to this...
How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.:
```
class Blah
{
public:
Blah()
{
throw "oops";
}
};
void main()
{
Blah* b = NULL;
... | 2009/11/04 | [
"https://Stackoverflow.com/questions/1674980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31760/"
] | If an object cannot complete destruction because the constructor throws an exception, the first thing to happen (this happens as part of the constructor's special handling) is that all member variables to have been constructed are destroyed - if an exception is thrown in the initializer list, this means that only eleme... | The long and short of it is that if you haven't made any allocations of other entities in you object(as in your example) then the memory that was allocated will be deleted automatically. However, any new statements(or anything else that directly manages memory) needs to be handled in a catch statement in the constructo... |
1,674,980 | I really can't believe I couldn't find a clear answer to this...
How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.:
```
class Blah
{
public:
Blah()
{
throw "oops";
}
};
void main()
{
Blah* b = NULL;
... | 2009/11/04 | [
"https://Stackoverflow.com/questions/1674980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31760/"
] | From the C++ 2003 Standard 5.3.4/17 - New:
>
> If any part of the object initialization described above terminates by throwing an exception and a suitable deallocation function can be found, the deallocation function is called to free the memory in which the object was being constructed, after which the exception con... | Quoted from C++ FAQ ([parashift.com](http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.10)):
>
> [17.4] How should I handle resources if my constructors may throw
> exceptions?
> ------------------------------------------------------------------------------
>
>
> Every data member inside your object sho... |
1,674,980 | I really can't believe I couldn't find a clear answer to this...
How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.:
```
class Blah
{
public:
Blah()
{
throw "oops";
}
};
void main()
{
Blah* b = NULL;
... | 2009/11/04 | [
"https://Stackoverflow.com/questions/1674980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31760/"
] | If the Constructor throws the memory allocated for the object is auto-magically returned to the system.
Note the destructor of the class that threw will not be called.
But the destructor of any base class (where the base constructor has completed) will also be called.
Note:
As most other people have noted membe... | I think it's kind of wierd for a constructor to raise an exception.
Could you have a return value and test it in your main?
```
class Blah
{
public:
Blah()
{
if Error
{
this.Error = "oops";
}
}
};
void main()
{
Blah* b = NULL;
b = new Blah();
if (... |
1,674,980 | I really can't believe I couldn't find a clear answer to this...
How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.:
```
class Blah
{
public:
Blah()
{
throw "oops";
}
};
void main()
{
Blah* b = NULL;
... | 2009/11/04 | [
"https://Stackoverflow.com/questions/1674980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31760/"
] | From the C++ 2003 Standard 5.3.4/17 - New:
>
> If any part of the object initialization described above terminates by throwing an exception and a suitable deallocation function can be found, the deallocation function is called to free the memory in which the object was being constructed, after which the exception con... | The problem described is as old as the road to Rome, to use a Dutch saying. I have worked out the problem and a memory allocation for an object that might throw an exception looks as follows:
```
try
{
std::string *l_string =
(_heap_cleanup_tpl<std::string>(&l_string),
new std::string(0xf0000000, '... |
1,674,980 | I really can't believe I couldn't find a clear answer to this...
How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.:
```
class Blah
{
public:
Blah()
{
throw "oops";
}
};
void main()
{
Blah* b = NULL;
... | 2009/11/04 | [
"https://Stackoverflow.com/questions/1674980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31760/"
] | If an object cannot complete destruction because the constructor throws an exception, the first thing to happen (this happens as part of the constructor's special handling) is that all member variables to have been constructed are destroyed - if an exception is thrown in the initializer list, this means that only eleme... | I think it's kind of wierd for a constructor to raise an exception.
Could you have a return value and test it in your main?
```
class Blah
{
public:
Blah()
{
if Error
{
this.Error = "oops";
}
}
};
void main()
{
Blah* b = NULL;
b = new Blah();
if (... |
1,674,980 | I really can't believe I couldn't find a clear answer to this...
How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.:
```
class Blah
{
public:
Blah()
{
throw "oops";
}
};
void main()
{
Blah* b = NULL;
... | 2009/11/04 | [
"https://Stackoverflow.com/questions/1674980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31760/"
] | If the Constructor throws the memory allocated for the object is auto-magically returned to the system.
Note the destructor of the class that threw will not be called.
But the destructor of any base class (where the base constructor has completed) will also be called.
Note:
As most other people have noted membe... | Quoted from C++ FAQ ([parashift.com](http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.10)):
>
> [17.4] How should I handle resources if my constructors may throw
> exceptions?
> ------------------------------------------------------------------------------
>
>
> Every data member inside your object sho... |
1,674,980 | I really can't believe I couldn't find a clear answer to this...
How do you free the memory allocated after a C++ class constructor throws an exception, in the case where it's initialised using the `new` operator. E.g.:
```
class Blah
{
public:
Blah()
{
throw "oops";
}
};
void main()
{
Blah* b = NULL;
... | 2009/11/04 | [
"https://Stackoverflow.com/questions/1674980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/31760/"
] | You should refer to the similar questions [here](https://stackoverflow.com/questions/1230423/c-handle-resources-if-constructors-may-throw-exceptions-reference-to-faq-17) and [here](https://stackoverflow.com/questions/1197566/is-it-ever-not-safe-to-throw-an-exception-in-a-constructor).
Basically if the constructor throw... | From the C++ 2003 Standard 5.3.4/17 - New:
>
> If any part of the object initialization described above terminates by throwing an exception and a suitable deallocation function can be found, the deallocation function is called to free the memory in which the object was being constructed, after which the exception con... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.