qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
32,661,873 | I'm using node v0.12.7 and want to stream directly from a database to the client (for file download). However, I am noticing a large memory footprint (and possible memory leak) when using streams.
With express, I create an endpoint that simply pipes a readable stream to the response as follows:
```js
app.post('/query... | 2015/09/18 | [
"https://Stackoverflow.com/questions/32661873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1370556/"
] | Just try this before all:
1. Add [manual/explicit garbage collection calls](http://devjar.me/post/22886448979/manually-run-gc-in-nodejs) to your app, and
2. Add [heapdump](https://github.com/bnoordhuis/node-heapdump) `npm install heapdump`
3. Add code to clean garbage and dump the rest to find a leak:
```
var heapdum... | To me it looks like you are load testing multiple stream modules. That is a nice service to provide for the Node community, but you may also consider just caching the postgres data dump to a file, gzip, and serve a static file.
Or maybe make your own Readable that uses a cursor and outputs CSV (as string/text). |
32,661,873 | I'm using node v0.12.7 and want to stream directly from a database to the client (for file download). However, I am noticing a large memory footprint (and possible memory leak) when using streams.
With express, I create an endpoint that simply pipes a readable stream to the response as follows:
```js
app.post('/query... | 2015/09/18 | [
"https://Stackoverflow.com/questions/32661873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1370556/"
] | **Update 2**: Here's a history of various Stream APIs:
<https://medium.com/the-node-js-collection/a-brief-history-of-node-streams-pt-2-bcb6b1fd7468>
0.12 uses Streams 3.
**Update**: This answer was true for old node.js streams. New Stream API has a mechanism to *pause* readable stream if writable stream can't keep u... | To me it looks like you are load testing multiple stream modules. That is a nice service to provide for the Node community, but you may also consider just caching the postgres data dump to a file, gzip, and serve a static file.
Or maybe make your own Readable that uses a cursor and outputs CSV (as string/text). |
32,661,873 | I'm using node v0.12.7 and want to stream directly from a database to the client (for file download). However, I am noticing a large memory footprint (and possible memory leak) when using streams.
With express, I create an endpoint that simply pipes a readable stream to the response as follows:
```js
app.post('/query... | 2015/09/18 | [
"https://Stackoverflow.com/questions/32661873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1370556/"
] | It's too easy to have a memory leak in Node.js
Usually, it's a minor thing, like declaring variable after creating anonymous function or using a function argument inside a callback. But it makes a huge difference on closure context. Thus some variables can never be freed.
[This article](https://auth0.com/blog/four-ty... | To me it looks like you are load testing multiple stream modules. That is a nice service to provide for the Node community, but you may also consider just caching the postgres data dump to a file, gzip, and serve a static file.
Or maybe make your own Readable that uses a cursor and outputs CSV (as string/text). |
32,661,873 | I'm using node v0.12.7 and want to stream directly from a database to the client (for file download). However, I am noticing a large memory footprint (and possible memory leak) when using streams.
With express, I create an endpoint that simply pipes a readable stream to the response as follows:
```js
app.post('/query... | 2015/09/18 | [
"https://Stackoverflow.com/questions/32661873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1370556/"
] | **Update 2**: Here's a history of various Stream APIs:
<https://medium.com/the-node-js-collection/a-brief-history-of-node-streams-pt-2-bcb6b1fd7468>
0.12 uses Streams 3.
**Update**: This answer was true for old node.js streams. New Stream API has a mechanism to *pause* readable stream if writable stream can't keep u... | Just try this before all:
1. Add [manual/explicit garbage collection calls](http://devjar.me/post/22886448979/manually-run-gc-in-nodejs) to your app, and
2. Add [heapdump](https://github.com/bnoordhuis/node-heapdump) `npm install heapdump`
3. Add code to clean garbage and dump the rest to find a leak:
```
var heapdum... |
32,661,873 | I'm using node v0.12.7 and want to stream directly from a database to the client (for file download). However, I am noticing a large memory footprint (and possible memory leak) when using streams.
With express, I create an endpoint that simply pipes a readable stream to the response as follows:
```js
app.post('/query... | 2015/09/18 | [
"https://Stackoverflow.com/questions/32661873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1370556/"
] | Just try this before all:
1. Add [manual/explicit garbage collection calls](http://devjar.me/post/22886448979/manually-run-gc-in-nodejs) to your app, and
2. Add [heapdump](https://github.com/bnoordhuis/node-heapdump) `npm install heapdump`
3. Add code to clean garbage and dump the rest to find a leak:
```
var heapdum... | It's too easy to have a memory leak in Node.js
Usually, it's a minor thing, like declaring variable after creating anonymous function or using a function argument inside a callback. But it makes a huge difference on closure context. Thus some variables can never be freed.
[This article](https://auth0.com/blog/four-ty... |
32,661,873 | I'm using node v0.12.7 and want to stream directly from a database to the client (for file download). However, I am noticing a large memory footprint (and possible memory leak) when using streams.
With express, I create an endpoint that simply pipes a readable stream to the response as follows:
```js
app.post('/query... | 2015/09/18 | [
"https://Stackoverflow.com/questions/32661873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1370556/"
] | **Update 2**: Here's a history of various Stream APIs:
<https://medium.com/the-node-js-collection/a-brief-history-of-node-streams-pt-2-bcb6b1fd7468>
0.12 uses Streams 3.
**Update**: This answer was true for old node.js streams. New Stream API has a mechanism to *pause* readable stream if writable stream can't keep u... | It's too easy to have a memory leak in Node.js
Usually, it's a minor thing, like declaring variable after creating anonymous function or using a function argument inside a callback. But it makes a huge difference on closure context. Thus some variables can never be freed.
[This article](https://auth0.com/blog/four-ty... |
49,618,981 | I am trying to sort an array of 5 random integers in a listbox to ascending order. While creating a new thread and calling it separately, the form becomes unresponsive when I select the 'sort' button.
```
public partial class Form1 : Form
{
const int iSize = 5;
int[] iArray = new int[iSize];
Random rnd = n... | 2018/04/02 | [
"https://Stackoverflow.com/questions/49618981",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9045195/"
] | To expound on [Dour High Arch's](https://stackoverflow.com/users/22437/dour-high-arch) comment.
**EDIT**
There are a couple of issues with your code. UI updates can only be done on the UI thread. You can accomplish this with the SychronizationContext or async/await handles it for you. Also, your bubblesort was missi... | You can not act on `UI`, or Main thread within of another.
This line :
`lbxNumbers.Items.Add(item);`
which is invoked from another thread can cause a trouble.
The proper way of handling this scenario in WindowsForms would be using of
[Control.Invoke](https://msdn.microsoft.com/en-us/library/zyzhdc6b(v=vs.110).a... |
15,296,507 | If you have two pairs of values, start and end- how do you compute where their overlap is?
I.e if the pairs of start and end values are
>
> [10, 20], [15, 20]
>
>
>
In this case `compute_overlap((15,20),(10,20))` should return `(15,20)` because that is where the overlap is.
What is the best way to do this? | 2013/03/08 | [
"https://Stackoverflow.com/questions/15296507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/992687/"
] | If your intervals are `a, b` and `c, d`, i.e.
```
(a, b), (c, d) = [10, 20], [15, 20]
```
then the overlapping interval is
```
x, y = max(a, c), min(b, d)
if x > y: # no overlap
x, y = None, None
```
and the amount of overlap is `y - x` or `y - x + 1`, depending on whether your intervals are closed or [half-... | Assuming you have an iterable and you want to compute to overlap of adjacent items ...
You need to yield the elements "pairwise". Usually, this is as easy as:
```
seq = [[10, 20], [15, 20]]
for lower,upper in zip(seq,seq[1:]):
if upper[0] > lower[1]:
print lower[1],upper[0]
else:
print None, ... |
15,296,507 | If you have two pairs of values, start and end- how do you compute where their overlap is?
I.e if the pairs of start and end values are
>
> [10, 20], [15, 20]
>
>
>
In this case `compute_overlap((15,20),(10,20))` should return `(15,20)` because that is where the overlap is.
What is the best way to do this? | 2013/03/08 | [
"https://Stackoverflow.com/questions/15296507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/992687/"
] | Use `zip` to group the starting and ending points together. Then use `max` to find the largest starting point, and `min` to find the smallest end point:
```
>>> def compute_overlap(pairs):
... starts, ends = zip(*pairs)
... return max(starts), min(ends)
...
>>> compute_overlap(([10, 20], [15,20]))
(15, 20)
`... | Assuming you have an iterable and you want to compute to overlap of adjacent items ...
You need to yield the elements "pairwise". Usually, this is as easy as:
```
seq = [[10, 20], [15, 20]]
for lower,upper in zip(seq,seq[1:]):
if upper[0] > lower[1]:
print lower[1],upper[0]
else:
print None, ... |
15,296,507 | If you have two pairs of values, start and end- how do you compute where their overlap is?
I.e if the pairs of start and end values are
>
> [10, 20], [15, 20]
>
>
>
In this case `compute_overlap((15,20),(10,20))` should return `(15,20)` because that is where the overlap is.
What is the best way to do this? | 2013/03/08 | [
"https://Stackoverflow.com/questions/15296507",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/992687/"
] | If your intervals are `a, b` and `c, d`, i.e.
```
(a, b), (c, d) = [10, 20], [15, 20]
```
then the overlapping interval is
```
x, y = max(a, c), min(b, d)
if x > y: # no overlap
x, y = None, None
```
and the amount of overlap is `y - x` or `y - x + 1`, depending on whether your intervals are closed or [half-... | Use `zip` to group the starting and ending points together. Then use `max` to find the largest starting point, and `min` to find the smallest end point:
```
>>> def compute_overlap(pairs):
... starts, ends = zip(*pairs)
... return max(starts), min(ends)
...
>>> compute_overlap(([10, 20], [15,20]))
(15, 20)
`... |
1,237 | I'm looking for a password manager which is available as Android App and Linux Desktop application alike. I know there's e.g. KeePassDroid (see: [Password manager for Linux with just working in-browser autotype](https://softwarerecs.stackexchange.com/q/541/185)), but that does not fit my requirements, as it has a "fixe... | 2014/02/16 | [
"https://softwarerecs.stackexchange.com/questions/1237",
"https://softwarerecs.stackexchange.com",
"https://softwarerecs.stackexchange.com/users/185/"
] | The easy thing about your criteria is that you don't actually need a matched set. As long as the data file is completely inter-operable, any combination of unrelated apps will work.
### TL;DR
[KeepassX 2](https://www.keepassx.org/) + [Keepass2Android](https://play.google.com/store/apps/details?id=keepass2android.keep... | Another pair coming pretty close (it seems there's none matching all my requirements) is this:
>
> **[Revelation](http://revelation.olasagasti.info/ "Revelation Homepage")** is a password manager for the GNOME desktop, released under the GNU GPL license. It stores all your accounts and passwords in a single, secure p... |
5,436,188 | I have written some code in Java which tests the fitness of two solutions.
I am looking to then compare the two solutions and keep the one which has the best fitness and to discard the other.
For example:
```
if(fitness1 < fitness2)
keep fitness1 and discard/ignore fitness2
else
keep fitness2 and discard/ign... | 2011/03/25 | [
"https://Stackoverflow.com/questions/5436188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636987/"
] | ```
best = (fitness1 < fitness2) ? fitness1 : fitness2;
```
`?:` ternary operator may be useful in this kind of decision making process. | Introduce another variable.
*type* `bestFitness`
```
if(fitness1 < fitness2){
bestFitness = fitness1;
}else{
bestFitness = fitness2;
}
```
Then discard both `fitness1`, `fitness2`
Or use [Math.min](http://download.oracle.com/javase/6/docs/api/java/lang/Math.html#min%28double,%20double%29) |
5,436,188 | I have written some code in Java which tests the fitness of two solutions.
I am looking to then compare the two solutions and keep the one which has the best fitness and to discard the other.
For example:
```
if(fitness1 < fitness2)
keep fitness1 and discard/ignore fitness2
else
keep fitness2 and discard/ign... | 2011/03/25 | [
"https://Stackoverflow.com/questions/5436188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636987/"
] | ```
best = (fitness1 < fitness2) ? fitness1 : fitness2;
```
`?:` ternary operator may be useful in this kind of decision making process. | Assuming the fitness is an int
```
int fitness1 = 5;
int fitness2 = 10;
int bestFit = bestFit(fitness1, fitness2);
//nothing needs to be done to explicitly discard fitness2. Just keep using bestFit
//and let the GC worry about discarding stuff for you
public static int bestFit(int f1, int f2) {
return f1 > f2... |
5,436,188 | I have written some code in Java which tests the fitness of two solutions.
I am looking to then compare the two solutions and keep the one which has the best fitness and to discard the other.
For example:
```
if(fitness1 < fitness2)
keep fitness1 and discard/ignore fitness2
else
keep fitness2 and discard/ign... | 2011/03/25 | [
"https://Stackoverflow.com/questions/5436188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636987/"
] | ```
best = (fitness1 < fitness2) ? fitness1 : fitness2;
```
`?:` ternary operator may be useful in this kind of decision making process. | If your end goal is to have a list of the "top n fitness levels", you'll probably have a list of them coming in, right?
If that's the case, just leverage the capabilities of List:
```
// takes a list of Doubles, returns 'top' levels
public List<Double> getTopN(List<Double> allLevels, int top) {
List<Double> sorte... |
5,436,188 | I have written some code in Java which tests the fitness of two solutions.
I am looking to then compare the two solutions and keep the one which has the best fitness and to discard the other.
For example:
```
if(fitness1 < fitness2)
keep fitness1 and discard/ignore fitness2
else
keep fitness2 and discard/ign... | 2011/03/25 | [
"https://Stackoverflow.com/questions/5436188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636987/"
] | I'd say, create an `ArrayList<Double>` to keep the best values in and use this:
```
arrayList.add((fitness1 < fitness2) ? fitness1 : fitness2);
```
That way you'll have a list of the best values. | Introduce another variable.
*type* `bestFitness`
```
if(fitness1 < fitness2){
bestFitness = fitness1;
}else{
bestFitness = fitness2;
}
```
Then discard both `fitness1`, `fitness2`
Or use [Math.min](http://download.oracle.com/javase/6/docs/api/java/lang/Math.html#min%28double,%20double%29) |
5,436,188 | I have written some code in Java which tests the fitness of two solutions.
I am looking to then compare the two solutions and keep the one which has the best fitness and to discard the other.
For example:
```
if(fitness1 < fitness2)
keep fitness1 and discard/ignore fitness2
else
keep fitness2 and discard/ign... | 2011/03/25 | [
"https://Stackoverflow.com/questions/5436188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636987/"
] | If your end goal is to have a list of the "top n fitness levels", you'll probably have a list of them coming in, right?
If that's the case, just leverage the capabilities of List:
```
// takes a list of Doubles, returns 'top' levels
public List<Double> getTopN(List<Double> allLevels, int top) {
List<Double> sorte... | Introduce another variable.
*type* `bestFitness`
```
if(fitness1 < fitness2){
bestFitness = fitness1;
}else{
bestFitness = fitness2;
}
```
Then discard both `fitness1`, `fitness2`
Or use [Math.min](http://download.oracle.com/javase/6/docs/api/java/lang/Math.html#min%28double,%20double%29) |
5,436,188 | I have written some code in Java which tests the fitness of two solutions.
I am looking to then compare the two solutions and keep the one which has the best fitness and to discard the other.
For example:
```
if(fitness1 < fitness2)
keep fitness1 and discard/ignore fitness2
else
keep fitness2 and discard/ign... | 2011/03/25 | [
"https://Stackoverflow.com/questions/5436188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636987/"
] | I'd say, create an `ArrayList<Double>` to keep the best values in and use this:
```
arrayList.add((fitness1 < fitness2) ? fitness1 : fitness2);
```
That way you'll have a list of the best values. | Assuming the fitness is an int
```
int fitness1 = 5;
int fitness2 = 10;
int bestFit = bestFit(fitness1, fitness2);
//nothing needs to be done to explicitly discard fitness2. Just keep using bestFit
//and let the GC worry about discarding stuff for you
public static int bestFit(int f1, int f2) {
return f1 > f2... |
5,436,188 | I have written some code in Java which tests the fitness of two solutions.
I am looking to then compare the two solutions and keep the one which has the best fitness and to discard the other.
For example:
```
if(fitness1 < fitness2)
keep fitness1 and discard/ignore fitness2
else
keep fitness2 and discard/ign... | 2011/03/25 | [
"https://Stackoverflow.com/questions/5436188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636987/"
] | I'd say, create an `ArrayList<Double>` to keep the best values in and use this:
```
arrayList.add((fitness1 < fitness2) ? fitness1 : fitness2);
```
That way you'll have a list of the best values. | If your end goal is to have a list of the "top n fitness levels", you'll probably have a list of them coming in, right?
If that's the case, just leverage the capabilities of List:
```
// takes a list of Doubles, returns 'top' levels
public List<Double> getTopN(List<Double> allLevels, int top) {
List<Double> sorte... |
5,436,188 | I have written some code in Java which tests the fitness of two solutions.
I am looking to then compare the two solutions and keep the one which has the best fitness and to discard the other.
For example:
```
if(fitness1 < fitness2)
keep fitness1 and discard/ignore fitness2
else
keep fitness2 and discard/ign... | 2011/03/25 | [
"https://Stackoverflow.com/questions/5436188",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/636987/"
] | If your end goal is to have a list of the "top n fitness levels", you'll probably have a list of them coming in, right?
If that's the case, just leverage the capabilities of List:
```
// takes a list of Doubles, returns 'top' levels
public List<Double> getTopN(List<Double> allLevels, int top) {
List<Double> sorte... | Assuming the fitness is an int
```
int fitness1 = 5;
int fitness2 = 10;
int bestFit = bestFit(fitness1, fitness2);
//nothing needs to be done to explicitly discard fitness2. Just keep using bestFit
//and let the GC worry about discarding stuff for you
public static int bestFit(int f1, int f2) {
return f1 > f2... |
32,275,035 | EDIT: Thanks guys. It was truly just a formatting error of the single-quotation mark from the source code I copied. Thanks a lot!
**Codes:**
```
USE Library;
INSERT INTO myLibrary VALUES (
‘SQL Bible’
,‘Alex Kriegel’
,‘Boris M. Trukhnov’
,‘Wiley’
,888
,‘April 7,2008’
,‘978-0470229064’
... | 2015/08/28 | [
"https://Stackoverflow.com/questions/32275035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5035395/"
] | In SQL, strings are defined with the `'` characters, not `‘` and `’` | Looks like you're using the wrong character to encapsulate your strings. Instead of the `‘` character, you need to use either a `'` or a `"`:
```
USE Library;
INSERT INTO myLibrary VALUES (
"SQL Bible"
,"Alex Kriegel"
,"Boris M. Trukhnov"
,"Wiley"
,888
,"April 7,2008"
,"978-0470229064"
... |
32,275,035 | EDIT: Thanks guys. It was truly just a formatting error of the single-quotation mark from the source code I copied. Thanks a lot!
**Codes:**
```
USE Library;
INSERT INTO myLibrary VALUES (
‘SQL Bible’
,‘Alex Kriegel’
,‘Boris M. Trukhnov’
,‘Wiley’
,888
,‘April 7,2008’
,‘978-0470229064’
... | 2015/08/28 | [
"https://Stackoverflow.com/questions/32275035",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5035395/"
] | In SQL, strings are defined with the `'` characters, not `‘` and `’` | If you did a copy/paste from some software, like Word, it can have formatting attached. Your SQL engine will not interpret it.
Take the code, put it into notepad or some other simple text editor (notepad + or jedit are two that I use) and do a replace the open quote and the end quote with a ' or ". |
116,477 | Is it possible to create a table with a layout as this one?

If yes, what packages should I use? | 2013/05/28 | [
"https://tex.stackexchange.com/questions/116477",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/31381/"
] | You could use `TikZ` for this. The advantage of `TikZ` is that it's very powerful, so you can produce whatever effect you want, providing you have the know-how.
Here is some code.
* The `\def...` lines near the top are for customising the size and colour of the cells.
* The table might look wrong if the data in the... | Your example could be done like this, losing the fancy formatting, but retaining all the information, as far as I can tell.
```
\documentclass{scrartcl}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{lcccc}
\toprule
& 1339707619:``value'' & 1339817619:``value'' &
1369... |
116,477 | Is it possible to create a table with a layout as this one?

If yes, what packages should I use? | 2013/05/28 | [
"https://tex.stackexchange.com/questions/116477",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/31381/"
] | You could use `TikZ` for this. The advantage of `TikZ` is that it's very powerful, so you can produce whatever effect you want, providing you have the know-how.
Here is some code.
* The `\def...` lines near the top are for customising the size and colour of the cells.
* The table might look wrong if the data in the... | Yes you can using multirow, here is an example:
```
\documentclass[border=5mm]{standalone}
\usepackage{multirow}
\begin{document}
\begin{tabular}{cc|c|c|c|c|l}
\cline{3-6}
& & \multicolumn{4}{ c| }{Primes} \\ \cline{3-6}
& & 2 & 3 & 5 & 7 \\ \cline{1-6}
\multicolumn{1}{ |c| }{\multirow{2}{*}{Powers} } &
\multicol... |
116,477 | Is it possible to create a table with a layout as this one?

If yes, what packages should I use? | 2013/05/28 | [
"https://tex.stackexchange.com/questions/116477",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/31381/"
] | You could use `TikZ` for this. The advantage of `TikZ` is that it's very powerful, so you can produce whatever effect you want, providing you have the know-how.
Here is some code.
* The `\def...` lines near the top are for customising the size and colour of the cells.
* The table might look wrong if the data in the... | Compound stacks!
```
\documentclass{arlticle}
\usepackage{xcolor}
\usepackage[usestackEOL]{stackengine}
\newcommand\widebox[2][white]{\fcolorbox{black}{#1}{\makebox[1.5in]{#2\strut}}}
\newcommand\groupbox[1]{\groupboxaux[#1]}
\def\groupboxaux[#1\cr#2]{\stackanchor[-\fboxsep]{\widebox[yellow]{#1}}
{\widebox{#2}}\kern... |
116,477 | Is it possible to create a table with a layout as this one?

If yes, what packages should I use? | 2013/05/28 | [
"https://tex.stackexchange.com/questions/116477",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/31381/"
] | You could use `TikZ` for this. The advantage of `TikZ` is that it's very powerful, so you can produce whatever effect you want, providing you have the know-how.
Here is some code.
* The `\def...` lines near the top are for customising the size and colour of the cells.
* The table might look wrong if the data in the... | With `{NiceTabular}` of `nicematrix`.
```
\documentclass{article}
\usepackage{nicematrix}
\usepackage{geometry}
\geometry{left=1cm,right=1cm}
\begin{document}
\begin{NiceTabular}[corners={NE,SE},hvlines]{ccccc}
\CodeBefore
\rowcolor{yellow}{1,3,5}
\columncolor{blue!20}{1}
\Body
\Block{2-1}{123} & 1339707619:"val... |
116,477 | Is it possible to create a table with a layout as this one?

If yes, what packages should I use? | 2013/05/28 | [
"https://tex.stackexchange.com/questions/116477",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/31381/"
] | Your example could be done like this, losing the fancy formatting, but retaining all the information, as far as I can tell.
```
\documentclass{scrartcl}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{lcccc}
\toprule
& 1339707619:``value'' & 1339817619:``value'' &
1369... | Yes you can using multirow, here is an example:
```
\documentclass[border=5mm]{standalone}
\usepackage{multirow}
\begin{document}
\begin{tabular}{cc|c|c|c|c|l}
\cline{3-6}
& & \multicolumn{4}{ c| }{Primes} \\ \cline{3-6}
& & 2 & 3 & 5 & 7 \\ \cline{1-6}
\multicolumn{1}{ |c| }{\multirow{2}{*}{Powers} } &
\multicol... |
116,477 | Is it possible to create a table with a layout as this one?

If yes, what packages should I use? | 2013/05/28 | [
"https://tex.stackexchange.com/questions/116477",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/31381/"
] | Your example could be done like this, losing the fancy formatting, but retaining all the information, as far as I can tell.
```
\documentclass{scrartcl}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{lcccc}
\toprule
& 1339707619:``value'' & 1339817619:``value'' &
1369... | Compound stacks!
```
\documentclass{arlticle}
\usepackage{xcolor}
\usepackage[usestackEOL]{stackengine}
\newcommand\widebox[2][white]{\fcolorbox{black}{#1}{\makebox[1.5in]{#2\strut}}}
\newcommand\groupbox[1]{\groupboxaux[#1]}
\def\groupboxaux[#1\cr#2]{\stackanchor[-\fboxsep]{\widebox[yellow]{#1}}
{\widebox{#2}}\kern... |
116,477 | Is it possible to create a table with a layout as this one?

If yes, what packages should I use? | 2013/05/28 | [
"https://tex.stackexchange.com/questions/116477",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/31381/"
] | Your example could be done like this, losing the fancy formatting, but retaining all the information, as far as I can tell.
```
\documentclass{scrartcl}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\begin{tabular}{lcccc}
\toprule
& 1339707619:``value'' & 1339817619:``value'' &
1369... | With `{NiceTabular}` of `nicematrix`.
```
\documentclass{article}
\usepackage{nicematrix}
\usepackage{geometry}
\geometry{left=1cm,right=1cm}
\begin{document}
\begin{NiceTabular}[corners={NE,SE},hvlines]{ccccc}
\CodeBefore
\rowcolor{yellow}{1,3,5}
\columncolor{blue!20}{1}
\Body
\Block{2-1}{123} & 1339707619:"val... |
116,477 | Is it possible to create a table with a layout as this one?

If yes, what packages should I use? | 2013/05/28 | [
"https://tex.stackexchange.com/questions/116477",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/31381/"
] | Yes you can using multirow, here is an example:
```
\documentclass[border=5mm]{standalone}
\usepackage{multirow}
\begin{document}
\begin{tabular}{cc|c|c|c|c|l}
\cline{3-6}
& & \multicolumn{4}{ c| }{Primes} \\ \cline{3-6}
& & 2 & 3 & 5 & 7 \\ \cline{1-6}
\multicolumn{1}{ |c| }{\multirow{2}{*}{Powers} } &
\multicol... | With `{NiceTabular}` of `nicematrix`.
```
\documentclass{article}
\usepackage{nicematrix}
\usepackage{geometry}
\geometry{left=1cm,right=1cm}
\begin{document}
\begin{NiceTabular}[corners={NE,SE},hvlines]{ccccc}
\CodeBefore
\rowcolor{yellow}{1,3,5}
\columncolor{blue!20}{1}
\Body
\Block{2-1}{123} & 1339707619:"val... |
116,477 | Is it possible to create a table with a layout as this one?

If yes, what packages should I use? | 2013/05/28 | [
"https://tex.stackexchange.com/questions/116477",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/31381/"
] | Compound stacks!
```
\documentclass{arlticle}
\usepackage{xcolor}
\usepackage[usestackEOL]{stackengine}
\newcommand\widebox[2][white]{\fcolorbox{black}{#1}{\makebox[1.5in]{#2\strut}}}
\newcommand\groupbox[1]{\groupboxaux[#1]}
\def\groupboxaux[#1\cr#2]{\stackanchor[-\fboxsep]{\widebox[yellow]{#1}}
{\widebox{#2}}\kern... | With `{NiceTabular}` of `nicematrix`.
```
\documentclass{article}
\usepackage{nicematrix}
\usepackage{geometry}
\geometry{left=1cm,right=1cm}
\begin{document}
\begin{NiceTabular}[corners={NE,SE},hvlines]{ccccc}
\CodeBefore
\rowcolor{yellow}{1,3,5}
\columncolor{blue!20}{1}
\Body
\Block{2-1}{123} & 1339707619:"val... |
51,165,812 | Here this is my code........
**Two problem are here,**
1. when i minimise this app window and start another app on my phone, while again view this app its not resume where i minimise this app.
2. when i refresh on at any page of this app webview its redirect
homepage each time
I want to use progressBar like as yout... | 2018/07/04 | [
"https://Stackoverflow.com/questions/51165812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9757989/"
] | `break` and `continue` statements are to be used in `loops` and not in `if-else` blocks.
You should rather merge the statements using logical operators
```
if ((support_Fixednodes !== undefined && support_Fixednodes !== null) && ((arrayIndex.length - 1) === arrayIndex.lastIndexOf("FIXED"))){
var supportFBnode_index... | to avoid repeated conditionals and repeated code is possible using a little known javascript construct ... the `label`
depending on what `jump here` is actually referring to (before the if, or the body of the if)
So, before the if (so the last if is checked regardless)
```
var supportFBnode_index;
hack: {
if (su... |
2,598,939 | I have this
```
<%=Model.StartDate%>
<%=Html.Hidden("StartDate", Model.StartDate)%>
```
it outputs:
```
2010-05-11 11:00:00 +01:00
<input type="hidden" value="2010-03-17 11:00:00 +01:00" name="StartDate" id="StartDate">
```
What the...
It's a paging mechanism so the hidden value was valid on the first ... | 2010/04/08 | [
"https://Stackoverflow.com/questions/2598939",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/168390/"
] | First one uses Model object, second one uses existing ModelState. Look at ModelState values before generating view. It propably holds value for this field. Html helpers priveded by MVC use ModelState to generate form fields. It helps in recreating values after post back.
To get rid of this kind of problems, use POST-R... | I think the <%=Html.Hidden("StartDate", Model.StartDate)%> is out of place here.
Html Helpers try to keep data in the UI like they where entered by examining the post/route data. Please dont ask me how someone would ever enter data in a hidden field.
You want something different: You want to set the data to Model.Sta... |
20,919,154 | Hi guys what i have done is an accordion drop down which drops down on click the header of the DIV used in my coding...... everything works fine but the thing is i want the drop down to go back in if the user opens one and clicks on the same .... i am new with J QUERY ... but i have tried implementing a logic but it do... | 2014/01/04 | [
"https://Stackoverflow.com/questions/20919154",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2982744/"
] | You just have to add an else part
```
else{
$('.acc_trigger').removeClass('active').next().slideUp();
}
```
[Check on fiddle](http://jsfiddle.net/UWF5q/) | Here is the Simple code which i wrote. This works good, just some CSS work to do..
```
<script src="jquery.js"></script>
<style>
ul{list-style:none;}
p{border:1px solid;}
</style>
<script>
$(document).ready(function(){
$("#tab > p").hide();
$("#tab h1").click(function(){
$("#t... |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | Timing comparisons of various ways to do this:
```
In [1]: import sys
In [2]: sys.setrecursionlimit(10**5)
In [3]: from so import *
In [4]: %timeit recur(range(10**4)).show()
10 loops, best of 3: 18.2 ms per loop
In [5]: %timeit recurse1(range(10**4))
1 loops, best of 3: 559 ms per loop
In [6]: %timeit recurse2(r... | Maybe something like:
```
def dec_by_one(alist, index):
if index == len(alist):
return alist
alist[index] -= 1
return dec_by_one(alist, index + 1)
print(dec_by_one([1, 3, 4], 0)) # [0, 2, 3]
``` |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | Probably *less* pythonic, but there:
```
def recurseDecrMap(l):
return [l[0]-1] + recurseDecrMap(l[1:]) if l else []
``` | Here's the worst way - using [Fixed Point Combinator](http://en.wikipedia.org/wiki/Fixed-point_combinator):
```
Y = lambda g: (lambda f: g(lambda arg: f(f)(arg))) (lambda f: g(lambda arg: f(f)(arg)))
recurseDecrMap = Y(lambda f: lambda l: [l[0]-1] + f(l[1:]) if l else [])
``` |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | Probably *less* pythonic, but there:
```
def recurseDecrMap(l):
return [l[0]-1] + recurseDecrMap(l[1:]) if l else []
``` | Here's a simple pythonic way:
```
>>> mylist = range(30)
>>> def func(l):
... return [i-1 for i in l]
>>> func(mylist)
[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]
```
Explanation:
I used [list comprehensions](http://docs.python.org/2/tutorial/da... |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | You can use only one argument, in my opinion it is simpler:
```
def recurseDecrMap(l):
if not l:
return []
else:
return [l[0]-1] + recurseDecrMap(l[1:])
```
But as @jamylak pointed out, the complexity of this algorithm is O(N^2), since `l[1:]` creates a new list with references to the r... | Maybe something like:
```
def dec_by_one(alist, index):
if index == len(alist):
return alist
alist[index] -= 1
return dec_by_one(alist, index + 1)
print(dec_by_one([1, 3, 4], 0)) # [0, 2, 3]
``` |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | You can use only one argument, in my opinion it is simpler:
```
def recurseDecrMap(l):
if not l:
return []
else:
return [l[0]-1] + recurseDecrMap(l[1:])
```
But as @jamylak pointed out, the complexity of this algorithm is O(N^2), since `l[1:]` creates a new list with references to the r... | Here's a recursive solution that can cope with large lists without hitting the recursion depth limit. By using divide and conquer the recursion depth is O(log(N)) at worst, compared to O(N) with naive recursion. Any sort of recursion is a poor choice of technique for this problem though, as it's trivially solved with a... |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | Here's the worst way - using [Fixed Point Combinator](http://en.wikipedia.org/wiki/Fixed-point_combinator):
```
Y = lambda g: (lambda f: g(lambda arg: f(f)(arg))) (lambda f: g(lambda arg: f(f)(arg)))
recurseDecrMap = Y(lambda f: lambda l: [l[0]-1] + f(l[1:]) if l else [])
``` | Here's a simple pythonic way:
```
>>> mylist = range(30)
>>> def func(l):
... return [i-1 for i in l]
>>> func(mylist)
[-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]
```
Explanation:
I used [list comprehensions](http://docs.python.org/2/tutorial/da... |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | You can use only one argument, in my opinion it is simpler:
```
def recurseDecrMap(l):
if not l:
return []
else:
return [l[0]-1] + recurseDecrMap(l[1:])
```
But as @jamylak pointed out, the complexity of this algorithm is O(N^2), since `l[1:]` creates a new list with references to the r... | For what it's worth, this is a terrible way to learn about recursion, because you're using it to do something that is not inherently recursive. If your teacher really is asking you to write a program that decrements the elements of a list like `[1, 2, 3, 4]` *recursively*, then shame on him/her.
As Haidro noted, the ... |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | For what it's worth, this is a terrible way to learn about recursion, because you're using it to do something that is not inherently recursive. If your teacher really is asking you to write a program that decrements the elements of a list like `[1, 2, 3, 4]` *recursively*, then shame on him/her.
As Haidro noted, the ... | Maybe something like:
```
def dec_by_one(alist, index):
if index == len(alist):
return alist
alist[index] -= 1
return dec_by_one(alist, index + 1)
print(dec_by_one([1, 3, 4], 0)) # [0, 2, 3]
``` |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | Probably *less* pythonic, but there:
```
def recurseDecrMap(l):
return [l[0]-1] + recurseDecrMap(l[1:]) if l else []
``` | Here's a recursive solution that can cope with large lists without hitting the recursion depth limit. By using divide and conquer the recursion depth is O(log(N)) at worst, compared to O(N) with naive recursion. Any sort of recursion is a poor choice of technique for this problem though, as it's trivially solved with a... |
16,257,878 | I'm testing with the selenium webdriver, and getting an error. I have set the Ro.properties file and put all locator in properties file.
Below is the code that I am using, can anyone please help me out?
```
public class usePropertiesFile {
private WebDriver driver;
public static Properties prop = new Propert... | 2013/04/27 | [
"https://Stackoverflow.com/questions/16257878",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2327952/"
] | Timing comparisons of various ways to do this:
```
In [1]: import sys
In [2]: sys.setrecursionlimit(10**5)
In [3]: from so import *
In [4]: %timeit recur(range(10**4)).show()
10 loops, best of 3: 18.2 ms per loop
In [5]: %timeit recurse1(range(10**4))
1 loops, best of 3: 559 ms per loop
In [6]: %timeit recurse2(r... | Here's a recursive solution that can cope with large lists without hitting the recursion depth limit. By using divide and conquer the recursion depth is O(log(N)) at worst, compared to O(N) with naive recursion. Any sort of recursion is a poor choice of technique for this problem though, as it's trivially solved with a... |
410,390 | >
> If we are given with a polynomial $\mathcal P$ and a compactly
> supported distribution $g$. Can we prove that their convolution will
> be a polynomial again?
>
>
> | 2013/06/03 | [
"https://math.stackexchange.com/questions/410390",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/76098/"
] | It should be somewhat easy to show the following:
**Lemma**
If $f:\Bbb{R}^n\rightarrow\Bbb{R}$ is $m$ times continuously differentiable and $\partial^m\_{x\_j}f\equiv 0$ for all $1\leq j\leq n$, then $f$ is a polynomial of degree at most $m-1$.
Then, you should be able to differentiate under the integral sign to ob... | If you take $p(x) = x^k$ (where $x^k = x\_1^{k\_1}\cdots x\_n^{k\_n}$,
and $\binom{k}{j} = \binom{k\_1}{j\_1} \cdots \binom{k\_n}{j\_n}$), then $(p \ast g)(x) = \int (x-t)^k dg(t) = \sum\_{j \le k } \binom{k}{j} x^j \int (-t)^{k-j} dg(t)$, which is a polynomial.
It follows by linearity that polynomials will be mapped ... |
21,291 | >
> I often told you we'd go there when
> spring arrives.
>
>
>
That sentence seems funny to me. It means that in the past the speaker would often promise the listener that when spring arrives they would go to a certain place together. Is it grammatically correct?
What about these alternatives?
>
> I often tol... | 2011/04/15 | [
"https://english.stackexchange.com/questions/21291",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/5877/"
] | >
> I often told you we'd go there when
> spring arrives. That sentence seems
> funny to me. It means that in the past
> the speaker would often promise the
> listener that when spring arrives they
> would go to a certain place together.
> Is it grammatically correct?
>
>
> What about these alternatives?
>
> ... | Grammatically it seems that 'arrived' is correct. But idiomatically 'arrives' should be correct to denote that spring has arrived now. Since the principal clause and the subordinate clause should agree in tense in this case, 'arrived' is applicable in any case, i.e. whether it is spring or fall doesn't matter. But if i... |
21,291 | >
> I often told you we'd go there when
> spring arrives.
>
>
>
That sentence seems funny to me. It means that in the past the speaker would often promise the listener that when spring arrives they would go to a certain place together. Is it grammatically correct?
What about these alternatives?
>
> I often tol... | 2011/04/15 | [
"https://english.stackexchange.com/questions/21291",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/5877/"
] | If spring is still in the future, you should use *arrives*.
The past tense:
>
> I often told you we'd go there when
> spring arrived.
>
>
>
implies that spring has already arrived. On the other hand, if spring arrived long ago, you must use *arrived*. If the arrival of spring is recent, either one works. | Grammatically it seems that 'arrived' is correct. But idiomatically 'arrives' should be correct to denote that spring has arrived now. Since the principal clause and the subordinate clause should agree in tense in this case, 'arrived' is applicable in any case, i.e. whether it is spring or fall doesn't matter. But if i... |
21,291 | >
> I often told you we'd go there when
> spring arrives.
>
>
>
That sentence seems funny to me. It means that in the past the speaker would often promise the listener that when spring arrives they would go to a certain place together. Is it grammatically correct?
What about these alternatives?
>
> I often tol... | 2011/04/15 | [
"https://english.stackexchange.com/questions/21291",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/5877/"
] | If spring is still in the future, you should use *arrives*.
The past tense:
>
> I often told you we'd go there when
> spring arrived.
>
>
>
implies that spring has already arrived. On the other hand, if spring arrived long ago, you must use *arrived*. If the arrival of spring is recent, either one works. | >
> I often told you we'd go there when
> spring arrives. That sentence seems
> funny to me. It means that in the past
> the speaker would often promise the
> listener that when spring arrives they
> would go to a certain place together.
> Is it grammatically correct?
>
>
> What about these alternatives?
>
> ... |
12,357,261 | I have a list of store names, with a few thousand names, some of which have non-standard American English characters that are posing a problem.
For example, my input file looks like this:
```
store_name
yéché
Ázak
ótndle
```
I want the output file to actually look like this (I think Googledocs made this happen, bt... | 2012/09/10 | [
"https://Stackoverflow.com/questions/12357261",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1590499/"
] | Your issue is most likely with the MS Office suite's CP-1252 "Windows Unicode" encoding. If you read it as either ASCII or UTF, you'll get funky characters.
You can do two things:
1. Force MS Office to use another encoding. Some of the Office programs support it, and some do not.
2. Rewrite the file after MS Office s... | You can use [decode and encode](http://docs.python.org/library/codecs.html#module-codecs):
```
print a
péché
Álak
óundle
print a.decode('latin9').encode('utf8'),
péché
Ãlak
óundle
```
I had to do the reverse... |
27,098,535 | i have tried by calling
```
String s=findDate();
```
this findDate() is declared in retrofit service as
```
public RetrofitService{
@GET(/findDate)
String findDate()
}
```
Is this correct?
But i am getting response as a string 214-11-24 when i tried using Async Callback. Why it is so? The server is returning da... | 2014/11/24 | [
"https://Stackoverflow.com/questions/27098535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2834980/"
] | I ran into the same problem when trying to access a directive's variable from the controller. In my case I could make `myFile` available to the controller, but I had to assign it to `scope.$parent.$parent.myFile` from within the directive. I didn't want to hard code in a depth of ancestry in order to access the variabl... | I have seen that tutorial but opted for using this library witch makes file uploading seamless:
[ng-file-upload](https://github.com/danialfarid/ng-file-upload) |
27,098,535 | i have tried by calling
```
String s=findDate();
```
this findDate() is declared in retrofit service as
```
public RetrofitService{
@GET(/findDate)
String findDate()
}
```
Is this correct?
But i am getting response as a string 214-11-24 when i tried using Async Callback. Why it is so? The server is returning da... | 2014/11/24 | [
"https://Stackoverflow.com/questions/27098535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2834980/"
] | I ran into the same problem when trying to access a directive's variable from the controller. In my case I could make `myFile` available to the controller, but I had to assign it to `scope.$parent.$parent.myFile` from within the directive. I didn't want to hard code in a depth of ancestry in order to access the variabl... | Try below solution:
HTML code:
```
<div class="btn-header">
<label for="attachment" class="control-label">Attachment</label>
<div class="has-feedback">
<input type="file" id="fileUpload" name="attachment" ng-disabled="BRPTab.BRPTelePhonyandTestScipt.Checked"
class="form-control" data-ak-... |
27,098,535 | i have tried by calling
```
String s=findDate();
```
this findDate() is declared in retrofit service as
```
public RetrofitService{
@GET(/findDate)
String findDate()
}
```
Is this correct?
But i am getting response as a string 214-11-24 when i tried using Async Callback. Why it is so? The server is returning da... | 2014/11/24 | [
"https://Stackoverflow.com/questions/27098535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2834980/"
] | I ran into the same problem when trying to access a directive's variable from the controller. In my case I could make `myFile` available to the controller, but I had to assign it to `scope.$parent.$parent.myFile` from within the directive. I didn't want to hard code in a depth of ancestry in order to access the variabl... | try this code
```
<html>
<head>
<script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>
<body ng-app = "myApp">
<div ng-controller = "myCtrl">
<input ... |
27,098,535 | i have tried by calling
```
String s=findDate();
```
this findDate() is declared in retrofit service as
```
public RetrofitService{
@GET(/findDate)
String findDate()
}
```
Is this correct?
But i am getting response as a string 214-11-24 when i tried using Async Callback. Why it is so? The server is returning da... | 2014/11/24 | [
"https://Stackoverflow.com/questions/27098535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2834980/"
] | I ran into the same problem when trying to access a directive's variable from the controller. In my case I could make `myFile` available to the controller, but I had to assign it to `scope.$parent.$parent.myFile` from within the directive. I didn't want to hard code in a depth of ancestry in order to access the variabl... | This issue is seen in couple of Angular versions, where file object can't be set the scope variable. As a work around make, pass the field to controller, use this file object to upload ( not from scope)
**HTML Form**
```
<form>
<div class="form-group">
<label for="myFileField">Select a file: <... |
27,098,535 | i have tried by calling
```
String s=findDate();
```
this findDate() is declared in retrofit service as
```
public RetrofitService{
@GET(/findDate)
String findDate()
}
```
Is this correct?
But i am getting response as a string 214-11-24 when i tried using Async Callback. Why it is so? The server is returning da... | 2014/11/24 | [
"https://Stackoverflow.com/questions/27098535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2834980/"
] | This issue is seen in couple of Angular versions, where file object can't be set the scope variable. As a work around make, pass the field to controller, use this file object to upload ( not from scope)
**HTML Form**
```
<form>
<div class="form-group">
<label for="myFileField">Select a file: <... | I have seen that tutorial but opted for using this library witch makes file uploading seamless:
[ng-file-upload](https://github.com/danialfarid/ng-file-upload) |
27,098,535 | i have tried by calling
```
String s=findDate();
```
this findDate() is declared in retrofit service as
```
public RetrofitService{
@GET(/findDate)
String findDate()
}
```
Is this correct?
But i am getting response as a string 214-11-24 when i tried using Async Callback. Why it is so? The server is returning da... | 2014/11/24 | [
"https://Stackoverflow.com/questions/27098535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2834980/"
] | This issue is seen in couple of Angular versions, where file object can't be set the scope variable. As a work around make, pass the field to controller, use this file object to upload ( not from scope)
**HTML Form**
```
<form>
<div class="form-group">
<label for="myFileField">Select a file: <... | Try below solution:
HTML code:
```
<div class="btn-header">
<label for="attachment" class="control-label">Attachment</label>
<div class="has-feedback">
<input type="file" id="fileUpload" name="attachment" ng-disabled="BRPTab.BRPTelePhonyandTestScipt.Checked"
class="form-control" data-ak-... |
27,098,535 | i have tried by calling
```
String s=findDate();
```
this findDate() is declared in retrofit service as
```
public RetrofitService{
@GET(/findDate)
String findDate()
}
```
Is this correct?
But i am getting response as a string 214-11-24 when i tried using Async Callback. Why it is so? The server is returning da... | 2014/11/24 | [
"https://Stackoverflow.com/questions/27098535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2834980/"
] | This issue is seen in couple of Angular versions, where file object can't be set the scope variable. As a work around make, pass the field to controller, use this file object to upload ( not from scope)
**HTML Form**
```
<form>
<div class="form-group">
<label for="myFileField">Select a file: <... | try this code
```
<html>
<head>
<script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>
<body ng-app = "myApp">
<div ng-controller = "myCtrl">
<input ... |
36,463,975 | I am getting an error that I am unauthorized.. RESPONSE CODE 401
The token I am using works in perl..
This is what I have tried till now:
```
public static void main(String[] args) throws Exception {
try {
String auth = returnAuth(); //getting token from a file.
//System.out.println(au... | 2016/04/06 | [
"https://Stackoverflow.com/questions/36463975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6169313/"
] | ```
public static void main(String[] args) throws Exception {
try {
String auth = returnAuth(); //getting token from a file.
String url1= "https://canvas.instructure.com/api/v1/courses";
URL url = new URL(url1);
HttpsURLConnection connection =(HttpsURLConnection) url.openConnection();
conne... | You have it commented out but every Oauth server I've dealt with would be "Bearer <token>" - one space and no colon. |
36,463,975 | I am getting an error that I am unauthorized.. RESPONSE CODE 401
The token I am using works in perl..
This is what I have tried till now:
```
public static void main(String[] args) throws Exception {
try {
String auth = returnAuth(); //getting token from a file.
//System.out.println(au... | 2016/04/06 | [
"https://Stackoverflow.com/questions/36463975",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6169313/"
] | ```
public static void main(String[] args) throws Exception {
try {
String auth = returnAuth(); //getting token from a file.
String url1= "https://canvas.instructure.com/api/v1/courses";
URL url = new URL(url1);
HttpsURLConnection connection =(HttpsURLConnection) url.openConnection();
conne... | You set the parameters AFTER you called!
Change your code to first set the authentication, then open the connection.
```
String url1= "https://canvas.instructure.com/api/v1";
URL url = new URL(url1+"/courses");
connection.setRequestProperty("Authorization", "Bearer "+auth);
connection.setRequestMethod("GET");
/... |
32,434,244 | Can someone please explain these lines of code? I know we are setting `hl` to correct if its min is lower than highlited min, but I don't understand why we finish the `if` block after opening bolding HTML code. Shouldn't I put `endif` after all of the bolding code?
```
{% set hl = weather[month]['max'] >= highlight['... | 2015/09/07 | [
"https://Stackoverflow.com/questions/32434244",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5308170/"
] | The `if` appears twice because **both the starting and ending bold tags are conditional** - the text appears either way, it's only whether or not it's bold that varies with the value of `highlight['max']`. The alternative to the code you've shown is:
```html
{% if weather[month]['max'] >= highlight['max'] %}
<b>{{... | The first if is to print the opening tag, the second is to place the closing tag
and the value is always printed.
Conclusion only if this if is true, the value will be bold, else the value won't be bold.
```
{% set hl = weather[month]['max'] >= highlight['max'] %}
{% if hl %} // <= Opening tag if the condit... |
9,908,994 | I am writing an intranet customer manager (so will not be accessible at all from the internet, and runs locally only). I am using Uploadify <http://www.uploadify.com/documentation/> , a Jquery script to add files to each of the customers records (its being used in a shop, so the shop keeper can add photos / measurement... | 2012/03/28 | [
"https://Stackoverflow.com/questions/9908994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1150948/"
] | You can use virtual pageviews. For each step of the process, add a call to
```
_gaq.push(['_trackPageview', '/ajax-contactForm/PAGE-or-STEP-NAME.html']);
```
This will register as a pageview and can be used as a step in the goal.
See [virtual pageviews in the GA docs](http://code.google.com/apis/analytics/docs/tra... | This answer possibly needs to be updated for more recent versions of GA. I did the following to set up goals when the page is submitted via ajax.
```
$.ajax({
type: "POST",
url: "/some/page/that/does/not/have/ga/on/it.php",
data: { formData:formData },
success: function() {
... |
9,908,994 | I am writing an intranet customer manager (so will not be accessible at all from the internet, and runs locally only). I am using Uploadify <http://www.uploadify.com/documentation/> , a Jquery script to add files to each of the customers records (its being used in a shop, so the shop keeper can add photos / measurement... | 2012/03/28 | [
"https://Stackoverflow.com/questions/9908994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1150948/"
] | You can use virtual pageviews. For each step of the process, add a call to
```
_gaq.push(['_trackPageview', '/ajax-contactForm/PAGE-or-STEP-NAME.html']);
```
This will register as a pageview and can be used as a step in the goal.
See [virtual pageviews in the GA docs](http://code.google.com/apis/analytics/docs/tra... | Here's an updated answer for 2019. Linking up your Analytics account to Google Tag Manager lets you track submissions on AJAX forms in Google Analytics by either tracking all form submissions or by setting an event listener to an element's visibility (i.e. your form's confirmation/thank you message). It requires use of... |
9,908,994 | I am writing an intranet customer manager (so will not be accessible at all from the internet, and runs locally only). I am using Uploadify <http://www.uploadify.com/documentation/> , a Jquery script to add files to each of the customers records (its being used in a shop, so the shop keeper can add photos / measurement... | 2012/03/28 | [
"https://Stackoverflow.com/questions/9908994",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1150948/"
] | This answer possibly needs to be updated for more recent versions of GA. I did the following to set up goals when the page is submitted via ajax.
```
$.ajax({
type: "POST",
url: "/some/page/that/does/not/have/ga/on/it.php",
data: { formData:formData },
success: function() {
... | Here's an updated answer for 2019. Linking up your Analytics account to Google Tag Manager lets you track submissions on AJAX forms in Google Analytics by either tracking all form submissions or by setting an event listener to an element's visibility (i.e. your form's confirmation/thank you message). It requires use of... |
45,841,176 | I am a beginner in Android.
I am trying to create a sample app which will open facebook inside it.
Now i want to add a back button in it, so that if from every activity it can return to its parent activity page. Otherwise just pressing android back button just throws me out of the app.
**Basic app was working fine b... | 2017/08/23 | [
"https://Stackoverflow.com/questions/45841176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6038386/"
] | After finding the [C API function that gets called under the hood](https://developers.google.com/tango/apis/c/reference/group/area-description#group___area_description_1ga07c6db409a2be634a38ae0456236e61a) and reading its docs, I found out that
>
> Since the Tango Service locks internally, other API calls (such as Tan... | Under the hood, `SaveCurrent()` uses a **System.Xml.Serialization.XmlSerializer** which is, according to [msdn](https://msdn.microsoft.com/de-de/library/system.xml.serialization.xmlserializer%28v=vs.110%29.aspx), threadsafe.
But they initialize it with a [StreamWriter](https://msdn.microsoft.com/de-de/library/system.... |
2,151,030 | The polynomial is :
$$
\left(x-\frac{1}{1\cdot3}\right) \left(x-\frac{2}{1\cdot3\cdot5}\right) \left(x-\frac{3}{1\cdot3\cdot5\cdot7}\right) \cdots \left(x-\frac{30}{1\cdot3\cdot5\cdots61}\right)
$$
What I've done so far : The given polynomial is an expression of degree $30$. Hence, the coefficient of $x^{29}$ will be... | 2017/02/19 | [
"https://math.stackexchange.com/questions/2151030",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/397349/"
] | HINT: The sum $S\_k $ given by
$$\sum\_{n=1}^{k} \dfrac {n}{(2n+1)!!} $$
for $k=1,2,3....$ gives
$$S\_1=\frac {1}{3} \\ =\frac {1}{2}-\frac {1/2}{ 1 \cdot 3}$$
$$S\_2=\frac {1}{3} + \frac {2}{15} =\frac {7}{15} \\= \frac {1}{2}-\frac {1/2}{1 \cdot 3 \cdot 5 }$$
$$S\_3=\frac {1}{3} + \frac {2}{15} +\frac {3}{105}... | HINT:$$\underbrace{1.3,1.3.5,...,1.3.5....61}\_{30-terms} $$so
$$\underbrace{(x-\frac{1}{1.3})(x-\frac{2}{1.3.5})(x-\frac{3}{1.3.5.7})......(x-\frac{30}{1.3.5.....61})}\_{30-terms }$$we have
,to obtain $x^{29}$
we have
when you want
$x^{29}$ from $(x+a\_1)(x+a\_2)(x+a\_3)...(x+a\_{30})$ you have to find this
$$(... |
2,151,030 | The polynomial is :
$$
\left(x-\frac{1}{1\cdot3}\right) \left(x-\frac{2}{1\cdot3\cdot5}\right) \left(x-\frac{3}{1\cdot3\cdot5\cdot7}\right) \cdots \left(x-\frac{30}{1\cdot3\cdot5\cdots61}\right)
$$
What I've done so far : The given polynomial is an expression of degree $30$. Hence, the coefficient of $x^{29}$ will be... | 2017/02/19 | [
"https://math.stackexchange.com/questions/2151030",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/397349/"
] | The coefficient is $-\sum\_{i=1}^{30}\frac {i}{\prod\_{j=1}^i (2j+1)} $
Claim: let $M\_n = \prod\_{j=1}^n (2j+1) $ then $\sum\_{i=1}^{n}\frac {i}{\prod\_{j=1}^i (2j+1)}=\frac {M\_n-1}{2M\_n} $.
Proof by induction:
Base step: $1/1\*3 = \frac {3-1}{2\*3} $.
Induction step: Suppose $\sum\_{i=1}^{n}\frac {i}{\prod\_{j=... | HINT:$$\underbrace{1.3,1.3.5,...,1.3.5....61}\_{30-terms} $$so
$$\underbrace{(x-\frac{1}{1.3})(x-\frac{2}{1.3.5})(x-\frac{3}{1.3.5.7})......(x-\frac{30}{1.3.5.....61})}\_{30-terms }$$we have
,to obtain $x^{29}$
we have
when you want
$x^{29}$ from $(x+a\_1)(x+a\_2)(x+a\_3)...(x+a\_{30})$ you have to find this
$$(... |
2,151,030 | The polynomial is :
$$
\left(x-\frac{1}{1\cdot3}\right) \left(x-\frac{2}{1\cdot3\cdot5}\right) \left(x-\frac{3}{1\cdot3\cdot5\cdot7}\right) \cdots \left(x-\frac{30}{1\cdot3\cdot5\cdots61}\right)
$$
What I've done so far : The given polynomial is an expression of degree $30$. Hence, the coefficient of $x^{29}$ will be... | 2017/02/19 | [
"https://math.stackexchange.com/questions/2151030",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/397349/"
] | Let
$p\_m(x)
=\prod\_{k=1}^{m} (x-\dfrac{k}{\prod\_{j=1}^{k+1}(2j-1)})
$
Since,
in the usual way,
$\begin{array}\\
\prod\_{j=1}^{k+1}(2j-1)
&=\dfrac{\prod\_{j=1}^{2k+1}j}{\prod\_{j=1}^k(2j)}\\
&=\dfrac{(2k+1)!}{2^kk!}\\
\end{array}
$
$p\_m(x)
=\prod\_{k=1}^{m} (x-\dfrac{k2^kk!}{(2k+1)!})
$
The coefficient of $x^{m-... | HINT:$$\underbrace{1.3,1.3.5,...,1.3.5....61}\_{30-terms} $$so
$$\underbrace{(x-\frac{1}{1.3})(x-\frac{2}{1.3.5})(x-\frac{3}{1.3.5.7})......(x-\frac{30}{1.3.5.....61})}\_{30-terms }$$we have
,to obtain $x^{29}$
we have
when you want
$x^{29}$ from $(x+a\_1)(x+a\_2)(x+a\_3)...(x+a\_{30})$ you have to find this
$$(... |
2,151,030 | The polynomial is :
$$
\left(x-\frac{1}{1\cdot3}\right) \left(x-\frac{2}{1\cdot3\cdot5}\right) \left(x-\frac{3}{1\cdot3\cdot5\cdot7}\right) \cdots \left(x-\frac{30}{1\cdot3\cdot5\cdots61}\right)
$$
What I've done so far : The given polynomial is an expression of degree $30$. Hence, the coefficient of $x^{29}$ will be... | 2017/02/19 | [
"https://math.stackexchange.com/questions/2151030",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/397349/"
] | HINT: The sum $S\_k $ given by
$$\sum\_{n=1}^{k} \dfrac {n}{(2n+1)!!} $$
for $k=1,2,3....$ gives
$$S\_1=\frac {1}{3} \\ =\frac {1}{2}-\frac {1/2}{ 1 \cdot 3}$$
$$S\_2=\frac {1}{3} + \frac {2}{15} =\frac {7}{15} \\= \frac {1}{2}-\frac {1/2}{1 \cdot 3 \cdot 5 }$$
$$S\_3=\frac {1}{3} + \frac {2}{15} +\frac {3}{105}... | The coefficient is $-\sum\_{i=1}^{30}\frac {i}{\prod\_{j=1}^i (2j+1)} $
Claim: let $M\_n = \prod\_{j=1}^n (2j+1) $ then $\sum\_{i=1}^{n}\frac {i}{\prod\_{j=1}^i (2j+1)}=\frac {M\_n-1}{2M\_n} $.
Proof by induction:
Base step: $1/1\*3 = \frac {3-1}{2\*3} $.
Induction step: Suppose $\sum\_{i=1}^{n}\frac {i}{\prod\_{j=... |
2,151,030 | The polynomial is :
$$
\left(x-\frac{1}{1\cdot3}\right) \left(x-\frac{2}{1\cdot3\cdot5}\right) \left(x-\frac{3}{1\cdot3\cdot5\cdot7}\right) \cdots \left(x-\frac{30}{1\cdot3\cdot5\cdots61}\right)
$$
What I've done so far : The given polynomial is an expression of degree $30$. Hence, the coefficient of $x^{29}$ will be... | 2017/02/19 | [
"https://math.stackexchange.com/questions/2151030",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/397349/"
] | HINT: The sum $S\_k $ given by
$$\sum\_{n=1}^{k} \dfrac {n}{(2n+1)!!} $$
for $k=1,2,3....$ gives
$$S\_1=\frac {1}{3} \\ =\frac {1}{2}-\frac {1/2}{ 1 \cdot 3}$$
$$S\_2=\frac {1}{3} + \frac {2}{15} =\frac {7}{15} \\= \frac {1}{2}-\frac {1/2}{1 \cdot 3 \cdot 5 }$$
$$S\_3=\frac {1}{3} + \frac {2}{15} +\frac {3}{105}... | Let
$p\_m(x)
=\prod\_{k=1}^{m} (x-\dfrac{k}{\prod\_{j=1}^{k+1}(2j-1)})
$
Since,
in the usual way,
$\begin{array}\\
\prod\_{j=1}^{k+1}(2j-1)
&=\dfrac{\prod\_{j=1}^{2k+1}j}{\prod\_{j=1}^k(2j)}\\
&=\dfrac{(2k+1)!}{2^kk!}\\
\end{array}
$
$p\_m(x)
=\prod\_{k=1}^{m} (x-\dfrac{k2^kk!}{(2k+1)!})
$
The coefficient of $x^{m-... |
6,733,890 | Is there an application or tool that can do a preview of Android XML gradients and shapes? Is very annoying having to run app in emulator each time I modify XML, it should be a better way but Google says nothing. | 2011/07/18 | [
"https://Stackoverflow.com/questions/6733890",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/819827/"
] | As of ADT 11, the eclipse plugin allows for a preview of gradients and drawables from the View mode of the xml. In ADT 12, there is even a drawable preview within the resource chooser dialog.
Make sure you have updated to ADT 12 along with SDK Tools r12. Here are the relevant [release notes](http://developer.android.c... | Just for the record, steps to properly update, if you have Eclipse Galileo, are:
1. Update Android SDK to 12 via AVD manager ->Installed packages ->Update all.
2. Update Eclipse via -> Help->Check for updates.
It complains about some package not signed but in the end installed and worked nice and easy. |
6,733,890 | Is there an application or tool that can do a preview of Android XML gradients and shapes? Is very annoying having to run app in emulator each time I modify XML, it should be a better way but Google says nothing. | 2011/07/18 | [
"https://Stackoverflow.com/questions/6733890",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/819827/"
] | As of ADT 11, the eclipse plugin allows for a preview of gradients and drawables from the View mode of the xml. In ADT 12, there is even a drawable preview within the resource chooser dialog.
Make sure you have updated to ADT 12 along with SDK Tools r12. Here are the relevant [release notes](http://developer.android.c... | In Android Studio:
```
View -> Tool Windows -> Preview
``` |
4,068,085 | I try finding a good way to develop a software project instead of spending a lot of time in the development and coding phase but I do not find a suitable solution.
I know a little about Visio - Rational Rose - Paradigm and other UML tools.
What are the good analysis and design tools that i may use in OOP, OOD, Data S... | 2010/11/01 | [
"https://Stackoverflow.com/questions/4068085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/493325/"
] | I don't know of any tool that, out of the box, allows you to model the whole system graphically (using e.g. UML) and then generates a complete, working, full stack application (i.e. UI + Domain Logic + Persistence).
There are some options that will give you some of the above however:
1. There are various UML-based to... | I tried a few UML design tools (Dia, BOUML, Umbrello, Visio, Eclipse's UML2). However, my favourite, and unfortunately it's not open source, is [Sparx Systems Enterprise Architect](http://sparxsystems.com.au/). A little bit costy (around 200$ US a license), but it can generate code from UML, and reverse engineer code t... |
4,068,085 | I try finding a good way to develop a software project instead of spending a lot of time in the development and coding phase but I do not find a suitable solution.
I know a little about Visio - Rational Rose - Paradigm and other UML tools.
What are the good analysis and design tools that i may use in OOP, OOD, Data S... | 2010/11/01 | [
"https://Stackoverflow.com/questions/4068085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/493325/"
] | I don't know of any tool that, out of the box, allows you to model the whole system graphically (using e.g. UML) and then generates a complete, working, full stack application (i.e. UI + Domain Logic + Persistence).
There are some options that will give you some of the above however:
1. There are various UML-based to... | It seems that your question is about Model Driven Development.
You have today two options:
**First option** is to generate code from a model. Usually it takes the model xmi into entry and generate the skeleton of the application but not the business logic which are coded inside methods.
**Second option** is the live ... |
2,561 | I'm working on a project with multiple axis of movement… trying to get two motors to run at the same time in order to achieve a mix of two! | 2013/11/22 | [
"https://bricks.stackexchange.com/questions/2561",
"https://bricks.stackexchange.com",
"https://bricks.stackexchange.com/users/3120/"
] | In NXT-G if you place a block after another block it will run in succession. To get two motors running at the same time you can place two motor blocks, one at the start and the other just above or below. [Drag the sequence beam](https://i.stack.imgur.com/IKW5m.gif) (the white Technic beam) to the second block to comple... | It depends on the programming language, but assuming you're using NXT-G then the Move block may be sufficient. The Move block is designed to coordinate 2 motors so that they both rotate at the same speed over a distance. The Move block has settings for speed/power of the motion. There is a forward/backward setting. The... |
2,561 | I'm working on a project with multiple axis of movement… trying to get two motors to run at the same time in order to achieve a mix of two! | 2013/11/22 | [
"https://bricks.stackexchange.com/questions/2561",
"https://bricks.stackexchange.com",
"https://bricks.stackexchange.com/users/3120/"
] | It depends on the programming language, but assuming you're using NXT-G then the Move block may be sufficient. The Move block is designed to coordinate 2 motors so that they both rotate at the same speed over a distance. The Move block has settings for speed/power of the motion. There is a forward/backward setting. The... | do 2 starts. From the orange. :) |
2,561 | I'm working on a project with multiple axis of movement… trying to get two motors to run at the same time in order to achieve a mix of two! | 2013/11/22 | [
"https://bricks.stackexchange.com/questions/2561",
"https://bricks.stackexchange.com",
"https://bricks.stackexchange.com/users/3120/"
] | In NXT-G if you place a block after another block it will run in succession. To get two motors running at the same time you can place two motor blocks, one at the start and the other just above or below. [Drag the sequence beam](https://i.stack.imgur.com/IKW5m.gif) (the white Technic beam) to the second block to comple... | do 2 starts. From the orange. :) |
2,561 | I'm working on a project with multiple axis of movement… trying to get two motors to run at the same time in order to achieve a mix of two! | 2013/11/22 | [
"https://bricks.stackexchange.com/questions/2561",
"https://bricks.stackexchange.com",
"https://bricks.stackexchange.com/users/3120/"
] | In NXT-G if you place a block after another block it will run in succession. To get two motors running at the same time you can place two motor blocks, one at the start and the other just above or below. [Drag the sequence beam](https://i.stack.imgur.com/IKW5m.gif) (the white Technic beam) to the second block to comple... | If you want two things to run at the same time place the first just in front of but not touching the start block and the other just below the first. Click on the joiners (grey ovals on the end where blocks join) and press wire from here and tap on the first code. Do the same with the second.
[![enter image description ... |
2,561 | I'm working on a project with multiple axis of movement… trying to get two motors to run at the same time in order to achieve a mix of two! | 2013/11/22 | [
"https://bricks.stackexchange.com/questions/2561",
"https://bricks.stackexchange.com",
"https://bricks.stackexchange.com/users/3120/"
] | If you want two things to run at the same time place the first just in front of but not touching the start block and the other just below the first. Click on the joiners (grey ovals on the end where blocks join) and press wire from here and tap on the first code. Do the same with the second.
[![enter image description ... | do 2 starts. From the orange. :) |
8,421,759 | Probably my question sounds weird, but my point is: i have to compile a program using GCC, if i compile GCC from the source i will get a slight edge in terms of performances from a software compiled with the fresh new GCC? What I should expect? | 2011/12/07 | [
"https://Stackoverflow.com/questions/8421759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1036661/"
] | Not unless you're building a newer version of gcc, or enabling cloog, graphite, etc. | the performance difference usually is nothing or is negligible.
in a very rare, really very rare cases you can see noticeable difference, but not always performance improvement. degradation is possible too. |
8,421,759 | Probably my question sounds weird, but my point is: i have to compile a program using GCC, if i compile GCC from the source i will get a slight edge in terms of performances from a software compiled with the fresh new GCC? What I should expect? | 2011/12/07 | [
"https://Stackoverflow.com/questions/8421759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1036661/"
] | 1. You won't get any faster programs out of a compiler built with optimizing flags. Since a program is the compilers' output, and optimizations don't change the output of a correct program, the programs stay the same.
2. You might, however, profit from new available options if your distributor ships an incomplete compi... | the performance difference usually is nothing or is negligible.
in a very rare, really very rare cases you can see noticeable difference, but not always performance improvement. degradation is possible too. |
8,421,759 | Probably my question sounds weird, but my point is: i have to compile a program using GCC, if i compile GCC from the source i will get a slight edge in terms of performances from a software compiled with the fresh new GCC? What I should expect? | 2011/12/07 | [
"https://Stackoverflow.com/questions/8421759",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1036661/"
] | 1. You won't get any faster programs out of a compiler built with optimizing flags. Since a program is the compilers' output, and optimizations don't change the output of a correct program, the programs stay the same.
2. You might, however, profit from new available options if your distributor ships an incomplete compi... | Not unless you're building a newer version of gcc, or enabling cloog, graphite, etc. |
48,382,939 | I need to interpolate a tabled function s.t. the resulting spline has zero derivatives at ends of interval. I wrote the example using `InterpolateWithDerivatives` function, but the resulting spline doesn't cross the given points:
```
typedef Eigen::Spline<double,1> Spline1d;
typedef Eigen::SplineFitting<Spline1d> Spli... | 2018/01/22 | [
"https://Stackoverflow.com/questions/48382939",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4267059/"
] | I came across the same problem yesterday. Unfortunately there is indeed a bug in eigen. As pointed out by Andreas, the vector b was not initialized properly.
As I do not have time to track the bug in eigen, I am posting my patch here so that it may help in case someone is having the same issue.
```
--- /original/eige... | Just stumbled over the same issue. There seems to be a bug in Eigen.
First example:
```
must be 0: 0
must be 0: 7.54792e+168
must be 0: 1.90459e+185
must be 0: 7.54792e+168
must be 0: 0
```
Second example:
```
must be 0: 0
must be 0: 0
must be 0: 0
must be 0: 0
must be 0: 0
```
The right hand side vector `b` doe... |
48,382,939 | I need to interpolate a tabled function s.t. the resulting spline has zero derivatives at ends of interval. I wrote the example using `InterpolateWithDerivatives` function, but the resulting spline doesn't cross the given points:
```
typedef Eigen::Spline<double,1> Spline1d;
typedef Eigen::SplineFitting<Spline1d> Spli... | 2018/01/22 | [
"https://Stackoverflow.com/questions/48382939",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4267059/"
] | I came across the same problem yesterday. Unfortunately there is indeed a bug in eigen. As pointed out by Andreas, the vector b was not initialized properly.
As I do not have time to track the bug in eigen, I am posting my patch here so that it may help in case someone is having the same issue.
```
--- /original/eige... | I tested this, and it is fixed in the latest version of Eigen. |
1,447,319 | So here is what we were given. Let (X, $\mathscr{M}$, $\mu$) be a measure space and let E, F $\in$ $\mathscr{M}$. Prove that $\mu$(E$\Delta$F) = 0 implies $\mu$(E)=$\mu$(F). Know that E$\Delta$F = E$\setminus$F $\cup$ F$\setminus$E.
Here is what I have so far. $$(E \cup F) = (E\setminus F)\cup (E \cap F) \cup (F\setmi... | 2015/09/23 | [
"https://math.stackexchange.com/questions/1447319",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/211391/"
] | Hint: we can rewrite $E$, $\newcommand{\sdiff}{\color{darkgreen}{EΔ F}}$
$$\mu(E) = \mu(E∩[\sdiff]) + \mu(E∩ F) = \mu(\sdiff) + \mu(E∩ F) = 0+\mu(E∩ F) $$
Since $0\leq \mu(E∩ [\sdiff]) \leq \mu(\sdiff) = 0$. | What you have so far is correct, and I'm sure you realize that $E\cap F$ and
$E \Delta F$ are disjoint.
Now observe that $E = (E \cap F) \cup (E \cap F^C)$ and that these two sets are pairwise disjoint. Similarly, $F = (F \cap E) \cup (F \cap E^C)$.
Thus by countable additivity, we have that $\mu(E) = \mu(E \cap ... |
1,447,319 | So here is what we were given. Let (X, $\mathscr{M}$, $\mu$) be a measure space and let E, F $\in$ $\mathscr{M}$. Prove that $\mu$(E$\Delta$F) = 0 implies $\mu$(E)=$\mu$(F). Know that E$\Delta$F = E$\setminus$F $\cup$ F$\setminus$E.
Here is what I have so far. $$(E \cup F) = (E\setminus F)\cup (E \cap F) \cup (F\setmi... | 2015/09/23 | [
"https://math.stackexchange.com/questions/1447319",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/211391/"
] | Hint: we can rewrite $E$, $\newcommand{\sdiff}{\color{darkgreen}{EΔ F}}$
$$\mu(E) = \mu(E∩[\sdiff]) + \mu(E∩ F) = \mu(\sdiff) + \mu(E∩ F) = 0+\mu(E∩ F) $$
Since $0\leq \mu(E∩ [\sdiff]) \leq \mu(\sdiff) = 0$. | Recall that $$E\_{1}\triangle E\_{2}=\big(E\_{1}\setminus E\_{2}\big)\cup\big(E\_{2}\setminus E\_{1}\big)=\big(E\_{1}\cap E\_{2}^{C})\cup\big(E\_{2}\cap E\_{1}^{C})$$
Since $(E\_1 \setminus E\_2)$ and $(E\_2 \setminus E\_1)$ are pair-wise disjoint and the finite additivity of $\mu$ we get that:
$$ \mu\bigg[\big(E\_{1}... |
1,447,319 | So here is what we were given. Let (X, $\mathscr{M}$, $\mu$) be a measure space and let E, F $\in$ $\mathscr{M}$. Prove that $\mu$(E$\Delta$F) = 0 implies $\mu$(E)=$\mu$(F). Know that E$\Delta$F = E$\setminus$F $\cup$ F$\setminus$E.
Here is what I have so far. $$(E \cup F) = (E\setminus F)\cup (E \cap F) \cup (F\setmi... | 2015/09/23 | [
"https://math.stackexchange.com/questions/1447319",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/211391/"
] | $\mu E\Delta F = \color{red}{\mu E-\mu (F\cap E)}+\color{blue}{\mu F-\mu (F\cap E )}=0$ consider with $\mu (F\cap E )\leq \mu E$ & $\mu (F\cap E )\leq \mu F$(since $F\cap E\subseteq E$..)
thus we have sum of two positive number equal zero which give both equal zero,
$\mu (F\cap E )= \mu E=\mu F$ | What you have so far is correct, and I'm sure you realize that $E\cap F$ and
$E \Delta F$ are disjoint.
Now observe that $E = (E \cap F) \cup (E \cap F^C)$ and that these two sets are pairwise disjoint. Similarly, $F = (F \cap E) \cup (F \cap E^C)$.
Thus by countable additivity, we have that $\mu(E) = \mu(E \cap ... |
1,447,319 | So here is what we were given. Let (X, $\mathscr{M}$, $\mu$) be a measure space and let E, F $\in$ $\mathscr{M}$. Prove that $\mu$(E$\Delta$F) = 0 implies $\mu$(E)=$\mu$(F). Know that E$\Delta$F = E$\setminus$F $\cup$ F$\setminus$E.
Here is what I have so far. $$(E \cup F) = (E\setminus F)\cup (E \cap F) \cup (F\setmi... | 2015/09/23 | [
"https://math.stackexchange.com/questions/1447319",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/211391/"
] | $\mu E\Delta F = \color{red}{\mu E-\mu (F\cap E)}+\color{blue}{\mu F-\mu (F\cap E )}=0$ consider with $\mu (F\cap E )\leq \mu E$ & $\mu (F\cap E )\leq \mu F$(since $F\cap E\subseteq E$..)
thus we have sum of two positive number equal zero which give both equal zero,
$\mu (F\cap E )= \mu E=\mu F$ | Recall that $$E\_{1}\triangle E\_{2}=\big(E\_{1}\setminus E\_{2}\big)\cup\big(E\_{2}\setminus E\_{1}\big)=\big(E\_{1}\cap E\_{2}^{C})\cup\big(E\_{2}\cap E\_{1}^{C})$$
Since $(E\_1 \setminus E\_2)$ and $(E\_2 \setminus E\_1)$ are pair-wise disjoint and the finite additivity of $\mu$ we get that:
$$ \mu\bigg[\big(E\_{1}... |
345,575 | $a, b, c$ are given positive integers. I need $\sin(\alpha)$ or $\cos$ or anything simple with $\alpha$ from the equation:
$$a \sin(\alpha) - c \sin^2(\alpha) = b \cos(\alpha) - c \cos^2(\alpha)$$ | 2013/03/29 | [
"https://math.stackexchange.com/questions/345575",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/70017/"
] | With this much information, you can use $$\cos\alpha=\frac{1-\tan^2\frac\alpha2}{1+\tan^2\frac\alpha2}\text{ and } \sin\alpha=\frac{2\tan\frac\alpha2}{1+\tan^2\frac\alpha2} $$ which will give you a [Quartic Equation](http://mathworld.wolfram.com/QuarticEquation.html) in $\tan\frac\alpha2$
Once you have solved for $\ta... | In general, lab bhattacharjee's method will work. However, if $a^2+b^2=c^2$, there is a simpler solution.
If $a^2+b^2=c^2$, and $\tan(\theta)=b/a$, then this simplifies to
$$
\begin{align}
0
&=a\sin(\alpha)-b\cos(\alpha)+c\cos^2(\alpha)-c\sin^2(\alpha)\\
&=c\sin(\alpha-\theta)+c\cos(2\alpha)\\
&=c\cos(\pi/2-\alpha+\th... |
7,266,594 | I implement a method to return a dictionary in my app. But I find a memory leak using instrument, I tried to figure it out, but I still cannot find it. Can anyone help me out?
Thanks in advance, here is the code for that methods:
```
-(NSMutableDictionary *)initDict
{
NSMutableDictionary *dict = [[NSMutableDictio... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7266594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/623807/"
] | All variants are good. Here is third variant (choose wisely):
Replace
```
NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
```
with
```
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
``` | I think you just need to change the last line of `initDict` to this:
```
return [dict autorelease];
``` |
7,266,594 | I implement a method to return a dictionary in my app. But I find a memory leak using instrument, I tried to figure it out, but I still cannot find it. Can anyone help me out?
Thanks in advance, here is the code for that methods:
```
-(NSMutableDictionary *)initDict
{
NSMutableDictionary *dict = [[NSMutableDictio... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7266594",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/623807/"
] | All variants are good. Here is third variant (choose wisely):
Replace
```
NSMutableDictionary *dict = [[NSMutableDictionary alloc]init];
```
with
```
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
``` | When you are creating any object in your function and you want to return them then you should always create it in a way that those objects are autoreleased. So you should change your code like below.
```
NSMutableDictionary *dict = [[[NSMutableDictionary alloc]init]autorelease];
```
So whenever you create any object... |
21,557,396 | Getting error while updating data
```
Error converting data type nvarchar to int.
```
my code is
```
public bool UpdateData(MemberInfo memberinfo)
{
SqlCommand cmd = DataConnection.GetConnection().CreateCommand();
cmd.CommandText = "prcUpdateMemberInfo";
cmd.CommandType... | 2014/02/04 | [
"https://Stackoverflow.com/questions/21557396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2214972/"
] | As I have said in my comment, in the class definition PhoneNumber is a string but the stored procedure expects an integer. This is your problem.
I would change the stored procedure and the underlying datatable to a VARCHAR(30) or a size of your like because it is possible to have phone numbers with alphabetical charac... | Your procedure has `@PhoneNumber int` which should probably be `@PhoneNumber varchar(50)` or some other varchar length. |
27,952,290 | Not sure what caused this problem: error: '=' expected but ';' found.
```
val vectors = filtered_data_by_key.map( x => {
var temp
x._2.copyToArray(temp) // Error occurs here
(x._1, temp)
})
``` | 2015/01/14 | [
"https://Stackoverflow.com/questions/27952290",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2002387/"
] | `var temp` isn't a statement.
If you're trying to declare temp without assigning anything to it, do
```
var temp :Array[_] = _
```
But is temp supposed to be an array? then try `var temp = Array()`. `temp` needs something assigned to it before being passed into `copyToArray`. Also as you're not destructively assig... | If filtered\_data\_by\_key is an RDD of (T, Iterable), or in other words, a result of groupByKey transformation, then this can be written simply like this:
```
val vectors = filtered_data_by_key.map( { case (x, iter) => (x, iter.toArray) })
``` |
9,591,114 | I want to access a session variable from my layout master page, but you cant have a model in a layout page, so how do I access this variable? | 2012/03/06 | [
"https://Stackoverflow.com/questions/9591114",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/643493/"
] | ```
@{var sessionvar = Session["myVar"] as FooType;}
``` | You should move that logic to a child action and call the child action from the master page using `@Html.Action(...)`.
To answer the question, use the `Session` property. |
62,931,596 | Does anyone tried using the TPM key for the device CA and identity certificates in Edge Device?
Currently the device CA and the identity keys are generated in PEM files and set the path in the config.yaml as URI link.
I have generated a TPM key and generate device CA and Identity certificate with a root CA. How do I u... | 2020/07/16 | [
"https://Stackoverflow.com/questions/62931596",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13940979/"
] | Objective is to secure the certificates used by edge device using TPM for upstream(device identity) and downstream (device CA)operations.
Currently both keys above are using PEM key files which is unsafe.
**Operation example:**
*Step1: User Create TPM keys for device CA and identity keys with peristent handle under a... | Great question!
The IoT Edge runtime needs to access the TPM to automatically provision your device. See how to do it here: <https://learn.microsoft.com/en-us/azure/iot-edge/how-to-auto-provision-simulated-device-linux#give-iot-edge-access-to-the-tpm>
The way the attestation process works is like this:
*When a devic... |
37,221,510 | We have been using the SoundCloud API and it suddenly stopped working earlier this week; it now return a "Not Found" message. Nothing changed on our side as far we know, so we are wondering if there are some known changes to the API that would require code change?
Here's an example of the URL we are using to access th... | 2016/05/14 | [
"https://Stackoverflow.com/questions/37221510",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6332887/"
] | The docs do not mention `api-v2` endpoints.
>
> Unless otherwise specified, the base URL for API endpoints is:
>
>
>
> ```none
> https://api.soundcloud.com
>
> ```
>
>
Try changing the base URL; if you're using the JS SDK, make sure you have the latest version of it.
---
Looks like `api-v2` is an [undocument... | The v1 API is the one being deprecated in my opinion. the official python repository for the SoundCloud v1 API itself clarifies that. Soundcloud, as of now (since almost 2 years in fact, at the time of writing) is not accepting app registrations since they're in the middle of improving their developer platform, but it'... |
47,015,070 | I already have a table with a varchar Primary Key. This is working fine with my current .edmx.
Now I added an auto-increament identity column in that table. While I try to update the .edmx, that table is not being included in .edmx
Can't I put a varchar PK column and an auto-increament identity column in the same ta... | 2017/10/30 | [
"https://Stackoverflow.com/questions/47015070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8841449/"
] | Finally figured out.
The IT team changed the IP of my machine and added me into the Multi Media group.
Now I am able to view the Report Manager and Report Server URL as well as connect to the SSRS Engine via SSMS.
Thanks anyway for your help. | I can replicate the error on my machine running SQL server 2012, if I stop the SSRS service. To restart the SSRS service, go to 'Microsoft SQL Server 2012' then 'Configuration Tools' open 'SQL Server Configuration Manager'. Click on [](https://i.stack.imgu... |
47,015,070 | I already have a table with a varchar Primary Key. This is working fine with my current .edmx.
Now I added an auto-increament identity column in that table. While I try to update the .edmx, that table is not being included in .edmx
Can't I put a varchar PK column and an auto-increament identity column in the same ta... | 2017/10/30 | [
"https://Stackoverflow.com/questions/47015070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8841449/"
] | Finally figured out.
The IT team changed the IP of my machine and added me into the Multi Media group.
Now I am able to view the Report Manager and Report Server URL as well as connect to the SSRS Engine via SSMS.
Thanks anyway for your help. | I am again facing the same issue. I believe the problem is due to permission issues. How do I provide Admin privileges to the Windows user account that I am using ? |
254,081 | I am not able to understand the meaning of the following sentence
>
> It can only be more applicable, now that a fresh law that aims for a greater transformative effect, the Rights of Persons with Disabilities Act, 2016, is in place.
>
>
>
[To Read Full Article](https://www.thehindu.com/opinion/editorial/for-equ... | 2020/07/17 | [
"https://ell.stackexchange.com/questions/254081",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/77972/"
] | "Has gone" is somewhat more idiomatic here. The distinction is that "has gone" only states that the event existed, whereas "went" focuses on the specific day when the event happened. Here are some clearer examples:
1. "What's your fastest time in the mile?" "I've run it as fast as 4:37."
2. "What's your fastest time i... | Green\_ideas is correct. “Went” is clear, understandable and correct.
He failed, left, and went. All the same tense. All in the correct order of time.
He failed, left, and has gone. Change of tense, all in the correct order of time. The change of tense merely gives a slight feeling of contrast between his academic re... |
10,349,685 | I know this question has been asked many times and the answer is always "No we cant disable home button".
I have a little different query to ask.
I wrote simple code in which my activity overrides the onKeyDown() and return true for all key presses.
In theory this means whoever opens the application is stuck there a... | 2012/04/27 | [
"https://Stackoverflow.com/questions/10349685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1360973/"
] | >
> I know this question has been asked many times and the answer is always "No we cant disable home button".
>
>
>
If you want to handle the HOME button, implement a home screen.
>
> Does any one have any idea , why different devices are behaving differently
>
>
>
Because they are different devices, and the... | As mentioned in my question itself for devices below 2.3.6 OS overriding `keypress()` functions work well.
Issue starts with 2.3.6 onwards. I don't know what these device vendors have done but `keypress()` function does not functions same on all devices.
Also from ICS onwards google has stopped using `keypress()` fun... |
10,349,685 | I know this question has been asked many times and the answer is always "No we cant disable home button".
I have a little different query to ask.
I wrote simple code in which my activity overrides the onKeyDown() and return true for all key presses.
In theory this means whoever opens the application is stuck there a... | 2012/04/27 | [
"https://Stackoverflow.com/questions/10349685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1360973/"
] | You may want to give this a try:
```
@Override
public void onBackPressed() {
}
@Override
protected void onUserLeaveHint() {
super.onUserLeaveHint();
((ActivityManager) getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE)).moveTaskToFront(getTaskId(), 0);
}
@Override
protected void onPause() {
... | As mentioned in my question itself for devices below 2.3.6 OS overriding `keypress()` functions work well.
Issue starts with 2.3.6 onwards. I don't know what these device vendors have done but `keypress()` function does not functions same on all devices.
Also from ICS onwards google has stopped using `keypress()` fun... |
38,506,282 | I have an UITextField which user sets its luggage weight as numbers in TextField. I want to set that textfields value with weight mark (for ex 10 KG which comes from user settings) so whatever user types, there will be KG mark at the end of its textfield. Is there any way for it? | 2016/07/21 | [
"https://Stackoverflow.com/questions/38506282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4183335/"
] | do like
initially clear the value when begin start
```
func textFieldShouldBeginEditing(textField: UITextField) {
textField.text = ""
}
```
when editing is over append the kg
```
func textFieldDidEndEditing(textField: UITextField) {
yourTextfieldName.text = "\(textField.text!) KG"
}
```
**Choice-2**
```
func ... | You could place a "Label" next to the UITextField.
And then just change the text of the Label to whatever the user selects.
OR (but i dont know if that works), try to get the text form the textfield, add the unit (as a string) to the string from the textfield. |
59,234,200 | \*\*\* UPDATE \*\*\*\*
The additional letter "A" was a problem. I'm rephrasing this here. Perhaps clearer?
I have to replace values in a list using a dictionary which has lists of variable lengths as its values. For example:
```
variants = {C:["cat", "can", "car"], D:["do","die"], Z:["zen", "zoo"]}
```
And a list:
... | 2019/12/08 | [
"https://Stackoverflow.com/questions/59234200",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3116297/"
] | The first thing is to make the initial condition calculated with `fixed_initial=False` option when you specify `x=m.Var()`. The model building function `m.fix()` can fix any point in the horizon such as with `m.fix(x,pos=3,val=6)` but this also fixes the derivative at that point.
An alternative method is to specify an... | The [Bryson benchmark problem (see #2)](https://apmonitor.com/do/index.php/Main/MidtermExam2016) shows four ways to fix values that are not initial conditions.
```py
if option == 1:
# most likely to cause DOF issues because of many
# zero (0==0) equations
m.Equation(final*x1 == 0)
m.Equation(final*x... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.