qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
1,209,941
If $M, N$ are finite dimensional vector spaces with same dimension, then if $M$ is subset of $N$, then $M=N$. I think i need to show that both vector spaces are spanned by the same bases in order to do this or to prove $N$ is subset of $M$? But i am not sure how to do this. Thanks
2015/03/28
[ "https://math.stackexchange.com/questions/1209941", "https://math.stackexchange.com", "https://math.stackexchange.com/users/225132/" ]
Let me reformulate the problem: > > If $M$ is a (finite dimensional) subspace of a finite dimensional vector space $N$ and $\dim M=\dim N$, then $M=N$. > > > The clause that $M$ is finite dimensional is redundant, but it's not important, as you have it in your assignment. Suppose $M\ne N$ and let $v\in N$, $v\no...
I think the notation etc can get over-engineered and technical. Here is an attempt to look at things more straightforwardly. Here are two facts you should know about vector spaces: Every basis of a finite dimensional vector space has the same number of elements. Any linearly independent subset of a vector space can ...
11,252,066
I have variable `WCHAR sDisplayName[1024];` How can I check if `sDisplayName` contains the string "example"?
2012/06/28
[ "https://Stackoverflow.com/questions/11252066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508284/" ]
``` if(wcscmp(sDisplayName, L"example") == 0) ; //then it contains "example" else ; //it does not ``` This does not cover the case where the string in `sDisplayName` starts with "example" or has "example" in the middle. For those cases, you can use `wcsncmp` and `wcsstr`. Also this check is case sensitive. ...
You can use the `wchar_t` [variants of standard C functions](http://msdn.microsoft.com/en-us/library/z9da80kz%28v=vs.80%29.aspx) (i.e., `wcsstr`).
11,252,066
I have variable `WCHAR sDisplayName[1024];` How can I check if `sDisplayName` contains the string "example"?
2012/06/28
[ "https://Stackoverflow.com/questions/11252066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508284/" ]
``` if(wcscmp(sDisplayName, L"example") == 0) ; //then it contains "example" else ; //it does not ``` This does not cover the case where the string in `sDisplayName` starts with "example" or has "example" in the middle. For those cases, you can use `wcsncmp` and `wcsstr`. Also this check is case sensitive. ...
wscstr will find your string anywhere in sDisplayName, wsccmp will see if sDisplayName is exactly your string.
11,252,066
I have variable `WCHAR sDisplayName[1024];` How can I check if `sDisplayName` contains the string "example"?
2012/06/28
[ "https://Stackoverflow.com/questions/11252066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508284/" ]
You can use the `wchar_t` [variants of standard C functions](http://msdn.microsoft.com/en-us/library/z9da80kz%28v=vs.80%29.aspx) (i.e., `wcsstr`).
wscstr will find your string anywhere in sDisplayName, wsccmp will see if sDisplayName is exactly your string.
24,094
At the end of A Most Wanted Man, Gunther > > drives somewhere, gets out of his car, and walks off > > > And then the movie ends. Where did he drive, and what is the significance of that scene?
2014/08/22
[ "https://movies.stackexchange.com/questions/24094", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/13422/" ]
I think it is as simple as this: Gunther was angry that he had been taken advantage of, but there was nothing he could do -- so he left.
It never focuses on the second car up after he parks but it matches color and clothing of the American lady and her car. Also when he gets out of his van to smoke he gives a long stare and a possible signal toward the American agent's vehicle as it drives up. Significance is that he was in on it as well, but it could j...
24,094
At the end of A Most Wanted Man, Gunther > > drives somewhere, gets out of his car, and walks off > > > And then the movie ends. Where did he drive, and what is the significance of that scene?
2014/08/22
[ "https://movies.stackexchange.com/questions/24094", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/13422/" ]
I think it is as simple as this: Gunther was angry that he had been taken advantage of, but there was nothing he could do -- so he left.
To me, the plot of the movie is about different agencies working against each other, if you remember the beginning of the movie a message about how inefficiencies and competing interest in the german intelligence community lead to Muhammad Atta's successful planning of 9/11. To me the movie was about how the intelligen...
24,094
At the end of A Most Wanted Man, Gunther > > drives somewhere, gets out of his car, and walks off > > > And then the movie ends. Where did he drive, and what is the significance of that scene?
2014/08/22
[ "https://movies.stackexchange.com/questions/24094", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/13422/" ]
I think it is as simple as this: Gunther was angry that he had been taken advantage of, but there was nothing he could do -- so he left.
Gunther thought he could trust the American agents, but finally realizes he was set up and betrayed by them. Instead of working together for a positive outcome, the Americans had their own agenda, and never understood his or his country's priorities. This symbolizes something we don't often realize: our image in the wo...
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
You can do something simple instead of insane regex; just pad `+` with white space: ``` String number = "100+500"; number = number.replace("+", " + "); ``` Now you can split it at the white space: ``` String[] split = number.split(" "); ``` Now your indices will be set: ``` split[0] = "100"; split[1] = "+"; spli...
Since +,-,\* basically all mathematically symbols are special characters so you put a "\\" before them inside the split function like this ``` String number = "100+500"; String[] numbers = number.split("\\+"); for (String n:numbers) { System.out.println(n); } ```
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
Off the bat, I don't know any library routine for the split. A custom splitting routine could be like this: ``` /** * Splits the given {@link String} at the operators +, -, * and / * * @param string * the {@link String} to be split. * @throws NullPointerException * when the given {@link S...
You can do something simple instead of insane regex; just pad `+` with white space: ``` String number = "100+500"; number = number.replace("+", " + "); ``` Now you can split it at the white space: ``` String[] split = number.split(" "); ``` Now your indices will be set: ``` split[0] = "100"; split[1] = "+"; spli...
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
You can also use the Pattern/Matcher classes in Java: ``` String expression = "100+34"; Pattern p = Pattern.compile("(\\d+)|(\\+)"); Matcher m = p.matcher(expression); String[] elems = new String[m.groupCount() +1]; int i=0; while(m.find()) { elems[i++] = m.group(); } ```
You can split your expression string, then in result having pure tokens and categorized tokens. The [mXparser](http://mathparser.org/) library supports this as well as the calculation process. Please follow the below example: Your very simple example "100+500": ``` import org.mariuszgromada.math.mxparser.*; ... ... E...
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
Off the bat, I don't know any library routine for the split. A custom splitting routine could be like this: ``` /** * Splits the given {@link String} at the operators +, -, * and / * * @param string * the {@link String} to be split. * @throws NullPointerException * when the given {@link S...
Since +,-,\* basically all mathematically symbols are special characters so you put a "\\" before them inside the split function like this ``` String number = "100+500"; String[] numbers = number.split("\\+"); for (String n:numbers) { System.out.println(n); } ```
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
You can also use the Pattern/Matcher classes in Java: ``` String expression = "100+34"; Pattern p = Pattern.compile("(\\d+)|(\\+)"); Matcher m = p.matcher(expression); String[] elems = new String[m.groupCount() +1]; int i=0; while(m.find()) { elems[i++] = m.group(); } ```
Since +,-,\* basically all mathematically symbols are special characters so you put a "\\" before them inside the split function like this ``` String number = "100+500"; String[] numbers = number.split("\\+"); for (String n:numbers) { System.out.println(n); } ```
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
You want to split between digits and non-digits without consuming any input... you need look arounds: ``` String[] split = number.split("(?<=\\d)(?=\\D)|(?<=\\D)(?=\\d)"); ``` What the heck is that train wreck of a regex? It's expressing the initial sentence of this answer: * `(?<=\d)` means the previous character...
Off the bat, I don't know any library routine for the split. A custom splitting routine could be like this: ``` /** * Splits the given {@link String} at the operators +, -, * and / * * @param string * the {@link String} to be split. * @throws NullPointerException * when the given {@link S...
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
You want to split between digits and non-digits without consuming any input... you need look arounds: ``` String[] split = number.split("(?<=\\d)(?=\\D)|(?<=\\D)(?=\\d)"); ``` What the heck is that train wreck of a regex? It's expressing the initial sentence of this answer: * `(?<=\d)` means the previous character...
You can do something simple instead of insane regex; just pad `+` with white space: ``` String number = "100+500"; number = number.replace("+", " + "); ``` Now you can split it at the white space: ``` String[] split = number.split(" "); ``` Now your indices will be set: ``` split[0] = "100"; split[1] = "+"; spli...
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
You can do something simple instead of insane regex; just pad `+` with white space: ``` String number = "100+500"; number = number.replace("+", " + "); ``` Now you can split it at the white space: ``` String[] split = number.split(" "); ``` Now your indices will be set: ``` split[0] = "100"; split[1] = "+"; spli...
You can split your expression string, then in result having pure tokens and categorized tokens. The [mXparser](http://mathparser.org/) library supports this as well as the calculation process. Please follow the below example: Your very simple example "100+500": ``` import org.mariuszgromada.math.mxparser.*; ... ... E...
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
You want to split between digits and non-digits without consuming any input... you need look arounds: ``` String[] split = number.split("(?<=\\d)(?=\\D)|(?<=\\D)(?=\\d)"); ``` What the heck is that train wreck of a regex? It's expressing the initial sentence of this answer: * `(?<=\d)` means the previous character...
You can split your expression string, then in result having pure tokens and categorized tokens. The [mXparser](http://mathparser.org/) library supports this as well as the calculation process. Please follow the below example: Your very simple example "100+500": ``` import org.mariuszgromada.math.mxparser.*; ... ... E...
27,808,112
I am trying to split a Math Expression. ``` String number = "100+500"; String[] split = new String[3]; ``` I want to make * split[0] = "100" * split[1] = "+" * split[2] = "500" I tried this but I don't know what to write for splitting. ``` split = number.split(????); ```
2015/01/06
[ "https://Stackoverflow.com/questions/27808112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4195580/" ]
You want to split between digits and non-digits without consuming any input... you need look arounds: ``` String[] split = number.split("(?<=\\d)(?=\\D)|(?<=\\D)(?=\\d)"); ``` What the heck is that train wreck of a regex? It's expressing the initial sentence of this answer: * `(?<=\d)` means the previous character...
Since +,-,\* basically all mathematically symbols are special characters so you put a "\\" before them inside the split function like this ``` String number = "100+500"; String[] numbers = number.split("\\+"); for (String n:numbers) { System.out.println(n); } ```
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
Pandas has portions of its code written in C to make it run faster. If you tried to install pandas manually you would need to build it. Try reinstalling it with miniconda package manager here: <http://conda.pydata.org/miniconda.html> and then you can just do ``` conda install pandas ``` There are very simple instr...
I was having this problem with python 2.7.13 here is my solution: 1. install Cython with ``` pip install Cython ``` 2. install g++ and gcc ``` apt-get install gcc, g++ ``` 3. uninstall pandas ``` pip uninstall pandas ``` 4. reinstall pandas ``` pip install pandas ``` then everything will be OK.
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
Actually, none of these answers worked for me in the following environment: ``` docker-compose # multiple containers, the managing one based on debian Python 2.7 Django 1.8.19 numpy==1.11.3 # pinned to version, because of https://github.com/rbgirshick/py-faster-rcnn/issues/481 ... more requirements ``` The followin...
Ok, I tried more than 20 differents way of install/uninstall, it was still not working. (conda and pip, --force --upgrade, ==THEGOODVERSION, etc...). At the end I found that I had the wrong PATH... [![Check this out if your out of options](https://i.stack.imgur.com/O1L1F.jpg)](https://i.stack.imgur.com/O1L1F.jpg)
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
Instead of installing it with conda or pip, try to install it with your package manager: sudo apt-get install python3-pandas
try ``` /miniconda3/bin/conda install python python: 3.6.0-0 --> 3.6.1-2 ``` and ``` /miniconda3/bin/conda install pandas ``` Try the same with your Anaconda version.
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
Actually, none of these answers worked for me in the following environment: ``` docker-compose # multiple containers, the managing one based on debian Python 2.7 Django 1.8.19 numpy==1.11.3 # pinned to version, because of https://github.com/rbgirshick/py-faster-rcnn/issues/481 ... more requirements ``` The followin...
try ``` /miniconda3/bin/conda install python python: 3.6.0-0 --> 3.6.1-2 ``` and ``` /miniconda3/bin/conda install pandas ``` Try the same with your Anaconda version.
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
Pandas has portions of its code written in C to make it run faster. If you tried to install pandas manually you would need to build it. Try reinstalling it with miniconda package manager here: <http://conda.pydata.org/miniconda.html> and then you can just do ``` conda install pandas ``` There are very simple instr...
I had the same problem and the issue came from an encoding problem. My os was previously set up in French and everything was fine. But then when I switched to English I had the error above. You can type ``` locale ``` in the terminal to check the local environment variables. When set up in French, I had this con...
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
Instead of installing it with conda or pip, try to install it with your package manager: sudo apt-get install python3-pandas
Ok, I tried more than 20 differents way of install/uninstall, it was still not working. (conda and pip, --force --upgrade, ==THEGOODVERSION, etc...). At the end I found that I had the wrong PATH... [![Check this out if your out of options](https://i.stack.imgur.com/O1L1F.jpg)](https://i.stack.imgur.com/O1L1F.jpg)
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
Pandas has portions of its code written in C to make it run faster. If you tried to install pandas manually you would need to build it. Try reinstalling it with miniconda package manager here: <http://conda.pydata.org/miniconda.html> and then you can just do ``` conda install pandas ``` There are very simple instr...
I had this issue when I needed up upgrade from Python 32 bit to 64 bit to use tensorflow. Running this command uninstalled pandas 0.21 and reinstalled 0.22 : pip install --upgrade pandas Sorted.
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
I had the same problem and the issue came from an encoding problem. My os was previously set up in French and everything was fine. But then when I switched to English I had the error above. You can type ``` locale ``` in the terminal to check the local environment variables. When set up in French, I had this con...
I was unable to upgrade pandas with regular ``` pip install --upgrade pandas "tensorflow 1.6.0 has requirement numpy>=1.13.3, but you'll have numpy 1.13.1 which is incompatible." ``` However bumping it with: ``` pip install --upgrade pandas --force ``` solved issue completely
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
Instead of installing it with conda or pip, try to install it with your package manager: sudo apt-get install python3-pandas
I had this issue when I needed up upgrade from Python 32 bit to 64 bit to use tensorflow. Running this command uninstalled pandas 0.21 and reinstalled 0.22 : pip install --upgrade pandas Sorted.
30,761,152
I installed Anaconda with python 2.7.7. However, whenever I run "import pandas" I get the error: `"ImportError: C extension: y not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first."` I tried running the sugg...
2015/06/10
[ "https://Stackoverflow.com/questions/30761152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3453901/" ]
I was having this problem with python 2.7.13 here is my solution: 1. install Cython with ``` pip install Cython ``` 2. install g++ and gcc ``` apt-get install gcc, g++ ``` 3. uninstall pandas ``` pip uninstall pandas ``` 4. reinstall pandas ``` pip install pandas ``` then everything will be OK.
I tried all the solutions above, but nothing works out... Error Message ============= I got an error message with `ipython` ``` ImportError: C extension: iNaT not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensi...
68,565,520
I'm very new when it comes to axios and react. My goal is to have half of the array rendered in one column and the other half in the second column. So i can style each of the columns separately. I have an array of JSON objects that I would like to render in to columns like this: OmOss.js -------- ``` const OmOss = ...
2021/07/28
[ "https://Stackoverflow.com/questions/68565520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11637117/" ]
This fixed the problem: (1) Use postgresql instead of sqlite. (2) Switch from SequentialExecutor to LocalExecutor.
Just to add to that - we had other similar reports and we decided to make a very clear warning in such case in the UI (will be released in the next version): <https://github.com/apache/airflow/pull/17133> [![Warning when you use sequential executor](https://i.stack.imgur.com/BEkjY.png)](https://i.stack.imgur.com/BEkj...
17,060,152
Currently I load values like so (using configparser) ``` my_value = config.get("my", "value") ``` But I find myself loading alot of values sometimes as my program grows over time. Is there any "prettier"/better way to load all values in a config file? Was perhaps thinking of json but not really sure? One problem wi...
2013/06/12
[ "https://Stackoverflow.com/questions/17060152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I would suggest to save the configuration as a Python dict in a YAML file. YAML is human-readable and supports comments with a # sign at the beginning of a line. However, it does not support block comments. ``` import yaml conf = {"name":"john", "password":"asdf"} with open("conf.yaml", "w") as f: yaml.dump(conf, ...
In a Java application I developed I had hundreds of parameters in a static class called Resources that I needed to make configurable by the user via a XML file without breaking the existing application. What I did was to use introspection to read the name and type of each property of the Resources class and then searc...
17,060,152
Currently I load values like so (using configparser) ``` my_value = config.get("my", "value") ``` But I find myself loading alot of values sometimes as my program grows over time. Is there any "prettier"/better way to load all values in a config file? Was perhaps thinking of json but not really sure? One problem wi...
2013/06/12
[ "https://Stackoverflow.com/questions/17060152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you want to use ConfigParser, you can store your config values in a dictionary indexed by `[section name][item name]`, and load them without having to explicitly specify each variable name: ``` import ConfigParser from pprint import pprint cfg = ConfigParser.ConfigParser() cfg.read('config.cfg') CONFIG_DATA = {} fo...
In a Java application I developed I had hundreds of parameters in a static class called Resources that I needed to make configurable by the user via a XML file without breaking the existing application. What I did was to use introspection to read the name and type of each property of the Resources class and then searc...
17,060,152
Currently I load values like so (using configparser) ``` my_value = config.get("my", "value") ``` But I find myself loading alot of values sometimes as my program grows over time. Is there any "prettier"/better way to load all values in a config file? Was perhaps thinking of json but not really sure? One problem wi...
2013/06/12
[ "https://Stackoverflow.com/questions/17060152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What about simply using Python modules? You can just have a config.py file including something like the following: ``` # config.py MY = "value" DB = "mysql://..." LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { }, 'handlers': { }, 'loggers': { } } ``` And...
In a Java application I developed I had hundreds of parameters in a static class called Resources that I needed to make configurable by the user via a XML file without breaking the existing application. What I did was to use introspection to read the name and type of each property of the Resources class and then searc...
17,060,152
Currently I load values like so (using configparser) ``` my_value = config.get("my", "value") ``` But I find myself loading alot of values sometimes as my program grows over time. Is there any "prettier"/better way to load all values in a config file? Was perhaps thinking of json but not really sure? One problem wi...
2013/06/12
[ "https://Stackoverflow.com/questions/17060152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you want to use ConfigParser, you can store your config values in a dictionary indexed by `[section name][item name]`, and load them without having to explicitly specify each variable name: ``` import ConfigParser from pprint import pprint cfg = ConfigParser.ConfigParser() cfg.read('config.cfg') CONFIG_DATA = {} fo...
I would suggest to save the configuration as a Python dict in a YAML file. YAML is human-readable and supports comments with a # sign at the beginning of a line. However, it does not support block comments. ``` import yaml conf = {"name":"john", "password":"asdf"} with open("conf.yaml", "w") as f: yaml.dump(conf, ...
17,060,152
Currently I load values like so (using configparser) ``` my_value = config.get("my", "value") ``` But I find myself loading alot of values sometimes as my program grows over time. Is there any "prettier"/better way to load all values in a config file? Was perhaps thinking of json but not really sure? One problem wi...
2013/06/12
[ "https://Stackoverflow.com/questions/17060152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If you want to use ConfigParser, you can store your config values in a dictionary indexed by `[section name][item name]`, and load them without having to explicitly specify each variable name: ``` import ConfigParser from pprint import pprint cfg = ConfigParser.ConfigParser() cfg.read('config.cfg') CONFIG_DATA = {} fo...
What about simply using Python modules? You can just have a config.py file including something like the following: ``` # config.py MY = "value" DB = "mysql://..." LOGGING = { 'version': 1, 'disable_existing_loggers': True, 'formatters': { }, 'handlers': { }, 'loggers': { } } ``` And...
13,334,207
I'm trying to learn how to pause and resume a thread in java. I'm using an `Applet` that `implements Runnable`has 2 buttons "Start" and "Stop". ``` public void init(){ th = new Thread(this); th.start(); btn_increment = new Button("Start"); btn_increment.addActionListener(new ActionListener(){ public void ...
2012/11/11
[ "https://Stackoverflow.com/questions/13334207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/636342/" ]
You can't just call `notify` and `wait`. You have to wait *for something*. And before calling `notify`, you have to make it so that there's nothing to wait for anymore. If your blocks aren't already synchronized, then something is wrong in your design. How can you call `wait` unless you have something to wait for? An...
I think you have to synchronize on the thread in order to call wait and notify. Try to use ``` synchronized (th) { th.notify(); } ``` and the same with `wait()`.
13,334,207
I'm trying to learn how to pause and resume a thread in java. I'm using an `Applet` that `implements Runnable`has 2 buttons "Start" and "Stop". ``` public void init(){ th = new Thread(this); th.start(); btn_increment = new Button("Start"); btn_increment.addActionListener(new ActionListener(){ public void ...
2012/11/11
[ "https://Stackoverflow.com/questions/13334207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/636342/" ]
You have misunderstood how `wait()` works. Calling `wait` on a `Thread` object does not pause that thread; it instead tells the currently running thread to wait for something else to happen. To explain why, I'll need to back up a bit and explain what `synchronized` actually does. When you enter a `synchronized` block ...
I think you have to synchronize on the thread in order to call wait and notify. Try to use ``` synchronized (th) { th.notify(); } ``` and the same with `wait()`.
13,334,207
I'm trying to learn how to pause and resume a thread in java. I'm using an `Applet` that `implements Runnable`has 2 buttons "Start" and "Stop". ``` public void init(){ th = new Thread(this); th.start(); btn_increment = new Button("Start"); btn_increment.addActionListener(new ActionListener(){ public void ...
2012/11/11
[ "https://Stackoverflow.com/questions/13334207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/636342/" ]
You have misunderstood how `wait()` works. Calling `wait` on a `Thread` object does not pause that thread; it instead tells the currently running thread to wait for something else to happen. To explain why, I'll need to back up a bit and explain what `synchronized` actually does. When you enter a `synchronized` block ...
You can't just call `notify` and `wait`. You have to wait *for something*. And before calling `notify`, you have to make it so that there's nothing to wait for anymore. If your blocks aren't already synchronized, then something is wrong in your design. How can you call `wait` unless you have something to wait for? An...
9,754,562
I am trying to use twitter search web service in python. I want to call a web service like: ``` http://search.twitter.com/search.json?q=blue%20angels&rpp=5&include_entities=true&result_type=mixed ``` from my python program. Can anybody tell me 1. how to use xmlhttprequst object in python 2. how to pass parameters...
2012/03/17
[ "https://Stackoverflow.com/questions/9754562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/929701/" ]
You don't need "asynchronous httprequest" to use twitter search api: ``` import json import urllib import urllib2 # make query query = urllib.urlencode(dict(q="blue angel", rpp=5, include_entities=1, result_type="mixed")) # make request resp = urllib2.urlopen("http://search.twitter.com...
I'd recommend checking out [requests](http://docs.python-requests.org/en/latest/) and its [`async` module](http://docs.python-requests.org/en/latest/user/advanced/#asynchronous-requests). Simple request: --------------- ``` import json import requests params = {'rpp': 5, 'include_entities': 1, 'result_type': 'mixed'...
117,429
My current client has several internal products which the IT-department supports. All product owners are non-technical and each application is always developed by one developer (and so is all change requests). The current methodology is a bit like waterfall. All uses cases are defined first by the product owner. Then ...
2011/11/02
[ "https://softwareengineering.stackexchange.com/questions/117429", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/12629/" ]
You don't have to follow full Scrum but you can definitely take advantage of its incremental iterative approach which will replace your waterfall. How will the process change: * POs will not need to define all use cases upfront. * POs will define only use cases they are absolutely sure about at the moment and priori...
In a one developer environment the key things are: ``` Source control Continuous build server Task/bug tracking system Defined sprints Unit tests Code coverage Independent testing in parallel to development ``` Doing this will make you agile enough without meeting the strict definition of one of documented methodolo...
117,429
My current client has several internal products which the IT-department supports. All product owners are non-technical and each application is always developed by one developer (and so is all change requests). The current methodology is a bit like waterfall. All uses cases are defined first by the product owner. Then ...
2011/11/02
[ "https://softwareengineering.stackexchange.com/questions/117429", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/12629/" ]
You don't have to follow full Scrum but you can definitely take advantage of its incremental iterative approach which will replace your waterfall. How will the process change: * POs will not need to define all use cases upfront. * POs will define only use cases they are absolutely sure about at the moment and priori...
Scrum is overkill, but Agile is more natural for small teams, even one person teams. The point of Agile is laying out a backlog of user stories upfront that accurately describe the client's use cases. Before the start of each sprint, priority and LOE (Level of Effort or Points) are determined for user stories, and bas...
30,310,542
I need to **compare hundreds of objects** stored in a unique list to find duplicates: ``` object_list = {Object_01, Object_02, Object_03, Object_04, Object_05, ...} ``` I've written a custom function, which returns `True`, if the objects are equal and `False` if not: ``` object_01.compare(object_02) >>> True ``` ...
2015/05/18
[ "https://Stackoverflow.com/questions/30310542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3091066/" ]
You don't need to calculate all combinations, you just need to check if a given item is a duplicate: ``` for i, a in enumerate(x): if any(a.compare(b) for b in x[:i]): # a is a duplicate of an already seen item, so do something ``` This is still technically O(n^2), but you've cut out at least half the ch...
Group the objects by name if you want to find the dups grouping by attributes ``` class Foo: def __init__(self,i,j): self.i = i self.j = j object_list = {Foo(1,2),Foo(3,4),Foo(1,2),Foo(3,4),Foo(5,6)} from collections import defaultdict d = defaultdict(list) for obj in object_list: d[(obj.i,...
3,268,491
We run an web-app with built-in SSRS reports, which are integrated via an Iframe. A user has set her display percentage to 150% in Windows 7. (Control Panel > Appearance and Personalization > Display). She is displaying the webpage with the report in Firefox and she has to scroll horizontally and vertically within th...
2010/07/16
[ "https://Stackoverflow.com/questions/3268491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/233226/" ]
It looks like `AbstractAutowireCapableBeanFactory` (where most of the work with BeanWrapper is done) is hardcoded to use `BeanWrapperImpl`. No point of extension there. `BeanWrapperImpl` uses `CachedIntrospectionResults` which uses `Introspector` in turn. Looks like there is no way to configure any of these dependencie...
Interesting question, You might find following links useful <http://www.grails.org/Extended+Data+Binding+Plugin#Application-wide> DataBinder and BeanWrapper configuration <http://blog.krecan.net/2008/06/17/spring-field-injection/>
48,763,802
This is my data. ``` Mod <- as.factor(c(rep("GLM",5),rep("MLP",5),rep("RF",5),rep("SVML",5),rep("SVMR",5))) Manifold <- as.factor(rep(c("LLE","Iso","PCA","MDS","kPCA"),5)) ROC <- runif(25,0,1) Sens <- runif(25,0,1) Spec <- runif(25,0,1) df <- data.frame("Mod"= Mod, "Manifold"= Manifold, "ROC" = ROC, "Sens" = sens, "Sp...
2018/02/13
[ "https://Stackoverflow.com/questions/48763802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7222370/" ]
Changing the `geom_point` line, adding a `scale_color_manual` and using the override as seen in @drmariod's answer will result in this plot: ``` ggplot(df, aes(x = Mod, y = ROC, fill= Manifold)) + geom_bar(stat = "identity", position = "dodge", color = "black") + ylab("ROC & Specificity") + xlab("Classifiers") ...
You can overwrite the aesthetics for shape and set it to `NA` like this ``` ggplot(df, aes(x = Mod, y = ROC, fill= Manifold)) + geom_bar(stat = "identity", position = "dodge", color = "black") + ylab("ROC & Specificity") + xlab("Classifiers") + theme_bw() + ggtitle("Classifiers' ROC per Feature Extraction P...
44,764,311
I am writing a python script to find the latest zip files in a given directory. I just finished to write it, but it's taking really long time to give the output on data that are >30 GB. It's taking ~45min to run. Any tips on how I can improve the performance of my script to run faster? I am using python 2.7 on a window...
2017/06/26
[ "https://Stackoverflow.com/questions/44764311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8056376/" ]
The best and simplest idea is to use [PyPy](https://pypy.org/). It is an alternative python interpreter that is very optimized. However, if you use modules written in C that are not from the standard library, you won't be able to use them directly with PyPy.
The compiler used in python isn't the fastet (It isn't as close to the machine code compared too for example C), that's why C, C++, etc is used for programs that require better performance. Unfortunately I don't think you can improve the speed if not betting a faster/better performing computer. Hope this explains it :...
44,764,311
I am writing a python script to find the latest zip files in a given directory. I just finished to write it, but it's taking really long time to give the output on data that are >30 GB. It's taking ~45min to run. Any tips on how I can improve the performance of my script to run faster? I am using python 2.7 on a window...
2017/06/26
[ "https://Stackoverflow.com/questions/44764311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8056376/" ]
Without seeing the code and the data it's working on, I can only guess, but if you only need to find the latest files, the running time should depend on the number of files in the directory, not their size. To get the last time of modification of a file, you can use `os.stat()` for example. EDIT: Ok, now that I see it...
The compiler used in python isn't the fastet (It isn't as close to the machine code compared too for example C), that's why C, C++, etc is used for programs that require better performance. Unfortunately I don't think you can improve the speed if not betting a faster/better performing computer. Hope this explains it :...
421,771
Is there a formal mathematical proof that the solution to the [German Tank Problem](https://en.wikipedia.org/wiki/German_tank_problem) is a function of **only** the parameters *k* (number of observed samples) and *m* (maximum value among observed samples)? In other words, can one prove that the solution is independent ...
2019/08/12
[ "https://stats.stackexchange.com/questions/421771", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/55245/" ]
### Likelihood Common problems in [probability theory](https://en.wikipedia.org/wiki/Probability_theory) refer to the probability of observations $x\_1, x\_2, ... , x\_n$ given a certain model and given the parameters (let's call them $\theta$) involved. For instance the probabilities for specific situations in card g...
You haven't presented a precise formulation of "the problem", so it's not exactly clear what you're asking to be proved. From a Bayesian perspective, the posterior probability does depend on all the data. However, each observation of a particular serial number will support that number the most. That is, given any obser...
17,196,402
To give some background information, I am processing a saved file, and after using a regular expression to split the file into it's component objects, I then need to process the object's data based on which type of object it is. My current thought is to use parallelism to get a little bit of a performance gain as load...
2013/06/19
[ "https://Stackoverflow.com/questions/17196402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/860566/" ]
> > the C++ runtime is supposed to monitor the number of threads created and schedule std::async appropriately > > > No. If the asynchronous tasks are in fact run asynchronously (rather than deferred) then all that's required is that they are run as if on a new thread. It is perfectly valid for a new thread to be ...
Posting to an old thread here but an excellent book is [https://www.amazon.com/C-Concurrency-Action-Practical-Multithreading/dp/1933988770](https://rads.stackoverflow.com/amzn/click/com/1933988770) However, GPU / CPU cooperation and concurrency may be where the bigger performance benefits can be found based on recent ...
41,874
At a job fair I was talking to a recruiting agent and he asked what I am getting my degree in. I said computer science with a specialization in networking and communications. He asked what made me go into that specialization. The reason is I was already in the computer science program and had taken some networking cou...
2015/02/24
[ "https://workplace.stackexchange.com/questions/41874", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/32200/" ]
You said: > > I basically already had taken 90% of the courses required for the specialization so in a sense it happened organically. > > > This is your answer. It's honest, it's admirable, and it's pretty well put apart from the jumbling of the first four words. You say your answer would be "because I enjoy it,...
Actually, "because I enjoy it and am good at it" isn't a bad place to start, but you can build that out more. As you studied this area more you realized that you really enjoyed it and were good at it, which led you to take more courses and ultimately to specialize. That shows that it's an ongoing interest, while "becau...
53,138,975
I am sorry if this has already been covered before. I know how to do this is C and Java but not C++. Without using a pre-existing class which includes the use of Vector, how would you increase the size of an array given the code below? The array expansion and assignment to the array takes place in push() noted with th...
2018/11/04
[ "https://Stackoverflow.com/questions/53138975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397145/" ]
The simple answer is you should always use std::vector in this case. However it might be useful to explain just why that is. So lets consider how you would implement this without std::vector so you might see just why you would want to use std::vector: ``` // Naive approach Line::push(const Point& p) { Point* new_p...
You basically have no way but to allocate a new array, copy existing values inside and `delete []` the old one. That's why vector is doing the reallocation by a multiplicative factor (say each reallocation doubles the size). This is one of the reasons you want to use the standard library structures instead of reimpleme...
53,138,975
I am sorry if this has already been covered before. I know how to do this is C and Java but not C++. Without using a pre-existing class which includes the use of Vector, how would you increase the size of an array given the code below? The array expansion and assignment to the array takes place in push() noted with th...
2018/11/04
[ "https://Stackoverflow.com/questions/53138975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397145/" ]
You basically have no way but to allocate a new array, copy existing values inside and `delete []` the old one. That's why vector is doing the reallocation by a multiplicative factor (say each reallocation doubles the size). This is one of the reasons you want to use the standard library structures instead of reimpleme...
**Keep It Simple** In my opinion, in this case, it's better to use a Linked-List of `CPoint` in `CLine`: ``` struct CPoint { int x = 0, y = 0; CPoint * m_next = nullptr; }; class CLine { public: CLine() {}; virtual ~CLine() { // Free Linked-List: while (m_points != nullptr) { ...
53,138,975
I am sorry if this has already been covered before. I know how to do this is C and Java but not C++. Without using a pre-existing class which includes the use of Vector, how would you increase the size of an array given the code below? The array expansion and assignment to the array takes place in push() noted with th...
2018/11/04
[ "https://Stackoverflow.com/questions/53138975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397145/" ]
The simple answer is you should always use std::vector in this case. However it might be useful to explain just why that is. So lets consider how you would implement this without std::vector so you might see just why you would want to use std::vector: ``` // Naive approach Line::push(const Point& p) { Point* new_p...
Essentially the only way is to use a *dynamic array* (one created using `new[]`) and to create an entirely new *dynamic array* and copy (or move) the objects from the old *array* to the new one. Something like this: ``` class Line { public: Line(): index(0), points(nullptr) {} // initialize virtual ~Line() {...
53,138,975
I am sorry if this has already been covered before. I know how to do this is C and Java but not C++. Without using a pre-existing class which includes the use of Vector, how would you increase the size of an array given the code below? The array expansion and assignment to the array takes place in push() noted with th...
2018/11/04
[ "https://Stackoverflow.com/questions/53138975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397145/" ]
The simple answer is you should always use std::vector in this case. However it might be useful to explain just why that is. So lets consider how you would implement this without std::vector so you might see just why you would want to use std::vector: ``` // Naive approach Line::push(const Point& p) { Point* new_p...
**Keep It Simple** In my opinion, in this case, it's better to use a Linked-List of `CPoint` in `CLine`: ``` struct CPoint { int x = 0, y = 0; CPoint * m_next = nullptr; }; class CLine { public: CLine() {}; virtual ~CLine() { // Free Linked-List: while (m_points != nullptr) { ...
53,138,975
I am sorry if this has already been covered before. I know how to do this is C and Java but not C++. Without using a pre-existing class which includes the use of Vector, how would you increase the size of an array given the code below? The array expansion and assignment to the array takes place in push() noted with th...
2018/11/04
[ "https://Stackoverflow.com/questions/53138975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4397145/" ]
Essentially the only way is to use a *dynamic array* (one created using `new[]`) and to create an entirely new *dynamic array* and copy (or move) the objects from the old *array* to the new one. Something like this: ``` class Line { public: Line(): index(0), points(nullptr) {} // initialize virtual ~Line() {...
**Keep It Simple** In my opinion, in this case, it's better to use a Linked-List of `CPoint` in `CLine`: ``` struct CPoint { int x = 0, y = 0; CPoint * m_next = nullptr; }; class CLine { public: CLine() {}; virtual ~CLine() { // Free Linked-List: while (m_points != nullptr) { ...
1,443,146
We're starting a new project in Python with a few proprietary algorithms and sensitive bits of logic that we'd like to keep private. We also will have a few outsiders (select members of the public) working on the code. We cannot grant the outsiders access to the small, private bits of code, but we'd like a public versi...
2009/09/18
[ "https://Stackoverflow.com/questions/1443146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102704/" ]
[In the `__init__` method of the `foo` package you can change `__path__` to make it look for its modules in other directories.](http://docs.python.org/tutorial/modules.html#packages-in-multiple-directories) So create a directory called `secret` and put it in your private Subversion repository. In `secret` put your pro...
Use some sort of plugin system, and keep your plugins to your self, but also have publically available plugins that gets shipped with the open code. Plugin systems abound. You can easily make dead simple ones yourself. If you want something more advanced I prefer the Zope Component Architecture, but there are also opt...
1,443,146
We're starting a new project in Python with a few proprietary algorithms and sensitive bits of logic that we'd like to keep private. We also will have a few outsiders (select members of the public) working on the code. We cannot grant the outsiders access to the small, private bits of code, but we'd like a public versi...
2009/09/18
[ "https://Stackoverflow.com/questions/1443146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102704/" ]
[In the `__init__` method of the `foo` package you can change `__path__` to make it look for its modules in other directories.](http://docs.python.org/tutorial/modules.html#packages-in-multiple-directories) So create a directory called `secret` and put it in your private Subversion repository. In `secret` put your pro...
Here's an alternate solution I noticed when reading the docs for [Flask](http://flask.pocoo.org/docs/): > > **`flaskext/__init__.py`** > > > The only purpose of this file is to mark the package as namespace package. This is required so that multiple modules from different PyPI packages can reside in the same Python...
1,443,146
We're starting a new project in Python with a few proprietary algorithms and sensitive bits of logic that we'd like to keep private. We also will have a few outsiders (select members of the public) working on the code. We cannot grant the outsiders access to the small, private bits of code, but we'd like a public versi...
2009/09/18
[ "https://Stackoverflow.com/questions/1443146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102704/" ]
Use some sort of plugin system, and keep your plugins to your self, but also have publically available plugins that gets shipped with the open code. Plugin systems abound. You can easily make dead simple ones yourself. If you want something more advanced I prefer the Zope Component Architecture, but there are also opt...
Here's an alternate solution I noticed when reading the docs for [Flask](http://flask.pocoo.org/docs/): > > **`flaskext/__init__.py`** > > > The only purpose of this file is to mark the package as namespace package. This is required so that multiple modules from different PyPI packages can reside in the same Python...
5,401,448
I've a client server architecture implemented in C++ with blocking sockets under Windows 7. Everything is running well up to a certain level of load. If there are a couple of clients (e.g. > 4) receiving or sending megabytes of data, sometimes the communication with one client freezes for approximately 5 seconds. All o...
2011/03/23
[ "https://Stackoverflow.com/questions/5401448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/534960/" ]
This is a Windows bug. [KB 2020447 - **Socket communication using the loopback address will intermittently encounter a five second delay**](http://support.microsoft.com/kb/2020447) A Hotfix is available in [KB 2861819 - **Data transfer stops for five seconds in a Windows Socket-based application in Windows 7 and Win...
I've had this problem in situations of high load: the last packet of TCP data sometimes reached before the second to last, as the default stack is not defined for package sorting, this disorder caused in receiving similar result to what you describe. The solution adopted was: load distribution in more servers
1,831,373
changing the text of a label (or sophisticatedly we can say a text-based progress bar). in winforms you just Invalidate / Update. But how to do this in WPF without using Background Threads. ???
2009/12/02
[ "https://Stackoverflow.com/questions/1831373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/185022/" ]
``` public static class ExtensionMethods { private static Action EmptyDelegate = delegate() { }; public static void Refresh(this UIElement uiElement) { uiElement.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate); } } private void LoopingMethod() { for (int i = 0; i < 10; i++) { ...
Perhaps you should read more on the subject of [Bindings](http://msdn.microsoft.com/en-us/magazine/cc163299.aspx).. Basicly, bindings will manage this for you..
9,551,015
I'm trying to set up replication between a SQL Server 2008 R2 database and SQL Server CE 3.5. I have set up IIS 7 accordingly and get a nice "Microsoft SQL Server Compact Server Agent" when checking the publication URL (<http://winserver2008/SQLReplication/sqlcesa35.dll>). However when I try <http://winserver2008/SQLR...
2012/03/04
[ "https://Stackoverflow.com/questions/9551015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41348/" ]
Finally figured it out. After locating the actual error message in SQL Server Profiler it became obvious there was an issue with the access privileges of the publication. As it turns out I had to add the database user to the PAL instead of the corresponding windows account.
The IIS web site and web application utilized by SQL CE 3.5 has to be set to allow "directory browsing". Once I turned that on, the ReadWriteDeleteMessageFile status went to SUCCESS.
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
Leave out the `<p>` tag unless the content of your table cell is *truly* a paragraph. It's certainly possible to have paragraphs in tabular data, and in that case a semantic `<p>` would be appropriately placed. But for the common table with data in the cells eg. numbers, names, etc., don't include the `<p>`.
If the tabular cell data is text: ``` <td> content text </td> ``` If the tabular cell data is paragraph(s): ``` <td> <p> content text </p> ... </td> ```
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
It depends on your intention. If the cell is going to have just ONE paragraph then it makes no sense to add the `<p>` tag to it. If you intend to have a few paragraphs in the `<td>` cell then it makes sense to use the `<p>` tag.
If the tabular cell data is text: ``` <td> content text </td> ``` If the tabular cell data is paragraph(s): ``` <td> <p> content text </p> ... </td> ```
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
Leave out the `<p>` tag unless the content of your table cell is *truly* a paragraph. It's certainly possible to have paragraphs in tabular data, and in that case a semantic `<p>` would be appropriately placed. But for the common table with data in the cells eg. numbers, names, etc., don't include the `<p>`.
They are both valid. However, if you are going to have multiple paragraphs, obviously use the `<p>` tags
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
If the tabular cell data is text: ``` <td> content text </td> ``` If the tabular cell data is paragraph(s): ``` <td> <p> content text </p> ... </td> ```
Both are valid; if that is the only content of `<td>`, and the content is not being used in JavaScript code, then the second is better.
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
They are both valid. However, if you are going to have multiple paragraphs, obviously use the `<p>` tags
Both are valid; if that is the only content of `<td>`, and the content is not being used in JavaScript code, then the second is better.
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
Leave out the `<p>` tag unless the content of your table cell is *truly* a paragraph. It's certainly possible to have paragraphs in tabular data, and in that case a semantic `<p>` would be appropriately placed. But for the common table with data in the cells eg. numbers, names, etc., don't include the `<p>`.
It depends on your intention. If the cell is going to have just ONE paragraph then it makes no sense to add the `<p>` tag to it. If you intend to have a few paragraphs in the `<td>` cell then it makes sense to use the `<p>` tag.
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
It depends on your intention. If the cell is going to have just ONE paragraph then it makes no sense to add the `<p>` tag to it. If you intend to have a few paragraphs in the `<td>` cell then it makes sense to use the `<p>` tag.
They are both valid. However, if you are going to have multiple paragraphs, obviously use the `<p>` tags
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
They are both valid. However, if you are going to have multiple paragraphs, obviously use the `<p>` tags
Depends on if you subscribe to the "tables are for tabular data" or the "tables are for layout" school. If you prefer to use your tables for tabular data, and the paragraph is not tabular data the "p" is valid, if tables are for layout, and you have the "p" tag reserved for other layout semantics then its not required....
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
Leave out the `<p>` tag unless the content of your table cell is *truly* a paragraph. It's certainly possible to have paragraphs in tabular data, and in that case a semantic `<p>` would be appropriately placed. But for the common table with data in the cells eg. numbers, names, etc., don't include the `<p>`.
Depends on if you subscribe to the "tables are for tabular data" or the "tables are for layout" school. If you prefer to use your tables for tabular data, and the paragraph is not tabular data the "p" is valid, if tables are for layout, and you have the "p" tag reserved for other layout semantics then its not required....
1,944,213
Which is more semantic and valid? ``` <td> <p> content text </p> </td> ``` or ``` <td> content text </td> ```
2009/12/22
[ "https://Stackoverflow.com/questions/1944213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
Leave out the `<p>` tag unless the content of your table cell is *truly* a paragraph. It's certainly possible to have paragraphs in tabular data, and in that case a semantic `<p>` would be appropriately placed. But for the common table with data in the cells eg. numbers, names, etc., don't include the `<p>`.
Both are valid; if that is the only content of `<td>`, and the content is not being used in JavaScript code, then the second is better.
951,078
**Problem:** Prove that the equation $5^x+2=17^y$ doesn't have any solutions with $x,y$ in $\mathbb{N}$. I've been analyzing the remainder while dividing by $4$, but I'm getting nowhere.
2014/09/29
[ "https://math.stackexchange.com/questions/951078", "https://math.stackexchange.com", "https://math.stackexchange.com/users/143201/" ]
I'll refer to (one of) my preferred textbooks : * Herbert Enderton, [A Mathematical Introduction to Logic](http://rads.stackoverflow.com/amzn/click/0122384520) (2nd ed - 2001), page 112 : he defines *substitution* by recursion : > > 1. For atomic $\alpha, \alpha\_t^x$ is the expression obtained from $\alpha$ by rep...
To be able to formally replace $y$ by $x$, it must be true that $x=y$ (or $y=x$) where $x$ and $y$ are *free* variables. In the statement $\forall x\exists y ¬(x=y)$, $x$ and $y$ are not free variables; they are *bound* variables. For this reason, we cannot make the substitution.
3,820,348
I am trying to shear an Image in WPF (C#) using pure XAML. I have used transformations such as skew, scale and matrix but I am not getting the result as I want. Following is the code I am using ``` <Image Source="G:\Demo\virtualization\virtualization\img3.bmp" Stretch="Fill" Height="70" Width="240" Margin="0,...
2010/09/29
[ "https://Stackoverflow.com/questions/3820348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
You cannot achieve this kind of effect with linear transformation (mathematically impossible). You could get this effect with WPF 3D.
You can achieve this effect with a custom pixel shader. Download a copy of Shazzam (it's free) and check out the paperfold sample (shazzam-tool.com). While it's not exactly the shear effect you showed in your question, it is close. Have you worked with shaders before? If you want to use a custom shader I have a proto...
54,165,098
I'm trying to create a small project but I'm stuck and don't even know where to begin with the JS code. Essentially when you type in your order in the textbox, as you type it or when you click the button (it doesn't have to add everything up in real time though it would be "cooler") it adds a number to the price based ...
2019/01/13
[ "https://Stackoverflow.com/questions/54165098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You are probably looking for something as follows. Note the code below only includes mapping for `soup`, `noodles` and `bread`, but you can add the remaining items easily to the `priceMap`. Also space is assumed as a delimiter used by a user in textarea. You can change it by passing a different character into `split`. ...
In order to use this fully functional, you should separate order items by `,` and give quantity to the item even though you buy 1. Try `1 lasagna, 2 cake` ```js let input = document.querySelector("#txtarea") let selectedFood = []; let menu = [ { item: "soup", price: 5 }, { item: "noodles", price: 5...
35,900,044
So I'm following a set of tutorials and have come to a point where I have the app working (A simple calculator), but the UI could still be improved. The current UI works great on phones, but when going up to an iPad, parts of the UI expand as needed, but the buttons stay at quite a small size. I have no constraints ke...
2016/03/09
[ "https://Stackoverflow.com/questions/35900044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4644541/" ]
Searching for the message in your exception returns the following SO answer: [Mixed mode assembly is built against version 'v1.1.4322'](https://stackoverflow.com/questions/4018924/mixed-mode-assembly-is-built-against-version-v1-1-4322) > > You need to add an app.Config file and set useLegacyV2RuntimeActivationPolicy...
You can temporarily add an exception block to your code with a messagebox show: ``` try { ... (your existing code) } catch (Exception ex) { MessageBox.Show(ex.Message); } ``` Or, you could create a handler for unhandled exceptions and rely on that. To do so, make your project's Program.cs look something like...
48,962,743
For the following codility task my solution is 100% correct from the Performance point of view and 80% from the correctness point of view. My Solution is failing for two elements but I have tested it with different values (two elements) and I am getting required output. Please let me know how can I fix this issue. **C...
2018/02/24
[ "https://Stackoverflow.com/questions/48962743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8494430/" ]
#### A) To uninstall `Docker Engine`: ``` sudo yum remove docker-ce docker-ce-cli containerd.io docker-compose-plugin ``` #### B) To uninstall old versions of docker (previously called `docker` or `docker-engine`): ``` sudo yum remove docker \ docker-client \ docker-client-latest \ ...
for newer versions you need to remove the cli as well ```sh sudo yum remove -y docker-ce docker-ce-cli ``` that will do the trick
48,962,743
For the following codility task my solution is 100% correct from the Performance point of view and 80% from the correctness point of view. My Solution is failing for two elements but I have tested it with different values (two elements) and I am getting required output. Please let me know how can I fix this issue. **C...
2018/02/24
[ "https://Stackoverflow.com/questions/48962743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8494430/" ]
#### A) To uninstall `Docker Engine`: ``` sudo yum remove docker-ce docker-ce-cli containerd.io docker-compose-plugin ``` #### B) To uninstall old versions of docker (previously called `docker` or `docker-engine`): ``` sudo yum remove docker \ docker-client \ docker-client-latest \ ...
A newer answer for this is: Uninstall the Docker Engine, CLI, and Containerd packages: ``` $ sudo yum remove docker-ce docker-ce-cli containerd.io ``` Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes: ``` $ sudo...
48,962,743
For the following codility task my solution is 100% correct from the Performance point of view and 80% from the correctness point of view. My Solution is failing for two elements but I have tested it with different values (two elements) and I am getting required output. Please let me know how can I fix this issue. **C...
2018/02/24
[ "https://Stackoverflow.com/questions/48962743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8494430/" ]
#### A) To uninstall `Docker Engine`: ``` sudo yum remove docker-ce docker-ce-cli containerd.io docker-compose-plugin ``` #### B) To uninstall old versions of docker (previously called `docker` or `docker-engine`): ``` sudo yum remove docker \ docker-client \ docker-client-latest \ ...
I'm on CentOS 7 and followed all the above suggestions which worked to remove docker's files and commands, but I still found it in my repo list. ``` yum repolist ``` Showed up... ``` docker-ce-stable/7/x86_64 Docker CE Stable - x86_64 117 ``` I removed it via the following c...
48,962,743
For the following codility task my solution is 100% correct from the Performance point of view and 80% from the correctness point of view. My Solution is failing for two elements but I have tested it with different values (two elements) and I am getting required output. Please let me know how can I fix this issue. **C...
2018/02/24
[ "https://Stackoverflow.com/questions/48962743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8494430/" ]
for newer versions you need to remove the cli as well ```sh sudo yum remove -y docker-ce docker-ce-cli ``` that will do the trick
A newer answer for this is: Uninstall the Docker Engine, CLI, and Containerd packages: ``` $ sudo yum remove docker-ce docker-ce-cli containerd.io ``` Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes: ``` $ sudo...
48,962,743
For the following codility task my solution is 100% correct from the Performance point of view and 80% from the correctness point of view. My Solution is failing for two elements but I have tested it with different values (two elements) and I am getting required output. Please let me know how can I fix this issue. **C...
2018/02/24
[ "https://Stackoverflow.com/questions/48962743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8494430/" ]
for newer versions you need to remove the cli as well ```sh sudo yum remove -y docker-ce docker-ce-cli ``` that will do the trick
I'm on CentOS 7 and followed all the above suggestions which worked to remove docker's files and commands, but I still found it in my repo list. ``` yum repolist ``` Showed up... ``` docker-ce-stable/7/x86_64 Docker CE Stable - x86_64 117 ``` I removed it via the following c...
48,962,743
For the following codility task my solution is 100% correct from the Performance point of view and 80% from the correctness point of view. My Solution is failing for two elements but I have tested it with different values (two elements) and I am getting required output. Please let me know how can I fix this issue. **C...
2018/02/24
[ "https://Stackoverflow.com/questions/48962743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8494430/" ]
A newer answer for this is: Uninstall the Docker Engine, CLI, and Containerd packages: ``` $ sudo yum remove docker-ce docker-ce-cli containerd.io ``` Images, containers, volumes, or customized configuration files on your host are not automatically removed. To delete all images, containers, and volumes: ``` $ sudo...
I'm on CentOS 7 and followed all the above suggestions which worked to remove docker's files and commands, but I still found it in my repo list. ``` yum repolist ``` Showed up... ``` docker-ce-stable/7/x86_64 Docker CE Stable - x86_64 117 ``` I removed it via the following c...
44,642,544
I'm trying to pass a boolean parameter from the 'GetClientValidationRules' method of a validator. However the parameter comes through as a string. Is it possible to pass the parameter as an actual boolean value? Code for reference: Server-side: ``` public override IEnumerable<ModelClientValidationRule> GetClientVali...
2017/06/20
[ "https://Stackoverflow.com/questions/44642544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4127388/" ]
Here's a spec that simulates Spark's avro auto-schema generation in a non-spark environment and tests the ser/de. ``` private val sconf = new SparkConf().set("spark.sql.avro.compression.codec", "snappy") implicit val spark: SparkSession = SparkSession.builder().appName("SparkTest").master("local[*]").config(s...
You don't need to emulate serialization, you just need to create a `GenericRecord`: ``` val gr = new GenericRecordBuilder(schema) .put("bar", 10) .put("baz", "bat") .build foo(gr) shouldBe Foo(10, "baz") ```
388,681
I am trying to write a .awk source file to filter a .txt and I wanted to know how do I use the max variable after in the second command ``` BEGIN {max1=0} ``` Find the max value in $4 between two patterns (0 and 1) and set it as a variable ============================================================================...
2017/08/27
[ "https://unix.stackexchange.com/questions/388681", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/248391/" ]
This is a one-pass solution: ``` /Nodes/ { read = 1 } /EndNodes/ { read = 0 } !read { next } NF == 4 { n = $1; x = $2; y = $3; z = $4 } z > max { delete set; i = 1; max = z } x >= 0 && y == 0 && z == max { set[i++] = n ...
***awk*** solution: ***get\_max\_nodes.awk*** script: ``` #!/bin/awk -f BEGIN{ max=0 } NR==FNR{ # processing the 1st input file if ($4~/^[0-9]/) { # if the 4th field is a number if($4+0 > max) max=$4+0 # capturing maximal number } next } { # processing the 2nd ...
388,681
I am trying to write a .awk source file to filter a .txt and I wanted to know how do I use the max variable after in the second command ``` BEGIN {max1=0} ``` Find the max value in $4 between two patterns (0 and 1) and set it as a variable ============================================================================...
2017/08/27
[ "https://unix.stackexchange.com/questions/388681", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/248391/" ]
This is a one-pass solution: ``` /Nodes/ { read = 1 } /EndNodes/ { read = 0 } !read { next } NF == 4 { n = $1; x = $2; y = $3; z = $4 } z > max { delete set; i = 1; max = z } x >= 0 && y == 0 && z == max { set[i++] = n ...
I do not have enough reputation to comment, so I am forced to respond with an answer. My first comment would have been that awk is not the best tool for doing real number math. It is better at strings and integer numbers. Other points on awk: The BEGIN paragraph happens before any lines are read from your input. The E...
20,938,797
I want to create a custom control ideally like this: ``` <foo:Frobnicate runat="server"> <DoStuffWithThese> <asp:TextBox runat="server" ID="fizzbot" /> </DoStuffWithThese> <!-- other controls can be in the wrapper but outside the DoSomeStuffWithThese collection --> <asp:DropDownList runa...
2014/01/05
[ "https://Stackoverflow.com/questions/20938797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I believe you have to implement `INamingContainer` in your class, WebControl doesn't do that on its own. Note that it's just a marker interface, you don't need any code. Also, instead of a list of controls, you should probably use `ITemplate` (which allows you to actually create the controls and use them in the output ...
Can you get the id of the dropdown? If so, I think it has to do with the other items missing runat=server.
481,868
Show that the function $x^4 – 3x^2 + x-10$ cannot have a root inside $(0,2)$. Please note that roots of $f'(x)$ cannot be found using a calculator. Attempted the question by calculating $f'(x)$ and assuming that at least one root of $f(x)$ exists in $(0,2)$. However had difficulty locating the points of maxima/minima, ...
2013/09/02
[ "https://math.stackexchange.com/questions/481868", "https://math.stackexchange.com", "https://math.stackexchange.com/users/92679/" ]
You can show that in the domain $(0,2)$, $$ x^4 - 3x^2 + x - 10 < -10 + 3x.$$ This is equivalent to $$x (x-2) (x+1)^2 < 0. $$ Since $-10 + 3x < 0 $ in the domain $(0,2)$, it follows that the function is never 0 in the domain. --- The RHS of the inequality is obtained by finding the linear function which satisfie...
Note that the function $g(x) = x^4-3x^2$ achieves maximum modulus in $[0,2]$ at $x=2$, with $|g(4)|=4$. Also note that in $(0,2)$ we have $$|x^4-3x^2+x-10|>10-|x|-|g(x)| > 8-|g(x)| \geq 4.$$
481,868
Show that the function $x^4 – 3x^2 + x-10$ cannot have a root inside $(0,2)$. Please note that roots of $f'(x)$ cannot be found using a calculator. Attempted the question by calculating $f'(x)$ and assuming that at least one root of $f(x)$ exists in $(0,2)$. However had difficulty locating the points of maxima/minima, ...
2013/09/02
[ "https://math.stackexchange.com/questions/481868", "https://math.stackexchange.com", "https://math.stackexchange.com/users/92679/" ]
Note that the function $g(x) = x^4-3x^2$ achieves maximum modulus in $[0,2]$ at $x=2$, with $|g(4)|=4$. Also note that in $(0,2)$ we have $$|x^4-3x^2+x-10|>10-|x|-|g(x)| > 8-|g(x)| \geq 4.$$
Calvin's method looks great [+1]. If you really want other ways, you could try If $0 < x < 2$, then $x^3 < 8$ and $3x^2 + 10 > 2 \sqrt{30} x$ by AM-GM. So $x^4 + x = x(x^3+1) < 9 x < 2 \sqrt{30} x < 3x^2 + 10$
481,868
Show that the function $x^4 – 3x^2 + x-10$ cannot have a root inside $(0,2)$. Please note that roots of $f'(x)$ cannot be found using a calculator. Attempted the question by calculating $f'(x)$ and assuming that at least one root of $f(x)$ exists in $(0,2)$. However had difficulty locating the points of maxima/minima, ...
2013/09/02
[ "https://math.stackexchange.com/questions/481868", "https://math.stackexchange.com", "https://math.stackexchange.com/users/92679/" ]
Note that the function $g(x) = x^4-3x^2$ achieves maximum modulus in $[0,2]$ at $x=2$, with $|g(4)|=4$. Also note that in $(0,2)$ we have $$|x^4-3x^2+x-10|>10-|x|-|g(x)| > 8-|g(x)| \geq 4.$$
Each term of a polynomial function $f:x\mapsto \sum\_{k=0}^na\_kx^k$ is monotonic in $x$ over any interval $[a,b]$ with $0\leqslant a\leqslant b$. Therefore $$f(x)\le \sum\_{k=0}^n a\_kc\_k^k\quad(a\leqslant x\leqslant b),$$where $c\_k=a$ if $a\_k\leqslant 0$ and $c\_k=b$ if $a\_k>0.$ Now you can apply this to your exa...
481,868
Show that the function $x^4 – 3x^2 + x-10$ cannot have a root inside $(0,2)$. Please note that roots of $f'(x)$ cannot be found using a calculator. Attempted the question by calculating $f'(x)$ and assuming that at least one root of $f(x)$ exists in $(0,2)$. However had difficulty locating the points of maxima/minima, ...
2013/09/02
[ "https://math.stackexchange.com/questions/481868", "https://math.stackexchange.com", "https://math.stackexchange.com/users/92679/" ]
You can show that in the domain $(0,2)$, $$ x^4 - 3x^2 + x - 10 < -10 + 3x.$$ This is equivalent to $$x (x-2) (x+1)^2 < 0. $$ Since $-10 + 3x < 0 $ in the domain $(0,2)$, it follows that the function is never 0 in the domain. --- The RHS of the inequality is obtained by finding the linear function which satisfie...
Calvin's method looks great [+1]. If you really want other ways, you could try If $0 < x < 2$, then $x^3 < 8$ and $3x^2 + 10 > 2 \sqrt{30} x$ by AM-GM. So $x^4 + x = x(x^3+1) < 9 x < 2 \sqrt{30} x < 3x^2 + 10$
481,868
Show that the function $x^4 – 3x^2 + x-10$ cannot have a root inside $(0,2)$. Please note that roots of $f'(x)$ cannot be found using a calculator. Attempted the question by calculating $f'(x)$ and assuming that at least one root of $f(x)$ exists in $(0,2)$. However had difficulty locating the points of maxima/minima, ...
2013/09/02
[ "https://math.stackexchange.com/questions/481868", "https://math.stackexchange.com", "https://math.stackexchange.com/users/92679/" ]
You can show that in the domain $(0,2)$, $$ x^4 - 3x^2 + x - 10 < -10 + 3x.$$ This is equivalent to $$x (x-2) (x+1)^2 < 0. $$ Since $-10 + 3x < 0 $ in the domain $(0,2)$, it follows that the function is never 0 in the domain. --- The RHS of the inequality is obtained by finding the linear function which satisfie...
Each term of a polynomial function $f:x\mapsto \sum\_{k=0}^na\_kx^k$ is monotonic in $x$ over any interval $[a,b]$ with $0\leqslant a\leqslant b$. Therefore $$f(x)\le \sum\_{k=0}^n a\_kc\_k^k\quad(a\leqslant x\leqslant b),$$where $c\_k=a$ if $a\_k\leqslant 0$ and $c\_k=b$ if $a\_k>0.$ Now you can apply this to your exa...
6,522,960
I want join an arbitrary-length list of filters with `or`. If the list would be fixed-length, it would look like this: ``` query.filter(filters(0) || filters(1) || … || filter(n)) ``` Joining filters with `and` would be easy: ``` for (filter ← filters) query = query.filter(filter) ``` Joining things that eval...
2011/06/29
[ "https://Stackoverflow.com/questions/6522960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247482/" ]
There is really nothing about `Query.filter` which would make this any different than combining predicates for filtering a Scala collection. Yes, it does have a more complicated type: ``` def filter[T](f: E => T)(implicit wt: CanBeQueryCondition[T]): Query[E, U] = ... ``` But you can safely ignore the `CanBeQueryCon...
How about this? ``` query.filter(filters reduceLeft (_ || _)) ```
6,008,940
Howdie I 've classified all the regular expressions I used the most as library files. To give a dummy example, I have a file called `/mysdk/library/regex/email/match` with the contents: ``` ^[a-z]@[a-z]\.com$ ``` (I know this is not the good regex, but that's for the example :)). And I have a lot of folders with co...
2011/05/15
[ "https://Stackoverflow.com/questions/6008940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/754522/" ]
It's possible you have trailing newlines on those, or maybe headers. Try running chomp on the strings you read in. Hard to tell without know what the files look like.
Have you considered looking at `Regexp::Common` This might not solve your problem directly, but could help you classify and its already includes some very common regex's you may find useful.
6,008,940
Howdie I 've classified all the regular expressions I used the most as library files. To give a dummy example, I have a file called `/mysdk/library/regex/email/match` with the contents: ``` ^[a-z]@[a-z]\.com$ ``` (I know this is not the good regex, but that's for the example :)). And I have a lot of folders with co...
2011/05/15
[ "https://Stackoverflow.com/questions/6008940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/754522/" ]
It's possible you have trailing newlines on those, or maybe headers. Try running chomp on the strings you read in. Hard to tell without know what the files look like.
Rather than putting the regular expressions in files, you might consider putting them in a module: ``` # In FavoriteRegex.pm. package FavoriteRegex; use strict; use warnings; use parent qw(Exporter); our @EXPORT = qw(); our @EXPORT_OK = qw(%FAVS); our %FAVS = ( foo => qr/foo/, integer => qr/\A\d+\Z/,...
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
initialize a variable check with value =1 and update the value in the else .then check the value of check after the loop has executed ``` if (future.isDone()) { System.out.println("true"); } else {System.out.println("false"); check=0;} ```
If the method `future.get` returns then the computation done by the future is finished, so calling `isDone` is redundant. And yes, after all futures have finished all of the threads in the `ThreadPool` should be available.
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
Using a boolean variable is the simplest way to understand that all threads are done. Another way could be using a primitive, e.g. an integer. You could simply increment/decrement the counter to see if all threads are done. And another way could be checking the return value of `awaitTermination()` invocation on your `...
Invokeall calling this method waits complete all take then CPU execution reaches to for loop to check for completion Or Do we need do .. While loop To check completion of tasks
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
Using a boolean variable is the simplest way to understand that all threads are done. Another way could be using a primitive, e.g. an integer. You could simply increment/decrement the counter to see if all threads are done. And another way could be checking the return value of `awaitTermination()` invocation on your `...
initialize a variable check with value =1 and update the value in the else .then check the value of check after the loop has executed ``` if (future.isDone()) { System.out.println("true"); } else {System.out.println("false"); check=0;} ```
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
Meant as a comment on vainolo's reply but I don't have enough reputation points: `isDone` is also redundant because `invokeAll` returns a list of futures for which `isDone` is true. The javadocs [mention this](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html#invokeAll(java.util.Collec...
Invokeall calling this method waits complete all take then CPU execution reaches to for loop to check for completion Or Do we need do .. While loop To check completion of tasks
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
Normally you add Runnable tasks to a Thread pool. Adding Threads to a thread pool isn't going to do what you think. When future.get() returns for each task, all the tasks have completed. The threads which ran the tasks will still be running. If you want to stop all the thread once the tasks have completed you can use...
If the method `future.get` returns then the computation done by the future is finished, so calling `isDone` is redundant. And yes, after all futures have finished all of the threads in the `ThreadPool` should be available.
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
Meant as a comment on vainolo's reply but I don't have enough reputation points: `isDone` is also redundant because `invokeAll` returns a list of futures for which `isDone` is true. The javadocs [mention this](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html#invokeAll(java.util.Collec...
Normally you add Runnable tasks to a Thread pool. Adding Threads to a thread pool isn't going to do what you think. When future.get() returns for each task, all the tasks have completed. The threads which ran the tasks will still be running. If you want to stop all the thread once the tasks have completed you can use...
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
Meant as a comment on vainolo's reply but I don't have enough reputation points: `isDone` is also redundant because `invokeAll` returns a list of futures for which `isDone` is true. The javadocs [mention this](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ExecutorService.html#invokeAll(java.util.Collec...
initialize a variable check with value =1 and update the value in the else .then check the value of check after the loop has executed ``` if (future.isDone()) { System.out.println("true"); } else {System.out.println("false"); check=0;} ```
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
Normally you add Runnable tasks to a Thread pool. Adding Threads to a thread pool isn't going to do what you think. When future.get() returns for each task, all the tasks have completed. The threads which ran the tasks will still be running. If you want to stop all the thread once the tasks have completed you can use...
initialize a variable check with value =1 and update the value in the else .then check the value of check after the loop has executed ``` if (future.isDone()) { System.out.println("true"); } else {System.out.println("false"); check=0;} ```
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
To check if all are true, you can do something like this: ``` boolean works=true; for(Future<Boolean> future : futures){ future.get(); if (future.isDone()) { System.out.println("true"); } else{ System.out.println("false");works=false; } } if(works)S...
initialize a variable check with value =1 and update the value in the else .then check the value of check after the loop has executed ``` if (future.isDone()) { System.out.println("true"); } else {System.out.println("false"); check=0;} ```
12,896,755
Having the following code at hand: ``` ExecutorService executor = Executors.newFixedThreadPool(10); Collection collection = new ArrayList(); for (int n=1; n<100; n++) collection.add(new MyThread(n)); try { List<Future<Boolean>> futures = executor.invokeAll(collection); for(Fut...
2012/10/15
[ "https://Stackoverflow.com/questions/12896755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018686/" ]
To check if all are true, you can do something like this: ``` boolean works=true; for(Future<Boolean> future : futures){ future.get(); if (future.isDone()) { System.out.println("true"); } else{ System.out.println("false");works=false; } } if(works)S...
Normally you add Runnable tasks to a Thread pool. Adding Threads to a thread pool isn't going to do what you think. When future.get() returns for each task, all the tasks have completed. The threads which ran the tasks will still be running. If you want to stop all the thread once the tasks have completed you can use...