qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
84,894 | What is the best method for importing video from my JVC Everio HDD video camera into Ubuntu 11.10? | 2011/12/03 | [
"https://askubuntu.com/questions/84894",
"https://askubuntu.com",
"https://askubuntu.com/users/36481/"
] | Here is my solution:
1. Install `compizconfig-settings-manager` and open it (type `ccsm` in terminal).
2. Go to Desktop > Ubuntu Unity Plugin.
3. Open Switcher tab and make `key to start the switcher` and `key to start the switcher in reverse` disabled.
4. Go back to CompizConfig Settings Manager.
5. Go to Window Mana... | I tried this and as soon as I launched ccsm:
* my desktop was gone. No start menu, taskbar, launcher.. Just the wallpaper.
* `Alt+Tab` doesn't work at all.
I was able to launch a Terminal using right click on desktop. Many people faced this under different situations. Solution always said reset `compiz` config, delet... |
84,894 | What is the best method for importing video from my JVC Everio HDD video camera into Ubuntu 11.10? | 2011/12/03 | [
"https://askubuntu.com/questions/84894",
"https://askubuntu.com",
"https://askubuntu.com/users/36481/"
] | Before installing anything, try these key combinations:
* `alt` + `|` (the key above `Tab`, may be ```, `º`, `|`...) to switch between instances of the current application
* `alt` + `ESC` to direct switch to the next window
* `alt` + `Tab`, of course, to switch between different applications
You can see the three key... | I'm running Ubuntu 18.04 running the Gnome shell. I installed Gnome Tweaks via
```
sudo apt install gnome-tweak-tool
```
and went to
>
> Extensions -> AlternateTab
>
>
>
and switched the toggle to "On".
This changed the window-switcher to not group by application. |
84,894 | What is the best method for importing video from my JVC Everio HDD video camera into Ubuntu 11.10? | 2011/12/03 | [
"https://askubuntu.com/questions/84894",
"https://askubuntu.com",
"https://askubuntu.com/users/36481/"
] | The other option -which I'm testing out this week- is to have the ALT+TAB switch between apps, and ALT+| switch between windows of the same app. It sounds complicated but it works surprisingly well.
Use case A: You're on Firefox and want to switch to Thunderbird: ALT+TAB.
Use case B: You're on a Calc window and want... | In Ubuntu 19 just install
```
sudo apt install compizconfig-settings-manager compiz-plugins
```
and then open compizconfig settings manager
```
ccsm
```
Go to windows management on left sidebar > then select Application Switcher
then just enable Application Switcher from left sidebar.
And that it, when you use ... |
84,894 | What is the best method for importing video from my JVC Everio HDD video camera into Ubuntu 11.10? | 2011/12/03 | [
"https://askubuntu.com/questions/84894",
"https://askubuntu.com",
"https://askubuntu.com/users/36481/"
] | Before installing anything, try these key combinations:
* `alt` + `|` (the key above `Tab`, may be ```, `º`, `|`...) to switch between instances of the current application
* `alt` + `ESC` to direct switch to the next window
* `alt` + `Tab`, of course, to switch between different applications
You can see the three key... | In Ubuntu 19 just install
```
sudo apt install compizconfig-settings-manager compiz-plugins
```
and then open compizconfig settings manager
```
ccsm
```
Go to windows management on left sidebar > then select Application Switcher
then just enable Application Switcher from left sidebar.
And that it, when you use ... |
84,894 | What is the best method for importing video from my JVC Everio HDD video camera into Ubuntu 11.10? | 2011/12/03 | [
"https://askubuntu.com/questions/84894",
"https://askubuntu.com",
"https://askubuntu.com/users/36481/"
] | The other option -which I'm testing out this week- is to have the ALT+TAB switch between apps, and ALT+| switch between windows of the same app. It sounds complicated but it works surprisingly well.
Use case A: You're on Firefox and want to switch to Thunderbird: ALT+TAB.
Use case B: You're on a Calc window and want... | I tried this and as soon as I launched ccsm:
* my desktop was gone. No start menu, taskbar, launcher.. Just the wallpaper.
* `Alt+Tab` doesn't work at all.
I was able to launch a Terminal using right click on desktop. Many people faced this under different situations. Solution always said reset `compiz` config, delet... |
84,894 | What is the best method for importing video from my JVC Everio HDD video camera into Ubuntu 11.10? | 2011/12/03 | [
"https://askubuntu.com/questions/84894",
"https://askubuntu.com",
"https://askubuntu.com/users/36481/"
] | Here is my solution:
1. Install `compizconfig-settings-manager` and open it (type `ccsm` in terminal).
2. Go to Desktop > Ubuntu Unity Plugin.
3. Open Switcher tab and make `key to start the switcher` and `key to start the switcher in reverse` disabled.
4. Go back to CompizConfig Settings Manager.
5. Go to Window Mana... | Just thought I would share this since I tried to follow the accepted answer but couldn't find the Ubuntu Unity switcher. I'm running 18.04 and I was able to change the alt-tab behavior by:
1. going to settings->devices->keyboard
2. scroll down to the shortcut for "Switch Windows" (under the "Navigation" section)
3. ch... |
84,894 | What is the best method for importing video from my JVC Everio HDD video camera into Ubuntu 11.10? | 2011/12/03 | [
"https://askubuntu.com/questions/84894",
"https://askubuntu.com",
"https://askubuntu.com/users/36481/"
] | Otuzbesli's answer works but for Ubunut 14.04 you need to install compiz-plugins in addition to compizconfig-settings-manager
```
sudo apt-get install compizconfig-settings-manager compiz-plugins
``` | In Ubuntu 19 just install
```
sudo apt install compizconfig-settings-manager compiz-plugins
```
and then open compizconfig settings manager
```
ccsm
```
Go to windows management on left sidebar > then select Application Switcher
then just enable Application Switcher from left sidebar.
And that it, when you use ... |
84,894 | What is the best method for importing video from my JVC Everio HDD video camera into Ubuntu 11.10? | 2011/12/03 | [
"https://askubuntu.com/questions/84894",
"https://askubuntu.com",
"https://askubuntu.com/users/36481/"
] | Otuzbesli's answer works but for Ubunut 14.04 you need to install compiz-plugins in addition to compizconfig-settings-manager
```
sudo apt-get install compizconfig-settings-manager compiz-plugins
``` | I tried this and as soon as I launched ccsm:
* my desktop was gone. No start menu, taskbar, launcher.. Just the wallpaper.
* `Alt+Tab` doesn't work at all.
I was able to launch a Terminal using right click on desktop. Many people faced this under different situations. Solution always said reset `compiz` config, delet... |
84,894 | What is the best method for importing video from my JVC Everio HDD video camera into Ubuntu 11.10? | 2011/12/03 | [
"https://askubuntu.com/questions/84894",
"https://askubuntu.com",
"https://askubuntu.com/users/36481/"
] | I'm running Ubuntu 18.04 running the Gnome shell. I installed Gnome Tweaks via
```
sudo apt install gnome-tweak-tool
```
and went to
>
> Extensions -> AlternateTab
>
>
>
and switched the toggle to "On".
This changed the window-switcher to not group by application. | I tried this and as soon as I launched ccsm:
* my desktop was gone. No start menu, taskbar, launcher.. Just the wallpaper.
* `Alt+Tab` doesn't work at all.
I was able to launch a Terminal using right click on desktop. Many people faced this under different situations. Solution always said reset `compiz` config, delet... |
54,809,150 | Is it possible in SQL to generate random alphanumeric character string?
current strings are ‘Mxxxx’ and ‘Pxxxx’ where the xxxx is just a sequential number.
i need a format with alphanumeric character in position 1, 2 & 4, special characters in position 3 & 5. All will be random and unique.
The alphanumeric character... | 2019/02/21 | [
"https://Stackoverflow.com/questions/54809150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3605493/"
] | You can use something like on the below lines.
```
DECLARE @AlLChars varchar(100) = 'ABCDEFGHIJKL'
DECLARE @Numerics varchar(100) = '12345678910'
DECLARE @SpecialChars varchar(10) = '*+=#/%&!?'
DECLARE @I INT = 1
WHILE @I <= 400
BEGIN
INSERT INTO tblStrings
SELECT
RIGHT( LEFT(@AlLChars,ABS(BINARY_CHECKSUM(NEWID())%... | You can do something like this:
```
;WITH ALPHA AS (
SELECT DISTINCT CHAR(object_id) AS C FROM sys.columns SC
WHERE
object_id BETWEEN ASCII('A') AND ASCII('Z')
OR object_id BETWEEN ASCII('0') AND ASCII('9')
), SPC AS(
SELECT DISTINCT CHAR(object_id) AS S FROM sys.columns SC
WHERE
object_... |
54,809,150 | Is it possible in SQL to generate random alphanumeric character string?
current strings are ‘Mxxxx’ and ‘Pxxxx’ where the xxxx is just a sequential number.
i need a format with alphanumeric character in position 1, 2 & 4, special characters in position 3 & 5. All will be random and unique.
The alphanumeric character... | 2019/02/21 | [
"https://Stackoverflow.com/questions/54809150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3605493/"
] | Have a look at my blog post about methods to generate random strings using the pure TSQL:
"[SQL: generate random character string](https://www.arbinada.com/en/node/1631)". The second method doesn't have any string length limitations. | You can do something like this:
```
;WITH ALPHA AS (
SELECT DISTINCT CHAR(object_id) AS C FROM sys.columns SC
WHERE
object_id BETWEEN ASCII('A') AND ASCII('Z')
OR object_id BETWEEN ASCII('0') AND ASCII('9')
), SPC AS(
SELECT DISTINCT CHAR(object_id) AS S FROM sys.columns SC
WHERE
object_... |
6,401,039 | I have a project in which I have to achieve fast search, insert and delete operations on data ranging from megabytes to terabytes. I had been studying data structures of late and analyzing them. Being specific, I want to introduce 3 cases and ask questions on that:
1. The data is much more than what the memory can han... | 2011/06/19 | [
"https://Stackoverflow.com/questions/6401039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/805122/"
] | A red/black tree is more or less equivalent to a 2-3-4 tree, which is just a type of B-tree. The worst-case performance is identical, provided you do a binary search of the B-tree node values.
The obvious disadvantage of a B-tree is wasted space, but depending on the language/memory allocator used, you may find that a... | Robert Sedgewick's experimental data(freely available online) shows that the red capacity is constantly moving up the black tree,and swapped out to the black tree top, the quadratic cost of which is identical to other tree algorithms.
The red black tree algorithm suffers from global red waterfall(red fountain).
B-tre... |
71,061,787 | I am new to block chain and I am using Alchemy and my NFTs and NFT Meta Data is on "Pinata". When I fetch my minted NFTs from Alchemy API, in response I get list of "contract addresses" and "Token Ids". Is there any way to get list of meaningful names of my minted NFTs instead of ids (without using loops). OR is there ... | 2022/02/10 | [
"https://Stackoverflow.com/questions/71061787",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10619278/"
] | >
> Is there any way to get list of meaningful names of my minted NFTs instead of ids (without using loops).
>
>
>
Yes! As of July 12th, 2022 (current time) -- the `getNFTs` endpoint includes a `withMetadata` query param option that defaults to true ([see docs](https://docs.alchemy.com/alchemy/enhanced-apis/nft-ap... | Use the [getNFTMetadata](https://docs.alchemy.com/alchemy/enhanced-apis/nft-api/getnftmetadata) method to get information on each NFT. |
39,046,552 | I am in the process of adding members to the dictionary for the same key dynamic which will be processed to create json objects.
For example sample code
```
data_Dict = dict()
data_Dict['1'] = {'Key': '1111',}
data_Dict.setdefault('1', []).append({ 'Val':'Name'})
```
I am getting error
AttributeError: 'dict' obje... | 2016/08/19 | [
"https://Stackoverflow.com/questions/39046552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6372996/"
] | You could simply do something like:
```
data_Dict = dict()
data_Dict['1'] = {'Key': '1111'}
data_Dict['1']['Val'] = 'Name'
```
This will give you something like:
```
>>> print data_Dict
{'1': {'Val': 'Name', 'Key': '1111'}}
``` | I think `.update` will do what you're looking for
```python
data_Dict = dict()
data_Dict['1'] = {'Key': '1111'}
data_Dict['1'].update({'Val':'Name'})
print(data_Dict)
# {'1': {'Val': 'Name', 'Key': '1111'}}
``` |
39,046,552 | I am in the process of adding members to the dictionary for the same key dynamic which will be processed to create json objects.
For example sample code
```
data_Dict = dict()
data_Dict['1'] = {'Key': '1111',}
data_Dict.setdefault('1', []).append({ 'Val':'Name'})
```
I am getting error
AttributeError: 'dict' obje... | 2016/08/19 | [
"https://Stackoverflow.com/questions/39046552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6372996/"
] | I think `.update` will do what you're looking for
```python
data_Dict = dict()
data_Dict['1'] = {'Key': '1111'}
data_Dict['1'].update({'Val':'Name'})
print(data_Dict)
# {'1': {'Val': 'Name', 'Key': '1111'}}
``` | What I don't understand is where dict.setdefault comes in to this... the solution is very simple.
When you call `data_Dict['1']` you get the element assigned to `'1'` in the dictionary. This is the dictionary you want to add `'Val': 'Name'` to. Logically, you should be able to assign `'Val': 'Name'` to it by typing it... |
39,046,552 | I am in the process of adding members to the dictionary for the same key dynamic which will be processed to create json objects.
For example sample code
```
data_Dict = dict()
data_Dict['1'] = {'Key': '1111',}
data_Dict.setdefault('1', []).append({ 'Val':'Name'})
```
I am getting error
AttributeError: 'dict' obje... | 2016/08/19 | [
"https://Stackoverflow.com/questions/39046552",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6372996/"
] | You could simply do something like:
```
data_Dict = dict()
data_Dict['1'] = {'Key': '1111'}
data_Dict['1']['Val'] = 'Name'
```
This will give you something like:
```
>>> print data_Dict
{'1': {'Val': 'Name', 'Key': '1111'}}
``` | What I don't understand is where dict.setdefault comes in to this... the solution is very simple.
When you call `data_Dict['1']` you get the element assigned to `'1'` in the dictionary. This is the dictionary you want to add `'Val': 'Name'` to. Logically, you should be able to assign `'Val': 'Name'` to it by typing it... |
8,413,640 | >
> **Possible Duplicate:**
>
> [QR code reader for iPhone](https://stackoverflow.com/questions/5902705/qr-code-reader-for-iphone)
>
> [QR Code library for iphone](https://stackoverflow.com/questions/6120071/qr-code-library-for-iphone)
>
>
>
I want to develop an application for QR code reader.So i need to k... | 2011/12/07 | [
"https://Stackoverflow.com/questions/8413640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993322/"
] | I had some success integrating zbar into an OS X app.
<http://zbar.sourceforge.net/index.html>
It also has support for iOS and a sample app you can use it with. | This is the only open-source project I know of that has anything to do with QR codes on iOS, but it looks like it should work for you: Zebra Crossing ( <http://code.google.com/p/zxing/> ). |
8,413,640 | >
> **Possible Duplicate:**
>
> [QR code reader for iPhone](https://stackoverflow.com/questions/5902705/qr-code-reader-for-iphone)
>
> [QR Code library for iphone](https://stackoverflow.com/questions/6120071/qr-code-library-for-iphone)
>
>
>
I want to develop an application for QR code reader.So i need to k... | 2011/12/07 | [
"https://Stackoverflow.com/questions/8413640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/993322/"
] | I had some success integrating zbar into an OS X app.
<http://zbar.sourceforge.net/index.html>
It also has support for iOS and a sample app you can use it with. | You can find a similar question here :
<https://stackoverflow.com/questions/6120071/qr-code-library-for-iphone>
than i suggest this: <http://redlaser.com/> |
20,705,377 | I try to access a rest endpoint by using springs RestTemplate.getForObject() but my uri variables are not expanded, and attached as parameters to the url. This is what I got so far:
```
Map<String, String> uriParams = new HashMap<String, String>();
uriParams.put("method", "login");
uriParams.put("input_type", DATA_TYP... | 2013/12/20 | [
"https://Stackoverflow.com/questions/20705377",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1145874/"
] | There is no append some query string logic in [`RestTemplate`](http://docs.spring.io/spring/docs/3.0.x/api/org/springframework/web/client/RestTemplate.html) it basically replace variable like `{foo}` by their value:
```
http://www.sample.com?foo={foo}
```
becomes:
```
http://www.sample.com?foo=2
```
if `foo` is 2... | The currently-marked answer from `user180100` is technically correct but not very explicit. Here is a more explicit answer, to help those coming along behind me, because the answer didn't quite make sense to me at first.
```
String url = "http://www.sample.com?foo={fooValue}";
Map<String, String> uriVariables = new H... |
7,667,004 | So I want to restrict access to a url. Now if they are coming from a given IP address then they shouldn't be prompted for a password. If they are not coming from a givin IP address then they should be prompted for a password.
so a either or of:
```
AuthUserFile /some/path/.htpasswd
AuthName "Please Log In"
AuthType B... | 2011/10/05 | [
"https://Stackoverflow.com/questions/7667004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231018/"
] | You can use the Apache ["Satisfy"](http://httpd.apache.org/docs/2.2/mod/core.html#satisfy) directive.
Here is an example of using it :
```
AuthType Basic
AuthName "Please Log In"
AuthUserFile /some/path/.htpasswd
Require valid-user
Order deny,allow
Deny from all
Allow from 127.0.0.1
Satisfy any
```
Access without ... | With Apache 2.4 [`Satisfy`](https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#satisfy) is still available, but [deprecated](https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html)
>
> **Note**
>
>
> The directives provided by mod\_access\_compat have been deprecated by mod\_authz\_host. *Mixing old... |
7,667,004 | So I want to restrict access to a url. Now if they are coming from a given IP address then they shouldn't be prompted for a password. If they are not coming from a givin IP address then they should be prompted for a password.
so a either or of:
```
AuthUserFile /some/path/.htpasswd
AuthName "Please Log In"
AuthType B... | 2011/10/05 | [
"https://Stackoverflow.com/questions/7667004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231018/"
] | You can use the Apache ["Satisfy"](http://httpd.apache.org/docs/2.2/mod/core.html#satisfy) directive.
Here is an example of using it :
```
AuthType Basic
AuthName "Please Log In"
AuthUserFile /some/path/.htpasswd
Require valid-user
Order deny,allow
Deny from all
Allow from 127.0.0.1
Satisfy any
```
Access without ... | This workes perfect for me:
```
AuthType Basic
AuthName "myserver publicname"
AuthUserFile "/myserverpath/.htpasswds/public/passwd"
require ip 100.12.255.233
require valid-user
```
Note:
Just placed 'require ip' with 'my example ip' before 'require valid-user' and it does the trick. I can log in from my ip without p... |
7,667,004 | So I want to restrict access to a url. Now if they are coming from a given IP address then they shouldn't be prompted for a password. If they are not coming from a givin IP address then they should be prompted for a password.
so a either or of:
```
AuthUserFile /some/path/.htpasswd
AuthName "Please Log In"
AuthType B... | 2011/10/05 | [
"https://Stackoverflow.com/questions/7667004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/231018/"
] | With Apache 2.4 [`Satisfy`](https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html#satisfy) is still available, but [deprecated](https://httpd.apache.org/docs/2.4/mod/mod_access_compat.html)
>
> **Note**
>
>
> The directives provided by mod\_access\_compat have been deprecated by mod\_authz\_host. *Mixing old... | This workes perfect for me:
```
AuthType Basic
AuthName "myserver publicname"
AuthUserFile "/myserverpath/.htpasswds/public/passwd"
require ip 100.12.255.233
require valid-user
```
Note:
Just placed 'require ip' with 'my example ip' before 'require valid-user' and it does the trick. I can log in from my ip without p... |
51,710,721 | <http://jsfiddle.net/mnkfdcLz/4/>
```css
.child1{
padding: 10px; flex: 1;
}
.parent {
font-size: 20px;
height: 50px;
border: 1px solid rgba(0, 0, 0, 0.125);
display: flex;
}
.child2 {
flex: 0;
}
```
```html
<div class="parent">
<div class="child1">
{SUBJEC... | 2018/08/06 | [
"https://Stackoverflow.com/questions/51710721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9046260/"
] | If you set an element to `display:flex`, it automatically assigns `align-self:stretch` to the children.
```css
.parent {
font-size: 20px;
height: 50px;
border: 1px solid rgba(0, 0, 0, 0.125);
display: flex;
}
.child1 {
padding: 10px;
flex: 1;
}
.child2 {
flex: 0;
display: flex; /* NEW */
... | Set `.child2` to `display:flex`
```css
.child1 {
padding: 10px;
flex: 1;
}
.parent {
font-size: 20px;
height: 50px;
border: 1px solid rgba(0, 0, 0, 0.125);
display: flex;
}
.child2 {
flex: 0;
display: flex;
}
```
```html
<div class="parent">
<div class="child1">
{SUBJECT}
</d... |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | when iterating over a list, python keeps an integer index of the array element that it's pointing to. however, when you *remove* the current element, then all of the later elements shift to a lower index. Then the position index gets incremented before you get to "see" the element that shifted to take the place of the ... | instead of trying to remove the item from the list, have it do nothing and create another list with what you want.
```
array = []
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
pass
else:
array.append(line)
```
now array will be the ar... |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | I think you might be invalidating your iterators; in other words, you shouldn't try to remove an item on a list that you're looping through.
You might want to make a new list, that only contains items you care about.
For example:
```
newdifflist = []
for line in difflist:
if not ((line.startswith('<'))or (line.s... | instead of trying to remove the item from the list, have it do nothing and create another list with what you want.
```
array = []
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
pass
else:
array.append(line)
```
now array will be the ar... |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | I think you might be invalidating your iterators; in other words, you shouldn't try to remove an item on a list that you're looping through.
You might want to make a new list, that only contains items you care about.
For example:
```
newdifflist = []
for line in difflist:
if not ((line.startswith('<'))or (line.s... | There's nothing "abnormal" about what's going on. In fact it's quite normal. Here's what's happening:
1. The loop is looking at item *i*.
2. Item *i* meets your test, so you delete it. What was item *i+1* is now item *i*.
3. Your loop begins again and the iterator advances to point to item *i+1*, but the *new* item *i... |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | ```
result = []
for line in difflist:
if not line.startswith(('<', '>', '---')):
result += [line]
```
Or using list comprehensions:
```
[line for line in difflist if not line.startswith(('<', '>', '---'))]
``` | There's nothing "abnormal" about what's going on. In fact it's quite normal. Here's what's happening:
1. The loop is looking at item *i*.
2. Item *i* meets your test, so you delete it. What was item *i+1* is now item *i*.
3. Your loop begins again and the iterator advances to point to item *i+1*, but the *new* item *i... |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | I think you might be invalidating your iterators; in other words, you shouldn't try to remove an item on a list that you're looping through.
You might want to make a new list, that only contains items you care about.
For example:
```
newdifflist = []
for line in difflist:
if not ((line.startswith('<'))or (line.s... | Do this instead:
```
>>> difflist = [i for i in difflist if not i.startswith(('<','>','---'))]
>>> difflist
['1a2', '3c4,5', '5c7', '']
```
Doing `.remove()` changes the order and thus (kinda) messes up the for-loop. Check out mgilson's answer for more info |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | I think you might be invalidating your iterators; in other words, you shouldn't try to remove an item on a list that you're looping through.
You might want to make a new list, that only contains items you care about.
For example:
```
newdifflist = []
for line in difflist:
if not ((line.startswith('<'))or (line.s... | ```
result = []
for line in difflist:
if not line.startswith(('<', '>', '---')):
result += [line]
```
Or using list comprehensions:
```
[line for line in difflist if not line.startswith(('<', '>', '---'))]
``` |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | when iterating over a list, python keeps an integer index of the array element that it's pointing to. however, when you *remove* the current element, then all of the later elements shift to a lower index. Then the position index gets incremented before you get to "see" the element that shifted to take the place of the ... | ```
result = []
for line in difflist:
if not line.startswith(('<', '>', '---')):
result += [line]
```
Or using list comprehensions:
```
[line for line in difflist if not line.startswith(('<', '>', '---'))]
``` |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | ```
result = []
for line in difflist:
if not line.startswith(('<', '>', '---')):
result += [line]
```
Or using list comprehensions:
```
[line for line in difflist if not line.startswith(('<', '>', '---'))]
``` | instead of trying to remove the item from the list, have it do nothing and create another list with what you want.
```
array = []
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
pass
else:
array.append(line)
```
now array will be the ar... |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | when iterating over a list, python keeps an integer index of the array element that it's pointing to. however, when you *remove* the current element, then all of the later elements shift to a lower index. Then the position index gets incremented before you get to "see" the element that shifted to take the place of the ... | There's nothing "abnormal" about what's going on. In fact it's quite normal. Here's what's happening:
1. The loop is looking at item *i*.
2. Item *i* meets your test, so you delete it. What was item *i+1* is now item *i*.
3. Your loop begins again and the iterator advances to point to item *i+1*, but the *new* item *i... |
16,071,899 | ```
print difflist
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
difflist.remove(line)
print difflist
```
Here, initially,
```
difflist = ['1a2', '> ', '3c4,5', '< staring', '---', '> starring', '> ', '5c7', '< at ', '---', '>... | 2013/04/17 | [
"https://Stackoverflow.com/questions/16071899",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2086905/"
] | Do this instead:
```
>>> difflist = [i for i in difflist if not i.startswith(('<','>','---'))]
>>> difflist
['1a2', '3c4,5', '5c7', '']
```
Doing `.remove()` changes the order and thus (kinda) messes up the for-loop. Check out mgilson's answer for more info | instead of trying to remove the item from the list, have it do nothing and create another list with what you want.
```
array = []
for line in difflist:
if ((line.startswith('<'))or (line.startswith('>')) or (line.startswith('---'))):
pass
else:
array.append(line)
```
now array will be the ar... |
42,340,244 | I have to get the background color of the selected row in my listview programmatically.
I wrote this for coloring the row:
```
View v;
v.setBackgroundColor(context.getResources().getColor(R.color.childArticle));
```
But I can't figure out how to get the color of the row because I have to do something like this:... | 2017/02/20 | [
"https://Stackoverflow.com/questions/42340244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4894901/"
] | You can set background color id within Tag like below and also get Id of Color that is mentioned in color.xml
first set color code id into tag .
```
view.setTag(R.color.childArticle);
```
Then when you want to get background color get tag from view and parse its value and get color code from color.xml file.
```
in... | This code will output the colour string ouf the clicked row or nothing if there is no colour background set. But you didn't specify how exactly you set the background colour.
```
ListView listView = (ListView) findViewById(R.id.listView);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.s... |
42,340,244 | I have to get the background color of the selected row in my listview programmatically.
I wrote this for coloring the row:
```
View v;
v.setBackgroundColor(context.getResources().getColor(R.color.childArticle));
```
But I can't figure out how to get the color of the row because I have to do something like this:... | 2017/02/20 | [
"https://Stackoverflow.com/questions/42340244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4894901/"
] | You can set background color id within Tag like below and also get Id of Color that is mentioned in color.xml
first set color code id into tag .
```
view.setTag(R.color.childArticle);
```
Then when you want to get background color get tag from view and parse its value and get color code from color.xml file.
```
in... | ```
final int MY_COLOR = R.color.childArticle;
View v;
v.setBackgroundColor(context.getResources()
.getColor(R.color.childArticle));
view.setTag(R.color.childArticle);
Integer colorOfSelectedRow = (Integer) v.getTag();
if(colorOfSelectedRow == MY_COLOR) {
// Do something
}
```
Use this.. |
12,201 | I'm using Sitecore 8.0 update 6 and following Sitecore security hardening [documentation](https://doc.sitecore.net/sitecore_experience_platform/80/setting_up_and_maintaining/security_hardening/configuring/deny_anonymous_users_access_to_a_folder).
I'd like to redirect user when the request is made to <https://www.foo.c... | 2018/06/07 | [
"https://sitecore.stackexchange.com/questions/12201",
"https://sitecore.stackexchange.com",
"https://sitecore.stackexchange.com/users/526/"
] | To update the workflow for the current item’s descendants, you can use the below script
```
$contentsToUpdate = Get-Item master: -Query "sitecore/content/ParentItem//*" -Language "en-GB"
foreach($content in $contentsToUpdate) {
$content.Editing.BeginEdit()
$content.Fields["__Default workflow"].Value ... | Following blog post contains script
<https://mtgeekblog.wordpress.com/2016/11/30/first-blog-post/>
```
function SetWorkflow($item)
{
## Update only items assigned __Default workflow
if ($item.”__Default workflow” -eq “{A5BC37E7-ED96-4C1E-8590-A26E64DB55EA}”) {
$item.__Workflow = “{A5BC37E7-ED96-4C1E-8590-A26... |
12,201 | I'm using Sitecore 8.0 update 6 and following Sitecore security hardening [documentation](https://doc.sitecore.net/sitecore_experience_platform/80/setting_up_and_maintaining/security_hardening/configuring/deny_anonymous_users_access_to_a_folder).
I'd like to redirect user when the request is made to <https://www.foo.c... | 2018/06/07 | [
"https://sitecore.stackexchange.com/questions/12201",
"https://sitecore.stackexchange.com",
"https://sitecore.stackexchange.com/users/526/"
] | Following blog post contains script
<https://mtgeekblog.wordpress.com/2016/11/30/first-blog-post/>
```
function SetWorkflow($item)
{
## Update only items assigned __Default workflow
if ($item.”__Default workflow” -eq “{A5BC37E7-ED96-4C1E-8590-A26E64DB55EA}”) {
$item.__Workflow = “{A5BC37E7-ED96-4C1E-8590-A26... | Do reset for existing items
```
Set-Location -Path "master:/sitecore/content/ParentItem"
function Reset-Workflows {
foreach ($item in Get-ChildItem . -Recurse)
{
foreach ($versionItem in $item.Versions.GetVersions($true))
{
Write-Host "trying update an item " $versionItem.ID
... |
12,201 | I'm using Sitecore 8.0 update 6 and following Sitecore security hardening [documentation](https://doc.sitecore.net/sitecore_experience_platform/80/setting_up_and_maintaining/security_hardening/configuring/deny_anonymous_users_access_to_a_folder).
I'd like to redirect user when the request is made to <https://www.foo.c... | 2018/06/07 | [
"https://sitecore.stackexchange.com/questions/12201",
"https://sitecore.stackexchange.com",
"https://sitecore.stackexchange.com/users/526/"
] | To update the workflow for the current item’s descendants, you can use the below script
```
$contentsToUpdate = Get-Item master: -Query "sitecore/content/ParentItem//*" -Language "en-GB"
foreach($content in $contentsToUpdate) {
$content.Editing.BeginEdit()
$content.Fields["__Default workflow"].Value ... | Do reset for existing items
```
Set-Location -Path "master:/sitecore/content/ParentItem"
function Reset-Workflows {
foreach ($item in Get-ChildItem . -Recurse)
{
foreach ($versionItem in $item.Versions.GetVersions($true))
{
Write-Host "trying update an item " $versionItem.ID
... |
2,796,134 | I need something like this:
```
class Node (left : Node*, right : Node*)
```
I understand the ambiguity of this signature.
Is there a way around it better than the following?
```
class Node (left : Array[Node, right : Array[Node])
val n = new Node (Array(n1, n2), Array(n3))
```
Maybe some kind of separator like ... | 2010/05/09 | [
"https://Stackoverflow.com/questions/2796134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/61342/"
] | This works:
```
class Node (left : Node*) (right : Node*)
```
Scala is great! | I dont beleive you can have multiple varargs. You maybe could do something like
```
class Node(left: Node*) {
def apply(right: Node*) = ...
```
and then you can create `new Node(n1,n2)(n3)` |
2,796,134 | I need something like this:
```
class Node (left : Node*, right : Node*)
```
I understand the ambiguity of this signature.
Is there a way around it better than the following?
```
class Node (left : Array[Node, right : Array[Node])
val n = new Node (Array(n1, n2), Array(n3))
```
Maybe some kind of separator like ... | 2010/05/09 | [
"https://Stackoverflow.com/questions/2796134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/61342/"
] | You can have multiple argument lists, each of which may have (or just be) one repeated-args parameter:
```
scala> def m1(ints: Int*)(strs: String*): Int = ints.length + strs.length
dm1: (ints: Int*)(strs: String*)Int
scala> m1(1, 2, 3)("one", "two", "three")
res0: Int = 6
```
I ran this in the Scala 2.8 REPL. I don... | I dont beleive you can have multiple varargs. You maybe could do something like
```
class Node(left: Node*) {
def apply(right: Node*) = ...
```
and then you can create `new Node(n1,n2)(n3)` |
2,796,134 | I need something like this:
```
class Node (left : Node*, right : Node*)
```
I understand the ambiguity of this signature.
Is there a way around it better than the following?
```
class Node (left : Array[Node, right : Array[Node])
val n = new Node (Array(n1, n2), Array(n3))
```
Maybe some kind of separator like ... | 2010/05/09 | [
"https://Stackoverflow.com/questions/2796134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/61342/"
] | You can have multiple argument lists, each of which may have (or just be) one repeated-args parameter:
```
scala> def m1(ints: Int*)(strs: String*): Int = ints.length + strs.length
dm1: (ints: Int*)(strs: String*)Int
scala> m1(1, 2, 3)("one", "two", "three")
res0: Int = 6
```
I ran this in the Scala 2.8 REPL. I don... | This works:
```
class Node (left : Node*) (right : Node*)
```
Scala is great! |
57,374,070 | I have been working with newtonsoft api for a while now.
From the terminology point of view, it makes sense when you call out a value of a property you will get a `JValue`. But do I continue processing that value if it is a JObject? The only way that I have come up is to call out: `JObject.Parse(JValue.ToString())`
A ... | 2019/08/06 | [
"https://Stackoverflow.com/questions/57374070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8669730/"
] | 
If you look at the API of JObject
<https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_Linq_JObject.htm>
You can see that when you access a property it returns a JToken, not a JValue.
A JToken is a common ancestor of both JValue and JObjec... | This is probably obvious but was a gotcha for me that might help someone.
If I have a JObject containing another object called "myProperty" and I retrieve it like this:
```
var myResult = jobject["myProperty"] // myResult is a JValue
```
myResult is a JValue.
If I want a JObject I need to:
```
var myJObjectResult... |
109,547 | I know there is k-means clustering algorithm and k-median. One that uses the mean as the center of the cluster and the other uses the median. My question is: when/where to use which? | 2014/07/27 | [
"https://stats.stackexchange.com/questions/109547",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/27779/"
] | k-means minimizes within-cluster variance, which equals squared Euclidean distances.
In general, the **arithmetic mean** does this. It does *not* optimize distances, but squared deviations from the mean.
k-medians minimizes absolute deviations, which equals Manhattan distance.
In general, the **per-axis median** sho... | If you want to make an analysis not regarding of the possible effect of extreme values use k means but if you want to be more accurate use k median |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | In my case, this error was due to the Network connection error that i was noticed in log. | In my case, the error was valid and it was due to using try with resource
```
try (ConfigurableApplicationContext cxt = new ClassPathXmlApplicationContext(
"classpath:application-main-config.xml")) {..
}
```
It auto closes the stream which should not happen if I want to reuse this context in oth... |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | In my case, the error "BeanFactory not initialized or already closed - call 'refresh' before" was a consequence of a previous error that I didn't noticed in the server startup.
I think that it is not always the real cause of the problem. | please mention "applicationContext.xml" in bean factory / ClassPathXmlApplicationContext.
Resource r = new ClassPathResource("applicationContext.xml");
BeanFactory factory = new XmlBeanFactory(r);
```
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
``` |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | please mention "applicationContext.xml" in bean factory / ClassPathXmlApplicationContext.
Resource r = new ClassPathResource("applicationContext.xml");
BeanFactory factory = new XmlBeanFactory(r);
```
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
``` | I had the same error and I had not made any changes to the application config or the web.xml. Multiple tries to revert back some minor changes to code was not clearing the exceptions.
Finally it worked after restarting STS. |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | In the spring framework inside the springframework initialization Repository or controller annotation, the same class name can only exist a default instance, you can set the value name | I had the same error and I had not made any changes to the application config or the web.xml. Multiple tries to revert back some minor changes to code was not clearing the exceptions.
Finally it worked after restarting STS. |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | I had this issue until I removed the project in question from the server's deployments (in JBoss Dev Studio, right-click the server and "Remove" the project in the Servers view), then did the following:
1. Restarted the JBoss EAP 6.1 server without any projects deployed.
2. Once the server had started, I then added t... | I had the same error and I had not made any changes to the application config or the web.xml. Multiple tries to revert back some minor changes to code was not clearing the exceptions.
Finally it worked after restarting STS. |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | This exception come due to you are providing listener `ContextLoaderListener`
```
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
```
but you are not providing **`context-param`**
for your spring configuration file. like ***`applicationContext.xml`***
You... | In my case, the error "BeanFactory not initialized or already closed - call 'refresh' before" was a consequence of a previous error that I didn't noticed in the server startup.
I think that it is not always the real cause of the problem. |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | In my case, the error "BeanFactory not initialized or already closed - call 'refresh' before" was a consequence of a previous error that I didn't noticed in the server startup.
I think that it is not always the real cause of the problem. | I had the same error and I had not made any changes to the application config or the web.xml. Multiple tries to revert back some minor changes to code was not clearing the exceptions.
Finally it worked after restarting STS. |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | The issue here is that the version of `spring-web` that you're using (3.1.1-RELEASE) is not compatible with the version of `spring-beans` that you're using (3.0.2-RELEASE). At the top of the stack you can see the `NoSuchMethodError` which in turn triggers the `BeanFactory not initialized...` exception.
The `NoSuchMeth... | I came across this issue twice once in upgrading to 3.2.18 from 3.2.1 and 4.3.5 from 3.2.8. In both cases, this error is because of different version of spring modules |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | This exception come due to you are providing listener `ContextLoaderListener`
```
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
```
but you are not providing **`context-param`**
for your spring configuration file. like ***`applicationContext.xml`***
You... | please mention "applicationContext.xml" in bean factory / ClassPathXmlApplicationContext.
Resource r = new ClassPathResource("applicationContext.xml");
BeanFactory factory = new XmlBeanFactory(r);
```
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
``` |
20,114,955 | here is my error:
I am getting this error , can any one help me on this.
```
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> java.lang.NoSuchMethodError:
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.set... | 2013/11/21 | [
"https://Stackoverflow.com/questions/20114955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2814677/"
] | This exception come due to you are providing listener `ContextLoaderListener`
```
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
```
but you are not providing **`context-param`**
for your spring configuration file. like ***`applicationContext.xml`***
You... | The issue here is that the version of `spring-web` that you're using (3.1.1-RELEASE) is not compatible with the version of `spring-beans` that you're using (3.0.2-RELEASE). At the top of the stack you can see the `NoSuchMethodError` which in turn triggers the `BeanFactory not initialized...` exception.
The `NoSuchMeth... |
26,134,706 | Is it possible to pair two date pickers but still allow selection of the same day.
```
$('#depart, #departc, #depart_modify').Zebra_DatePicker({
format: 'd/m/Y',
selectWeek: true,
inline: true,
pair: $('#return, #returnc'),
firstDay: 1
});
$('#return, #returnc, #de... | 2014/10/01 | [
"https://Stackoverflow.com/questions/26134706",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2750320/"
] | Try this
```
$('#depart, #departc, #depart_modify').Zebra_DatePicker({
format: 'd/m/Y',
selectWeek: true,
inline: true,
pair: $('#return, #returnc'),
firstDay: 1,
direction: true // add this line
});
$('#return, #returnc, #depart_review').Zebra_DatePicker({
format: 'd/m/Y',
selectWeek:... | If you are php you can call the current date function like this
```html
$('#to').Zebra_DatePicker({
direction: [true,'<?php echo date("Y-m-d")?>'],
```
It works just fine on my project. |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | A somewhat trivial set of examples: $|G|$ divides $|G|$, so take any group which is *not* cyclic and it'll have no element of order $|G|$.
For a less trivial example, look at $G = \mathbb{Z}\_2 \times \mathbb{Z}\_2 \times \mathbb{Z}\_2$. Every non-identity element has order $2$, but $|G| = 8$. | Maybe needless to say: if $G$ is a finite group then the following are equivalent.
(a) For all $d \mid |G|$ there is a $g \in G$ with $ord(g)=d$.
(b) $G$ is cyclic.
The proof is almost trivial. Hence, any finite non-cyclic group provides an example to the question. |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Perhaps the following is worth mentioning. If $n$ is prime, then [Cauchy's theorem](https://en.wikipedia.org/wiki/Cauchy%27s_theorem_(group_theory)) tells you that a finite group of order divisible by $n$ has an element of order $n$.
We will show
>
> Suppose $n$ is not prime. Then there is a group $G$ of order divis... | $S\_4$ has order $24$ but no elements of order $6, 8, 12, 24$. |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | A somewhat trivial set of examples: $|G|$ divides $|G|$, so take any group which is *not* cyclic and it'll have no element of order $|G|$.
For a less trivial example, look at $G = \mathbb{Z}\_2 \times \mathbb{Z}\_2 \times \mathbb{Z}\_2$. Every non-identity element has order $2$, but $|G| = 8$. | Take $\mathbb{Z}\_2\times\mathbb{Z}\_2$. It has no element of order $4$. |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | A somewhat trivial set of examples: $|G|$ divides $|G|$, so take any group which is *not* cyclic and it'll have no element of order $|G|$.
For a less trivial example, look at $G = \mathbb{Z}\_2 \times \mathbb{Z}\_2 \times \mathbb{Z}\_2$. Every non-identity element has order $2$, but $|G| = 8$. | Try $S\_{3}$ with $n=6$, where $S\_{3}$ denotes the [symmetric group](https://en.wikipedia.org/wiki/Symmetric_group) on $3$ symbols |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | $S\_4$ has order $24$ but no elements of order $6, 8, 12, 24$. | Maybe needless to say: if $G$ is a finite group then the following are equivalent.
(a) For all $d \mid |G|$ there is a $g \in G$ with $ord(g)=d$.
(b) $G$ is cyclic.
The proof is almost trivial. Hence, any finite non-cyclic group provides an example to the question. |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Try $S\_{3}$ with $n=6$, where $S\_{3}$ denotes the [symmetric group](https://en.wikipedia.org/wiki/Symmetric_group) on $3$ symbols | Maybe needless to say: if $G$ is a finite group then the following are equivalent.
(a) For all $d \mid |G|$ there is a $g \in G$ with $ord(g)=d$.
(b) $G$ is cyclic.
The proof is almost trivial. Hence, any finite non-cyclic group provides an example to the question. |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | A somewhat trivial set of examples: $|G|$ divides $|G|$, so take any group which is *not* cyclic and it'll have no element of order $|G|$.
For a less trivial example, look at $G = \mathbb{Z}\_2 \times \mathbb{Z}\_2 \times \mathbb{Z}\_2$. Every non-identity element has order $2$, but $|G| = 8$. | Perhaps the following is worth mentioning. If $n$ is prime, then [Cauchy's theorem](https://en.wikipedia.org/wiki/Cauchy%27s_theorem_(group_theory)) tells you that a finite group of order divisible by $n$ has an element of order $n$.
We will show
>
> Suppose $n$ is not prime. Then there is a group $G$ of order divis... |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Take $\mathbb{Z}\_2\times\mathbb{Z}\_2$. It has no element of order $4$. | Maybe needless to say: if $G$ is a finite group then the following are equivalent.
(a) For all $d \mid |G|$ there is a $g \in G$ with $ord(g)=d$.
(b) $G$ is cyclic.
The proof is almost trivial. Hence, any finite non-cyclic group provides an example to the question. |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Try $S\_{3}$ with $n=6$, where $S\_{3}$ denotes the [symmetric group](https://en.wikipedia.org/wiki/Symmetric_group) on $3$ symbols | $S\_4$ has order $24$ but no elements of order $6, 8, 12, 24$. |
2,838,293 | >
> A random variable $X$ has log-normal distribution if $Y=ln(X)$ has a normal distribution with density function
> $$f\_Y(y)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(y=\mu)^2}{2\sigma^2}} \ \ \ \ y\in(-\infty,\infty)$$
>
>
>
I have calculated that the density function of $X$ is
$$f\_X(x)=\frac{1}{x\sqrt{2\pi\si... | 2018/07/02 | [
"https://math.stackexchange.com/questions/2838293",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | A somewhat trivial set of examples: $|G|$ divides $|G|$, so take any group which is *not* cyclic and it'll have no element of order $|G|$.
For a less trivial example, look at $G = \mathbb{Z}\_2 \times \mathbb{Z}\_2 \times \mathbb{Z}\_2$. Every non-identity element has order $2$, but $|G| = 8$. | $S\_4$ has order $24$ but no elements of order $6, 8, 12, 24$. |
1,752,783 | (if V is a vectorfield describing the velocity of a fluid or body, and $x\in R^3$)
I agree that it should be when you look at the calculation, but intuitively speeking... If $\nabla \times V(x)= curl(V(x))$, couldn't one interpret the curl to be the change of velocity orthogonally to the flow line at the given point, ... | 2016/04/21 | [
"https://math.stackexchange.com/questions/1752783",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/333483/"
] | Denote by ${\bf v}$ the velocity field of a planar fluid rotating with angular velocity $\omega$ around the origin ${\bf 0}$ of the ${\bf z}$-plane. At distance $r$ from ${\bf 0}$ we then have $|{\bf v}|=r\omega$. Two rays from ${\bf 0}$ at arguments $\phi$ and $\phi+d\phi$, together with two concentric circles of radi... | Hello I would say for a problem with the radius of a circle denoted by $\mathbf{r}$, the tangential velocity $\mathbf{v}$ and the angular velocity $\boldsymbol{\omega}$ we have
\begin{equation}
\nabla \times \mathbf{v} = \nabla \times (\boldsymbol{\omega} \times \mathbf{r})
\end{equation}
Using the Graßmann identity
\b... |
36,870 | I am amending my yard with plants attractive for birds, and I noticed Prunus padus as one of such plants. However, on multiple sites I found info that it is poisonous for humans if the fruit is consumed and have sour taste, to such extent that it can cause death.
On the other hand, it is said that birds love its fruit... | 2018/01/17 | [
"https://gardening.stackexchange.com/questions/36870",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/19946/"
] | Since you're concerned about the potential toxicity of the [prunus padus](http://www.luontoportti.com/suomi/en/puut/bird-cherry) to birds, I'll address that.
The fruit from the tree is not only safe for birds, but is actually a healthy part of their diet. It supplies them with needed vitamins and nutrients. Sources g... | This plant (Prunus padus) is definitely toxic to humans, well, the leaves and berries, because they contain hydrogen cyanide, a substance which is toxic to us; birds, however, are unaffected by the toxin simply because their physiology is different. In order for a substance to be toxic to a particular creature, it has ... |
36,870 | I am amending my yard with plants attractive for birds, and I noticed Prunus padus as one of such plants. However, on multiple sites I found info that it is poisonous for humans if the fruit is consumed and have sour taste, to such extent that it can cause death.
On the other hand, it is said that birds love its fruit... | 2018/01/17 | [
"https://gardening.stackexchange.com/questions/36870",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/19946/"
] | Since you're concerned about the potential toxicity of the [prunus padus](http://www.luontoportti.com/suomi/en/puut/bird-cherry) to birds, I'll address that.
The fruit from the tree is not only safe for birds, but is actually a healthy part of their diet. It supplies them with needed vitamins and nutrients. Sources g... | An interesting question which is perhaps better on biology.se than here.
But here's my guess. Prunus padus has actually been used in herbal medicine for centuries, and although it does contain cyanide, it is in quite small amounts. The more cyanide it contains the fruit becomes more bitter making it unpalatable.
>
>... |
29,483,229 | I have a history table with the following values
```
CREATE TABLE History (SnapShotDate DATETIME, UID VARCHAR(10), DUEDATE DATETIME)
INSERT INTO History VALUES ('03-23-2015','PT-01','2015-04-22')
INSERT INTO History VALUES ('03-30-2015','PT-01','2015-04-20')
INSERT INTO History VALUES ('04-06-2015','PT-01','2015-06... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29483229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4756980/"
] | This works and is tested:
```
error_reporting(-1);
ini_set('display_errors', 'On');
if($pbtype == 'pwall' OR $pbtype == 'cl')
{
$file = 'pwallpb.php';
$pbac = md5($affn).'.php';
}
else
{
$file = 'postback.php';
$pbac = md5($affn).'.php';
}
$myfile =... | You are using ".=" instead of "=". ".=" appends your results to the file. Your code might look better like this:
```
if($pbtype == 'pwall' OR $pbtype == 'cl')
{
$file = '../postback/pwallpb.php';
}
else
{
$file = '../postback/postback.php';
}
$pbac = '../postback/'.md5($affn).'.php';
copy($file, $pbac);
... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | >
> How do I go about telling my mom, that I appreciate all she is doing for me during my visits, but that she needn't cause herself too much work and stress?
>
>
>
You've already tried talking to her about this, and she brushes it aside. She doesn't want *you* to stress over what *she* does. But both of you are l... | >
> I see all the effort you put when I come visit. It's really kind of you to take care of me so well every time. I love these visits. Everything you do and prepare is really great.
>
>
> The best part about being with you is actually being with you. If you are stressed about all the things you have to do, you are ... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | So 2 suggestions that work well for me when I'm visiting family.
1) If you can afford it, you can reduce the stress around meals by offering to take everyone to a local restaurant for at least one key meal during your stay.
This has the advantage that it
* Directly saves your Mum work and stress as she has one less... | >
> I see all the effort you put when I come visit. It's really kind of you to take care of me so well every time. I love these visits. Everything you do and prepare is really great.
>
>
> The best part about being with you is actually being with you. If you are stressed about all the things you have to do, you are ... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | So 2 suggestions that work well for me when I'm visiting family.
1) If you can afford it, you can reduce the stress around meals by offering to take everyone to a local restaurant for at least one key meal during your stay.
This has the advantage that it
* Directly saves your Mum work and stress as she has one less... | It is time to start building a new relationship with your parents.
Let's imagine you're angry at your mom for making you feel like a guest in "your own home". This is reasonable; why would she want you to be a guest? If you were angry, perhaps you'd say something like:
>
> Why is it every time I'm here, you spend th... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | This thing with mothers is completely normal. Especially when you are first out of the house & the empty nest syndrome is alive.
I find understanding the cause is helpful to me & how I communicate with my parents.
The anxiety is real, they worry that if you don't enjoy the visit, you won't come to visit as much. Als... | It is time to start building a new relationship with your parents.
Let's imagine you're angry at your mom for making you feel like a guest in "your own home". This is reasonable; why would she want you to be a guest? If you were angry, perhaps you'd say something like:
>
> Why is it every time I'm here, you spend th... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | >
> How do I go about telling my mom, that I appreciate all she is doing for me during my visits, but that she needn't cause herself too much work and stress?
>
>
>
You've already tried talking to her about this, and she brushes it aside. She doesn't want *you* to stress over what *she* does. But both of you are l... | Empty nester here. In the long run, things change but Time only flows one way. And please don't underestimate the pain of children leaving home. It really is like grieving for many parents. So redirect the affection into spending *time* together. This could be
>
> Hey Mom, let's make that cake together on Sunday.
>
... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | I wonder if you and I have the same mother and are sister/brother, but never mind... :)
For decades, my Mom has been exactly the same. Same words, same ideas, same problems, same questions, as the ones you just mentioned to us. And I've tried, just like you. Almost everything, until I reached the point of "**nothing e... | So 2 suggestions that work well for me when I'm visiting family.
1) If you can afford it, you can reduce the stress around meals by offering to take everyone to a local restaurant for at least one key meal during your stay.
This has the advantage that it
* Directly saves your Mum work and stress as she has one less... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | Empty nester here. In the long run, things change but Time only flows one way. And please don't underestimate the pain of children leaving home. It really is like grieving for many parents. So redirect the affection into spending *time* together. This could be
>
> Hey Mom, let's make that cake together on Sunday.
>
... | It is time to start building a new relationship with your parents.
Let's imagine you're angry at your mom for making you feel like a guest in "your own home". This is reasonable; why would she want you to be a guest? If you were angry, perhaps you'd say something like:
>
> Why is it every time I'm here, you spend th... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | I wonder if you and I have the same mother and are sister/brother, but never mind... :)
For decades, my Mom has been exactly the same. Same words, same ideas, same problems, same questions, as the ones you just mentioned to us. And I've tried, just like you. Almost everything, until I reached the point of "**nothing e... | Empty nester here. In the long run, things change but Time only flows one way. And please don't underestimate the pain of children leaving home. It really is like grieving for many parents. So redirect the affection into spending *time* together. This could be
>
> Hey Mom, let's make that cake together on Sunday.
>
... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | This thing with mothers is completely normal. Especially when you are first out of the house & the empty nest syndrome is alive.
I find understanding the cause is helpful to me & how I communicate with my parents.
The anxiety is real, they worry that if you don't enjoy the visit, you won't come to visit as much. Als... | >
> I see all the effort you put when I come visit. It's really kind of you to take care of me so well every time. I love these visits. Everything you do and prepare is really great.
>
>
> The best part about being with you is actually being with you. If you are stressed about all the things you have to do, you are ... |
7,052 | Situation
---------
I visit my parents about one time per month, for one to two days. Sometimes I manage to visit them twice, in rare cases I have to skip a month. So we see each other in person regularly (and, for sure, during some holidays, but this is about the shorter visits.). They know that I can't visit them mo... | 2017/11/21 | [
"https://interpersonal.stackexchange.com/questions/7052",
"https://interpersonal.stackexchange.com",
"https://interpersonal.stackexchange.com/users/2625/"
] | My grandma used to be just like this.
I found that telling her not to worry makes things significantly worse.
In that vein, I would suggest that you don't explicitly talk to her about stopping to obsess over you. It is likely not going to reduce her stress and anxiety around your visits, but increase it.
I also foun... | >
> How do I go about telling my mom, that I appreciate all she is doing for me during my visits, but that she needn't cause herself too much work and stress?
>
>
>
You've already tried talking to her about this, and she brushes it aside. She doesn't want *you* to stress over what *she* does. But both of you are l... |
52,177,159 | There are two lists. Users are listed in the first list. And the second list shows the types of events. The filter should work like this:
User selected the user from the first list and selected the type of the event from the second list. Then a table with the names of the events appears. And based on the selected user ... | 2018/09/05 | [
"https://Stackoverflow.com/questions/52177159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10309896/"
] | You could use [`itemTemplate`](http://js-grid.com/docs/) to get the required result.
* **itemTemplate** is a function to create cell content. It should return markup as string, DomNode or jQueryElement. The function signature is `function(value, item)`, where value is a `value` of column property of data item, and ite... | You are not using the documented way. You should use `editTemplate`.
A simple working example is:
```js
$(document).ready(function() {
$("#grid").jsGrid({
width: "100%",
editing: true,
autoload: true,
data: [ { id:1, name:"Tom"}, {id:2, name:"Dick"}],
fields: [
{ name: "id", ... |
2,278,111 | Someone entered a ton of numeric data into a table with the sign backwards.
Is there a clean way to flip the sign in the numeric column with a SQL statement? | 2010/02/17 | [
"https://Stackoverflow.com/questions/2278111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/141172/"
] | ```
update my_table
set amount = -amount
where <whatever>
``` | It should be straightforward.
```
update table set column = -column;
``` |
2,278,111 | Someone entered a ton of numeric data into a table with the sign backwards.
Is there a clean way to flip the sign in the numeric column with a SQL statement? | 2010/02/17 | [
"https://Stackoverflow.com/questions/2278111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/141172/"
] | ```
update my_table
set amount = -amount
where <whatever>
``` | `UPDATE [table] SET [column]=([column]*(-1))`
You can add a `WHERE` clause as needed to limit which rows you are flipping signs on. |
2,278,111 | Someone entered a ton of numeric data into a table with the sign backwards.
Is there a clean way to flip the sign in the numeric column with a SQL statement? | 2010/02/17 | [
"https://Stackoverflow.com/questions/2278111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/141172/"
] | ```
update my_table
set amount = -amount
where <whatever>
``` | ```
UPDATE MyTable
SET amount = -amount
WHERE amount = ABS(amount)
```
By including the amount = ABS(amount) clause you prevent unnecessary log activity and index maintenance. It's always a good idea to only update the rows that actually need it. |
2,278,111 | Someone entered a ton of numeric data into a table with the sign backwards.
Is there a clean way to flip the sign in the numeric column with a SQL statement? | 2010/02/17 | [
"https://Stackoverflow.com/questions/2278111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/141172/"
] | It should be straightforward.
```
update table set column = -column;
``` | ```
UPDATE MyTable
SET amount = -amount
WHERE amount = ABS(amount)
```
By including the amount = ABS(amount) clause you prevent unnecessary log activity and index maintenance. It's always a good idea to only update the rows that actually need it. |
2,278,111 | Someone entered a ton of numeric data into a table with the sign backwards.
Is there a clean way to flip the sign in the numeric column with a SQL statement? | 2010/02/17 | [
"https://Stackoverflow.com/questions/2278111",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/141172/"
] | `UPDATE [table] SET [column]=([column]*(-1))`
You can add a `WHERE` clause as needed to limit which rows you are flipping signs on. | ```
UPDATE MyTable
SET amount = -amount
WHERE amount = ABS(amount)
```
By including the amount = ABS(amount) clause you prevent unnecessary log activity and index maintenance. It's always a good idea to only update the rows that actually need it. |
12,449,655 | I want to pass the "passedThisValue" to my "start\_battle" function and use the "start\_battle" function in my "Rematch". But the modal just hangs why is this happening? what could be wrong? Please help! :) Thank you.
CODE:
```
function start_battle(){
$.ajax({
data: {
receivePassedValue: pass... | 2012/09/16 | [
"https://Stackoverflow.com/questions/12449655",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1633318/"
] | When you call a function, you don't use `function start_battle();`, you just use `start_battle();`.
When you pass a value to a function, you need to use this syntax: `start_battle(param1, param2);`.
When you want to get a value from a function, you need to return it in the function, like so:
```
function start_batt... | Your function declaration seems a little off. I think you should leave off the `$` from `function`. Just do this
```
function start_battle() {
```
Also, when you're calling a function, you don't say `function` before it. And if you want to pass a value to the function, you have to put it inside the parenthesis, both... |
43,917,865 | With WIX Tools v3.10 I used to add a variable `AddLocal` to the bundle which I passed to the `MsiProperty` with the `Name="ADDLOCAL"` as described [by BryanJ in "Pass parameters from bootstrapper to msi bundle package"](https://stackoverflow.com/a/10504382/6240645).
```
<Bundle>
...
<Variable Name="InstallLevel" Typ... | 2017/05/11 | [
"https://Stackoverflow.com/questions/43917865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6240645/"
] | I ran into the same issue and ended up using a transform with only the ADDLOCAL property set. | you can influence on ADDLOCAL parameter in your custom bootstrapper project something like that:
```
_bootstrapper.PlanMsiFeature += (_, ea) =>
{
ea.State = (needToInstall) ? FeatureState.Local : FeatureState.Absent;
};
``` |
43,917,865 | With WIX Tools v3.10 I used to add a variable `AddLocal` to the bundle which I passed to the `MsiProperty` with the `Name="ADDLOCAL"` as described [by BryanJ in "Pass parameters from bootstrapper to msi bundle package"](https://stackoverflow.com/a/10504382/6240645).
```
<Bundle>
...
<Variable Name="InstallLevel" Typ... | 2017/05/11 | [
"https://Stackoverflow.com/questions/43917865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6240645/"
] | Rather than using AddLocal, I found adding code like:
```
<Feature Id="FeatureB" Level="0">
<Condition Level="1">INSTALL_FEATUREB="1" OR FEATUREB_INSTALLED="1"
</Condition>
</Feature>
```
to my msi file behaved in a reasonable manner, allowing me to add/remove a feature.
Modified from:
using <https://support.fi... | you can influence on ADDLOCAL parameter in your custom bootstrapper project something like that:
```
_bootstrapper.PlanMsiFeature += (_, ea) =>
{
ea.State = (needToInstall) ? FeatureState.Local : FeatureState.Absent;
};
``` |
43,917,865 | With WIX Tools v3.10 I used to add a variable `AddLocal` to the bundle which I passed to the `MsiProperty` with the `Name="ADDLOCAL"` as described [by BryanJ in "Pass parameters from bootstrapper to msi bundle package"](https://stackoverflow.com/a/10504382/6240645).
```
<Bundle>
...
<Variable Name="InstallLevel" Typ... | 2017/05/11 | [
"https://Stackoverflow.com/questions/43917865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6240645/"
] | I ran into the same issue and ended up using a transform with only the ADDLOCAL property set. | Well, you can always pass a value to a Variable from the Code behind like this.
```
Bootstrapper.Engine.StringVariables["AddLocal"] = "your value";
``` |
43,917,865 | With WIX Tools v3.10 I used to add a variable `AddLocal` to the bundle which I passed to the `MsiProperty` with the `Name="ADDLOCAL"` as described [by BryanJ in "Pass parameters from bootstrapper to msi bundle package"](https://stackoverflow.com/a/10504382/6240645).
```
<Bundle>
...
<Variable Name="InstallLevel" Typ... | 2017/05/11 | [
"https://Stackoverflow.com/questions/43917865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6240645/"
] | Rather than using AddLocal, I found adding code like:
```
<Feature Id="FeatureB" Level="0">
<Condition Level="1">INSTALL_FEATUREB="1" OR FEATUREB_INSTALLED="1"
</Condition>
</Feature>
```
to my msi file behaved in a reasonable manner, allowing me to add/remove a feature.
Modified from:
using <https://support.fi... | Well, you can always pass a value to a Variable from the Code behind like this.
```
Bootstrapper.Engine.StringVariables["AddLocal"] = "your value";
``` |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | Use the following guard clause at the top of your method:
```
if (!preg_match("/^[a-z]$/", $param)) {
// throw an Exception...
}
```
If you want to allow upper case letters too, change the regular expression accordingly:
```
if (!preg_match("/^[a-zA-Z]$/", $param)) {
// throw an Exception...
}
```
Another... | ```
preg_match('/^[a-zA-Z]$/', $var_vhar);
```
Method will return int value: for no match returns 0 and for matches returns 1. |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | ```
preg_match('/^[a-zA-Z]$/', $var_vhar);
```
Method will return int value: for no match returns 0 and for matches returns 1. | You can't use [a-zA-Z] for Unicode.
here are the example working with Unicode,
```
if ( preg_match('/^\p{L}+$/u', 'my text') ) {
echo 'match';
} else {
echo 'not match';
}
``` |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | Use the following guard clause at the top of your method:
```
if (!preg_match("/^[a-z]$/", $param)) {
// throw an Exception...
}
```
If you want to allow upper case letters too, change the regular expression accordingly:
```
if (!preg_match("/^[a-zA-Z]$/", $param)) {
// throw an Exception...
}
```
Another... | I'd use ctype, as Nick suggested,since it is not only faster than regex, it is even faster than most of the string functions built into PHP. But you also need to make sure it is a single character:
```
if (ctype_alpha($ch) && strlen($ch) == 1) {
// Accept
} else {
// Reject
}
``` |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | ```
preg_match('/^[a-zA-Z]$/', $var_vhar);
```
Method will return int value: for no match returns 0 and for matches returns 1. | This will help hopefully.This a simple function in php called [ctype\_alpha](http://php.net/manual/en/function.ctype-alpha.php "ctype_alpha")
```
$mystring = 'a'
if (ctype_alpha($mystring))
{
//Then do the code here.
}
``` |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | Use the following guard clause at the top of your method:
```
if (!preg_match("/^[a-z]$/", $param)) {
// throw an Exception...
}
```
If you want to allow upper case letters too, change the regular expression accordingly:
```
if (!preg_match("/^[a-zA-Z]$/", $param)) {
// throw an Exception...
}
```
Another... | You can try:
```
preg_match('/^[a-zA-Z]$/',$input_char);
```
The return value of the above function is true if the $input\_char contains a single alphabet, else it is false. You can suitably make use of return value. |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | <http://php.net/manual/en/function.ctype-alpha.php>
```
<?php
$ch = 'a';
if (ctype_alpha($ch)) {
// Accept
} else {
// Reject
}
```
This also takes locale into account if you set it correctly.
**EDIT:** To be complete, other posters here seem to think that you need to ensure the para... | ```
preg_match('/^[a-zA-Z]$/', $var_vhar);
```
Method will return int value: for no match returns 0 and for matches returns 1. |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | ```
preg_match('/^[a-zA-Z]$/', $var_vhar);
```
Method will return int value: for no match returns 0 and for matches returns 1. | I'd use ctype, as Nick suggested,since it is not only faster than regex, it is even faster than most of the string functions built into PHP. But you also need to make sure it is a single character:
```
if (ctype_alpha($ch) && strlen($ch) == 1) {
// Accept
} else {
// Reject
}
``` |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | Use the following guard clause at the top of your method:
```
if (!preg_match("/^[a-z]$/", $param)) {
// throw an Exception...
}
```
If you want to allow upper case letters too, change the regular expression accordingly:
```
if (!preg_match("/^[a-zA-Z]$/", $param)) {
// throw an Exception...
}
```
Another... | This will help hopefully.This a simple function in php called [ctype\_alpha](http://php.net/manual/en/function.ctype-alpha.php "ctype_alpha")
```
$mystring = 'a'
if (ctype_alpha($mystring))
{
//Then do the code here.
}
``` |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | Use the following guard clause at the top of your method:
```
if (!preg_match("/^[a-z]$/", $param)) {
// throw an Exception...
}
```
If you want to allow upper case letters too, change the regular expression accordingly:
```
if (!preg_match("/^[a-zA-Z]$/", $param)) {
// throw an Exception...
}
```
Another... | You can't use [a-zA-Z] for Unicode.
here are the example working with Unicode,
```
if ( preg_match('/^\p{L}+$/u', 'my text') ) {
echo 'match';
} else {
echo 'not match';
}
``` |
2,227,080 | Having problems with this.
Let's say I have a parameter composed of a single character and I only want to accept alphabetic characters. How will I determine that the parameter passed is a member of the latin alphabet (`a`–`z`)?
By the way Im using PHP Kohana 3.
Thanks. | 2010/02/09 | [
"https://Stackoverflow.com/questions/2227080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/269253/"
] | You can't use [a-zA-Z] for Unicode.
here are the example working with Unicode,
```
if ( preg_match('/^\p{L}+$/u', 'my text') ) {
echo 'match';
} else {
echo 'not match';
}
``` | You can try:
```
preg_match('/^[a-zA-Z]$/',$input_char);
```
The return value of the above function is true if the $input\_char contains a single alphabet, else it is false. You can suitably make use of return value. |
25,777,499 | If I have an existing POJO and want to add some key/value pairs to it, I normally do it like so:
```
var existingObject = {
firstValue: 'hello'
};
/* some time later... */
existingObject.secondValue = 'world';
existingObject.thirdValue = 'new value';
existingObject.fourthValue = 'another value';
existingObject.f... | 2014/09/11 | [
"https://Stackoverflow.com/questions/25777499",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1063035/"
] | With the new ES6 method `Object.assign`, much of the repeated boilerplate can be eliminated. Example:
```
var existingObject = {
firstValue: 'hello'
};
/* some time later... */
Object.assign(existingObject, {
secondValue: 'world',
thirdValue: 'new value',
fourthValue: 'another value',
fifthValue: 'anothe... | Short answer: no.
Alternatively, the best I can suggest, is a function that takes variable arguments, alternating between keys and values. Just make it a bare function, optionally taking an existing object to extend. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.