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 |
|---|---|---|---|---|---|
2,585,429 | It is possible to access bits of MATLAB's internal java code to programmatically change MATLAB itself. For example, you can programmatically open a document in the editor using
```
editorServices = com.mathworks.mlservices.MLEditorServices;
editorServices.newDocument() %older versions of MATLAB seem to use new()
```... | 2010/04/06 | [
"https://Stackoverflow.com/questions/2585429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/134830/"
] | To find out more about java objects, I use [uiinspect](http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-methodspropertiescallbacks-of-an-object).
The only place I know that is documenting the Matlab hidden Java stuff is [Undocumented Matlab](http://undocumentedmatlab.com/) by [Yair Altman](... | [Undocumented Matlab](http://undocumentedmatlab.com/) is a great place to start looking. |
2,585,429 | It is possible to access bits of MATLAB's internal java code to programmatically change MATLAB itself. For example, you can programmatically open a document in the editor using
```
editorServices = com.mathworks.mlservices.MLEditorServices;
editorServices.newDocument() %older versions of MATLAB seem to use new()
```... | 2010/04/06 | [
"https://Stackoverflow.com/questions/2585429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/134830/"
] | There is no official documentation nor support for these classes. Moreover, these classes and internal methods represent internal implementation that may change without notice in any future Matlab release. This said, you can use my [uiinspect](http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-... | To find out more about java objects, I use [uiinspect](http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-methodspropertiescallbacks-of-an-object).
The only place I know that is documenting the Matlab hidden Java stuff is [Undocumented Matlab](http://undocumentedmatlab.com/) by [Yair Altman](... |
2,585,429 | It is possible to access bits of MATLAB's internal java code to programmatically change MATLAB itself. For example, you can programmatically open a document in the editor using
```
editorServices = com.mathworks.mlservices.MLEditorServices;
editorServices.newDocument() %older versions of MATLAB seem to use new()
```... | 2010/04/06 | [
"https://Stackoverflow.com/questions/2585429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/134830/"
] | I am an eclipse fan. If you use that as your IDE, the jar can be imported into one of your projects and you can inspect the methods in there. | [Undocumented Matlab](http://undocumentedmatlab.com/) is a great place to start looking. |
2,585,429 | It is possible to access bits of MATLAB's internal java code to programmatically change MATLAB itself. For example, you can programmatically open a document in the editor using
```
editorServices = com.mathworks.mlservices.MLEditorServices;
editorServices.newDocument() %older versions of MATLAB seem to use new()
```... | 2010/04/06 | [
"https://Stackoverflow.com/questions/2585429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/134830/"
] | There is no official documentation nor support for these classes. Moreover, these classes and internal methods represent internal implementation that may change without notice in any future Matlab release. This said, you can use my [uiinspect](http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-... | [Undocumented Matlab](http://undocumentedmatlab.com/) is a great place to start looking. |
2,585,429 | It is possible to access bits of MATLAB's internal java code to programmatically change MATLAB itself. For example, you can programmatically open a document in the editor using
```
editorServices = com.mathworks.mlservices.MLEditorServices;
editorServices.newDocument() %older versions of MATLAB seem to use new()
```... | 2010/04/06 | [
"https://Stackoverflow.com/questions/2585429",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/134830/"
] | There is no official documentation nor support for these classes. Moreover, these classes and internal methods represent internal implementation that may change without notice in any future Matlab release. This said, you can use my [uiinspect](http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-... | I am an eclipse fan. If you use that as your IDE, the jar can be imported into one of your projects and you can inspect the methods in there. |
10,121,715 | I am trying to increment progress bar and show percentage on a label. However, both remains without changes when "incrementaProgres" function is called. `IBOutlets` are properly linked on `xib` and also tested that, when function is called, variables have proper value. Thanks
from delegate:
```
loadingViewController ... | 2012/04/12 | [
"https://Stackoverflow.com/questions/10121715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1238934/"
] | Progress bar's [progress](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIProgressView_Class/Reference/Reference.html) value is between `0.0` and `1.0`, your code sets it in the increments of `15.0`, which is out of range. Your increment should be `0.15`, not `15.0`. | Progress is a value between 0.0 and 1.0.
Edit:
Did you try to call `[myView setNeedsDisplay];`?
2nd Edit:
Maybe there is one confusion: `viewDidLoad` is called right before you are presenting the view. Therefore in the code you have shown here `incrementaProgres:` is called before `viewDidLoad`. |
27,503,621 | I have the following code:
```
ids = set()
for result in text_results:
ids.add(str(result[5]))
for result in doc_results:
ids.add(str(result[4]))
```
Both `text_results` and `doc_results` are lists that contain other lists as items as you might have already guessed. Is there a more efficient way to do this u... | 2014/12/16 | [
"https://Stackoverflow.com/questions/27503621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864413/"
] | I would probably write:
```
ids = set(str(result[5]) for result in text_results)
ids.update(str(result[4]) for result in doc_results)
```
As for efficiency, if you want to squeeze every possible bit of performance then you first need a realistic dataset, then you can try things like `map` (or `itertools.imap` in Pyt... | This one liner should work:
```
ids = set(map (lambda x: str(x[4]), doc_results) + map(lambda x: str(x[5]), text_results))
``` |
27,503,621 | I have the following code:
```
ids = set()
for result in text_results:
ids.add(str(result[5]))
for result in doc_results:
ids.add(str(result[4]))
```
Both `text_results` and `doc_results` are lists that contain other lists as items as you might have already guessed. Is there a more efficient way to do this u... | 2014/12/16 | [
"https://Stackoverflow.com/questions/27503621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864413/"
] | I would probably write:
```
ids = set(str(result[5]) for result in text_results)
ids.update(str(result[4]) for result in doc_results)
```
As for efficiency, if you want to squeeze every possible bit of performance then you first need a realistic dataset, then you can try things like `map` (or `itertools.imap` in Pyt... | This (wrapped) one liner should work:
```
ids = set([str(tr[5]) for tr in text_results] +
[str(dr[4]) for dr in doc_results])
``` |
27,503,621 | I have the following code:
```
ids = set()
for result in text_results:
ids.add(str(result[5]))
for result in doc_results:
ids.add(str(result[4]))
```
Both `text_results` and `doc_results` are lists that contain other lists as items as you might have already guessed. Is there a more efficient way to do this u... | 2014/12/16 | [
"https://Stackoverflow.com/questions/27503621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864413/"
] | I would probably write:
```
ids = set(str(result[5]) for result in text_results)
ids.update(str(result[4]) for result in doc_results)
```
As for efficiency, if you want to squeeze every possible bit of performance then you first need a realistic dataset, then you can try things like `map` (or `itertools.imap` in Pyt... | Do this:
```
ids = {str(i) for text, doc in zip(text_results, doc_results) for i in (text[5], doc[4])}
```
This is assuming results is something like:
```
text_results = [['t11', 't12', 't13', 't14', 't15', 't16'], ['t21', 't22', 't23', 't24', 't25', 't26']]
doc_results = [['d11', 'd12', 'd13', 'd14', 'd15', 'd16']... |
27,503,621 | I have the following code:
```
ids = set()
for result in text_results:
ids.add(str(result[5]))
for result in doc_results:
ids.add(str(result[4]))
```
Both `text_results` and `doc_results` are lists that contain other lists as items as you might have already guessed. Is there a more efficient way to do this u... | 2014/12/16 | [
"https://Stackoverflow.com/questions/27503621",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/864413/"
] | I would probably write:
```
ids = set(str(result[5]) for result in text_results)
ids.update(str(result[4]) for result in doc_results)
```
As for efficiency, if you want to squeeze every possible bit of performance then you first need a realistic dataset, then you can try things like `map` (or `itertools.imap` in Pyt... | I guess this is a more pythonic way:
```
map(str,set([i[5] for i in text_results]+[i[4] for i in doc_results]))
```
Demo:
```
>>> text_results = [[1,2,3,4,5,6,7,8,9],[1,2,3,4,56,6],[4,5,6,1,2,6,22],[1,2,3,4,5,7,8,9]]
>>> doc_results = [[1,2,3,4,5,9,7,8,9],[1,2,3,4,56,3],[4,5,6,1,2,7,22],[1,2,3,4,5,7,7,9]]
>>> map(... |
59,030,684 | I am trying to see test coverage line by line in a class, however, only the first line is highlighted.
[](https://i.stack.imgur.com/uW3o7.png)
The *Show Inline Statistics* setting is enabled.
[
Step 2 -
Generate coverage report - click on icon as shown in above image (yellow highlighted) give exported path to generate html file.
Step 3 - Click on index.html file to view report.
... | Run the test with coverage, then you can see it line by line:
[](https://i.stack.imgur.com/q8pgp.png) |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | I assume that you'd like to extract the first of two numbers in each string.
You may use the `stri_extract_first_regex` function from the [stringi](http://stringi.rexamine.com) package:
```
library(stringi)
stri_extract_first_regex(c("Pic 26+25", "Pic 1,2,3", "no pics"), "[0-9]+")
## [1] "26" "1" NA
``` | To follow up your `strsplit` attempt:
```
# split the strings
l <- strsplit(x = c("Pic 26 + 25", "Pic 27 + 28"), split = " ")
l
# [[1]]
# [1] "Pic" "26" "+" "25"
#
# [[2]]
# [1] "Pic" "27" "+" "28"
# extract relevant part from each list element and convert to numeric
as.numeric(lapply(l , `[`, 2))
# [1] 26 2... |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | I assume that you'd like to extract the first of two numbers in each string.
You may use the `stri_extract_first_regex` function from the [stringi](http://stringi.rexamine.com) package:
```
library(stringi)
stri_extract_first_regex(c("Pic 26+25", "Pic 1,2,3", "no pics"), "[0-9]+")
## [1] "26" "1" NA
``` | In the responses below we use this test data:
```
# test data
v1 <- c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 + 27", "Pic 29 + 30",
"Pic 30 + 29", "Pic 31 + 32")
```
**1) gsubfn**
```
library(gsubfn)
strapply(v1, "(\\d+).*", as.numeric, simplify = c)
## [1] 26 27 28 29 30 31
```
**2) sub** This requires no packag... |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | I assume that you'd like to extract the first of two numbers in each string.
You may use the `stri_extract_first_regex` function from the [stringi](http://stringi.rexamine.com) package:
```
library(stringi)
stri_extract_first_regex(c("Pic 26+25", "Pic 1,2,3", "no pics"), "[0-9]+")
## [1] "26" "1" NA
``` | You can do this very nicely with the `str_first_number()` function from the `strex` package, or for more general needs, you can use the `str_nth_number()` function. Install it with `install.packages("strex")`.
```
library(strex)
#> Loading required package: stringr
strings <- c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 +... |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | I assume that you'd like to extract the first of two numbers in each string.
You may use the `stri_extract_first_regex` function from the [stringi](http://stringi.rexamine.com) package:
```
library(stringi)
stri_extract_first_regex(c("Pic 26+25", "Pic 1,2,3", "no pics"), "[0-9]+")
## [1] "26" "1" NA
``` | With `str_extract` from `stringr`:
```
library(stringr)
vec = c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 + 27",
"Pic 29 + 30", "Pic 30 + 29", "Pic 31 + 32")
str_extract(v1, "[0-9]+")
# [1] "26" "27" "28" "29" "30" "31"
``` |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | In the responses below we use this test data:
```
# test data
v1 <- c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 + 27", "Pic 29 + 30",
"Pic 30 + 29", "Pic 31 + 32")
```
**1) gsubfn**
```
library(gsubfn)
strapply(v1, "(\\d+).*", as.numeric, simplify = c)
## [1] 26 27 28 29 30 31
```
**2) sub** This requires no packag... | To follow up your `strsplit` attempt:
```
# split the strings
l <- strsplit(x = c("Pic 26 + 25", "Pic 27 + 28"), split = " ")
l
# [[1]]
# [1] "Pic" "26" "+" "25"
#
# [[2]]
# [1] "Pic" "27" "+" "28"
# extract relevant part from each list element and convert to numeric
as.numeric(lapply(l , `[`, 2))
# [1] 26 2... |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | You can do this very nicely with the `str_first_number()` function from the `strex` package, or for more general needs, you can use the `str_nth_number()` function. Install it with `install.packages("strex")`.
```
library(strex)
#> Loading required package: stringr
strings <- c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 +... | To follow up your `strsplit` attempt:
```
# split the strings
l <- strsplit(x = c("Pic 26 + 25", "Pic 27 + 28"), split = " ")
l
# [[1]]
# [1] "Pic" "26" "+" "25"
#
# [[2]]
# [1] "Pic" "27" "+" "28"
# extract relevant part from each list element and convert to numeric
as.numeric(lapply(l , `[`, 2))
# [1] 26 2... |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | With `str_extract` from `stringr`:
```
library(stringr)
vec = c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 + 27",
"Pic 29 + 30", "Pic 30 + 29", "Pic 31 + 32")
str_extract(v1, "[0-9]+")
# [1] "26" "27" "28" "29" "30" "31"
``` | To follow up your `strsplit` attempt:
```
# split the strings
l <- strsplit(x = c("Pic 26 + 25", "Pic 27 + 28"), split = " ")
l
# [[1]]
# [1] "Pic" "26" "+" "25"
#
# [[2]]
# [1] "Pic" "27" "+" "28"
# extract relevant part from each list element and convert to numeric
as.numeric(lapply(l , `[`, 2))
# [1] 26 2... |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | In the responses below we use this test data:
```
# test data
v1 <- c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 + 27", "Pic 29 + 30",
"Pic 30 + 29", "Pic 31 + 32")
```
**1) gsubfn**
```
library(gsubfn)
strapply(v1, "(\\d+).*", as.numeric, simplify = c)
## [1] 26 27 28 29 30 31
```
**2) sub** This requires no packag... | You can do this very nicely with the `str_first_number()` function from the `strex` package, or for more general needs, you can use the `str_nth_number()` function. Install it with `install.packages("strex")`.
```
library(strex)
#> Loading required package: stringr
strings <- c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 +... |
23,323,344 | I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:
```
<div class="row">
<div class="col-md-6">
<div class="form-group">
... | 2014/04/27 | [
"https://Stackoverflow.com/questions/23323344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3185936/"
] | In the responses below we use this test data:
```
# test data
v1 <- c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 + 27", "Pic 29 + 30",
"Pic 30 + 29", "Pic 31 + 32")
```
**1) gsubfn**
```
library(gsubfn)
strapply(v1, "(\\d+).*", as.numeric, simplify = c)
## [1] 26 27 28 29 30 31
```
**2) sub** This requires no packag... | With `str_extract` from `stringr`:
```
library(stringr)
vec = c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 + 27",
"Pic 29 + 30", "Pic 30 + 29", "Pic 31 + 32")
str_extract(v1, "[0-9]+")
# [1] "26" "27" "28" "29" "30" "31"
``` |
30,778,140 | Hi I am using `gem 'carmen-rails'`
In my view I have written this
```
<%= f.country_select :country, prompt: 'Please select a country',
:id=>'curr-country' %>
```
but its not taking this id 'curr-country'. Please guide how to give id in this.
Thanks in advance. | 2015/06/11 | [
"https://Stackoverflow.com/questions/30778140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2739770/"
] | You'll have to pass a second hash with the HTML options:
```
<%= f.country_select :country,
{ prompt: 'Please select a country' },
{ id: 'curr-country' } %>
```
The `carmen-rails` gem doesn't document this explicitly (it is documented [in code](https://github.com/jim/carmen-r... | ```
<%= f.country_select :country, {id: 'curr-country', prompt: 'Please select a country'} %>
```
try this |
30,778,140 | Hi I am using `gem 'carmen-rails'`
In my view I have written this
```
<%= f.country_select :country, prompt: 'Please select a country',
:id=>'curr-country' %>
```
but its not taking this id 'curr-country'. Please guide how to give id in this.
Thanks in advance. | 2015/06/11 | [
"https://Stackoverflow.com/questions/30778140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2739770/"
] | You'll have to pass a second hash with the HTML options:
```
<%= f.country_select :country,
{ prompt: 'Please select a country' },
{ id: 'curr-country' } %>
```
The `carmen-rails` gem doesn't document this explicitly (it is documented [in code](https://github.com/jim/carmen-r... | Try this
```
<%= f.country_select :country, {priority: %w(US CA)}, {prompt: 'Please select a country'}, {:id => 'your-id'} %>
```
Hope this will help you. |
30,778,140 | Hi I am using `gem 'carmen-rails'`
In my view I have written this
```
<%= f.country_select :country, prompt: 'Please select a country',
:id=>'curr-country' %>
```
but its not taking this id 'curr-country'. Please guide how to give id in this.
Thanks in advance. | 2015/06/11 | [
"https://Stackoverflow.com/questions/30778140",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2739770/"
] | You'll have to pass a second hash with the HTML options:
```
<%= f.country_select :country,
{ prompt: 'Please select a country' },
{ id: 'curr-country' } %>
```
The `carmen-rails` gem doesn't document this explicitly (it is documented [in code](https://github.com/jim/carmen-r... | ```
<%= f.country_select :country, {}, class: "form-control" %>
```
Try this one :) |
203,578 | As the question says, where do each of the browsers store their offline data, be it cache, offline storage from html5, images, flash videos or anything web related that gets stored locally. | 2012/10/20 | [
"https://askubuntu.com/questions/203578",
"https://askubuntu.com",
"https://askubuntu.com/users/7035/"
] | Firefox store the offline data in `~/.mozilla` directory, to be more specific in `~/.mozilla/profiles/xxxxxxxx.default` directory.
Chrome uses `~/.cache/google-chrome` directory for storing cache. Google chrome also uses `~/.config/google-chrome/Default` directory for storing recent history, tabs and other things.
L... | I've just found that the flatpak chromium uses
```
~/.var/app/org.chromium.Chromium/cache
```
On Firefox I use the browser.cache.disk.parent\_directory "preference" in about:config to get it to use somewhere that's not backed up, to reduce backup sizes. |
17,718,922 | I have two classes
* Author with attributes id, papers (Paper relationship), ...
* Paper with attributes id, mainAuthor (Author relationship), authors (Author relationship) ...
and want to map some JSON to it
```
"authors": [
{
"id": 123,
"papers": [
{
"id": 1,
... | 2013/07/18 | [
"https://Stackoverflow.com/questions/17718922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/184245/"
] | This is exactly what foreign key mapping is for. It allows you to temporarily store the 'identity' value that you're provided with and then RestKit will find the appropriate object and complete the relationship. | Apart from the Answer @Wain (foreign key mapping) provided, it is also possible to implement a custom serialization (c.f. [RKSerialization](http://restkit.org/api/latest/Protocols/RKSerialization.html)) and modify the objects before mapping takes place. However, the aforementioned method is superior to this (somehow ug... |
12,157,558 | I am learning matlab myself andI have made an animated plot using matlab;now i want to save it as an video file.can you tell me how to convert my animation into a video file in matlab.Below is my code
```
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
A(i) = getframe... | 2012/08/28 | [
"https://Stackoverflow.com/questions/12157558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/996366/"
] | use avifile:
```
aviobj = avifile('example.avi','compression','None');
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
aviobj = addframe(aviobj,gcf);
drawnow
end
viobj = close(aviobj)
``` | One way to do this is to [print](http://www.mathworks.com.au/help/techdoc/ref/print.html) the figure to an image, and then stitch the resulting image sequence into a video. [ffmpeg](http://ffmpeg.org/) and [mencoder](http://www.mplayerhq.hu/) are great tools for doing this. There are some great resources for describing... |
12,157,558 | I am learning matlab myself andI have made an animated plot using matlab;now i want to save it as an video file.can you tell me how to convert my animation into a video file in matlab.Below is my code
```
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
A(i) = getframe... | 2012/08/28 | [
"https://Stackoverflow.com/questions/12157558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/996366/"
] | If Matlab's avifile doesn't work (it might have problems with codecs of 64-bit OS), then use mmwrite.
<http://www.mathworks.com/matlabcentral/fileexchange/15881-mmwrite>
It's simple, and it works. I used it to create \*.wmv files simply by:
`mmwrite(filename, frames);`
Edit: code example
```
% set params
fps = 25;
... | One way to do this is to [print](http://www.mathworks.com.au/help/techdoc/ref/print.html) the figure to an image, and then stitch the resulting image sequence into a video. [ffmpeg](http://ffmpeg.org/) and [mencoder](http://www.mplayerhq.hu/) are great tools for doing this. There are some great resources for describing... |
12,157,558 | I am learning matlab myself andI have made an animated plot using matlab;now i want to save it as an video file.can you tell me how to convert my animation into a video file in matlab.Below is my code
```
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
A(i) = getframe... | 2012/08/28 | [
"https://Stackoverflow.com/questions/12157558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/996366/"
] | use avifile:
```
aviobj = avifile('example.avi','compression','None');
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
aviobj = addframe(aviobj,gcf);
drawnow
end
viobj = close(aviobj)
``` | Have a look at [`VideoWriter`](https://uk.mathworks.com/help/matlab/ref/videowriter.html) or see this [`forum discussion`](https://uk.mathworks.com/matlabcentral/answers/455886-how-to-save-animated-plots#answer_370280) |
12,157,558 | I am learning matlab myself andI have made an animated plot using matlab;now i want to save it as an video file.can you tell me how to convert my animation into a video file in matlab.Below is my code
```
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
A(i) = getframe... | 2012/08/28 | [
"https://Stackoverflow.com/questions/12157558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/996366/"
] | If Matlab's avifile doesn't work (it might have problems with codecs of 64-bit OS), then use mmwrite.
<http://www.mathworks.com/matlabcentral/fileexchange/15881-mmwrite>
It's simple, and it works. I used it to create \*.wmv files simply by:
`mmwrite(filename, frames);`
Edit: code example
```
% set params
fps = 25;
... | Have a look at [`VideoWriter`](https://uk.mathworks.com/help/matlab/ref/videowriter.html) or see this [`forum discussion`](https://uk.mathworks.com/matlabcentral/answers/455886-how-to-save-animated-plots#answer_370280) |
12,157,558 | I am learning matlab myself andI have made an animated plot using matlab;now i want to save it as an video file.can you tell me how to convert my animation into a video file in matlab.Below is my code
```
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
A(i) = getframe... | 2012/08/28 | [
"https://Stackoverflow.com/questions/12157558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/996366/"
] | use avifile:
```
aviobj = avifile('example.avi','compression','None');
x=[1:2];
for i=1:25,
m=randi([3,5]);
n=randi([3,5]);
y=[m n];
bar(x,y)
axis equal
aviobj = addframe(aviobj,gcf);
drawnow
end
viobj = close(aviobj)
``` | If Matlab's avifile doesn't work (it might have problems with codecs of 64-bit OS), then use mmwrite.
<http://www.mathworks.com/matlabcentral/fileexchange/15881-mmwrite>
It's simple, and it works. I used it to create \*.wmv files simply by:
`mmwrite(filename, frames);`
Edit: code example
```
% set params
fps = 25;
... |
71,941,740 | I have installed Visual Studio 2022 on my PC today. I have an old app, which targets .NET 4.5. I see this error when attempting to build/compile the project:
"Error MSB3644 The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this ... | 2022/04/20 | [
"https://Stackoverflow.com/questions/71941740",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/937440/"
] | Because you might install a higher version of .net framework firstly, so installer might stop you install a lower version of .net framework
There is another way can try to fix it without reinstalling.
1. Download [Microsoft.NETFramework.ReferenceAssemblies.net45](https://www.nuget.org/packages/microsoft.netframework.... | If you want a less hacky way, another option is to download the VS2017 Build Tools and install the .NET Framework 4.5 Targeting Pack only (from the tab Individual Components). This works fine with Visual Studio 2022, since it installs the reference assemblies where they are needed.
[ issues! :( So basically I want to sort my array by their values. I would like the values to display in this order: Platinum, Gold, Silver, Bronze, Complete, None, Uncomplete. Now I can sort them well, but I would like to preserve their key (is that possible?). here is my code:
```
function co... | 2015/03/25 | [
"https://Stackoverflow.com/questions/29268013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4492877/"
] | Just use `uasort` intead of `usort`. Definition of `uasort` is
>
> Sort an array with a user-defined comparison function and maintain
> index association.
>
>
>
There is an example of code with your comparing function and uasort:
```
$list = array('post1' => 'Gold', 'post2' => 'None', 'post3' => 'Platinum');
... | `usort` did not preserve the key, if you want to preserve key after sort then you should use `asort`. Hope this help you. |
29,268,013 | I am having MAJOR usort() issues! :( So basically I want to sort my array by their values. I would like the values to display in this order: Platinum, Gold, Silver, Bronze, Complete, None, Uncomplete. Now I can sort them well, but I would like to preserve their key (is that possible?). here is my code:
```
function co... | 2015/03/25 | [
"https://Stackoverflow.com/questions/29268013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4492877/"
] | Just use `uasort` intead of `usort`. Definition of `uasort` is
>
> Sort an array with a user-defined comparison function and maintain
> index association.
>
>
>
There is an example of code with your comparing function and uasort:
```
$list = array('post1' => 'Gold', 'post2' => 'None', 'post3' => 'Platinum');
... | Considering these assumptions:
1. Your input array may contain values that are not unique (`Gold` may be the value for multiple posts).
2. You *know* (and can list) all of the potential values which will be used to sort the input array. (there will be no "outliers")
You can simplify your custom sort function by passi... |
29,268,013 | I am having MAJOR usort() issues! :( So basically I want to sort my array by their values. I would like the values to display in this order: Platinum, Gold, Silver, Bronze, Complete, None, Uncomplete. Now I can sort them well, but I would like to preserve their key (is that possible?). here is my code:
```
function co... | 2015/03/25 | [
"https://Stackoverflow.com/questions/29268013",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4492877/"
] | `usort` did not preserve the key, if you want to preserve key after sort then you should use `asort`. Hope this help you. | Considering these assumptions:
1. Your input array may contain values that are not unique (`Gold` may be the value for multiple posts).
2. You *know* (and can list) all of the potential values which will be used to sort the input array. (there will be no "outliers")
You can simplify your custom sort function by passi... |
8,314,823 | I have the following Linq-to-SQL query. On line #5 I'm trying to get the number of records from my Packages table where the conditions listed in my Where statement are satisfied. I think everything is correct in this code except for line #5. What did I do wrong?
```
var Overage = from s in db.Subscriptions
join p ... | 2011/11/29 | [
"https://Stackoverflow.com/questions/8314823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/549273/"
] | I prefer inheritance and events too :-) Try this:
```
class MyEntryElement : EntryElement {
public MyEntryElement (string c, string p, string v) : base (c, p, v)
{
MaxLength = -1;
}
public int MaxLength { get; set; }
static NSString cellKey = new NSString ("MyEntryElement");
pr... | MonoTouch.Dialog does not have this feature baked in by default. Your best bet is to copy and paste the code for that element and rename it something like LimitedEntryElement. Then implement your own version of UITextField (something like LimitedTextField) which overrides the ShouldChangeCharacters characters method. A... |
8,314,823 | I have the following Linq-to-SQL query. On line #5 I'm trying to get the number of records from my Packages table where the conditions listed in my Where statement are satisfied. I think everything is correct in this code except for line #5. What did I do wrong?
```
var Overage = from s in db.Subscriptions
join p ... | 2011/11/29 | [
"https://Stackoverflow.com/questions/8314823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/549273/"
] | MonoTouch.Dialog does not have this feature baked in by default. Your best bet is to copy and paste the code for that element and rename it something like LimitedEntryElement. Then implement your own version of UITextField (something like LimitedTextField) which overrides the ShouldChangeCharacters characters method. A... | I do this:
```
myTextView.ShouldChangeText += CheckTextViewLength;
```
And this method:
```
private bool CheckTextViewLength (UITextView textView, NSRange range, string text)
{
return textView.Text.Length + text.Length - range.Length <= MAX_LENGTH;
}
``` |
8,314,823 | I have the following Linq-to-SQL query. On line #5 I'm trying to get the number of records from my Packages table where the conditions listed in my Where statement are satisfied. I think everything is correct in this code except for line #5. What did I do wrong?
```
var Overage = from s in db.Subscriptions
join p ... | 2011/11/29 | [
"https://Stackoverflow.com/questions/8314823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/549273/"
] | MonoTouch.Dialog does not have this feature baked in by default. Your best bet is to copy and paste the code for that element and rename it something like LimitedEntryElement. Then implement your own version of UITextField (something like LimitedTextField) which overrides the ShouldChangeCharacters characters method. A... | I prefer like below because I just need to specify the number of characters for each case. In this sample I settled to 12 numbers.
```
this.edPhone.ShouldChangeCharacters = (UITextField t, NSRange range, string replacementText) => {
int newLength = t.Text.Length + replacementText.Length - range.Length;
return ... |
8,314,823 | I have the following Linq-to-SQL query. On line #5 I'm trying to get the number of records from my Packages table where the conditions listed in my Where statement are satisfied. I think everything is correct in this code except for line #5. What did I do wrong?
```
var Overage = from s in db.Subscriptions
join p ... | 2011/11/29 | [
"https://Stackoverflow.com/questions/8314823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/549273/"
] | I prefer inheritance and events too :-) Try this:
```
class MyEntryElement : EntryElement {
public MyEntryElement (string c, string p, string v) : base (c, p, v)
{
MaxLength = -1;
}
public int MaxLength { get; set; }
static NSString cellKey = new NSString ("MyEntryElement");
pr... | I do this:
```
myTextView.ShouldChangeText += CheckTextViewLength;
```
And this method:
```
private bool CheckTextViewLength (UITextView textView, NSRange range, string text)
{
return textView.Text.Length + text.Length - range.Length <= MAX_LENGTH;
}
``` |
8,314,823 | I have the following Linq-to-SQL query. On line #5 I'm trying to get the number of records from my Packages table where the conditions listed in my Where statement are satisfied. I think everything is correct in this code except for line #5. What did I do wrong?
```
var Overage = from s in db.Subscriptions
join p ... | 2011/11/29 | [
"https://Stackoverflow.com/questions/8314823",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/549273/"
] | I prefer inheritance and events too :-) Try this:
```
class MyEntryElement : EntryElement {
public MyEntryElement (string c, string p, string v) : base (c, p, v)
{
MaxLength = -1;
}
public int MaxLength { get; set; }
static NSString cellKey = new NSString ("MyEntryElement");
pr... | I prefer like below because I just need to specify the number of characters for each case. In this sample I settled to 12 numbers.
```
this.edPhone.ShouldChangeCharacters = (UITextField t, NSRange range, string replacementText) => {
int newLength = t.Text.Length + replacementText.Length - range.Length;
return ... |
46,341,399 | I have a web application that uses Apache Wicket. After the submitting of a form, I need to intercept the browser's back button, in order to redirect to the initial page, or to a expired page. How can I implement this? I try with
```
@Override
protected void setHeaders(WebResponse response) {
response.se... | 2017/09/21 | [
"https://Stackoverflow.com/questions/46341399",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7465987/"
] | Interesting question!
In the screenshot you've provided, the **Name** column is cut off, so I can't tell what resource is still being served from disk cache. I'll assume that it's a service worker script, based on the description in your "EDIT".
The question I'll answer, then, is "how does the browser cache service w... | In addition to the disable cache option, on the network pane of the developer tools you can now right click and choose "Clear Cache" from the popup menu.
Also, you can use this plugin if you need to clear the cache frequently:
<https://chrome.google.com/webstore/detail/jpfbieopdmepaolggioebjmedmclkbap> |
22,800,104 | Is it possible to extract properties of a `HTML tag` using Javascript.
For example, I want to know the values present inside with the `<div>` which has `align = "center"`.
```
<div align="center">Hello</div>
```
What I know is:
```
var division=document.querySelectorAll("div");
```
but it selects the elements bet... | 2014/04/02 | [
"https://Stackoverflow.com/questions/22800104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2045807/"
] | You are looking for the [getAttribute](https://developer.mozilla.org/en-US/docs/Web/API/Element.getAttribute) function. Which is accessible though the element.
You would use it like this.
```
var division = document.querySelectorAll('div')
for(var i=0,length=division.length;i < length;i++)
{
var element = divisio... | ```
var test = document.querySelectorAll('div[align="center"]');
``` |
55,911,955 | I try:
```
public interface I { abstract void F(); }
```
I get:
>
> The modifier 'abstract' is not valid for this item in C# 7.3. Please
> use language version 'preview' or greater.
>
>
>
However I can find no mention of this feature ie in <https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8>
... | 2019/04/29 | [
"https://Stackoverflow.com/questions/55911955",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/460084/"
] | C# 8.0 will allow modifiers and default implementations for interface members. You can see discussion [here](https://github.com/dotnet/csharplang/issues/288) and details [here](https://github.com/dotnet/csharplang/blob/master/proposals/default-interface-methods.md)
However, the `abstract` modifier in an interface meth... | Like the other answer it is legal from c#8.0.
But is there any benefit of having abstract methods in interface??
With recent improvements in the language, `abstract` function in interface can be considered as something which will not have default implementation.
Now the C# interfaces can have default implementation f... |
8,706,597 | I have a nice default-value check going and client wants to add additional functionality to the `onBlur` event. The default-value check is global and works fine. The new functionality requires some field-specific values be passed to the new function. If it weren't for this, I'd just tack it onto the default-check and b... | 2012/01/03 | [
"https://Stackoverflow.com/questions/8706597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/901426/"
] | Just store the custom variable in a [custom data attribute](http://ejohn.org/blog/html-5-data-attributes/). Not technically standards-compliant [in HTML 4], but it works:
```
<input type='text' id='field_01' value='default data' data-customvar="variableForThisField">
$(document.body).getElements('input[type=text],tex... | I think you're using Mootools? I don't quite recognize the syntax, but I created a JSFiddle and it seems to work with Mootools, and not other libraries.
Here's the fiddle I created to test it: <http://jsfiddle.net/NDTsz/>
Answer would appear to be **yes** - certainly in Chrome, but I believe in every browser. |
8,405,711 | I would like to load an image previously loaded using GDI+ into Direct X; is it possible? I know that I can save the image to disk and then load it using:
```
D3DXLoadSurfaceFromFile
```
But I would like to use
```
D3DXLoadSurfaceFromMemory
```
with the GDI+ image loaded in memory; the GDI+ image is a *GdiPlus*::... | 2011/12/06 | [
"https://Stackoverflow.com/questions/8405711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1007264/"
] | The problem is that WebBrowser has airspace concerns. You can't overlay content on top of a WebBrowser control.
For details, see the [WPF Interop page on Airspace](http://msdn.microsoft.com/en-us/library/aa970688%28v=vs.85%29.aspx). | Actually, you can add any content on top of a web browser. You need to place the content inside a Popup inside its own Canvas, like this:
```
<Canvas ClipToBounds="False">
<Popup AllowsTransparency="True" ClipToBounds="False" IsOpen="True">
<Rectangle x:Name="YourContent"/>
<Popup>
</Canvas>
```
You may ... |
30,265,728 | I have eliminated labels on the y axis because only the relative amount is really important.
```
w <- c(34170,24911,20323,14290,9605,7803,7113,6031,5140,4469)
plot(1:length(w), w, type="b", xlab="Number of clusters",
ylab="Within-cluster variance",
main="K=5 eliminates most of the within-cluster variance",
... | 2015/05/15 | [
"https://Stackoverflow.com/questions/30265728",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2573061/"
] | Try setting `ylab=""` in your `plot` call and use `title` to set the label of the y-axis manually. Using `line` you could adjust the position of the label, e.g.:
```
plot(1:length(w), w, type="b", xlab="Number of clusters", ylab="",
main="K=5 eliminates most of the within-cluster variance",
cex.main=1.5,
... | Adjust `mgp`, see `?par`
```
title(ylab="Within-cluster variance", mgp=c(1,1,0), family="Calibri Light",cex.lab=1.2)
```
 |
67,868,509 | When the user typing a text in Textformfield, **onChanged** callback is triggered per character and **onFieldSubmitted** callback is triggered if the user presses enter button after finish the typing. But, I want different behavior than onChanged and onFieldSubmitted.
(What I mean by **outside** in the following is ba... | 2021/06/07 | [
"https://Stackoverflow.com/questions/67868509",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12306259/"
] | As described on Media.Plugin:
>
> Xamarin.Essentials 1.6 introduced official support for picking/taking
> [photos and videos](https://learn.microsoft.com/xamarin/essentials/media-picker?WT.mc_id=friends-0000-jamont) with the new Media Picker API.
>
>
> | According to your description, if you want to limit selected photos numbers, I suggest you can check the numbers in OnActivityResult. I do one sample that you can take a look:
Firstly, create interface for the dependency service to open the gallery in .net standard project.
```
public interface IMediaService
{
Ta... |
563,340 | ```
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{mathtools}
\begin{document}
\renewcommand{\arraystretch}{1.2}
\newcommand{\minus}{\scalebox{0.4}[1.0]{$-$}}
\[
\begin{bmatrix*}[r]
0& \minus\frac{1}{2} &\frac{1}{2} \\
\minus\frac{1}{2}& 0&\minus\frac{1}{2}\\
\frac{1}{2}& \minus\fr... | 2020/09/19 | [
"https://tex.stackexchange.com/questions/563340",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/221248/"
] | I wouldn't reduce the size of the `0` numerals. If you believe that they look too big in relation to the text-style `\frac{1}{2}` expressions, maybe what's *really* needed is to replace the `\frac` terms with their decimal representations -- of course while aligning the numbers on their (explicit or implicit decimal ma... | I would say that your sample actually suggests the opposite: "I want to preserve regular size even for numerators and denominators". Use `\dfrac` instead of `\frac`.
Also, why do you have special treatment for minus? Why the `-` isn't enough?
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepa... |
563,340 | ```
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{mathtools}
\begin{document}
\renewcommand{\arraystretch}{1.2}
\newcommand{\minus}{\scalebox{0.4}[1.0]{$-$}}
\[
\begin{bmatrix*}[r]
0& \minus\frac{1}{2} &\frac{1}{2} \\
\minus\frac{1}{2}& 0&\minus\frac{1}{2}\\
\frac{1}{2}& \minus\fr... | 2020/09/19 | [
"https://tex.stackexchange.com/questions/563340",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/221248/"
] | I would second Mico's recommendation to not do this. But the solution would be to make the fractions display style rather than shrink the zeros (your example was likely set by naïve software which doesn't know how to properly resize fractions. Here's another alternative setting adapted from your MWE:
```
\documentclas... | I would say that your sample actually suggests the opposite: "I want to preserve regular size even for numerators and denominators". Use `\dfrac` instead of `\frac`.
Also, why do you have special treatment for minus? Why the `-` isn't enough?
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepa... |
563,340 | ```
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{mathtools}
\begin{document}
\renewcommand{\arraystretch}{1.2}
\newcommand{\minus}{\scalebox{0.4}[1.0]{$-$}}
\[
\begin{bmatrix*}[r]
0& \minus\frac{1}{2} &\frac{1}{2} \\
\minus\frac{1}{2}& 0&\minus\frac{1}{2}\\
\frac{1}{2}& \minus\fr... | 2020/09/19 | [
"https://tex.stackexchange.com/questions/563340",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/221248/"
] | The image which the OP posted looks like display style fractions `\dfrac` were used. As stated in my comment, shrinking the `0` in these situations is uncommon. Generally speaking, the various `Tex` engines and most trusted and well used packages have good typographic features by default.
```
\documentclass{article}
\... | I would say that your sample actually suggests the opposite: "I want to preserve regular size even for numerators and denominators". Use `\dfrac` instead of `\frac`.
Also, why do you have special treatment for minus? Why the `-` isn't enough?
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepa... |
563,340 | ```
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{mathtools}
\begin{document}
\renewcommand{\arraystretch}{1.2}
\newcommand{\minus}{\scalebox{0.4}[1.0]{$-$}}
\[
\begin{bmatrix*}[r]
0& \minus\frac{1}{2} &\frac{1}{2} \\
\minus\frac{1}{2}& 0&\minus\frac{1}{2}\\
\frac{1}{2}& \minus\fr... | 2020/09/19 | [
"https://tex.stackexchange.com/questions/563340",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/221248/"
] | A good solution, in my opinion, to reduce the size discrepancy between fractions (in text mode by default) and ordinary numbers is to use the medium-sized fractions from `nccmath`, which are ca 80 % of \displaystyle:
```
\documentclass{article}
\usepackage{nccmath, mathtools} % for 'bmatrix*' env.
\usepackage{makecell... | I would say that your sample actually suggests the opposite: "I want to preserve regular size even for numerators and denominators". Use `\dfrac` instead of `\frac`.
Also, why do you have special treatment for minus? Why the `-` isn't enough?
```
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepa... |
144,739 | Is it possible to install/register another local server instance in any SqlServer version, besides the default local instance, where only one SqlServer version is installed? | 2008/09/27 | [
"https://Stackoverflow.com/questions/144739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23087/"
] | Yes, it's possible. I have several combinations in my servers. I have one server that has both SQL Server 2000 and 2005 installed side by side. My desktop at work is a Windows 2003 Server, and I have SQL Server 2005 and 2008 installed side by side.
What you want is called a named instance. There will be a screen durin... | Yes. Usually the installer will detect that you have one or more existing instances and will prompt you for a instance name. We have setup three SQL Server 2000 standard editions on a development box to emulate the three production servers at one of our clients. |
19,343 | I'm trying to define a Display Suite Code Field which would be responsible for converting a list item key (selected in a dropdown on admin side) into an image on the output side. The field simply assumes the list keys:
```
series1|Series 1 Name
series2|Series 2 Name
```
correspond to the images names and the tokeniz... | 2012/01/10 | [
"https://drupal.stackexchange.com/questions/19343",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1691/"
] | "Promoted to front page" can be used as a views filter. So you could create views based on that (so it displays node teasers that have a certain taxonomy and are "Promoted to front page").
Another simple way to mimic "Promoted to front page" is to add a taxonomy select field to your content types, and then the taxonom... | Alternative to mtro's answer (which is correct), I find it also useful to use the "flags" module. <http://drupal.org/project/flag>
Create a flag like "promote to sub-page" then create a "sub-page" view which selects nodes with that flag. |
19,343 | I'm trying to define a Display Suite Code Field which would be responsible for converting a list item key (selected in a dropdown on admin side) into an image on the output side. The field simply assumes the list keys:
```
series1|Series 1 Name
series2|Series 2 Name
```
correspond to the images names and the tokeniz... | 2012/01/10 | [
"https://drupal.stackexchange.com/questions/19343",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1691/"
] | "Promoted to front page" can be used as a views filter. So you could create views based on that (so it displays node teasers that have a certain taxonomy and are "Promoted to front page").
Another simple way to mimic "Promoted to front page" is to add a taxonomy select field to your content types, and then the taxonom... | Besides, you can also use [Rules](http://drupal.org/project/rules) module.
With Rules, you can specify the condition and action on a node is prompted to front. |
19,343 | I'm trying to define a Display Suite Code Field which would be responsible for converting a list item key (selected in a dropdown on admin side) into an image on the output side. The field simply assumes the list keys:
```
series1|Series 1 Name
series2|Series 2 Name
```
correspond to the images names and the tokeniz... | 2012/01/10 | [
"https://drupal.stackexchange.com/questions/19343",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1691/"
] | "Promoted to front page" can be used as a views filter. So you could create views based on that (so it displays node teasers that have a certain taxonomy and are "Promoted to front page").
Another simple way to mimic "Promoted to front page" is to add a taxonomy select field to your content types, and then the taxonom... | you could also use a Boolean field as a simple checkbox and then filter Views on that. |
19,343 | I'm trying to define a Display Suite Code Field which would be responsible for converting a list item key (selected in a dropdown on admin side) into an image on the output side. The field simply assumes the list keys:
```
series1|Series 1 Name
series2|Series 2 Name
```
correspond to the images names and the tokeniz... | 2012/01/10 | [
"https://drupal.stackexchange.com/questions/19343",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1691/"
] | Alternative to mtro's answer (which is correct), I find it also useful to use the "flags" module. <http://drupal.org/project/flag>
Create a flag like "promote to sub-page" then create a "sub-page" view which selects nodes with that flag. | Besides, you can also use [Rules](http://drupal.org/project/rules) module.
With Rules, you can specify the condition and action on a node is prompted to front. |
19,343 | I'm trying to define a Display Suite Code Field which would be responsible for converting a list item key (selected in a dropdown on admin side) into an image on the output side. The field simply assumes the list keys:
```
series1|Series 1 Name
series2|Series 2 Name
```
correspond to the images names and the tokeniz... | 2012/01/10 | [
"https://drupal.stackexchange.com/questions/19343",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1691/"
] | Alternative to mtro's answer (which is correct), I find it also useful to use the "flags" module. <http://drupal.org/project/flag>
Create a flag like "promote to sub-page" then create a "sub-page" view which selects nodes with that flag. | you could also use a Boolean field as a simple checkbox and then filter Views on that. |
19,343 | I'm trying to define a Display Suite Code Field which would be responsible for converting a list item key (selected in a dropdown on admin side) into an image on the output side. The field simply assumes the list keys:
```
series1|Series 1 Name
series2|Series 2 Name
```
correspond to the images names and the tokeniz... | 2012/01/10 | [
"https://drupal.stackexchange.com/questions/19343",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/1691/"
] | Besides, you can also use [Rules](http://drupal.org/project/rules) module.
With Rules, you can specify the condition and action on a node is prompted to front. | you could also use a Boolean field as a simple checkbox and then filter Views on that. |
43,633,263 | I have a Spring boot project that uses spring-kafka. In this project I've built some event driven components that wrap spring-kafka beans (namely KafkaTemplate and ConcurrentKafkaListenerContainer). I want to make this project a reusable library accross a set of Spring boot applications. But when I add dependency to th... | 2017/04/26 | [
"https://Stackoverflow.com/questions/43633263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3484517/"
] | Im found work around to solve this problem by creating AutowireHelper.java and AutowireHelperConfig.java
Put it under spring config folder > util
>
> AutowireHelper.java
>
>
>
```
package com.yourcompany.yourapplicationname.config.util;
import org.springframework.context.ApplicationContext;
import org.springfra... | You must annotate CsvService class with some Spring component (example @Service).
```
@Service
public class CsvService {
//Code Here
}
```
And
```
public class QueWorker implements MessageListener {
@Autowired
private CsvService csvService;
}
```
If you have already done that and still it does not wo... |
8,495,507 | When I draw lines in my program the position is perfect, but when I use those same coordinates for a square or oval they are way off the mark. My code is:
```
g2d.drawRect(one1, one2, two1, two2);
g2d.drawOval(one1, one2, two1, two2);
```
And the points are gather by:
```
one1 = (int)e.getX();
one2 = (int)e.getY();... | 2011/12/13 | [
"https://Stackoverflow.com/questions/8495507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/639627/"
] | Alright, I got what your problem is. If you see the below image, the way that the parameters taken by oval and sqaure are different from the line.
To draw a line --> You will have to specify the starting point and the ending point. Just passing them directly to the Graphics object would do the job for you. However for... | My guess is that you're capturing the X & Y coordinates for a container (say 200,200) then creating the oval/rect within a NEW container; you state a JLabel above in your comment.
If you're capturing X & Y to be 200,200 for a JPanel, then creating a JLabel and assigning the component an X/Y of 200,200 it is the coordi... |
8,495,507 | When I draw lines in my program the position is perfect, but when I use those same coordinates for a square or oval they are way off the mark. My code is:
```
g2d.drawRect(one1, one2, two1, two2);
g2d.drawOval(one1, one2, two1, two2);
```
And the points are gather by:
```
one1 = (int)e.getX();
one2 = (int)e.getY();... | 2011/12/13 | [
"https://Stackoverflow.com/questions/8495507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/639627/"
] | I think I understand what your issue is. You are having the user click in two different spots on the canvas and then you want to draw a rectangle/oval using those points. So if the user clicks at 10,10 and then clicks at 20,20, then you want a rectangle whose top left corner is at 10,10 and whose bottom right corner is... | My guess is that you're capturing the X & Y coordinates for a container (say 200,200) then creating the oval/rect within a NEW container; you state a JLabel above in your comment.
If you're capturing X & Y to be 200,200 for a JPanel, then creating a JLabel and assigning the component an X/Y of 200,200 it is the coordi... |
8,495,507 | When I draw lines in my program the position is perfect, but when I use those same coordinates for a square or oval they are way off the mark. My code is:
```
g2d.drawRect(one1, one2, two1, two2);
g2d.drawOval(one1, one2, two1, two2);
```
And the points are gather by:
```
one1 = (int)e.getX();
one2 = (int)e.getY();... | 2011/12/13 | [
"https://Stackoverflow.com/questions/8495507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/639627/"
] | Alright, I got what your problem is. If you see the below image, the way that the parameters taken by oval and sqaure are different from the line.
To draw a line --> You will have to specify the starting point and the ending point. Just passing them directly to the Graphics object would do the job for you. However for... | I think I understand what your issue is. You are having the user click in two different spots on the canvas and then you want to draw a rectangle/oval using those points. So if the user clicks at 10,10 and then clicks at 20,20, then you want a rectangle whose top left corner is at 10,10 and whose bottom right corner is... |
31,164,883 | I want to click on a checkbox and if I click this box it should run a function what gets an ID and saves it into an array or deletes it from the array if it still exists in the array.
That works, but if I click on the text beside the box the function runs twice. It first writes the ID into the array and then deletes i... | 2015/07/01 | [
"https://Stackoverflow.com/questions/31164883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5068532/"
] | Looks like the AWS Node JS has a bug, in that we need not mention the data type for the keys.
I tried this and it worked well
```
{
"RequestItems":{
"<TableName>":{
"Keys":[
{"<HashKeyName>":"<HashKeyValue1>", "<RangeKeyName>":"<RangeKeyValue2>"},
{"<HashKeyName>":"<HashKeyValue2>", "<RangeKey... | You get this error when the schema of your table does not match the key schema of the keys you provided. You provided a key with Hash=String and Range=String. What is the schema of your table? You can use the [DescribeTable](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html) API to ge... |
30,311,640 | The error message of gcc 4.9.2 is:
```
could not convert from '<brace-enclosed initializer list>' to 'std::vector<std::pair<float, float> >'
```
of this code:
```
vector<pair<GLfloat, GLfloat>> LightOneColorsPairVec {{0.5f, 0.5f, 0.5f, 1.0f}, {0.0f, 0.0f, 1.0f, 1.0f}};
```
The code is compiled with 'std=c++11' co... | 2015/05/18 | [
"https://Stackoverflow.com/questions/30311640",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3163389/"
] | First of all because [`std::pair`](http://en.cppreference.com/w/cpp/utility/pair) doesn't have [constructor](http://en.cppreference.com/w/cpp/utility/pair/pair) that takes a [`std::initializer_list`](http://en.cppreference.com/w/cpp/utility/initializer_list). Secondly because `std::pair` is a *pair*, it only have two v... | As Joachim Pileborg pointed out pairs are not similar to vectors, so I converted the code to this:
```
vector<vector<vector<GLfloat>>> LightColorsVec {{{0.5f, 0.5f, 0.5f, 1.0f}, {0.0f, 0.0f, 1.0f, 1.0f}}};
```
And it works for multiple light sources now. |
40,349,778 | I hava a list of sings:
```
var sings = [",",".",":","!","?"]
```
How do I check if a word contains one of these signs and return it?
For example:
```
"But,"
return ","
"Finished."
return "."
"Questions?"
return "?"
``` | 2016/10/31 | [
"https://Stackoverflow.com/questions/40349778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583481/"
] | Here is example function
```
var checkSigns = function(str) {
var signs = [",",".",":","!","?"];
for (var i = 0; i < signs.length; i++) {
if (str.indexOf[signs[i]] !== -1) {
return signs[i];
}
}
};
``` | You can use `filter()` and `indexOf()` and return array of signs that are found in string.
```js
var signs = [",",".",":","!","?"];
function check(str, arr) {
return arr.filter(function(e) {
return str.indexOf(e) != -1
})
}
console.log(check("But,", signs))
console.log(check("Finished.", signs))
``` |
40,349,778 | I hava a list of sings:
```
var sings = [",",".",":","!","?"]
```
How do I check if a word contains one of these signs and return it?
For example:
```
"But,"
return ","
"Finished."
return "."
"Questions?"
return "?"
``` | 2016/10/31 | [
"https://Stackoverflow.com/questions/40349778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583481/"
] | You could solve that with a regular expression:
```js
function match(input) {
var regex = /([,\.\:!\?])/;
var matches = input.match(regex);
return matches ? matches[0] : false;
}
console.log(match("foo?")); // "?"
console.log(match("bar.")); // "."
console.log(match("foobar")); // false
``` | Here is example function
```
var checkSigns = function(str) {
var signs = [",",".",":","!","?"];
for (var i = 0; i < signs.length; i++) {
if (str.indexOf[signs[i]] !== -1) {
return signs[i];
}
}
};
``` |
40,349,778 | I hava a list of sings:
```
var sings = [",",".",":","!","?"]
```
How do I check if a word contains one of these signs and return it?
For example:
```
"But,"
return ","
"Finished."
return "."
"Questions?"
return "?"
``` | 2016/10/31 | [
"https://Stackoverflow.com/questions/40349778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583481/"
] | Here is example function
```
var checkSigns = function(str) {
var signs = [",",".",":","!","?"];
for (var i = 0; i < signs.length; i++) {
if (str.indexOf[signs[i]] !== -1) {
return signs[i];
}
}
};
``` | Try this prototype `str.hasSign();` return `sign` if contains or `false` if not.
```js
String.prototype.hasSigns = function() {
var signs = [",", ".", ":", "!", "?"];
for (var i = 0; i < signs.length; i++) {
if (this.indexOf(signs[i]) > -1) return signs[i];
}
return false;
}
console.log("football, ... |
40,349,778 | I hava a list of sings:
```
var sings = [",",".",":","!","?"]
```
How do I check if a word contains one of these signs and return it?
For example:
```
"But,"
return ","
"Finished."
return "."
"Questions?"
return "?"
``` | 2016/10/31 | [
"https://Stackoverflow.com/questions/40349778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583481/"
] | You could solve that with a regular expression:
```js
function match(input) {
var regex = /([,\.\:!\?])/;
var matches = input.match(regex);
return matches ? matches[0] : false;
}
console.log(match("foo?")); // "?"
console.log(match("bar.")); // "."
console.log(match("foobar")); // false
``` | You can use `filter()` and `indexOf()` and return array of signs that are found in string.
```js
var signs = [",",".",":","!","?"];
function check(str, arr) {
return arr.filter(function(e) {
return str.indexOf(e) != -1
})
}
console.log(check("But,", signs))
console.log(check("Finished.", signs))
``` |
40,349,778 | I hava a list of sings:
```
var sings = [",",".",":","!","?"]
```
How do I check if a word contains one of these signs and return it?
For example:
```
"But,"
return ","
"Finished."
return "."
"Questions?"
return "?"
``` | 2016/10/31 | [
"https://Stackoverflow.com/questions/40349778",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1583481/"
] | You could solve that with a regular expression:
```js
function match(input) {
var regex = /([,\.\:!\?])/;
var matches = input.match(regex);
return matches ? matches[0] : false;
}
console.log(match("foo?")); // "?"
console.log(match("bar.")); // "."
console.log(match("foobar")); // false
``` | Try this prototype `str.hasSign();` return `sign` if contains or `false` if not.
```js
String.prototype.hasSigns = function() {
var signs = [",", ".", ":", "!", "?"];
for (var i = 0; i < signs.length; i++) {
if (this.indexOf(signs[i]) > -1) return signs[i];
}
return false;
}
console.log("football, ... |
891,714 | We have application which is using some additional files from one catalog. Right now when some of this file is changed we need to log in to each application container clone repository and copy files to catalog. We want to automate this process without rebuilding/restarting whole application.
Is there some native appro... | 2018/01/11 | [
"https://serverfault.com/questions/891714",
"https://serverfault.com",
"https://serverfault.com/users/278626/"
] | Have a look at PersistentVolume [Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) matrix. What you are looking for is either ROX or RWX support. ROX is more common but you'll need some side process to update the content. RWX give you full access to change content on these volu... | It looks like you have already found a solution by making use of NFS mounted volume. There are a number of other volume options available for those who read this seeking a similar solution.
If you only need pods on a single node to be able to access a volume, the the options for Access Mode 'ReadWriteOnce' in this [ta... |
1,532,937 | I know this is a pretty simple question, but I'm just not getting the textbook... I'm taking a basic CS course and on one of the problems (not an assigned homework problem, just one I'm practicing on), it says that
>
> on the set of all integers, the relation $x \ne$ y is symmetric but not transitive where $(x,y) \i... | 2015/11/17 | [
"https://math.stackexchange.com/questions/1532937",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/264450/"
] | Let $f(x)=x^p$
By convexity $$f(\frac{X+Y}{2})\leq \frac{1}{2} f(X)+\frac{1}{2} f(Y) \implies \frac{(X+Y)^p}{2^p}\leq\frac{1}{2} X^p+\frac{1}{2}Y^p$$
The result follows. | If $p>1$, then by Holder inequality,
\begin{align\*}
X+Y &\le (X^p+Y^p)^{\frac{1}{p}} 2^{1-\frac{1}{p}}.
\end{align\*}
That is,
\begin{align\*}
(X+Y)^p \le 2^{p-1} (X^p+Y^p).
\end{align\*}
For $0 \le p \le 1$, we note that
\begin{align\*}
\left(\frac{X}{X+Y} \right)^p + \left(\frac{Y}{X+Y} \right)^p \ge \frac{X}{X+Y}+ ... |
104,851 | We started learning about electromagnetism in physics class, and the Right Hand Rule comes in handy as seems easy to use, but I'm curious as to how it actually works. I guess it's more of a math question since I think it just involves solving the cross product of the velocity of the charge and the magnetic field. I don... | 2014/03/23 | [
"https://physics.stackexchange.com/questions/104851",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/41058/"
] | The formula for the force of a particle due to its magnetic field is $F = q \vec v \times \vec B$. The cross product has the property that its result is always perpendicular to both arguments.
Its direction is simply a result of how the cross product function is defined and the sign of electric charge (an electron is ... | Look at the diagram below,

Two vectors $B$ ***(Magnetic field vector )*** and $v$ ***( velocity vector of a proton )*** shown in the diagram are perpendicular to each other. Here, I have considered the simplest case where the two vectors are perpend... |
104,851 | We started learning about electromagnetism in physics class, and the Right Hand Rule comes in handy as seems easy to use, but I'm curious as to how it actually works. I guess it's more of a math question since I think it just involves solving the cross product of the velocity of the charge and the magnetic field. I don... | 2014/03/23 | [
"https://physics.stackexchange.com/questions/104851",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/41058/"
] | The formula for the force of a particle due to its magnetic field is $F = q \vec v \times \vec B$. The cross product has the property that its result is always perpendicular to both arguments.
Its direction is simply a result of how the cross product function is defined and the sign of electric charge (an electron is ... | The cross product does not have a specific direction, but either the left hand rule or right hand rule works, but it has to be applied consistantly. That's the key. So you simply drum in one rule in everywhere.
It's kind of like driving to the left or to the right. Either works, but you have to be consistant about it... |
104,851 | We started learning about electromagnetism in physics class, and the Right Hand Rule comes in handy as seems easy to use, but I'm curious as to how it actually works. I guess it's more of a math question since I think it just involves solving the cross product of the velocity of the charge and the magnetic field. I don... | 2014/03/23 | [
"https://physics.stackexchange.com/questions/104851",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/41058/"
] | The formula for the force of a particle due to its magnetic field is $F = q \vec v \times \vec B$. The cross product has the property that its result is always perpendicular to both arguments.
Its direction is simply a result of how the cross product function is defined and the sign of electric charge (an electron is ... | The right hand rule is simply a mathematical convention. We use right handed coordinate systems. We could make the left hand rule true if we wanted to, but we would need to adapt our equations to the new convention. |
16,810,876 | I have an Iphone application in which I had 10 tab items in the tab bar.
I don't want to add the more button behaviour of the tab bar here.
Instead of that **I need to make my tab bar as scrollable**.
Can anybody had the idea or links to illustrate this?
Can anybody guide me in the right direction? | 2013/05/29 | [
"https://Stackoverflow.com/questions/16810876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/834925/"
] | But You can not use the `UITabbar`. You need to create custom `UITabbar` that behave the same.
Here are links of some projects will help you more.
1. [Infinte Tab Bar](https://www.cocoacontrols.com/controls/infinitabbar)
2. [Scrollable Tab Bar](https://github.com/jasarien/JSScrollableTabBar) | Have you tried looking here?
[How to make a horizontal scrollable UITabBar in iOS?](https://stackoverflow.com/questions/8482661/how-to-make-a-horizontal-scrollable-uitabbar-in-ios)
Although, and this is the reason im not writing a comment, i would not use a scrollview, as described in the accepted answer. Instead, i w... |
16,810,876 | I have an Iphone application in which I had 10 tab items in the tab bar.
I don't want to add the more button behaviour of the tab bar here.
Instead of that **I need to make my tab bar as scrollable**.
Can anybody had the idea or links to illustrate this?
Can anybody guide me in the right direction? | 2013/05/29 | [
"https://Stackoverflow.com/questions/16810876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/834925/"
] | But You can not use the `UITabbar`. You need to create custom `UITabbar` that behave the same.
Here are links of some projects will help you more.
1. [Infinte Tab Bar](https://www.cocoacontrols.com/controls/infinitabbar)
2. [Scrollable Tab Bar](https://github.com/jasarien/JSScrollableTabBar) | 1) define `UIScrollview *scrollview`
2) drag and drop scroll view
3) connect instance and delegate in xib
4) set frame of scrollview more so it is scrollable and more than view size
5) add uitabbar as subview to scrollview
```
[uitabar instance addsubview:scrollview];
``` |
13,155,318 | Can somebody please suggest me when would I need a Level-Order Traversal (to solve some practical/real-life scenario)? | 2012/10/31 | [
"https://Stackoverflow.com/questions/13155318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | [Level order traversal](http://en.wikipedia.org/wiki/Tree_traversal#Queue-based_level_order_traversal) is actually a Breadth First Search, which is not recursive by nature.
From: <http://en.wikipedia.org/wiki/Breadth-first_search>
Breadth-first search can be used to solve many problems in graph theory, for example:
... | Google Map Direction is using Level Order Traversal (BFS) all the time.
Algorithms repeat the same method choosing the node nearest to the intersection points, eventually selecting the route with the shortest length.
<http://blog.hackerearth.com/breadth-first-search-algorithm-example-working-of-gps-navigation> |
275,272 | If I build a module with a indexer, is Magento going to run the reindex automatically each night or do I need to create a cronjob for it? | 2019/05/20 | [
"https://magento.stackexchange.com/questions/275272",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/40598/"
] | If you want the reindex happen automatically, you need to set a cronjob for that. Please refer [here](https://magento.stackexchange.com/questions/269624/how-to-check-whether-the-reindex-working-or-not-in-magento) for detailed explanations: | Automatic re-indexing always require a active Cronjob |
528,999 | I have two servers in a pool with Nginx, PHP5-FPM and Memcached. For some reason, the first server in the pool seems to inexplicably lose about 2GB of RAM. I can't explain where it's going.
A reboot gets everything back to normal, but after a few hours the RAM is used again.
At first I thought it was down to memcach... | 2013/08/06 | [
"https://serverfault.com/questions/528999",
"https://serverfault.com",
"https://serverfault.com/users/123168/"
] | The machine is a virtual guest running on **ESXi** hypervisor. What about **memory ballooning**? First of all, I would recommend you to check ESXi/vCenter memory/balloon statistics of this guest.
It can happen that the hypervisor asked the guest to "inflate" the balloon in order to allocate some additional memory, e.... | The watch command may be useful. Try watch -n 5 free to monitor memory usage with updates every five seconds.
Also
htop is the best solution.
```
sudo apt-get install htop
```
This way you will notice what programs is using most RAM. and you can easily terminate one if you want to. |
40,128,449 | Hi I remove my ssl cert from my website. I fixed the database from showing HTTPS and remove the necessary lines from htaccess file . but for now - anyone how trying to enter to my wordpress website get an error message (because the ssl...) How can I forward the user from HTTPS TO HTTP?
htaccess below:
```
text/x-gene... | 2016/10/19 | [
"https://Stackoverflow.com/questions/40128449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7041592/"
] | It is a bad practice to use NSDictionary for storing data. Create new class for section (i.e. SectionData) and row (i.e. RowData). Your ViewController (or some other data provider) will keep array of SectionData, where SectionData keeps array of RowData. RowData may contain func for handling row selection, so in didSel... | I think this talk is broader than what you are seeking but he talks about it.
<https://realm.io/news/altconf-benji-encz-uikit-inside-out-declarative-programming/> |
40,128,449 | Hi I remove my ssl cert from my website. I fixed the database from showing HTTPS and remove the necessary lines from htaccess file . but for now - anyone how trying to enter to my wordpress website get an error message (because the ssl...) How can I forward the user from HTTPS TO HTTP?
htaccess below:
```
text/x-gene... | 2016/10/19 | [
"https://Stackoverflow.com/questions/40128449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7041592/"
] | An approach I use when creating a table where I know all the possible sections is with enums. You create an enum for each of the possible section types:
`enum SectionTypes { case sectionA, sectionB, sectionC }`
And then create a variable to hold the sections:
`var sections: [SectionTypes]`
When you have your data... | It is a bad practice to use NSDictionary for storing data. Create new class for section (i.e. SectionData) and row (i.e. RowData). Your ViewController (or some other data provider) will keep array of SectionData, where SectionData keeps array of RowData. RowData may contain func for handling row selection, so in didSel... |
40,128,449 | Hi I remove my ssl cert from my website. I fixed the database from showing HTTPS and remove the necessary lines from htaccess file . but for now - anyone how trying to enter to my wordpress website get an error message (because the ssl...) How can I forward the user from HTTPS TO HTTP?
htaccess below:
```
text/x-gene... | 2016/10/19 | [
"https://Stackoverflow.com/questions/40128449",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7041592/"
] | An approach I use when creating a table where I know all the possible sections is with enums. You create an enum for each of the possible section types:
`enum SectionTypes { case sectionA, sectionB, sectionC }`
And then create a variable to hold the sections:
`var sections: [SectionTypes]`
When you have your data... | I think this talk is broader than what you are seeking but he talks about it.
<https://realm.io/news/altconf-benji-encz-uikit-inside-out-declarative-programming/> |
11,460,673 | Bellow is a PHP script.
I tried to implement the Observer pattern (without MVC structure)... only basic.
The error which is encountered has been specified in a comment.
First I tried to add User objects to the UsersLibrary repository. There was a error such as User::update() does not exists or something.
Why is that... | 2012/07/12 | [
"https://Stackoverflow.com/questions/11460673",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1393475/"
] | Your `User` class is not implementing `interface IObserver` and therefore is not forced to have the method `update()`.
You have to instantiate a `new User()` in order to add it to the `UsersLibrary`:
```
$library = new UsersLibrary();
$user = new User(1, "Demo");
$library->add($user);
```
Also, you are mixing **Use... | You are passing a string instead of an object in your `$a->add()` call. You should either pass in an object, or alter the code in UserLibrary::add() to wrap it's argument in an appropriate object (or do an object lookup of it sees a string, for instance find a user with that name).
```
$user = new User(1, "Demo");
$a ... |
35,336,711 | I have this array of objects.
```
[ { geom: '{"type":"Point","coordinates":[-3.81086160022019,50.4619066354793]}' },
{ geom: '{"type":"Point","coordinates":[-4.038333333,51.17166667]}' },
{ geom: '{"type":"Point","coordinates":[-4.286666667,50.99666667]}' },
{ geom: '{"type":"Point","coordinates":[-4.006666667,5... | 2016/02/11 | [
"https://Stackoverflow.com/questions/35336711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3346163/"
] | You can do this without `underscore` as well. You just have to loop over array and return `currentObj.geom`. Also, `currentObj.geom` is a string, so you would need `JSON.parse`
```js
var a = [ { geom: '{"type":"Point","coordinates":[-3.81086160022019,50.4619066354793]}' },
{ geom: '{"type":"Point","coordinates":[-4... | As **@Rajesh** stated, there is no need for underscore here, but if you really want to use it then can just do:-
```
var data = [ { geom: '{"type":"Point","coordinates":[-3.81086160022019,50.4619066354793]}' },
{ geom: '{"type":"Point","coordinates":[-4.038333333,51.17166667]}' },
{ geom: '{"... |
1,465,880 | This is quoted from Feynman's lectures [The Dependence of Amplitudes on Position](http://www.feynmanlectures.caltech.edu/III_16.html)
:
>
> In Chapter 13 we then proposed that the amplitudes $C(x\_n)$ should vary with time in a way described by the Hamiltonian equation. In our new notation this equation is
> $$iℏ\fr... | 2015/10/05 | [
"https://math.stackexchange.com/questions/1465880",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | HINT:
[Taylor's Theorem](https://en.wikipedia.org/wiki/Taylor%27s_theorem#Statement_of_the_theorem) with the Peano form of the remainder is
$$C(x\pm b)=C(x)\pm C'(x)b+\frac12 C''(x)b^2+h(x;b)b^2 \tag 1$$
where $\lim\_{b\to 0}h(x;b)=0$.
Now, add the positve and negative terms in $(1)$ and see what happens. | It can be easily proved via L'Hospital's Rule that $$\lim\_{b \to 0}\frac{C(a + b) + C(a - b) - 2C(a)}{b^{2}} = C''(a)\tag{1}$$ provided that the second derivative $C''(a)$ exists. Hence we can write $$\frac{C(a + b) + C(a - b) - 2C(a)}{b^{2}} \approx C''(a)\tag{2}$$ when $b$ is small. This is same as writing $$2C(x) -... |
1,465,880 | This is quoted from Feynman's lectures [The Dependence of Amplitudes on Position](http://www.feynmanlectures.caltech.edu/III_16.html)
:
>
> In Chapter 13 we then proposed that the amplitudes $C(x\_n)$ should vary with time in a way described by the Hamiltonian equation. In our new notation this equation is
> $$iℏ\fr... | 2015/10/05 | [
"https://math.stackexchange.com/questions/1465880",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/-1/"
] | Let's Taylor expand the $C$ terms to second order about $x$:
$$ C(x) = C(x) $$
So far so good...
$$ C(x+b) = C(x)+\frac{\partial C}{\partial x}(x) b + \frac{1}{2}\frac{\partial^2 C}{\partial x^2}(x)b^2 + o(b^2) $$
(I'm not a fan of this notation, but there's not really another way to make it consistent with Feynman's d... | It can be easily proved via L'Hospital's Rule that $$\lim\_{b \to 0}\frac{C(a + b) + C(a - b) - 2C(a)}{b^{2}} = C''(a)\tag{1}$$ provided that the second derivative $C''(a)$ exists. Hence we can write $$\frac{C(a + b) + C(a - b) - 2C(a)}{b^{2}} \approx C''(a)\tag{2}$$ when $b$ is small. This is same as writing $$2C(x) -... |
52,521,159 | I tried to adapt the 2d platformer character controller from this live session: <https://www.youtube.com/watch?v=wGI2e3Dzk_w&list=PLX2vGYjWbI0SUWwVPCERK88Qw8hpjEGd8>
Into a 2d top down character controller. It seemed to work but it is possible to move into colliders with some combination of keys pressed that I couldn'... | 2018/09/26 | [
"https://Stackoverflow.com/questions/52521159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10419464/"
] | simplifying, unity checks for collision each frame in a synchronized way (for the sake of frame drop compensation), if your object is moving fast (covering a great distance in a short time), there's a chance of your object pass through a wall in that exactly time gap of a collision check and another.
as well stated and... | As Matheus suggested I changed the colliders mode to continuous, however the problem still happens. I found a way to make it happen for sure.
To make this work I removed line 38 of PhysicsObject2D.cs:
**targetVelocity = -targetVelocity \* 5;**
[See this image](https://i.stack.imgur.com/W1inZ.png)
In this position, ... |
52,521,159 | I tried to adapt the 2d platformer character controller from this live session: <https://www.youtube.com/watch?v=wGI2e3Dzk_w&list=PLX2vGYjWbI0SUWwVPCERK88Qw8hpjEGd8>
Into a 2d top down character controller. It seemed to work but it is possible to move into colliders with some combination of keys pressed that I couldn'... | 2018/09/26 | [
"https://Stackoverflow.com/questions/52521159",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10419464/"
] | 1) Set Collision Detection Mode to "Continuous" for important entities like the player.
2) Use `rb2d.MovePosition();` for movement.
3) Don't call `rb2d.MovePosition()` more than once in a frame.
these 3 combined should make your movement and collision detection work fine.
I wont question the rest of your code, but ... | As Matheus suggested I changed the colliders mode to continuous, however the problem still happens. I found a way to make it happen for sure.
To make this work I removed line 38 of PhysicsObject2D.cs:
**targetVelocity = -targetVelocity \* 5;**
[See this image](https://i.stack.imgur.com/W1inZ.png)
In this position, ... |
34,633,844 | I need to create a XAML `textbox` immediately after another `textbox` using code-behind. Maybe something like this:
Before
```
<StackPanel>
<TextBox Name="TextBox1"/>
<TextBox Name="TextBox2"/>
<TextBox Name="TextBox3"/>
</StackPanel>
```
After
```
<StackPanel>
<TextBox Name="TextBox1"/>
<TextB... | 2016/01/06 | [
"https://Stackoverflow.com/questions/34633844",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5719584/"
] | You need to name the `StackPanel` to reference it in code, and you need the index of the preceding `TextBox`:
```
var index = this.stackPanel1.Children.IndexOf(TextBox2);
this.stackPanel1.Children.Insert(index + 1, new TextBox { Name = "InsertedTextBox" });
``` | You could try this, note I've given the `StackPanel` a name.
```
// Where 2 is the index.
this.StackPanel1.Children.Insert(2, new TextBox());
``` |
17,266,818 | Trying to split the `http://` from `http://url.com/xxyjz.jpg` with the following:
```
var imgUrl = val['url'].split(/(^http:\/\/)/);
```
And, even though I can get my desired result with the code above, I get some extra parameters that I would like not to have.
Output:
>
> ["", "http://", "url.com/xxyjz.jpg"]
> ... | 2013/06/24 | [
"https://Stackoverflow.com/questions/17266818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/971392/"
] | You could use `match` instead of `split`:
```
var matches = str.match(/(http:\/\/)(.*)/).slice(1);
```
That will give you the array you want. | you can just reference the index:
```
var a=str.match(/http:\/\/(.*)/)[1]
``` |
433,810 | I have trouble displaying an abbreviation nicely.
Removing largesmallcaps is a small improvement, but looks really bad in full document. I want normal numbers in the rest of the document.
How can I make the zero appear the correct size and differentiate it nicely from the O?
MWE:
```
\documentclass{article}
\usepac... | 2018/05/28 | [
"https://tex.stackexchange.com/questions/433810",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/81219/"
] | This can be achieved by combining `multirow` from the eponymous package with `rotatebox` from the `graphicx` package as follows:
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{multirow}
\begin{document}
\begin{table}[!ht]
\centering
\begin{tabular}{llll... | I propose this variant, with `intersecting` horizontal and a (`thicker`) vertical rules, an adjustment of the position of the vertical text, and some padding of rows:
```
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[svgnames, table]{xcolor}
\usepackage{booktabs}
\usepackage{rotating}
\usepackage{mul... |
13,074,250 | I am trying to display the correct button and link depending on what device the user browses to a page on. If android display android app store button if ios display apple store button.
I cannot seem to get it to swap at all even though im making the function default to swap it from android to apple button.
Here is t... | 2012/10/25 | [
"https://Stackoverflow.com/questions/13074250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1775052/"
] | Keep in mind, I do NOT program gmp, but a tail-dynamic buffer in a struct is usually implemented something like this (adapted to how I think you want to use it):
```
typedef struct
{
size_t length; //length of the array
size_t numbits; //number of bits allocated per val in vals
mpz_t vals[1]; //flexible array ... | If you're using a flexible array member, you need to allocate the struct in one go:
```
CoolArray *array = malloc(sizeof(CoolArray) + length * sizeof(mpz_t));
mpz_array_init(array->vals, length, numbits);
``` |
112,536 | I found myself in an interesting puzzle. Here is the simplified version:
I have a flight from A to C, connecting through B. I decide that from B I actually want to go to D, so I buy a separate ticket for that journey\*. The B-C and B-D flights are around the same time and with the same airline\*\*. Will there be a pro... | 2018/04/06 | [
"https://travel.stackexchange.com/questions/112536",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/62048/"
] | **No**, there won't be any problem. Separate bookings are separate bookings and don't affect each other, even on the same airline.
I will note, however, that if you make a habit of buying A-B-C tickets and getting off at B, and give your frequent flyer number every time, the airline will eventually get grumpy. However... | 1. It's unlikely but not impossible that you will get problems at check in. This can be interpreted as you cancelling the "B-C" leg, which incurs a change fee (as stated in the contract of carriage). It sounds insane, but airlines want you to pay for not taking a flight that you have already paid for. They can enforce ... |
112,536 | I found myself in an interesting puzzle. Here is the simplified version:
I have a flight from A to C, connecting through B. I decide that from B I actually want to go to D, so I buy a separate ticket for that journey\*. The B-C and B-D flights are around the same time and with the same airline\*\*. Will there be a pro... | 2018/04/06 | [
"https://travel.stackexchange.com/questions/112536",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/62048/"
] | **No**, there won't be any problem. Separate bookings are separate bookings and don't affect each other, even on the same airline.
I will note, however, that if you make a habit of buying A-B-C tickets and getting off at B, and give your frequent flyer number every time, the airline will eventually get grumpy. However... | There might be a big problem with any checked-in bag. If this is all with the same airline, your bag might be checked through to destination C, with no opportunity to retrieve it at the intermediate stop B. |
112,536 | I found myself in an interesting puzzle. Here is the simplified version:
I have a flight from A to C, connecting through B. I decide that from B I actually want to go to D, so I buy a separate ticket for that journey\*. The B-C and B-D flights are around the same time and with the same airline\*\*. Will there be a pro... | 2018/04/06 | [
"https://travel.stackexchange.com/questions/112536",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/62048/"
] | **No**, there won't be any problem. Separate bookings are separate bookings and don't affect each other, even on the same airline.
I will note, however, that if you make a habit of buying A-B-C tickets and getting off at B, and give your frequent flyer number every time, the airline will eventually get grumpy. However... | I would not count on being able to do this with the same airline. Many airlines implement [revenue protection](http://www.navitaire.com/Styles/Images/PDFs/New%20Skies%20Revenue%20Protection.pdf) systems that can automatically [cancel](https://thepointsguy.com/2017/08/illegal-book-2-flights-cancel-1) duplicate bookings.... |
112,536 | I found myself in an interesting puzzle. Here is the simplified version:
I have a flight from A to C, connecting through B. I decide that from B I actually want to go to D, so I buy a separate ticket for that journey\*. The B-C and B-D flights are around the same time and with the same airline\*\*. Will there be a pro... | 2018/04/06 | [
"https://travel.stackexchange.com/questions/112536",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/62048/"
] | There might be a big problem with any checked-in bag. If this is all with the same airline, your bag might be checked through to destination C, with no opportunity to retrieve it at the intermediate stop B. | 1. It's unlikely but not impossible that you will get problems at check in. This can be interpreted as you cancelling the "B-C" leg, which incurs a change fee (as stated in the contract of carriage). It sounds insane, but airlines want you to pay for not taking a flight that you have already paid for. They can enforce ... |
112,536 | I found myself in an interesting puzzle. Here is the simplified version:
I have a flight from A to C, connecting through B. I decide that from B I actually want to go to D, so I buy a separate ticket for that journey\*. The B-C and B-D flights are around the same time and with the same airline\*\*. Will there be a pro... | 2018/04/06 | [
"https://travel.stackexchange.com/questions/112536",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/62048/"
] | There might be a big problem with any checked-in bag. If this is all with the same airline, your bag might be checked through to destination C, with no opportunity to retrieve it at the intermediate stop B. | I would not count on being able to do this with the same airline. Many airlines implement [revenue protection](http://www.navitaire.com/Styles/Images/PDFs/New%20Skies%20Revenue%20Protection.pdf) systems that can automatically [cancel](https://thepointsguy.com/2017/08/illegal-book-2-flights-cancel-1) duplicate bookings.... |
18,456,454 | we have a client application that plays flash files (.swf). This works on all other mobiles except iphone as Apple doesn't support Flash. Is there any workaround to play these flash files in iphone using HTML5 or any other tweaking? Since there aren't any answers to this question recently, I am submiting this question. | 2013/08/27 | [
"https://Stackoverflow.com/questions/18456454",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2682102/"
] | No, there is no way to display a Flash file (SWF) in the iPhone browser.
If you have access to the source of the Flash files in the application, it may be possible to export them as HTML5 from the Flash builder. There's no way to do this conversion just from the SWFs, though.
As an aside: your application won't work ... | * **using external browser:**
There is a browser called **photon** which plays *flash videos and games* on ios devices without any need to jailbreak open this browser with the web url using custom app url scheme
* **using html5 conversion tools:**
Use *google swiffy* or *Adobe wallaby* and open the HTML page using ui... |
32,785,066 | I'm trying to read some French character from the file but some symbols comes if letter contains à é è.
Can anyone guide me how to get actual character of the file.
Here is my main method
```
public static void main(String args[]) throws IOException
{
char current,org;
//String strPath = "C:/Documents a... | 2015/09/25 | [
"https://Stackoverflow.com/questions/32785066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4485283/"
] | You're trying to read UTF-8 character actually using ASCII. Here's an example of how to implement your feature:
```
public class Test {
private static final FILE_PATH = "c:\\temp\\test.txt";
public static void main(String[] args){
try {
File fileDir = new File(FILE_PATH);
BufferedReader i... | The following assumes the text is in Windows Latin-1, but I have added alternatively UTF-8.
```
private static final String FILE_PATH = "c:\\temp\\test.txt";
Path path = Paths.get(FILE_PATH);
//Charset charset = StandardCharset.ISO_8859_1;
//Charset charset = StandardCharset.UTF_8;
Charset charset = Charset.forName("... |
32,785,066 | I'm trying to read some French character from the file but some symbols comes if letter contains à é è.
Can anyone guide me how to get actual character of the file.
Here is my main method
```
public static void main(String args[]) throws IOException
{
char current,org;
//String strPath = "C:/Documents a... | 2015/09/25 | [
"https://Stackoverflow.com/questions/32785066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4485283/"
] | You're trying to read UTF-8 character actually using ASCII. Here's an example of how to implement your feature:
```
public class Test {
private static final FILE_PATH = "c:\\temp\\test.txt";
public static void main(String[] args){
try {
File fileDir = new File(FILE_PATH);
BufferedReader i... | the specific encoding for french give by IBM is CP1252 (preferred because run on all operating system).
Regards,
A frenchy guy |
32,785,066 | I'm trying to read some French character from the file but some symbols comes if letter contains à é è.
Can anyone guide me how to get actual character of the file.
Here is my main method
```
public static void main(String args[]) throws IOException
{
char current,org;
//String strPath = "C:/Documents a... | 2015/09/25 | [
"https://Stackoverflow.com/questions/32785066",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4485283/"
] | You're trying to read UTF-8 character actually using ASCII. Here's an example of how to implement your feature:
```
public class Test {
private static final FILE_PATH = "c:\\temp\\test.txt";
public static void main(String[] args){
try {
File fileDir = new File(FILE_PATH);
BufferedReader i... | You can download one jar file for Apache Commons IO and try to implement it by reading each line rather than reading char by char.
```
List<String> lines = IOUtils.readLines(fis, "UTF8");
for (String line: lines) {
dbhelper.addDataRecord(line + ",'" + strCompCode + "'");
}
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.