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 |
|---|---|---|---|---|---|
61,183,080 | When I am trying to play the video I am getting this exception below.
>
> \*\*\* Assertion failure in -[CustomSlider \_setValue:minValue:maxValue:andSendAction:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3698.119.2/UISlider.m:1477
>
>
> \*\*\* Terminating app due to uncaught exception 'NSInte... | 2020/04/13 | [
"https://Stackoverflow.com/questions/61183080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5769997/"
] | The slider's maximum value is nan which means the duration of your avPlayer is indefinite, you can get an estimate using:
```
let newDurationSeconds = Float(currentItem.asset.duration.seconds ?? 00)
``` | This error comes when duration is to be .Nan, Use this code to fix it
```
if let duration = musicPlayer.instance.player.currentItem?.duration {
guard duration.isNaN else {
return
}
let seconds : Float64 = duration
self.sliderAudio.maximumValue = Float... |
61,183,080 | When I am trying to play the video I am getting this exception below.
>
> \*\*\* Assertion failure in -[CustomSlider \_setValue:minValue:maxValue:andSendAction:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3698.119.2/UISlider.m:1477
>
>
> \*\*\* Terminating app due to uncaught exception 'NSInte... | 2020/04/13 | [
"https://Stackoverflow.com/questions/61183080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5769997/"
] | The error message says that `maximumValue` is NaN (not-a-number), which means `newDurationSeconds` is not a number, which means `currentItem.duration.seconds` is not a number. Check to make sure it's not NaN before using it, like this:
```
[...]
guard currentItem.duration >= .zero, !currentItem.duration.seconds.isNaN ... | This error comes when duration is to be .Nan, Use this code to fix it
```
if let duration = musicPlayer.instance.player.currentItem?.duration {
guard duration.isNaN else {
return
}
let seconds : Float64 = duration
self.sliderAudio.maximumValue = Float... |
1,559,378 | I'm planning to automate the FAQ section in my site where the questions and answers stored in standard DB and would like to get the input question from the user and recognize it (**algorithm**) and get the appropriate answer for that and return it to the user.
Approach :
get input string -> parse -> check words with e... | 2009/10/13 | [
"https://Stackoverflow.com/questions/1559378",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/167885/"
] | When I was working on some code for automatic selection of questions and answers from a FAQ collection, I ended up extracting keywords from the answers and setting scores on them. Then I checked all keywords against the question asked and the highest-scoring Q&A pair was presented.
A slight improvement would be to pre... | One simple approach would be to first filter unnecessary words like 'how' and 'and' and so on. Then query the DB for the important words and generate a score for the matches. |
330,762 | I'm trying to build an architecture where I have a Domain project with all my domain models, an Infrastructure project with my Services and Infrastructure.Entity with my Repositories and entities.
However, I'm a little confused on what's the best way to pass objects between the different layers.
The presentation laye... | 2016/09/11 | [
"https://softwareengineering.stackexchange.com/questions/330762",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/245695/"
] | Ideally, you have *separate* domain models **and** data transfer objects (DTO). The domain model is a model per layer or *domain*. For example, the UI layer and the business logic layer should have their own domain objects.
You use DTO's to pass "data" between the layers.
```
[UI Layer] <- UserDto -> [Business logic ... | If you look at the CQRS pattern you'll note that domain operations boil down to commands. In this case I'd see it completely fine to define a delete command as just requiring the ID. Also using this pattern allows you complete flexibility in how the data is represented and does not tie one down to how the domain entiti... |
330,762 | I'm trying to build an architecture where I have a Domain project with all my domain models, an Infrastructure project with my Services and Infrastructure.Entity with my Repositories and entities.
However, I'm a little confused on what's the best way to pass objects between the different layers.
The presentation laye... | 2016/09/11 | [
"https://softwareengineering.stackexchange.com/questions/330762",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/245695/"
] | If you look at the CQRS pattern you'll note that domain operations boil down to commands. In this case I'd see it completely fine to define a delete command as just requiring the ID. Also using this pattern allows you complete flexibility in how the data is represented and does not tie one down to how the domain entiti... | You have some concepts need to clarify first before going further.
Let me get it for you, as those are the things I had scratched my head about.
1. Controller (this is self explanation): the interface (maybe web view, desktop app view, mobile view, or API endpoints) of the application with external system, or user.
... |
330,762 | I'm trying to build an architecture where I have a Domain project with all my domain models, an Infrastructure project with my Services and Infrastructure.Entity with my Repositories and entities.
However, I'm a little confused on what's the best way to pass objects between the different layers.
The presentation laye... | 2016/09/11 | [
"https://softwareengineering.stackexchange.com/questions/330762",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/245695/"
] | Ideally, you have *separate* domain models **and** data transfer objects (DTO). The domain model is a model per layer or *domain*. For example, the UI layer and the business logic layer should have their own domain objects.
You use DTO's to pass "data" between the layers.
```
[UI Layer] <- UserDto -> [Business logic ... | You have some concepts need to clarify first before going further.
Let me get it for you, as those are the things I had scratched my head about.
1. Controller (this is self explanation): the interface (maybe web view, desktop app view, mobile view, or API endpoints) of the application with external system, or user.
... |
3,906,701 | Generate three random numbers independently and uniformly distributed in $(0,1)$. Let $X$ be the smallest of these three numbers and $Y$ the biggest.
(a) Do you expect $X$ and $Y$ are positively correlated, negatively correlated, or uncorrelated? Explain your reasoning intuitively then find the value of the correlatio... | 2020/11/14 | [
"https://math.stackexchange.com/questions/3906701",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/849289/"
] | Since $a\in Ha=bH$, we have $a=bh$ for some $h\in H$. Therefore, $$aH=(bh)H=b(hH)=bH=Ha.$$
Since $ab^{-1}=h\in H$, we have $Ha=Hb$.
Hence we conclude that $aH=Ha=Hb$. | A (left or right) [coset](https://en.wikipedia.org/wiki/Coset#Definition) is generated by any of its elements.
Therefore $Ha=aH$ ( since $= bH$ a left coset, and contains $a$).
Similarly $bH = Hb$. |
27,325,974 | I am expressing the algorithms in pseudo code. I'm just wondering if my design works just as well as the original one displayed below. The algorithm is supposed to compute the sum of n odd positive integers.
This is how the algorithm should look:
```
procedure sumofodds(n:positive integer)
if n = 1
return... | 2014/12/05 | [
"https://Stackoverflow.com/questions/27325974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1516501/"
] | One small improvement that *might* help is defining it with tail recursion. Tail recursion happens when the very last thing to execute is the recursive call. To make this tail recursive, use a helper method and pass the running sum as a parameter. I'm pretty sure the pseudo code below is tail recursive since, regardles... | Let me suggest that you implement your idea in Python. You may be surprised to see that the working code is very similar to pseudocode.
This is the original algorithm:
```py
def sum_of_n_odds(n):
if n == 1:
return 1
else:
return sum_of_n_odds(n-1) + (2*n-1)
```
And this is the one you wrote:
```py
def ... |
27,325,974 | I am expressing the algorithms in pseudo code. I'm just wondering if my design works just as well as the original one displayed below. The algorithm is supposed to compute the sum of n odd positive integers.
This is how the algorithm should look:
```
procedure sumofodds(n:positive integer)
if n = 1
return... | 2014/12/05 | [
"https://Stackoverflow.com/questions/27325974",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1516501/"
] | Your algorithm is not the same as the original.
The original computes the sum of the first n odd numbers.
Your algorithm computes the sum of all the odd numbers in the range 1..n.
So for an input of n=3, the first algorithm will compute 1+3+5, while your algorithm will compute 1+3.
(If you want a quicker way, then ... | Let me suggest that you implement your idea in Python. You may be surprised to see that the working code is very similar to pseudocode.
This is the original algorithm:
```py
def sum_of_n_odds(n):
if n == 1:
return 1
else:
return sum_of_n_odds(n-1) + (2*n-1)
```
And this is the one you wrote:
```py
def ... |
58,571,618 | Please someone tell and explain the correct answer to the following Multiple Choice Question?
You have a query that filters a BigQuery table using a WHERE clause on timestamp and ID columns. By using `bq query β-dry_run` you learn that the query triggers a full scan of the table, even though the filter on timestamp an... | 2019/10/26 | [
"https://Stackoverflow.com/questions/58571618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12195971/"
] | Some elements like `select` and `input type="checkbox"` are hard, if not impossible, to style with regard to many of their styling properties.
I'd suggest you use the common checkbox replacement technique:
```css
input[type=checkbox] { display: none; }
input[type=checkbox] + label {
padding-left: 30px;
positio... | As connexo mentioned, checkboxes are hard to style and you can replace them entirely. You can also use `outline` if you really want to keep the actual checkbox but style it red.
Personally, I would use a CSS class and the `classList.add` or `classList.toggle` methods rather than styling the elements directly.
```js
c... |
58,571,618 | Please someone tell and explain the correct answer to the following Multiple Choice Question?
You have a query that filters a BigQuery table using a WHERE clause on timestamp and ID columns. By using `bq query β-dry_run` you learn that the query triggers a full scan of the table, even though the filter on timestamp an... | 2019/10/26 | [
"https://Stackoverflow.com/questions/58571618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12195971/"
] | Some elements like `select` and `input type="checkbox"` are hard, if not impossible, to style with regard to many of their styling properties.
I'd suggest you use the common checkbox replacement technique:
```css
input[type=checkbox] { display: none; }
input[type=checkbox] + label {
padding-left: 30px;
positio... | Thanks for all your answers. I've manage to fix it! I discovered that I had deleted several lines in the CSS regarding the label part. Now everything works fine, many thanks! |
17,917,788 | `Facebook::api` method has [documentation](https://developers.facebook.com/docs/reference/php/facebook-api/) as follows:
First parameter is path:
Description of parameter:
The Graph API path for the request, e.g. "/me" for the logged in user's profile.
Following documentation, there is an example how `$path` argum... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17917788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/746393/"
] | If you are trying to add a library, go to
File -> Project Structure -> Libraries -> click + then add the jar.
Once it has been added, it will ask you for the module which is dependent on jar. Select ProjectA from the list. That should link the library to Module. | After setup dependencies in build.gradle:
try "Tools -> Android -> Sync Project with Gradle Files" |
17,917,788 | `Facebook::api` method has [documentation](https://developers.facebook.com/docs/reference/php/facebook-api/) as follows:
First parameter is path:
Description of parameter:
The Graph API path for the request, e.g. "/me" for the logged in user's profile.
Following documentation, there is an example how `$path` argum... | 2013/07/29 | [
"https://Stackoverflow.com/questions/17917788",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/746393/"
] | If you are trying to add a library, go to
File -> Project Structure -> Libraries -> click + then add the jar.
Once it has been added, it will ask you for the module which is dependent on jar. Select ProjectA from the list. That should link the library to Module. | Set up you configs like this:
**/settings.gradle**
```
include ':LibA', ':progect'
```
**/project/build.gradle**
```
apply plugin: 'android'
dependencies {
compile project(':LibA')
}
android {
compileSdkVersion 18
buildToolsVersion "18"
defaultConfig {
minSdkVersion 7
targetSdkV... |
45,855,685 | I am making a common header and footer which will be used throughout in all the HTML pages. My page has a white header and white footer and the body is grey colored. Now, my work demands to achieve as below:
[](https://i.stack.imgur.com/EO3tl.png)
Wh... | 2017/08/24 | [
"https://Stackoverflow.com/questions/45855685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/982402/"
] | That is because of the default (*user agent* stylesheet) `margin` applied by the browser on the `body` tag - see how the *white stripes* vanish when I set `margin: 0` for `body`.
Demo below:
```css
body {
margin: 0;
}
main {
background-color: lightgrey;
padding: 50px;
}
header {
background-colo... | you can try giving the `main` tag a `margin: 0 -10px`, may solve your problem.
[See the fiddle](https://jsfiddle.net/dyx5pxq8/) |
45,855,685 | I am making a common header and footer which will be used throughout in all the HTML pages. My page has a white header and white footer and the body is grey colored. Now, my work demands to achieve as below:
[](https://i.stack.imgur.com/EO3tl.png)
Wh... | 2017/08/24 | [
"https://Stackoverflow.com/questions/45855685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/982402/"
] | That is because of the default (*user agent* stylesheet) `margin` applied by the browser on the `body` tag - see how the *white stripes* vanish when I set `margin: 0` for `body`.
Demo below:
```css
body {
margin: 0;
}
main {
background-color: lightgrey;
padding: 50px;
}
header {
background-colo... | you can add this code in your css:
```
body {
display: initial;
}
``` |
45,855,685 | I am making a common header and footer which will be used throughout in all the HTML pages. My page has a white header and white footer and the body is grey colored. Now, my work demands to achieve as below:
[](https://i.stack.imgur.com/EO3tl.png)
Wh... | 2017/08/24 | [
"https://Stackoverflow.com/questions/45855685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/982402/"
] | That is because of the default (*user agent* stylesheet) `margin` applied by the browser on the `body` tag - see how the *white stripes* vanish when I set `margin: 0` for `body`.
Demo below:
```css
body {
margin: 0;
}
main {
background-color: lightgrey;
padding: 50px;
}
header {
background-colo... | Try the following:
`html, body {margin: 0;}` |
45,855,685 | I am making a common header and footer which will be used throughout in all the HTML pages. My page has a white header and white footer and the body is grey colored. Now, my work demands to achieve as below:
[](https://i.stack.imgur.com/EO3tl.png)
Wh... | 2017/08/24 | [
"https://Stackoverflow.com/questions/45855685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/982402/"
] | add `body{margin:0}` in your stylesheet.
By default `body` tag have margin of `8px` in most major browsers.
```css
body{
margin:0
}
main {
background-color: lightgrey;
padding: 50px;
}
header {
background-color: white;
width: 100%;
height: 50px;
}
.content-section... | you can try giving the `main` tag a `margin: 0 -10px`, may solve your problem.
[See the fiddle](https://jsfiddle.net/dyx5pxq8/) |
45,855,685 | I am making a common header and footer which will be used throughout in all the HTML pages. My page has a white header and white footer and the body is grey colored. Now, my work demands to achieve as below:
[](https://i.stack.imgur.com/EO3tl.png)
Wh... | 2017/08/24 | [
"https://Stackoverflow.com/questions/45855685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/982402/"
] | add `body{margin:0}` in your stylesheet.
By default `body` tag have margin of `8px` in most major browsers.
```css
body{
margin:0
}
main {
background-color: lightgrey;
padding: 50px;
}
header {
background-color: white;
width: 100%;
height: 50px;
}
.content-section... | you can add this code in your css:
```
body {
display: initial;
}
``` |
45,855,685 | I am making a common header and footer which will be used throughout in all the HTML pages. My page has a white header and white footer and the body is grey colored. Now, my work demands to achieve as below:
[](https://i.stack.imgur.com/EO3tl.png)
Wh... | 2017/08/24 | [
"https://Stackoverflow.com/questions/45855685",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/982402/"
] | add `body{margin:0}` in your stylesheet.
By default `body` tag have margin of `8px` in most major browsers.
```css
body{
margin:0
}
main {
background-color: lightgrey;
padding: 50px;
}
header {
background-color: white;
width: 100%;
height: 50px;
}
.content-section... | Try the following:
`html, body {margin: 0;}` |
49,791 | I don't know if takeoff would be the right term, but the wing should generate lift with any headwind. | 2018/03/25 | [
"https://aviation.stackexchange.com/questions/49791",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/29991/"
] | It could, but eventually drag would cause the ultralight to start moving in the same direction as the wind and it would lose any apparent forward airspeed. | A wing will produce lift when exposed to a headwind. And yes, if the wind is strong enough, a properly tethered airplane, ultralight or not, will 'become unstuck'. |
49,791 | I don't know if takeoff would be the right term, but the wing should generate lift with any headwind. | 2018/03/25 | [
"https://aviation.stackexchange.com/questions/49791",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/29991/"
] | A wing will produce lift when exposed to a headwind. And yes, if the wind is strong enough, a properly tethered airplane, ultralight or not, will 'become unstuck'. | The ultralight could takeoff with a strong enough headwind, but would be blown away in the process. This would not only be..ahem...very dangerous, but would cause the ultralight to lose a lot of airspeed. If it were tethered to the ground, it would fly like a kite. The wind would pick it up, and the strings or rope wou... |
49,791 | I don't know if takeoff would be the right term, but the wing should generate lift with any headwind. | 2018/03/25 | [
"https://aviation.stackexchange.com/questions/49791",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/29991/"
] | It could, but eventually drag would cause the ultralight to start moving in the same direction as the wind and it would lose any apparent forward airspeed. | The ultralight could takeoff with a strong enough headwind, but would be blown away in the process. This would not only be..ahem...very dangerous, but would cause the ultralight to lose a lot of airspeed. If it were tethered to the ground, it would fly like a kite. The wind would pick it up, and the strings or rope wou... |
61,507 | In the movie *Futari no Hero*, Todoroki only stares at Momo in her yellow dress when she came through the door and did not look at any other girl but her. They also had a heart-to-heart conversation when training with Eraser Head in Season 2.
**Does Todoroki like Momo romantically?** I don't ship them, I just watch ho... | 2021/01/05 | [
"https://anime.stackexchange.com/questions/61507",
"https://anime.stackexchange.com",
"https://anime.stackexchange.com/users/58048/"
] | It's a possibility, but not one you could call obvious.
If you look at the characters, most of the boys and girls form some kind of pairing considering their friendships, which could evolve to romance.
Kirishima with Ashido, Jiro with Kaminari, Hagakure with Ojiro. And of course, Izuku with Ochako, the one ship which ... | According to [this website](https://www.epicdope.com/who-do-you-think-has-a-crush-on-momo-in-mha) (caution - contains a small spoiler):
>
> Momo Yaoyorozu likes Todoroki; however, both of them are caught up in their own issues at the moment and do not have the time to engage romantically. As the series progresses, th... |
31,180,108 | Hi I'm really new in this. I have the code for an expandable listview. when clicked on the child items, it simply display a toast of the same text. I want to open a new activity when we click on any child item. Any help will be much appreciated.
```css
MyExpandableAdapter
public class MyExpandableAdapter extends Bas... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31180108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4985129/"
] | This code should work
```
<table class="tablematrix content table-striped">
<?php
$total=7;
$tr=$total;
$count=1;
for($i=1;$i<=$tr;$i++)
{
echo '<tr>';
for($j=1;$j<=4;$j++)
{
echo '<td>'.$count.'</td>';
$count=$count+1;
}
echo '</tr>';
}
?>
</table>
```
Please try this. You are... | Amount of columns = "" => 4.
Amount of Rows = "" = ?
Look at this part of your code
```
echo '<tr>';
for($j=1;$j<=$total;$j++)
{
echo '<td>'.$j.'</td>';
}
echo '</tr>';
```
you have set $total to 7 so you are runing 7 times and creating 7 columns instead of row which would have ... |
31,180,108 | Hi I'm really new in this. I have the code for an expandable listview. when clicked on the child items, it simply display a toast of the same text. I want to open a new activity when we click on any child item. Any help will be much appreciated.
```css
MyExpandableAdapter
public class MyExpandableAdapter extends Bas... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31180108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4985129/"
] | Check this code:
```
<table class="tablematrix content table-striped">
<?php
$row=6;
$col=4;
$total=$row*$col;
echo "<tr>";
for($i=1;$i<=$total;$i++)
{
echo "<td>".$i."</td>";
if($i%$col==0)
{ echo '</tr>';
if($i!=$total)
echo '<tr>';
}
}
?>
</table>
```
OR
```
<table class="tablematrix conten... | Amount of columns = "" => 4.
Amount of Rows = "" = ?
Look at this part of your code
```
echo '<tr>';
for($j=1;$j<=$total;$j++)
{
echo '<td>'.$j.'</td>';
}
echo '</tr>';
```
you have set $total to 7 so you are runing 7 times and creating 7 columns instead of row which would have ... |
31,180,108 | Hi I'm really new in this. I have the code for an expandable listview. when clicked on the child items, it simply display a toast of the same text. I want to open a new activity when we click on any child item. Any help will be much appreciated.
```css
MyExpandableAdapter
public class MyExpandableAdapter extends Bas... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31180108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4985129/"
] | This code should work
```
<table class="tablematrix content table-striped">
<?php
$total=7;
$tr=$total;
$count=1;
for($i=1;$i<=$tr;$i++)
{
echo '<tr>';
for($j=1;$j<=4;$j++)
{
echo '<td>'.$count.'</td>';
$count=$count+1;
}
echo '</tr>';
}
?>
</table>
```
Please try this. You are... | Here you have:
```
<?php
$rows = 6;
$cols = 4;
for ($i = 1; $i <= $rows; $i++) {
echo '<tr>';
for ($l = 1; $l <= $cols; $l++) {
echo '<td>'.((($i - 1) * $cols) + $l).'</td>';
}
echo '</tr>';
}
?>
```
Tested, should do the job.. |
31,180,108 | Hi I'm really new in this. I have the code for an expandable listview. when clicked on the child items, it simply display a toast of the same text. I want to open a new activity when we click on any child item. Any help will be much appreciated.
```css
MyExpandableAdapter
public class MyExpandableAdapter extends Bas... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31180108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4985129/"
] | This code should work
```
<table class="tablematrix content table-striped">
<?php
$total=7;
$tr=$total;
$count=1;
for($i=1;$i<=$tr;$i++)
{
echo '<tr>';
for($j=1;$j<=4;$j++)
{
echo '<td>'.$count.'</td>';
$count=$count+1;
}
echo '</tr>';
}
?>
</table>
```
Please try this. You are... | Check this code:
```
<table class="tablematrix content table-striped">
<?php
$row=6;
$col=4;
$total=$row*$col;
echo "<tr>";
for($i=1;$i<=$total;$i++)
{
echo "<td>".$i."</td>";
if($i%$col==0)
{ echo '</tr>';
if($i!=$total)
echo '<tr>';
}
}
?>
</table>
```
OR
```
<table class="tablematrix conten... |
31,180,108 | Hi I'm really new in this. I have the code for an expandable listview. when clicked on the child items, it simply display a toast of the same text. I want to open a new activity when we click on any child item. Any help will be much appreciated.
```css
MyExpandableAdapter
public class MyExpandableAdapter extends Bas... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31180108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4985129/"
] | This code should work
```
<table class="tablematrix content table-striped">
<?php
$total=7;
$tr=$total;
$count=1;
for($i=1;$i<=$tr;$i++)
{
echo '<tr>';
for($j=1;$j<=4;$j++)
{
echo '<td>'.$count.'</td>';
$count=$count+1;
}
echo '</tr>';
}
?>
</table>
```
Please try this. You are... | You can use this function. It can be optimised not to use $tmp variable
```
function createHtmlMatrix ($w, $h) {
$matrixHtml = '<table class="tablematrix content table-striped">';
$tmp = 0;
for ($i = 0 ; $i < $h ; ++$i) {
$matrixHtml .= '<tr>';
for ($j = 0 ; $j < $w ; ++$j) {
... |
31,180,108 | Hi I'm really new in this. I have the code for an expandable listview. when clicked on the child items, it simply display a toast of the same text. I want to open a new activity when we click on any child item. Any help will be much appreciated.
```css
MyExpandableAdapter
public class MyExpandableAdapter extends Bas... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31180108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4985129/"
] | This code should work
```
<table class="tablematrix content table-striped">
<?php
$total=7;
$tr=$total;
$count=1;
for($i=1;$i<=$tr;$i++)
{
echo '<tr>';
for($j=1;$j<=4;$j++)
{
echo '<td>'.$count.'</td>';
$count=$count+1;
}
echo '</tr>';
}
?>
</table>
```
Please try this. You are... | try this
```
<?php
$row = 6;
$column = 3;
echo "<table style = 'border: 1px solid black'>";
for($x= 0; $x<= $row; $x++){
echo "<tr>";
for($y=0; $y<= $column; $y++){
echo "<td>";
echo $y;
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
?>
``` |
31,180,108 | Hi I'm really new in this. I have the code for an expandable listview. when clicked on the child items, it simply display a toast of the same text. I want to open a new activity when we click on any child item. Any help will be much appreciated.
```css
MyExpandableAdapter
public class MyExpandableAdapter extends Bas... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31180108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4985129/"
] | Check this code:
```
<table class="tablematrix content table-striped">
<?php
$row=6;
$col=4;
$total=$row*$col;
echo "<tr>";
for($i=1;$i<=$total;$i++)
{
echo "<td>".$i."</td>";
if($i%$col==0)
{ echo '</tr>';
if($i!=$total)
echo '<tr>';
}
}
?>
</table>
```
OR
```
<table class="tablematrix conten... | Here you have:
```
<?php
$rows = 6;
$cols = 4;
for ($i = 1; $i <= $rows; $i++) {
echo '<tr>';
for ($l = 1; $l <= $cols; $l++) {
echo '<td>'.((($i - 1) * $cols) + $l).'</td>';
}
echo '</tr>';
}
?>
```
Tested, should do the job.. |
31,180,108 | Hi I'm really new in this. I have the code for an expandable listview. when clicked on the child items, it simply display a toast of the same text. I want to open a new activity when we click on any child item. Any help will be much appreciated.
```css
MyExpandableAdapter
public class MyExpandableAdapter extends Bas... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31180108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4985129/"
] | Check this code:
```
<table class="tablematrix content table-striped">
<?php
$row=6;
$col=4;
$total=$row*$col;
echo "<tr>";
for($i=1;$i<=$total;$i++)
{
echo "<td>".$i."</td>";
if($i%$col==0)
{ echo '</tr>';
if($i!=$total)
echo '<tr>';
}
}
?>
</table>
```
OR
```
<table class="tablematrix conten... | You can use this function. It can be optimised not to use $tmp variable
```
function createHtmlMatrix ($w, $h) {
$matrixHtml = '<table class="tablematrix content table-striped">';
$tmp = 0;
for ($i = 0 ; $i < $h ; ++$i) {
$matrixHtml .= '<tr>';
for ($j = 0 ; $j < $w ; ++$j) {
... |
31,180,108 | Hi I'm really new in this. I have the code for an expandable listview. when clicked on the child items, it simply display a toast of the same text. I want to open a new activity when we click on any child item. Any help will be much appreciated.
```css
MyExpandableAdapter
public class MyExpandableAdapter extends Bas... | 2015/07/02 | [
"https://Stackoverflow.com/questions/31180108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4985129/"
] | Check this code:
```
<table class="tablematrix content table-striped">
<?php
$row=6;
$col=4;
$total=$row*$col;
echo "<tr>";
for($i=1;$i<=$total;$i++)
{
echo "<td>".$i."</td>";
if($i%$col==0)
{ echo '</tr>';
if($i!=$total)
echo '<tr>';
}
}
?>
</table>
```
OR
```
<table class="tablematrix conten... | try this
```
<?php
$row = 6;
$column = 3;
echo "<table style = 'border: 1px solid black'>";
for($x= 0; $x<= $row; $x++){
echo "<tr>";
for($y=0; $y<= $column; $y++){
echo "<td>";
echo $y;
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
?>
``` |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | You can use `rrapply::rrapply`:
```r
library(rrapply)
firstList1 <- rrapply(list1, how = "flatten")[[1]]
firstList2 <- rrapply(list2, how = "flatten")[[1]]
all.equal(firstList1, firstList2)
# [1] TRUE
```
output
```r
> rrapply(list1, how = "flatten")[[1]]
Time Series:
Start = 1
End = 100
Frequency = 1
[1] ... | Another possible solution, using `purrr::pluck` and `purrr::vec_depth`:
```r
library(tidyverse)
pluck(list1, !!!(rep(1, vec_depth(list1)-2) %>% as.list()))
#> Time Series:
#> Start = 1
#> End = 100
#> Frequency = 1
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#> [19] 19 20 ... |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | Another base R solution - you could do this with a recursive function:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matrix(rnorm(10))),
NA)
recursive_fun <- function(my_list) ... | Another possible solution, using `purrr::pluck` and `purrr::vec_depth`:
```r
library(tidyverse)
pluck(list1, !!!(rep(1, vec_depth(list1)-2) %>% as.list()))
#> Time Series:
#> Start = 1
#> End = 100
#> Frequency = 1
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#> [19] 19 20 ... |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | Another base R solution - you could do this with a recursive function:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matrix(rnorm(10))),
NA)
recursive_fun <- function(my_list) ... | **base R solution** I've just got the idea for a pretty simple function. It is a `while` loop that runs until the element is not a list.
```
myfun <- function(mylist){
dig_deeper <- TRUE
while(dig_deeper){
mylist<- my_list[[1]]
dig_deeper <- is.list(mylist)
}
return(mylist)
}
```
It works as expected... |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | You can use `rrapply::rrapply`:
```r
library(rrapply)
firstList1 <- rrapply(list1, how = "flatten")[[1]]
firstList2 <- rrapply(list2, how = "flatten")[[1]]
all.equal(firstList1, firstList2)
# [1] TRUE
```
output
```r
> rrapply(list1, how = "flatten")[[1]]
Time Series:
Start = 1
End = 100
Frequency = 1
[1] ... | **base R solution** I've just got the idea for a pretty simple function. It is a `while` loop that runs until the element is not a list.
```
myfun <- function(mylist){
dig_deeper <- TRUE
while(dig_deeper){
mylist<- my_list[[1]]
dig_deeper <- is.list(mylist)
}
return(mylist)
}
```
It works as expected... |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | You can use `rrapply::rrapply`:
```r
library(rrapply)
firstList1 <- rrapply(list1, how = "flatten")[[1]]
firstList2 <- rrapply(list2, how = "flatten")[[1]]
all.equal(firstList1, firstList2)
# [1] TRUE
```
output
```r
> rrapply(list1, how = "flatten")[[1]]
Time Series:
Start = 1
End = 100
Frequency = 1
[1] ... | We can combine `while` loop with `purrr::pluck`. This avoids an actual recursive function, which could be a problem with deeply nested lists.
```
library(purrr)
get_list <- function(x){
while(is.list(x)){
x <- pluck(x, 1)
}
x
}
```
We can also set the function to be c... |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | Another base R solution - you could do this with a recursive function:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matrix(rnorm(10))),
NA)
recursive_fun <- function(my_list) ... | We can combine `while` loop with `purrr::pluck`. This avoids an actual recursive function, which could be a problem with deeply nested lists.
```
library(purrr)
get_list <- function(x){
while(is.list(x)){
x <- pluck(x, 1)
}
x
}
```
We can also set the function to be c... |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | Using a `while` loop :
```r
x <- list1
while (inherits(x <- x[[1]], "list")) {}
x
#> Time Series:
#> Start = 1
#> End = 100
#> Frequency = 1
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#> [19] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#> [37] 37 ... | **base R solution** I've just got the idea for a pretty simple function. It is a `while` loop that runs until the element is not a list.
```
myfun <- function(mylist){
dig_deeper <- TRUE
while(dig_deeper){
mylist<- my_list[[1]]
dig_deeper <- is.list(mylist)
}
return(mylist)
}
```
It works as expected... |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | Another base R solution - you could do this with a recursive function:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matrix(rnorm(10))),
NA)
recursive_fun <- function(my_list) ... | You can use `rrapply::rrapply`:
```r
library(rrapply)
firstList1 <- rrapply(list1, how = "flatten")[[1]]
firstList2 <- rrapply(list2, how = "flatten")[[1]]
all.equal(firstList1, firstList2)
# [1] TRUE
```
output
```r
> rrapply(list1, how = "flatten")[[1]]
Time Series:
Start = 1
End = 100
Frequency = 1
[1] ... |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | Another base R solution - you could do this with a recursive function:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matrix(rnorm(10))),
NA)
recursive_fun <- function(my_list) ... | Using a `while` loop :
```r
x <- list1
while (inherits(x <- x[[1]], "list")) {}
x
#> Time Series:
#> Start = 1
#> End = 100
#> Frequency = 1
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#> [19] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#> [37] 37 ... |
70,957,130 | I need to access the first element of a `list`. The problem is that the lists vary in the way how deep they are nested. Here is an example:
```
list1 <- list(ts(1:100),
list(1:19,
factor(letters)))
list2 <- list(list(list(ts(1:100), data.frame(a= rnorm(100))),
matri... | 2022/02/02 | [
"https://Stackoverflow.com/questions/70957130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11359310/"
] | Using a `while` loop :
```r
x <- list1
while (inherits(x <- x[[1]], "list")) {}
x
#> Time Series:
#> Start = 1
#> End = 100
#> Frequency = 1
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#> [19] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#> [37] 37 ... | Another possible solution, using `purrr::pluck` and `purrr::vec_depth`:
```r
library(tidyverse)
pluck(list1, !!!(rep(1, vec_depth(list1)-2) %>% as.list()))
#> Time Series:
#> Start = 1
#> End = 100
#> Frequency = 1
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#> [19] 19 20 ... |
42,831,699 | Should i always overload operator if programming language allows to do so, or it's better to create a member function?
For example:
`bool operator ==(...) {...}`
or
`bool equals(...){...}` | 2017/03/16 | [
"https://Stackoverflow.com/questions/42831699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5539574/"
] | If an operator maps directly to the meaning of the function, then it's recommended to use the operator, e.g.
* `==` instead of `equals` because it compares equality,
* `+` instead of `add` if it's adding e.g. mathematical vectors,
* but not `+` instead of `add` if it's e.g. appending to a list. | I would do it only it if it is absolutely clear what it does. For reading code is better to avoid overloading. Because your brain is used to read words and not some operators. And sometimes operators could do something different what you would guess. But I thing that `==` is clear enough.
Operators are good to use if ... |
42,831,699 | Should i always overload operator if programming language allows to do so, or it's better to create a member function?
For example:
`bool operator ==(...) {...}`
or
`bool equals(...){...}` | 2017/03/16 | [
"https://Stackoverflow.com/questions/42831699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5539574/"
] | If an operator maps directly to the meaning of the function, then it's recommended to use the operator, e.g.
* `==` instead of `equals` because it compares equality,
* `+` instead of `add` if it's adding e.g. mathematical vectors,
* but not `+` instead of `add` if it's e.g. appending to a list. | Just as an addition to other answers:
The main difference between *non member operator==* and *member operator==* or some kind of *equals* method, which comes to my mind, is an opportunity to use implicit conversions when comparing objects of your class/structure.
So, if you have some structure `X`:
```
struct X {
... |
42,831,699 | Should i always overload operator if programming language allows to do so, or it's better to create a member function?
For example:
`bool operator ==(...) {...}`
or
`bool equals(...){...}` | 2017/03/16 | [
"https://Stackoverflow.com/questions/42831699",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5539574/"
] | Just as an addition to other answers:
The main difference between *non member operator==* and *member operator==* or some kind of *equals* method, which comes to my mind, is an opportunity to use implicit conversions when comparing objects of your class/structure.
So, if you have some structure `X`:
```
struct X {
... | I would do it only it if it is absolutely clear what it does. For reading code is better to avoid overloading. Because your brain is used to read words and not some operators. And sometimes operators could do something different what you would guess. But I thing that `==` is clear enough.
Operators are good to use if ... |
19,329,437 | This might be obvious but, can a void pointer safely point to another pointer? i.e. point to a type int \*
```
int i = 5;
int *ip = &i;
void *vp = &ip;
int *nip = *(int **)vp;
int ni = *nip; // == 5?
```
EDIT: Sorry maybe I'm not being clear, I would like to know if a void pointer can POINT TO a section of memory t... | 2013/10/12 | [
"https://Stackoverflow.com/questions/19329437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2489299/"
] | Yes, you can convert any object pointer to `void *` and back to the original pointer type without loss of information.
From the horse's mouth:
>
> (C99, 6.3.2.3p1) "A pointer to void may be converted to or from a pointer to any incomplete or object type. A pointer to any incomplete or object type may be converted to... | Yes, it can point to *any* object type1. You can't actually *dereference* a void pointer since the compiler doesn't know the "real" type behind it. But the pointing aspect is fine.
From `C11 6.3.2.3 Pointers /1`:
>
> A pointer to void may be converted to or from a pointer to *any* object type. A pointer to *any* obj... |
1,214,734 | I have an animation in WPF that is jerky, my WPF form is layed out as follows:
a 1280x800 Window contains a 2400x7\*\* grid, seperated into 3 columns.
* Column 1 is \* width
* Column 2 is 148 width
* Column 3 is \* width
This allows me to, using an animation, chage the grid's margin to ~-1000 on the left side to bri... | 2009/07/31 | [
"https://Stackoverflow.com/questions/1214734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72871/"
] | Simple buffering wouldn't help with this problem, because it seems that lags are not in graphics, but rather in logic behind updating properties of different elements during animation. Following should help though:
* On button click, render whole grid to RenderTargetBitmap.
* Paint resulting image (RenderTargetBitmap ... | I've checked your code and can verify the funny transition. However, the animation lags only when going to the right.
When I replaced your WebBrowser with a colored Border, the lag was gone.
So the conclusion would be that the issue here is the slow rendering of an outside hosted visual. The WebBrowser is an interop ... |
1,214,734 | I have an animation in WPF that is jerky, my WPF form is layed out as follows:
a 1280x800 Window contains a 2400x7\*\* grid, seperated into 3 columns.
* Column 1 is \* width
* Column 2 is 148 width
* Column 3 is \* width
This allows me to, using an animation, chage the grid's margin to ~-1000 on the left side to bri... | 2009/07/31 | [
"https://Stackoverflow.com/questions/1214734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/72871/"
] | Simple buffering wouldn't help with this problem, because it seems that lags are not in graphics, but rather in logic behind updating properties of different elements during animation. Following should help though:
* On button click, render whole grid to RenderTargetBitmap.
* Paint resulting image (RenderTargetBitmap ... | Another approach to investigate:
Instead of storyboard in XAML, use
```
CompositionTarget.Rendering
```
event for animation (change value for animated property based on elapsed time).
Possibly, finish event handler with
```
thatBigGrid.UpdateLayout();
```
Margin is a property that affects layout. When Margin of... |
45,716,150 | I am using angularjs 4.3.4 via angular CLI which is working fine. However I am getting strange issue. I had created a custom component with checkbox and label. the id and for property value comes from custom tag attribute. When I see the html code I can see that it has been generated the id and for attribute as expecte... | 2017/08/16 | [
"https://Stackoverflow.com/questions/45716150",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1338202/"
] | Try one of this solutions:
```
<label [attr.for]="id">{{title}}</label>
<label attr.for="{{id}}">{{title}}</label>
<label htmlFor="{{id}}">{{title}}</label>
```
with a plunker : <https://plnkr.co/edit/RI0bmtX1kceDdd3xt1g6?p=preview> | @Vega Thanks for your help. I figured out what was wrong with my code for checkbox component.
In case some one else is looking for solution of same problem here is working example.
```
https://plnkr.co/edit/UTXmMEW2jEE1lblnKMuK?p=preview.
```
**Requirement was make custom checkbox component with title and id prop... |
476,689 | I have a question about Rudin's proof of Theorem 1.20 (b) in his book *Principles of Mathematical Analysis*. Theorem 1.20 is stated as follows:
>
> (a) If $x\in R, y\in R$, and $x>0$, then there is a positive integer $n$ such that $$nx>y.$$
> (b) If $x\in R, y\in R$, and $x<y$, then there exists a $p\in Q$ such that... | 2013/08/26 | [
"https://math.stackexchange.com/questions/476689",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61285/"
] | The integers $m\_1$ and $m\_2$ serve to bound $nx$ between two integers. The set $$=\{-m\_2+1,-m\_2+2,\ldots,m\_1\}$$ is a finite set of integers, so we can choose the smallest member $m$ of this set such that $nx<m$.
If we knew that $nx$ was positive, we wouldnβt need $m\_2$: we could just choose the smallest positi... | This essentially requires either induction or the well-ordering property of the natural numbers.
Let $S=\{s\in \mathbb N:m\_2+s>nx\}$.
We know that $m\_1-m\_2\in S$. So $S$ is a non-empty set of natural numbers. By the well-ordering principle, we know that there is an $s\_0$ that is the least element of $S$.
You als... |
476,689 | I have a question about Rudin's proof of Theorem 1.20 (b) in his book *Principles of Mathematical Analysis*. Theorem 1.20 is stated as follows:
>
> (a) If $x\in R, y\in R$, and $x>0$, then there is a positive integer $n$ such that $$nx>y.$$
> (b) If $x\in R, y\in R$, and $x<y$, then there exists a $p\in Q$ such that... | 2013/08/26 | [
"https://math.stackexchange.com/questions/476689",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61285/"
] | This essentially requires either induction or the well-ordering property of the natural numbers.
Let $S=\{s\in \mathbb N:m\_2+s>nx\}$.
We know that $m\_1-m\_2\in S$. So $S$ is a non-empty set of natural numbers. By the well-ordering principle, we know that there is an $s\_0$ that is the least element of $S$.
You als... | If there were no such $m$, then $-m\_2 < nx < m\_1$ would be false, since all of the following propositions would be false:
$$
\begin{align}
-m\_2 &\le nx < -m\_2 + 1\\
-m\_2 + 1 &\le nx < -m\_2 + 2\\
&\quad\,\cdots\\
m\_1 - 2 &\le nx < m\_1 - 1\\
m\_1 - 1 &\le nx < m\_1
\end{align}
$$ |
476,689 | I have a question about Rudin's proof of Theorem 1.20 (b) in his book *Principles of Mathematical Analysis*. Theorem 1.20 is stated as follows:
>
> (a) If $x\in R, y\in R$, and $x>0$, then there is a positive integer $n$ such that $$nx>y.$$
> (b) If $x\in R, y\in R$, and $x<y$, then there exists a $p\in Q$ such that... | 2013/08/26 | [
"https://math.stackexchange.com/questions/476689",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61285/"
] | This essentially requires either induction or the well-ordering property of the natural numbers.
Let $S=\{s\in \mathbb N:m\_2+s>nx\}$.
We know that $m\_1-m\_2\in S$. So $S$ is a non-empty set of natural numbers. By the well-ordering principle, we know that there is an $s\_0$ that is the least element of $S$.
You als... | To reinforce previous answers, I think the only way to rigorously prove the "Hence..." statement is to assume the well-ordering property of the integers, despite what some other answers have given; see, e.g., this related [post](https://math.stackexchange.com/questions/930550/can-the-proof-of-theorem-1-20-b-in-the-book... |
476,689 | I have a question about Rudin's proof of Theorem 1.20 (b) in his book *Principles of Mathematical Analysis*. Theorem 1.20 is stated as follows:
>
> (a) If $x\in R, y\in R$, and $x>0$, then there is a positive integer $n$ such that $$nx>y.$$
> (b) If $x\in R, y\in R$, and $x<y$, then there exists a $p\in Q$ such that... | 2013/08/26 | [
"https://math.stackexchange.com/questions/476689",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61285/"
] | The integers $m\_1$ and $m\_2$ serve to bound $nx$ between two integers. The set $$=\{-m\_2+1,-m\_2+2,\ldots,m\_1\}$$ is a finite set of integers, so we can choose the smallest member $m$ of this set such that $nx<m$.
If we knew that $nx$ was positive, we wouldnβt need $m\_2$: we could just choose the smallest positi... | If there were no such $m$, then $-m\_2 < nx < m\_1$ would be false, since all of the following propositions would be false:
$$
\begin{align}
-m\_2 &\le nx < -m\_2 + 1\\
-m\_2 + 1 &\le nx < -m\_2 + 2\\
&\quad\,\cdots\\
m\_1 - 2 &\le nx < m\_1 - 1\\
m\_1 - 1 &\le nx < m\_1
\end{align}
$$ |
476,689 | I have a question about Rudin's proof of Theorem 1.20 (b) in his book *Principles of Mathematical Analysis*. Theorem 1.20 is stated as follows:
>
> (a) If $x\in R, y\in R$, and $x>0$, then there is a positive integer $n$ such that $$nx>y.$$
> (b) If $x\in R, y\in R$, and $x<y$, then there exists a $p\in Q$ such that... | 2013/08/26 | [
"https://math.stackexchange.com/questions/476689",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61285/"
] | The integers $m\_1$ and $m\_2$ serve to bound $nx$ between two integers. The set $$=\{-m\_2+1,-m\_2+2,\ldots,m\_1\}$$ is a finite set of integers, so we can choose the smallest member $m$ of this set such that $nx<m$.
If we knew that $nx$ was positive, we wouldnβt need $m\_2$: we could just choose the smallest positi... | To reinforce previous answers, I think the only way to rigorously prove the "Hence..." statement is to assume the well-ordering property of the integers, despite what some other answers have given; see, e.g., this related [post](https://math.stackexchange.com/questions/930550/can-the-proof-of-theorem-1-20-b-in-the-book... |
476,689 | I have a question about Rudin's proof of Theorem 1.20 (b) in his book *Principles of Mathematical Analysis*. Theorem 1.20 is stated as follows:
>
> (a) If $x\in R, y\in R$, and $x>0$, then there is a positive integer $n$ such that $$nx>y.$$
> (b) If $x\in R, y\in R$, and $x<y$, then there exists a $p\in Q$ such that... | 2013/08/26 | [
"https://math.stackexchange.com/questions/476689",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/61285/"
] | If there were no such $m$, then $-m\_2 < nx < m\_1$ would be false, since all of the following propositions would be false:
$$
\begin{align}
-m\_2 &\le nx < -m\_2 + 1\\
-m\_2 + 1 &\le nx < -m\_2 + 2\\
&\quad\,\cdots\\
m\_1 - 2 &\le nx < m\_1 - 1\\
m\_1 - 1 &\le nx < m\_1
\end{align}
$$ | To reinforce previous answers, I think the only way to rigorously prove the "Hence..." statement is to assume the well-ordering property of the integers, despite what some other answers have given; see, e.g., this related [post](https://math.stackexchange.com/questions/930550/can-the-proof-of-theorem-1-20-b-in-the-book... |
68,154,742 | I'm in progress converting the [MBART](https://huggingface.co/facebook/mbart-large-50-many-to-many-mmt) model from HuggingFace Transformer to the OpenVino IF format and I've "successfully" brokendown the original pytorch model graph into 3 seperate ONNX models. I then used the `mo.py` to convert the onnx model to the I... | 2021/06/27 | [
"https://Stackoverflow.com/questions/68154742",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13568346/"
] | Use the format `"H:m:s"`.
**Detail:**
The hour, minute, and second in `DateTimeFormatter.ISO_LOCAL_TIME` are in the format, `HH:mm:ss` whereas your time string does not have minutes in two digits. The format, `"H:m:s"` caters to time units in both, single and double-digit.
**Demo:**
```
import java.time.LocalDate;
... | The time is formatted incorrectly for `ISO_LOCAL_TIME`.
The hours, minutes and seconds have a fixed width of 2 digits each.
They should be left-padded with zeros to ensure two digits.
A parseable time would be: `21:05:20`
If you can't change the input format, you can create your own DateTimeFormatter:
```
DateTimeFor... |
1,251 | Who owns Gehenem (also known as Hell)? | 2010/04/28 | [
"https://judaism.stackexchange.com/questions/1251",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/-1/"
] | Hashem is the Ribon Kol HaOlamim, the Master of all Worlds.
While in other religions the "netherworld" etc. is seen as under the control of malevolent forces, Judaism doesn't believe that there is a power/force which serves as an opponent of G-d. Evil is necessary for free will and when that need has run its course it... | [Gehennam](http://en.wikipedia.org/wiki/Gehenna) is derived from *gei Ben Hinnom*, the valley of the son of Hinnom. Thus:
>
> ...are terms derived from a place outside ancient Jerusalem known in the Hebrew Bible as the Valley of the Son of Hinnom (Hebrew: ΧΦ΅ΧΧ ΧΦΆΧΦΎΧΦ΄Χ ΦΉΦΌΧ or ΧΧΧ ΧΧ-ΧΧΧ ΧΧ); one of the two principal val... |
1,251 | Who owns Gehenem (also known as Hell)? | 2010/04/28 | [
"https://judaism.stackexchange.com/questions/1251",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/-1/"
] | Hashem is the Ribon Kol HaOlamim, the Master of all Worlds.
While in other religions the "netherworld" etc. is seen as under the control of malevolent forces, Judaism doesn't believe that there is a power/force which serves as an opponent of G-d. Evil is necessary for free will and when that need has run its course it... | In other religions Hell is place. In Judaism it is a spiritual process of cleansing the soul. The Alter Rebbe's Sefer Tanya sheds light on different ways a person's soul is cleansed for sins and wrong choices.
Tanya Ch. 8 mentions different methods of cleansing the soul including Gehenom Shel Sheleg (Gehenom of Snow)... |
1,251 | Who owns Gehenem (also known as Hell)? | 2010/04/28 | [
"https://judaism.stackexchange.com/questions/1251",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/-1/"
] | Geheinom is the place where (after death) God punishes a person for violating mitzvot lo ta'aseh (prohibitions phrased in the Torah in the form of "Don't do such and such") in the world to come. The Zohar tells us that the maximum time one's soul will spend there is one year. After that, God brings one's soul to the Ga... | [Gehennam](http://en.wikipedia.org/wiki/Gehenna) is derived from *gei Ben Hinnom*, the valley of the son of Hinnom. Thus:
>
> ...are terms derived from a place outside ancient Jerusalem known in the Hebrew Bible as the Valley of the Son of Hinnom (Hebrew: ΧΦ΅ΧΧ ΧΦΆΧΦΎΧΦ΄Χ ΦΉΦΌΧ or ΧΧΧ ΧΧ-ΧΧΧ ΧΧ); one of the two principal val... |
1,251 | Who owns Gehenem (also known as Hell)? | 2010/04/28 | [
"https://judaism.stackexchange.com/questions/1251",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/-1/"
] | Geheinom is the place where (after death) God punishes a person for violating mitzvot lo ta'aseh (prohibitions phrased in the Torah in the form of "Don't do such and such") in the world to come. The Zohar tells us that the maximum time one's soul will spend there is one year. After that, God brings one's soul to the Ga... | In other religions Hell is place. In Judaism it is a spiritual process of cleansing the soul. The Alter Rebbe's Sefer Tanya sheds light on different ways a person's soul is cleansed for sins and wrong choices.
Tanya Ch. 8 mentions different methods of cleansing the soul including Gehenom Shel Sheleg (Gehenom of Snow)... |
220,066 | I would like to define a well-order on $\mathbb R$. My first thought was, of course, to use $\leq$. Unfortunately, the result isn't well-founded, since $(-\infty,0)$ is an example of a subset that doesn't have a minimal element.
My next thought was to use that $P(\mathbb N)$ is in bijection with $\mathbb R$ and then t... | 2012/10/24 | [
"https://math.stackexchange.com/questions/220066",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/5798/"
] | Assuming the axiom of choice holds, it is possible to well-order every set. In particular the real numbers.
Fix a choice function on $P(\mathbb R)\setminus\{\varnothing\}$, let us denote it by $f$. We now define by transfinite induction an injection from $\mathbb R$ into the ordinals:
>
> Assuming that $r\_\alpha$ w... | You canβt: itβs consistent with ZF that $\Bbb R$ not be well-orderable. See [this answer](https://math.stackexchange.com/a/190814/12042) for starters. |
220,066 | I would like to define a well-order on $\mathbb R$. My first thought was, of course, to use $\leq$. Unfortunately, the result isn't well-founded, since $(-\infty,0)$ is an example of a subset that doesn't have a minimal element.
My next thought was to use that $P(\mathbb N)$ is in bijection with $\mathbb R$ and then t... | 2012/10/24 | [
"https://math.stackexchange.com/questions/220066",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/5798/"
] | You canβt: itβs consistent with ZF that $\Bbb R$ not be well-orderable. See [this answer](https://math.stackexchange.com/a/190814/12042) for starters. | To repeat Asaf's answer in my own words to test whether I understand it:
Once we have a bijection $f: \mathbb R \to S \subset \mathbf{ON}$, $\mathbb R$ is well-ordered by the relation $r < r' \iff f(r) < f(r')$.
To define a bijection assume the axiom of choice so that there is a choice function $f$ on $P(\mathbb R) \... |
220,066 | I would like to define a well-order on $\mathbb R$. My first thought was, of course, to use $\leq$. Unfortunately, the result isn't well-founded, since $(-\infty,0)$ is an example of a subset that doesn't have a minimal element.
My next thought was to use that $P(\mathbb N)$ is in bijection with $\mathbb R$ and then t... | 2012/10/24 | [
"https://math.stackexchange.com/questions/220066",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/5798/"
] | Assuming the axiom of choice holds, it is possible to well-order every set. In particular the real numbers.
Fix a choice function on $P(\mathbb R)\setminus\{\varnothing\}$, let us denote it by $f$. We now define by transfinite induction an injection from $\mathbb R$ into the ordinals:
>
> Assuming that $r\_\alpha$ w... | To repeat Asaf's answer in my own words to test whether I understand it:
Once we have a bijection $f: \mathbb R \to S \subset \mathbf{ON}$, $\mathbb R$ is well-ordered by the relation $r < r' \iff f(r) < f(r')$.
To define a bijection assume the axiom of choice so that there is a choice function $f$ on $P(\mathbb R) \... |
28,074,576 | I have two forms in my project (Form1.vb with screen called "MainPanel", and From2.vb with screen called "frmTestSelect"). I have a button on the MainPanel that opens frmTestSelect. frmTestSelect is a much smaller screen/form than MainPanel. When both forms are open, I want a user to be able to click on the MainPanel f... | 2015/01/21 | [
"https://Stackoverflow.com/questions/28074576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4455882/"
] | ```
Dim frmTestSelect As Form2 = Nothing
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
frmTestSelect = New Form2
frmTestSelect.Show()
End Sub
Private Sub Form1_Activated(sender As Object, e As EventArgs) Handles Me.Activated
If frmTestSelect IsNot Nothing Then
f... | You can keep a reference to the live instance of frmTestSelect in MainPanel (in a member variable for example), and invoke .Close() on it if MainPanel gets focus.
If you make MainPanel an MDIParent, and frmTestSelect an MDIChild (by specifying .MDIParent = MainPanelInstance), you can access all MDIChildren of MainPane... |
59,949,198 | I came across this problem in which you will take an integer as a input from the user and then return the nearest **greater number with unique digits**.
First it seem like an easy one and i wrote it's code which gave me an desired outputs but for some inputs returns an integer with repeating digits or a unique numbe... | 2020/01/28 | [
"https://Stackoverflow.com/questions/59949198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8228063/"
] | You're probably over complicating this for yourself.
Would something like this work rather than doing all of the conversions?
```py
n = int(input("enter a no.:"))+1 #taking input adding 1 to make
#sure if the input is unique then
#program does'... | Why not simply increment the number until you find one with unique digits?
```
def next_uniq(n):
a = str(n)
while len(set(a)) != len(a):
a = str(int(a) + 1)
return a
for i in [1233, 7885, 7886, 999]:
print(next_uniq(i))
# 1234, 7890, 7890, 1023
``` |
27,765,326 | I need to be able to when the submit button is clicked a new tab must be open
based on the anchor link coming from the database. I have been struggling for hours.
this is my form
```
<form action="" method="POST">
<select name="name">
<option value="">Select Names</option>
<option value="1">Names</option>
</selec... | 2015/01/04 | [
"https://Stackoverflow.com/questions/27765326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4346441/"
] | May be, something like this?
```
<?php
..
echo $ran_name= "<script> document.location.href='".$link."';</script>";
..
?>
```
More about location object <http://www.w3schools.com/jsref/obj_location.asp>. | 1. Way 1
< input type="button" value="Open Window"
onclick="window.open('< ?php echo $link;?>')">
OR:
```
onclick="window.location.href='< ?php echo $link;?>','_blank'";
```
2. Way 2:
< form action="< ?php echo $link;?>" method="post" target="\_blank">
```
...
```
< /form>
p/s: I don't know how to show code ... |
27,765,326 | I need to be able to when the submit button is clicked a new tab must be open
based on the anchor link coming from the database. I have been struggling for hours.
this is my form
```
<form action="" method="POST">
<select name="name">
<option value="">Select Names</option>
<option value="1">Names</option>
</selec... | 2015/01/04 | [
"https://Stackoverflow.com/questions/27765326",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4346441/"
] | May be, something like this?
```
<?php
..
echo $ran_name= "<script> document.location.href='".$link."';</script>";
..
?>
```
More about location object <http://www.w3schools.com/jsref/obj_location.asp>. | maybe you try this one? that's should do what you want
```
<?php
$query="SELECT * FROM names_table ORDER BY RAND() LIMIT 1 ";
$result=mysqli_query($connection,$query);
if(!$result) {
exit("no results");
}
while($selected=mysqli_fetch_assoc($result)){
$link=$selected['name'];
... |
204,788 | I suppose Voldemort couldn't use the Patronus Charm. So, what would happen if he faces Dementors? How can he counter them? | 2019/02/06 | [
"https://scifi.stackexchange.com/questions/204788",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/111374/"
] | He could use a way other than a Patronus.
=========================================
Though we donβt know what method Snape preferred, Snape disagreed with Harry on the best way to fight Dementors. Therefore, other ways of fighting Dementors exist.
>
> βHarry fully expected to receive low marks on his, because he had... | 1. While the Patronus charm is the most widely known method of combating dementors, it is not the only one. Sirius Black was able to resist their effects while in Azkaban by focusing obsessively on his own innocence and periodically taking the form of an animal, whose less complex thoughts could not be affected as seve... |
4,878,292 | The default configuration of the Team Build Number Format is:
```
$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)
```
It drops all output to `\\foo\bar\MyBuildDef_20111031.1` Great stuff so far!
The small **problem is that it drops all binaries** in that directory without a good indication of the dependencies of t... | 2011/02/02 | [
"https://Stackoverflow.com/questions/4878292",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/23199/"
] | This blog post should help you out: <http://blogs.msdn.com/b/willbar/archive/2011/02/05/splitting-team-build-outputs-into-folders.aspx>
Essentially, you create a new 'Platform' for each project. Team Build will put each platform in a different directory by default, so you get a different directory for each of your pro... | Unfortunately I have not found a good way to do this yet, though it has been a while since I tried to find a better solution then what I settled on.
Current have solutions for each desktop application, and one with all the websites. I then followed the instructions [here](http://blogs.microsoft.co.il/blogs/royrose/ar... |
69,230,561 | I hope someone can help with this.
I want to stop/abort audio instead of pause, how would this be done?
I was trying to figure out how to do that.
That is all I am trying to figure out how to do.
How to abort an audio stream instead of pausing it.
How would I be able to do that?
<https://jsfiddle.net/s0ae7ph9/>
... | 2021/09/18 | [
"https://Stackoverflow.com/questions/69230561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | It seems something like [HTML5 audio start over](https://stackoverflow.com/questions/13002935/html5-audio-start-over) should work. I know this works for audio files locally, but not sure about the one you have in your code. I would assume it should work the same though. | I'm not sure, but try
```
audio.currentTime = 0;
audio.play();
``` |
69,230,561 | I hope someone can help with this.
I want to stop/abort audio instead of pause, how would this be done?
I was trying to figure out how to do that.
That is all I am trying to figure out how to do.
How to abort an audio stream instead of pausing it.
How would I be able to do that?
<https://jsfiddle.net/s0ae7ph9/>
... | 2021/09/18 | [
"https://Stackoverflow.com/questions/69230561",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | If you want to eventually stop loading the media, you can't use the native `HTMLMediaElement`.
You should fetch and stream the media yourself, and abort it when you please using an [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController). [`Aborting a fetch`](https://developer.mozilla.org/... | I'm not sure, but try
```
audio.currentTime = 0;
audio.play();
``` |
22,617,712 | I need to enable/disable all network adapters (kinda like Flight Mode) on a Windows 8 tablet when the user clicks on a button.
This can be done with the following cmdlet in Powershell: "Disable-NetAdapter \* βConfirm:$false" and it's counterpart Enable-NetAdapter. They do exactly what I expect them to do, but I have t... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22617712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2358200/"
] | The Win32\_NetworkAdapter class contains Enable/Disable methods <http://msdn.microsoft.com/en-us/library/aa394216>
here's a code example from [Programmatically Enable / Disable Connection](https://stackoverflow.com/questions/3053372/programmatically-enable-disable-connection)
You need to run in Admin or System contex... | Here is an example of some VB.NET code I am actually using in production:
```
Imports System.Management
Imports System.Text.RegularExpressions
Try
Dim scope As New ManagementScope("\\" + computername + "\root\CIMV2")
scope.Connect()
Dim query As New ObjectQ... |
22,617,712 | I need to enable/disable all network adapters (kinda like Flight Mode) on a Windows 8 tablet when the user clicks on a button.
This can be done with the following cmdlet in Powershell: "Disable-NetAdapter \* βConfirm:$false" and it's counterpart Enable-NetAdapter. They do exactly what I expect them to do, but I have t... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22617712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2358200/"
] | The Win32\_NetworkAdapter class contains Enable/Disable methods <http://msdn.microsoft.com/en-us/library/aa394216>
here's a code example from [Programmatically Enable / Disable Connection](https://stackoverflow.com/questions/3053372/programmatically-enable-disable-connection)
You need to run in Admin or System contex... | I know this question is old but could be useful for someone in the future, hence posting my answer here.
```
public class Program
{
static void Main(string[] args)
{
string command = "netsh interface set interface \"Ethernet\" enable";
ProcessStartInfo processStartInfo = new ProcessStartIn... |
22,617,712 | I need to enable/disable all network adapters (kinda like Flight Mode) on a Windows 8 tablet when the user clicks on a button.
This can be done with the following cmdlet in Powershell: "Disable-NetAdapter \* βConfirm:$false" and it's counterpart Enable-NetAdapter. They do exactly what I expect them to do, but I have t... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22617712",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2358200/"
] | Here is an example of some VB.NET code I am actually using in production:
```
Imports System.Management
Imports System.Text.RegularExpressions
Try
Dim scope As New ManagementScope("\\" + computername + "\root\CIMV2")
scope.Connect()
Dim query As New ObjectQ... | I know this question is old but could be useful for someone in the future, hence posting my answer here.
```
public class Program
{
static void Main(string[] args)
{
string command = "netsh interface set interface \"Ethernet\" enable";
ProcessStartInfo processStartInfo = new ProcessStartIn... |
77,371 | While I do not know the source, I have heard many times that Gentiles are forbidden from keeping Shabbos and must make sure to violate at least one law of the Shabbos every Shabbos. If this is the case why is it not among the 7 Mitzvos for Bnei Noach? Additionally, are there any other commandments for Gentiles not list... | 2016/11/06 | [
"https://judaism.stackexchange.com/questions/77371",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/9543/"
] | Gemara in Sanhedrin 58b-59a:
>
> ΧΧΧ¨"Χ Χ’ΧΧΧ ΧΧΧΧΧΧ Χ©Χ©ΧΧͺ ΧΧΧΧ ΧΧΧͺΧ Χ©Χ Χ' (ΧΧ¨ΧΧ©ΧΧͺ Χ, ΧΧ) ΧΧΧΧ ΧΧΧΧΧ ΧΧ ΧΧ©ΧΧΧͺΧ
>
> And Reish Lakish said, A non-Jew who observes Shabbos is obligated to be put to death, as it says, (Bereishis 8:22) "Day and night, you shall not rest."
>
>
>
The succeeding Gemara explains that this... | A goy is assumed to be an idolater(R"Eliezer,Gittin 45b and H"Assurot Maachalot 8:11). A goy should only be involved in the sheva mitzvot bnei Noach.
Notice the different dinim between a goy and a ben Noach in H"Melachim 10:10 about tzedekah.
A better question, is what happens when a goy is no longer an idolater. Can... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | put selector.xml file in drawable folder (res/drawable)
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/list_focused" android:state_pressed="true"/>
<item android:drawable="@drawable/list_focused" android:state... | Try the `View` function `setBackgroundColor()`
See the Android docs:
<http://developer.android.com/reference/android/view/View.html#setBackgroundColor%28int%29>
```
public void setBackgroundColor (int color) Added in API level 1
Sets the background color for this view.
Parameters
color the color of ... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | Regardless of the method you chose (XML/code) - make sure you make your `LinearLayout` clickable:
XML:
```
android:clickable="true"
```
Code:
```
myLinearLayout.setClickable(true);
``` | put selector.xml file in drawable folder (res/drawable)
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/list_focused" android:state_pressed="true"/>
<item android:drawable="@drawable/list_focused" android:state... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | Define background.xml in drawable folder
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/pressed" />
<item android:state_focused="false"
android:drawable="@drawable/normal" />
</se... | put selector.xml file in drawable folder (res/drawable)
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/list_focused" android:state_pressed="true"/>
<item android:drawable="@drawable/list_focused" android:state... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | Regardless of the method you chose (XML/code) - make sure you make your `LinearLayout` clickable:
XML:
```
android:clickable="true"
```
Code:
```
myLinearLayout.setClickable(true);
``` | The following method will get you want you want. Even the ripple animation in Lollipop. Just pass a context the the view (can be a linear layout):
```
public static void setClickableAnimation(final Context context, final View view) {
final int[] attrs = new int[]{R.attr.selectableItemBackground};
final TypedAr... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | Regardless of the method you chose (XML/code) - make sure you make your `LinearLayout` clickable:
XML:
```
android:clickable="true"
```
Code:
```
myLinearLayout.setClickable(true);
``` | Try the `View` function `setBackgroundColor()`
See the Android docs:
<http://developer.android.com/reference/android/view/View.html#setBackgroundColor%28int%29>
```
public void setBackgroundColor (int color) Added in API level 1
Sets the background color for this view.
Parameters
color the color of ... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | Regardless of the method you chose (XML/code) - make sure you make your `LinearLayout` clickable:
XML:
```
android:clickable="true"
```
Code:
```
myLinearLayout.setClickable(true);
``` | Here is my solution, it's very simple:
```
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_pressed_tab"
android:clickable="true"
android:focusable="true"
... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | Here is my solution, it's very simple:
```
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_pressed_tab"
android:clickable="true"
android:focusable="true"
... | The following method will get you want you want. Even the ripple animation in Lollipop. Just pass a context the the view (can be a linear layout):
```
public static void setClickableAnimation(final Context context, final View view) {
final int[] attrs = new int[]{R.attr.selectableItemBackground};
final TypedAr... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | The following method will get you want you want. Even the ripple animation in Lollipop. Just pass a context the the view (can be a linear layout):
```
public static void setClickableAnimation(final Context context, final View view) {
final int[] attrs = new int[]{R.attr.selectableItemBackground};
final TypedAr... | Try the `View` function `setBackgroundColor()`
See the Android docs:
<http://developer.android.com/reference/android/view/View.html#setBackgroundColor%28int%29>
```
public void setBackgroundColor (int color) Added in API level 1
Sets the background color for this view.
Parameters
color the color of ... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | Define background.xml in drawable folder
```
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/pressed" />
<item android:state_focused="false"
android:drawable="@drawable/normal" />
</se... | The following method will get you want you want. Even the ripple animation in Lollipop. Just pass a context the the view (can be a linear layout):
```
public static void setClickableAnimation(final Context context, final View view) {
final int[] attrs = new int[]{R.attr.selectableItemBackground};
final TypedAr... |
15,963,922 | I am having a linear layout in my xml and am adding another linear layout(containing two textviews) to that linear layout through java. Touch events works perfect, but i want to highlight the selected linear layout by setting background color. Please advice. | 2013/04/12 | [
"https://Stackoverflow.com/questions/15963922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/514227/"
] | Here is my solution, it's very simple:
```
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bg_pressed_tab"
android:clickable="true"
android:focusable="true"
... | Try the `View` function `setBackgroundColor()`
See the Android docs:
<http://developer.android.com/reference/android/view/View.html#setBackgroundColor%28int%29>
```
public void setBackgroundColor (int color) Added in API level 1
Sets the background color for this view.
Parameters
color the color of ... |
64,521,231 | ```lua
local t={}
for i,v in pairs(game.Players:GetPlayers()) do
if v~=game.Players.LocalPlayer then
table.insert(t,v.Name)
end
end
```
if i do table.foreach(t,print) it also shows the index and it causes problems when i want to select a random player. The error usually tends to be something like "1 is not a v... | 2020/10/25 | [
"https://Stackoverflow.com/questions/64521231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13336898/"
] | Your problem is not that table.insert adds an index, but that you use it instead of the value you want do use.
`table.insert` inserts an element to a list. If no index is given the value is added to the end of the list.
So there is no way to use `table.insert` without "inserting the index". Actually there is no way a... | `table.foreach(t,f)` applies the function `f` to each *key-value* pair of `t` as [is written](http://lua-users.org/wiki/TableLibraryTutorial). Also, since Lua 5.1 the function is deprecated.
If you want simply to print all values, do
```lua
for _, name in ipairs (t) do
print (name)
end
```
or
```lua
print (tab... |
19,265,614 | I have One array :
```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
```
I Want to update the indexes ,like if the text is 3 ,Then I want to delete the whole index `({text:'3', done:false},)` and `push` (add) new row .
How can i d... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2218635/"
] | ```
var find = function(arr, text) {
for(var i = 0; i < arr.length; i++) {
if (arr[i].text == text) {
return i;
}
}
}
var foundIndex = find(xx, '3');
while(foundIndex != undefined) {
arr.splice(foundIndex, 1)
foundIndex = find(xx, '3');
}
```
Please remember that using 'delete' ke... | ```
xx = [];
xx[-1] = true;
xx[1] = false;
xx[2] = true;
xx[3] = false;
xx[4] = false;
// update index: 4 => 5
xx[5] = xx[4]
delete xx[4]
// delete at index: 3
delete xx[3]
// add at index: 8, value: true
xx[8] = true
``` |
19,265,614 | I have One array :
```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
```
I Want to update the indexes ,like if the text is 3 ,Then I want to delete the whole index `({text:'3', done:false},)` and `push` (add) new row .
How can i d... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2218635/"
] | What about a custom cross browser solution ?
```
function findIndexBy(a, fn) {
var i = 0, l = a.length;
for (; i < l; i++) {
if (fn(a[i], i)) {
return i;
}
}
return -1;
}
```
Usage :
```
// make sure that "xx" exists as an array
if (xx && Object.prototype.toString.call(xx... | ```
var find = function(arr, text) {
for(var i = 0; i < arr.length; i++) {
if (arr[i].text == text) {
return i;
}
}
}
var foundIndex = find(xx, '3');
while(foundIndex != undefined) {
arr.splice(foundIndex, 1)
foundIndex = find(xx, '3');
}
```
Please remember that using 'delete' ke... |
19,265,614 | I have One array :
```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
```
I Want to update the indexes ,like if the text is 3 ,Then I want to delete the whole index `({text:'3', done:false},)` and `push` (add) new row .
How can i d... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2218635/"
] | ```
var find = function(arr, text) {
for(var i = 0; i < arr.length; i++) {
if (arr[i].text == text) {
return i;
}
}
}
var foundIndex = find(xx, '3');
while(foundIndex != undefined) {
arr.splice(foundIndex, 1)
foundIndex = find(xx, '3');
}
```
Please remember that using 'delete' ke... | Finally i used all answers , now i got it :
>
> //value=[] come lot of values
>
>
>
```
$scope.updateTodo = function () {
$.ajax({
url: '/Home/Update',
type: 'GET',
async: false,
data: { todoName: $scope.todoName, todoAge: $scope.todoAge, todoId: $scope.todoId },
conte... |
19,265,614 | I have One array :
```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
```
I Want to update the indexes ,like if the text is 3 ,Then I want to delete the whole index `({text:'3', done:false},)` and `push` (add) new row .
How can i d... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2218635/"
] | ```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
function update(id,new_el_done){
var i=0;
var deleted_something=false;
for(;i<xx.length;i++){
if(deleted_something==true) xx[i].text = (parseInt(xx[i].text) - 1)... | ```
xx = [];
xx[-1] = true;
xx[1] = false;
xx[2] = true;
xx[3] = false;
xx[4] = false;
// update index: 4 => 5
xx[5] = xx[4]
delete xx[4]
// delete at index: 3
delete xx[3]
// add at index: 8, value: true
xx[8] = true
``` |
19,265,614 | I have One array :
```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
```
I Want to update the indexes ,like if the text is 3 ,Then I want to delete the whole index `({text:'3', done:false},)` and `push` (add) new row .
How can i d... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2218635/"
] | What about a custom cross browser solution ?
```
function findIndexBy(a, fn) {
var i = 0, l = a.length;
for (; i < l; i++) {
if (fn(a[i], i)) {
return i;
}
}
return -1;
}
```
Usage :
```
// make sure that "xx" exists as an array
if (xx && Object.prototype.toString.call(xx... | ```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
function update(id,new_el_done){
var i=0;
var deleted_something=false;
for(;i<xx.length;i++){
if(deleted_something==true) xx[i].text = (parseInt(xx[i].text) - 1)... |
19,265,614 | I have One array :
```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
```
I Want to update the indexes ,like if the text is 3 ,Then I want to delete the whole index `({text:'3', done:false},)` and `push` (add) new row .
How can i d... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2218635/"
] | ```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
function update(id,new_el_done){
var i=0;
var deleted_something=false;
for(;i<xx.length;i++){
if(deleted_something==true) xx[i].text = (parseInt(xx[i].text) - 1)... | Finally i used all answers , now i got it :
>
> //value=[] come lot of values
>
>
>
```
$scope.updateTodo = function () {
$.ajax({
url: '/Home/Update',
type: 'GET',
async: false,
data: { todoName: $scope.todoName, todoAge: $scope.todoAge, todoId: $scope.todoId },
conte... |
19,265,614 | I have One array :
```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
```
I Want to update the indexes ,like if the text is 3 ,Then I want to delete the whole index `({text:'3', done:false},)` and `push` (add) new row .
How can i d... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2218635/"
] | What about a custom cross browser solution ?
```
function findIndexBy(a, fn) {
var i = 0, l = a.length;
for (; i < l; i++) {
if (fn(a[i], i)) {
return i;
}
}
return -1;
}
```
Usage :
```
// make sure that "xx" exists as an array
if (xx && Object.prototype.toString.call(xx... | ```
xx = [];
xx[-1] = true;
xx[1] = false;
xx[2] = true;
xx[3] = false;
xx[4] = false;
// update index: 4 => 5
xx[5] = xx[4]
delete xx[4]
// delete at index: 3
delete xx[3]
// add at index: 8, value: true
xx[8] = true
``` |
19,265,614 | I have One array :
```
var xx = [
{text:'-1', done:true},
{text:'1', done:false},
{text:'2', done:true},
{text:'3', done:false},
{text:'4', done:false}];
```
I Want to update the indexes ,like if the text is 3 ,Then I want to delete the whole index `({text:'3', done:false},)` and `push` (add) new row .
How can i d... | 2013/10/09 | [
"https://Stackoverflow.com/questions/19265614",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2218635/"
] | What about a custom cross browser solution ?
```
function findIndexBy(a, fn) {
var i = 0, l = a.length;
for (; i < l; i++) {
if (fn(a[i], i)) {
return i;
}
}
return -1;
}
```
Usage :
```
// make sure that "xx" exists as an array
if (xx && Object.prototype.toString.call(xx... | Finally i used all answers , now i got it :
>
> //value=[] come lot of values
>
>
>
```
$scope.updateTodo = function () {
$.ajax({
url: '/Home/Update',
type: 'GET',
async: false,
data: { todoName: $scope.todoName, todoAge: $scope.todoAge, todoId: $scope.todoId },
conte... |
10,384,558 | I have a method to send sms. This method registers two pending intents to receive sending and delivery reports.
I send the first message and I receive its sending and delivery reports and then send another message. While receiving reports for second message, I get reports of first message and then second message. If I... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10384558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1152549/"
] | use this code to send and receive the sent notification
```
send.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
String phoneNo = "Phone number";
String message = "Content of the msg";
if (phoneNo.lengt... | Did you put this in your onPause?
```
@Override
protected void onPause() {
super.onPause();
if (bRSMS_has_been_sent != null){
unregisterReceiver(bRSMS_has_been_sent);
bRSMS_has_been_sent = null;
}
if (brSMS_has_beed_delivered != null){
unregisterR... |
10,384,558 | I have a method to send sms. This method registers two pending intents to receive sending and delivery reports.
I send the first message and I receive its sending and delivery reports and then send another message. While receiving reports for second message, I get reports of first message and then second message. If I... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10384558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1152549/"
] | problem is solved by adding this line at the end of OnReceive() methods:
```
MyActivity.this.unregisterReceiver(this);
```
Closer look:
```
sendingBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
switch (getResultCode())
{
... | Did you put this in your onPause?
```
@Override
protected void onPause() {
super.onPause();
if (bRSMS_has_been_sent != null){
unregisterReceiver(bRSMS_has_been_sent);
bRSMS_has_been_sent = null;
}
if (brSMS_has_beed_delivered != null){
unregisterR... |
10,384,558 | I have a method to send sms. This method registers two pending intents to receive sending and delivery reports.
I send the first message and I receive its sending and delivery reports and then send another message. While receiving reports for second message, I get reports of first message and then second message. If I... | 2012/04/30 | [
"https://Stackoverflow.com/questions/10384558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1152549/"
] | problem is solved by adding this line at the end of OnReceive() methods:
```
MyActivity.this.unregisterReceiver(this);
```
Closer look:
```
sendingBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
switch (getResultCode())
{
... | use this code to send and receive the sent notification
```
send.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
String phoneNo = "Phone number";
String message = "Content of the msg";
if (phoneNo.lengt... |
86,213 | I am facing this error in node form when I going to be print title of the body field.
Error:
>
> Notice: Undefined index: und in include() (line 4 of C:\wamp\www\drupalapi\themes\bartik\article-node-form.tpl.php).
>
>
>
I need to print the title of the body field, and my code looks like:
```
print $form['un... | 2013/09/20 | [
"https://drupal.stackexchange.com/questions/86213",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/8649/"
] | To get usable markup of the field in template you need to render it before print.
```
print drupal_render_children($form['title']);
```
As explained here [Theming Node Forms in Drupal 7](https://drupal.org/node/1092122)
Additionally make sure you also render the hidden parts of the form to keep track of form identi... | Greatly explained by user20301.
If you still not sure how to print the title then do something like this in your tpl.php file:
```
print $form['body']['und']['0']['#title'];
```
This will print the title of body field "Body" in node form. |
5,727,648 | I have a very large list of items (~2 millions) that I want to optimize for access speed. I iterate trough the items using an iterator (++it).
Right now the code is implemented using `std:map<std::wstring, STRUCT>`.
I wonder if it's worth to change std::map with a `std::deque<std::pair<std::wstring, STRUCT>>`. I ... | 2011/04/20 | [
"https://Stackoverflow.com/questions/5727648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572586/"
] | With deque, you would lose ( or would have to re-implement ) the advantage of Key-Value pairs. If it's not essential for your data, I would consider using deque. | Generally, if you're only doing search in this set (no insertions/deletions), you're probably better off using a sorted sequential cointainer, like deque or vector. You can then use simple binary search to find the needed elements. The advantage of using a sequential container is that it is better in terms of memory us... |
5,727,648 | I have a very large list of items (~2 millions) that I want to optimize for access speed. I iterate trough the items using an iterator (++it).
Right now the code is implemented using `std:map<std::wstring, STRUCT>`.
I wonder if it's worth to change std::map with a `std::deque<std::pair<std::wstring, STRUCT>>`. I ... | 2011/04/20 | [
"https://Stackoverflow.com/questions/5727648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/572586/"
] | With deque, you would lose ( or would have to re-implement ) the advantage of Key-Value pairs. If it's not essential for your data, I would consider using deque. | The fastest container to iterate through is usually a `vector`, so if you want to optimize for iteration at the expense of everything else, use that.
Overall app performance of course will depend how many times you iterate, and how you construct your data in the first place. For a simple test, once your map has been p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.