qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
40,251,793 | For instance, how can I write code in ATS that traverses a given string as is done by the following C code:
```
while ((c = *str++) != 0) do_something(c);
``` | 2016/10/26 | [
"https://Stackoverflow.com/questions/40251793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Well, there is always a combinator-based solution:
```
(str).foreach()(lam(c) => do_something(c))
``` | The following solution makes use of UNSAFE but it should be really easy to access:
```
staload
UNSAFE =
"prelude/SATS/unsafe.sats"
fun
loop(p0: ptr): void = let
val c = $UNSAFE.ptr_get<char>p0)
in
if isneqz(c) then (do_something(c); loop(ptr_succ<char>(p0)) else ()
end
val () = loop(string2ptr(str))
``` |
40,251,793 | For instance, how can I write code in ATS that traverses a given string as is done by the following C code:
```
while ((c = *str++) != 0) do_something(c);
``` | 2016/10/26 | [
"https://Stackoverflow.com/questions/40251793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Well, there is always a combinator-based solution:
```
(str).foreach()(lam(c) => do_something(c))
``` | The following solution is easy, accessible and doesn't require any unsafe features (but it does use one advanced feature: indexed string type).
```
fun
loop {n:int}(p0: string(n)): void =
if string_isnot_empty (p0) then let
val c = (g0ofg1)(string_head(p0))
val p0 = string_tail(p0)
in
do_something(c); loop(p0)
e... |
40,251,793 | For instance, how can I write code in ATS that traverses a given string as is done by the following C code:
```
while ((c = *str++) != 0) do_something(c);
``` | 2016/10/26 | [
"https://Stackoverflow.com/questions/40251793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The following solution is easy, accessible and doesn't require any unsafe features (but it does use one advanced feature: indexed string type).
```
fun
loop {n:int}(p0: string(n)): void =
if string_isnot_empty (p0) then let
val c = (g0ofg1)(string_head(p0))
val p0 = string_tail(p0)
in
do_something(c); loop(p0)
e... | The following solution makes use of UNSAFE but it should be really easy to access:
```
staload
UNSAFE =
"prelude/SATS/unsafe.sats"
fun
loop(p0: ptr): void = let
val c = $UNSAFE.ptr_get<char>p0)
in
if isneqz(c) then (do_something(c); loop(ptr_succ<char>(p0)) else ()
end
val () = loop(string2ptr(str))
``` |
25,945,433 | Can a mapreduce program be configured such that only reducer is executed not mapper[even though there is a map function defined in the program]. Can this be achieved just by changing job configuration.
I want to implement incremental computation in mapreduce(with input as append only files). For example
For wordcount... | 2014/09/20 | [
"https://Stackoverflow.com/questions/25945433",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2515566/"
] | No, this is not possible. Hadoop requires you to do a `map`, while the `reduce` is optional.
If you want to do a group-by, you can try to use `Apache Tez` and configure a DAG that will the same what you want to archieve (might be still hacky, because you will need to use the internal data format). | yes You can!, use this code as mapper(python\_version)
`import sys
for i in sys.stdin:
print i`
this will do the trick, because mapper is must one. so just print the contents of the input with a dummy mapper
I guess that helped! |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | As RonJohn wrote, "computer industry, pushed by IBM, standardized on 8-bit bytes for General Purpose computers".
After that, there are internal advantages with using powers of 2 multiples of that - it allows for everything to be aligned when different size collections of bytes are used, and allows different bits of th... | It's coincidence, or just everyone copying everyone else. There is no deep technical reason that the number of bits should be a power of two. (There is a deep technical reason however that the number of possible values is a power of two).
A processor with 24, or 31, or 60 bit words would work just fine. Processors sup... |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | I'd suggest that it is more a convention, less a technical issue.
[Wikipedia's page on the word size choice in computer architecture](https://en.wikipedia.org/wiki/Word_(computer_architecture)) has a nice table with a *lot* of older computer architectures with byte/word sizes which are not a power of two. On that page... | I think some of the arguments missing is that it is convenient that a register can be divided into two parts which are easy to work with, for instance with smaller registers. Hence, for the intel architecture, you initially had 16 bits registers that were subdivided into two 8-bit subregisters, and then these registers... |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | Having 2ⁿ bit registers, allows bits in the registers to be addressed with an integer number of bits:
Addressing a bit in an 8 bit register will need 3 bits. Addressing a bit in a 16 bit register will need 4 bits. But, addressing a bit in a 12 bit register will need 3.58… bits. You would have to round it up to 4, thus... | Generally, processors are referred to as x-bit, where x is the width of the data bus.
In rough terms, increasing the data bus size offers primarily speed as a reward...twice the bits, twice the data access speed. This is the ideal; some inefficiencies are involved (e.g., fetching 1 byte still takes 1 cycle on a 32-bit... |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | I think some of the arguments missing is that it is convenient that a register can be divided into two parts which are easy to work with, for instance with smaller registers. Hence, for the intel architecture, you initially had 16 bits registers that were subdivided into two 8-bit subregisters, and then these registers... | CPU register width tends to grow faster than the ability to cheaply get RAM to fill it all.
You can save money on developing and manufacturing your CPU by not adding pins, such as address pins, that will never be used.
Furthermore the 8086 was really weird - addresses were expressed using segments. 20 bits address li... |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | 8-bit bytes
-----------
Much of this grows out of the adoption of the 8-bit byte. That became popular with the introduction of the IBM 360 family of computers in 1964. In an issue that year of the IBM Technical Journal, an explanation of the choice was offered:
>
> Character size, 6 vs 4/8: In character size, the fu... | I think some of the arguments missing is that it is convenient that a register can be divided into two parts which are easy to work with, for instance with smaller registers. Hence, for the intel architecture, you initially had 16 bits registers that were subdivided into two 8-bit subregisters, and then these registers... |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | 8-bit bytes
-----------
Much of this grows out of the adoption of the 8-bit byte. That became popular with the introduction of the IBM 360 family of computers in 1964. In an issue that year of the IBM Technical Journal, an explanation of the choice was offered:
>
> Character size, 6 vs 4/8: In character size, the fu... | As RonJohn wrote, "computer industry, pushed by IBM, standardized on 8-bit bytes for General Purpose computers".
After that, there are internal advantages with using powers of 2 multiples of that - it allows for everything to be aligned when different size collections of bytes are used, and allows different bits of th... |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | The most common reason is because computers use the binary system, where
a bit can be either a zero or one.
If computers used ternary values for the bits, then we'd have everything in powers of 3.
As regarding RAM/memory:
A number N of bits in an address bus (used to select an address)
can address `2^N` bytes.
Whenev... | Generally, processors are referred to as x-bit, where x is the width of the data bus.
In rough terms, increasing the data bus size offers primarily speed as a reward...twice the bits, twice the data access speed. This is the ideal; some inefficiencies are involved (e.g., fetching 1 byte still takes 1 cycle on a 32-bit... |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | It's coincidence, or just everyone copying everyone else. There is no deep technical reason that the number of bits should be a power of two. (There is a deep technical reason however that the number of possible values is a power of two).
A processor with 24, or 31, or 60 bit words would work just fine. Processors sup... | CPU register width tends to grow faster than the ability to cheaply get RAM to fill it all.
You can save money on developing and manufacturing your CPU by not adding pins, such as address pins, that will never be used.
Furthermore the 8086 was really weird - addresses were expressed using segments. 20 bits address li... |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | I think some of the arguments missing is that it is convenient that a register can be divided into two parts which are easy to work with, for instance with smaller registers. Hence, for the intel architecture, you initially had 16 bits registers that were subdivided into two 8-bit subregisters, and then these registers... | Generally, processors are referred to as x-bit, where x is the width of the data bus.
In rough terms, increasing the data bus size offers primarily speed as a reward...twice the bits, twice the data access speed. This is the ideal; some inefficiencies are involved (e.g., fetching 1 byte still takes 1 cycle on a 32-bit... |
1,735,154 | I am using Office Version 2206 (Build 15330.20230), the current version. When I am searching for an email it shows a message that maybe not all results are shown and that it is still indexing 127279 emails, many more emails than I have recieved since the issue occured. When I search for something it only shows results ... | 2022/08/03 | [
"https://superuser.com/questions/1735154",
"https://superuser.com",
"https://superuser.com/users/1160996/"
] | The most common reason is because computers use the binary system, where
a bit can be either a zero or one.
If computers used ternary values for the bits, then we'd have everything in powers of 3.
As regarding RAM/memory:
A number N of bits in an address bus (used to select an address)
can address `2^N` bytes.
Whenev... | I think some of the arguments missing is that it is convenient that a register can be divided into two parts which are easy to work with, for instance with smaller registers. Hence, for the intel architecture, you initially had 16 bits registers that were subdivided into two 8-bit subregisters, and then these registers... |
32,968,591 | How can I fix the following problem?
```
aaa@aaa $ bower install bower.json
bower bower.json#* cached git://github.com/Kalitte/app-states.git#0.6.9
bower bower.json#* validate 0.6.9 against git://github.com/Kalitte/app-states.git#*
bower webcomponentsjs#~0.5.4 cached git://github.com/Polyme... | 2015/10/06 | [
"https://Stackoverflow.com/questions/32968591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1523874/"
] | I don't know how or at what point this happened, but it happened to me and if you look inside your `bower_components` folder there maybe a folder called `App States`. I deleted this folder and I was able to do an install. | You have your bower config in bower.json file, right? You don't give the file as argument, it messes like you show.
So, type in the folder that holds the bower.json file only
```
bower install
```
That command will find the bower.json for you automatically. |
32,968,591 | How can I fix the following problem?
```
aaa@aaa $ bower install bower.json
bower bower.json#* cached git://github.com/Kalitte/app-states.git#0.6.9
bower bower.json#* validate 0.6.9 against git://github.com/Kalitte/app-states.git#*
bower webcomponentsjs#~0.5.4 cached git://github.com/Polyme... | 2015/10/06 | [
"https://Stackoverflow.com/questions/32968591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1523874/"
] | You have your bower config in bower.json file, right? You don't give the file as argument, it messes like you show.
So, type in the folder that holds the bower.json file only
```
bower install
```
That command will find the bower.json for you automatically. | In my case, the bower had created "App States" folder and after deleting the folder the error got resolved.
After deleting the folder: execute
`bower install --allow-root`
This should fix the issue. |
32,968,591 | How can I fix the following problem?
```
aaa@aaa $ bower install bower.json
bower bower.json#* cached git://github.com/Kalitte/app-states.git#0.6.9
bower bower.json#* validate 0.6.9 against git://github.com/Kalitte/app-states.git#*
bower webcomponentsjs#~0.5.4 cached git://github.com/Polyme... | 2015/10/06 | [
"https://Stackoverflow.com/questions/32968591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1523874/"
] | I don't know how or at what point this happened, but it happened to me and if you look inside your `bower_components` folder there maybe a folder called `App States`. I deleted this folder and I was able to do an install. | In my case, the bower had created "App States" folder and after deleting the folder the error got resolved.
After deleting the folder: execute
`bower install --allow-root`
This should fix the issue. |
60,007,307 | I have 5 fragments that call function from the activity in their onResume method. The problem is as follows: they call the function multiple times, but I want them to call it only one time. I am using the Navigation(NavHostFragment) and NavController to control the fragments. So my question is - Is there a way to call ... | 2020/01/31 | [
"https://Stackoverflow.com/questions/60007307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12356209/"
] | What do you mean "they call the function multiple times"? As in they call the function every time you close and reopen the app?
Here is an overview of the [fragment life cycle](https://developer.android.com/guide/components/fragments#Creating) and some more [information on handling that life cycle](https://developer.a... | thanks for sharing your code btw, pretty sure we're all python programs that can analyze your code with our minds |
35,372,930 | I have an assignment where I have to use a linked list of node with void\* as the data. I would be filling the nodes with an object. I want to know some way of accessing the members of the object after it is in the linked list, other than casting it to the class. Is it possible? Also, here's a chunk of my code just in ... | 2016/02/12 | [
"https://Stackoverflow.com/questions/35372930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5829155/"
] | You cannot work with the pointee of a `void*` without first casting it first. If it points at a `Star`, for example, you could do something like this:
```
static_cast<Star*>(data_)->PrintToConsole(); // Haha, Star star!
```
That said, in C++, it's pretty unusual to store things like this. You're much better off usin... | You should cast it to the class. But if you really don't want to, you can use the [offsetof](http://en.cppreference.com/w/cpp/types/offsetof) macro:
>
> The macro offsetof expands to a constant of type std::size\_t, the
> value of which is the offset, in bytes, from the beginning of an
> object of specified type to... |
35,372,930 | I have an assignment where I have to use a linked list of node with void\* as the data. I would be filling the nodes with an object. I want to know some way of accessing the members of the object after it is in the linked list, other than casting it to the class. Is it possible? Also, here's a chunk of my code just in ... | 2016/02/12 | [
"https://Stackoverflow.com/questions/35372930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5829155/"
] | You cannot work with the pointee of a `void*` without first casting it first. If it points at a `Star`, for example, you could do something like this:
```
static_cast<Star*>(data_)->PrintToConsole(); // Haha, Star star!
```
That said, in C++, it's pretty unusual to store things like this. You're much better off usin... | No. You have to cast it to the appropriate object.
I would question the reason on using void pointers.
I would also suggest a dynamic cast might be better |
35,372,930 | I have an assignment where I have to use a linked list of node with void\* as the data. I would be filling the nodes with an object. I want to know some way of accessing the members of the object after it is in the linked list, other than casting it to the class. Is it possible? Also, here's a chunk of my code just in ... | 2016/02/12 | [
"https://Stackoverflow.com/questions/35372930",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5829155/"
] | You cannot work with the pointee of a `void*` without first casting it first. If it points at a `Star`, for example, you could do something like this:
```
static_cast<Star*>(data_)->PrintToConsole(); // Haha, Star star!
```
That said, in C++, it's pretty unusual to store things like this. You're much better off usin... | Since this is an assignment, you might be best to ask your teacher/mentor as to what their intents are for using a `void*` type in C++; `void*` types are not inherently *bad*, but there other ways of achieving similar results while maintaining language consistency.
To answer directly:
>
> I want to know some way of ... |
26,955,033 | if I have a program like this:
```
int i = 0;
int status;
bool result = true;
for(i = 0; i < numfiles; i++) { // LOOP 1
if (fork() == 0) {/* Child */
if (substLines(s1, s2, filenames[i])) {
exit(0);
} else {
exit(2);
}
}
}
... | 2014/11/16 | [
"https://Stackoverflow.com/questions/26955033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/604114/"
] | The [man page of wait](http://linux.die.net/man/3/wait) says
>
> If a child has already changed state, then these calls return immediately. Otherwise they block until either a child changes state or a signal handler interrupts the call
>
>
>
so question1 doesn't matter
and question2, the answer is no.
Concurren... | Just an addition to @simon\_xia's excellent answer.
A killed or exited process becomes a `zombie` until its parent calls `wait` for it. And yes, this is the official terminology. :-) In zombie state everything is cleaned up (memory pages, open files, env, etc), just the exit status or killing signal number are kept. |
2,036,441 | My attempt: Since $R$ is not a field, there must be a nonzero element $a$ in $R$ that is not a unit. Let $I=(a,X)$, and we try to show that this ideal is not principal. Since $R$ is an integral domain, then $I=\left\{af(X)+cg(X): f(X),g(X)\in R[X]\right\}$. Suppose it has a generator $h(X)$, then $I=(h(X))$. Since $a\i... | 2016/11/29 | [
"https://math.stackexchange.com/questions/2036441",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/213139/"
] | Typically, one then argues that $h(X)$ must be constant by degree considerations (since $R$ is a domain), and then argues a bit more to deduce the desired claim. However, I will suggest an easier route: note that the principal ideal $(X)$ is prime, since $R[X]/(X) \cong R$, but is not maximal, since $R$ is not a field.... | As $R$ is a domain, the degree of a product of polynomials is the sum of the factor degrees. Using $h(X)\mid a$, this tells us $\deg h\le \deg a=0$, hence $h$ is a constant. But then from $h(X)\mid X$, the leading coefficient of $h$ must divide the leading coefficient of $X$, i.e., the leading coefficient of $h$ - whic... |
24,131,396 | I need to find out the most recently added blob files to the blob storage. Is there a timestamp associated with each blob file? If not, what's the best way (for easy retrieval) to add it? | 2014/06/10 | [
"https://Stackoverflow.com/questions/24131396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/458969/"
] | Look at the `LastModified` property of the `BlobProperties` class in the `ICloudBlob` object that is returned by the `GetBlobReferenceFromServer` methods of the `CloudBlobContainer`. That will give you the timestamp you are looking for. | Solution was based on above solution provided by @Lukkha only .
PSB the solution where I used a dictionary with name of blob as key and DateStamp as Value.(K-V pair)
```
blob_service = BlockBlobService(account_name=account, account_key=key, endpoint_suffix=domain)
generator = blob_service.list_blobs(container_name=con... |
1,453,278 | I don't know how to proceed in this question. What I know is that the perimeter is the sum of all the sides. | 2015/09/27 | [
"https://math.stackexchange.com/questions/1453278",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/267950/"
] | No, we don't.
Taylor's theorem states that
$$f(x)=f(a)+\frac {f'(a)}{1!} (x-a)+ \frac{f''(a)}{2!} (x-a)^2+\ldots+\frac{f^{(n)}(a)}{n!}(x-a)^n+ R\_n(x)$$
where quite a few things can be said about $R\_n(x)$, for example
$$ \lim\_{x\to a}\frac{R\_n(x)}{(x-a)^n}=0$$
or
$$ \forall x\exists \xi\colon (a<\xi<x\lor x<\xi<a)\... | The way you state this is to imprecise to give a proof. The correct statement is that $$f(x) =\sum\_{k=0}^N \frac{f^{(k)}(0)}{k!}x^k +r\_N(x,\ldots)$$
Without the last term, the so called remainder (for which various different expressions are known, see [this page](https://en.wikipedia.org/wiki/Taylor's_theorem), the s... |
1,453,278 | I don't know how to proceed in this question. What I know is that the perimeter is the sum of all the sides. | 2015/09/27 | [
"https://math.stackexchange.com/questions/1453278",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/267950/"
] | No, we don't.
Taylor's theorem states that
$$f(x)=f(a)+\frac {f'(a)}{1!} (x-a)+ \frac{f''(a)}{2!} (x-a)^2+\ldots+\frac{f^{(n)}(a)}{n!}(x-a)^n+ R\_n(x)$$
where quite a few things can be said about $R\_n(x)$, for example
$$ \lim\_{x\to a}\frac{R\_n(x)}{(x-a)^n}=0$$
or
$$ \forall x\exists \xi\colon (a<\xi<x\lor x<\xi<a)\... | Take a look at chapters 7 and 11 (Specially section 11.9) of the well-known book:
Calculus, Vol. 1: One-Variable Calculus, with an Introduction to Linear Algebra
by Tom. M. Apostol.
There is a rigorous study of Taylor polynomials and series in those chapters. |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | Here is some ansible jinja2 template info for automating the build of a cluster with the 0.0.0.0 hostname in zoo.cfg
```
{% for url in zookeeper_hosts_list %}
{%- set url_host = url.split(':')[0] -%}
{%- if url_host == ansible_fqdn or url_host in ansible_all_ipv4_addresses -%}
server.{{loop.index0}}=0.0.0.0:28... | We faced the same issue , for our case the root cause of the problem is too-many number of client connections . The default ulimit on aws ec2 instance is 1024 and this causes zookeeper nodes not able to communicate with each other .
The fix for this is
change the ulimit to a higher number -> (> ulimit -n 20000 )
sto... |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | How have defined the ip of the local server in each node? If you have given the public ip, then the listener would have failed to connect to the port. You must specify 0.0.0.0 for the current node
```
server.1=0.0.0.0:2888:3888
server.2=192.168.10.10:2888:3888
server.3=192.168.2.1:2888:3888
```
This change must be ... | I had the same error log, in my case, i use hostname of my node in `zookeeper.conf`.
My nodes were on virtual machine in **Centos 8**.
Like @user2286693 said, my mistake was the resolution mechanism:
Since `node1`, when I ping node1:
```
PING node1(localhost (::1)) 56 data bytes
```
I check my `/etc/hosts` file a... |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | I met the save question and solved it.
make sure the myid is the save with your configuration in the zoo.cfg.
please check your zoo.cfg file in your `conf` directory, which contains such content.
```
server.1=zookeeper1:2888:3888
server.2=zookeeper2:2888:3888
server.3=zookeeper3:2888:3888
```
and check the m... | In mycase, the issue was, I had to start all the three zookeeper servers, Only then I was able to connect to zookeeper server using `./zkCli.sh` |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | If your own hostname resolves to 127.0.0.1 (In my case, the hostname was in /etc/hosts), zookeeper won't start up without having 0.0.0.0 in the zoo.cfg file, but if your hostname resolves to the actual machine's IP, you can put it's own hostname in the config file. | Had similar issues on a 3-Node zookeeper ensemble.
Solution was as advised by espeirasbora and restarted.
So this was what I did
zookeeper1,zookeeper2 and zookeeper3
**A. Issue** :: znodes in my ensemble could not start
**B. System SetUp** ::
3 Znodes in three 3 machines
**C. Error::**
In my zookeper log file ... |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | How have defined the ip of the local server in each node? If you have given the public ip, then the listener would have failed to connect to the port. You must specify 0.0.0.0 for the current node
```
server.1=0.0.0.0:2888:3888
server.2=192.168.10.10:2888:3888
server.3=192.168.2.1:2888:3888
```
This change must be ... | Adding additional info regarding Zookeeper clustering inside Amazon's VPC.
Solution with '0.0.0.0' is working in case of Zookeeper running **directly** inside EC2 instance, in case when you are using docker '0.0.0.0' will not work properly with Zookeeper 3.5.X after node restart.
The issue lies in resolving '0.0.0.0' ... |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | I had the same error log, in my case, i use hostname of my node in `zookeeper.conf`.
My nodes were on virtual machine in **Centos 8**.
Like @user2286693 said, my mistake was the resolution mechanism:
Since `node1`, when I ping node1:
```
PING node1(localhost (::1)) 56 data bytes
```
I check my `/etc/hosts` file a... | I got the same because the quorum server port 3181 was still used by another service - changing the port fixed it |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | In mycase, the issue was, I had to start all the three zookeeper servers, Only then I was able to connect to zookeeper server using `./zkCli.sh` | We faced the same issue , for our case the root cause of the problem is too-many number of client connections . The default ulimit on aws ec2 instance is 1024 and this causes zookeeper nodes not able to communicate with each other .
The fix for this is
change the ulimit to a higher number -> (> ulimit -n 20000 )
sto... |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | If your own hostname resolves to 127.0.0.1 (In my case, the hostname was in /etc/hosts), zookeeper won't start up without having 0.0.0.0 in the zoo.cfg file, but if your hostname resolves to the actual machine's IP, you can put it's own hostname in the config file. | I had a similar issue. The status on 2 of my three zookeeper nodes was listed as "standalone", even though the zoo.cfg file indicated that it should be clustered. My third node couldn't start, with the error you described. I think what fixed it for me was running `zkServer.sh start` in quick succession across my three ... |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | I met the save question and solved it.
make sure the myid is the save with your configuration in the zoo.cfg.
please check your zoo.cfg file in your `conf` directory, which contains such content.
```
server.1=zookeeper1:2888:3888
server.2=zookeeper2:2888:3888
server.3=zookeeper3:2888:3888
```
and check the m... | When you are having this issue, you will see something like this:
```
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
at org.apache.zookeeper.KeeperException.create(KeeperException.java:99) ~[zookeeper-3.4.6.jar:3.4.6-1569965]
```
This indicates a network communicatio... |
30,941,033 | I currently have a situation where I have to find the next value after my current move.
Currently I have below:
```
SELECT CONVERT(CHAR(17), PlannedStartDateUTC,13)
FROM VisitMovement VM
WHERE vm.VisitMovement_GUID = (SELECT VM2.VisitMovement_GUID
FROM VisitMovement VM2
... | 2015/06/19 | [
"https://Stackoverflow.com/questions/30941033",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2492835/"
] | If your own hostname resolves to 127.0.0.1 (In my case, the hostname was in /etc/hosts), zookeeper won't start up without having 0.0.0.0 in the zoo.cfg file, but if your hostname resolves to the actual machine's IP, you can put it's own hostname in the config file. | We faced the same issue , for our case the root cause of the problem is too-many number of client connections . The default ulimit on aws ec2 instance is 1024 and this causes zookeeper nodes not able to communicate with each other .
The fix for this is
change the ulimit to a higher number -> (> ulimit -n 20000 )
sto... |
55,746 | Fix a universe $\mathcal{U}$. Call a category $\mathcal{U}$-complete if every diagram indexed by a $\mathcal{U}$-small category has a limit, and a functor $\mathcal{U}$-continuous if it preserves $\mathcal{U}$-small limits. Usually, when one fixes a universe, one calls this simply complete and continuous.
Now assume w... | 2011/02/17 | [
"https://mathoverflow.net/questions/55746",
"https://mathoverflow.net",
"https://mathoverflow.net/users/2841/"
] | For a martingale $M\_n$ with bounded increment, then, almost surely :
* either $M\_n$ converges to a finite limite.
* or $\limsup M\_n=\infty$ and $\liminf M\_n=-\infty$.
Sketch of the proof. One can assume that $M\_0=0$. Let $T$ be the first time at which the martingale goes below $-A$. Then $M\_{n \wedge N}$ is a m... | For the second part of the question: it depends on the mean and variance you have.
Let $X\_t=M\_t+Y\_t$ where $M\_t$ is a martingale and $Y\_t$ is predictable. Let $\mu\_t=\mathbb E[X\_t]=\mathbb E[Y\_t]$ and $\sigma\_t^2=\sum\_{s\le t}\mathbb E[(M\_s-M\_{s-1})^2|M\_1,\ldots,M\_{s-1}]$. By martingale central limit the... |
18,344,537 | I just saw this for the first time. The source code I'm looking at is in C
```
if( rate < 0.){
...
}
else{
...
}
```
What happens if `rate=0` ? | 2013/08/20 | [
"https://Stackoverflow.com/questions/18344537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2701366/"
] | `0.` is a literal of type `double` (and value zero). By contrast, `0` is a literal of type `int`. | It is interpreting `0.` as a double (`0.0`) instead of an integer (`0`).
Check the link: of ["working code"](http://codepad.org/LdSzUu5Y), showing the different sizes of various types of zero constants: |
18,344,537 | I just saw this for the first time. The source code I'm looking at is in C
```
if( rate < 0.){
...
}
else{
...
}
```
What happens if `rate=0` ? | 2013/08/20 | [
"https://Stackoverflow.com/questions/18344537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2701366/"
] | It is interpreting `0.` as a double (`0.0`) instead of an integer (`0`).
Check the link: of ["working code"](http://codepad.org/LdSzUu5Y), showing the different sizes of various types of zero constants: | `0.` is a *floating constant* and since it does not have a suffix it is a `double`, from the [draft C99 standard](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf) section `6.4.4.2` *Floating constants* we have the following grammar:
```
floating-constant:
decimal-floating-constant
hexadecimal-floating... |
18,344,537 | I just saw this for the first time. The source code I'm looking at is in C
```
if( rate < 0.){
...
}
else{
...
}
```
What happens if `rate=0` ? | 2013/08/20 | [
"https://Stackoverflow.com/questions/18344537",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2701366/"
] | `0.` is a literal of type `double` (and value zero). By contrast, `0` is a literal of type `int`. | `0.` is a *floating constant* and since it does not have a suffix it is a `double`, from the [draft C99 standard](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf) section `6.4.4.2` *Floating constants* we have the following grammar:
```
floating-constant:
decimal-floating-constant
hexadecimal-floating... |
19,304,259 | I've recently posted a question about reducing the timeout of an FTP connection ([click here to see it if you want](https://stackoverflow.com/questions/19292936/ios-how-to-reduce-an-ftp-connection-timeout)).
Now, I've been asked to post a more specific question, focusing on the component we're using for the FTP downlo... | 2013/10/10 | [
"https://Stackoverflow.com/questions/19304259",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1464327/"
] | Moving my comment to an answer (and see updates to the question for details):
I thought that the extension ID (the part right after chrome-extension://) was not user- or computer-specific and remained the same everywhere the Chrome extension is installed. | I'm successfully using the Datastore API from a Firefox extension. The trick is to attach the dropbox scripts to an actual webpage, not a local page. I have a blank page hosted on my server, and the extension opens that page and attached the necessary scripts. From there it redirects the user to the Dropbox authenticat... |
43,317,997 | Is there any reason why the command `until` was implemented into bash/shell (I'm still unsure which)? Is there anything you can't do with a negation on a `while` statement? Is it faster than using the `NOT` CPU function? - unlikely... | 2017/04/10 | [
"https://Stackoverflow.com/questions/43317997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6036665/"
] | Bash supports it because it conforms to POSIX - specifically, [IEEE Std 1003.1, 2004 Edition - Shell Command Language - The until Loop](http://pubs.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_09_04_11). The feature predates GNU, and GNU `bash` repo has it [since the 1st commit](http://git.savann... | Everything you can do with `until` can be done with `while`. Your code may be 1 character shorter thanks to this “optimization” and some interpreters *may* be slightly faster but it would be ridiculously insignificant compared to the rest to the code.
As far as I know this statement mostly exists because some language... |
43,317,997 | Is there any reason why the command `until` was implemented into bash/shell (I'm still unsure which)? Is there anything you can't do with a negation on a `while` statement? Is it faster than using the `NOT` CPU function? - unlikely... | 2017/04/10 | [
"https://Stackoverflow.com/questions/43317997",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6036665/"
] | Bash supports it because it conforms to POSIX - specifically, [IEEE Std 1003.1, 2004 Edition - Shell Command Language - The until Loop](http://pubs.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_09_04_11). The feature predates GNU, and GNU `bash` repo has it [since the 1st commit](http://git.savann... | The reason for such statement is not so much technical (indeed, a inverted `while` would have the same meaning) but semantic.
`until (condition) {do something}`
can be closer to natural language than
`while (not condition) {do something}`
This is especially true when the condition itself is expressed as a negative... |
766,810 | So far, I've made sure I've installed libpng and libjpeg with DarwinPorts (I'm running on OS X Leopard), but that doesn't seem to do the trick. I've read in a number of places that you need the development files (i.e. libpng-devel, etc.) as well to make this work. I'm a little lost. Can someone help me understand what ... | 2009/04/20 | [
"https://Stackoverflow.com/questions/766810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2484/"
] | This error indicates that the libpng.so or libpng.a file could not be found. These files are created when libpng is compiled.
I don't know much about the Mac OS X way of installing things, but if you want to do it the Mac OS X way, you'll probably need to find and install that libpng-devel package.
Otherwise, you'll ... | I believe MacPorts installs by default to /opt/local not /usr/local? Maybe try /opt/local instead?
If you have fink, here's what I'm currently using (so i know it works)
Here are the fink packages i have installed.
```
i libpng3 1:1.2.29-1 PNG image format handling library
i libpng3-shlibs 1:1.2.29-1 Shared ... |
44,212,648 | I started downloading Visual Studio for offline installation using layout switch. When the installation was 19.1Go, I closed the console and the download got stopped. Today I restarted it in the same folder (where previous files were) thinking it would continue. However, from what I see, it simply overwrites the previo... | 2017/05/27 | [
"https://Stackoverflow.com/questions/44212648",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | simple retype the command after opening command prompt in my case it was `vs_community.exe --layout c:\vs2017layout --lang en-US`
**NOTE directory should be same as previous**
it first verify the previously downloaded packages and then resumed the downloading here are some logs
```
Verified existing package 'Microsoft... | Yes , now we can resume the offline installation. Latest installer Verifies the files if directory is unchanged and Resumes from there But they should provide torrent links of at least VS community edition, it is more reliable especially if files are multiple and are large in size. |
20,554,946 | I'm trying to update an arrowHelper. I've tried manipulating the vertices in the arrow object's line, setting everything `dynamic = true` and so on, but the only way I can seem to do it is by removing the old line and drawing a new one. Is there a way to update an arrowHelper? | 2013/12/12 | [
"https://Stackoverflow.com/questions/20554946",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/738675/"
] | So you can't update an arrowHelper per se in the usual way you update something, by changing the values you used to create the object.
However: you can move the arrow's position, which moves its apparent start point, and you can give it a new direction and length, which moves its apparent end point.
Here's how to do ... | Thanks to the folks who answered this question, it certainly helped me. There are a couple of small problems with it that folks will want to avoid:
Calling direction.normalize() in the penultimate line of code changes the direction vector to a unit vector and thus the original length is lost. You can change the order ... |
22,617,280 | Working on a project, where i started on the navbar. The thing i am wondering if its possible to add my own icons right next to each of the menu bars ? For example this icons: <https://www.dropbox.com/sh/0be3c7ub4245kd6/zNMrvFi6Wq>
Like this:

* [DE... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22617280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3270211/"
] | You can either use font awesome or the bootstrap glyph icons. Just add something like this before the text for a glyphicon:
```
<span class="glyphicon glyphicon-search"></span>
```
Or this for font awesome
```
<span class="fa fa-search"></span>
```
Or you can create your image icons and create css classes for you... | Here's a way to do it without adding any additional markup, though you do need to add unique classes to each of the anchor links.
CSS:
```
.navbar-default .navbar-nav>.active>a:before,
.navbar-nav>li>a:before {
background-repeat: no-repeat;
background-position: 0 top;
content: "";
display: inline-bloc... |
22,617,280 | Working on a project, where i started on the navbar. The thing i am wondering if its possible to add my own icons right next to each of the menu bars ? For example this icons: <https://www.dropbox.com/sh/0be3c7ub4245kd6/zNMrvFi6Wq>
Like this:

* [DE... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22617280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3270211/"
] | You can either use font awesome or the bootstrap glyph icons. Just add something like this before the text for a glyphicon:
```
<span class="glyphicon glyphicon-search"></span>
```
Or this for font awesome
```
<span class="fa fa-search"></span>
```
Or you can create your image icons and create css classes for you... | Ok @TrevorOrr answer for Bootstrap standard glyphs, but remember to envelope `<span>` tag inside the `<a>` tag. Example:
```
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-left">
<li><a href="#">Envelope icon: <... |
22,617,280 | Working on a project, where i started on the navbar. The thing i am wondering if its possible to add my own icons right next to each of the menu bars ? For example this icons: <https://www.dropbox.com/sh/0be3c7ub4245kd6/zNMrvFi6Wq>
Like this:

* [DE... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22617280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3270211/"
] | You can either use font awesome or the bootstrap glyph icons. Just add something like this before the text for a glyphicon:
```
<span class="glyphicon glyphicon-search"></span>
```
Or this for font awesome
```
<span class="fa fa-search"></span>
```
Or you can create your image icons and create css classes for you... | I had a similar problem, but the solution picked here didn't work. I had to mash the two answers together for it to work, that is, apply background attributes to a `<span class="icone icone-custom pull-right">` nested within the `<a>`. No `:before`. |
22,617,280 | Working on a project, where i started on the navbar. The thing i am wondering if its possible to add my own icons right next to each of the menu bars ? For example this icons: <https://www.dropbox.com/sh/0be3c7ub4245kd6/zNMrvFi6Wq>
Like this:

* [DE... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22617280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3270211/"
] | Here's a way to do it without adding any additional markup, though you do need to add unique classes to each of the anchor links.
CSS:
```
.navbar-default .navbar-nav>.active>a:before,
.navbar-nav>li>a:before {
background-repeat: no-repeat;
background-position: 0 top;
content: "";
display: inline-bloc... | Ok @TrevorOrr answer for Bootstrap standard glyphs, but remember to envelope `<span>` tag inside the `<a>` tag. Example:
```
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-left">
<li><a href="#">Envelope icon: <... |
22,617,280 | Working on a project, where i started on the navbar. The thing i am wondering if its possible to add my own icons right next to each of the menu bars ? For example this icons: <https://www.dropbox.com/sh/0be3c7ub4245kd6/zNMrvFi6Wq>
Like this:

* [DE... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22617280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3270211/"
] | Here's a way to do it without adding any additional markup, though you do need to add unique classes to each of the anchor links.
CSS:
```
.navbar-default .navbar-nav>.active>a:before,
.navbar-nav>li>a:before {
background-repeat: no-repeat;
background-position: 0 top;
content: "";
display: inline-bloc... | I had a similar problem, but the solution picked here didn't work. I had to mash the two answers together for it to work, that is, apply background attributes to a `<span class="icone icone-custom pull-right">` nested within the `<a>`. No `:before`. |
22,617,280 | Working on a project, where i started on the navbar. The thing i am wondering if its possible to add my own icons right next to each of the menu bars ? For example this icons: <https://www.dropbox.com/sh/0be3c7ub4245kd6/zNMrvFi6Wq>
Like this:

* [DE... | 2014/03/24 | [
"https://Stackoverflow.com/questions/22617280",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3270211/"
] | Ok @TrevorOrr answer for Bootstrap standard glyphs, but remember to envelope `<span>` tag inside the `<a>` tag. Example:
```
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-left">
<li><a href="#">Envelope icon: <... | I had a similar problem, but the solution picked here didn't work. I had to mash the two answers together for it to work, that is, apply background attributes to a `<span class="icone icone-custom pull-right">` nested within the `<a>`. No `:before`. |
51,165,528 | I am using Powershell to determine the password expiry date for domain accounts. I have used the following command to get this information:
`Get-ADUser -Filter {SamAccountName -eq "<username>"} -Properties "DisplayName" , "msDS-UserPasswordExpiryTimeComputed"`
I then covert this value to a meaningful date by using:
... | 2018/07/04 | [
"https://Stackoverflow.com/questions/51165528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8148945/"
] | The [documentation](https://msdn.microsoft.com/en-us/library/cc223410.aspx) lists *several* conditions in which `msDS-UserPasswordExpiryTimeComputed` returns `9223372036854775807` aka `0x7fffffffffffffff` aka `[int64]::MaxValue` (`TO` refers to a given *t*arget *o*bject):
>
> If any of the `ADS_UF_SMARTCARD_REQUIRED`... | I don't have a DC at the moment to test but theoretically this can work.
1. Get the Password Policy of the domain with `Get-ADDefaultDomainPasswordPolicy -Identity Domain.com`
2. Get the `passwordLastSet` property of a user like this: `(Get-ADUser -Identity <UserName> -Properties *).PasswordlastSet` and convert to app... |
42,542,790 | consider the below dataframe -df
```
one two three four five six seven eight
0 0.1 1.1 2.2 3.3 3.6 4.1 0.0 0.0
1 0.1 2.1 2.3 3.2 3.7 4.3 0.0 0.0
2 1.6 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3 0.1 1.2 2.5 3.7 4.4 0.0 0.0 0.0
4 1.7 2.1 0.0 0.0 ... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42542790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4695774/"
] | You can do the following in short:
```
df.eq(3.2).any(axis=1) & ~df.isin([0.1, 1.2]).any(axis=1)
```
Or here more explicitly:
```
contains = df.eq(3.2).any(axis=1)
not_contains = ~df.isin([0.1,1.2]).any(axis=1)
print(df[contains & not_contains])
one two three four five six seven eight
5 2.... | You could just combine the conditions.
```
>>> df[(df == 3.2).any(1) & ~df.isin([0.1, 1.2]).any(1)]
one two three four five six seven eight
5 2.1 3.2 0.0 0.0 0.0 0.0 0.0 0.0
6 2.1 2.3 3.2 4.3 0.0 0.0 0.0 0.0
``` |
42,542,790 | consider the below dataframe -df
```
one two three four five six seven eight
0 0.1 1.1 2.2 3.3 3.6 4.1 0.0 0.0
1 0.1 2.1 2.3 3.2 3.7 4.3 0.0 0.0
2 1.6 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3 0.1 1.2 2.5 3.7 4.4 0.0 0.0 0.0
4 1.7 2.1 0.0 0.0 ... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42542790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4695774/"
] | For performance, specially since you mentioned large dataset and if you are looking to exclude just two numbers, here's one approach with array data -
```
a = df.values
df_out = df.iloc[(a == 3.2).any(1) & (((a!=0.1) & (a!=1.2)).all(1))]
```
Sample run -
```
In [43]: a = df.values
In [44]: df.iloc[(a == 3.2).any(1... | You can do the following in short:
```
df.eq(3.2).any(axis=1) & ~df.isin([0.1, 1.2]).any(axis=1)
```
Or here more explicitly:
```
contains = df.eq(3.2).any(axis=1)
not_contains = ~df.isin([0.1,1.2]).any(axis=1)
print(df[contains & not_contains])
one two three four five six seven eight
5 2.... |
42,542,790 | consider the below dataframe -df
```
one two three four five six seven eight
0 0.1 1.1 2.2 3.3 3.6 4.1 0.0 0.0
1 0.1 2.1 2.3 3.2 3.7 4.3 0.0 0.0
2 1.6 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3 0.1 1.2 2.5 3.7 4.4 0.0 0.0 0.0
4 1.7 2.1 0.0 0.0 ... | 2017/03/01 | [
"https://Stackoverflow.com/questions/42542790",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4695774/"
] | For performance, specially since you mentioned large dataset and if you are looking to exclude just two numbers, here's one approach with array data -
```
a = df.values
df_out = df.iloc[(a == 3.2).any(1) & (((a!=0.1) & (a!=1.2)).all(1))]
```
Sample run -
```
In [43]: a = df.values
In [44]: df.iloc[(a == 3.2).any(1... | You could just combine the conditions.
```
>>> df[(df == 3.2).any(1) & ~df.isin([0.1, 1.2]).any(1)]
one two three four five six seven eight
5 2.1 3.2 0.0 0.0 0.0 0.0 0.0 0.0
6 2.1 2.3 3.2 4.3 0.0 0.0 0.0 0.0
``` |
67,412 | What is the train route from Charles de Gaulle airport to Calais? I see that there is a train station inside the airport. Is there only one station or many? If there are many stations please let me know the station name and the train to board and the route.
I hope the train is the cheapest and best mode to travel from... | 2016/04/27 | [
"https://travel.stackexchange.com/questions/67412",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/42854/"
] | As chx pointed out, you will need to clarify what "best" is. Cheaper? Faster? Most convenient? Most frequent?
I'll concentrate on the train part.
There are two train stations in CDG:
* "**Aéroport Charles de Gaulle 1**" is only served by the "**RER**" (suburban train / express metro). It is located in "Roissypôle", ... | The train station is located in Terminal 2 (between 2D and 2F).
Not sure if the train will be the cheapest way to go to Calais. The bus or a shared car might be cheaper (but also take more time).
For instance, with the bus, you can get to Lille from CDG for just 9€ :
<http://uk.ouibus.com>
Then from Lille to Calais,... |
67,412 | What is the train route from Charles de Gaulle airport to Calais? I see that there is a train station inside the airport. Is there only one station or many? If there are many stations please let me know the station name and the train to board and the route.
I hope the train is the cheapest and best mode to travel from... | 2016/04/27 | [
"https://travel.stackexchange.com/questions/67412",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/42854/"
] | [Rome2Rio says that you can get a Eurolines bus from Paris CDG to Calais.](http://www.rome2rio.com/s/Paris-CDG-Airport-CDG/Calais) The journey lasts approximately 5 hours and is significantly cheaper than the train. Below is a screenshot from Rome2Rio:
[.
Not sure if the train will be the cheapest way to go to Calais. The bus or a shared car might be cheaper (but also take more time).
For instance, with the bus, you can get to Lille from CDG for just 9€ :
<http://uk.ouibus.com>
Then from Lille to Calais,... |
67,412 | What is the train route from Charles de Gaulle airport to Calais? I see that there is a train station inside the airport. Is there only one station or many? If there are many stations please let me know the station name and the train to board and the route.
I hope the train is the cheapest and best mode to travel from... | 2016/04/27 | [
"https://travel.stackexchange.com/questions/67412",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/42854/"
] | You'll need to decide your price / time balance. You can save money by taking the bus but it's slower than by train.
As mentioned you can take the train directly from CDG Terminal 2. Some require a change, or even change between two different stations, in Lille. Details here [Voyages-SNCF](http://www.voyages-sncf.com/... | The train station is located in Terminal 2 (between 2D and 2F).
Not sure if the train will be the cheapest way to go to Calais. The bus or a shared car might be cheaper (but also take more time).
For instance, with the bus, you can get to Lille from CDG for just 9€ :
<http://uk.ouibus.com>
Then from Lille to Calais,... |
67,412 | What is the train route from Charles de Gaulle airport to Calais? I see that there is a train station inside the airport. Is there only one station or many? If there are many stations please let me know the station name and the train to board and the route.
I hope the train is the cheapest and best mode to travel from... | 2016/04/27 | [
"https://travel.stackexchange.com/questions/67412",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/42854/"
] | As chx pointed out, you will need to clarify what "best" is. Cheaper? Faster? Most convenient? Most frequent?
I'll concentrate on the train part.
There are two train stations in CDG:
* "**Aéroport Charles de Gaulle 1**" is only served by the "**RER**" (suburban train / express metro). It is located in "Roissypôle", ... | [Rome2Rio says that you can get a Eurolines bus from Paris CDG to Calais.](http://www.rome2rio.com/s/Paris-CDG-Airport-CDG/Calais) The journey lasts approximately 5 hours and is significantly cheaper than the train. Below is a screenshot from Rome2Rio:
[. It is located in "Roissypôle", ... | You'll need to decide your price / time balance. You can save money by taking the bus but it's slower than by train.
As mentioned you can take the train directly from CDG Terminal 2. Some require a change, or even change between two different stations, in Lille. Details here [Voyages-SNCF](http://www.voyages-sncf.com/... |
2,723,765 | I'm trying to parse an HTTP GET request to determine if the url contains any of a number of file types. If it does, I want to capture the entire request. There is something I don't understand about ORing.
The following regular expression only captures part of it, and only if .flv is the first int the list of ORd value... | 2010/04/27 | [
"https://Stackoverflow.com/questions/2723765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/327105/"
] | You have your grouping wrong. The `|` needs to be inside the parentheses:
```
GET.*?(\.flv|\.mp4|\.avi).*?
```
I'm also not sure why you have the `?` on the end of the final `.*?`. In most languages, the ? here makes the \* non-greedy, so it matches as few characters as possible, while not preventing the pattern fro... | First of all, your regex reads like this:
```
GET.*?(\.flv) | (\.mp4) | (\.avi).*?
```
(spaces added for clarity). Try it like this:
```
GET.*?(\.flv|\.mp4|\.avi).*?
``` |
16,888 | I am trying to setup jenkins and run build using maven, but I am getting an error, because maven is executing build with java source 1.5. I have mentioned the source and target in pom.xml as 1.7 still it is executing with source 1.5.
```
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-co... | 2016/02/08 | [
"https://sqa.stackexchange.com/questions/16888",
"https://sqa.stackexchange.com",
"https://sqa.stackexchange.com/users/15345/"
] | 1. Run the application on an emulator, it should give you a way to define location
2. Ask the developer to allow you to inject mock locations through some sort of API
2.1 Mocking can be done at the app level- i.e. don't read the location from the GPS
2.2 You did not mention a platform, but Android and I suppose iOS t... | @Talya Ostrovsky Lit -
1) You can use some application which can change your location, easily available on Google app store. or you can search some more application
such as "hola"
2) Or you can you simulator and emulator for such testing. |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | There is no way to prevent request forgery while under a clickjacking attack. No CSRF defense exists that can withstand a clickjacking attack, because there is no way to distinguish a real click from a fake click on the client side.
OWASP [mentions in their CRSF prevention spreadsheet](https://www.owasp.org/index.php/... | **--UPDATE--**
When you say "widget", if you mean something outside of your application that un-authenticated people interact with then disregard this answer. I reread your question and you never really state what you mean by "widget". We have all kinds of "widgets" that are with in our application. I thought that's wh... |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | Clicking on the widget needs to open a pop-up window containing a new page -- an iframe is not good enough, it must be a new window -- which is entirely under the control of your web application. Confirm the action, whatever it is, on that page.
Yes, this is somewhat inelegant, but the present Web security architectur... | I think I understand what you're doing. You want to allow any site to iframe your widget, thus an attacker has complete control of the parent's source code and can create clickjacking routines to force users to click the widget.
So the iframe would be able to employ a CSRF token, as it should, which will protect from ... |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | There is no way to prevent request forgery while under a clickjacking attack. No CSRF defense exists that can withstand a clickjacking attack, because there is no way to distinguish a real click from a fake click on the client side.
OWASP [mentions in their CRSF prevention spreadsheet](https://www.owasp.org/index.php/... | I think I understand what you're doing. You want to allow any site to iframe your widget, thus an attacker has complete control of the parent's source code and can create clickjacking routines to force users to click the widget.
So the iframe would be able to employ a CSRF token, as it should, which will protect from ... |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | There is no good programmable [solution on clickjacking](http://podlipensky.com/2012/07/clickjacking-explained/). Some companies sue spammers as a defense to clickjacking. Others choose to show popup windows once user clicked inside iframe, although it degrades user experience, especially in case of single-click-button... | **--UPDATE--**
When you say "widget", if you mean something outside of your application that un-authenticated people interact with then disregard this answer. I reread your question and you never really state what you mean by "widget". We have all kinds of "widgets" that are with in our application. I thought that's wh... |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | Clicking on the widget needs to open a pop-up window containing a new page -- an iframe is not good enough, it must be a new window -- which is entirely under the control of your web application. Confirm the action, whatever it is, on that page.
Yes, this is somewhat inelegant, but the present Web security architectur... | There is no way to prevent request forgery while under a clickjacking attack. No CSRF defense exists that can withstand a clickjacking attack, because there is no way to distinguish a real click from a fake click on the client side.
OWASP [mentions in their CRSF prevention spreadsheet](https://www.owasp.org/index.php/... |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | There is no way to prevent request forgery while under a clickjacking attack. No CSRF defense exists that can withstand a clickjacking attack, because there is no way to distinguish a real click from a fake click on the client side.
OWASP [mentions in their CRSF prevention spreadsheet](https://www.owasp.org/index.php/... | >
> Because of CSRF you must be within an iframe...
>
>
>
No. You cannot remediate CSRF with form cookies and other nonce tricks. It does not matter where you put them.
>
> So there is a duality, it seems you are stuck between CSRF
> and Clickjacking. What the best solution (if any) to this problem?
>
>
>
T... |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | Clicking on the widget needs to open a pop-up window containing a new page -- an iframe is not good enough, it must be a new window -- which is entirely under the control of your web application. Confirm the action, whatever it is, on that page.
Yes, this is somewhat inelegant, but the present Web security architectur... | There is no good programmable [solution on clickjacking](http://podlipensky.com/2012/07/clickjacking-explained/). Some companies sue spammers as a defense to clickjacking. Others choose to show popup windows once user clicked inside iframe, although it degrades user experience, especially in case of single-click-button... |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | There is no way to prevent request forgery while under a clickjacking attack. No CSRF defense exists that can withstand a clickjacking attack, because there is no way to distinguish a real click from a fake click on the client side.
OWASP [mentions in their CRSF prevention spreadsheet](https://www.owasp.org/index.php/... | There is no good programmable [solution on clickjacking](http://podlipensky.com/2012/07/clickjacking-explained/). Some companies sue spammers as a defense to clickjacking. Others choose to show popup windows once user clicked inside iframe, although it degrades user experience, especially in case of single-click-button... |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | Clicking on the widget needs to open a pop-up window containing a new page -- an iframe is not good enough, it must be a new window -- which is entirely under the control of your web application. Confirm the action, whatever it is, on that page.
Yes, this is somewhat inelegant, but the present Web security architectur... | **--UPDATE--**
When you say "widget", if you mean something outside of your application that un-authenticated people interact with then disregard this answer. I reread your question and you never really state what you mean by "widget". We have all kinds of "widgets" that are with in our application. I thought that's wh... |
7,328,307 | I have a service with a content observer watching the calendar provider and there are some instances where i need to stop the service so the observer's `onchange` does not get called when adding an event and then restart the service when it is added.
In my activity I use `stopService(new Intent(context,Service.class))... | 2011/09/07 | [
"https://Stackoverflow.com/questions/7328307",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/599346/"
] | There is no good programmable [solution on clickjacking](http://podlipensky.com/2012/07/clickjacking-explained/). Some companies sue spammers as a defense to clickjacking. Others choose to show popup windows once user clicked inside iframe, although it degrades user experience, especially in case of single-click-button... | I think I understand what you're doing. You want to allow any site to iframe your widget, thus an attacker has complete control of the parent's source code and can create clickjacking routines to force users to click the widget.
So the iframe would be able to employ a CSRF token, as it should, which will protect from ... |
48,896,382 | ```
import subprocess
command = r'C:\Windows\system32\windowspowershell\v1.0\powershell.exe -noe -c ". \"C:\Program Files\VMware\VMware View\Server\extras\PowerShell\add-snapin.ps1\""'
command2 = 'Get-PoolEntitlement -pool_id gameserver2 | Remove-
PoolEntitlement'
output = subprocess.getoutput(command)
output = subpro... | 2018/02/21 | [
"https://Stackoverflow.com/questions/48896382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7293493/"
] | It is more complex than just MangoDB or not.
Tendermint is BFT in the partially synchronous way, it means that sometimes the network is totally asynchronous, but eventually, we will have a perfect window of synchronism. Tendermint is a Blockchain in a sense that there is blocks where members agree on. There is rounds,... | Tendermint is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine, written in any programming language, and securely replicates it on many machines. HashGraph on the other hand is an Asynchronous BFT based consensus algorithm that follows gossip to gossip protocol for achieving consensus amo... |
48,896,382 | ```
import subprocess
command = r'C:\Windows\system32\windowspowershell\v1.0\powershell.exe -noe -c ". \"C:\Program Files\VMware\VMware View\Server\extras\PowerShell\add-snapin.ps1\""'
command2 = 'Get-PoolEntitlement -pool_id gameserver2 | Remove-
PoolEntitlement'
output = subprocess.getoutput(command)
output = subpro... | 2018/02/21 | [
"https://Stackoverflow.com/questions/48896382",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7293493/"
] | It is more complex than just MangoDB or not.
Tendermint is BFT in the partially synchronous way, it means that sometimes the network is totally asynchronous, but eventually, we will have a perfect window of synchronism. Tendermint is a Blockchain in a sense that there is blocks where members agree on. There is rounds,... | BigchainDB 2.0 uses MongoDB and Tendermint, not Hashgraph.
Tendermint is based on a BFT consensus protocol from 1988 (with improvements). It has some similarities with PBFT, but isn't the same.
Hashgraph is quite new and works *very* differently. |
22,078,501 | In previous versions of Idea, if I had the "development" or "production" Maven profiles checked, whenever I ran my unit tests, IntelliJ IDEA did not actually use these profiles. Instead, it didn't use any of them.
Since I am developing a Spring-based application, I use 3 profiles to configure various things, but mostl... | 2014/02/27 | [
"https://Stackoverflow.com/questions/22078501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/331439/"
] | I think `click at` stopped working in 10.9. Or at least
```
tell application "System Events" to tell process "Safari"
set frontmost to true
click at {20, 20}
end tell
```
works for me in 10.8 but results in an error like `error "System Events got an error: Can’t make {20, 20} into type list." number -1700 fr... | I just answered a quite similar problem with s.o. trying to "click at desktop" ([here](https://apple.stackexchange.com/questions/219088/activate-desktop-using-applescript/220536#220536)) ...
System Events' sdef file says, that *"click at" still works **when sent to a "process" object** [at] the { x, y } location at w... |
33,170,983 | I'm trying to display image in HTML from MySql and PHP.
My ajax request
```
$.ajax({
type : "POST",
url : "jsonajax.php",
data : { id: id },
success : function(data){
alert(data);
$('#dialog').dialog('open');
$('#dialog').html('<img src='+ data + '" />');
}
});
```
... | 2015/10/16 | [
"https://Stackoverflow.com/questions/33170983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4988805/"
] | You need to add a datatype, like "Json" | try
```
JSON.parse(data)
```
this will decode the data |
33,170,983 | I'm trying to display image in HTML from MySql and PHP.
My ajax request
```
$.ajax({
type : "POST",
url : "jsonajax.php",
data : { id: id },
success : function(data){
alert(data);
$('#dialog').dialog('open');
$('#dialog').html('<img src='+ data + '" />');
}
});
```
... | 2015/10/16 | [
"https://Stackoverflow.com/questions/33170983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4988805/"
] | You need to add a datatype, like "Json" | Add `dataType:"json"`
```
$.ajax({
type : "POST",
dataType: "json",
url : "jsonajax.php",
data : { id: id },
success : function(data){
alert(data);
$('#dialog').dialog('open');
$('#dialog').html('<img src='+ data + '" />');
}
});
```
And then do `data.img_url` |
33,170,983 | I'm trying to display image in HTML from MySql and PHP.
My ajax request
```
$.ajax({
type : "POST",
url : "jsonajax.php",
data : { id: id },
success : function(data){
alert(data);
$('#dialog').dialog('open');
$('#dialog').html('<img src='+ data + '" />');
}
});
```
... | 2015/10/16 | [
"https://Stackoverflow.com/questions/33170983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4988805/"
] | You need to add a datatype, like "Json" | You need to convert the string response to an object - which will automagically remove the slashes :)
Option 1: Parse the data with `JSON.parse(data)`
Option 2: You can specify the `dataType: 'json'` option in your `$.ajax` request.
```
$.ajax({
type : "POST",
url : "jsonajax.php",
data : { id: i... |
33,170,983 | I'm trying to display image in HTML from MySql and PHP.
My ajax request
```
$.ajax({
type : "POST",
url : "jsonajax.php",
data : { id: id },
success : function(data){
alert(data);
$('#dialog').dialog('open');
$('#dialog').html('<img src='+ data + '" />');
}
});
```
... | 2015/10/16 | [
"https://Stackoverflow.com/questions/33170983",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4988805/"
] | You need to add a datatype, like "Json" | Make the ajax block like this (In your case):
```
$.ajax({
type : "POST",
url : "jsonajax.php",
data : { id: id },
dataType: 'json',
success : function(data){
console.log(data);
$('#dialog').dialog('open');
$('#dialog').html('<img src=' + data[0].img_url + '" />');
... |
64,370,739 | I'm reading a chunk from a big file, loading it in memory as a list of lines, then processing a task on every line.
The sequential solution was taking too long so I started looking at how to parallelize it.
The first solution I came up with is with Process and managing each subprocess' slice of the list.
```
import ... | 2020/10/15 | [
"https://Stackoverflow.com/questions/64370739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6377497/"
] | I am not entirely sure about this but it appears to me that your programs are materially different in what they submit to workers.
In your Process method you seem to be submitting a large chunk of rows:
```
p = mp.Process(target=work, args=(piece_list[start:finish]))
```
but then when you use Pool, you do this:
``... | I do not know if this gonna work , but may you try with this?
```
if __name__ == "__main__":
with open(BIG_FILE_PATH, encoding="Latin-1") as file:
with mp.Pool(N_PROCESSES) as pool:
for piece in read_in_chunks(file, CHUNKSIZE):
piece_list = piece.splitlines()
pool.ma... |
64,370,739 | I'm reading a chunk from a big file, loading it in memory as a list of lines, then processing a task on every line.
The sequential solution was taking too long so I started looking at how to parallelize it.
The first solution I came up with is with Process and managing each subprocess' slice of the list.
```
import ... | 2020/10/15 | [
"https://Stackoverflow.com/questions/64370739",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6377497/"
] | Oh boy! This was quite a ride to figure out, but very fun nonetheless.
The **Pool.map** is getting, pickling and passing every item individually from the iterator to each one of the workers. Once a worker is done, rinse and repeat, *get* -> *pickle* -> *pass*. This creates a noticeable overhead cost.
This is actually... | I do not know if this gonna work , but may you try with this?
```
if __name__ == "__main__":
with open(BIG_FILE_PATH, encoding="Latin-1") as file:
with mp.Pool(N_PROCESSES) as pool:
for piece in read_in_chunks(file, CHUNKSIZE):
piece_list = piece.splitlines()
pool.ma... |
22,424,554 | I have a function that takes the items in multiple lists and permutates them. So if I have the lists `child0 = ['a', 'b']` and `child1 = ['c', 'd']`:
```
def permutate():
for i in child0:
for k in child1:
print (i, k)
permutate()
# a c
# a d
# b c
# b d
```
I'm running into problems with sav... | 2014/03/15 | [
"https://Stackoverflow.com/questions/22424554",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3421111/"
] | You need to build a list and return that list object:
```
def permutate():
result = []
for i in child0:
for k in child1:
result.append((i, k))
return result
for pair in permutate():
print(*pair)
```
What you are doing is creating the *cartesian product*, not the permutations.
Th... | Pass a file object as an argument, and use `file` argument of `print` function.
```
def permutate(f):
for i in child0:
for k in child1:
print(i, k, file=f)
with open('testfile.txt', 'w') as f:
permutate(f)
``` |
28,264,277 | I found this code with which the square root is obtained what surprises me is the way it does, using a union and bit shifts this is the code:
```
float sqrt3(const float x)
{
union
{
int i;
float x;
} u;
u.x = x;
u.i = (1<<29) + (u.i >> 1) - (1<<22);
return u.x;
}
```
first is saved in **u.x... | 2015/02/01 | [
"https://Stackoverflow.com/questions/28264277",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4322080/"
] | The above code exhibits UB (undefined behaviour), so it should not be trusted to work on any platform. This is because it writes to a member of a `union` and reads back from a member different from that it last used to write the `union` with. It also depends heavily on endianness (the ordering of the bytes within a mul... | You can find a perfect explanation on wikipedia:
[Methods of computing square roots](http://en.wikipedia.org/wiki/Methods_of_computing_square_roots)
see section: Approximations that depend on the floating point representation
>
> So for a 32-bit single precision floating point number in IEEE format
> (where notably... |
8,389,593 | I get a string line:
```
>>> line = " abc\n def\n\n ghi\n jkl"
>>> print line
abc
def
ghi
jkl
```
and I want to convert it to "abcdef\n\n ghijkl", like:
```
>>> print " abcdef\n\n ghijkl"
abcdef
ghijkl
```
I tried python re module, and write something like this:
```
re.sub('(?P<word1>[^\n\s]... | 2011/12/05 | [
"https://Stackoverflow.com/questions/8389593",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/543492/"
] | `\s` matches space, `\t`, `\n` (and, depending on your regex engine) a few other whitespace characters.
So if you only want to replace single linebreaks + spaces/tabs, you can use this:
```
newline = re.sub(r"(?<!\n)\n[ \t]*(?!\n)", "", line)
```
**Explanation:**
```
(?<!\n) # Assert that the previous character is... | Try this,
```
line = " abc\n def\n\n ghi\n jkl"
print re.sub(r'\n(?!\n)\s*', '', line)
```
It gives,
>
> abcdef
>
> ghijkl
>
>
>
It says, "Replace a new line, followed by a space that is NOT a new line with nothing."
UPDATE: Here's a better version
```
>>> re.sub(r'([^\n])\n(?!\n)\s*', r'\1', line)... |
8,389,593 | I get a string line:
```
>>> line = " abc\n def\n\n ghi\n jkl"
>>> print line
abc
def
ghi
jkl
```
and I want to convert it to "abcdef\n\n ghijkl", like:
```
>>> print " abcdef\n\n ghijkl"
abcdef
ghijkl
```
I tried python re module, and write something like this:
```
re.sub('(?P<word1>[^\n\s]... | 2011/12/05 | [
"https://Stackoverflow.com/questions/8389593",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/543492/"
] | `\s` matches space, `\t`, `\n` (and, depending on your regex engine) a few other whitespace characters.
So if you only want to replace single linebreaks + spaces/tabs, you can use this:
```
newline = re.sub(r"(?<!\n)\n[ \t]*(?!\n)", "", line)
```
**Explanation:**
```
(?<!\n) # Assert that the previous character is... | You could simplify the regexp if you used `\S`, which matches any non-whitespace character:
```
>>> import re
>>> line = " abc\n def\n\n ghi\n jkl"
>>> print re.sub(r'(\S+)\n\s*(\S+)', r'\1\2', line)
abcdef
ghijkl
```
However, the reason why your own regexp is not working is because your `<word1>` and `<wor... |
9,976 | This question: [Would Zorquan be a Unity domain patron?](https://rpg.stackexchange.com/q/169939/35259)
As I said in a comment, given that the question includes "2e Forgotten Realms" (provided for background context for lore purposes) and "we're playing a fairly by-the-book **5e campaign.**", isn't this confirmation of... | 2020/06/04 | [
"https://rpg.meta.stackexchange.com/questions/9976",
"https://rpg.meta.stackexchange.com",
"https://rpg.meta.stackexchange.com/users/35259/"
] | I know I am likely to be the minority voice here, but for the sake of future reference, I have decided to add this answer, so there is at least one counter argument. Let me start by saying that I respect the never-guess-the-system policy. However, I believe that policy cannot apply here, as there is nothing to guess.
... | It is a violation of the policy, strictly speaking. There are many games that have five or more editions, so “2e” and “5e” could well be references to those systems—nothing in the question confirms that they are playing *D&D* 5e. Officially, the Forgotten Realms is a setting only for Dungeons & Dragons, but that doesn’... |
98,595 | All protein coding sequences in the [iGEM Registry](http://parts.igem.org/Main_Page) are supposed to [end with a double stop codon](http://parts.igem.org/Help:Protein_coding_sequences/Design). Presumably, this is to decrease the potential for read-through, which could be problematic if one is putting together a polycis... | 2021/03/04 | [
"https://biology.stackexchange.com/questions/98595",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/52598/"
] | The impact of any read-through from a leaky stop codon in an expression unit with only one CDS would probably depend on a few things, mainly (i) where is the next in-frame stop codon, (ii) what are you trying to express, and (iii) how leaky is the stop codon?
In cases where the next in-frame stop codon is only a few b... | Perhaps I could add for eukaryotic systems which terminate all stop codons by a single protein, eRF1, this study by [Schmied et al.,](https://pubs.acs.org/doi/abs/10.1021/ja5069728) showed readthrough of all stop codons to be less than 0.2% by wild-type eRF1, which seems acceptably low! I am unsure how this would trans... |
98,595 | All protein coding sequences in the [iGEM Registry](http://parts.igem.org/Main_Page) are supposed to [end with a double stop codon](http://parts.igem.org/Help:Protein_coding_sequences/Design). Presumably, this is to decrease the potential for read-through, which could be problematic if one is putting together a polycis... | 2021/03/04 | [
"https://biology.stackexchange.com/questions/98595",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/52598/"
] | The impact of any read-through from a leaky stop codon in an expression unit with only one CDS would probably depend on a few things, mainly (i) where is the next in-frame stop codon, (ii) what are you trying to express, and (iii) how leaky is the stop codon?
In cases where the next in-frame stop codon is only a few b... | If there is only one CDS, presumably there will be a transcriptional termination directly after the CDS (after the stop codon actually), which makes any read-through coming from using a single stop codon almost negligible. |
24,676 | I just finished changing the strings for my classical guitar. This is the first time so it wasn't absolutely smooth.
Now, tuning my E string (the highest) I noticed that it gets quite tense and all. I guess that it's normal however because of how I wound the strings, my E string on the tuning peg gets all stacked up o... | 2014/10/31 | [
"https://music.stackexchange.com/questions/24676",
"https://music.stackexchange.com",
"https://music.stackexchange.com/users/15106/"
] | I would do it over again, and have about half as many loops on the peg as you have now. See [this guide](https://www.taylorguitars.com/sites/default/files/Nylon_Restring.pdf) for some more hints. | It looks like the string is butting up against the headstock itself, so if you wind the string up more it'll be fouling on the wood which won't help with tone etc and in the end will make a rut in the wood where the string is fouling.
That's not "major damage" but it's undesirable, and the wood fouling on the string w... |
15,935,622 | I'm new to Android development and test, currently I'm training to make a test scripts under Python and then use monkeyrunner to run them.
As said in MonkeyDevice official documentation , the [getProperty()][1] and [getSystemProperty()][2] should return you a value that depends on property variable name you pass for t... | 2013/04/10 | [
"https://Stackoverflow.com/questions/15935622",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1499175/"
] | You need to specify the property group. For example:
```
print device.getSystemProperty('build.version.sdk')
``` | for whatever reason both `getProperty()` and `getSystemProperty()` don't work for me but you can run:
`$ adb shell getprop`
which returns a complete list of attributes/values |
43,612,866 | I'm learning about microservices and I'm gonna build a project with a microservices architecture.
The thing is, one of my team mates want to use one database for all services, sharing all tables so "data doesn't get repeated", each service would be built with different frameworks and languages like django and rails wh... | 2017/04/25 | [
"https://Stackoverflow.com/questions/43612866",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7437529/"
] | You are not likely to benefit from a Microservices architecture if all the services share the same database tables. This is because you are effectively tightly coupling the services. If a database table changes all the services will have to change.
You have to understand that the whole reason for a Microservices archi... | In general a microservice should be responsible for it's own data. That's a perfect world scenario.
In practice some of the services may be highly related to each other. E.g. CustomerShippingDetails and CustomerShoppingCheckout services may both access the same data - customer address. How would you then solve a prob... |
21,952,322 | I just want to know can we use this in CodeIgniter..
```
$this->form_validation->set_rules('marriage_id', 'Marriage ID','required|is_unique[marriage.marriage_id]|matches[person.marriage_id]');
```
`marriage` is my table name and `marriage_id` is a field in that table.
`Person` is another table and it also have `mar... | 2014/02/22 | [
"https://Stackoverflow.com/questions/21952322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3240391/"
] | Turning off host name verification would make your connection vulnerable to MITM attacks. This isn't the right way to fix this.
The problem you have comes from the fact you're using an IP address, and not a host name. Java follows RFC 2818 strictly on this point (unlike some browsers):
>
> In some cases, the URI is ... | The whole SSL certification for webs is based on hostnames. You cannot simply turn off the "host name verification" because it is part of standard.
To overcame this problem you need to call host by its name specified in issued certificate. If you have central DNS server it is best to configure host names there. If no... |
71,436,023 | I am using session\_set\_save\_handler to save session in database instead of file.
when using session\_regenerate\_id() it create the new session id but all the session data get blank and no entry
old session id - ajphtktier8essc3sjdrj26fei
session class write function query
```
REPLACE INTO sessions(id,access,data... | 2022/03/11 | [
"https://Stackoverflow.com/questions/71436023",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9260714/"
] | I'm pretty sure you would like your first `if` check wrap the entire thing, not only the first line.
Currently you are every frame firing a Raycast and destroy whatever you hit.
You rather want to only do this **once** per tap like e.g.
```
void Update()
{
if (Input.touchCount > 0 && Input.GetTouch(0).phase == T... | It's obvious that your if statement is missing a bracket {},
If your "Destory()" method can't ecstasy a game object, try the "DestroyImmediate()" method. DestroyImmediate will be destroyed as soon as it is destroyed, and the memory will be released. It takes more time to perform this operation and affects the main thre... |
22,283,318 | My `activity` is in landscape mode. That is my intention and I like to keep in landscape. So all `AlertDialog` or Toast come out in `landscape`. For this case, I like to rotate `AlertDialog` 90 deg in the program, how can I do that? Thanks | 2014/03/09 | [
"https://Stackoverflow.com/questions/22283318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2467772/"
] | You may use this layout to custom your dialog :
<https://github.com/rongi/rotate-layout>
[](https://i.stack.imgur.com/HFqsX.png) | This is something that could be done with a lot of complicated code, but would be quite confusing to the user, as he would have to rotate his device to the read and react to the dialog. |
41,523,205 | I Have the following code and want to find out if there is any way i can put the following code into a `for` loop so that it is not so long as i am doing it a few times in my code
```
if (Q1o1.equals("null")){
button1.setVisibility(View.INVISIBLE);
}else{
button1.setVisibility(View.VISIBLE);
button1... | 2017/01/07 | [
"https://Stackoverflow.com/questions/41523205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7379489/"
] | Maybe declare arrays like this:
```
String[] stringArray = {*your strings here*};
ButtonView[] buttonArray = {*your buttons here*};
```
and a loop like this:
```
for(int i = 0; i < stringArray.length; i++){
String thisString = stringArray[i];
ButtonView thisButton = buttonArray[i];
if(thisString.equals(... | I would suggest creating an array of the `Q1o7`'s, and an array of the buttons, then using a for loop between 0 and the length of the array, in which you will all the appropriate methods for the selected element in the array
Example:
First create the arrays:
```
Button[] buttonArray = {button1, .., button7}; //Repla... |
41,523,205 | I Have the following code and want to find out if there is any way i can put the following code into a `for` loop so that it is not so long as i am doing it a few times in my code
```
if (Q1o1.equals("null")){
button1.setVisibility(View.INVISIBLE);
}else{
button1.setVisibility(View.VISIBLE);
button1... | 2017/01/07 | [
"https://Stackoverflow.com/questions/41523205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7379489/"
] | Maybe declare arrays like this:
```
String[] stringArray = {*your strings here*};
ButtonView[] buttonArray = {*your buttons here*};
```
and a loop like this:
```
for(int i = 0; i < stringArray.length; i++){
String thisString = stringArray[i];
ButtonView thisButton = buttonArray[i];
if(thisString.equals(... | All you have to do is to define two Arralists where one is for buttons and the other is for variables :
```
ArrayList<Button> buttonsList = new ArraList<>();
```
add all your buttons to this list :
```
buttonsList.add(button1);
....
```
do the same for your variables and put them in another arraylist of strings
... |
53,412,372 | I need to set linear-gradient as well as the background image on a specific div using styles in Reactsjs
I am able to get either of them, I mean to say either image or linear-gradient but not both at the same time
The image is going to overlap with the linear gradient
I tried below solution :
```css
leftAdArea: {
... | 2018/11/21 | [
"https://Stackoverflow.com/questions/53412372",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7086382/"
] | On the function create() you call
```
$Shop = new Shop;
```
but on the top of the file you miss to import the Model class placed in "app/models/{ClassName}" folder.
On the folder "app/models/" you need to create one file with this name Shop
and past this code.
```
<?php
namespace App\Models;
use Illuminate\Datab... | add csrf token in form by using helper function
```
{!! csrf_field() !!}
```
otherwise add url in `verifyCsrfToken.php` file and remove `exit()` function in controller
import model on controller
```
use App\Shop;
``` |
342,914 | This question has come from a conversation at loggerheads. I can't find the answer online.
There are two positions on which is the correct expression to use when starting a job.For the example, I've used a job as a plumber.
Person A states "John becomes a plumber today"
Person B states "John has started working as a p... | 2016/08/15 | [
"https://english.stackexchange.com/questions/342914",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/191368/"
] | Considering this is the part you're talking about:
>
> I stopped watching for ridicule, the scorpion's tail hidden in his words. He said what he meant; he was puzzled if you did not. Some people might have mistaken this for simplicity. But is it not a sort of genius to cut always to the heart?
>
>
>
I believe the... | "To cut to the heart" could mean different things in different contexts. For example it could be a poetic way of saying "When you attack someone, you hurt them very badly", or perhaps, using the metaphor "the heart of the problem" (meaning the most important aspect), "When you analyse a problem, you immediately see the... |
342,914 | This question has come from a conversation at loggerheads. I can't find the answer online.
There are two positions on which is the correct expression to use when starting a job.For the example, I've used a job as a plumber.
Person A states "John becomes a plumber today"
Person B states "John has started working as a p... | 2016/08/15 | [
"https://english.stackexchange.com/questions/342914",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/191368/"
] | To "cut to the heart of the matter" is an idiom that means "get straight to the point". But "cut to the heart" can also mean to strongly engage someone's emotions, as a song might do.
Which meaning applies would depend on context. | "To cut to the heart" could mean different things in different contexts. For example it could be a poetic way of saying "When you attack someone, you hurt them very badly", or perhaps, using the metaphor "the heart of the problem" (meaning the most important aspect), "When you analyse a problem, you immediately see the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.