qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
12,864,341 | I am working with stacks and need to check to see if two are the same. I have overloaded the
```
bool operator==
```
function in my code, and now I need to put the logic in the code. I will check a few things to see if the two stacks are the same: the length, the data type, and the content of each element. Length ... | 2012/10/12 | [
"https://Stackoverflow.com/questions/12864341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/843443/"
] | If you implement the stack data structure using *templates* (e.g. `template <typename T> class Stack...`), then you just need to overload `operator==` and check sizes and do an item-wise comparison:
```
template <typename T>
bool operator==(const Stack<T> & lhs, const Stack<T> & rhs)
{
if (lhs.Size() != rhs.Size())
... | I found a simple program which will solve your purpose, Its simple and very efficient way of checking if two stacks are equal or not.
```
bool isEqual(stack<Type> &stack1, stack<Type> &stack2) {
if (stack1.empty() && stack2.empty())
return true;
else if (stack1.empty() || stack2.empty())
return ... |
12,864,341 | I am working with stacks and need to check to see if two are the same. I have overloaded the
```
bool operator==
```
function in my code, and now I need to put the logic in the code. I will check a few things to see if the two stacks are the same: the length, the data type, and the content of each element. Length ... | 2012/10/12 | [
"https://Stackoverflow.com/questions/12864341",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/843443/"
] | I found a simple program which will solve your purpose, Its simple and very efficient way of checking if two stacks are equal or not.
```
bool isEqual(stack<Type> &stack1, stack<Type> &stack2) {
if (stack1.empty() && stack2.empty())
return true;
else if (stack1.empty() || stack2.empty())
return ... | As you can see in C++ tag definition of stackoverflow
```
C++ is a widely-used, statically-typed, free-form, compiled,
multi-paradigm, multi-level, imperative, general-purpose,
object-oriented programming language.
```
In this definition `statically-typed` mean all type information must be clean in compile time so i... |
165,818 | For the events of $A$ and $B$, probabilites are $\Bbb P(A) = 3/11$ and $\Bbb P(B) = 4/11$. Define the $\Bbb P(A \cap B )$ if:
a) $\Bbb P(A \cup B) = 6/11$.
b) events are indenpendent
I have done a task, and it's following
$$\Bbb P(A \cup B) = \Bbb P(A) + \Bbb P(B) - \Bbb P(A \cap B ) = 1/11\;.$$
However I don't kn... | 2012/07/02 | [
"https://math.stackexchange.com/questions/165818",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/34933/"
] | To say that $A$ and $B$ are independent is to say that $\Bbb P(A\cap B)=\Bbb P(A)\Bbb P(B)$.
By the way, it’s not correct to write
>
> $\Bbb P(A\cup B)=\Bbb P(A)+\Bbb P(B)-\Bbb P(A\cap B)=1/11$;
>
>
>
what you mean is that $\Bbb P(A\cup B)=\Bbb P(A)+\Bbb P(B)-\Bbb P(A\cap B)$, so $\Bbb P(A\cap B)=1/11$. | Independence means $P(A \cap B)=P(A) P(B)$ but $P(A) P(B)=3 \times 4/121 \approx 0.0991$ and you found $P(A \cap B)=1/11 \approx 0.09091$. Close but not equal, so not independent. Note the difference between $12/121$ vs $11/121$. |
35,903,826 | I have a string containing a list and by that I mean :
```
String list = "[\"hello\",\"everyone\"]";
```
How can I transform that so I can read it as a `String[]`? My question might not be very clear but please understand English is not my native language thanks everyone. | 2016/03/09 | [
"https://Stackoverflow.com/questions/35903826",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4224901/"
] | ```
select id, fruit, row_number() over (partition by fruit order by id) as running_total
from fruits
order by id
```
And then,
```
alter table Fruits add RUNNING_TOTAL int null
update fruits set running_total = subquery.running_total
from fruits
inner join (
select id, row_number() over (partition by fruit order ... | In SQL Server 2008, you can use an updatable CTE:
```
with toupdate as (
select f.*, row_number() over (partition by fruit order by id) as seqnum
from fruits f
)
update toupdate
set running_total = seqnum;
```
I wouldn't really call such a column "running\_total". It seems more like a "sequence\... |
3,207,675 | I have a combobox and I need the first row to be set as default.
This is my code
```
cbBrandForModel.DisplayMember = "BrandName";
cbBrandForModel.ValueMember = "BrandID";
cbBrandForModel.DataSource = dataTable;
```
I need to add this:
```
cbBrandForModel.DisplayMember = "Select Brand";
cbBrandForModel.ValueMem... | 2010/07/08 | [
"https://Stackoverflow.com/questions/3207675",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/226487/"
] | If the (SelectedValue of the) ComboBox is not databound, all you need is to set `cbBrandForModel.SelectedIndex = 0;' | I agree with the answer regarding SelectedIndex.
In addition your second code snippet, where you set DisplayMember and ValueMember again, overwrites the first snippet. This is not going to have the effect you intend. |
18,264,229 | I am currently trying to make a wheel progress bar show while the web view is currently loading. Having some troubles with my code. Any idea on what is wrong or missing with my code?
```
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature... | 2013/08/16 | [
"https://Stackoverflow.com/questions/18264229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1698358/"
] | We are automatically assuming that the problem is the EF. Can be, can be not. There are a lots of points that we should take care, not only data access infrastructure.
With data access issued, as you are using only EF, you can gain fast improvement using simple `.AsNoTracking()` method. Adopt a [ServiceLocator](http:/... | Check if you have proxy entities stored in session. In the other hand it's not required to call explicitly `Dispose()` in `DbContext`.
Check this <http://blog.jongallant.com/2012/10/do-i-have-to-call-dispose-on-dbcontext.html#.U6WdzrGEeTw> |
155,053 | I have downloaded Austria official map tiles from <http://www.basemap.at/index_en.html> using the provided offline downloader tool. Tiles are stored in my hard disk with paths similar to `/<level>/<number>/<number>.png` .
I now need to create a .map configuration file for mapserver, however all I have is the GetCapabi... | 2015/07/20 | [
"https://gis.stackexchange.com/questions/155053",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/55287/"
] | As one can see from the picture

the task has a solution for shapes equal to their own convex hull. If it is not the case, the position of point and 'un-convexness' of polygon might create artefacts. Output can be slightly improved by using minimum s... | I would recommend scripting this as you'll save a hell of a lot of time...but you could do this via adding fields to the attribute field and run an analysis to produce the proportional distance value from the point to the basin edge.
*Are you looking to buffer distance from the point to the basin edge or from the basi... |
164,937 | Does anyone know a good book about lattices (as subgroups of a vector space $V$)? | 2012/06/30 | [
"https://math.stackexchange.com/questions/164937",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/32119/"
] | [These notes of mine on geometry of numbers](http://alpha.math.uga.edu/%7Epete/geometryofnumbers.pdf) begin with a section on lattices in Euclidean space. However they are a work in progress and certainly not yet fully satisfactory. Of the references I myself have been consulting for this material, the one I have found... | Check the following:
Roman,Steven: "Lattices and Ordered Sets", Springer
Blyth, T.S.: "Lattices and Ordered Algebraic Structures" , Springer
Roggenkamp, Klaus - Huber-Dyson, Verena : "Lattices over Orders" , Springer |
33,850 | We have a home garden and recently fuschia was added to our collection. it was all great looking and healthy but after a few days there were no blooms and it was all leaves on the plant. I did read some articles Googling the issue, and they suggested pruning or pinching. I did cut off some stems to encourage blooming t... | 2017/06/09 | [
"https://gardening.stackexchange.com/questions/33850",
"https://gardening.stackexchange.com",
"https://gardening.stackexchange.com/users/17859/"
] | I had similar problem with my Roma tomato plant. The yellow, uncurled leaves can signal a nitrogen deficiency or it could also be a fungal infection.
You may wanna apply a nitrogen-rich organic vegetable fertilizer or a fungicide to see if this solves the problem. In my case, the fertilizer and regular watering did th... | Those look pretty similar to spider mite damage. Which I am currently battling (successfully) in Texas. They bite individual cells and suck out the juices, leaving that stippling pattern. I think a fungus would have larger diameter circles, and thrip damage is usually in squiggly lines, not dots.
Look very closely at ... |
651,488 | I have a simple macro that I want to define as
```
\newcommand{\myalert}[1]{\textcolor{red}{ALERT: #1}}
```
However, I want to have a conditional such that if #1 is one of two strings (say "noalert" and "null"), then the macro is instead equivalent to ignoring #1 and eating it up:
```
\newcommand{\myalert}[1]{}
``... | 2022/07/20 | [
"https://tex.stackexchange.com/questions/651488",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/1970/"
] | Here is a possibility using `\str_case:nnF`:
```
\documentclass{article}
\usepackage{xcolor}
\ExplSyntaxOn
\NewDocumentCommand \myalert { m }
{
\str_case:nnF {#1}
{
{ noalert } { }
{ null } { }
}
{ \textcolor{red}{ALERT:~#1} }
}
\ExplSyntaxOff
\begin{document}
\noindent
\... | With pure (La)TeX:
```
\documentclass{article}
\usepackage{xcolor}
\newcommand{\myalert}[1]{%
\def\compareA{#1}%
\def\compareB{noalert}%
\def\compareC{null}%
\ifx\compareA\compareB\else%
\ifx\compareA\compareC\else%
\textcolor{red}{ALERT: #1}%
\fi%
\fi%
}
\begin{docume... |
651,488 | I have a simple macro that I want to define as
```
\newcommand{\myalert}[1]{\textcolor{red}{ALERT: #1}}
```
However, I want to have a conditional such that if #1 is one of two strings (say "noalert" and "null"), then the macro is instead equivalent to ignoring #1 and eating it up:
```
\newcommand{\myalert}[1]{}
``... | 2022/07/20 | [
"https://tex.stackexchange.com/questions/651488",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/1970/"
] | Here is a possibility using `\str_case:nnF`:
```
\documentclass{article}
\usepackage{xcolor}
\ExplSyntaxOn
\NewDocumentCommand \myalert { m }
{
\str_case:nnF {#1}
{
{ noalert } { }
{ null } { }
}
{ \textcolor{red}{ALERT:~#1} }
}
\ExplSyntaxOff
\begin{document}
\noindent
\... | *You did not specify what behavior you wish to have if things are wrapped in `\MakeUppercase`/`\MakeLowercase`/`\uppercase`/`\lowercase`.*
If you are not comfortable with temporary macros and `\ifx..\else..\fi` for whatsoever reason and like "oldschool-coding", then you can, e.g., do this fully expandable by means of ... |
4,039 | Here is the reason in question:
•"Questions seeking advice on company-specific regulations, agreements, or policies should be directed to your manager or HR department. Questions that address only a specific company or position are of limited use to future visitors. Questions seeking legal advice should be directed to... | 2016/11/16 | [
"https://workplace.meta.stackexchange.com/questions/4039",
"https://workplace.meta.stackexchange.com",
"https://workplace.meta.stackexchange.com/users/46894/"
] | As I suggested [here](https://workplace.meta.stackexchange.com/a/4040/325), I propose:
>
> Questions about company-specific regulations, agreements, or policies should be directed to your manager, your HR department, or an attorney. Questions that address only a specific company or position are of limited use to futu... | We need to keep a provision that prohibits questions seeking advice on company specific regulations.
----------------------------------------------------------------------------------------------------
These questions aren't usually applicable to others who might find the answers helpful, and often the topics that com... |
26,541,017 | Signed up to ask this question. How come I get an error with code like this?
FuzzyObject.h:
```
#ifndef FUZZYOBJECT_H
#define FUZZYOBJECT_H
#include <iostream>
#include <d3d9.h>
#include <d3dx9.h>
class FuzzyObject {
public:
FuzzyObject();
typedef struct tagFMaterial* FMaterial;
typedef struct tagFMesh*... | 2014/10/24 | [
"https://Stackoverflow.com/questions/26541017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4156345/"
] | **The problem is in the second loop.**
Making progress as **j=i** and checking for **j<=i** will always give the **true** result. So there is the infinite loop.
You may want to change the progress to something like `j= j+1`
**Edit:** You need to do this
```
for (int i=1;i<=10;i=i+1) {
for (int j=1;j<=i; j++) {
... | The problem caused in second loop during initialize `j = i`. This interrupt the var `j` to be increment. It should be `j++` or `j += 1` or `j = j + 1`. Example here...
```
for (int i = 1; i <= 10; i++) {
for (int j = 1; j <= i ; j++) {
jTextArea1.append(" "+i);
}
}
``` |
26,541,017 | Signed up to ask this question. How come I get an error with code like this?
FuzzyObject.h:
```
#ifndef FUZZYOBJECT_H
#define FUZZYOBJECT_H
#include <iostream>
#include <d3d9.h>
#include <d3dx9.h>
class FuzzyObject {
public:
FuzzyObject();
typedef struct tagFMaterial* FMaterial;
typedef struct tagFMesh*... | 2014/10/24 | [
"https://Stackoverflow.com/questions/26541017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4156345/"
] | **The problem is in the second loop.**
Making progress as **j=i** and checking for **j<=i** will always give the **true** result. So there is the infinite loop.
You may want to change the progress to something like `j= j+1`
**Edit:** You need to do this
```
for (int i=1;i<=10;i=i+1) {
for (int j=1;j<=i; j++) {
... | Use this see what is happening. I've simplified your code a bit:
```
for (int i=1; i<=10; i++){
for (int j=1; j<i; j=i){
System.out.println("j=" + j + ", i=" + i);
}
}
``` |
415,226 | i want to extract block of text based on ids present in another file,
Input
```
>Feature scaffold1
1 100 g
101 200 g
201 300 g
500 500 r
900 1000 r
>Feature scaffold2
1 100 g
01 500 g
200 300 r
>Feature scaffold3
10 500 g
100 200 r
>Feature scaffold4
10 300 g
500 600 r
>Feature scaffold5
1 1000 r
```
... | 2018/01/06 | [
"https://unix.stackexchange.com/questions/415226",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/244634/"
] | Short **`awk`** solution:
```
awk 'NR==FNR{ a[$1]; next }/^>Feature/{ f=($2 in a) }f' id.txt input.txt
```
* `NR==FNR{ ... }` - processing the 1st input file (i.e. `id.txt`):
+ `a[$1]` - capturing each *"scaffold"* id into array `a`
+ `next` - jump to next record
* `/^>Feature/` - on encountering pattern line star... | Perl solution:
```
#!/usr/bin/perl
open $ids, '<', 'id.txt' or die $!;
chomp, $h{$_} = 1 while <$ids>;
open $in, '<', 'input.txt' or die $!;
while (<$in>) {
$id = $1 if />Feature (.*)/;
print if $h{$id};
}
```
It first loads the ids into a hash, then it reads the input file line by line, sets the current id... |
415,226 | i want to extract block of text based on ids present in another file,
Input
```
>Feature scaffold1
1 100 g
101 200 g
201 300 g
500 500 r
900 1000 r
>Feature scaffold2
1 100 g
01 500 g
200 300 r
>Feature scaffold3
10 500 g
100 200 r
>Feature scaffold4
10 300 g
500 600 r
>Feature scaffold5
1 1000 r
```
... | 2018/01/06 | [
"https://unix.stackexchange.com/questions/415226",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/244634/"
] | Perl solution:
```
#!/usr/bin/perl
open $ids, '<', 'id.txt' or die $!;
chomp, $h{$_} = 1 while <$ids>;
open $in, '<', 'input.txt' or die $!;
while (<$in>) {
$id = $1 if />Feature (.*)/;
print if $h{$id};
}
```
It first loads the ids into a hash, then it reads the input file line by line, sets the current id... | I have done by below method
```
for i in scaffold1 scaffold3 scaffold4
> do
> sed -n "/$i/,/scaffold/p" inputfile | sed '$d'
> done
```
output.
```
Feature scaffold1
1 100 g
101 200 g
201 300 g
500 500 r
900 1000 r
>Feature scaffold3
10 500 g
100 200 r
>Feature scaffold4
10 300 g
500 600 r
``` |
415,226 | i want to extract block of text based on ids present in another file,
Input
```
>Feature scaffold1
1 100 g
101 200 g
201 300 g
500 500 r
900 1000 r
>Feature scaffold2
1 100 g
01 500 g
200 300 r
>Feature scaffold3
10 500 g
100 200 r
>Feature scaffold4
10 300 g
500 600 r
>Feature scaffold5
1 1000 r
```
... | 2018/01/06 | [
"https://unix.stackexchange.com/questions/415226",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/244634/"
] | Short **`awk`** solution:
```
awk 'NR==FNR{ a[$1]; next }/^>Feature/{ f=($2 in a) }f' id.txt input.txt
```
* `NR==FNR{ ... }` - processing the 1st input file (i.e. `id.txt`):
+ `a[$1]` - capturing each *"scaffold"* id into array `a`
+ `next` - jump to next record
* `/^>Feature/` - on encountering pattern line star... | I have done by below method
```
for i in scaffold1 scaffold3 scaffold4
> do
> sed -n "/$i/,/scaffold/p" inputfile | sed '$d'
> done
```
output.
```
Feature scaffold1
1 100 g
101 200 g
201 300 g
500 500 r
900 1000 r
>Feature scaffold3
10 500 g
100 200 r
>Feature scaffold4
10 300 g
500 600 r
``` |
58,278,466 | Is there a pythonic way to check if two objects are of one specific type? I suppose this is more of academic interest than actual code necessity.
Obviously using two `isinstance()` would work, and the triple equation does the trick as well, but I was wondering if there is a one-liner that would work and be pythonic as... | 2019/10/07 | [
"https://Stackoverflow.com/questions/58278466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5086312/"
] | At the moment you can control trace order within trace types by ordering the trace objects in the data array, but not across trace types, so violins will always draw behind scatters. | I found a clever way around it. In this case, you first assign the graph object to a variable:
```
PLOT1 = go.Scatter(STUFF)
PLOT2 = go.Scatter(STUFF)
PLOT3 = go.Scatter(STUFF)
```
You can then specify a dictionary with the desired order:
```
order = {"1":PLOT3, "2":PLOT1, "3":PLOT2}
for i in np.arange(1, len(orde... |
58,278,466 | Is there a pythonic way to check if two objects are of one specific type? I suppose this is more of academic interest than actual code necessity.
Obviously using two `isinstance()` would work, and the triple equation does the trick as well, but I was wondering if there is a one-liner that would work and be pythonic as... | 2019/10/07 | [
"https://Stackoverflow.com/questions/58278466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5086312/"
] | There's a feature request for this, and a workaround proposed that works some of the time: [feature request: z-ordering parameter for traces](https://github.com/plotly/plotly.py/issues/2345).
```py
import plotly.express as px
import plotly.graph_objects as go
fig = px.scatter(x=[1,2,3,4], y=[1,2,3,4], size=[1,2,3,4],... | I found a clever way around it. In this case, you first assign the graph object to a variable:
```
PLOT1 = go.Scatter(STUFF)
PLOT2 = go.Scatter(STUFF)
PLOT3 = go.Scatter(STUFF)
```
You can then specify a dictionary with the desired order:
```
order = {"1":PLOT3, "2":PLOT1, "3":PLOT2}
for i in np.arange(1, len(orde... |
37,845,483 | I'm very new to macros and I'm trying to teach myself VBA in excel 2013 and could use a lot of help. I would like to know how to change a shape fill color (not a cell) when I click an ActiveX button. Here is what I'm thinking:
```
onClick() <-- Do I need a button name?
if shape.color = RGB(2... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37845483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6471570/"
] | Here is the code you are looking for:
```
Option Explicit
Sub ButtonClick()
Dim shp As Shape
Set shp = ThisWorkbook.Worksheets(1).Shapes("Rectangle 1")
If shp.Fill.ForeColor.RGB = RGB(231, 230, 230) Then
shp.Fill.ForeColor.RGB = RGB(0, 0, 0)
Else
shp.Fill.ForeColor.RGB = RGB(231, 230, 230)
End If
End Sub
... | Put this in the module of the worksheet which contains the button:
EDITED: Sorry, I originally thought you wanted the actual button colour to change. I borrowed from Ralph's answer to account for the shape being the object of the colour change, but below this is for an ActiveX control (as you asked) instead of a form ... |
37,845,483 | I'm very new to macros and I'm trying to teach myself VBA in excel 2013 and could use a lot of help. I would like to know how to change a shape fill color (not a cell) when I click an ActiveX button. Here is what I'm thinking:
```
onClick() <-- Do I need a button name?
if shape.color = RGB(2... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37845483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6471570/"
] | Put this in the module of the worksheet which contains the button:
EDITED: Sorry, I originally thought you wanted the actual button colour to change. I borrowed from Ralph's answer to account for the shape being the object of the colour change, but below this is for an ActiveX control (as you asked) instead of a form ... | Yes, you need a button name. Drop an ActiveX control on the sheet, then go to the sheet's module in the VBE. In the left dropdown at the top of the code pane, find your control name (you probably want to rename it first - I didn't for this example)
[]... |
37,845,483 | I'm very new to macros and I'm trying to teach myself VBA in excel 2013 and could use a lot of help. I would like to know how to change a shape fill color (not a cell) when I click an ActiveX button. Here is what I'm thinking:
```
onClick() <-- Do I need a button name?
if shape.color = RGB(2... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37845483",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6471570/"
] | Here is the code you are looking for:
```
Option Explicit
Sub ButtonClick()
Dim shp As Shape
Set shp = ThisWorkbook.Worksheets(1).Shapes("Rectangle 1")
If shp.Fill.ForeColor.RGB = RGB(231, 230, 230) Then
shp.Fill.ForeColor.RGB = RGB(0, 0, 0)
Else
shp.Fill.ForeColor.RGB = RGB(231, 230, 230)
End If
End Sub
... | Yes, you need a button name. Drop an ActiveX control on the sheet, then go to the sheet's module in the VBE. In the left dropdown at the top of the code pane, find your control name (you probably want to rename it first - I didn't for this example)
[]... |
26,479,963 | I've seen instances of code where info is passed to a function without a temporary variable and I can't figure out how to do it. Here is what I mean:
```
For i = 1 to ubound(arr)
temp = cool_function(arr(i))
next
```
So in the above it's possible to pass arr(i) directly to the cool\_function. However, when I try... | 2014/10/21 | [
"https://Stackoverflow.com/questions/26479963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3973919/"
] | It should work as long as the element type is the same as the argument type.
So for example you have a function like this:
```
Function cool_function(wild As String)
'~~> cool stuff here
End Function
```
In your sub, below should work:
```
Sub Test()
Dim arr() As String
'~~> populate array somewhere ... | This works for me:
```
Sub arrFunctionTest()
Dim arrV(3) As Variant
For i = 1 To 3
arrV(i) = i
arrV(i) = cool_Function(arrV, i)
Next i
For i = 1 To 3
Debug.Print arrV(i)
Next i
End Sub
Function cool_Function(arr As Variant, i) As Integer
cool_Function = arr(i) * 2
E... |
9,381,077 | I have a feeling I'm overlooking something elementary, but what better way to find it than to be wrong on the internet?
I have a fairly basic UI. The view for my `UIViewController` is a subclass whose `+layerClass` is `CAGradientLayer`. Depending on the user's actions, I need to move some UI elements around, and chang... | 2012/02/21 | [
"https://Stackoverflow.com/questions/9381077",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16892/"
] | There seem to be two things going on here. The first (as Travis correctly points out, and the documentation states) is that UIKit animations don't seem to hold any sway over the implicit animation applied to `CALayer` property changes. I think this is weird (UIKit *must* be using Core Animation), but it is what it is.
... | You have to use explicit CAAnimations, because you're changing the value of a CALayer.
UIViewAnimations work on UIView properties, but not directly on their CALayer's properties...
Actually, you should use a CABasicAnimation so that you can access its `fromValue` and `toValue` properties.
The following code should wo... |
42,532 | I'm working on an application which allows users to search real estate.
One of the app's features will be the ability to search in several (maximum of 3) locations at the same time.
**Problem**
How to show the user all 3 locations that he has chosen on the search/home screen?
**Solution 1**
Show text fields w... | 2013/07/22 | [
"https://ux.stackexchange.com/questions/42532",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/22513/"
] | Can't you just limit adding location up to three positions? When maximum is reached the button is dissapeared, so it is natural constraint.
Also I think it is more convenient to display first more specific location part, i.e. street. You can hide part of a city name, it is in user's mind. But street address is more ... | You could just write "3 selected locations" and add an `edit locations` icon to it. |
55,154,198 | I don't see why my code isn't working. I want to remove the bullets on my ul anchors. but "ul {list-style: none;} isn't working.
Here's my code:
```
<div class="nav-wrapper">
<div class="logo">
<!-- <a href="/">Logo</a> -->
</div>
<div class="main-page-links">
<ul>
<li><a href... | 2019/03/14 | [
"https://Stackoverflow.com/questions/55154198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11200474/"
] | Maybe your browser is cached, try using `control`+`shift`+`R` on the page you are using, your code is fine here
```css
*{
margin: 0;
padding: 0;
box-sizing: border-box;}
body{
height: 100%;
}
.nav-wrapper{
display: grid;
grid-template-columns: repeat(6, 1);
grid-template-rows: 8;
height: 100px;
widt... | I tried list-style: none, no bullets show.
```css
*{
margin: 0;
padding: 0;
box-sizing: border-box;}
body{
height: 100%;
}
.nav-wrapper{
display: grid;
grid-template-columns: repeat(6, 1);
grid-template-rows: 8;
height: 100px;
width: 900px;}
ul { list-style: none;} /* I thought this w... |
55,154,198 | I don't see why my code isn't working. I want to remove the bullets on my ul anchors. but "ul {list-style: none;} isn't working.
Here's my code:
```
<div class="nav-wrapper">
<div class="logo">
<!-- <a href="/">Logo</a> -->
</div>
<div class="main-page-links">
<ul>
<li><a href... | 2019/03/14 | [
"https://Stackoverflow.com/questions/55154198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11200474/"
] | Maybe your browser is cached, try using `control`+`shift`+`R` on the page you are using, your code is fine here
```css
*{
margin: 0;
padding: 0;
box-sizing: border-box;}
body{
height: 100%;
}
.nav-wrapper{
display: grid;
grid-template-columns: repeat(6, 1);
grid-template-rows: 8;
height: 100px;
widt... | try executing it with
list-style-type: none;
it should work perfectly. |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | The integral of a function being zero does not imply that the function is zero. But you can apply the mean value theorem to $h$ to show that it must be zero at a point.
The integral mean value theorem for continuous function s$\mathbb R\to \mathbb R$ states that if $$\int\_a^b f(x)\,dx=S,$$ then there exists a point $... | Consider proving the contrapositive: if $f(x) \ne g(x)$ for all $x$ in $[a, b]$, then $\int\_a^b f \ne \int\_a^b g$. Because $f - g$ is continuous, it has *constant sign* on $[a, b]$: since it's never zero, IVT prevents it from being positive somewhere and negative elsewhere. So, swapping the roles of $f$ and $g$ if ne... |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | The MVT states that if
$$\int\_a^bh(t)dt=k$$ then there exists some $c\in[a,b]$ such that
$$k(b-a)=h(c)$$
Since in this case $k=0$ we get
$$h(c)=0$$ | The integral of a function being zero does not imply that the function is zero. But you can apply the mean value theorem to $h$ to show that it must be zero at a point.
The integral mean value theorem for continuous function s$\mathbb R\to \mathbb R$ states that if $$\int\_a^b f(x)\,dx=S,$$ then there exists a point $... |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | It is not true that
$$\int\_a^bh(x)dx=0\implies h(x)=0,\forall x\in[a,b].$$
For example
$$\int\_0^{2\pi}\sin x\,dx=0.$$
However, if $\int\_a^bh(x)dx=0$ and $h$ is continuous, then $h(x)=0$ at one point. We can prove it by contrapositive. Suppose $h(x)\neq 0$ for all $x\in[a,b]$. By continuity and the Inetermediate Valu... | The integral of a function being zero does not imply that the function is zero. But you can apply the mean value theorem to $h$ to show that it must be zero at a point.
The integral mean value theorem for continuous function s$\mathbb R\to \mathbb R$ states that if $$\int\_a^b f(x)\,dx=S,$$ then there exists a point $... |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | The integral of a function being zero does not imply that the function is zero. But you can apply the mean value theorem to $h$ to show that it must be zero at a point.
The integral mean value theorem for continuous function s$\mathbb R\to \mathbb R$ states that if $$\int\_a^b f(x)\,dx=S,$$ then there exists a point $... | Others have explained your mistake. Here is a proof of the fact that starts with your approach:
Apply the [mean value theorem for integrals](https://en.wikipedia.org/wiki/Mean_value_theorem#Mean_value_theorems_for_integration) to $h$ to conclude that
$$
0 = \int\_a^b h = h(c) (b-a)
$$
which implies $h(c)=0$, that is, ... |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | It is not true that
$$\int\_a^bh(x)dx=0\implies h(x)=0,\forall x\in[a,b].$$
For example
$$\int\_0^{2\pi}\sin x\,dx=0.$$
However, if $\int\_a^bh(x)dx=0$ and $h$ is continuous, then $h(x)=0$ at one point. We can prove it by contrapositive. Suppose $h(x)\neq 0$ for all $x\in[a,b]$. By continuity and the Inetermediate Valu... | You can't conclude that $\forall x\in [a,b], h(x) = 0 $. Take $h(x) = x$ on $[-1,1]$ as a counterexemple.
But if $\int\_a^b h(x) = 0$, then $H$ a primitive of $h$ verify $H(a) = H(b)$. Then you use Rolle theorem to show that there exist $c\in ]a,b[$ such that $H'(c) = 0$ |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | It is not true that
$$\int\_a^bh(x)dx=0\implies h(x)=0,\forall x\in[a,b].$$
For example
$$\int\_0^{2\pi}\sin x\,dx=0.$$
However, if $\int\_a^bh(x)dx=0$ and $h$ is continuous, then $h(x)=0$ at one point. We can prove it by contrapositive. Suppose $h(x)\neq 0$ for all $x\in[a,b]$. By continuity and the Inetermediate Valu... | Consider proving the contrapositive: if $f(x) \ne g(x)$ for all $x$ in $[a, b]$, then $\int\_a^b f \ne \int\_a^b g$. Because $f - g$ is continuous, it has *constant sign* on $[a, b]$: since it's never zero, IVT prevents it from being positive somewhere and negative elsewhere. So, swapping the roles of $f$ and $g$ if ne... |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | The integral of a function being zero does not imply that the function is zero. But you can apply the mean value theorem to $h$ to show that it must be zero at a point.
The integral mean value theorem for continuous function s$\mathbb R\to \mathbb R$ states that if $$\int\_a^b f(x)\,dx=S,$$ then there exists a point $... | You can't conclude that $\forall x\in [a,b], h(x) = 0 $. Take $h(x) = x$ on $[-1,1]$ as a counterexemple.
But if $\int\_a^b h(x) = 0$, then $H$ a primitive of $h$ verify $H(a) = H(b)$. Then you use Rolle theorem to show that there exist $c\in ]a,b[$ such that $H'(c) = 0$ |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | It is not true that
$$\int\_a^bh(x)dx=0\implies h(x)=0,\forall x\in[a,b].$$
For example
$$\int\_0^{2\pi}\sin x\,dx=0.$$
However, if $\int\_a^bh(x)dx=0$ and $h$ is continuous, then $h(x)=0$ at one point. We can prove it by contrapositive. Suppose $h(x)\neq 0$ for all $x\in[a,b]$. By continuity and the Inetermediate Valu... | Others have explained your mistake. Here is a proof of the fact that starts with your approach:
Apply the [mean value theorem for integrals](https://en.wikipedia.org/wiki/Mean_value_theorem#Mean_value_theorems_for_integration) to $h$ to conclude that
$$
0 = \int\_a^b h = h(c) (b-a)
$$
which implies $h(c)=0$, that is, ... |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | The MVT states that if
$$\int\_a^bh(t)dt=k$$ then there exists some $c\in[a,b]$ such that
$$k(b-a)=h(c)$$
Since in this case $k=0$ we get
$$h(c)=0$$ | Consider proving the contrapositive: if $f(x) \ne g(x)$ for all $x$ in $[a, b]$, then $\int\_a^b f \ne \int\_a^b g$. Because $f - g$ is continuous, it has *constant sign* on $[a, b]$: since it's never zero, IVT prevents it from being positive somewhere and negative elsewhere. So, swapping the roles of $f$ and $g$ if ne... |
1,354,059 | Let $f : [a,b] \to \mathbb R$ and $g : [a,b] \to \mathbb R$ be continuous on $[a,b]$ and $\int\_a^b f = \int\_a^b g$, then there exists a point $c \in [a,b]$ such that $f(c) =g(c)$.
If we let $h(x) = f(x) - g(x)$ then we have
$$\int\_a^b h = \int\_a^b \bigl(f-g\bigr) = \int\_a^b f - \int\_a^b g = 0$$
From these we c... | 2015/07/08 | [
"https://math.stackexchange.com/questions/1354059",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/98414/"
] | The MVT states that if
$$\int\_a^bh(t)dt=k$$ then there exists some $c\in[a,b]$ such that
$$k(b-a)=h(c)$$
Since in this case $k=0$ we get
$$h(c)=0$$ | Others have explained your mistake. Here is a proof of the fact that starts with your approach:
Apply the [mean value theorem for integrals](https://en.wikipedia.org/wiki/Mean_value_theorem#Mean_value_theorems_for_integration) to $h$ to conclude that
$$
0 = \int\_a^b h = h(c) (b-a)
$$
which implies $h(c)=0$, that is, ... |
477,475 | Django webservices is running on port 8000 (pyhon manage.py runserver 0.0.0.0:8000)
I am able to access using , <https://ec2-72-44-51-113.compute-1.amazonaws.com/admin/>
but if I specify port in url, <https://ec2-72-44-51-113.compute-1.amazonaws.com:8000/admin/>
I am not able to access the portal..
What could be pos... | 2013/02/11 | [
"https://serverfault.com/questions/477475",
"https://serverfault.com",
"https://serverfault.com/users/158420/"
] | If you want to reach port 8000 from outside AWS, you must add it as a permitted port in your AWS security group. | The first link you provide is 'https://...', so this would be accessing port 443 of the server. In order for this to work, there must be something (apache, nginx, pound, ...) proxying the requests through to the python process. It probably also means that it's hosting an SSL cert.
The second link is '<https://ec2-72-4... |
55,244,130 | As the title of this post, I found the answer regarding "Can we put subviews of a UIView in front of its CALayer" in [this](https://stackoverflow.com/questions/6551394/put-subviews-of-a-uiview-in-front-of-its-calayer) post, but I cannot find the answer to *why* this is so. In my opinion, having the view as the subview ... | 2019/03/19 | [
"https://Stackoverflow.com/questions/55244130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10378044/"
] | You can use `combinations` to generate all pairs and use `sample` to choose randomly. Admittedly only lazy in the "not much to type" sense, and not in the use a generator not a list sense :-)
```
from itertools import combinations
from random import sample
n = 100
sample(list(combinations(range(1,n),2)),5)
```
If y... | I don't think any thing on your line can improve. After all, as your `m` get closer and closer to the limit `n(n-1)/2`, you have thinner and thinner chance to find the unseen pair.
I would suggest to split into two cases: if `m` is small, use your random approach. But if `m` is large enough, try
```
pairs = list(ite... |
55,244,130 | As the title of this post, I found the answer regarding "Can we put subviews of a UIView in front of its CALayer" in [this](https://stackoverflow.com/questions/6551394/put-subviews-of-a-uiview-in-front-of-its-calayer) post, but I cannot find the answer to *why* this is so. In my opinion, having the view as the subview ... | 2019/03/19 | [
"https://Stackoverflow.com/questions/55244130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10378044/"
] | Here is an approach which works by taking a number in the range `0 to n*(n-1)/2 - 1` and decodes it to a unique pair of items in the range `0 to n-1`. I used 0-based math for convenience, but you could of course add 1 to all of the returned pairs if you want:
```
import math
import random
def decode(i):
k = math.... | You can use `combinations` to generate all pairs and use `sample` to choose randomly. Admittedly only lazy in the "not much to type" sense, and not in the use a generator not a list sense :-)
```
from itertools import combinations
from random import sample
n = 100
sample(list(combinations(range(1,n),2)),5)
```
If y... |
55,244,130 | As the title of this post, I found the answer regarding "Can we put subviews of a UIView in front of its CALayer" in [this](https://stackoverflow.com/questions/6551394/put-subviews-of-a-uiview-in-front-of-its-calayer) post, but I cannot find the answer to *why* this is so. In my opinion, having the view as the subview ... | 2019/03/19 | [
"https://Stackoverflow.com/questions/55244130",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10378044/"
] | Here is an approach which works by taking a number in the range `0 to n*(n-1)/2 - 1` and decodes it to a unique pair of items in the range `0 to n-1`. I used 0-based math for convenience, but you could of course add 1 to all of the returned pairs if you want:
```
import math
import random
def decode(i):
k = math.... | I don't think any thing on your line can improve. After all, as your `m` get closer and closer to the limit `n(n-1)/2`, you have thinner and thinner chance to find the unseen pair.
I would suggest to split into two cases: if `m` is small, use your random approach. But if `m` is large enough, try
```
pairs = list(ite... |
45,613,775 | I have a json file with the following format:
```
{userid: 1, client_visited: [1001, 1002]}
{userid: 2, client_visited: [1001, 1004]}
{userid: 3, client_visited: [1004, 1006]}
{userid: 4, client_visited: [1003, 1005, 1006]}
{userid: 5, client_visited: [1006]}
```
I have a mapping of clients that is output from MYSQL... | 2017/08/10 | [
"https://Stackoverflow.com/questions/45613775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7321201/"
] | First, jq is a JSON processor, so you will have to convert your file and dictionary to valid JSON. (For some guidance in doing so, see the [jq FAQ](https://github.com/stedolan/jq/wiki/FAQ "jq FAQ")).
Second, you haven't indicated where the dictionary is to be found. In the following, I'll assume it can be included in... | Not as succinct as [peak](https://stackoverflow.com/users/997358/peak)'s answer but here is a solution using **reduce** to iterate over the indices of `client_visited` updating each element.
```
reduce (.client_visited|range(length)) as $i (
.
; .client_visited[$i] |= $arg[tostring]
)
```
To specify `$arg` yo... |
12,905 | I've been chasing some weird problems with a Custom Field Type on a page that has a list view web part with Designer-provided Conditional Formatting.
It seems like the XSL for the fields have been frozen since I added the Conditional Formatting; it no longer changes when the custom field type's XSL is updated and rede... | 2011/05/17 | [
"https://sharepoint.stackexchange.com/questions/12905",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/1529/"
] | I think here you will need, first of all, to understand, how the conditional formatting actually works.
Conditional formatting in SPD is not more than a visual way to define Xsl property of XsltListViewWebPart and other standard webparts, which use xsl transformations. Xsl property contains custom xsl code, and links ... | I'm not quite sure what you mean. XSL is just the XML processing instructions that convert the XML data into HTML for display on the page. So yes, the XSL would be static in that regard. Conditional formatting is just further instructions on how to handle particular rows of data that is output. |
12,905 | I've been chasing some weird problems with a Custom Field Type on a page that has a list view web part with Designer-provided Conditional Formatting.
It seems like the XSL for the fields have been frozen since I added the Conditional Formatting; it no longer changes when the custom field type's XSL is updated and rede... | 2011/05/17 | [
"https://sharepoint.stackexchange.com/questions/12905",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/1529/"
] | I think here you will need, first of all, to understand, how the conditional formatting actually works.
Conditional formatting in SPD is not more than a visual way to define Xsl property of XsltListViewWebPart and other standard webparts, which use xsl transformations. Xsl property contains custom xsl code, and links ... | I've noticed when working with the XSLT List View Web Part, that sometimes changes to the XSLT do not show up. This usually happens to me because there is some invalid XSLT in my stylesheet, so it uses the last stylesheet that worked. As long as there is invalid XSLT it continues to use the old stylesheet. Try opening ... |
60,117,872 | I have two parsers `parser1 :: Parser a` and `parser2 :: Parser a`.
I would like now to parse a list of `a`s interspersing them with `parser2`
The desired signature is something like
```
interspersedParser :: Parser b -> Parser a -> Parser [a]
```
For example, if `Parser a` parses the `'a'` character and `Parser b... | 2020/02/07 | [
"https://Stackoverflow.com/questions/60117872",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2718064/"
] | If you want to correctly scale to all screens on anything; My best rules are using ScrollView and RelativeLayout/ConstraintLayout in general so it's usable and scales.
You can choose between ConstraintLayout and RelativeLayout; Both should scale correctly, perhaps Relative is easier since you don't have to set the co... | I am currently working on a similar layout using Switch with custom drawable for its thumb and track. From what I have learned, LinearLayout weight property can affect your Switch track's drawable (either cropped or squished) if your device width doesn't provide enough room.
With this unwanted behavior, I recommend ch... |
5,935,941 | Like the title says:
I have a `DateTime start` and a `DateTime stop`
Now i want to compare these with a `List<DateTime> dates`
I just wanto check if the list `dates` is between `start` and `stop`
`if(dates.all(..... >= start && <= stop)) {
. do something
}` | 2011/05/09 | [
"https://Stackoverflow.com/questions/5935941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687478/"
] | The pseudo-code in your question is not far from the working code you're looking for.
Using LINQ's [All()](http://msdn.microsoft.com/en-us/library/bb548541.aspx) method:
```
if (dates.All(date => date >= start && date <= stop)) {
// Do something.
}
``` | Sort the list.
Check if the first item in the list is >= start date and last item in the list <= end date |
5,935,941 | Like the title says:
I have a `DateTime start` and a `DateTime stop`
Now i want to compare these with a `List<DateTime> dates`
I just wanto check if the list `dates` is between `start` and `stop`
`if(dates.all(..... >= start && <= stop)) {
. do something
}` | 2011/05/09 | [
"https://Stackoverflow.com/questions/5935941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687478/"
] | Sort the list.
Check if the first item in the list is >= start date and last item in the list <= end date | You can work on it like
```
bool allTrue = LstDates.TrueForAll(delegate(DateTime dt) { return dt >= startDate && dt <= endDate; });
``` |
5,935,941 | Like the title says:
I have a `DateTime start` and a `DateTime stop`
Now i want to compare these with a `List<DateTime> dates`
I just wanto check if the list `dates` is between `start` and `stop`
`if(dates.all(..... >= start && <= stop)) {
. do something
}` | 2011/05/09 | [
"https://Stackoverflow.com/questions/5935941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687478/"
] | The pseudo-code in your question is not far from the working code you're looking for.
Using LINQ's [All()](http://msdn.microsoft.com/en-us/library/bb548541.aspx) method:
```
if (dates.All(date => date >= start && date <= stop)) {
// Do something.
}
``` | With linq: `if(dates.All(d => d >= start && d <= stop))` |
5,935,941 | Like the title says:
I have a `DateTime start` and a `DateTime stop`
Now i want to compare these with a `List<DateTime> dates`
I just wanto check if the list `dates` is between `start` and `stop`
`if(dates.all(..... >= start && <= stop)) {
. do something
}` | 2011/05/09 | [
"https://Stackoverflow.com/questions/5935941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687478/"
] | The pseudo-code in your question is not far from the working code you're looking for.
Using LINQ's [All()](http://msdn.microsoft.com/en-us/library/bb548541.aspx) method:
```
if (dates.All(date => date >= start && date <= stop)) {
// Do something.
}
``` | Use the `All` extension method, and a lambda expression that does the comparison:
```
if (dates.All(d => d >= start && d <= stop)) { ... }
``` |
5,935,941 | Like the title says:
I have a `DateTime start` and a `DateTime stop`
Now i want to compare these with a `List<DateTime> dates`
I just wanto check if the list `dates` is between `start` and `stop`
`if(dates.all(..... >= start && <= stop)) {
. do something
}` | 2011/05/09 | [
"https://Stackoverflow.com/questions/5935941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687478/"
] | The pseudo-code in your question is not far from the working code you're looking for.
Using LINQ's [All()](http://msdn.microsoft.com/en-us/library/bb548541.aspx) method:
```
if (dates.All(date => date >= start && date <= stop)) {
// Do something.
}
``` | Incase you want to iterate just the dates in the bracket, you can use the following:
```
foreach (DateTime date in dates.Where(o => o >= start && o <= stop))
{
//Do your thing.
}
``` |
5,935,941 | Like the title says:
I have a `DateTime start` and a `DateTime stop`
Now i want to compare these with a `List<DateTime> dates`
I just wanto check if the list `dates` is between `start` and `stop`
`if(dates.all(..... >= start && <= stop)) {
. do something
}` | 2011/05/09 | [
"https://Stackoverflow.com/questions/5935941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687478/"
] | The pseudo-code in your question is not far from the working code you're looking for.
Using LINQ's [All()](http://msdn.microsoft.com/en-us/library/bb548541.aspx) method:
```
if (dates.All(date => date >= start && date <= stop)) {
// Do something.
}
``` | You can work on it like
```
bool allTrue = LstDates.TrueForAll(delegate(DateTime dt) { return dt >= startDate && dt <= endDate; });
``` |
5,935,941 | Like the title says:
I have a `DateTime start` and a `DateTime stop`
Now i want to compare these with a `List<DateTime> dates`
I just wanto check if the list `dates` is between `start` and `stop`
`if(dates.all(..... >= start && <= stop)) {
. do something
}` | 2011/05/09 | [
"https://Stackoverflow.com/questions/5935941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687478/"
] | With linq: `if(dates.All(d => d >= start && d <= stop))` | You can work on it like
```
bool allTrue = LstDates.TrueForAll(delegate(DateTime dt) { return dt >= startDate && dt <= endDate; });
``` |
5,935,941 | Like the title says:
I have a `DateTime start` and a `DateTime stop`
Now i want to compare these with a `List<DateTime> dates`
I just wanto check if the list `dates` is between `start` and `stop`
`if(dates.all(..... >= start && <= stop)) {
. do something
}` | 2011/05/09 | [
"https://Stackoverflow.com/questions/5935941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687478/"
] | Use the `All` extension method, and a lambda expression that does the comparison:
```
if (dates.All(d => d >= start && d <= stop)) { ... }
``` | You can work on it like
```
bool allTrue = LstDates.TrueForAll(delegate(DateTime dt) { return dt >= startDate && dt <= endDate; });
``` |
5,935,941 | Like the title says:
I have a `DateTime start` and a `DateTime stop`
Now i want to compare these with a `List<DateTime> dates`
I just wanto check if the list `dates` is between `start` and `stop`
`if(dates.all(..... >= start && <= stop)) {
. do something
}` | 2011/05/09 | [
"https://Stackoverflow.com/questions/5935941",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/687478/"
] | Incase you want to iterate just the dates in the bracket, you can use the following:
```
foreach (DateTime date in dates.Where(o => o >= start && o <= stop))
{
//Do your thing.
}
``` | You can work on it like
```
bool allTrue = LstDates.TrueForAll(delegate(DateTime dt) { return dt >= startDate && dt <= endDate; });
``` |
31,119,225 | I kind of don't get the nested loops, can someone explain to me why the following code is executed 45 times please? Shouldn't the i++ and j++ increment by 1? So first loop should be (0 \* 0), (1 \* 1), (2 \* 2) and so on.
```
for(int i = 0; i < 10; i++)
for(int j = 0; j < i; j++)
System.out.println(i * j);... | 2015/06/29 | [
"https://Stackoverflow.com/questions/31119225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4090343/"
] | outer loop runs `i` times according to value of `i`
1st i value is `0` last `i` value is `9` because `i<10`.
so inner loop loops `9*10/2` which is `45`
loop time=`0+1+2+.....+8+9` = `9*10/2` = `45`
note . i used this equation to calculate sum of the loop times
```
1 + 2 + 3 + ... + N = N(N+1)/2
``` | That is not how nested loops work, its like this -
1. First we enter outer loop, then we execute inner loop till the inner loop exits (that is j's value becomes equal to i) , and only after that we again increment i.
So for example , if `i` is 5 , it would enter the the outer loop, and then `j` would start from `0` t... |
31,119,225 | I kind of don't get the nested loops, can someone explain to me why the following code is executed 45 times please? Shouldn't the i++ and j++ increment by 1? So first loop should be (0 \* 0), (1 \* 1), (2 \* 2) and so on.
```
for(int i = 0; i < 10; i++)
for(int j = 0; j < i; j++)
System.out.println(i * j);... | 2015/06/29 | [
"https://Stackoverflow.com/questions/31119225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4090343/"
] | outer loop runs `i` times according to value of `i`
1st i value is `0` last `i` value is `9` because `i<10`.
so inner loop loops `9*10/2` which is `45`
loop time=`0+1+2+.....+8+9` = `9*10/2` = `45`
note . i used this equation to calculate sum of the loop times
```
1 + 2 + 3 + ... + N = N(N+1)/2
``` | Rather than printing out the expression `i * j`, print out the values of `i` and `j` so you can trace through and see whats happening in the loops. The product of `i * j` is really meaningless to understand how many times it loops.
```
for(int i = 0; i < 10; i++)
for(int j = 0; j < i; j++)
System.out.print... |
31,119,225 | I kind of don't get the nested loops, can someone explain to me why the following code is executed 45 times please? Shouldn't the i++ and j++ increment by 1? So first loop should be (0 \* 0), (1 \* 1), (2 \* 2) and so on.
```
for(int i = 0; i < 10; i++)
for(int j = 0; j < i; j++)
System.out.println(i * j);... | 2015/06/29 | [
"https://Stackoverflow.com/questions/31119225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4090343/"
] | outer loop runs `i` times according to value of `i`
1st i value is `0` last `i` value is `9` because `i<10`.
so inner loop loops `9*10/2` which is `45`
loop time=`0+1+2+.....+8+9` = `9*10/2` = `45`
note . i used this equation to calculate sum of the loop times
```
1 + 2 + 3 + ... + N = N(N+1)/2
``` | I feel that you have a problem in understanding the scope of variables. I am re-writing the code for better understanding:
```
for(int i = 0; i < 10; i++){
for(int j = 0; j < i; j++){
System.out.println(i * j);
} //end of scope of variable j
}// end of scope of variable i
```
You are most... |
31,119,225 | I kind of don't get the nested loops, can someone explain to me why the following code is executed 45 times please? Shouldn't the i++ and j++ increment by 1? So first loop should be (0 \* 0), (1 \* 1), (2 \* 2) and so on.
```
for(int i = 0; i < 10; i++)
for(int j = 0; j < i; j++)
System.out.println(i * j);... | 2015/06/29 | [
"https://Stackoverflow.com/questions/31119225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4090343/"
] | outer loop runs `i` times according to value of `i`
1st i value is `0` last `i` value is `9` because `i<10`.
so inner loop loops `9*10/2` which is `45`
loop time=`0+1+2+.....+8+9` = `9*10/2` = `45`
note . i used this equation to calculate sum of the loop times
```
1 + 2 + 3 + ... + N = N(N+1)/2
``` | As the other answers already explain the loops I won't do it. But if you make your code output a little more information, you can more easily see what happens.
```
public static void main( final String[] args )
{
int counter = 0;
for ( int i = 0; i < 10; i++ )
{
System.out.p... |
31,119,225 | I kind of don't get the nested loops, can someone explain to me why the following code is executed 45 times please? Shouldn't the i++ and j++ increment by 1? So first loop should be (0 \* 0), (1 \* 1), (2 \* 2) and so on.
```
for(int i = 0; i < 10; i++)
for(int j = 0; j < i; j++)
System.out.println(i * j);... | 2015/06/29 | [
"https://Stackoverflow.com/questions/31119225",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4090343/"
] | outer loop runs `i` times according to value of `i`
1st i value is `0` last `i` value is `9` because `i<10`.
so inner loop loops `9*10/2` which is `45`
loop time=`0+1+2+.....+8+9` = `9*10/2` = `45`
note . i used this equation to calculate sum of the loop times
```
1 + 2 + 3 + ... + N = N(N+1)/2
``` | ```
int iCount=1;
System.out.println("Outer for loop will begin and run for 10 times");
for (int i = 0; i < 10; i++) {
System.out.println(" Inner for loop will begin and run for " + i + " time(s)");
for (int j = 0; j < i; j++) {
System.out.println(" (" +... |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | You can apply a value of `!important` after the value you want to take precedence. | I had a similar problem, also after using `!important` the problem stayed.
The problem depends on which browser we are using, in my case it was Chrome.
Normally chrome stores frequently used sites and does not always fully page reload.
The issue was solved only after clearing the chrome history or `Ctrl`+`Shift`+`R`... |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | Specificity
===========
Your issue is most likely regarding specificity. Chris Coyier has a great article on [CSS specificity](http://css-tricks.com/specifics-on-css-specificity/). I would also suggest you check out this handy [specificity calculator](http://specificity.keegan.st/).
Using that calculator, we can see ... | I had a similar problem, also after using `!important` the problem stayed.
The problem depends on which browser we are using, in my case it was Chrome.
Normally chrome stores frequently used sites and does not always fully page reload.
The issue was solved only after clearing the chrome history or `Ctrl`+`Shift`+`R`... |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | You can add `!important` after each style in the `.red` class. Adding !important basically will give the CSS more weight which allows you to override other styles.
Your css would look like:
```
.red {
background-color: red !important;
color: white !important;
}
``` | I had a similar problem, also after using `!important` the problem stayed.
The problem depends on which browser we are using, in my case it was Chrome.
Normally chrome stores frequently used sites and does not always fully page reload.
The issue was solved only after clearing the chrome history or `Ctrl`+`Shift`+`R`... |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | Firstly, read Sean Ryan's answer - it is very good and informative, but I had to tweak his answer enough before implementing in my code that I wanted have a distinct answer that might help the next person.
I had almost the same question as the OP but also needed to be able to highlight the row, too. Below is how I en... | Would it not be a solution that instead of applying a class, append css to the element? |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | Firstly, read Sean Ryan's answer - it is very good and informative, but I had to tweak his answer enough before implementing in my code that I wanted have a distinct answer that might help the next person.
I had almost the same question as the OP but also needed to be able to highlight the row, too. Below is how I en... | Use
```
.table-striped > tbody > tr:nth-child(odd) > td.red {
background-color:red;
color:white;
}
```
to create more specific selector, or the !important keyword (as shown by Andrew)
Alternitvaly, and probably best, you can create a custom bootstrap configuration, which not includes table styling (Uncheck... |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | Specificity
===========
Your issue is most likely regarding specificity. Chris Coyier has a great article on [CSS specificity](http://css-tricks.com/specifics-on-css-specificity/). I would also suggest you check out this handy [specificity calculator](http://specificity.keegan.st/).
Using that calculator, we can see ... | Use
```
.table-striped > tbody > tr:nth-child(odd) > td.red {
background-color:red;
color:white;
}
```
to create more specific selector, or the !important keyword (as shown by Andrew)
Alternitvaly, and probably best, you can create a custom bootstrap configuration, which not includes table styling (Uncheck... |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | You need to apply `!important` after class style. because we use the selector is `.table-striped > tbody > tr:nth-child(odd) > td`, which is more specific than the class rule and will take precedence. So you need to override this with `!important`.
But there are two ways to fix this:
1. Use `!important` to make a rul... | You can apply a value of `!important` after the value you want to take precedence. |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | Firstly, read Sean Ryan's answer - it is very good and informative, but I had to tweak his answer enough before implementing in my code that I wanted have a distinct answer that might help the next person.
I had almost the same question as the OP but also needed to be able to highlight the row, too. Below is how I en... | You can apply a value of `!important` after the value you want to take precedence. |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | Specificity
===========
Your issue is most likely regarding specificity. Chris Coyier has a great article on [CSS specificity](http://css-tricks.com/specifics-on-css-specificity/). I would also suggest you check out this handy [specificity calculator](http://specificity.keegan.st/).
Using that calculator, we can see ... | You can add `!important` after each style in the `.red` class. Adding !important basically will give the CSS more weight which allows you to override other styles.
Your css would look like:
```
.red {
background-color: red !important;
color: white !important;
}
``` |
19,768,795 | I have a problem where I need to be able to dynamically insert new search fields in a list - sorted by a particular order as defined in the HTML5 data attribute.
If I have this simple HTML code:
```
<table>
<tr>
<td>Personel</td>
<td>Region</td>
<td>Misc</td>
</tr>
<tr>
<td>
<input type='check... | 2013/11/04 | [
"https://Stackoverflow.com/questions/19768795",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2028935/"
] | Firstly, read Sean Ryan's answer - it is very good and informative, but I had to tweak his answer enough before implementing in my code that I wanted have a distinct answer that might help the next person.
I had almost the same question as the OP but also needed to be able to highlight the row, too. Below is how I en... | You need to apply `!important` after class style. because we use the selector is `.table-striped > tbody > tr:nth-child(odd) > td`, which is more specific than the class rule and will take precedence. So you need to override this with `!important`.
But there are two ways to fix this:
1. Use `!important` to make a rul... |
67,300,163 | I have an email template
For example this
>
> Hello @FirstName@ @LastName@
>
>
>
I have an object that comes from a parameter with properties
I need to iterate all object properties and replace all words that matched the property name quoted with @@ with property value.
So, for example, I have an object with F... | 2021/04/28 | [
"https://Stackoverflow.com/questions/67300163",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10021083/"
] | Try to use this for dowloading image from URL, it helps me a lot that code, even you got the download on notification bar. You can set the filename when calling
```
public static void downloadImage(Context context, String filename, String downloadUrlOfImage){
try{
DownloadManager dm = (DownloadMan... | If you want to use a library than
```
dependencies {
implementation 'com.github.artjimlop:altex-image-downloader:'
}
```
And use this code to download
```
AltexImageDownloader.writeToDisk(context, PICTURE_URL, NAME_FOLDER); //NAME_FOLDER is the name of the folder where you want to save the image.
```
... |
25,299,721 | I am trying to actually test sending an email using mailtrap.io, and I set up the email server as directed, however, when I try to do the following:
```
form = InterestedForm(request.POST)
if form.is_valid():
name = form.cleaned_data['name']
email = form.cleaned_data['email']
subject = "Index form: Interes... | 2014/08/14 | [
"https://Stackoverflow.com/questions/25299721",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3162151/"
] | According to the [documentation](https://docs.djangoproject.com/en/dev/topics/email/#send-mail):
```
send_mail(subject, message, from_email, recipient_list, fail_silently=False, auth_user=None, auth_password=None, connection=None, html_message=None)¶
```
You are missing `from_email` argument.
Either set it, or pass... | Subject, message, from\_email and recipient are required. I do not see you have provided the from\_email. You can refer to <https://docs.djangoproject.com/en/dev/topics/email/#send-mail> for more info. |
139,579 | I've heard a lot of horror stories about PhD programs taking several years, and that US universities typically force you to go through many steps before you're able to be considered for graduation.
I'm interested in pursuing a PhD in the field of artificial intelligence, I already have a pretty thoroughly researched t... | 2019/11/05 | [
"https://academia.stackexchange.com/questions/139579",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/115982/"
] | Let me go out on a limb and assume that the question you really want answered is twofold. Can I do this? How?
In the US, the *essential core* of a doctorate is the ability to pass a set of qualifying exams and production of an acceptable dissertation. I got my degree from a place where those were actually the only re... | PhD programs in the US very often are combined master+PhD programs with a planned duration of 2+3 years. In maths and computer science it is also very common that people take exactly that time. The horror stories you heard are more common in lab sciences like physics or chemistry.
If you already have a masters degree... |
74,118,250 | Currently I am trying to solve this task: Two arrays of five integers each are given. Find the lowest number in the first array that is not in the second array.
It seems to me that if the user enters such integers in the first array:
```none
0 1 2 3 4
```
And the integers of the second array:
```none
0 2 3 4 5
`... | 2022/10/18 | [
"https://Stackoverflow.com/questions/74118250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20276903/"
] | Things get complicated with code tries to maintain multiple indexes into multiple arrays... Things are simplified if you re-use code and break out functions (that can test user input, too)...
```
#include <stdio.h>
void fill( int arr[], size_t sz ) { // Get user input (with checking)
printf("Enter integers\n");
... | There are some issues ...
1. We don't care about the min value for `arr2`--only for `arr1`
2. We must scan *all* `arr2` values for a match to the current/candidate value of `arr1`
3. There are some special cases we must handle
Normally, if we're just looking for the min value in `arr1` (e.g. `arr2` is *not* a factor)... |
74,118,250 | Currently I am trying to solve this task: Two arrays of five integers each are given. Find the lowest number in the first array that is not in the second array.
It seems to me that if the user enters such integers in the first array:
```none
0 1 2 3 4
```
And the integers of the second array:
```none
0 2 3 4 5
`... | 2022/10/18 | [
"https://Stackoverflow.com/questions/74118250",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/20276903/"
] | Algorithm
---------
The naive approach to this, and one that works very well for small datasets, is to nest a couple of loops. This approach grows in time complexity very fast. O(m\*n) where `m` is the length of the first array and `n` is the length of the second array.
Fortunately, we can approach this in a way that... | There are some issues ...
1. We don't care about the min value for `arr2`--only for `arr1`
2. We must scan *all* `arr2` values for a match to the current/candidate value of `arr1`
3. There are some special cases we must handle
Normally, if we're just looking for the min value in `arr1` (e.g. `arr2` is *not* a factor)... |
22,670,416 | I found the [InterlockedExchange](http://msdn.microsoft.com/en-us/library/windows/desktop/ms683590%28v=vs.85%29.aspx) function which allows me to exchange two **signed** 32-bit variables (LONG).
But, what is the correct way to atomically exchange two **unsigned** 32-bit variables (ULONG) under Windows?
I do not see a... | 2014/03/26 | [
"https://Stackoverflow.com/questions/22670416",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470474/"
] | Simply use a type-cast:
```
ULONG value1, value2;
InterlockedExchange((LPLONG)&value2, (LONG)value1);
``` | In your link, casting a unigned something to types of different sizes
(and/or floting point stuff) is explained.
Casting only between signed and unigned of the same type
should be possible without any problems. |
48,085,828 | I have a query that pulls in the banking activity each month and compares it to the prior months' activity using a pivot table. This works well as long as the items are named consistently at the bank. There are a few items where each transaction is assigned a name and a new number each month and therefore can't be comp... | 2018/01/03 | [
"https://Stackoverflow.com/questions/48085828",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8200199/"
] | Try to do following:
Define a function (logic can be more complex)
```
fGetNewDescription = (Description as text) =>
let
#"Fist Part" = Text.Start( Description , 23 ),
#"Second Part" = Text.Range( Description , 31, 11 ),
#"New Description" = #"Fist Part" & " " & #"Second Part"
in
```
Call this funct... | I'm more of a UI guy, so I would use the Query Editor ribbon and go to Add Column / Conditional Column. In that dialog I would specify the series of rules to output what you want, along the lines of:
```
If [Description] contains TRANSFER FROM ACCOUNT 1 then PRINCIPAL
Else If [Description] contains PRINCIPAL 4- then P... |
17,791,317 | I've been trying to display a xml file in my uiwebview. I've tried using NSURLRequest but the UIWebview shows up blank. I am able to display a local xml using the code below. Is there a way pull this from a defined website rather than from local file or maybe download the file then display it?
```
NSString *htmlFile ... | 2013/07/22 | [
"https://Stackoverflow.com/questions/17791317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1067231/"
] | Set your `UIWebView` delegate and define [`webView:didFailLoadWithError:`](http://developer.apple.com/library/ios/documentation/uikit/reference/UIWebViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIWebViewDelegate/webView%3adidFailLoadWithError%3a) and [`– webViewDidFinishLoad:`](http://developer.... | @sergio method works. Another way to achieve this is to download the file, store it locally then load.
```
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *filePath = [NSString stringWithFormat:@"%@/%@", [paths objectAtIndex:0],@"index.html"];
NSURL *url = [... |
17,791,317 | I've been trying to display a xml file in my uiwebview. I've tried using NSURLRequest but the UIWebview shows up blank. I am able to display a local xml using the code below. Is there a way pull this from a defined website rather than from local file or maybe download the file then display it?
```
NSString *htmlFile ... | 2013/07/22 | [
"https://Stackoverflow.com/questions/17791317",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1067231/"
] | Set your `UIWebView` delegate and define [`webView:didFailLoadWithError:`](http://developer.apple.com/library/ios/documentation/uikit/reference/UIWebViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIWebViewDelegate/webView%3adidFailLoadWithError%3a) and [`– webViewDidFinishLoad:`](http://developer.... | Please use below code for load local xml file from document directory in uiwebview
```
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"dem... |
68,081 | Have problem with my Coleman ct200u ex that is driving me batty.
It starts, runs for about 15 seconds, then dies, almost as if it ran out of gas suddenly or the kill switch was pressed. Will not start immediately. If I wait about 30 seconds, it will start right up, run for 15 seconds, and repeats stall. Tried playing ... | 2019/06/14 | [
"https://mechanics.stackexchange.com/questions/68081",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/49709/"
] | Same problem here. New Ignition coil worked for me. The ignition coil wire was burned on the head under the plastic engine cover | Change out the spark plug. Most likely a hairline crack in the porcelain and is grounding out as soon as it gets hot. |
7,959,277 | I have a *very* large compressed file I'm processing using `grep`.
```
zcat blah.gz | grep -e pattern | gzip -c > pattern.gz
```
I'd like to print something to `stderr` for every million or so input lines processed, just to keep track of progress. Any ideas? | 2011/10/31 | [
"https://Stackoverflow.com/questions/7959277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443593/"
] | Try [`pv`](http://www.ivarch.com/programs/pv.shtml). It defaults to bytes, but there's a switch to make it lines. | Replace the grep with:
```
perl -ne 'print if /pattern/; print STDERR "." if $. % 1000000 == 0'
``` |
7,959,277 | I have a *very* large compressed file I'm processing using `grep`.
```
zcat blah.gz | grep -e pattern | gzip -c > pattern.gz
```
I'd like to print something to `stderr` for every million or so input lines processed, just to keep track of progress. Any ideas? | 2011/10/31 | [
"https://Stackoverflow.com/questions/7959277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443593/"
] | Try [`pv`](http://www.ivarch.com/programs/pv.shtml). It defaults to bytes, but there's a switch to make it lines. | The `mbuffer(1)` tool might be something for you. Quoting some abstract:
>
> The mbuffer tool is used to buffer data streams and show the I/O rate and
> summary to the user. It is especially useful for writing backups to
> fast tape drives or streaming them over the network. If used correctly,
> it can prevent buf... |
7,959,277 | I have a *very* large compressed file I'm processing using `grep`.
```
zcat blah.gz | grep -e pattern | gzip -c > pattern.gz
```
I'd like to print something to `stderr` for every million or so input lines processed, just to keep track of progress. Any ideas? | 2011/10/31 | [
"https://Stackoverflow.com/questions/7959277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443593/"
] | Try [`pv`](http://www.ivarch.com/programs/pv.shtml). It defaults to bytes, but there's a switch to make it lines. | Run it through awk:
```
zcat blah.gz | awk 'BEGIN {x = 1}; {if ((x++ % 1000000) == 0) print x " " $0 > "/dev/stderr"; print $0 }' | grep -e pattern | gzip -c > pattern.gz
``` |
7,959,277 | I have a *very* large compressed file I'm processing using `grep`.
```
zcat blah.gz | grep -e pattern | gzip -c > pattern.gz
```
I'd like to print something to `stderr` for every million or so input lines processed, just to keep track of progress. Any ideas? | 2011/10/31 | [
"https://Stackoverflow.com/questions/7959277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443593/"
] | Replace the grep with:
```
perl -ne 'print if /pattern/; print STDERR "." if $. % 1000000 == 0'
``` | The `mbuffer(1)` tool might be something for you. Quoting some abstract:
>
> The mbuffer tool is used to buffer data streams and show the I/O rate and
> summary to the user. It is especially useful for writing backups to
> fast tape drives or streaming them over the network. If used correctly,
> it can prevent buf... |
7,959,277 | I have a *very* large compressed file I'm processing using `grep`.
```
zcat blah.gz | grep -e pattern | gzip -c > pattern.gz
```
I'd like to print something to `stderr` for every million or so input lines processed, just to keep track of progress. Any ideas? | 2011/10/31 | [
"https://Stackoverflow.com/questions/7959277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/443593/"
] | Run it through awk:
```
zcat blah.gz | awk 'BEGIN {x = 1}; {if ((x++ % 1000000) == 0) print x " " $0 > "/dev/stderr"; print $0 }' | grep -e pattern | gzip -c > pattern.gz
``` | The `mbuffer(1)` tool might be something for you. Quoting some abstract:
>
> The mbuffer tool is used to buffer data streams and show the I/O rate and
> summary to the user. It is especially useful for writing backups to
> fast tape drives or streaming them over the network. If used correctly,
> it can prevent buf... |
21,491,576 | I have been using a folder object as part of a script written in javascript and used for photoshop cs6 scripting.
My question regards the folder object
The cs6 javascript referance document says the following about folder objects
>
> "ExtendScript defines the JavaScript classes File and Folder to
> encapsulate fil... | 2014/01/31 | [
"https://Stackoverflow.com/questions/21491576",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1846118/"
] | Something like:
```
var myfolder= Folder("path/to/folder");
if(myfolder.exists) alert("got it");
```
Should work. Take a look at the extend script toolkit and the object model viewer under help | I too found this part of extendScript tricky and underdocumented.
Note that extendScript can express paths as URIs (escape all non-ascii!) and as system specific (Win/Mac - each of which have a different set of 'forbidden' characters).
The file object has two properties: `fullName` (a URI) and fsName (a file-system-s... |
171,437 | To track time on Android, I use Time Meter, which supports Tasker. But in the configuration screen of Time Meter plugin in Tasker, I don't know how to put the foreground app name to it. Do you know how to do this?
[](https://i.stack.imgur.com/x08V9m.... | 2017/03/20 | [
"https://android.stackexchange.com/questions/171437",
"https://android.stackexchange.com",
"https://android.stackexchange.com/users/94084/"
] | In the file browser, at e.g. `.../r11`, Select All and choose Move, and move them to the similar path on internal memory (which works out to be `/storage/emulated/0/Android/data/com.google.android.apps.translate/files/olpv3/v5/25/r11`) and also move the other revisions (e.g. `.../r12` on the SD card to `.../r12` on int... | Try to de-install the app and then re-install it, incl. the offline language packs that you need. Make sure that all the time, the SD card is in the phone and mounted, otherwise it doesn't work. In my case, after re-installation, Android had created folders for the app in the phone's internal storage as well as on the ... |
30,060,280 | I have an entity which has a field called end\_date which is datetime. In my symfony form I have a unbinded field which you can select an amount of days e.g 3 days, 5days, 7 days.
What i need to do is manipulate the amount of days provided by the form (which i don't want to go into the db) and do the calculations of w... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30060280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1813158/"
] | ```
if($form->isValid()) {
$em = $controller->getDoctrine()->getManager();
$days = $request->get("form")["days"]
//* calc end date here $endDate as \DateTime */
$listing->setEndDate($endDate);
$em->persist($listing);
$em->persist($product);
... | Although @Evgeniy's answer is technically correct I want to expand it a little bit.
When you create a form in Symfony and then call the `handleRequest` method, the form will be populated with all of the submitted fields. If you want to manipulate your form's data you have two possible options:
1. Do any necessary mod... |
30,060,280 | I have an entity which has a field called end\_date which is datetime. In my symfony form I have a unbinded field which you can select an amount of days e.g 3 days, 5days, 7 days.
What i need to do is manipulate the amount of days provided by the form (which i don't want to go into the db) and do the calculations of w... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30060280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1813158/"
] | ```
if($form->isValid()) {
$em = $controller->getDoctrine()->getManager();
$days = $request->get("form")["days"]
//* calc end date here $endDate as \DateTime */
$listing->setEndDate($endDate);
$em->persist($listing);
$em->persist($product);
... | I recommend to you to do that in callback on prePersist. This is an good practice. See there more about this <http://symfony.com/doc/current/book/doctrine.html#lifecycle-callbacks> |
30,060,280 | I have an entity which has a field called end\_date which is datetime. In my symfony form I have a unbinded field which you can select an amount of days e.g 3 days, 5days, 7 days.
What i need to do is manipulate the amount of days provided by the form (which i don't want to go into the db) and do the calculations of w... | 2015/05/05 | [
"https://Stackoverflow.com/questions/30060280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1813158/"
] | Although @Evgeniy's answer is technically correct I want to expand it a little bit.
When you create a form in Symfony and then call the `handleRequest` method, the form will be populated with all of the submitted fields. If you want to manipulate your form's data you have two possible options:
1. Do any necessary mod... | I recommend to you to do that in callback on prePersist. This is an good practice. See there more about this <http://symfony.com/doc/current/book/doctrine.html#lifecycle-callbacks> |
4,734,591 | I'm investigating solutions of storing and querying a historical record of event occurrences for a large number of items.
This is the simplified scenario: I'm getting a daily log of 200 000 streetlamps (labeled sl1 to sl200000) which shows if the lamp was operational on the day or not. It does not matter for how long ... | 2011/01/19 | [
"https://Stackoverflow.com/questions/4734591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/581326/"
] | Create a 2D-array in Numpy:
```
import numpy as np
nbLamps = 200000
nbDays = 365
arr = np.array([nbLamps, nbDays], dtype=np.bool)
```
It will be very memory-efficient and you can aggregate easily the days and lamps.
In order to manipulate the days even better, have a look at [scikits.timeseries](http://pytseries.... | I'd probably dictionary the lamps and have each of them contain a list of state changes where the first element is the time of the change and the second the value that's valid since that time.
This way when you get to the next sample you do nothing unless the state changed compared to the last item.
Searching is qui... |
1,698,293 | I have learned how I can run Windows Store apps from [command line](https://answers.microsoft.com/en-us/windows/forum/all/starting-windows-10-store-app-from-the-command/836354c5-b5af-4d6c-b414-80e40ed14675?auth=1) via:
```cmd
shell:AppsFolder!App
# For example:
shell:Microsoft.BingWeather_8wekyb3d8bbwe!App
```
Ho... | 2022/01/09 | [
"https://superuser.com/questions/1698293",
"https://superuser.com",
"https://superuser.com/users/1657640/"
] | You can do file-sharing over the internet, by creating network shares
and making them visible over the internet. No third-party product is
required, or Python, only setting correctly the router.
Opening file-sharing over the internet requires port-forwarding 4 ports
from the router to your computer
([link](https://doc... | Concept:
--------
To copy files, ssh / scp from one computer to the other; where the "other" has to be running "sshd". This is assuming nothing (e.g. firewalls, NAT, ...) in between the computers stops this from working.
General description:
--------------------
A [raspberry pi](https://www.raspberrypi.com/products/... |
171,665 | I heard this exchange from a TV show:
>
> **Woman A**: You are a smart, beautiful woman. You don't have to **settle**.
>
>
> **Woman B**: I'm not **settling**.
>
>
>
The context is that Woman A is trying to persuade B not to date a famous guy anymore, because that guy has already married and has not made any pr... | 2018/07/09 | [
"https://ell.stackexchange.com/questions/171665",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/59517/"
] | Your example doesn't mix the rules for future progressive and future perfect. Instead, it combines the rules for the future tense and the passive voice.
The future tense typically involves using some verb or verb phrase that carries a future-tense meaning along with an infinitive verb or verb phrase.
>
> I will... | The future perfect is a rare tense in that it refers to an action in the future that is expected or promised to happen before another action. The passive form of the future perfect is very rare. The future progressive is less rare, but the passive form is far from common.
All future tenses start with "will" or "shall.... |
46,024,045 | I am in need to build a secure application for Mac. For that I am using a master password that only exists in the head of the creator.
To retrieve it the password first needs to be entered in a secure textfield\* it can then be used to encrypt and decrypt files. While the application remains open that master password... | 2017/09/03 | [
"https://Stackoverflow.com/questions/46024045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/174655/"
] | In every case, you would first derrive a key from the user password, and use this key to encrypt the files. So instead of holding the password in memory, you can immediately calculate the key with a key-derivation-function, and hold the key in memory. The advantage you get is, that an attacker can only learn the key, w... | The existence of tools such as `mach_inject` and `Cycript` clearly indicate your program's memory is never safe. In iOS world the security of keychain comes from the fact the key is engraved in a separate hardware chip and it's never copied to application memory. If you're doing the encryption/decryption inside your pr... |
5,008,407 | Here is how my data in jTable looks:
```
SrNo Name LName
1 A B
2 B C
3 D E
4 F G
```
now when I click row 4, and click a button "Move to TOP", the table should look like this,
```
SrNo Name LName
1 F G
2 A B
3 B C
4 D E
```
I could think of t... | 2011/02/15 | [
"https://Stackoverflow.com/questions/5008407",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/386875/"
] | The DefaultTableModel already supports a moveRow(...) method.
Also, I have no idea what the SrNo is, but if the value is just the row number then it should not be part of the model. Instead is should be rendered as part of the row header view. Maybe something like the [Row Number Table](http://tips4java.wordpress.com/... | Use a table model, which is backed up by a list of POJOs such as this:
<http://puces-samples.svn.sourceforge.net/viewvc/puces-samples/trunk/sessionstate-suite/sessionstate-sample/src/blogspot/puce/sessionstate/sample/ParticipantTableModel.java?revision=2&view=markup>
Add a method like this:
```
public void moveToTop... |
27,414,913 | In pyschools, I am stuck in the power of 2 recursive function
```
>>> createStars(0) # 2 to power of 0 = 1
'*'
>>> createStars(1) # 2 to power of 1 = 2
'**'
>>> createStars(2) # 2 to power of 2 = 4
'****'
>>> createStars(3) # 2 to power of 3 = 8
'********'
```
Wha... | 2014/12/11 | [
"https://Stackoverflow.com/questions/27414913",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3926943/"
] | Here are two options, either look for where the element of `B` matches an element of `A`, which could fail if `A` has repeats, or by using the `C` matrix, look for the n'th one.
```
A = [12 52 12 62 42];
C = logical([1 1 0 1 0])
B = A(C)
[~,idx]=find(A==B(3)) %// finds where the third element of B was in A
idx=find(c... | [`find`](http://es.mathworks.com/help/matlab/ref/find.html) gives the answer. Let `indB` denote the index in `B`. Then the index in `A`, denoted `indA`, is
```
indA = find(C); %// find nonzeros in C
indA = indA(indB); %// take the indB-th nonzero in C
``` |
4,265,795 | Find the minimal natural number $n$ such that there exists a natural number $m$ with
$$ \frac{61n}{200} < m < \frac{63n}{200} $$
I have tried to use the continued fraction of 62/200, but I do not know how to argue the minimality of $n$.
Is there a general method to solve this type of question? | 2021/10/02 | [
"https://math.stackexchange.com/questions/4265795",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/87323/"
] | Hint: rewrite it as
$$\frac{200}{63}<\frac{n}{m}<\frac{200}{61}$$
and compare the continued fractions of $\frac{200}{63}$ and $\frac{200}{61}$. These start with $[3;5]$ and $[3;3]$ respectively, so the answer is either $[3;3],[3;4],$ or $[3;5]$.
Experts in continued fractions will know whether these first iterates are... | Even if we have no knowledge of using continued fractions to argue about over/underestimates and minimality, you can proceed using the idea of TonyK's hint.
Show that
* $\frac{200}{63} < \frac{n}{m} < \frac{200}{61}$
* $\Rightarrow n = 3m+a, 0 < a < m$.
* $\Rightarrow \frac{11}{63} < \frac{a}{m} < \frac{17}{61}$
* $\... |
195,732 | I implemented a Date based on the Gregorian calendar as an exercise. I'm looking mainly for how to make it more readable and easy to test, but any feedback is welcome.
```
public interface Date {
GregorianDate addDays(final long offset);
boolean isLeapYear();
int getYearDays();
DayOfWeek getDayOfWeek(... | 2018/06/03 | [
"https://codereview.stackexchange.com/questions/195732",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77015/"
] | As a fellow programmer, I encourage you to replace
```
@Override
public String toString() {
return String.format("(%d, %s, %d)", day, month.toNumber(), year);
}
```
by
```
@Override
public String toString() {
return year + "-" + month.toNumber() + "-" + day;
}
```
To be [ISO 8601](https://en.wikipedia.org... | regarding String formatting: If your concern is readability, then this is fine. However, you need to be aware it comes with performance cost. The cost comes from parsing the format pattern. and this will occur every time the method is called and it is not unlikely that `toString()` is called in a loop (as in printing t... |
195,732 | I implemented a Date based on the Gregorian calendar as an exercise. I'm looking mainly for how to make it more readable and easy to test, but any feedback is welcome.
```
public interface Date {
GregorianDate addDays(final long offset);
boolean isLeapYear();
int getYearDays();
DayOfWeek getDayOfWeek(... | 2018/06/03 | [
"https://codereview.stackexchange.com/questions/195732",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/77015/"
] | ### Consistent naming
>
>
> ```
> private static final long CENTURY_INTERVAL = 4;
> private static final long CENTURY = 100;
>
> ```
>
>
I don't like these names. They're not consistent with `LEAP_YEAR_INTERVAL`. Consider
```
private static final long CENTURY_INTERVAL = 100;
... | regarding String formatting: If your concern is readability, then this is fine. However, you need to be aware it comes with performance cost. The cost comes from parsing the format pattern. and this will occur every time the method is called and it is not unlikely that `toString()` is called in a loop (as in printing t... |
50,947,010 | I found the Homography matrix following the [Feature Matching + Homography tutorial](https://docs.opencv.org/3.4.1/d1/de0/tutorial_py_feature_homography.html) using
```
M, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC,5.0)
```
and now I need to warp the second image (rotated one) to match the keypoints of t... | 2018/06/20 | [
"https://Stackoverflow.com/questions/50947010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3211422/"
] | Although it might be so counter-intuitive, for some reason, opencv has implemented `warpPerspective` function in this way:
```
corrected_image = cv2.warpPerspective(img1, M, (img1.shape[1], img1.shape[0]))
```
Also noticed that M obtained is for the mapping the first image to the second, which means I can use M on t... | The problem with what you are doing is that you are passing 3 parameters instead of 2 to the "shape" argument. A perspective transform is performed on a gray-scale image which has shape as (H,W). A RGB image has shape (H,W,3) where the last dimension shows the number of channels--red, green and blue. Try with gray-scal... |
27,599 | I burned a CD on XP using the built-in burning software and I can read the CD on that machine, but when I insert it into my Vista machine, I can't read the files. It shows the correct volume label, and the correct 'free space', but I can't access the actual files.
Am I missing something obvious?
(Both systems are ful... | 2009/08/22 | [
"https://superuser.com/questions/27599",
"https://superuser.com",
"https://superuser.com/users/4123/"
] | If you didn't finalize the disk then it is only readable in the drive that created it. This will make it look like it's an XP to Vista problem if these are the only two computers that you've tried it on. | I don't suppose you accidentally wrote the files as hidden or system and the options are not set to view these on the Vista machine?
That is the only obvious quick thing I can think of :S |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.