qid int64 1 74.6M | question stringlengths 45 24.2k | date stringlengths 10 10 | metadata stringlengths 101 178 | response_j stringlengths 32 23.2k | response_k stringlengths 21 13.2k |
|---|---|---|---|---|---|
42,297,695 | I have a numpy binary array like this:
```
np_bin_array = [0 1 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
```
It was 8-bit string characters of a word originally, starting from the left, with 0's padding it out.
I need to convert this... | 2017/02/17 | ['https://Stackoverflow.com/questions/42297695', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7580607/'] | You can firstly interpret the bits into an array, using [`numpy.packbits()`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.packbits.html), then convert it to an array of bytes by applying [`bytearray()`](https://docs.python.org/3.6/library/functions.html#bytearray), then `decode()` it to be a normal string... | ```
import numpy as np
np_bin_array = np.array([0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
bhello = ''.join(map(str, np_bin_array))
xhello = hex(int(bhello, 2)).strip("0x... |
42,297,695 | I have a numpy binary array like this:
```
np_bin_array = [0 1 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
```
It was 8-bit string characters of a word originally, starting from the left, with 0's padding it out.
I need to convert this... | 2017/02/17 | ['https://Stackoverflow.com/questions/42297695', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7580607/'] | You can firstly interpret the bits into an array, using [`numpy.packbits()`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.packbits.html), then convert it to an array of bytes by applying [`bytearray()`](https://docs.python.org/3.6/library/functions.html#bytearray), then `decode()` it to be a normal string... | I got it working with this:
```
np_bin_array = [0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
yy=[]
yy_word=""
yy=np.packbits(np_bin_array)
for i in yy:
if i:
... |
26,911,620 | After looking for a long time on the internet I could not find a real solution for my "problem".
---
**What I want to do:**
Compare 2 images (created with the Raspberry Pi camera in a Python script) in C.
I have tried this in Python but it is too slow (+/- 1 minute per 2 images).
So I would like to try it in C. I ... | 2014/11/13 | ['https://Stackoverflow.com/questions/26911620', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2289964/'] | To use Coveralls with Gradle and Travis, I'm using the Coverall's Gradle plugin ([com.github.kt3k.coveralls](https://github.com/kt3k/coveralls-gradle-plugin)) and a command after success in Travis.
The plugin's readme explains its usage pretty well. But if you want to check an example, you can refer to the project in ... | I also got this error (*Couldn't find a repository matching this job.*) when I specified a repo token. The Coveralls documentation suggested to specify a repo token, but didn't make it clear enough to me that you *must not* specify a repo token if you're using public repos.
In other words, if your stuff is public on G... |
34,092,276 | **EDIT**: Ive recreated the problem here <http://plnkr.co/edit/w6yJ8KUvD3cgOrr56zH3?p=preview>
I'm new to angularjs and I'm trying to create a popupmodal with some data..
I can't understand why it is empty the first time I open it, but the second (and so on) its good. By good I mean that the header is there. So every... | 2015/12/04 | ['https://Stackoverflow.com/questions/34092276', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1789325/'] | I managed to solve this by removing the script tag in my modal which I wanted to display
```
<div class="modal-header">
<h3 class="modal-title">I'm a modal!</h3>
</div>
<div class="modal-body">
<ul>
<li ng-repeat="item in items">
<a href="#" ng-click="$event.prev... | Try the following
```
angular.module("Modal")
.controller("ModalController",
[
"$scope", "$uibModal", "$log", "ModalService", "AuthenticationService",
function($scope, $uibModal, $log, ModalService, AuthenticationService) {
AuthenticationService.GetCurrentWindowsUser(function(username) {
$s... |
34,092,276 | **EDIT**: Ive recreated the problem here <http://plnkr.co/edit/w6yJ8KUvD3cgOrr56zH3?p=preview>
I'm new to angularjs and I'm trying to create a popupmodal with some data..
I can't understand why it is empty the first time I open it, but the second (and so on) its good. By good I mean that the header is there. So every... | 2015/12/04 | ['https://Stackoverflow.com/questions/34092276', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1789325/'] | I managed to solve this by removing the script tag in my modal which I wanted to display
```
<div class="modal-header">
<h3 class="modal-title">I'm a modal!</h3>
</div>
<div class="modal-body">
<ul>
<li ng-repeat="item in items">
<a href="#" ng-click="$event.prev... | ```
angular.module("Modal")
.controller("ModalController",
[
"$scope", "$uibModal", "$log", "ModalService", "AuthenticationService",
function($scope, $uibModal, $log, ModalService, AuthenticationService) {
AuthenticationService.GetCurrentWindowsUser(function(username) {
$scope.username = user... |
2,574,504 | How can I prove that polynomial ring $\mathbb{Z}[x]$ is not an integral domain ?
I was thinking that $\mathbb{Z}[x]$ is not a field so it is will not form integral domain as every finite integral domain is a field but here $\mathbb{Z}[x]$ contain infinitely many element so ,it will not form field .....
Is my thinking... | 2017/12/20 | ['https://math.stackexchange.com/questions/2574504', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | $\Bbb Z[X]$ is actually an integral domain:
---
Let $f,g \in \Bbb Z[X]$ with $fg=0$.
Convince yourself (prove via induction) that if the leading coefficient of $f$ is $m$ and that of $g$ is $n$, then that of $fg$ is $mn$.
However, since the leading coefficients of both sides must be equal, we must have $mn = 0$.
H... | $\mathbb Z [x] $ can be considered a subring of $\mathbb Q [x] $. $\mathbb Q $ is a field, so $\mathbb Q [x] $ is an integral domain, and so $\mathbb Z [x] $ must be too (as any zero divisors in $\mathbb Z [x] $ will also be zero divisors in $\mathbb Q [x] $). |
2,574,504 | How can I prove that polynomial ring $\mathbb{Z}[x]$ is not an integral domain ?
I was thinking that $\mathbb{Z}[x]$ is not a field so it is will not form integral domain as every finite integral domain is a field but here $\mathbb{Z}[x]$ contain infinitely many element so ,it will not form field .....
Is my thinking... | 2017/12/20 | ['https://math.stackexchange.com/questions/2574504', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | $\Bbb Z[X]$ is actually an integral domain:
---
Let $f,g \in \Bbb Z[X]$ with $fg=0$.
Convince yourself (prove via induction) that if the leading coefficient of $f$ is $m$ and that of $g$ is $n$, then that of $fg$ is $mn$.
However, since the leading coefficients of both sides must be equal, we must have $mn = 0$.
H... | A material implication $P\to Q$ is a statement like "If $P$, then $Q$". For example, "If a ring $R$ is finite and integral domain, then it is a field".
To every material implication $P\to Q$, we can consider the converse $Q\to P$, the inverse $\neg P\to\neg Q$, and the contrapositive $\neg Q\to\neg P.$
If an implica... |
2,574,504 | How can I prove that polynomial ring $\mathbb{Z}[x]$ is not an integral domain ?
I was thinking that $\mathbb{Z}[x]$ is not a field so it is will not form integral domain as every finite integral domain is a field but here $\mathbb{Z}[x]$ contain infinitely many element so ,it will not form field .....
Is my thinking... | 2017/12/20 | ['https://math.stackexchange.com/questions/2574504', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | $\Bbb Z[X]$ is actually an integral domain:
---
Let $f,g \in \Bbb Z[X]$ with $fg=0$.
Convince yourself (prove via induction) that if the leading coefficient of $f$ is $m$ and that of $g$ is $n$, then that of $fg$ is $mn$.
However, since the leading coefficients of both sides must be equal, we must have $mn = 0$.
H... | You don't explicitly say what $x$ is. If, as others seem to assume, $x$ is an indeterminate (an unknown variable), then of course $\mathbb{Z}[x]$ is an integral domain (no "zero divisors").
On the other hand one can construct a simple overring of the integers $\mathbb{Z}[x]$ in which there are zero-divisors. For exam... |
2,574,504 | How can I prove that polynomial ring $\mathbb{Z}[x]$ is not an integral domain ?
I was thinking that $\mathbb{Z}[x]$ is not a field so it is will not form integral domain as every finite integral domain is a field but here $\mathbb{Z}[x]$ contain infinitely many element so ,it will not form field .....
Is my thinking... | 2017/12/20 | ['https://math.stackexchange.com/questions/2574504', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | $\mathbb Z [x] $ can be considered a subring of $\mathbb Q [x] $. $\mathbb Q $ is a field, so $\mathbb Q [x] $ is an integral domain, and so $\mathbb Z [x] $ must be too (as any zero divisors in $\mathbb Z [x] $ will also be zero divisors in $\mathbb Q [x] $). | A material implication $P\to Q$ is a statement like "If $P$, then $Q$". For example, "If a ring $R$ is finite and integral domain, then it is a field".
To every material implication $P\to Q$, we can consider the converse $Q\to P$, the inverse $\neg P\to\neg Q$, and the contrapositive $\neg Q\to\neg P.$
If an implica... |
2,574,504 | How can I prove that polynomial ring $\mathbb{Z}[x]$ is not an integral domain ?
I was thinking that $\mathbb{Z}[x]$ is not a field so it is will not form integral domain as every finite integral domain is a field but here $\mathbb{Z}[x]$ contain infinitely many element so ,it will not form field .....
Is my thinking... | 2017/12/20 | ['https://math.stackexchange.com/questions/2574504', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | $\mathbb Z [x] $ can be considered a subring of $\mathbb Q [x] $. $\mathbb Q $ is a field, so $\mathbb Q [x] $ is an integral domain, and so $\mathbb Z [x] $ must be too (as any zero divisors in $\mathbb Z [x] $ will also be zero divisors in $\mathbb Q [x] $). | You don't explicitly say what $x$ is. If, as others seem to assume, $x$ is an indeterminate (an unknown variable), then of course $\mathbb{Z}[x]$ is an integral domain (no "zero divisors").
On the other hand one can construct a simple overring of the integers $\mathbb{Z}[x]$ in which there are zero-divisors. For exam... |
2,574,504 | How can I prove that polynomial ring $\mathbb{Z}[x]$ is not an integral domain ?
I was thinking that $\mathbb{Z}[x]$ is not a field so it is will not form integral domain as every finite integral domain is a field but here $\mathbb{Z}[x]$ contain infinitely many element so ,it will not form field .....
Is my thinking... | 2017/12/20 | ['https://math.stackexchange.com/questions/2574504', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/-1/'] | You don't explicitly say what $x$ is. If, as others seem to assume, $x$ is an indeterminate (an unknown variable), then of course $\mathbb{Z}[x]$ is an integral domain (no "zero divisors").
On the other hand one can construct a simple overring of the integers $\mathbb{Z}[x]$ in which there are zero-divisors. For exam... | A material implication $P\to Q$ is a statement like "If $P$, then $Q$". For example, "If a ring $R$ is finite and integral domain, then it is a field".
To every material implication $P\to Q$, we can consider the converse $Q\to P$, the inverse $\neg P\to\neg Q$, and the contrapositive $\neg Q\to\neg P.$
If an implica... |
2,016,967 | I am using Ubuntu ARM as testing platform on a QEMU emulator. The emulator has 256MB of RAM, but I'm wondering: what are the minimum requirements for running Ubuntu ARM? (CLI only) | 2010/01/06 | ['https://Stackoverflow.com/questions/2016967', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/62802/'] | Most of the time, it's because your code is mis-aligned and compiler assumes that your "do" block ended prematurely (or has extra code that dont really belong there) | Your last line isn't something like `someVar <- putStrLn "hello"`, by any chance, is it? You'll get that error if you try to do a variable binding on the last line, because it's equivalent to `putStrLn "Hello" >>= \someVar ->` — it expects there to be an expression at the end. |
2,016,967 | I am using Ubuntu ARM as testing platform on a QEMU emulator. The emulator has 256MB of RAM, but I'm wondering: what are the minimum requirements for running Ubuntu ARM? (CLI only) | 2010/01/06 | ['https://Stackoverflow.com/questions/2016967', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/62802/'] | Your last line isn't something like `someVar <- putStrLn "hello"`, by any chance, is it? You'll get that error if you try to do a variable binding on the last line, because it's equivalent to `putStrLn "Hello" >>= \someVar ->` — it expects there to be an expression at the end. | Incorrect indentation can lead to this error. Also, is good not to use tabs, only spaces. |
2,016,967 | I am using Ubuntu ARM as testing platform on a QEMU emulator. The emulator has 256MB of RAM, but I'm wondering: what are the minimum requirements for running Ubuntu ARM? (CLI only) | 2010/01/06 | ['https://Stackoverflow.com/questions/2016967', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/62802/'] | Most of the time, it's because your code is mis-aligned and compiler assumes that your "do" block ended prematurely (or has extra code that dont really belong there) | Incorrect indentation can lead to this error. Also, is good not to use tabs, only spaces. |
39,741,293 | I have seen similar questions on this issue but non of the answers worked for me. I have a boolean value that change whenever an async task has been completed, but it's strange that ngonchages does not fire anytime it changes. Below is my code:
```
import {
Component,
OnChanges,
SimpleChange
} from '@angul... | 2016/09/28 | ['https://Stackoverflow.com/questions/39741293', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/944258/'] | `ngOnChanges` is a lifecycle callback of Angulars change detection mechanism and it is called when an `@Input()` is changed by Angulars data binding
When you have
```
@Input() isLoaded: boolean;
```
and
```
<home-page [isLoaded]="someValue">
```
and `someValue` in the parent component is changed, then change d... | Property treated as input (part of checking changes) should be marked with @Input
```
@Input()
isLoaded: boolean;
``` |
69,591,239 | There is Hive table with ~ 500,000 rows.
It has the single column which keeps the JSON string.
JSON stores the measurements from 15 devices organized like this:
```
company_id=…
device_1:
array of measurements
every single measurements has 2 attributes:
value=
date=
device_2:
…
device_3
…
d... | 2021/10/15 | ['https://Stackoverflow.com/questions/69591239', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3440012/'] | You need to combine the recursive result with testing the current index.
```
def firstNCharsSame(string, string2, n):
if n == 0: # base case
return True
if n > len(string) or n > len(string2):
return False
return string[n - 1] == string2[n - 1] and firstNCharsSame(string, string2, n-1)
``` | Maybe something like this:
```
def firstNCharsSameRec(string, string2, current, n):
if current >= n:
return True
if string[current] != string2[current]:
return False
return firstNCharsSameRec(string, string2, current + 1, n)
```
And calling it like this:
```
print(firstNCharsSameRec("a... |
69,591,239 | There is Hive table with ~ 500,000 rows.
It has the single column which keeps the JSON string.
JSON stores the measurements from 15 devices organized like this:
```
company_id=…
device_1:
array of measurements
every single measurements has 2 attributes:
value=
date=
device_2:
…
device_3
…
d... | 2021/10/15 | ['https://Stackoverflow.com/questions/69591239', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3440012/'] | You need to combine the recursive result with testing the current index.
```
def firstNCharsSame(string, string2, n):
if n == 0: # base case
return True
if n > len(string) or n > len(string2):
return False
return string[n - 1] == string2[n - 1] and firstNCharsSame(string, string2, n-1)
``` | You can use the base case as 0, and implement like so:
```
def firstNCharsSame(string, string2, n):
if n == 0:
return True
if n > min(len(string), len(string2)):
return False
return string[n - 1] == string2[n - 1] and firstNCharsSame(string, string2, n-1)
``` |
69,591,239 | There is Hive table with ~ 500,000 rows.
It has the single column which keeps the JSON string.
JSON stores the measurements from 15 devices organized like this:
```
company_id=…
device_1:
array of measurements
every single measurements has 2 attributes:
value=
date=
device_2:
…
device_3
…
d... | 2021/10/15 | ['https://Stackoverflow.com/questions/69591239', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3440012/'] | You need to combine the recursive result with testing the current index.
```
def firstNCharsSame(string, string2, n):
if n == 0: # base case
return True
if n > len(string) or n > len(string2):
return False
return string[n - 1] == string2[n - 1] and firstNCharsSame(string, string2, n-1)
``` | You only need to use the last parameter as a decreasing counter. Just compare the first characters and recurse for the rest:
```
def firstNCharsSame(a, b, n):
return not n or a and b and a[0]==b[0] and firstNCharsSame(a[1:],b[1:],n-1)
``` |
69,591,239 | There is Hive table with ~ 500,000 rows.
It has the single column which keeps the JSON string.
JSON stores the measurements from 15 devices organized like this:
```
company_id=…
device_1:
array of measurements
every single measurements has 2 attributes:
value=
date=
device_2:
…
device_3
…
d... | 2021/10/15 | ['https://Stackoverflow.com/questions/69591239', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3440012/'] | You can use the base case as 0, and implement like so:
```
def firstNCharsSame(string, string2, n):
if n == 0:
return True
if n > min(len(string), len(string2)):
return False
return string[n - 1] == string2[n - 1] and firstNCharsSame(string, string2, n-1)
``` | Maybe something like this:
```
def firstNCharsSameRec(string, string2, current, n):
if current >= n:
return True
if string[current] != string2[current]:
return False
return firstNCharsSameRec(string, string2, current + 1, n)
```
And calling it like this:
```
print(firstNCharsSameRec("a... |
69,591,239 | There is Hive table with ~ 500,000 rows.
It has the single column which keeps the JSON string.
JSON stores the measurements from 15 devices organized like this:
```
company_id=…
device_1:
array of measurements
every single measurements has 2 attributes:
value=
date=
device_2:
…
device_3
…
d... | 2021/10/15 | ['https://Stackoverflow.com/questions/69591239', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3440012/'] | You can use the base case as 0, and implement like so:
```
def firstNCharsSame(string, string2, n):
if n == 0:
return True
if n > min(len(string), len(string2)):
return False
return string[n - 1] == string2[n - 1] and firstNCharsSame(string, string2, n-1)
``` | You only need to use the last parameter as a decreasing counter. Just compare the first characters and recurse for the rest:
```
def firstNCharsSame(a, b, n):
return not n or a and b and a[0]==b[0] and firstNCharsSame(a[1:],b[1:],n-1)
``` |
98,715 | When looking at the [USD/BRL conversion rate](https://www.xe.com/currencyconverter/convert/?Amount=1&From=USD&To=BRL) I see a rate more or less 1 USD = ~ 3.90BRL. Then when I want to transfer my funds from my contractor (in USD) to my local account (in BRL), I wait for a day with bigger rate.
But, by example, the sit... | 2018/08/17 | ['https://money.stackexchange.com/questions/98715', 'https://money.stackexchange.com', 'https://money.stackexchange.com/users/75994/'] | >
> Why this happens?
> How can I know the correct (or best approximate) conversion rate?
>
>
>
Most sites show the Mid-Rate. This is a notional rate. When you are buying or selling, you get a "Buy Rate" or "Sell Rate". The difference is the spread.
If you see the note on the site, just below the rate; it clearl... | Because there's is a difference between "Buy rate" and "Selling Rate" of a currency.
The spread in between 2 is the margin which money exchanger earns.
So, for example, a money exchanger buys 5 USD @ 70 INR/USD and sell USD @ 70.5 INR/USD, thereby making profit of 2.5 INR.
You need to see currencies as commodities to u... |
98,715 | When looking at the [USD/BRL conversion rate](https://www.xe.com/currencyconverter/convert/?Amount=1&From=USD&To=BRL) I see a rate more or less 1 USD = ~ 3.90BRL. Then when I want to transfer my funds from my contractor (in USD) to my local account (in BRL), I wait for a day with bigger rate.
But, by example, the sit... | 2018/08/17 | ['https://money.stackexchange.com/questions/98715', 'https://money.stackexchange.com', 'https://money.stackexchange.com/users/75994/'] | >
> Why this happens?
> How can I know the correct (or best approximate) conversion rate?
>
>
>
Most sites show the Mid-Rate. This is a notional rate. When you are buying or selling, you get a "Buy Rate" or "Sell Rate". The difference is the spread.
If you see the note on the site, just below the rate; it clearl... | Banks/brokers/currency traders etc... are in the business of making money, not speculating on where an asset class is going to move. Currency is just another "asset" it can change value just like a stock can depending on supply and demand, or a host of other factors.
If the bank/broker just bought and sold at the mar... |
98,715 | When looking at the [USD/BRL conversion rate](https://www.xe.com/currencyconverter/convert/?Amount=1&From=USD&To=BRL) I see a rate more or less 1 USD = ~ 3.90BRL. Then when I want to transfer my funds from my contractor (in USD) to my local account (in BRL), I wait for a day with bigger rate.
But, by example, the sit... | 2018/08/17 | ['https://money.stackexchange.com/questions/98715', 'https://money.stackexchange.com', 'https://money.stackexchange.com/users/75994/'] | Banks/brokers/currency traders etc... are in the business of making money, not speculating on where an asset class is going to move. Currency is just another "asset" it can change value just like a stock can depending on supply and demand, or a host of other factors.
If the bank/broker just bought and sold at the mar... | Because there's is a difference between "Buy rate" and "Selling Rate" of a currency.
The spread in between 2 is the margin which money exchanger earns.
So, for example, a money exchanger buys 5 USD @ 70 INR/USD and sell USD @ 70.5 INR/USD, thereby making profit of 2.5 INR.
You need to see currencies as commodities to u... |
3,363,352 | I have a TreeView on my page. It's bound to a collection of clients containing contracts, like:
```
public class Client
{
public int ClientID { get; set; }
public string Name { get; set; }
public List<Contract> Contracts { get; set; }
}
public class Contract
{
public int ContractID { get; set; }
public int ... | 2010/07/29 | ['https://Stackoverflow.com/questions/3363352', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/83096/'] | I figured out what's happening here, the clue is in the MSDN documentation for the return value of `ItemContainerGenerator.ContainerFromItem()`:
>
> A UIElement that corresponds to the
> given item. Returns null if the item
> does not belong to the item
> collection, or if a UIElement has not
> been generated for... | I think that there could be some condition where "UpdateLoayout will not work":
if the TreeView is in recycling mode and the item is not in the visible portion and/or also in a "add" operation where the TreeViewItem is created on another thread.
The solution is to use similar solution as I describe in:
[WPF: Select Tr... |
1,064,259 | I am in the process of writing a rule engine that performs simple assignments as determined by conditional constructs. It is a prerequisite of the project that the rules be in XML format. I have modeled my XML schema to resemble simple code blocks. I wish to parse the XML and to then transform it into Java code. I then... | 2009/06/30 | ['https://Stackoverflow.com/questions/1064259', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/101715/'] | You could transform it into Clojure code, and the Clojure compiler will turn it into bytecode for you. | you can fork a process like this
```
Process p = Runtime.getRuntime().exec("java -classpath "..." SomeClassContainingMain ...other arguments);
//you need to consume the outputs of the command if output/error is large otherwise the process is going to hang if output/error buffer is full. and create a se... |
1,064,259 | I am in the process of writing a rule engine that performs simple assignments as determined by conditional constructs. It is a prerequisite of the project that the rules be in XML format. I have modeled my XML schema to resemble simple code blocks. I wish to parse the XML and to then transform it into Java code. I then... | 2009/06/30 | ['https://Stackoverflow.com/questions/1064259', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/101715/'] | Save yourself the hassle and use [BeanShell](http://www.beanshell.org/) as alluded to here [Executing java code given in a text file](https://stackoverflow.com/questions/1057796/executing-java-code-given-in-a-text-file).
>
> **What is BeanShell?**
>
>
> BeanShell is a small, free, embeddable
> Java source interpre... | you can fork a process like this
```
Process p = Runtime.getRuntime().exec("java -classpath "..." SomeClassContainingMain ...other arguments);
//you need to consume the outputs of the command if output/error is large otherwise the process is going to hang if output/error buffer is full. and create a se... |
1,064,259 | I am in the process of writing a rule engine that performs simple assignments as determined by conditional constructs. It is a prerequisite of the project that the rules be in XML format. I have modeled my XML schema to resemble simple code blocks. I wish to parse the XML and to then transform it into Java code. I then... | 2009/06/30 | ['https://Stackoverflow.com/questions/1064259', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/101715/'] | Groovy, BeanShell or any other scripting language which is based on JVM have such a facility to inject, modify, add and run code at runtime. Actually all the scripting language are interpreted, so actually those are not compiling at runtime. | you can fork a process like this
```
Process p = Runtime.getRuntime().exec("java -classpath "..." SomeClassContainingMain ...other arguments);
//you need to consume the outputs of the command if output/error is large otherwise the process is going to hang if output/error buffer is full. and create a se... |
1,064,259 | I am in the process of writing a rule engine that performs simple assignments as determined by conditional constructs. It is a prerequisite of the project that the rules be in XML format. I have modeled my XML schema to resemble simple code blocks. I wish to parse the XML and to then transform it into Java code. I then... | 2009/06/30 | ['https://Stackoverflow.com/questions/1064259', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/101715/'] | Javassist is almost a full Java compiler written in Java, and it's completely made of Java. You can't give it a whole .java file at once, but you can give it the code string for individual functions and add them to the same CtClass object, which becomes bytecode and then a java.lang.Class.
I just released version 0.1 ... | you can fork a process like this
```
Process p = Runtime.getRuntime().exec("java -classpath "..." SomeClassContainingMain ...other arguments);
//you need to consume the outputs of the command if output/error is large otherwise the process is going to hang if output/error buffer is full. and create a se... |
14,551,196 | In this program the second and forth scanf get skipping , don't know the reason . can some please tell the reason ?
```
#include<stdio.h>
main()
{
int age;
char sex,status,city;
printf("Enter the persons age \n");
scanf("\n%d",&age);
printf("enter the gender\n");
scanf("%c",&sex);
printf("enter the h... | 2013/01/27 | ['https://Stackoverflow.com/questions/14551196', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1813332/'] | When reading chars using scanf(), it leaves a newline char in the input buffer.
Change :
```
scanf("%c",&sex);
printf("enter the health status");
scanf("%c",&status);
printf("where the person stay city or village");
scanf("%c",&city);
```
to:
```
scanf(" %c",&sex);
printf("enter the health sta... | I always get the same problem as you using `scanf`, therefore, I use strings instead. I would use:
```
#include<stdio.h>
main()
{
int age;
char sex[3],status[3],city[3];
printf("Enter the persons age \n");
scanf("\n%d",&age);
printf("enter the gender\n");
gets(sex);
printf("enter the health... |
355,666 | Is there a chain rule of any kind for the generalised directional derivative (of the Clarke type)? There is certainly a chain rule for the generalised gradient.
The generalised directional derivative is: $$f^\circ(x;v)=\limsup\_{y \to x, t \downarrow 0} \frac{f(y+tv) - f(y)}{t},$$
where $x,v \in \mathbb R^n$ for some ... | 2020/03/25 | ['https://mathoverflow.net/questions/355666', 'https://mathoverflow.net', 'https://mathoverflow.net/users/75761/'] | A nice and non-trivial extension of the chain-rule occurs from the DiPerna-Lions theory of rough vector fields: take on an open subset $\Omega$ of $\mathbb R^n$ a vector field $X$ with $L^\infty\_{loc}(\Omega)$ coefficients and null divergence such that $X\in W^{1,1}\_{loc}(\Omega)$. Let $u$ be an $L^\infty\_{loc}(\Ome... | The straightforward generalization of the [usual chain rule](https://en.wikipedia.org/wiki/Gradient#Chain_rule) would give
$$(f\circ g)^\circ(x,v)=v\cdot\bigl(Dg(x)\bigr)^{\rm T}\cdot\bigl(\nabla f(y)\bigr),$$
with $Dg$ the Jacobian matrix and $g(x)=y$. |
355,666 | Is there a chain rule of any kind for the generalised directional derivative (of the Clarke type)? There is certainly a chain rule for the generalised gradient.
The generalised directional derivative is: $$f^\circ(x;v)=\limsup\_{y \to x, t \downarrow 0} \frac{f(y+tv) - f(y)}{t},$$
where $x,v \in \mathbb R^n$ for some ... | 2020/03/25 | ['https://mathoverflow.net/questions/355666', 'https://mathoverflow.net', 'https://mathoverflow.net/users/75761/'] | According to theorem 8.14 of <https://arxiv.org/pdf/1708.04180.pdf>, we have that for locally Lipschitz $g:Y\to \mathbb R$ and Frechet-differentiable $f: X \to Y$, that
$$(g\circ f)^\circ(x;v) \leq g^\circ(f(x);f'(x)v).$$
Equality holds if $g$ is *regular.*
We can furthermore say that:
$$(g\circ f)^\circ(x;v) \geq ... | The straightforward generalization of the [usual chain rule](https://en.wikipedia.org/wiki/Gradient#Chain_rule) would give
$$(f\circ g)^\circ(x,v)=v\cdot\bigl(Dg(x)\bigr)^{\rm T}\cdot\bigl(\nabla f(y)\bigr),$$
with $Dg$ the Jacobian matrix and $g(x)=y$. |
355,666 | Is there a chain rule of any kind for the generalised directional derivative (of the Clarke type)? There is certainly a chain rule for the generalised gradient.
The generalised directional derivative is: $$f^\circ(x;v)=\limsup\_{y \to x, t \downarrow 0} \frac{f(y+tv) - f(y)}{t},$$
where $x,v \in \mathbb R^n$ for some ... | 2020/03/25 | ['https://mathoverflow.net/questions/355666', 'https://mathoverflow.net', 'https://mathoverflow.net/users/75761/'] | According to theorem 8.14 of <https://arxiv.org/pdf/1708.04180.pdf>, we have that for locally Lipschitz $g:Y\to \mathbb R$ and Frechet-differentiable $f: X \to Y$, that
$$(g\circ f)^\circ(x;v) \leq g^\circ(f(x);f'(x)v).$$
Equality holds if $g$ is *regular.*
We can furthermore say that:
$$(g\circ f)^\circ(x;v) \geq ... | A nice and non-trivial extension of the chain-rule occurs from the DiPerna-Lions theory of rough vector fields: take on an open subset $\Omega$ of $\mathbb R^n$ a vector field $X$ with $L^\infty\_{loc}(\Omega)$ coefficients and null divergence such that $X\in W^{1,1}\_{loc}(\Omega)$. Let $u$ be an $L^\infty\_{loc}(\Ome... |
48,983,929 | There are the two tables `Client` and `Stock`:
```
Table Client
Column IDC (primary key, int, not null)
Table Stock
Column IDS (primary key, int, not null)
Column IDC (int, not null)
Column Type (bit, not null)
Column Issued (bit, not null)
Column Price (decimal(1... | 2018/02/26 | ['https://Stackoverflow.com/questions/48983929', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6198659/'] | Is that what you wanna get?
```
SELECT z.IDC, z.PRICE
FROM Stock z
WHERE z.IDC IN
(
SELECT c.IDC IDC
FROM [Client] c
LEFT JOIN Stock S
on C.IDC = S.IDC
AND S.Type = 1
AND S.Price IS NOT NULL
WHERE S.IDC IS NULL
) AND Z.PRICE IS NOT ... | You may be looking for this
```
SELECT C.IDC, S.Price
FROM Client C
LEFT JOIN Stock S ON C.IDC = S.IDC
WHERE
(S.IDC IS NULL AND S.Issued = 1) OR
(S.Type = 1 AND S.Price IS NOT NULL)
``` |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | Add `&wmode=transparent` to the url and you're done, tested.
I use that technique in my own wordpress plugin [YouTube shortcode](http://wordpress.org/extend/plugins/youtube-shortcode)
Check its source code if you encounter any issue. | recently I saw that sometimes the flash player doesn't recognize `&wmode=opaque`, istead you should pass `&WMode=opaque` too (notice the uppercase). |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | Add `&wmode=transparent` to the url and you're done, tested.
I use that technique in my own wordpress plugin [YouTube shortcode](http://wordpress.org/extend/plugins/youtube-shortcode)
Check its source code if you encounter any issue. | I know this is an old question, but it still comes up in the top searches for this issue so I'm adding a new answer to help those looking for one for IE:
Adding `&wmode=opaque` to the end of the URL does NOT work in IE 10...
However, adding `?wmode=opaque` does the trick!
---
Found this solution here: <http://alamo... |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | Try adding `?wmode=opaque` to the URL or `&wmode=opaque` if there already is a parameter.
If it doesn't work try this instead, `&wmode=transparent` which will work in IE browser as well. | Try adding `?wmode=transparent` to the end of the URL. Worked for me. |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | Add `&wmode=transparent` to the url and you're done, tested.
I use that technique in my own wordpress plugin [YouTube shortcode](http://wordpress.org/extend/plugins/youtube-shortcode)
Check its source code if you encounter any issue. | `&wmode=opaque` didn't work for me (chrome 10) but `&wmode=transparent` cleared the issue right up. |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | If you are using the new asynchronous API, you will need to add the parameter like so:
```
<!-- YOUTUBE -->
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('scr... | recently I saw that sometimes the flash player doesn't recognize `&wmode=opaque`, istead you should pass `&WMode=opaque` too (notice the uppercase). |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | Just a tip!--make sure you up the z-index on the element you want to be over the embedded video. I added the wmode querystring, and it still didn't work...until I upped the z-index of the other element. :) | `&wmode=opaque` didn't work for me (chrome 10) but `&wmode=transparent` cleared the issue right up. |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | Try adding `?wmode=transparent` to the end of the URL. Worked for me. | Just a tip!--make sure you up the z-index on the element you want to be over the embedded video. I added the wmode querystring, and it still didn't work...until I upped the z-index of the other element. :) |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | Adding `?wmode=opaque` to the URL seems to solve this problem for me, although I have not tested it in IE yet.
For those of you having troubles with the previously proposed solution, note that an inital ampersand will only work if you are already supplying other arguments to the URL. The first argument must have an in... | Add `&wmode=transparent` to the url and you're done, tested.
I use that technique in my own wordpress plugin [YouTube shortcode](http://wordpress.org/extend/plugins/youtube-shortcode)
Check its source code if you encounter any issue. |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | Try adding `?wmode=transparent` to the end of the URL. Worked for me. | If you are using the new asynchronous API, you will need to add the parameter like so:
```
<!-- YOUTUBE -->
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('scr... |
4,050,999 | Using javascript with jQuery, I am adding an iframe with a youtube url to display a video on a website however the embed code that gets loaded in the iframe from youtube doesnt have wmode="Opaque", therefore the modal boxes on the page are shown beneath the youtube video.
Any ideas how to solve the issue? | 2010/10/29 | ['https://Stackoverflow.com/questions/4050999', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/427235/'] | If you are using the new asynchronous API, you will need to add the parameter like so:
```
<!-- YOUTUBE -->
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "http://www.youtube.com/player_api";
var firstScriptTag = document.getElementsByTagName('scr... | Just a tip!--make sure you up the z-index on the element you want to be over the embedded video. I added the wmode querystring, and it still didn't work...until I upped the z-index of the other element. :) |
686,249 | I'm trying to configure two subdomains using apache 2.4, but seems that there is a problem I can't resolve.
Here is the apache configuration file
```
<VirtualHost *:80>
ServerName www.subdomain1.myweb.com
ServerAlias subdomain1.myweb.com
DocumentRoot /srv/webapps/mywebapp
<Directory /srv/webapps/mywe... | 2015/04/28 | ['https://serverfault.com/questions/686249', 'https://serverfault.com', 'https://serverfault.com/users/284206/'] | I noticed in your subdomain2, you didn't include the . Not sure if that's just in the config here, or yours.
Did you do service httpd reload (or service apache2 reload depending on OS)
Is your DNS pointed at your IP using those domain names? | TL;DR delete www
www is already a subdomain of example.com.
so you certainly are able to define 3rd or 4th level domains from your original domain. But you most likely do not want something.www.yourdomain.com as your subdomain.
What you probably want is subdomain.yourdomain.com, thus just delete the wwww.
Havent te... |
6,839,242 | We recently moved to jQuery 1.6 and ran into the attr() versus prop() back-compat issue. During the first few hours after the change was deployed everything was fine, then it started breaking for people. We identified the problem pretty quickly and updated the offending JS, which was inline.
No we have a situation whe... | 2011/07/27 | ['https://Stackoverflow.com/questions/6839242', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/123749/'] | The answer to both your questions is no. *Unless* the whole page is being cached. A browser can't cache part of a file, since it would have to download it to know which parts it had cached and by that time it's downloaded them all anyways. It makes no sense :)
You could try sending some headers along with your page th... | I'd say the answers to your questions are 1) No and 2) Yes.
jQuery versions are different URLs so there's no caching problems there unless you somehow edit a jQuery file directly without changing the version string.
Browser pages (including inline javascript) will get cached according to both the page settings and th... |
65,878,482 | I am upgrading Spring Cloud version from `Hoxton.SR6` to `2020.0.0` as part of Spring boot version upgrade from `2.3.4.RELEASE` to `2.4.2`.
```
<spring-cloud.version>2020.0.0</spring-cloud.version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
... | 2021/01/25 | ['https://Stackoverflow.com/questions/65878482', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1869846/'] | You should not depend on `spring-cloud-sleuth-core`, here's what you need:
* The Spring Cloud BOM: `org.springframework.cloud:spring-cloud-dependencies`
* The Sleuth starter: `org.springframework.cloud:spring-cloud-starter-sleuth`
* The Zipkin module (if you want to send traces there): `org.springframework.cloud:sprin... | Just add this dependecy:
```
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-core</artifactId>
<version>2.2.8.RELEASE</version>
</dependency>
``` |
9,417,618 | I'm getting permissions errors while trying to deploy my rails app to a friend's server. I'm running rails 3.1.3, ruby-1.9.2-p290, capistrano 2.11.2, Mac OS 10.6.8, and we have ssh keys set up. However, we can't figure out where the permission issues are coming from. We think it might be that capistrano is trying to pu... | 2012/02/23 | ['https://Stackoverflow.com/questions/9417618', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1034602/'] | You've almost certainly diagnosed this issue correctly; you're trying to check out the github repository as the deploy user and the forwarded key isn't being set up correctly. It looks like you have forward\_agent turned on in Capistrano... are you adding your key to your agent so that it gets forwarded correctly?
Try... | Problem solved. The virtual host was created by cloning an existing one and changing the IP. I updated the /etc/hosts file to use the new hostname, but apparently not the new IP. So when the deploy user was trying to ssh as the git user... it was failing because there is no git user on the IP it was using. |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | **Basic hygiene**
Have you any idea what happens to a dead body if you just leave it lying around. It will stink, get infested with maggots, the internal organs may explode, excrement will be expelled, etc.
Obviously just using the skin (and preferably using some form of preservative) will avoid all this disgusting m... | While demons ligation to the physical plane is much more tenuous than our own they are still corporeal beings. They can move through air and earth alike but density obscures their conveyance. To realize greater advantage a demon must exist in the void of a vessel; unhindered by blood and bone. For it is the boundaries ... |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | Because they have to be removed.
This is a magic system that you're creating. By definition, the rules are also yours to define.
**Why do you need a ritual circle?**
Because demons only arrive via ritual circle.
**Why do victims have to be hollowed out like a pumpkin?**
Because when they tried it on someone who... | **Basic hygiene**
Have you any idea what happens to a dead body if you just leave it lying around. It will stink, get infested with maggots, the internal organs may explode, excrement will be expelled, etc.
Obviously just using the skin (and preferably using some form of preservative) will avoid all this disgusting m... |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | >
> Since demons are just bodiless spirits, why would a victim's insides have to be removed in order for the demon to possess them?
>
>
>
I don't know mate, that's non traditional lore and totally on you. Which sort of makes this question "opinion based" and closeable.
But if you are asking for a mythologically ... | While demons ligation to the physical plane is much more tenuous than our own they are still corporeal beings. They can move through air and earth alike but density obscures their conveyance. To realize greater advantage a demon must exist in the void of a vessel; unhindered by blood and bone. For it is the boundaries ... |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | >
> Since demons are just bodiless spirits, why would a victim's insides have to be removed in order for the demon to possess them?
>
>
>
I don't know mate, that's non traditional lore and totally on you. Which sort of makes this question "opinion based" and closeable.
But if you are asking for a mythologically ... | Evolved Protection
===================
Since demons are real it can be assume that they existed throughout our evolution.
It could be that back in time (a little after primordial soup, when skin evolved) that demons could at will take over any organic being. They did this because while they were in control they woul... |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | Because they have to be removed.
This is a magic system that you're creating. By definition, the rules are also yours to define.
**Why do you need a ritual circle?**
Because demons only arrive via ritual circle.
**Why do victims have to be hollowed out like a pumpkin?**
Because when they tried it on someone who... | Evolved Protection
===================
Since demons are real it can be assume that they existed throughout our evolution.
It could be that back in time (a little after primordial soup, when skin evolved) that demons could at will take over any organic being. They did this because while they were in control they woul... |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | Because they have to be removed.
This is a magic system that you're creating. By definition, the rules are also yours to define.
**Why do you need a ritual circle?**
Because demons only arrive via ritual circle.
**Why do victims have to be hollowed out like a pumpkin?**
Because when they tried it on someone who... | Have you ever looked at a property online but the windows are boarded up and there’s no natural light? Or gone to view a new flat only to find it’s full of a lifetime’s-worth of clutter and cardboard boxes? It’s the supernatural equivalent of that.
Demons simply won’t want to inhabit a body if it’s cluttered up with ... |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | **Basic hygiene**
Have you any idea what happens to a dead body if you just leave it lying around. It will stink, get infested with maggots, the internal organs may explode, excrement will be expelled, etc.
Obviously just using the skin (and preferably using some form of preservative) will avoid all this disgusting m... | Have you ever looked at a property online but the windows are boarded up and there’s no natural light? Or gone to view a new flat only to find it’s full of a lifetime’s-worth of clutter and cardboard boxes? It’s the supernatural equivalent of that.
Demons simply won’t want to inhabit a body if it’s cluttered up with ... |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | >
> Since demons are just bodiless spirits, why would a victim's insides have to be removed in order for the demon to possess them?
>
>
>
I don't know mate, that's non traditional lore and totally on you. Which sort of makes this question "opinion based" and closeable.
But if you are asking for a mythologically ... | ### Demons are corporeal on Earth
Demons may be incorporate in the netherworld, but on Earth they must be corporeal. After all, every creature with a will on the Earth is corporeal. Ghosts? Those are just stories.
If a demon comes through the portal from the netherworld, then its essence takes a corporeal form on thi... |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | >
> Since demons are just bodiless spirits, why would a victim's insides have to be removed in order for the demon to possess them?
>
>
>
I don't know mate, that's non traditional lore and totally on you. Which sort of makes this question "opinion based" and closeable.
But if you are asking for a mythologically ... | Have you ever looked at a property online but the windows are boarded up and there’s no natural light? Or gone to view a new flat only to find it’s full of a lifetime’s-worth of clutter and cardboard boxes? It’s the supernatural equivalent of that.
Demons simply won’t want to inhabit a body if it’s cluttered up with ... |
129,645 | Demons are incorporate, malicious spirits from the depths of hell. They require a human form in order to pass into the mortal realm. A dark sorcerer can sacrifice an individual in order to trap a demon in the victims body, enslaving the spirit to their will. This is a risky process that can come back to harm the user i... | 2018/11/08 | ['https://worldbuilding.stackexchange.com/questions/129645', 'https://worldbuilding.stackexchange.com', 'https://worldbuilding.stackexchange.com/users/52361/'] | Because they have to be removed.
This is a magic system that you're creating. By definition, the rules are also yours to define.
**Why do you need a ritual circle?**
Because demons only arrive via ritual circle.
**Why do victims have to be hollowed out like a pumpkin?**
Because when they tried it on someone who... | ### Demons are corporeal on Earth
Demons may be incorporate in the netherworld, but on Earth they must be corporeal. After all, every creature with a will on the Earth is corporeal. Ghosts? Those are just stories.
If a demon comes through the portal from the netherworld, then its essence takes a corporeal form on thi... |
5,127,797 | Has a way to get the datatype in C?
For example:
```
int foo;
if (foo is int)
{
// do something
}
```
or something like:
```
if (typeof(foo) == typeof(int))
{
// do something
}
```
Thanks in advance. | 2011/02/26 | ['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/'] | This is called type introspection or reflection and is not supported by the C language. You would probably have to write your own reflection library, and it would be a significant effort. | There is a `typeof` extension in GCC, but it's not in ANSI C: <http://tigcc.ticalc.org/doc/gnuexts.html#SEC69> |
5,127,797 | Has a way to get the datatype in C?
For example:
```
int foo;
if (foo is int)
{
// do something
}
```
or something like:
```
if (typeof(foo) == typeof(int))
{
// do something
}
```
Thanks in advance. | 2011/02/26 | ['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/'] | This is called type introspection or reflection and is not supported by the C language. You would probably have to write your own reflection library, and it would be a significant effort. | The fact that `foo` is an `int` is bound to the name `foo`. It can never change. So how would such a test be meaningful? The only case it could be useful at all is in macros, where `foo` could expand to different-type variables or expressions. In that case, you could look at some of my past questions related to the top... |
5,127,797 | Has a way to get the datatype in C?
For example:
```
int foo;
if (foo is int)
{
// do something
}
```
or something like:
```
if (typeof(foo) == typeof(int))
{
// do something
}
```
Thanks in advance. | 2011/02/26 | ['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/'] | This is called type introspection or reflection and is not supported by the C language. You would probably have to write your own reflection library, and it would be a significant effort. | The only time you wouldn't know the type is if the type of foo is defined by a typedef -- if that's the case, your example should reflect it. And why do you need to something dependent on the type? There may well be a way to solve your actual problem, but you haven't presented your actual problem. |
5,127,797 | Has a way to get the datatype in C?
For example:
```
int foo;
if (foo is int)
{
// do something
}
```
or something like:
```
if (typeof(foo) == typeof(int))
{
// do something
}
```
Thanks in advance. | 2011/02/26 | ['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/'] | This is called type introspection or reflection and is not supported by the C language. You would probably have to write your own reflection library, and it would be a significant effort. | Since C11, you can do that with `_Generic`:
```
if (_Generic(foo, int: 1, default: 0)) // if(typeof(foo)==int)
{
// do something
}
``` |
5,127,797 | Has a way to get the datatype in C?
For example:
```
int foo;
if (foo is int)
{
// do something
}
```
or something like:
```
if (typeof(foo) == typeof(int))
{
// do something
}
```
Thanks in advance. | 2011/02/26 | ['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/'] | There is a `typeof` extension in GCC, but it's not in ANSI C: <http://tigcc.ticalc.org/doc/gnuexts.html#SEC69> | The only time you wouldn't know the type is if the type of foo is defined by a typedef -- if that's the case, your example should reflect it. And why do you need to something dependent on the type? There may well be a way to solve your actual problem, but you haven't presented your actual problem. |
5,127,797 | Has a way to get the datatype in C?
For example:
```
int foo;
if (foo is int)
{
// do something
}
```
or something like:
```
if (typeof(foo) == typeof(int))
{
// do something
}
```
Thanks in advance. | 2011/02/26 | ['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/'] | There is a `typeof` extension in GCC, but it's not in ANSI C: <http://tigcc.ticalc.org/doc/gnuexts.html#SEC69> | Since C11, you can do that with `_Generic`:
```
if (_Generic(foo, int: 1, default: 0)) // if(typeof(foo)==int)
{
// do something
}
``` |
5,127,797 | Has a way to get the datatype in C?
For example:
```
int foo;
if (foo is int)
{
// do something
}
```
or something like:
```
if (typeof(foo) == typeof(int))
{
// do something
}
```
Thanks in advance. | 2011/02/26 | ['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/'] | The fact that `foo` is an `int` is bound to the name `foo`. It can never change. So how would such a test be meaningful? The only case it could be useful at all is in macros, where `foo` could expand to different-type variables or expressions. In that case, you could look at some of my past questions related to the top... | The only time you wouldn't know the type is if the type of foo is defined by a typedef -- if that's the case, your example should reflect it. And why do you need to something dependent on the type? There may well be a way to solve your actual problem, but you haven't presented your actual problem. |
5,127,797 | Has a way to get the datatype in C?
For example:
```
int foo;
if (foo is int)
{
// do something
}
```
or something like:
```
if (typeof(foo) == typeof(int))
{
// do something
}
```
Thanks in advance. | 2011/02/26 | ['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/'] | The fact that `foo` is an `int` is bound to the name `foo`. It can never change. So how would such a test be meaningful? The only case it could be useful at all is in macros, where `foo` could expand to different-type variables or expressions. In that case, you could look at some of my past questions related to the top... | Since C11, you can do that with `_Generic`:
```
if (_Generic(foo, int: 1, default: 0)) // if(typeof(foo)==int)
{
// do something
}
``` |
5,127,797 | Has a way to get the datatype in C?
For example:
```
int foo;
if (foo is int)
{
// do something
}
```
or something like:
```
if (typeof(foo) == typeof(int))
{
// do something
}
```
Thanks in advance. | 2011/02/26 | ['https://Stackoverflow.com/questions/5127797', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/464230/'] | Since C11, you can do that with `_Generic`:
```
if (_Generic(foo, int: 1, default: 0)) // if(typeof(foo)==int)
{
// do something
}
``` | The only time you wouldn't know the type is if the type of foo is defined by a typedef -- if that's the case, your example should reflect it. And why do you need to something dependent on the type? There may well be a way to solve your actual problem, but you haven't presented your actual problem. |
24,306,512 | When rotating a group in fabric.js, the .left and .top values of the group "jump". Is that a fabric.js bug or somehow explainable/intended?
```
group.on "moving", ->
#Yields values of about 100 px, also after the group was rotated
group.on "rotating", ->
#Yields values of about 130 px
```
JSFiddle -> <http:... | 2014/06/19 | ['https://Stackoverflow.com/questions/24306512', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/377671/'] | The difference is due to the originX and originY values changing upon rotation. originX and originY will become 'center' in place of their typical values of 'left' and 'top'. I encountered a similar issue where the positioning would change and found that I needed to be aware of the origin values. | I faced similar problem, but not with group, but single object.
Solution for me was not taking the top and left positions of rotated object, but top left Oocord x and y position.
For example:
```
fabricPlace.on('object:modified', function(event){
var object = event.target;
var save = {};
save.position = {};
save.id... |
56,464,704 | I have release apk with signed keys but it's not installing on android devices, its shows this message "**The apk failed to install
Error: Could not parse error string"** but debugging mode apk, the app works fine.
release command
flutter build apk --release.
I did follow this [question](https://stackoverflow.com/qu... | 2019/06/05 | ['https://Stackoverflow.com/questions/56464704', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6654129/'] | If you're trying to install a signed APK after using a debugging mode APK, Android will detect differences in signature, and refuse to install it.
Make sure you've uninstalled the unsigned debugging APK first from the device, and try to install again. | Please check available disk space on the target Android Device before doing any actions.
For most of cases it is a due to insuffisant space on the device. |
20,363,283 | Cannot increment variable `N` by 1 using `is/2` predicate. `N` is always 0 in the repeat loop. Why? How to increment it?
```
:- dynamic audible/1, flashes/1,tuned/1.
audible(false).
flashes(false).
tuned(false).
turn :-
N is 0 ,
repeat ,
(
incr(N,N1) ,
N1 =:= 5000 ,
audible(true) ,
flashes... | 2013/12/03 | ['https://Stackoverflow.com/questions/20363283', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/480632/'] | Because `N is 0`. Variables in Prolog are not [assignables](https://existentialtype.wordpress.com/2012/02/01/words-matter/). Here's what happens if you trace your loop:
```
?- trace, turn.
Call: (7) turn ?
Call: (8) _G492 is 0 ?
Exit: (8) 0 is 0 ?
Call: (8) repeat ?
Exit: (8) repeat ?
Call: (8) incr(0, _G493) ?
... | I haven't a clue what you're trying to accomplish here, but it would appear that you're trying to write procedural prolog code.
It doesn't work.
Prolog variables are write-once: having been unified with an object they cease to be variable. They become that object, until that unification is undone via backtracking.
Y... |
47,974,629 | app.component.html:
```
<div class="container">
<router-outlet></router-outlet>
</div>
```
child1.componet.html:
```
<div class="panel panel-primary ">
<div class="panel-heading">
........
</div>
</div>
```
child1.component.ts
```
@Component({
selector: 'tb-child1',
templateUrl: './child1.component.html... | 2017/12/26 | ['https://Stackoverflow.com/questions/47974629', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3968098/'] | I can override the parent class in Child's css class by disabling the view encapsulaion like below in my child component
```
encapsulation: ViewEncapsulation.None
``` | Please try like this
**app.component.html:**
```
<div class="container subclass">
<router-outlet></router-outlet>
</div>
```
In your **child1.component.css** add the below code
```
.container.subclass {width: 1500px !important;}
``` |
62,282 | I would like to know if there are more than one decimal in bitcoin numbers. While playing online slots with Bitcoin, I hit a big win for 100900 x 5 credits totaling 5207.17.The total was displayed as 5,207.17 Please explain to me how this is supposed to exactly read.
Thank you | 2017/11/09 | ['https://bitcoin.stackexchange.com/questions/62282', 'https://bitcoin.stackexchange.com', 'https://bitcoin.stackexchange.com/users/38558/'] | A Bitcoin is divisible down to 8 decimal places (that is x.xxxxxxxx). | There are 8 decimal places behind the decimal point to a bit coin.
There are only 2 decimal places behind the decimal point, legally allowed to equate the Australian dollar.
There fore if your rates notice not invoice depicts the R.I.D rate in dollar as
00.00466450
X Deliberatly Under valued home to 1/3 C.I.V:-
$333... |
62,282 | I would like to know if there are more than one decimal in bitcoin numbers. While playing online slots with Bitcoin, I hit a big win for 100900 x 5 credits totaling 5207.17.The total was displayed as 5,207.17 Please explain to me how this is supposed to exactly read.
Thank you | 2017/11/09 | ['https://bitcoin.stackexchange.com/questions/62282', 'https://bitcoin.stackexchange.com', 'https://bitcoin.stackexchange.com/users/38558/'] | Its common for sites to measure coins in milli- or micro-bitcoins, one milli-bitcoin is a thousandth of a bitcoin while a micro-bitcoin is a millionth of a bitcoin.
1 BTC = 1,000,000 µBTC (micro-bitcoin)
1 BTC = 1,000 mBTC (milli-bitcoin)
1 µBTC = 100 Satoshi
I'm not sure what website you are using, but I would he... | There are 8 decimal places behind the decimal point to a bit coin.
There are only 2 decimal places behind the decimal point, legally allowed to equate the Australian dollar.
There fore if your rates notice not invoice depicts the R.I.D rate in dollar as
00.00466450
X Deliberatly Under valued home to 1/3 C.I.V:-
$333... |
21,141 | One of the things I really hate about 2010 and the packaging solution that comes out-of-the box is that it encourages bad practices (plopping everything - web code, static artifacts, packaging) into one project.
There are lots of issues with this, but the most egregious issue -- in my opinion -- is that it forces the ... | 2011/10/11 | ['https://sharepoint.stackexchange.com/questions/21141', 'https://sharepoint.stackexchange.com', 'https://sharepoint.stackexchange.com/users/803/'] | After installing SP1, you need to install the latest Cumulative Update (CU), which is currently the Aug 2011 CU. After running that CU you'll need to re-run the SharePoint Product config wizard again after that is installed.
If I was doing a fresh install, I would install and configure SP2010, and run the config wizar... | The verdict is still unclear as to whether or not the latest CU is needed for SharePoint 2010, you'll hear arguments on both sides with some saying "stop at SP1 and go no further" and some saying "go on to the latest CU", I've seen farms configured both ways with no issues. You don't need to run the config wizard until... |
11,807,684 | Is there a simple method to hide the bigger part of website, display loader.gif and nicely show the content with jquery until whole DOM is ready ? How can I code it ? Ofc I do not want use AJAX, just jquery. | 2012/08/04 | ['https://Stackoverflow.com/questions/11807684', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1403568/'] | use `visibility:hidden / visible` on the part you don't want to show until dom is ready.
and once The DOM is ready ( `$('document').ready();`) , make your content visible with animation or anyway you like. | You can do it by using jQuery document.ready, which will only apply its functions/actions once the whole DOM is loaded.
You can do this by setting the body to be `visibility:hidden`, and then add a class with the document.ready function, which changes this to `visibility:visible`.
[jsFiddle](http://jsfiddle.net/wigst... |
37,289,389 | I was working with an example regarding seg fault:
```
char m[10]="dog";
strcpy(m+1,m);
```
In my centOs machine the result was as expected: segmentation fault. but on Ubuntu nothing happen. then I add a printf("%s",m); to the code on ubuntu and surprisingly I got the "ddog" as result.
I am using GCC and the ubuntu... | 2016/05/18 | ['https://Stackoverflow.com/questions/37289389', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2088861/'] | This causes [undefined behaviour](https://stackoverflow.com/a/4105123/1505939). `strcpy` may only be used between areas that do not overlap.
To fix this code you could write:
```
memmove(m+1, m, strlen(m) + 1);
``` | The memory for `m` is:
```
+---+---+---+---+---+---+---+---+---+---+
| | | | | | | | | | |
+---+---+---+---+---+---+---+---+---+---+
```
Whe you initialize it with:
```
char m[10] = "dog";
```
the first four elements `m` are initialized. The rest are initialized.
```
+---+---+---+----+---+---... |
28,301,641 | I want to write a small console application (C# 4.0/4.5) that will serve as a logger to a remote database. Said application could be called from numerous peripheral automation components/programs, not of all which will be .NET based. (calls would be made via commandline: e.g., logme.exe appID, taskID, statusID, msg)
Q... | 2015/02/03 | ['https://Stackoverflow.com/questions/28301641', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4155665/'] | I found a way, by using an inset drawable:
First, create a new inset drawable (e.g. radio\_button\_inset.xml) with your desired padding and a link to the theme radio button drawable like this:
```
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="?android:attr/listChoiceIndicat... | Try using paddingStart on the [RadioGroup](http://developer.android.com/reference/android/widget/RadioGroup.html). Since it's extends from a ViewGroup, [LinearLayout](http://developer.android.com/reference/android/widget/LinearLayout.html), all of the child elements will be affected.
```
<RadioGroup
android:layout... |
52,738,149 | [enter image description here](https://i.stack.imgur.com/ZRDlD.png)I have 2 different datagrid, the first DG1 is my item list and DG2 is the item queues for purchased items. My goal is whenever i click an item in DG2, DG1 is also selected with the same name or id. I want to ignore the index because my item queue is dif... | 2018/10/10 | ['https://Stackoverflow.com/questions/52738149', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7725975/'] | You can always create models:
```
export class User {
id: string,
username: string,
first_name: string,
last_name: string,
email: string,
is_active: boolean,
is_superuser: boolean
}
export class UserDetails{
user:User;
role:string;
}
```
Then:
```
// Assume you have received the json in string form in
're... | `this.userData["role"] = this.user.role` should be `this.userData["role"] = this.role` |
52,738,149 | [enter image description here](https://i.stack.imgur.com/ZRDlD.png)I have 2 different datagrid, the first DG1 is my item list and DG2 is the item queues for purchased items. My goal is whenever i click an item in DG2, DG1 is also selected with the same name or id. I want to ignore the index because my item queue is dif... | 2018/10/10 | ['https://Stackoverflow.com/questions/52738149', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7725975/'] | I think the best way is, create an Object corresponding with the JSON's structure and you assign just the data JSON to the Array of the object.
```js
class User{
id:string;
username:string;
firstName:string;
lastName:string;
email:string;
isActive:boolean;
isSuperviser:boolean;
}
class JSONData{
... | `this.userData["role"] = this.user.role` should be `this.userData["role"] = this.role` |
52,738,149 | [enter image description here](https://i.stack.imgur.com/ZRDlD.png)I have 2 different datagrid, the first DG1 is my item list and DG2 is the item queues for purchased items. My goal is whenever i click an item in DG2, DG1 is also selected with the same name or id. I want to ignore the index because my item queue is dif... | 2018/10/10 | ['https://Stackoverflow.com/questions/52738149', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7725975/'] | You can always create models:
```
export class User {
id: string,
username: string,
first_name: string,
last_name: string,
email: string,
is_active: boolean,
is_superuser: boolean
}
export class UserDetails{
user:User;
role:string;
}
```
Then:
```
// Assume you have received the json in string form in
're... | No need to convert. It s already json format but you should use array index then set user variable.
For example :
```
let user:any = {};
user = this.user[arrayIndex].user;
this.userData["user"] = user
this.userData["role"] = this.user[arrayIndex].role;
```
if you want o get data from json array , you should use ... |
52,738,149 | [enter image description here](https://i.stack.imgur.com/ZRDlD.png)I have 2 different datagrid, the first DG1 is my item list and DG2 is the item queues for purchased items. My goal is whenever i click an item in DG2, DG1 is also selected with the same name or id. I want to ignore the index because my item queue is dif... | 2018/10/10 | ['https://Stackoverflow.com/questions/52738149', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7725975/'] | I think the best way is, create an Object corresponding with the JSON's structure and you assign just the data JSON to the Array of the object.
```js
class User{
id:string;
username:string;
firstName:string;
lastName:string;
email:string;
isActive:boolean;
isSuperviser:boolean;
}
class JSONData{
... | No need to convert. It s already json format but you should use array index then set user variable.
For example :
```
let user:any = {};
user = this.user[arrayIndex].user;
this.userData["user"] = user
this.userData["role"] = this.user[arrayIndex].role;
```
if you want o get data from json array , you should use ... |
52,738,149 | [enter image description here](https://i.stack.imgur.com/ZRDlD.png)I have 2 different datagrid, the first DG1 is my item list and DG2 is the item queues for purchased items. My goal is whenever i click an item in DG2, DG1 is also selected with the same name or id. I want to ignore the index because my item queue is dif... | 2018/10/10 | ['https://Stackoverflow.com/questions/52738149', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7725975/'] | You can always create models:
```
export class User {
id: string,
username: string,
first_name: string,
last_name: string,
email: string,
is_active: boolean,
is_superuser: boolean
}
export class UserDetails{
user:User;
role:string;
}
```
Then:
```
// Assume you have received the json in string form in
're... | I think the best way is, create an Object corresponding with the JSON's structure and you assign just the data JSON to the Array of the object.
```js
class User{
id:string;
username:string;
firstName:string;
lastName:string;
email:string;
isActive:boolean;
isSuperviser:boolean;
}
class JSONData{
... |
51,924,559 | I am new to JS and rails so recently facing lots of difficulties about using ajax in rails environment. I will very appreciate if you contribute to developing my project. What I am trying to do is that Once a user selects data from the modal, I want to send the selected data to an action in the controller so that I can... | 2018/08/20 | ['https://Stackoverflow.com/questions/51924559', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8592732/'] | Please check script below
```
<script>
$(function(){
$(document).ready(function(){
$("#save").click(function(){
var checkedItem = [];
$.each($("input[name='selected']:checked"), function(){
checkedItem.push($(this).val());
});
$('#values').html("selected values are: " + check... | For simplicity you can inject rails path to that controller as dataset attribute.
for e.g
```
<form method="post" data-url="<%= tasks_path %>">
```
and in js part
```
$('#save').on('click', function (e) {
e.preventDefault();
$.ajax({
type: $(this).method || "GET",
url: this.dataset.url,
... |
49,578,996 | I am getting error like
```
/hackerearth/CPP14_28/s_e3.cpp: In function ‘int main()’: /hackerearth/CPP14_28/s_e3.cpp:6:10: error: declaration of ‘auto x’ has no initializer auto x; ^
```
My code is ,
```
#include <iostream>
using namespace std;
int main()
{
auto x;
cin >> x;
cout << x;
return 0;
... | 2018/03/30 | ['https://Stackoverflow.com/questions/49578996', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1119372/'] | You're misusing the `auto` keyword. **The type that actually gets used is determined by the value used to initialize the variable at compile time.** It has nothing to do with the ability to determine the type of variable to use at runtime.
For example, if you write `auto x = 0`, the compiler sees that you're initializ... | Objects declared with auto typing need to copy their static type from their initializers; What your 'x' is missing.
C++ - just like C - is a statically typed language. Extra string processing is needed to decode the input string value. If the set of possible types is limited to a known countable set, a proper std::vari... |
64,324,695 | I have the following table.
```
Fights (fight_year, fight_round, winner, fid, city, league)
```
I am trying to query the following:
For each year that appears in the Fights table, find the city that held the most fights. For example, if in year 1992, Jersey held more fights than any other city did, you should print... | 2020/10/12 | ['https://Stackoverflow.com/questions/64324695', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9905254/'] | * If the `pandas.Series` have been converted to a `datetime` format, they will not contain `None`, they will contain `NaT`, which leads me to think, the `Series` are not formatted as `datetime` objects.
* Given a `pandas.DataFrame` with two columns of dates
* Convert the columns to a datetime, with `pandas.to_datetime`... | It can't perform the operations on `NoneTypes` so just handle separately with a try/except block.
```
def date_check(x, y):
try:
return (np.abs(x - y)) > timedelta(minutes=10)
except:
return True
``` |
44,162,581 | I want to run a script where I can specifically select ID tag where parameters are
**\_string\_n\_n**
where *'\_string'* = release (in this case) and *'n'* = are numbers #
e.g. **\_release\_8\_3**
Here's my code... where I wan to run the script and get content of tag where ID matches \_string\_n\_n
```
<d... | 2017/05/24 | ['https://Stackoverflow.com/questions/44162581', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5326191/'] | Select all elements with an ID containing the following string (in this case `_release_`:
`document.querySelectorAll("[id*='_release_']");`
In jQuery: `$("[id*='_release_']")`
Here are [more wildcards](https://stackoverflow.com/a/8714421/1451422) if you need a different reaction.
```js
console.dir(document.querySel... | e.g. \_release\_8\_3
```
var string = 'release';
var number1 = 8;
var number2 = 3;
var selector = '#_'+ [ string, number1, number2 ].join( '_' );
var element = $(selector);
element = document.querySelector(selector);
element = document.getElementById('_'+ [ string, number1, number2 ].join( '_' ) );
```
Have... |
19,422,647 | I'm new in using codeigniter so am a bit confused now.
When I pass the players data object to the view, it lists all correctly. I'm trying to use codeigniter's pagination.
I loaded the pagination in a function in my controller:
```
public function playersHub(){
$playersData = $this->cms_model->getAllPlayers();
... | 2013/10/17 | ['https://Stackoverflow.com/questions/19422647', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2889753/'] | 1.Load the pagination library first:
```
$this->load->library('pagination');
```
2.Return the correct count from the database, make a different function to return the total count. dont count the data returned by the `getAllPlayers()`. Use `getAllPlayers()` to return `20 (per_page)` data to show in the page dependin... | Something like this
```
public function playersHub(){
$playersData = $this->cms_model->getAllPlayers();
$pageConf = array(
'base_url' => base_url('home/playersHub/'),
'total_rows' => count($playersData),
'per_page' => 20,
'uri_segment' => 3,
);
$this->pagination->initialize($pageConf);
//get the start... |
18,233,232 | I want to create an ul li tree menu based on html and css only, maybe a small jQuery.
so this is my html:
```
<div class="wfm">
<ul class="firstUl">
<li>
<span>Parent1</span>
<ul>
<li>
<span>Parent2</span>
... | 2013/08/14 | ['https://Stackoverflow.com/questions/18233232', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1192687/'] | Well, why not leverage details/summary elements of HTML5.1? It requires no JavaScript and customizable via CSS. Here an example
```
<details class="tree-nav__item is-expandable">
<summary class="tree-nav__item-title">The Realm of the Elderlings</summary>
<details class="tree-nav__item is-expandable">
... | Just created a single HTML with CSS and JS embedded for this kind of task.
[GitHub repo](https://github.com/Leedehai/expandable-tree-list), the link will stay valid as I have no plan to remove it. |
46,272,260 | I need help making my module accept my newly generated pages. In my terminal I used the ionic command `ionic generate page` to create two new pages in my file tree. One called privacy-policy and the other terms-of-use.
It built the new pages just fine:
\*\*privacy policy page \*\*
```
/*
Generated class for the Pr... | 2017/09/18 | ['https://Stackoverflow.com/questions/46272260', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1319386/'] | 1. Check if its name is precisely `pre-push` (not `pre-push.sh`, not `pre-push.py`, precisely `pre-push`, with no file extension).
2. Check if it's in `.git/hooks/`. If you have set `core.hooksPath=xxx` in the config, make sure it's under the directory `xxx`.
3. Check if it's executable.
4. Check if the user that runs ... | for your short description,I can't locate the reason. But you can try`husky` or `ghooks`.
`husky` or `ghooks` provide git hooks,such as `precommit`,`prepush`:
```
//husky
{
"scripts": {
"precommit": "npm test",
"prepush": "npm run coverage",
"...": "..."
}
}
``` |
46,272,260 | I need help making my module accept my newly generated pages. In my terminal I used the ionic command `ionic generate page` to create two new pages in my file tree. One called privacy-policy and the other terms-of-use.
It built the new pages just fine:
\*\*privacy policy page \*\*
```
/*
Generated class for the Pr... | 2017/09/18 | ['https://Stackoverflow.com/questions/46272260', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1319386/'] | check .git/hooks. If it's empty try to uninstall husky and install again. my sh history
```
ls .git/hooks
npm uninstall husky
npm i husky -D
ls .git/hooks
```
it helped me | for your short description,I can't locate the reason. But you can try`husky` or `ghooks`.
`husky` or `ghooks` provide git hooks,such as `precommit`,`prepush`:
```
//husky
{
"scripts": {
"precommit": "npm test",
"prepush": "npm run coverage",
"...": "..."
}
}
``` |
46,272,260 | I need help making my module accept my newly generated pages. In my terminal I used the ionic command `ionic generate page` to create two new pages in my file tree. One called privacy-policy and the other terms-of-use.
It built the new pages just fine:
\*\*privacy policy page \*\*
```
/*
Generated class for the Pr... | 2017/09/18 | ['https://Stackoverflow.com/questions/46272260', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1319386/'] | 1. Check if its name is precisely `pre-push` (not `pre-push.sh`, not `pre-push.py`, precisely `pre-push`, with no file extension).
2. Check if it's in `.git/hooks/`. If you have set `core.hooksPath=xxx` in the config, make sure it's under the directory `xxx`.
3. Check if it's executable.
4. Check if the user that runs ... | check .git/hooks. If it's empty try to uninstall husky and install again. my sh history
```
ls .git/hooks
npm uninstall husky
npm i husky -D
ls .git/hooks
```
it helped me |
47,318,119 | I am trying to wrap a Python script into an exe using PyInstaller (development version) for windows.
The script uses Pandas and I have been running into an error when running the exe.
```
Traceback (most recent call last): File "site-packages\pandas\__init__.py", line 26, in <module> File "C:\Users\Eddie\Anacond... | 2017/11/15 | ['https://Stackoverflow.com/questions/47318119', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8436718/'] | PyInstaller 3.3, Pandas 0.21.0, Python 3.6.1.
I was able to solve this thanks to not-yet published/committed fix to PyInstaller, see [this](https://github.com/pyinstaller/pyinstaller/issues/2978) and [this](https://github.com/lneuhaus/pyinstaller/blob/017b247064f9bd51a620cfb2172c05d63fc75133/PyInstaller/hooks/hook-pan... | I'm not sure it may help you but following the solution on the post you mention work for me with python 3.6 pyinstaller 3.3 and pandas 0.21.0 on windows 7.
So adding this to the spec file just after analysis :
```
def get_pandas_path():
import pandas
pandas_path = pandas.__path__[0]
return pandas_path
di... |
47,318,119 | I am trying to wrap a Python script into an exe using PyInstaller (development version) for windows.
The script uses Pandas and I have been running into an error when running the exe.
```
Traceback (most recent call last): File "site-packages\pandas\__init__.py", line 26, in <module> File "C:\Users\Eddie\Anacond... | 2017/11/15 | ['https://Stackoverflow.com/questions/47318119', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8436718/'] | I'm not sure it may help you but following the solution on the post you mention work for me with python 3.6 pyinstaller 3.3 and pandas 0.21.0 on windows 7.
So adding this to the spec file just after analysis :
```
def get_pandas_path():
import pandas
pandas_path = pandas.__path__[0]
return pandas_path
di... | If you are using Anaconda, it is highly likely that when you were trying to uninstall some package it has disrupted pandas dependency and unable to get the required script. If you just run `conda install pandas` you might end up with another error:
>
> `module 'pandas' has no attribute 'compat'`.
>
>
>
So, try un... |
47,318,119 | I am trying to wrap a Python script into an exe using PyInstaller (development version) for windows.
The script uses Pandas and I have been running into an error when running the exe.
```
Traceback (most recent call last): File "site-packages\pandas\__init__.py", line 26, in <module> File "C:\Users\Eddie\Anacond... | 2017/11/15 | ['https://Stackoverflow.com/questions/47318119', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8436718/'] | PyInstaller 3.3, Pandas 0.21.0, Python 3.6.1.
I was able to solve this thanks to not-yet published/committed fix to PyInstaller, see [this](https://github.com/pyinstaller/pyinstaller/issues/2978) and [this](https://github.com/lneuhaus/pyinstaller/blob/017b247064f9bd51a620cfb2172c05d63fc75133/PyInstaller/hooks/hook-pan... | I managed to solve this problem by using the "--hidden-import" flag. Hopefully this can be helpful to someone else that comes across this thread.
```
pyinstaller --onefile --hidden-import pandas._libs.tslibs.timedeltas myScript.py
``` |
47,318,119 | I am trying to wrap a Python script into an exe using PyInstaller (development version) for windows.
The script uses Pandas and I have been running into an error when running the exe.
```
Traceback (most recent call last): File "site-packages\pandas\__init__.py", line 26, in <module> File "C:\Users\Eddie\Anacond... | 2017/11/15 | ['https://Stackoverflow.com/questions/47318119', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8436718/'] | PyInstaller 3.3, Pandas 0.21.0, Python 3.6.1.
I was able to solve this thanks to not-yet published/committed fix to PyInstaller, see [this](https://github.com/pyinstaller/pyinstaller/issues/2978) and [this](https://github.com/lneuhaus/pyinstaller/blob/017b247064f9bd51a620cfb2172c05d63fc75133/PyInstaller/hooks/hook-pan... | If you are using Anaconda, it is highly likely that when you were trying to uninstall some package it has disrupted pandas dependency and unable to get the required script. If you just run `conda install pandas` you might end up with another error:
>
> `module 'pandas' has no attribute 'compat'`.
>
>
>
So, try un... |
47,318,119 | I am trying to wrap a Python script into an exe using PyInstaller (development version) for windows.
The script uses Pandas and I have been running into an error when running the exe.
```
Traceback (most recent call last): File "site-packages\pandas\__init__.py", line 26, in <module> File "C:\Users\Eddie\Anacond... | 2017/11/15 | ['https://Stackoverflow.com/questions/47318119', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8436718/'] | I managed to solve this problem by using the "--hidden-import" flag. Hopefully this can be helpful to someone else that comes across this thread.
```
pyinstaller --onefile --hidden-import pandas._libs.tslibs.timedeltas myScript.py
``` | If you are using Anaconda, it is highly likely that when you were trying to uninstall some package it has disrupted pandas dependency and unable to get the required script. If you just run `conda install pandas` you might end up with another error:
>
> `module 'pandas' has no attribute 'compat'`.
>
>
>
So, try un... |
39,528,273 | I have this file with 20k+ IPs inside:
```
104.20.15.220,104.20.61.219,104.20.62.219,104.20.73.221,104.20.74.221,104.20.14.220
104.20.15.220,104.20.73.221,104.20.74.221,104.25.195.107,104.25.196.107,104.20.14.220
91.215.154.209
...
```
The question is how to split in into single IPs on each string:
```
104.20.15.22... | 2016/09/16 | ['https://Stackoverflow.com/questions/39528273', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5311904/'] | Just replace a comma with a new line with either of these commands:
```
tr ',' '\n' < file
sed 's/,/\n/g' file
perl 's/,/\n/g' file
awk 'gsub(/,/,"\n")' file
```
... or match every block of text up to a comma or the end of line:
```
grep -oP '.*?(?=,|$)' file
```
... or loop through the fields and print them:
... | This will transform all the commands into newline.
```
tr ',' '\n' <filename
```
or
```
awk 'BEGIN{FS=",";OFS="\n"}{$1=$1}1' filename
``` |
976,120 | I have a PHP script running that lists files in a certain directory on the server. Is there any way to access the file's icon metadata? Lots of issues with this I suppose (eg: depends on the OS hosting the script. depends on whether the file is using a custom icon. still have to convert the icn file to something that c... | 2009/06/10 | ['https://Stackoverflow.com/questions/976120', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4939/'] | You might be able to plug into the /icons folder that most apache installations have setup for their default directory listings.
It's not OS dependent at least.
You should be able to craft a url that displays an icon for a particular extension. | [GDLib](http://php.oregonstate.edu/manual/en/book.image.php) or [ImageMagic](http://php.oregonstate.edu/manual/en/book.imagick.php) possibly is that what you are looking for... But if you want to access metadata GDLib won't help. Not sure about ImageMagic.
Actually, you can create thumbnails with their help and cache... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.