qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
42,797 | I need to evaluate, for a certain worded question:
If n is even
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$
If n is odd
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$
I havent been able to reduce this using the binomial expansion. | 2011/06/02 | [
"https://math.stackexchange.com/questions/42797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8365/"
] | Binomial expansion allows one to find both $\binom n0+\binom n1+\binom n2+\dots=(1+1)^n$ and $(\binom n0-\binom n1+\binom n2+\dots)=(1-1)^n$. Combining these two yields desired result: $\binom n0+\binom n2+\binom n4+\dots=\frac12\bigl((1+1)^n+(1-1)^n\bigr)=2^{n-1}$. | Here's a more general take. Sums of the form $\sum\_k \binom{n}{2k} f(k)$ are sometimes called *aerated binomial sums*. My paper "[Combinatorial Sums and Finite Differences](http://math.pugetsound.edu/~mspivey/CombSum.pdf)" (*Discrete Mathematics*, 307 (24): 3130-3146, 2007) proves some general results about these aera... |
42,797 | I need to evaluate, for a certain worded question:
If n is even
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$
If n is odd
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$
I havent been able to reduce this using the binomial expansion. | 2011/06/02 | [
"https://math.stackexchange.com/questions/42797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8365/"
] | The given sums count the number of even-cardinality subsets of an $n$-element set. I'll provide a simple argument that shows that the value of that sum is $2^{n-1}$.
Fix $x \in X$ (where $|X|=n$). The map $f \colon \mathcal{P}(X) \to \mathcal{P}(X)$ (where $\mathcal{P}(X)$ denotes the power set of $X$) defined by $$ f... | Let $X$ be a binomial$(n,p)$ random variable with $p=1/2$. If $n$ is even, then the probability that $X$ is even is equal to
$$
\sum\limits\_{k = 0,2, \ldots ,n} {{n \choose k}\frac{1}{{2^n }}} .
$$
On the other hand, this probability is obviously equal to $1/2$ (consider $X$ as the sum of $n$ independent random vari... |
42,797 | I need to evaluate, for a certain worded question:
If n is even
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$
If n is odd
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$
I havent been able to reduce this using the binomial expansion. | 2011/06/02 | [
"https://math.stackexchange.com/questions/42797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8365/"
] | The given sums count the number of even-cardinality subsets of an $n$-element set. I'll provide a simple argument that shows that the value of that sum is $2^{n-1}$.
Fix $x \in X$ (where $|X|=n$). The map $f \colon \mathcal{P}(X) \to \mathcal{P}(X)$ (where $\mathcal{P}(X)$ denotes the power set of $X$) defined by $$ f... | Here's a more general take. Sums of the form $\sum\_k \binom{n}{2k} f(k)$ are sometimes called *aerated binomial sums*. My paper "[Combinatorial Sums and Finite Differences](http://math.pugetsound.edu/~mspivey/CombSum.pdf)" (*Discrete Mathematics*, 307 (24): 3130-3146, 2007) proves some general results about these aera... |
42,797 | I need to evaluate, for a certain worded question:
If n is even
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$
If n is odd
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$
I havent been able to reduce this using the binomial expansion. | 2011/06/02 | [
"https://math.stackexchange.com/questions/42797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8365/"
] | Binomial expansion allows one to find both $\binom n0+\binom n1+\binom n2+\dots=(1+1)^n$ and $(\binom n0-\binom n1+\binom n2+\dots)=(1-1)^n$. Combining these two yields desired result: $\binom n0+\binom n2+\binom n4+\dots=\frac12\bigl((1+1)^n+(1-1)^n\bigr)=2^{n-1}$. | I think it might help to look at this in terms of the rows on pascal's triangle. The sum of a given row is 2^n. All rows are symmetric about the middle of the row. As this sounds like it could be HW, i'll leave it to you to figure out how each of those relate to the sum of the row. |
42,797 | I need to evaluate, for a certain worded question:
If n is even
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$
If n is odd
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$
I havent been able to reduce this using the binomial expansion. | 2011/06/02 | [
"https://math.stackexchange.com/questions/42797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8365/"
] | Binomial expansion allows one to find both $\binom n0+\binom n1+\binom n2+\dots=(1+1)^n$ and $(\binom n0-\binom n1+\binom n2+\dots)=(1-1)^n$. Combining these two yields desired result: $\binom n0+\binom n2+\binom n4+\dots=\frac12\bigl((1+1)^n+(1-1)^n\bigr)=2^{n-1}$. | The sum of **all** binomial coefficients ${n \choose 0} + \cdots {n \choose n}$ is $2^n$. This is a well-known equation and the slick proof is to consider the binomial theorem for $(1+1)^n$.
Related is the binomial theorem applied to $(1-1)^n$ giving the sum
$${n \choose 0} - {n \choose 1} + {n \choose 2} - \cdots \p... |
42,797 | I need to evaluate, for a certain worded question:
If n is even
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$
If n is odd
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$
I havent been able to reduce this using the binomial expansion. | 2011/06/02 | [
"https://math.stackexchange.com/questions/42797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8365/"
] | The sum of **all** binomial coefficients ${n \choose 0} + \cdots {n \choose n}$ is $2^n$. This is a well-known equation and the slick proof is to consider the binomial theorem for $(1+1)^n$.
Related is the binomial theorem applied to $(1-1)^n$ giving the sum
$${n \choose 0} - {n \choose 1} + {n \choose 2} - \cdots \p... | I think it might help to look at this in terms of the rows on pascal's triangle. The sum of a given row is 2^n. All rows are symmetric about the middle of the row. As this sounds like it could be HW, i'll leave it to you to figure out how each of those relate to the sum of the row. |
42,797 | I need to evaluate, for a certain worded question:
If n is even
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$
If n is odd
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$
I havent been able to reduce this using the binomial expansion. | 2011/06/02 | [
"https://math.stackexchange.com/questions/42797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8365/"
] | Binomial expansion allows one to find both $\binom n0+\binom n1+\binom n2+\dots=(1+1)^n$ and $(\binom n0-\binom n1+\binom n2+\dots)=(1-1)^n$. Combining these two yields desired result: $\binom n0+\binom n2+\binom n4+\dots=\frac12\bigl((1+1)^n+(1-1)^n\bigr)=2^{n-1}$. | Let $X$ be a binomial$(n,p)$ random variable with $p=1/2$. If $n$ is even, then the probability that $X$ is even is equal to
$$
\sum\limits\_{k = 0,2, \ldots ,n} {{n \choose k}\frac{1}{{2^n }}} .
$$
On the other hand, this probability is obviously equal to $1/2$ (consider $X$ as the sum of $n$ independent random vari... |
42,797 | I need to evaluate, for a certain worded question:
If n is even
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$
If n is odd
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$
I havent been able to reduce this using the binomial expansion. | 2011/06/02 | [
"https://math.stackexchange.com/questions/42797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8365/"
] | The sum of **all** binomial coefficients ${n \choose 0} + \cdots {n \choose n}$ is $2^n$. This is a well-known equation and the slick proof is to consider the binomial theorem for $(1+1)^n$.
Related is the binomial theorem applied to $(1-1)^n$ giving the sum
$${n \choose 0} - {n \choose 1} + {n \choose 2} - \cdots \p... | Let $X$ be a binomial$(n,p)$ random variable with $p=1/2$. If $n$ is even, then the probability that $X$ is even is equal to
$$
\sum\limits\_{k = 0,2, \ldots ,n} {{n \choose k}\frac{1}{{2^n }}} .
$$
On the other hand, this probability is obviously equal to $1/2$ (consider $X$ as the sum of $n$ independent random vari... |
42,797 | I need to evaluate, for a certain worded question:
If n is even
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n}$$
If n is odd
$$\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+\cdots\binom{n}{n-1}$$
I havent been able to reduce this using the binomial expansion. | 2011/06/02 | [
"https://math.stackexchange.com/questions/42797",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/8365/"
] | Binomial expansion allows one to find both $\binom n0+\binom n1+\binom n2+\dots=(1+1)^n$ and $(\binom n0-\binom n1+\binom n2+\dots)=(1-1)^n$. Combining these two yields desired result: $\binom n0+\binom n2+\binom n4+\dots=\frac12\bigl((1+1)^n+(1-1)^n\bigr)=2^{n-1}$. | The given sums count the number of even-cardinality subsets of an $n$-element set. I'll provide a simple argument that shows that the value of that sum is $2^{n-1}$.
Fix $x \in X$ (where $|X|=n$). The map $f \colon \mathcal{P}(X) \to \mathcal{P}(X)$ (where $\mathcal{P}(X)$ denotes the power set of $X$) defined by $$ f... |
22,797,515 | I am learning socket and server/client model concept and having a hard time understanding the server client concept. If a client sends a request, can server sends more than one respond? Or we have to put everything in one respond?
For a memory game program, when a client click a card, the action will send a request... | 2014/04/01 | [
"https://Stackoverflow.com/questions/22797515",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2720065/"
] | If you're talking about TCP connections, after the connection has established client and server are equivalent, both are free to send data as long and as much they like and/or shut down their end of the connection.
Edit: After several passes I think i have understood what the second paragraph of your question is aimin... | This is not your complete answer.
For one request, you get one response back.
Please read on this information in [wikipedia](http://en.wikipedia.org/wiki/Request-response) for the basics
*"Request-response, also known as request-reply, is a message exchange pattern in which a requestor sends a request message to a r... |
71,646,549 | hey guys can you explain me why i keep losing my sections after refreshing the page)?
this is my section ,i need to keep it ,i do it correctly,,
i check,them in below you can see the forEach where i return it ,,,
but basically ,after refreshing i lose my section ,
here is code :
<https://jsfiddle.net/adulik/8sqbcox2/3... | 2022/03/28 | [
"https://Stackoverflow.com/questions/71646549",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18482823/"
] | You can storage the data in localstorage, then create a function that get the array from localstorage and put it in divs.
also you can call the function in window.load | This is possible with window.localStorage or window.sessionStorage. The difference is that sessionStorage lasts for as long as the browser stays open, localStorage survives past browser restarts. The persistence applies to the entire web site not just a single page of it.
When you need to set a variable that should be... |
9,393,101 | I can't figure out how to fix a compile error C2664, which has driven me crazy all night! The error arises from a call to qsort(). I want to sort an array of ID2IX stored in the array pointed by radioIDs:
```
typedef struct id2ix { // struct maps radio id to array index
int id; // radio id
int ix... | 2012/02/22 | [
"https://Stackoverflow.com/questions/9393101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/371181/"
] | Change `sort_by_radioID`'s signature to:
>
> int \_\_cdecl sort\_by\_radioID(const void\* one, const void\* two)
>
>
>
And make sure you cast to `const ID2IX*` inside the function.
(if \_\_cdecl is the default call type, you can skip it. Try without it and see if it compiles) | try the signature `sort_by_radioID ( const ID2IX * one , const ID2IX * two)` |
9,393,101 | I can't figure out how to fix a compile error C2664, which has driven me crazy all night! The error arises from a call to qsort(). I want to sort an array of ID2IX stored in the array pointed by radioIDs:
```
typedef struct id2ix { // struct maps radio id to array index
int id; // radio id
int ix... | 2012/02/22 | [
"https://Stackoverflow.com/questions/9393101",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/371181/"
] | Change `sort_by_radioID`'s signature to:
>
> int \_\_cdecl sort\_by\_radioID(const void\* one, const void\* two)
>
>
>
And make sure you cast to `const ID2IX*` inside the function.
(if \_\_cdecl is the default call type, you can skip it. Try without it and see if it compiles) | Your comparison function has wrong signature (qsort expects different type of function pointer).
Solution: change your function to:
int sort\_by\_radioID ( const void\* one , const void\*);
Remember also to change casting of pointers in the body of your comparison function
to 'const ID2DX\*'. |
20,062,563 | I am using Java to determine the length of a double as part of a larger program. At this time the double is 666 but the length is returning as 5, which is a big problem. I read another question posted here with a solution but that didn't work for me. I will show my code and my attempt at emulating the previous solution... | 2013/11/19 | [
"https://Stackoverflow.com/questions/20062563",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1814946/"
] | That's because you are using a double.
```
String.valueOf(Real); // returns 666.0, i.e. length 5
```
Try casting it to an integer first:
```
Integer simple = (int) Real;
String.valueOf(simple); // returns 666, i.e. length 3.
``` | A double always puts a decimal place after the number. So the number looks like 666.0. You could see this by printing `String.valueOf(Real)`. You should use an `int` instead or cast the double to an int:
```
double Real = 666;
int realInt = (int) Real;
System.out.println(String.valueOf(realInt).length());
``` |
40,913,214 | As it stands my colleague will be running the below query 30 times.
```
EXEC dbo.usp.Nameofstoredprocedure '01-nov-2016'
```
It exports 3 rows with columns `ID, Name, type`
Is there anyway to have it export as:
```
Date, ID, name, type
01-nov-2016,10,john smith,man
01-nov-2016,11,jane smith,woman
02-nov-... | 2016/12/01 | [
"https://Stackoverflow.com/questions/40913214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4837645/"
] | You could try this:
```
CREATE TABLE <Table Name>
(
Date DateTime,
ID INT,
Name NVARCHAR(40),
Type NVARCHAR(6)
)
INSERT INTO <Table Name>
Exec <SP NAME> 'Params'
```
You need to run the create table only once of course then put the rest into an agent job to run whenever you need it to. | The real problem is the stored procedure should be redone to meet the requirements. Database objects often need refactoring too.
I would add an enddate optional parameter (with a default value of null, so it won't break existing uses of the proc). Then if only the first date was sent in, it would set the end date to t... |
40,913,214 | As it stands my colleague will be running the below query 30 times.
```
EXEC dbo.usp.Nameofstoredprocedure '01-nov-2016'
```
It exports 3 rows with columns `ID, Name, type`
Is there anyway to have it export as:
```
Date, ID, name, type
01-nov-2016,10,john smith,man
01-nov-2016,11,jane smith,woman
02-nov-... | 2016/12/01 | [
"https://Stackoverflow.com/questions/40913214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4837645/"
] | You could try this:
```
CREATE TABLE <Table Name>
(
Date DateTime,
ID INT,
Name NVARCHAR(40),
Type NVARCHAR(6)
)
INSERT INTO <Table Name>
Exec <SP NAME> 'Params'
```
You need to run the create table only once of course then put the rest into an agent job to run whenever you need it to. | The answer that worked.
```
declare @date2 date
set @date2 = '2016-11-01'
declare @inte int=0
while @inte <= 29
begin
create table #temp
(
ID int,
Name varchar(100),
Type varchar(50)
)
insert into #temp
exec [dbo].[usp_proceduregoeshere] @date2
insert into #Results
select @date2, *
from #Agents
drop table #tem... |
3,805,152 | I have
$$ \left| \frac{f(x)}{\sqrt{g(x)}} \right| \leq 1 \quad\quad (1)$$
for $x>0$, and $f(x)$ for some values of $x$ is positive and for some is negative. Now, when I use the identity $\left|y\right|=\sqrt{y^2}$ in $(1)$, I obtain
$$ \frac{f(x)^2}{g (x)}\leq 1 \quad\quad (2).$$
But when I square both sides of $(1)$ ... | 2020/08/27 | [
"https://math.stackexchange.com/questions/3805152",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/818411/"
] | As noticed in the comments, note that since $f(x)^2\ge 0$ and since $g(x)>0$ we have that
$$\left|\frac{f(x)^2}{g (x)}\right|=\frac{f(x)^2}{g (x)}\le 1$$
indeed by definition
$$\left| x \right| =
\begin{cases}
x \hspace{1cm} x \geq 0 \\ -x \hspace{0.7cm} x < 0
\end{cases}$$ | You have done everything correct.
You should know that, Modulus of a variable always returns the positive value of the variable.
so, $|x|=x$
so,in the third or first equation you can easily remove the modulus.The values are same with modulus or without modulus.
So now,th three equations are same |
3,805,152 | I have
$$ \left| \frac{f(x)}{\sqrt{g(x)}} \right| \leq 1 \quad\quad (1)$$
for $x>0$, and $f(x)$ for some values of $x$ is positive and for some is negative. Now, when I use the identity $\left|y\right|=\sqrt{y^2}$ in $(1)$, I obtain
$$ \frac{f(x)^2}{g (x)}\leq 1 \quad\quad (2).$$
But when I square both sides of $(1)$ ... | 2020/08/27 | [
"https://math.stackexchange.com/questions/3805152",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/818411/"
] | In $(2)$, you are not using $|y|=\sqrt{y^2}$ but $|y|^2=y^2$. And in $(3)$, there is no reason to wrap the square inside an absolute value.
In both cases, you have the same problem,
$$\left(\sqrt{g(x)}\right)^2\ne g(x)$$ as functions. They don't have the same domain. | You have done everything correct.
You should know that, Modulus of a variable always returns the positive value of the variable.
so, $|x|=x$
so,in the third or first equation you can easily remove the modulus.The values are same with modulus or without modulus.
So now,th three equations are same |
4,708,650 | I am having some trouble with an ASP.NET website I've set up and it's very difficult to debug.
Background Information:
There is a page on my website that allows the user to upload one or many Microsoft Word documents. The user can then press a button, and the code is supposed to open the document(s), count the words,... | 2011/01/16 | [
"https://Stackoverflow.com/questions/4708650",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479317/"
] | To quote Microsoft [MSKB 257757](http://support.microsoft.com/kb/257757/en-us):
>
> Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Of... | Unless that remote service has Microsoft Word installed, you can't rely on that code. The code is using COM automation on the machine on which your server side code is running. |
4,708,650 | I am having some trouble with an ASP.NET website I've set up and it's very difficult to debug.
Background Information:
There is a page on my website that allows the user to upload one or many Microsoft Word documents. The user can then press a button, and the code is supposed to open the document(s), count the words,... | 2011/01/16 | [
"https://Stackoverflow.com/questions/4708650",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479317/"
] | As others have said, it's a bad idea to automate Word on the server. Have you considered alternative solutions?
If you can use the openxml format (.docx) exclusively, the [OpenXml SDK](http://msdn.microsoft.com/en-us/library/bb448854.aspx) is a better alternative. If you must generate the documents in the older .doc ... | Unless that remote service has Microsoft Word installed, you can't rely on that code. The code is using COM automation on the machine on which your server side code is running. |
4,708,650 | I am having some trouble with an ASP.NET website I've set up and it's very difficult to debug.
Background Information:
There is a page on my website that allows the user to upload one or many Microsoft Word documents. The user can then press a button, and the code is supposed to open the document(s), count the words,... | 2011/01/16 | [
"https://Stackoverflow.com/questions/4708650",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/479317/"
] | To quote Microsoft [MSKB 257757](http://support.microsoft.com/kb/257757/en-us):
>
> Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Of... | As others have said, it's a bad idea to automate Word on the server. Have you considered alternative solutions?
If you can use the openxml format (.docx) exclusively, the [OpenXml SDK](http://msdn.microsoft.com/en-us/library/bb448854.aspx) is a better alternative. If you must generate the documents in the older .doc ... |
16,777 | I basically want to create a mod for Minecraft that does the following:
```
if(a sand block is next to lava block) {
change the sand block to a glass block
}
```
Is it possible to create a mod like this without editing multiple Java classes? | 2011/09/02 | [
"https://gamedev.stackexchange.com/questions/16777",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/9689/"
] | Something that a lot of people don't understand is that it is *possible* to make ANY mod. And also, you *need* to modify java classes at one point. There is no way around either of these simple facts.
So, yes. Yes you can. :) | That depends. To do specifically what you are describing, you will probably need to create a mod for a new block type. [Here's a tutorial](http://www.minecraftforum.net/topic/96862-creating-mods-modding-tutorials-21511/page__p__1502412#entry1502412) on doing so -- it's not terribly complex and you primarily just need t... |
53,977,774 | This code is a kind of "anagram finder" it use simple .txt files as "database"(for example all\_a4.txt contains all the words starting by "a" AND that are 4 characters long). It takes an input from the user and compare it to a list of words created with those txt files. it than compares the alphabetically sorted versio... | 2018/12/30 | [
"https://Stackoverflow.com/questions/53977774",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10848915/"
] | You're calculating the value of `plein` before you add anything to `anAgList` and the value is not updated after words are added to `anAgList`.
Try calculating the value after the foreach loop.
Also the usage of operator `is` is incorrect, since it is used for type checking (<https://learn.microsoft.com/en-us/dotnet/cs... | So I tried something different to try resolve this...I got rid of the boolean to simplify the problem. Instead of the boolean I use the variable int i to count whenever a word match and if the counter is still = to 0 when the whole list of word is fully iterated, i tell the user there is no anagram. But it's exactly th... |
51,807,243 | I've read some blogs and docs that when access an instance attribute `obj.a`:
1. try accessing data descriptor (named `a`) in current class `__dict__` **and base class \_\_dict\_\_**
2. find `a` in `obj.__dict__`
3. find non-data descriptor (named `a`) in current class `__dict__` and base class `__dict__`
4. find attr... | 2018/08/12 | [
"https://Stackoverflow.com/questions/51807243",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1822803/"
] | You misunderstood how descriptors are found in classes. Python will use the **first** such name in the class hierarchy. Once found, the search stops. `B.dd_1` exists, so `A.dd_1` is not considered.
The documentation tells you about base classes for the case where `B` does not define `dd_1`; in that case `B` is searche... | There aren't three separate searches through the class and the base class. (Also, it's not just the class and its base; it's the entire MRO.) There's one search through the MRO, and it stops as soon as it finds something, regardless of what parts of the descriptor protocol the found object may or may not support.
When... |
162,553 | I have the following voltage divider circuit with a potentiomenter, and I need to find the value of the resistors.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fV5jzZ.png) – Schematic created using [CircuitLab](https://www.circuitl... | 2015/03/31 | [
"https://electronics.stackexchange.com/questions/162553",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/52544/"
] | Hints: -
1. What current flows thru the pot when there is 20 volts across it?
2. What current flows thru those resistors
3. What is ohms law? | If you assume there is no loading from the wiper of the Pot, then you can do the following:
(1) Find the current through the resistors - as they are in series it will be the same current through each. You know that R2 is dropping V=(10-(-)10)=20V, and you know that R2=10k. Ohms law tells you the current.
(2) You know... |
162,553 | I have the following voltage divider circuit with a potentiomenter, and I need to find the value of the resistors.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fV5jzZ.png) – Schematic created using [CircuitLab](https://www.circuitl... | 2015/03/31 | [
"https://electronics.stackexchange.com/questions/162553",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/52544/"
] | Hints: -
1. What current flows thru the pot when there is 20 volts across it?
2. What current flows thru those resistors
3. What is ohms law? | In a series circuit like this, the voltage across each resistor is proportional to its resistance, so you can solve it simply by looking at the voltages across each resistor, and the given value of one resistor - no need to work out currents, or otherwise involve Ohm's Law.
You have 20 volts across the 10K pot, so the... |
162,553 | I have the following voltage divider circuit with a potentiomenter, and I need to find the value of the resistors.

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fV5jzZ.png) – Schematic created using [CircuitLab](https://www.circuitl... | 2015/03/31 | [
"https://electronics.stackexchange.com/questions/162553",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/52544/"
] | If you assume there is no loading from the wiper of the Pot, then you can do the following:
(1) Find the current through the resistors - as they are in series it will be the same current through each. You know that R2 is dropping V=(10-(-)10)=20V, and you know that R2=10k. Ohms law tells you the current.
(2) You know... | In a series circuit like this, the voltage across each resistor is proportional to its resistance, so you can solve it simply by looking at the voltages across each resistor, and the given value of one resistor - no need to work out currents, or otherwise involve Ohm's Law.
You have 20 volts across the 10K pot, so the... |
32,284,126 | I have two state in [Angular UI router](https://github.com/angular-ui/ui-router):
```
State
|-Menus (with 2 nested state)
| |- menus.list
| |- menus.instruction
|-Order
```
When I access menus.list from menus I get the scope with id 4 however when I access menus from Order I get scope with scope id 28.
The rea... | 2015/08/29 | [
"https://Stackoverflow.com/questions/32284126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2446466/"
] | I think you want to place the code with `$rootScope` in the run phase under the `config` part of your angular app, which will trigger the call back function for setting your stateOrders. for example:
```
angular.module('yourApp', ['ui.router'])
.config(function($stateProvider, $urlProvider) {
//details omitted
}).ru... | When you switch between sibling states, then new controller is created and new **$scope** variable for `Menu` is created. So the easiest way to fix that is to move your `$stateChangeSuccess` logic to State's controller, so it's **$scope** going to be updated and value will be available in child controllers. |
34,213,012 | I recently use ObjectOutputStream to write objects in TCP/IP socket programming.
If I want to write a large size of `List<Object>/ArrayList<Object>` through the socket
(e.g. list.size: 100, the total bytes may larger than the payload size),
should I just call `writeObject(List<Object>/ArrayList<Object>)`?
Is that O... | 2015/12/10 | [
"https://Stackoverflow.com/questions/34213012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I think your math in weight() is incorrect. It looks like weight is actually returning the following:
```
(w * 433/roundedSG)*roundedSG/433.
```
The 433s and roundedSGs cancel, and you're just returning w, which I'm guessing is 180? | Correct Weight Formula is:
>
> weight = (mass\*gravity);
>
>
>
Change from:
```
double weight = (mass * roundedSG)/433.59237;
```
To:
```
double weight = mass * roundedSG;
``` |
34,213,012 | I recently use ObjectOutputStream to write objects in TCP/IP socket programming.
If I want to write a large size of `List<Object>/ArrayList<Object>` through the socket
(e.g. list.size: 100, the total bytes may larger than the payload size),
should I just call `writeObject(List<Object>/ArrayList<Object>)`?
Is that O... | 2015/12/10 | [
"https://Stackoverflow.com/questions/34213012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I renamed your variables and added a constant which makes the code as written a bit clearer:
```
private static final double GRAMS_PER_POUND = 433.59237;
public static double weight(double sGravity, double weightLbs)
{
double roundedSG = sGravity / 10;
double mass = (weightLbs * GRAMS_PER_POUND)/roundedSG;
... | Correct Weight Formula is:
>
> weight = (mass\*gravity);
>
>
>
Change from:
```
double weight = (mass * roundedSG)/433.59237;
```
To:
```
double weight = mass * roundedSG;
``` |
34,213,012 | I recently use ObjectOutputStream to write objects in TCP/IP socket programming.
If I want to write a large size of `List<Object>/ArrayList<Object>` through the socket
(e.g. list.size: 100, the total bytes may larger than the payload size),
should I just call `writeObject(List<Object>/ArrayList<Object>)`?
Is that O... | 2015/12/10 | [
"https://Stackoverflow.com/questions/34213012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I think your math in weight() is incorrect. It looks like weight is actually returning the following:
```
(w * 433/roundedSG)*roundedSG/433.
```
The 433s and roundedSGs cancel, and you're just returning w, which I'm guessing is 180? | You weight method calculation are incorrect. the result of it returns only w which you pass as weightLbs (= 180). |
34,213,012 | I recently use ObjectOutputStream to write objects in TCP/IP socket programming.
If I want to write a large size of `List<Object>/ArrayList<Object>` through the socket
(e.g. list.size: 100, the total bytes may larger than the payload size),
should I just call `writeObject(List<Object>/ArrayList<Object>)`?
Is that O... | 2015/12/10 | [
"https://Stackoverflow.com/questions/34213012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I think your math in weight() is incorrect. It looks like weight is actually returning the following:
```
(w * 433/roundedSG)*roundedSG/433.
```
The 433s and roundedSGs cancel, and you're just returning w, which I'm guessing is 180? | I renamed your variables and added a constant which makes the code as written a bit clearer:
```
private static final double GRAMS_PER_POUND = 433.59237;
public static double weight(double sGravity, double weightLbs)
{
double roundedSG = sGravity / 10;
double mass = (weightLbs * GRAMS_PER_POUND)/roundedSG;
... |
34,213,012 | I recently use ObjectOutputStream to write objects in TCP/IP socket programming.
If I want to write a large size of `List<Object>/ArrayList<Object>` through the socket
(e.g. list.size: 100, the total bytes may larger than the payload size),
should I just call `writeObject(List<Object>/ArrayList<Object>)`?
Is that O... | 2015/12/10 | [
"https://Stackoverflow.com/questions/34213012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I renamed your variables and added a constant which makes the code as written a bit clearer:
```
private static final double GRAMS_PER_POUND = 433.59237;
public static double weight(double sGravity, double weightLbs)
{
double roundedSG = sGravity / 10;
double mass = (weightLbs * GRAMS_PER_POUND)/roundedSG;
... | You weight method calculation are incorrect. the result of it returns only w which you pass as weightLbs (= 180). |
152,130 | This is a follow-up to [this](https://math.stackexchange.com/questions/151212/bounded-linear-operator-on-a-hilbert-space) question. Part 3 of that question was stated incorrectly. The correct version is
>
> Show that a continuous invertible linear operator on a normed space has a continuous inverse if the unit spher... | 2012/05/31 | [
"https://math.stackexchange.com/questions/152130",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/30932/"
] | Hint: You seem to be almost there. Consider the sequence $\bigl(\,T^{-1}(a\_{n })/\Vert T^{-1}(a\_{n })\Vert\,\bigr)$, though. This is a sequence in $S$. What can you say about its image under $T$? Note that this sequence has a convergent subsequence...
Solution follows:
Let $x\_n=T^{-1}(a\_{n })/\Vert T^{-1}(a\_{n }... | There's no need to use sequences.
Since $T$ is continuous and $\| \cdot \|$ is continuous, $x \to \|T x\|$ is a continuous real-valued function. Since the unit sphere $S$ is compact, $\|T x\|$ attains a minimum on $S$. The minimum value can't be $0$ because $T$ is one-to-one. So there is $\epsilon > 0$ such that $\|Tx... |
61,355,684 | Is it possible to have a Sweetalert *(2)* not close in the `then` method after a `preConfirm` fetch? If the request returns something specific, I'd like to simply keep the Swal open, but do a `Swal.showValidationMessage()` rather than opening an entire new alert. When doing the validation message in the `then` method, ... | 2020/04/22 | [
"https://Stackoverflow.com/questions/61355684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4880538/"
] | You can do it in both ways, According to the best [practices docs](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-best-practices#repository-namespaces) you can have single container registry and manage them through [`namespaces`](https://learn.microsoft.com/en-us/azure/container-registry/... | Having multiple container registries can help keeping failure domains separated. If you have a problem with the registry you use for developing and testing, you don't want that error in production.
That's why I would suggest using at least two container registries, where one is dedicated to production use. Configuring... |
61,355,684 | Is it possible to have a Sweetalert *(2)* not close in the `then` method after a `preConfirm` fetch? If the request returns something specific, I'd like to simply keep the Swal open, but do a `Swal.showValidationMessage()` rather than opening an entire new alert. When doing the validation message in the `then` method, ... | 2020/04/22 | [
"https://Stackoverflow.com/questions/61355684",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4880538/"
] | This question is a bit old but still relevant.
There are two approach for this problem :
1. use 1 registry for each environment e.g. dev,staging,prod
2. use 1 registry for all environment.
I recommend solution 2. You should see your container registry like you see your source code repository. You don't have 1 reposi... | Having multiple container registries can help keeping failure domains separated. If you have a problem with the registry you use for developing and testing, you don't want that error in production.
That's why I would suggest using at least two container registries, where one is dedicated to production use. Configuring... |
987,802 | From VeraCrypt's documentation ([here](https://veracrypt.codeplex.com/wikipage?title=How%20to%20Back%20Up%20Securely "here"), section "System Partitions"), it sounds like one should be able to:
1) Boot a PE (or secondary OS),
2-3) Create & mount a new, empty encrypted volume (destination for cloning),
4) Mount an en... | 2015/10/16 | [
"https://superuser.com/questions/987802",
"https://superuser.com",
"https://superuser.com/users/507353/"
] | You may be over-thinking this. You have the source volume, mounted. You have the destination volume, mounted. Both volumes are encrypted VeraCrypt volumes. (And you do not want to duplicate the entire partition.)
So do a straight file system copy from the source to the destination.
This may not be what you intend to ... | I am also having this exact issue. My issue began when, for some reason, my hard drive encrypted with VeraCrypt would boot-loop after typing in the password at the bootloader. I can successfully mount the disk when attached externally in windows, so I figured I can clone the mounted disk over to another disk and have a... |
987,802 | From VeraCrypt's documentation ([here](https://veracrypt.codeplex.com/wikipage?title=How%20to%20Back%20Up%20Securely "here"), section "System Partitions"), it sounds like one should be able to:
1) Boot a PE (or secondary OS),
2-3) Create & mount a new, empty encrypted volume (destination for cloning),
4) Mount an en... | 2015/10/16 | [
"https://superuser.com/questions/987802",
"https://superuser.com",
"https://superuser.com/users/507353/"
] | You may be over-thinking this. You have the source volume, mounted. You have the destination volume, mounted. Both volumes are encrypted VeraCrypt volumes. (And you do not want to duplicate the entire partition.)
So do a straight file system copy from the source to the destination.
This may not be what you intend to ... | Let's take my case. full disk encryption, with Windows installed.
1. Boot Windows, then use a backup tool able to do snapshot on your own installation (live dump - shadow copy on Windows). As it is copying decrypted datas, the backup will be unencrypted on your destination location, but you can use backup tool own's e... |
41,157,791 | How can I find sum mean of 2d array with positive number and negative number in c
```
int data[4][5] = {
{3,-6,1,-5,7},
{-2,9,-3,5,4},
{7,3,-4,0,-6},
{9,-2,-5,8,3}
};
>Sum of all positive number
>Mean of all positve number
>Sum of all negative number
>Mean of all negative number
```
I'm freshman f... | 2016/12/15 | [
"https://Stackoverflow.com/questions/41157791",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7300426/"
] | Here is some code that works on a 1D array. You can understand this, and apply it to your 2D problem.
We need variables to keep track of two sums (positive and negative numbers), these can be `int`s. We need two variables to count how many positive and negative numbers are in the array, and these can also be `int`s. T... | ```
#include <stdio.h>
#include <stdlib.h>
#define ROWS 4
#define COLS 5
int
main(void) {
int data[ROWS][COLS] = {{3,-6,1,-5,7},
{-2,9,-3,5,4},
{7,3,-4,0,-6},
{9,-2,-5,8,3}};
int numpos = 0, numneg = 0;
int possum = 0, neg... |
42,593,771 | I have been trying to iterate the tensorflow model using the answer provided on
[Tensorflow : Memory leak even while closing Session?](https://stackoverflow.com/questions/35695183/tensorflow-memory-leak-even-while-closing-session)
I have the same error as mentioned in one of the comments i.e. "The Session graph is emp... | 2017/03/04 | [
"https://Stackoverflow.com/questions/42593771",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7337638/"
] | My suggestion is to make sure your session knows which graph it is running on.
Somethings you can try are:
1. build the graph first and pass in the graph to a session.
```
myGraph = tf.Graph()
with myGraph.as_default():
# build your graph here
mySession = tf.Session(graph=myGraph)
mySession.run(...)
# Or
with ... | If you search the TensorFlow source code you will find this exclusive message is telling you *the graph version* is 0, which means it is empty.
[](https://i.stack.imgur.com/l4iWR.jpg)
You need to [load](https://www.tensorflow.org/guide/saved_model) th... |
3,566,017 | In Linear Algebra, I am working with inverting matrices and doing proofs. The exact question is:
Show that if $ABC$ is invertible, then $A, B, C$ are all invertible.
Each matrix is a $n\times n$ matrix, but I do not understand how to show that each individual matrix is invertible. | 2020/03/02 | [
"https://math.stackexchange.com/questions/3566017",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/755855/"
] | **Hints:**
$M$ is invertible iff $\det(M)\ne0$.
$\det(ABC)=\det(A)\det(B)\det(C).$ | It is enough, by induction, to show that if $AB$ is an invertible matrix, then both $A$ and $B$ are invertible. By definition, we have a matrix $C$ such that $(AB)C=I$ (where $I$ is the identity matrix.) Now, obviously, by the associative property, we see that $A(BC)=I,$ so $BC$ is an inverse of $A.$ In other words, $A... |
3,566,017 | In Linear Algebra, I am working with inverting matrices and doing proofs. The exact question is:
Show that if $ABC$ is invertible, then $A, B, C$ are all invertible.
Each matrix is a $n\times n$ matrix, but I do not understand how to show that each individual matrix is invertible. | 2020/03/02 | [
"https://math.stackexchange.com/questions/3566017",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/755855/"
] | **Hints:**
$M$ is invertible iff $\det(M)\ne0$.
$\det(ABC)=\det(A)\det(B)\det(C).$ | If exists $X$ such that $(ABC)X=\mathbb1$ then $X$ has inverse too, and $BCX$ is the inverse of $A$. Then $BC=A^{-1}X^{-1}$. But also $(XAB)C=\mathbb1$, hence $C$ is invertible. So $B=(CXA)^{-1}$ then $B(CXA)=\mathbb1$, that is $B$ is also invertible. |
3,566,017 | In Linear Algebra, I am working with inverting matrices and doing proofs. The exact question is:
Show that if $ABC$ is invertible, then $A, B, C$ are all invertible.
Each matrix is a $n\times n$ matrix, but I do not understand how to show that each individual matrix is invertible. | 2020/03/02 | [
"https://math.stackexchange.com/questions/3566017",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/755855/"
] | You only really need to show that, if $AB$ is invertible, then $A$ and $B$ are invertible. If you then have $ABC = (AB)C$ is invertible, then $AB$ and $C$ are invertible (by the simple result), and hence $A, B, C$ are all invertible (by the simple result again).
Another thing to think about is that this is a property ... | It is enough, by induction, to show that if $AB$ is an invertible matrix, then both $A$ and $B$ are invertible. By definition, we have a matrix $C$ such that $(AB)C=I$ (where $I$ is the identity matrix.) Now, obviously, by the associative property, we see that $A(BC)=I,$ so $BC$ is an inverse of $A.$ In other words, $A... |
3,566,017 | In Linear Algebra, I am working with inverting matrices and doing proofs. The exact question is:
Show that if $ABC$ is invertible, then $A, B, C$ are all invertible.
Each matrix is a $n\times n$ matrix, but I do not understand how to show that each individual matrix is invertible. | 2020/03/02 | [
"https://math.stackexchange.com/questions/3566017",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/755855/"
] | You only really need to show that, if $AB$ is invertible, then $A$ and $B$ are invertible. If you then have $ABC = (AB)C$ is invertible, then $AB$ and $C$ are invertible (by the simple result), and hence $A, B, C$ are all invertible (by the simple result again).
Another thing to think about is that this is a property ... | If exists $X$ such that $(ABC)X=\mathbb1$ then $X$ has inverse too, and $BCX$ is the inverse of $A$. Then $BC=A^{-1}X^{-1}$. But also $(XAB)C=\mathbb1$, hence $C$ is invertible. So $B=(CXA)^{-1}$ then $B(CXA)=\mathbb1$, that is $B$ is also invertible. |
182,839 | Yesterday, I was talking to a guy who has a Ph.D. in organic chemistry, got sacked from academia because of Covid related fund cuts, and he is not being able to find jobs in the industry because, what I realized, his proficiency is poor or nonexistent with computers.
Now, consider another candidate whose research fiel... | 2022/02/28 | [
"https://academia.stackexchange.com/questions/182839",
"https://academia.stackexchange.com",
"https://academia.stackexchange.com/users/100406/"
] | I speak as someone a PhD in theoretical chemistry, who has landed a trainee position in industry with a promise of making it permanent after two years.
Doing a PhD in a narrow research field feels a lot like digging yourself a hole, where the hole gets deeper for every year. And a deep hole is hard to get out from... ... | Being a student of Masters in Bioinformatics in my final research phase with my stream being 'Translational Bioinformatics' dealing with Microarray and NGS, RNA-Seq related things, now working on Machine Learning related project and as a Associate Researcher in an Healthcare Industry, I can say that the the second pers... |
15,499,268 | I have a database on SQL Azure which has an identity primary.
After using SQL Server Import and Export Wizard, I transferred the data to my SQL Server 2008 R2 database.
My ASP.NET Application runs fine and reads the data. But When I try to insert a value in a table 'User', it gives me an error:
Cannot insert null in c... | 2013/03/19 | [
"https://Stackoverflow.com/questions/15499268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/406788/"
] | It's not quite enough to override the getTracks method, you have to fool super's layout into doing the right-thingy if tracking:
```
JTable myTable = new JTable(10, 4) {
private boolean inLayout;
@Override
public boolean getScrollableTracksViewportWidth() {
return hasExcessWidth();
}
@Ov... | With the implementation of @kleopatra, I noticed that you get a scrollbar, when you reduce the size of a column and then increase it again just slightly (which happens quite often by accident). So I've slightly changed the code slightly:
```
protected boolean hasExcessWidth() {
return getPreferredSize().width - ge... |
54,643,419 | I am using CodeIgniter. I am getting the data from the controller.
**Model code**
```
$select_filter_status=$parameters['select_filter_status'];
$select_filter_action= $parameters['select_filter_action'];
if(($select_filter_status=='') && ($select_filter_action=='')){
$where_2=" "; // I don't have any condi... | 2019/02/12 | [
"https://Stackoverflow.com/questions/54643419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9437856/"
] | you have to pass the where\_2 query in your main query.. concatinate the variable $where\_2 in your $com\_report query
```
if(($select_filter_status=='') && ($select_filter_action=='')){
$where_2=" "; // I don't have any condition here. I have to display all the records
}
else if(($select_filter_status=='') ||... | Yes, You can add where clause based on condition in Codeigniter, Like this,
```
$this->db->select("*");
$this->db->from('tbl_customer');
$this->db->join('tbl_customer_billing', 'tbl_customer.cust_id=tbl_customer_billing.c_b_id', 'LEFT');
$this->db->join('tbl_customer_shipping', 'tbl_customer.cust_id=tbl_customer_shipp... |
54,643,419 | I am using CodeIgniter. I am getting the data from the controller.
**Model code**
```
$select_filter_status=$parameters['select_filter_status'];
$select_filter_action= $parameters['select_filter_action'];
if(($select_filter_status=='') && ($select_filter_action=='')){
$where_2=" "; // I don't have any condi... | 2019/02/12 | [
"https://Stackoverflow.com/questions/54643419",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9437856/"
] | You can simply put only one if condition here like this. It will work for you.
```
if (!empty($where_2){
$this->db->where($where_2);
}
```
if $where\_2 is not empty it will execute second where condition, if it's empty it will ignore the second where.
Or you can concatenate the query string like this to use only... | Yes, You can add where clause based on condition in Codeigniter, Like this,
```
$this->db->select("*");
$this->db->from('tbl_customer');
$this->db->join('tbl_customer_billing', 'tbl_customer.cust_id=tbl_customer_billing.c_b_id', 'LEFT');
$this->db->join('tbl_customer_shipping', 'tbl_customer.cust_id=tbl_customer_shipp... |
844,987 | I have tried several products to recover the data.
I have all of the original files thanks to photorec and foremost however, the images are useless without the correct filenames.
I have all of the correct filenames as well thanks to testdisk but the files are incomplete and corrupt when recovered using its undelete o... | 2014/11/25 | [
"https://superuser.com/questions/844987",
"https://superuser.com",
"https://superuser.com/users/239977/"
] | Use audit.txt of Foremost to regain original filenames:
```
File.read("audit.txt").scan(/-{4,}\n(File: .*?\n.*?)(?=-{4,})/m).flatten.map{|z|
f1=z.scan(/File: (.*?)\n/).flatten[0];
f2=z.scan(/[0-9]+:\t(.*?) \t/m).flatten;
extension=File.extname(f1);
[
f1,
f2.find{|q| File.extname(q)==extension}
... | Well, that's the limitations of using Freeware recovery applications. Why not try EaseUS, Stellar Phoenix or some other recovery suites that may have relatively higher chances of full recovery with their actual file names?
I don't have idea about which exactly works but have heard that paid recovery applications are m... |
30,758,894 | I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or **tell Apache to use another port instead?**
I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it. | 2015/06/10 | [
"https://Stackoverflow.com/questions/30758894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393058/"
] | You may need to terminate SQL Server Reporting Services as well. | I think it simple to change your Apache server port
1. Go to **C:\xampplite\apache\conf**
2. Open **httpd.conf** files
3. Search for **Listen 80**
4. Change **80** to any other like 9080
5. Now XAMPP restart try to start server
**NB** I am using **Server version: 5.1.41 with windows 10** |
30,758,894 | I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or **tell Apache to use another port instead?**
I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it. | 2015/06/10 | [
"https://Stackoverflow.com/questions/30758894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393058/"
] | In my case I need both XAMPP for Apache development & IIS Express for .Net 2013 development; so I do the following:
1. In Command Prompt typed services.msc, this loads "Windows Services" where I located "World Wide Web Publishing Service" and stop it.
[World Wide Web Publishing Service STOP](http://i.stack.imgur.com/m... | I had the same issue and none of the above solutions worked for me.
Apache uses both ports 80 and 443 (for HTTPS) and both must be ready to be used for Apache to start successfully. Only port 80 might not be enough.
I found in my case that when running VMWare Workstation I had the port 443 used by the VMware sharing.... |
30,758,894 | I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or **tell Apache to use another port instead?**
I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it. | 2015/06/10 | [
"https://Stackoverflow.com/questions/30758894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393058/"
] | I know that maybe this problem was resolved but I had the same problem with different solution. For that, I am going to explain another possible solution. In my case, the port 80 was occupied by Skype (pid: 25252) and I did not know what programme was.
To see the program's pid which is using the port 80 you can use th... | Beside the quite obvious reason (IIS), there is another reason that is common enough for this problem. It is worth to quote this question and its answer here:
```
http://stackoverflow.com/questions/22994888/why-skype-using-http-or-https-ports-80-and-443
```
So, if you have Skype installed in the computer, be sure t... |
30,758,894 | I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or **tell Apache to use another port instead?**
I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it. | 2015/06/10 | [
"https://Stackoverflow.com/questions/30758894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393058/"
] | Type in command line
`netstat -aon | findstr :80`
You'll see PID of process which uses port 80.
Then try to configure this app to use another port, or just kill it
**UPDATE:**
I'll write my comment here to be more clear: according to [this](http://www.nextofwindows.com/why-port-80-is-being-used-by-system-process-id-... | In case you need to run IIS on port 80/443 but on different IP address, you may use `netsh http add iplisten xxx.xxx.xxx.xxx` as described here:
<https://support.microsoft.com/en-us/help/954874/iis-binds-to-all-ip-addresses-on-a-server-when-you-install-iis-7-0-on>
More details about `netsh http add iplisten` can be f... |
30,758,894 | I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or **tell Apache to use another port instead?**
I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it. | 2015/06/10 | [
"https://Stackoverflow.com/questions/30758894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393058/"
] | In my case I need both XAMPP for Apache development & IIS Express for .Net 2013 development; so I do the following:
1. In Command Prompt typed services.msc, this loads "Windows Services" where I located "World Wide Web Publishing Service" and stop it.
[World Wide Web Publishing Service STOP](http://i.stack.imgur.com/m... | The problem happens whenever a process uses port 80.
You can run **Netstat** which is available in **XAMPP Control Panel** and check which process uses port 80 in your system.
For me it wasn't **IIS**, but **Skype**.
Turn off that process/application and then start the Apache services. |
30,758,894 | I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or **tell Apache to use another port instead?**
I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it. | 2015/06/10 | [
"https://Stackoverflow.com/questions/30758894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393058/"
] | **With Windows 10 IIS runs on Port 80 by default which can be changed:**
Run [`appwiz.cpl`](https://support.microsoft.com/en-us/kb/192806) use `Turn Windows features on or off` and install the IIS Manager Console.
[ first stop the service with the following
>
> net stop http /y
>
>
>
2) then disable the startup (optional)
>
> sc config http start= disabled
>
>
> | I had the same issue and none of the above solutions worked for me.
Apache uses both ports 80 and 443 (for HTTPS) and both must be ready to be used for Apache to start successfully. Only port 80 might not be enough.
I found in my case that when running VMWare Workstation I had the port 443 used by the VMware sharing.... |
30,758,894 | I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or **tell Apache to use another port instead?**
I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it. | 2015/06/10 | [
"https://Stackoverflow.com/questions/30758894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393058/"
] | I had the same problem on windows 10, **IIS/10.0 was using port 80**
To solve that:
* find service "W3SVC"
* disable it, or set it to "manual"
French name is: "*Service de publication World Wide Web*"
English name is: "*World Wide Web Publishing Service*"
german name is: "WWW-Publishingdienst" – thanks @fiffy
Pol... | Beside the quite obvious reason (IIS), there is another reason that is common enough for this problem. It is worth to quote this question and its answer here:
```
http://stackoverflow.com/questions/22994888/why-skype-using-http-or-https-ports-80-and-443
```
So, if you have Skype installed in the computer, be sure t... |
30,758,894 | I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or **tell Apache to use another port instead?**
I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it. | 2015/06/10 | [
"https://Stackoverflow.com/questions/30758894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393058/"
] | Beside the quite obvious reason (IIS), there is another reason that is common enough for this problem. It is worth to quote this question and its answer here:
```
http://stackoverflow.com/questions/22994888/why-skype-using-http-or-https-ports-80-and-443
```
So, if you have Skype installed in the computer, be sure t... | First, open regedit run as administrator
[see image](http://i.stack.imgur.com/bWJqm.png)
open HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentCurrentControlSet\Services\HTTP
open Start, change value from 3 to 4
[see image](http://i.stack.imgur.com/z9NR4.png)
then restart your computer |
30,758,894 | I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or **tell Apache to use another port instead?**
I was using Windows 7 before. I had trouble with port 80 with skype, but i have disabled it. | 2015/06/10 | [
"https://Stackoverflow.com/questions/30758894",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3393058/"
] | I think it simple to change your Apache server port
1. Go to **C:\xampplite\apache\conf**
2. Open **httpd.conf** files
3. Search for **Listen 80**
4. Change **80** to any other like 9080
5. Now XAMPP restart try to start server
**NB** I am using **Server version: 5.1.41 with windows 10** | I had the same issue and none of the above solutions worked for me.
Apache uses both ports 80 and 443 (for HTTPS) and both must be ready to be used for Apache to start successfully. Only port 80 might not be enough.
I found in my case that when running VMWare Workstation I had the port 443 used by the VMware sharing.... |
4,882,802 | I need to check if the server has modified the contents of a page so that I can retrieve that page again. I tried using "Last-Modified" and "ETag" options of header response with httpClient method. But in many pages these values are missing. is there any other way to handle this in JAVA code or any opensource TOOL whic... | 2011/02/03 | [
"https://Stackoverflow.com/questions/4882802",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/575221/"
] | ```
document.location.href = '/documents/some%20file.doc';
``` | ```
window.open("/documents/some%20file.doc","_self","fullscreen=no,toolbar=yes,width=800,height=600,menubar=yes,status=no,scroll=yes");
``` |
35,927,686 | I'm new with JavaScript programming and have been trying to validate a number that is inputted from a user on a php page. Here is the javascript that is included.
```js
var validate_and_create = function(){
var i_number = $("input_number").value;
var isValid = true;
if (i_number === ""){
$("cr... | 2016/03/10 | [
"https://Stackoverflow.com/questions/35927686",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6047068/"
] | You can use [parseInt](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/parseInt) to convert the value to integer, like `parseInt("55", 10)` will return `55`.
And something like `parseInt("xx",10)` returns `NaN`. | Thanks adeneo, isNaN works for validation.
Code below:
```js
var validate_and_create = function(){
var i_number = $("input_number").value;
var isValid = true;
if (i_number === ""){
$("create_n_error").firstChild.nodeValue = "Number text field cannot be blank.";
isValid = false;
... |
72,058,587 | I am using react-bootstrap version **0.32.4**, I can't update the version, that will bring up many changes.
I want to have a tooltip info showing for 4 seconds on page load and then it should hide, after that the tool tip info should be shown on hover.
Below is the code:
```
import React from "react";
import ".... | 2022/04/29 | [
"https://Stackoverflow.com/questions/72058587",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11447688/"
] | You can use `useRef` to get the overlay's functions for showing/hiding the tooltip within the overlay
Here is [the sandbox](https://codesandbox.io/s/react-bootstrap3-tooltip-forked-fdpmn2?file=/src/App.js:0-1205)
You also can look into the below implementation with some explanation in the code
```
import React from ... | I`m not work with react, but hope it should help you
```
constructor(props) {
super(props);
this.state = {
isShowing: true,
showDelayPassed: false,
showDelay: 4000
};
}
componentDidMount() {
setTimeout(
function () {
this.setState({ showDelayPassed: true });
... |
111,696 | I notice that when I create a Quick Filter with some emoji (e.g. ☺️) it saves, but when I try others (e.g. ) it doesn't save.
Which emoji characters does Jira support in the Quick Filters? | 2017/11/11 | [
"https://webapps.stackexchange.com/questions/111696",
"https://webapps.stackexchange.com",
"https://webapps.stackexchange.com/users/207/"
] | **Update:** Based on my manual research, I think I found a pattern. It seems only the 2-byte characters in the [range U+203C through U+3299](https://unicodey.com/emoji-data/table.htm) are supported. This includes the [Miscellaneous Symbols Unicode block (U+2600-U+26FF)](https://en.wikipedia.org/wiki/Miscellaneous_Symbo... | <https://www.unicode.org/emoji/charts/full-emoji-list.html>
Open browser console and paste following code:
```
let icons = document.getElementsByClassName('chars');
let allowed = [];
for(let i = 0; i < icons.length - 1; i++){
if(icons[i].innerText.length <= 1){
allowed.push(icons[i].innerText);
ic... |
21,742 | What did Aro mean when he said, "*Maintaining our secret has never been more imperative*"? It is on the *Twilight Saga: Breaking Dawn Part 2* trailer and I'm very curious to know what this line meant. | 2012/08/09 | [
"https://scifi.stackexchange.com/questions/21742",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/8224/"
] | I can't correctly quote. But I think it is the third book there is a line that goes something like:
For the first time in history men have created weapons which can kill vampires.
Which means, for the first time since vampires have existed they have a threat. Since they can't have more numbers than humans(else they ru... | "Maintaining our secret has never been more imperative" is a command, something that demands attention or action, a necessity that "our" the vampires must assert and kept from the knowledge of others. This is at any cost including killing non vampires/vampires that are lacking caution. |
33,941,785 | Consider the following test case using standard `JUnit` asserts and hamcrest's `assertThat`:
```
byte b = 0;
int i = 0;
assertEquals(b, i); // success
assertThat(b, equalTo(i)); // java.lang.AssertionError: Expected: <0> but: was <0>
if (b == i) {
fail(); // test fails, so b == i is true for the JVM
}
```
Why ... | 2015/11/26 | [
"https://Stackoverflow.com/questions/33941785",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2426346/"
] | [`Assert#assertThat`](http://junit.org/apidocs/org/junit/Assert.html#assertThat%28T,%20org.hamcrest.Matcher%29) is a generic method. Primitive types don't work with generics. In this case, the `byte` and `int` are boxed to `Byte` and `Integer`, respectively.
It then becomes (within `assertThat`)
```
Byte b = 0;
Inte... | This happens because the `int` and `byte` are boxed to `Integer` and `Byte` as hamcrest matchers operate on objects, not on primitives. So you are comparing an `Integer` with a `Byte`, and the implementation of `Byte.equals()` is:
```
public boolean equals(Object obj) {
if (obj instanceof Byte) {
return va... |
1,781 | I have asked the following questions to Galleon Support Team but their reply completely missed my points and unhelpful. Therefore, I seek help here.
Basic assumption: I have a Ledger Nano connected to my Galleon v. 0.9b (thus NOT a file wallet). Then my questions are as follows:
After the Babylon upgrade, there have ... | 2019/11/19 | [
"https://tezos.stackexchange.com/questions/1781",
"https://tezos.stackexchange.com",
"https://tezos.stackexchange.com/users/1857/"
] | 1- Your Tz1 address is the implicit account and Kt1 addresses are smart contracts.
Each implicit account can only delegate to one baker. Ledger supports having several implicit accounts, however Galleon does not.
2- In order to withdraw your XTZ from your KT1 account, click on the ''manage delegation'' tab and on ''w... | you would have to create kt1 addresses via a smart contract and delegate with those on a per-contract basis. I'm still waiting for someone to answer my question as to how to make these smart contract Kt1 addresses... Hopefully someone answers here |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | If you keep driving it that way for very long, the fuel that's pumping through the non-firing cylinder will contaminate the catalytic converter. That can result in the catalyst overheating and melting, possibly blocking the exhaust in the process (BTDT and cats are not cheap...). If you're really having a bad day, the ... | I had a spark plug fail completely and another one hardly work on an old 5 cylinder Audi GT coupe sport. It was as rough as a badger, but you could still drive it back home to sort it out. Certainly not fatal:-) |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | Spark plugs are normally a wear and tear kind of part instead of an "all or nothing" kind of failure. Over time, they get worn or build up deposits from years of use and they become less effective and efficient. I have rarely ever heard of a spark plug failing 100% all of a sudden. Over time, it would contribute to red... | I had a spark plug fail completely and another one hardly work on an old 5 cylinder Audi GT coupe sport. It was as rough as a badger, but you could still drive it back home to sort it out. Certainly not fatal:-) |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | No one has mentioned vibration yet.
When one of the spark plug wires went 'bad' on my Chevy LS1, the spark plug failing to fire immediately translated to regular vibrations that changed frequency with RPM and became especially bad at idle.
Replacing the wires (and spark plugs) eliminated the vibrations completely. | Spark plugs can fail in a number of ways - most commonly, the electrodes get encrusted with carbon deposits, but the electrodes can be worn away, the ceramic insulator can crack, the threads can fail, or the body can crack apart. Generally the plugs degrade over time, causing weak spark, poor combustion and reduced gas... |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | No one has mentioned vibration yet.
When one of the spark plug wires went 'bad' on my Chevy LS1, the spark plug failing to fire immediately translated to regular vibrations that changed frequency with RPM and became especially bad at idle.
Replacing the wires (and spark plugs) eliminated the vibrations completely. | One thing not mentioned here is that the unburnt fuel from a cylinder misfiring will find its way into the oil and cause symptoms similar to a flooded engine. I called a mechanic to try boosting the engine on a relative's car today, and he said it was extremely flooded, the spark plugs needed to be replaced and the oil... |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | If you keep driving it that way for very long, the fuel that's pumping through the non-firing cylinder will contaminate the catalytic converter. That can result in the catalyst overheating and melting, possibly blocking the exhaust in the process (BTDT and cats are not cheap...). If you're really having a bad day, the ... | Spark plugs are normally a wear and tear kind of part instead of an "all or nothing" kind of failure. Over time, they get worn or build up deposits from years of use and they become less effective and efficient. I have rarely ever heard of a spark plug failing 100% all of a sudden. Over time, it would contribute to red... |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | I had a spark plug fail completely and another one hardly work on an old 5 cylinder Audi GT coupe sport. It was as rough as a badger, but you could still drive it back home to sort it out. Certainly not fatal:-) | No one has mentioned vibration yet.
When one of the spark plug wires went 'bad' on my Chevy LS1, the spark plug failing to fire immediately translated to regular vibrations that changed frequency with RPM and became especially bad at idle.
Replacing the wires (and spark plugs) eliminated the vibrations completely. |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | It should carry on running, albeit somewhat lumpy. I've seen a car (a 6-cylinder BMW) spit out a plug on the motorway, it carried on running quite happily, just got noiser and lost some power (as you would expect!). The owner pulled over at the next exit, found out what had happened and drove to the nearest parts shop ... | I could be wrong but I thought you should able to get Check Engine Light with proper code of given Cylinder Misfiring. |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | Spark plugs are normally a wear and tear kind of part instead of an "all or nothing" kind of failure. Over time, they get worn or build up deposits from years of use and they become less effective and efficient. I have rarely ever heard of a spark plug failing 100% all of a sudden. Over time, it would contribute to red... | Spark plugs can fail in a number of ways - most commonly, the electrodes get encrusted with carbon deposits, but the electrodes can be worn away, the ceramic insulator can crack, the threads can fail, or the body can crack apart. Generally the plugs degrade over time, causing weak spark, poor combustion and reduced gas... |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | I had a spark plug fail completely and another one hardly work on an old 5 cylinder Audi GT coupe sport. It was as rough as a badger, but you could still drive it back home to sort it out. Certainly not fatal:-) | Most newer cars will blink the check engine light if a spark plug suddenly fails. If you ever see a blinking check engine light it means you have a major misfire even that is going to damage your expensive catalytic converters! |
911 | AFAIK vehicle manuals say owner must replace spark plugs every N miles. Suppose he fails to do so and a single spark plug unexpectedly dies in an engine with multiple cylinders right in a freeway. What likely happens to the vehicle? | 2011/05/18 | [
"https://mechanics.stackexchange.com/questions/911",
"https://mechanics.stackexchange.com",
"https://mechanics.stackexchange.com/users/433/"
] | Spark plugs are normally a wear and tear kind of part instead of an "all or nothing" kind of failure. Over time, they get worn or build up deposits from years of use and they become less effective and efficient. I have rarely ever heard of a spark plug failing 100% all of a sudden. Over time, it would contribute to red... | I could be wrong but I thought you should able to get Check Engine Light with proper code of given Cylinder Misfiring. |
42,677,588 | I installed the oracle instant client 12, but I can't connect the php with OCI8. I am using XAMPP 32bit and PHP 7.0.15. In my phpinfo() don't show the OCI section. Please, I'm stuck in this problem for a few days. :/
Thanks for all! | 2017/03/08 | [
"https://Stackoverflow.com/questions/42677588",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7015535/"
] | Well, the problem was that XAMPP as well PECL(web site) has the wrong (or outdate) DLL for OCI8. So this link [here](http://windows.php.net/downloads/pecl/releases/oci8/2.1.3/) has the correctly DLLs for PHP. | You must check if your php is using x86 architecture, since you are using XAMPP-32bits.
If you go to your xampp/php directory through cmd, in my case it was `"C:\xampp\php"`, and start the php by the simple command "php" it will probably show what dlls **are not being found in the etc folder or which of those are not ... |
157,877 | Has anybody tried to build their own kitchen cabinets ?
I have to replace only about 12 feet of base and top cabinets. They are costing me almost $6000 (installed) for medium grade cabinets. These are not top of the line custom cabinets.
I am fairly handy and have almost all the woodworking tools.
How much will it ... | 2019/02/18 | [
"https://diy.stackexchange.com/questions/157877",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/97209/"
] | If time doesn't matter, then go for it. It's fun and you'll take pride in your work. On paper, you'll save money, though I can almost guarantee that the cabinets will opportunity cost you more than just flat out buying them. Nobody can put an actual price on the materials without knowing more details... wood? melamine?... | You definitely can and will save money but it's a ton of work. Plus it's really hard to get current styles. You may need some serious router bits and have to be careful to select good, properly dried lumber. Painting is also a big challenge if you don't have at least a crude spray booth. I just resurfaced my oak cabine... |
21,658,201 | home.php
```
<?php
include 'myClass.php';
$sampleClass=main;
$sampleClass->renderHtml();
?>
```
myClass.php
```
<?php
class main
{
public $var="apple";
public function renderHtml()
{
echo "This is $var";
return;
}
}
```
Now when I do that I receive an error and it says:
```
Fa... | 2014/02/09 | [
"https://Stackoverflow.com/questions/21658201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2451499/"
] | ```
include 'myClass.php';
// first create a new object
$sampleClass = new main();
// call object method
$sampleClass->renderHtml();
```
myClass.php
```
class main
{
public $var = "apple";
public function renderHtml()
{
echo "This is " . $this->var;
}
}
``` | You should use
```
$sampleClass = new main();
``` |
21,658,201 | home.php
```
<?php
include 'myClass.php';
$sampleClass=main;
$sampleClass->renderHtml();
?>
```
myClass.php
```
<?php
class main
{
public $var="apple";
public function renderHtml()
{
echo "This is $var";
return;
}
}
```
Now when I do that I receive an error and it says:
```
Fa... | 2014/02/09 | [
"https://Stackoverflow.com/questions/21658201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2451499/"
] | ```
include 'myClass.php';
// first create a new object
$sampleClass = new main();
// call object method
$sampleClass->renderHtml();
```
myClass.php
```
class main
{
public $var = "apple";
public function renderHtml()
{
echo "This is " . $this->var;
}
}
``` | use
```
$sampleClass = new main();
``` |
21,658,201 | home.php
```
<?php
include 'myClass.php';
$sampleClass=main;
$sampleClass->renderHtml();
?>
```
myClass.php
```
<?php
class main
{
public $var="apple";
public function renderHtml()
{
echo "This is $var";
return;
}
}
```
Now when I do that I receive an error and it says:
```
Fa... | 2014/02/09 | [
"https://Stackoverflow.com/questions/21658201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2451499/"
] | use
```
$sampleClass = new main();
``` | You should use
```
$sampleClass = new main();
``` |
45,027,317 | I referred the site <https://github.com/toddkitta/azure-content/blob/master/articles/data-lake-analytics/data-lake-analytics-get-started-net-sdk.md> for submitting a U-SQL job but the above GitHub sample showing error in the console application in the Authentication AcquireToken method.[:
mt5.initialize()
tf = mt5.TIMEFRAME_ + timeframe
symbol_rates = mt5.copy_rates_from(symbol, tf, dat... | 2020/06/07 | [
"https://Stackoverflow.com/questions/62245726",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12681257/"
] | first, `D1` needs to be a string: `'D1'`.
then, you need to use `getattr`:
```
tf = getattr(mt5, f'TIMEFRAME_{timeframe}')
``` | Although the answer with `getattr` probably works, it's not very Pythonic. The Python way is
```
import MetaTrader5 as mt5
def symbol_data(symbol,timeframe):
mt5.initialize()
symbol_rates = mt5.copy_rates_from(symbol, timeframe, datetime.now(),10**5)
mt5.shutdown()
return(symbol_rates)
symbol_data('... |
37,878,867 | An AVL tree is the same as a self-balancing binary search tree. What does AVL stand for? Does it have to do with the name of the inventor? | 2016/06/17 | [
"https://Stackoverflow.com/questions/37878867",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5745627/"
] | It is the name of the inventors like you guessed. From [wiki](https://en.wikipedia.org/wiki/AVL_tree):
>
> AVL tree is named after its two Soviet inventors, Georgy **A**delson-**V**elsky and Evgenii **L**andis
>
>
>
Their names spell the acronym, **AVL**. | An AVL tree is another balanced binary search tree. Named after their inventors, Adelson-Velskii and Landis, they were the first dynamically balanced trees to be proposed. Like red-black trees, they are not perfectly balanced, but pairs of sub-trees differ in height by at most 1, maintaining an O(logn) search time. Add... |
39,906 | I'm building a Site Definition that will be the core of a SharePoint product.
I want to use best practices building the data access architecture.
Since I do not know what the URL of the site will be, it seems SPContext.Current.Web is a great way to access lists on this site.
However, I often see people manually ente... | 2012/06/29 | [
"https://sharepoint.stackexchange.com/questions/39906",
"https://sharepoint.stackexchange.com",
"https://sharepoint.stackexchange.com/users/5763/"
] | Any kind of hardcoded path is, in general, opposite from best practice so opening a SPWeb or SPList object directly from its full server URL is a no-no.
To get the SPWeb object, if you are sure your code will always run in your desired web it is perfectly okay to use SPContext.Current.Web. In all other cases, you mig... | It depends on the "context". In a web part or application page, use SPContext. A lot of example code you see on the web uses a console app for simplicity - these would use the SPSite constructor with a string parameter representing the url. In a Feature receiver you'd use (SPWeb)properties.Feature.Parent.
Bottom line ... |
14,083,010 | I have this:
```
fin = open(blah)
fin_lower= fin.readlines()
lines = [fin_lower.lower() for line in fin]
lines = line.split()
```
It gives:
```
TypeError: expected string or buffer
```
Is it wrong to readlines? | 2012/12/29 | [
"https://Stackoverflow.com/questions/14083010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | [readlines](http://docs.python.org/2/tutorial/inputoutput.html) returns a list containing all lines of data, it looks like you have a bug, and you probably want to do this:
```
lines = [line.lower() for line in fin_lower]
```
Your code is also mixing variables around, take a good step through it, what are you trying... | I agree with Bartek
I was able to get this done.
```
import os
import signal
import time
import sys
import re
import string
fin = open('blah','r')
fin_lower= fin.readlines()
lines=""
for line in fin_lower:
lines += line.lower()
line = re.sub(';',' ',lines)
lines = line.split()
print lines
```
Initial Contents... |
14,083,010 | I have this:
```
fin = open(blah)
fin_lower= fin.readlines()
lines = [fin_lower.lower() for line in fin]
lines = line.split()
```
It gives:
```
TypeError: expected string or buffer
```
Is it wrong to readlines? | 2012/12/29 | [
"https://Stackoverflow.com/questions/14083010",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | `re.sub` expects a string as the third argument, you gave it `lines` which is a list. Also, you're iterating over `fin` after consuming all lines of it with `readlines`. You seem to be trying to do:
```
with open(blah) as fin:
lines = [line.lower().replace(',', '').split() for line in fin]
```
Also note that you... | I agree with Bartek
I was able to get this done.
```
import os
import signal
import time
import sys
import re
import string
fin = open('blah','r')
fin_lower= fin.readlines()
lines=""
for line in fin_lower:
lines += line.lower()
line = re.sub(';',' ',lines)
lines = line.split()
print lines
```
Initial Contents... |
43,740 | Just I want to know, is it possible to extract header data by 'Man in middle attack' in HTTPS connection
and is there any other way or hack to achieve same thing?
If there is way to hack, is it possible to prevent such kind of hack? | 2013/09/23 | [
"https://security.stackexchange.com/questions/43740",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/31918/"
] | It depends.
Lets say we have a server that only provides an HTTPS service and uses HTTP just to redirect to HTTPS. The user's browser is authenticated using a session cookie **without** the [secure flag](https://owasp.org/www-community/controls/SecureCookieAttribute). At some point, this browser is going to load HTML ... | TLS / SSL encrypts the entire connection, which also includes the request and the response with all HTTP headers and payload. To our best knowledge it's not possible to extract header information **IFF** the connection is properly secured. 'Properly secure' is a vague term. A lot of things can go wrong with TLS / SSL, ... |
36,444,995 | With sql query I get 100 result rows. I need to know single row position inside this 100 rows. I have unique fields which I can check by loop, but this takes long time. Is there a way that I can get single item position inside queried result.
For example: I have table with unique user ids`(12, 13, 20, 21, 34, 5)`. The... | 2016/04/06 | [
"https://Stackoverflow.com/questions/36444995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2098878/"
] | Optimizing SQL query is always more efficient that operating on huge results.
Make a `select` with `where` clause in which you will be checking how many users have lesser creation date than desired id owner
```
SELECT
count(*)
FROM
table
WHERE
creationDate < (SELECT creationDate FROM table WHERE id =... | you can try something like this
```
SELECT row ( SELECT ROW_NUMBER() OVER (ORDER BY columnChoosen) AS row, columnChoosen FROM yourTable) sub WHERE sub.columnChoosen = 34
``` |
10,282,179 | I've run across .NET 4's `ThreadLocal<T>` and was wondering if there's a way to accumulate the `.Value` values from all threads.
In Microsoft's ppl C++ library they have [`Concurrency::combinable::combine_each`](http://msdn.microsoft.com/en-us/library/dd470699.aspx), is there an equivalent method for .NET's `ThreadLo... | 2012/04/23 | [
"https://Stackoverflow.com/questions/10282179",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3848/"
] | Since .NET 4.5, Microsoft added an attribute called `Values` to the `ThreadLocal` class that does exactly what you need. Here's the way it works:
```
var localResult = new ThreadLocal<int>(() => 0, trackAllValues: true);
Parallel.For(0, 10000, i =>
{
localResult.Value += Compute(i);
});
int result = localResult.V... | This information is not available in .NET 4.0. For 4.5 and up, see Joao's answer.
Microsoft is [considering adding such a feature](https://devblogs.microsoft.com/pfxteam/new-feature-threadlocalt-values/). You will need to write a wrapper around `ThreadLocal<T>` to add this behavior.
[Here is a blog post](https://dev... |
13,435,516 | I am writing a program that can write sets of questions for review to a file for another program to read. The possible answers are typed into JTextFields at the bottom. It has code to ensure that there won't bew more than one blank JTextField at the end. When I type in answers, at varying points it will throw a StackOv... | 2012/11/17 | [
"https://Stackoverflow.com/questions/13435516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1518243/"
] | Infinite recursions in `AWTEventMulticaster` are usually caused by you adding a component inside itself. I cannot see how that may happen from the code you've pasted, but the bug might be in other parts of your code.
See [What causes an endless recursion in AWTEventMulticaster.mouseEntered()?](https://stackoverflow.co... | A piece of advice the next time you post a question: provide an [SSCCE](http://sscce.org). If we now wanted to run your code, we had to fix a bunch of compile errors due to missing classes and provide a main method ourself. The `WriterPanel` class seems to be completely unrelated to the error.
Further, strip down your... |
13,435,516 | I am writing a program that can write sets of questions for review to a file for another program to read. The possible answers are typed into JTextFields at the bottom. It has code to ensure that there won't bew more than one blank JTextField at the end. When I type in answers, at varying points it will throw a StackOv... | 2012/11/17 | [
"https://Stackoverflow.com/questions/13435516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1518243/"
] | Every time you type a key your initial listener's (this') keyTyped method is called, that calls fixAnswers, and as the last step, it adds another listener to your JTextField. You never remove any listeners so eventually you have a longer string of them than the Java stack can handle.
You only need one listener. Don't... | Infinite recursions in `AWTEventMulticaster` are usually caused by you adding a component inside itself. I cannot see how that may happen from the code you've pasted, but the bug might be in other parts of your code.
See [What causes an endless recursion in AWTEventMulticaster.mouseEntered()?](https://stackoverflow.co... |
13,435,516 | I am writing a program that can write sets of questions for review to a file for another program to read. The possible answers are typed into JTextFields at the bottom. It has code to ensure that there won't bew more than one blank JTextField at the end. When I type in answers, at varying points it will throw a StackOv... | 2012/11/17 | [
"https://Stackoverflow.com/questions/13435516",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1518243/"
] | Every time you type a key your initial listener's (this') keyTyped method is called, that calls fixAnswers, and as the last step, it adds another listener to your JTextField. You never remove any listeners so eventually you have a longer string of them than the Java stack can handle.
You only need one listener. Don't... | A piece of advice the next time you post a question: provide an [SSCCE](http://sscce.org). If we now wanted to run your code, we had to fix a bunch of compile errors due to missing classes and provide a main method ourself. The `WriterPanel` class seems to be completely unrelated to the error.
Further, strip down your... |
3,822,310 | I want to make some printf's to the windows console from my C program but want to make some of them different colours.
Anyone know if this can be done easily?
EDIT: Windows XP is my OS | 2010/09/29 | [
"https://Stackoverflow.com/questions/3822310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/305799/"
] | `SetConsoleTextAttribute()` will let you set the color of subsequent text output.
* <http://msdn.microsoft.com/en-us/library/ms686047.aspx>
You'll probably want to look at the complete set of Win32 console APIs to be able to get/set/restore and otherwise manipulate the console.
* <http://msdn.microsoft.com/en-us/lib... | That's not possible in CMD (correct me if I'm wrong). You can only change the foreground and background color of CMD as a whole. Not by line, or word.
For changing its foreground and background colors please refer to the `color` command:
`color /?` |
37,633 | For an ordinary bicycle (neither fixed gear nor capable of changing any gears).
Is it possible to modify it to **have a reverse gear** on it?
(i.e. reverse pedaling causes the bicycle to go backward)
(By modifying or attaching components to the rear wheel)
Thank you in advance | 2016/03/14 | [
"https://bicycles.stackexchange.com/questions/37633",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/25010/"
] | Have a look at the system Berg toys use for their go-karts. Its called a **BFR hub** (for brake, forward and reverse). This hub lets you go forward or backward, while always pedalling in forward direction. It also has a freewheel.
The system needs two chains, with this being in the middle of your drive sprocket and ax... | Yes. Some type of freewheel or freehub manual lockup should do the trick. It would also be cool if you could pedal backwards to apply power forwards, thus using muscles in a different way. |
37,633 | For an ordinary bicycle (neither fixed gear nor capable of changing any gears).
Is it possible to modify it to **have a reverse gear** on it?
(i.e. reverse pedaling causes the bicycle to go backward)
(By modifying or attaching components to the rear wheel)
Thank you in advance | 2016/03/14 | [
"https://bicycles.stackexchange.com/questions/37633",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/25010/"
] | While it may be possible, by creating a mechanism that shifts the chain from one freewheel to another, or disconnecting one temporarily through mechanical actuators, the hassle and engineering it would take to make happen would be outweighed by the fact that it is almost entirely pointless. A fixed gear would be your b... | Have a look at the system Berg toys use for their go-karts. Its called a **BFR hub** (for brake, forward and reverse). This hub lets you go forward or backward, while always pedalling in forward direction. It also has a freewheel.
The system needs two chains, with this being in the middle of your drive sprocket and ax... |
37,633 | For an ordinary bicycle (neither fixed gear nor capable of changing any gears).
Is it possible to modify it to **have a reverse gear** on it?
(i.e. reverse pedaling causes the bicycle to go backward)
(By modifying or attaching components to the rear wheel)
Thank you in advance | 2016/03/14 | [
"https://bicycles.stackexchange.com/questions/37633",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/25010/"
] | While it may be possible, by creating a mechanism that shifts the chain from one freewheel to another, or disconnecting one temporarily through mechanical actuators, the hassle and engineering it would take to make happen would be outweighed by the fact that it is almost entirely pointless. A fixed gear would be your b... | Cut then weld the bottom cranks and rear hub of two bikes to mirror the drive side. You will have gears and chains on both sides of your bike. -]---[- To make one ride backwards full time, just swap the parts right to left. |
37,633 | For an ordinary bicycle (neither fixed gear nor capable of changing any gears).
Is it possible to modify it to **have a reverse gear** on it?
(i.e. reverse pedaling causes the bicycle to go backward)
(By modifying or attaching components to the rear wheel)
Thank you in advance | 2016/03/14 | [
"https://bicycles.stackexchange.com/questions/37633",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/25010/"
] | I have repaired a pedal powered toy that had an arrangement like this. It was an Italian ride-on toy tractor that had a modified coaster brake set up so that instead of back pedalling applying a brake, the "brake" mechanism inside the hub locked against the hub body so that you could pedal the toy backwards. The modifi... | Cut then weld the bottom cranks and rear hub of two bikes to mirror the drive side. You will have gears and chains on both sides of your bike. -]---[- To make one ride backwards full time, just swap the parts right to left. |
37,633 | For an ordinary bicycle (neither fixed gear nor capable of changing any gears).
Is it possible to modify it to **have a reverse gear** on it?
(i.e. reverse pedaling causes the bicycle to go backward)
(By modifying or attaching components to the rear wheel)
Thank you in advance | 2016/03/14 | [
"https://bicycles.stackexchange.com/questions/37633",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/25010/"
] | Such a hub exists for trike and quads . Pedal forward with 3 or 5 gears then having a coaster brake to stop . At full stop with the brake engaged continued backward pedal pressure will cause the cycle will move in reverse in a reduced gear . Sturmey-Archer has made these hubs for the niche market (velomobiles ) for som... | Yes. Some type of freewheel or freehub manual lockup should do the trick. It would also be cool if you could pedal backwards to apply power forwards, thus using muscles in a different way. |
37,633 | For an ordinary bicycle (neither fixed gear nor capable of changing any gears).
Is it possible to modify it to **have a reverse gear** on it?
(i.e. reverse pedaling causes the bicycle to go backward)
(By modifying or attaching components to the rear wheel)
Thank you in advance | 2016/03/14 | [
"https://bicycles.stackexchange.com/questions/37633",
"https://bicycles.stackexchange.com",
"https://bicycles.stackexchange.com/users/25010/"
] | Such a hub exists for trike and quads . Pedal forward with 3 or 5 gears then having a coaster brake to stop . At full stop with the brake engaged continued backward pedal pressure will cause the cycle will move in reverse in a reduced gear . Sturmey-Archer has made these hubs for the niche market (velomobiles ) for som... | Have a look at the system Berg toys use for their go-karts. Its called a **BFR hub** (for brake, forward and reverse). This hub lets you go forward or backward, while always pedalling in forward direction. It also has a freewheel.
The system needs two chains, with this being in the middle of your drive sprocket and ax... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.