text:
Q: Number of paths through infinite trees with given "growth rates" (Preface: This may be a naive or easy question for experts....)
Consider an infinite tree, rooted on the left, where each node has two children; the number of nodes at each level (distance from the root) $n$ is $f(n) = 2^n$.
The number of paths is $2^{\omega}$, the cardinality of the continuum (uncountable).

Now consider a similar tree where only one node at each level has an extra child; the number of nodes at each level $n$ is $f(n) = n+1$. In this case, the number of paths is $\omega$; the paths here are countable.

My question is, what happens in between?
I would formalize the setting as follows (but maybe I have some details wrong): Suppose I have an infinite rooted tree, where each node has at least one child, and the number of nodes at distance $n$ from the root is $f(n)$ where $n \leq f(n) \leq 2^n$. Then what can we say about the number of paths in terms of the "growth rate" $f$?

For example, if the "growth rate" is polynomial, must there be a countable number of paths? Are there growth rate functions for which the cardinality of the number of paths is independent of ZFC, i.e. depends on the continuum hypothesis? Any other notes/comments?

A: As explained in the various comments,

*

*every tree has countably many or $2^\omega$ branches,

*there are trees with $2^\omega$ branches of any unbounded admissible growth rate $f(n)$, and

*if nodes can have arbitrarily many children, there are countable trees of arbitrary growth rate.
As Joel already mentioned, the question that remains is for which growth rates $f(n)$ there exist trees with countably many branches where every node has one or two children. (Below, I will assume the latter condition automatically, and call them just "trees".)
Now, even for this question, the absolute growth rate is largely irrelevant, what really matters is how $f(n+1)$ relates to $f(n)$, as demonstrated by the following example.
First, let me define for convenience that $f\colon\mathbb N\to\mathbb N$ is admissible if there exists a tree of growth rate $f(n)$. This is equivalent to the conditions

*

*$f(0)=1$,

*$f(n)\le f(n+1)\le2f(n)$ for every $n\in\mathbb N$.
The question also demands $f(n)\ge n$, but as Joel notes, this has no good reason, so I will state this explicitly where intended.

Example:

*

*For every function $g\colon\mathbb N\to\mathbb N^{>0}$ such that $\lim_ng(n)=+\infty$, there is an admissible function $f(n)\le g(n)$ such that every tree of growth rate $f(n)$ has $2^\omega$ branches.

*There is an admissible function $f$ such that $n\le f(n)\le2n$ for $n>0$, and every tree of growth rate $f(n)$ has $2^\omega$ branches.

Proof: For 1, we can choose an infinite sequence $0=n_0<n_1<n_2<\dots$ such that $g(n)\ge2^k$ for every $n\ge n_k$, and define
$$f(n)=2^k\text{ for }n_k\le n<n_{k+1}.$$
If $T$ is a tree of growth rate $f(n)$, all nodes at levels $n_k-1$ split, hence $T$ has $2^\omega$ branches.
The argument for 2 is similar: we fix a sequence $n_0,n_1,\dots$ such that $2n_k<n_{k+1}$ for every $k$, and put
$$f(n)=\begin{cases}n&n\le n_0\text{ or }2n_k\le n\le n_{k+1},\\
2n_k&n_k<n\le2n_k.\end{cases}$$
Again, all nodes at levels $n_k$ split.

It is in fact possible to characterize exactly what growth rates allow for trees with countably many branches.
If $f$ is an admissible function, put
$$d(n)=2f(n)-f(n+1).$$
Note that $0\le d(n)\le f(n)$. If $T$ is a tree of growth rate $f$, then $d(n)$ counts the number of nodes at level $n$ that do not split.
A moment's reflection reveals that if we want a tree of fixed growth rate to have as few branches as possible, we should try to put all splitting nodes on one side. With this in mind, define a tree $T_f$ of growth rate $f(n)$ as follows. The nodes at each level $n$ are numbered $1,\dots,f(n)$. Nodes $1,\dots,d(n)$ have one child each on level $n+1$, with the same number. Nodes $d(n)+1,\dots,f(n)$ have two children each, again numbered in the same fashion: that is, node $i>d(n)$ has children $2i-1-d(n)$ and $2i-d(n)$.

Theorem: For any admissible function $f$, the following are equivalent.

*

*All trees of growth rate $f$ have $2^\omega$ branches.

*$T_f$ has $2^\omega$ branches.

*There are $n_0\le n_1<n_2<n_3<\cdots$ such that
  $$\sum_{k=1}^\infty2^{-k}d(n_k)\le f(n_0)-1.$$

*There are $n_1<n_2<n_3<\cdots$ such that
  $$\sum_{k=1}^\infty2^{-k}d(n_k)<1.$$

Proof:
$1\to2$ is trivial.
$2\to3$: If $b$ is a branch in $T_f$, let $b(n)$ denote the number of the node of $b$ at level $n$. We observe that $b(n)$ is nondecreasing. If $b'(n_0)<b(n_0)$, then $b'(n)<b(n)$ for all $n\ge n_0$. If $b$ does not split after level $n$, then neither does any branch $b'$ below it; thus $b$ is isolated if and only if $b(n)$ is eventually constant. Let $b_m$ be the branch which goes through node $f(m)-1$ at level $m$, and then follows the higher child at each level where it splits. Every branch of $T$ except the topmost one is bounded above by some $b_m$, thus if every $b_m$ were eventually constant, all but one branch would be isolated, and the number of branches would be countable. Thus, let us fix $n_0$ such that $b:=b_{n_0}$ is not eventually constant.
We can compute $b(n)$ by an explicit recurrence:
\begin{align}
b(n_0)&=f(n_0)-1,\\
b(n+1)&=b(n)+\max\{0,b(n)-d(n)\}
\end{align}
for $n\ge n_0$. Since $b$ is not eventually constant, we have $b(n)>d(n)$ for infinitely many $n\ge n_0$; let us enumerate them as $n_1<n_2<\cdots$. Unwinding the recurrence, we see that
$$b(n)=2^m(f(n_0)-1)-2^{m-1}d(n_1)-2^{m-2}d(n_2)-\dots-d(n_m)\qquad\text{for }n_m<n\le n_{m+1}.$$
Since $b(n)\ge0$, we obtain
$$f(n_0)-1\ge\sum_{k=1}^m2^{-k}d(n_k)$$
for every $m$, which implies 3 in the limit.
$3\to4$: We have
$$f(n_0)=2^{n_0}-2^{n_0-1}d(0)-2^{n_0-2}d(1)-\dots-d(n_0-1),$$
hence if we put
$$n'_k=\begin{cases}k&k<n_0,\\n_{k+1-n_0}&\text{otherwise,}\end{cases}$$
we obtain
$$1>1-2^{-n_0}\ge\sum_{k=1}^\infty2^{-k}d(n'_k).$$
$4\to1$:$\let\res\restriction\let\sset\subseteq\let\Sset\supseteq $
Let $T$ be a subtree of $2^{<\omega}$ of growth rate $f(n)$, $[T]\sset2^\omega$ the set of its branches, and $T_1\sset T$ the set of nonsplitting nodes of $T$. For any $b\in[T]\cup T$, let $B(b)\sset\mathbb N$ denote the set of levels on which $b$ goes through a splitting point of $T$. $b\res n\in2^n$ denotes the restriction of $b$ to the first $n$ levels.
We consider a probability measure on Borel subsets of $2^\omega$ defined by
$$\Pr_{\sigma\in2^\omega}(\sigma\Sset t)=\begin{cases}2^{-|B(t)|}&t\in T\\0&\text{otherwise}\end{cases}$$
for $t\in2^{<\omega}$. That is, $[T]$ has measure 1, and if $t\in T\smallsetminus T_1$, the measure of the set of all branches going through $t$ is split evenly between the two children of $t$.
Claim: If $b\in[T]$, we have
$$\Pr_\sigma(\sigma=b)\le\sum_{k:b\res n_k\in T_1}2^{-k}\Pr_\sigma(\sigma=b\mid\sigma\Sset b\res n_k).$$
Proof: We can assume wlog $\Pr(\sigma=b)>0$, which implies that $b$ is isolated. Let $k_1<k_2<\cdots$ be the enumeration of all $k$ such that $b\res n_k\in T_1$. Then
\begin{multline}
\frac1{\Pr(\sigma=b)}\sum_{k:b\res n_k\in T_1}2^{-k}\Pr_\sigma(\sigma=b\mid\sigma\Sset b\res n_k)=\sum_{j=1}^\infty\frac1{2^{k_j}\Pr(\sigma\Sset b\res n_{k_j})}\\=\sum_{j=1}^\infty2^{-k_j}2^{|B(b)\cap\{0,\dots,n_{k_j}-1\}|}\ge\sum_{j=1}^\infty2^{-k_j}2^{k_j-j}=1.
\end{multline}
Now, assume for contradiction that $[T]$ is countable. Using countable additivity of the measure, and the claim, we obtain
\begin{multline}
1>\sum_{k=1}^\infty2^{-k}d(n_k)=\sum_k\sum_{t\in T_1\cap2^{n_k}}2^{-k}\ge\sum_k\sum_{t\in T_1\cap2^{n_k}}2^{-k}\sum_{b\Sset t}\Pr_\sigma(\sigma=b\mid\sigma\Sset t)\\=\sum_{b\in[T]}\sum_{k:b\res n_k\in T_1}2^{-k}\Pr_\sigma(\sigma=b\mid\sigma\Sset b\res n_k)\ge\sum_{b\in[T]}\Pr_\sigma(\sigma=b)=1,
\end{multline}
a contradiction.

A: On the one hand, the comments explain that a low-growth-rate tree
can still have continuum many branches. Indeed, the growth rate
can be extremely slow, with most levels having no splitting at
all, but then every once in a very long while, a single node
splits. Just make sure at the $k^{th}$ such splitting that you are
splitting at a node above the $k^{th}$ binary sequence of the tree
(in some fixed standard enumeration of all finite binary
sequences), and then the resulting tree $T$ will have the property
that every node lies below a splitting node. This property will
ensure a subtree of type $2^{<\omega}$, and hence give you
continuum many branches.
In contrast, it is the converse question that I find extremely
interesting, and which could be considered the real content of your question. Namely,
Question. What is a sufficient growth rate on the tree $T$ to
ensure that it has continuum many branches?
The answer is that the growth rate must be essentially close to
$2^n$, in the precise senses described by the following theorems.
On the one hand, such a high growth rate suffices for continuum
many paths:
Theorem. If $T\subset 2^{<\omega}$ is a binary tree with
growth rate $\Omega(2^n)$ (in the Knuth sense big-Omega notation), then $T$
has continuum many branches.
Proof. What I intend to assume on the growth rate is that is that
there is a positive real number $r>0$ such that the number of
nodes on the $n^{th}$ level of $T$ is at least $r2^n$. Thus, the
complement of the set of paths through $T$ is approximated by the
unions of the cones above the omitted nodes on this level, and
this has measure at most $1-r$ with respect to the usual
coin-flipping probability measure on Cantor space. Since this is
true at each level, it follows that the measure of the paths
through $T$ is at least $r$, which is positive, and so there must
be uncountably many paths through $T$. Since this is a closed set,
it follows by the Cantor-Bendixson theorem that $T$ has
continuum many paths. QED
On the other hand, any lower growth rate does not ensure continuum many paths.
Theorem. If $f:\mathbb{N}\to\mathbb{N}$ is in $o(2^n)$ (see
little-o notation),
then there is a tree $T$ with growth rate
exceeding $f$, but having only countably many paths.
Proof. The growth rate assumption is that for every $r>0$, it will be true for large enough $n$ that $f(n)<r2^n$.
Let me describe a general procedure for building a tree $T$ with a very high growth rate, but with only countably many branches. We build $T$ in stages. First, we let $T$ use the full
binary branching up to some level $n_0$. Then, at this stage, we
kill off the future growth of half the branches, the
ones beginning with $0$, forcing them to become isolated branches in the tree
starting at level $n_0$, continued only with more $0$s after
$n_0$. Meanwhile, we let the other "live" nodes, those having $1$ in their first bit, to continue splitting above $n_0$ until some much larger
stage $n_1$. At that level, we again kill off half of them.
Namely, any node beginning with $10$ will become isolated at
$n_1$, and the others, beginning with $11$, will continue splitting up until the very
much later stage $n_2$. And so on.
The general procedure is: at level $n_k$, the nodes beginning with
$1^k0$ will become isolated at level $n_k$ (which is much larger
than $k$), and the nodes beginning with $1^k$ are allowed to
continue branching up to level $n_{k+1}$.
The resulting tree $T$ will have only countably many branches,
since the only branches will be the isolated branches that we
forced to occur, plus the all $11111\cdots$ branch, since whenever
a sequence has its first $0$ in position $k$, it will become
isolated at level $n_k$.
But now, the main point, is that by choosing the levels
$n_0<n_1<n_2<\cdots$ to be very fast growing, we can ensure a
growth rate exceeding $f$. Specifically, since $f$ is
$o(2^n)$, there is for each $k$ a number $n_k$ such that
$f(n)<2^{n-k}$ for all $n\geq n_k$, and we may also assume
$n_0<n_1<n_2<\cdots$. Now, with the $T$ as defined above, it
follows that the number of nodes of $T$ on level $n_k$ is at least
$2^{n_k-k}$, and it remains at least $2^{n-k}$ for $n_k\leq n<n_{k+1}$, and
this is larger than $f(n)$, as desired. So the growth rate of $T$
is at least $f$, even though $T$ has only countably many paths.
QED


text:
Q: Filling in the enclosed space of an SVG? So I converted a PNG sketch of a fashion model to an SVG because it made the lines look a lot cleaner and more defined. The end goal is to have the user click on a color and it fills in the the separate articles of clothing with the selected color. My only problem is I can't really figure out how (or if there is way) to simply fill in the space enclosed by an SVG.
I'm also not sure if the complexity of the SVG is a problem. Because it's a sketch it's composed of many short lines that the SVG format has made into seemingly one smooth line.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
 width="370.000000pt" height="1000.000000pt" viewBox="0 0 370.000000 1000.000000"
 preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,1000.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M1885 9350 c-72 -9 -111 -18 -179 -43 -108 -40 -206 -235 -206 -411
0 -76 -2 -84 -26 -107 -24 -22 -26 -29 -21 -79 3 -31 17 -80 32 -110 34 -71
37 -83 36 -155 -1 -47 -7 -68 -27 -97 -17 -25 -24 -43 -19 -57 5 -16 2 -21
-13 -21 -27 0 -38 -17 -46 -68 -8 -51 -50 -99 -117 -132 -24 -12 -58 -33 -76
-46 -17 -13 -36 -24 -40 -24 -15 0 -80 -73 -98 -110 -29 -57 -62 -90 -184
-186 -76 -59 -132 -111 -161 -152 -169 -231 -190 -263 -190 -290 0 -16 -6 -50
-14 -76 -10 -33 -13 -79 -9 -164 5 -119 1 -149 -36 -254 -18 -53 -20 -82 -19
-339 0 -194 -3 -284 -11 -292 -6 -6 -11 -22 -11 -35 0 -13 -5 -32 -10 -42 -6
-10 -13 -70 -16 -132 l-6 -113 60 -120 c59 -116 130 -221 175 -258 12 -9 51
-32 86 -50 54 -27 71 -43 119 -112 30 -44 71 -96 90 -115 19 -19 42 -51 53
-71 10 -20 29 -49 42 -65 46 -55 49 -69 28 -111 -10 -21 -27 -86 -36 -145 -16
-101 -16 -119 0 -300 19 -215 19 -230 5 -517 -7 -129 -15 -215 -24 -235 -31
-72 -45 -125 -50 -201 -3 -44 -8 -112 -12 -152 -4 -44 -2 -83 5 -104 11 -32 0
-100 -21 -124 -17 -19 -8 -76 18 -115 20 -29 24 -43 16 -53 -13 -16 -38 -90
-47 -140 -4 -28 -2 -46 10 -64 15 -23 15 -26 -1 -38 -17 -12 -17 -19 -7 -67 7
-36 8 -85 2 -153 -5 -55 -7 -118 -4 -140 28 -253 39 -310 62 -333 13 -13 23
-33 23 -45 0 -13 16 -101 36 -197 19 -96 36 -184 36 -195 0 -11 9 -72 20 -135
23 -132 21 -230 -5 -258 -24 -26 -21 -41 8 -52 20 -8 25 -16 23 -37 -3 -24 1
-28 24 -31 26 -3 28 -6 28 -52 0 -57 -7 -80 -25 -80 -8 0 -16 -17 -20 -41 -7
-42 -26 -100 -69 -208 -52 -131 -44 -226 22 -260 20 -11 48 -30 62 -43 27 -26
68 -51 120 -74 19 -9 55 -28 80 -44 25 -15 88 -43 140 -62 l95 -33 215 0 c190
0 219 2 243 18 22 14 27 25 27 57 0 53 -11 78 -59 130 -22 25 -41 48 -41 52 0
3 -38 50 -85 104 -47 54 -85 102 -85 106 0 13 46 9 143 -13 50 -12 124 -27
162 -34 69 -12 253 -85 265 -105 13 -22 156 -41 315 -43 183 -2 244 12 271 64
27 53 19 88 -32 136 -26 24 -51 43 -56 43 -5 0 -25 12 -45 28 -20 15 -66 43
-102 63 -52 28 -71 45 -89 80 -33 62 -49 77 -117 111 -68 33 -115 74 -115 99
0 22 -65 79 -89 79 -37 0 -44 25 -37 118 13 149 15 160 29 189 16 33 31 99 53
238 8 55 24 140 34 189 11 49 27 141 36 205 9 63 20 124 25 133 5 10 14 96 20
190 6 103 16 189 25 212 11 28 12 42 4 51 -8 10 -7 16 2 24 65 52 98 87 103
110 3 16 17 43 30 61 13 18 21 38 17 44 -10 16 -3 122 13 196 8 36 26 128 41
205 15 77 40 181 56 230 44 138 50 184 37 323 -9 93 -9 144 0 215 7 50 16 207
21 347 11 288 14 310 42 310 11 0 33 14 50 31 30 29 31 32 25 99 -3 37 -11 86
-18 108 -11 38 -10 43 26 100 40 65 64 124 65 159 0 13 -15 40 -33 60 -23 26
-39 58 -49 103 -21 84 -35 120 -48 120 -5 0 -10 4 -10 9 0 5 -5 22 -11 38 -25
59 -60 158 -60 168 0 6 3 49 8 96 5 47 5 101 0 120 -4 19 -10 124 -14 234 l-5
200 35 32 c49 44 53 76 22 158 -14 37 -25 82 -25 100 0 38 -32 116 -56 136
-14 11 -15 26 -9 92 4 47 3 83 -3 90 -6 7 -15 48 -22 91 -6 44 -15 89 -20 100
-4 12 -13 41 -20 66 -25 90 -80 231 -100 257 -11 14 -20 31 -20 38 0 18 -27
38 -110 81 -103 53 -103 53 -69 92 16 18 29 41 29 52 0 32 -19 70 -37 77 -35
12 -53 46 -53 101 0 59 -20 115 -45 129 -15 9 -9 24 53 134 39 69 83 160 97
204 l27 79 -20 17 c-20 15 -20 22 -12 112 5 53 7 103 4 110 -3 9 9 21 33 32
39 19 135 96 185 150 67 73 15 150 -132 195 -25 7 -49 17 -54 22 -6 4 -15 8
-22 8 -6 0 -31 19 -55 43 -63 60 -106 96 -142 117 -58 33 -240 53 -362 40z
m276 -51 c38 -11 82 -31 98 -42 97 -73 120 -91 118 -93 -1 -1 -22 2 -47 6 -25
5 -97 9 -160 9 -135 0 -248 -25 -350 -80 -87 -46 -240 -188 -261 -241 -23 -59
-30 -27 -18 79 7 59 19 108 38 148 16 33 34 75 41 92 13 34 90 93 120 93 10 0
35 7 56 17 34 14 137 27 257 31 22 1 70 -7 108 -19z m214 -180 c38 -11 100
-30 137 -41 74 -22 137 -63 138 -89 0 -25 -103 -123 -182 -174 l-37 -23 -6 40
c-9 54 -66 161 -102 192 -54 49 -99 58 -240 53 -118 -4 -135 -7 -213 -39 -47
-19 -110 -47 -140 -62 -69 -35 -49 -15 56 56 66 45 97 59 170 76 121 29 125
29 244 31 80 1 121 -4 175 -20z m-108 -109 c59 -34 97 -95 109 -177 3 -26 11
-56 15 -65 13 -24 -1 -208 -15 -208 -13 0 -124 56 -144 73 -16 13 -333 11
-433 -3 -37 -5 -107 -23 -157 -40 -49 -16 -93 -30 -97 -30 -3 0 -17 25 -31 55
-41 94 -27 183 25 156 32 -18 41 -13 41 21 0 36 55 93 124 128 37 19 218 99
256 113 8 3 69 6 135 6 115 1 122 0 172 -29z m31 -457 c61 -31 112 -61 112
-67 -1 -31 -79 -212 -110 -251 -4 -5 -23 -40 -43 -76 l-35 -67 28 -27 c24 -23
29 -37 35 -103 7 -74 9 -79 51 -119 44 -43 56 -76 30 -86 -8 -3 -25 -28 -38
-56 l-24 -49 42 -7 c24 -3 58 -16 76 -28 18 -13 52 -33 75 -46 34 -20 47 -36
76 -100 19 -42 39 -89 45 -106 56 -157 101 -382 95 -475 -4 -59 -2 -68 21 -95
27 -31 51 -98 43 -120 -3 -6 6 -38 19 -71 28 -68 31 -122 9 -131 -9 -3 -25
-23 -35 -43 -17 -33 -20 -61 -20 -212 -1 -95 4 -198 11 -228 13 -62 13 -83 -1
-194 -8 -65 -7 -82 5 -100 9 -11 20 -39 26 -61 6 -22 33 -90 60 -151 27 -61
49 -121 49 -134 0 -14 15 -40 36 -61 35 -36 36 -38 24 -76 -7 -21 -21 -50 -32
-65 -10 -15 -30 -52 -44 -82 -21 -46 -33 -59 -82 -86 -31 -18 -75 -47 -97 -65
-22 -17 -67 -49 -100 -71 -55 -36 -65 -39 -130 -39 -38 0 -108 10 -155 21 -47
12 -116 29 -155 38 -38 10 -117 33 -175 51 -60 19 -109 30 -114 25 -5 -5 -19
-5 -32 1 -49 18 -151 37 -202 38 -29 0 -61 3 -71 6 -20 6 -33 46 -20 66 4 8
-7 30 -31 58 -57 69 -83 127 -77 173 7 50 -15 142 -53 223 -16 35 -30 70 -30
77 -1 7 -14 29 -30 48 -22 25 -30 45 -30 72 0 23 -9 53 -24 76 -21 33 -23 46
-18 113 3 61 1 81 -13 102 -15 23 -15 33 -4 84 7 32 16 63 21 70 5 6 13 87 18
180 7 154 23 243 42 243 5 0 8 7 8 15 0 9 9 33 20 55 25 49 25 81 0 153 -12
35 -22 92 -24 149 -6 134 -72 378 -102 378 -24 0 -23 -17 10 -131 19 -63 37
-143 40 -179 12 -118 24 -194 40 -251 l16 -55 -44 -85 -44 -85 -6 -165 c-4
-90 -11 -173 -16 -184 -4 -11 -13 -60 -19 -109 -9 -76 -8 -92 4 -106 18 -20
20 -45 11 -141 -7 -74 -7 -75 18 -87 25 -11 32 -30 27 -76 -1 -11 10 -31 23
-45 26 -28 100 -210 112 -274 4 -23 2 -42 -6 -52 -17 -21 23 -124 77 -196 40
-53 44 -63 45 -122 2 -69 -8 -91 -45 -103 -12 -3 -46 -24 -75 -46 -47 -37 -52
-44 -52 -79 0 -22 -4 -39 -9 -39 -13 0 -153 155 -172 192 -10 18 -27 52 -38
76 -11 23 -31 53 -43 66 -13 13 -24 30 -26 37 -2 8 -12 23 -22 34 -10 11 -25
35 -34 53 -9 17 -20 32 -25 32 -4 0 -43 47 -86 105 -70 95 -84 109 -139 135
-75 35 -120 76 -151 139 -14 27 -32 54 -40 61 -8 7 -15 20 -15 30 0 10 -7 23
-15 30 -8 6 -25 36 -38 64 -22 47 -24 63 -20 152 3 56 14 129 25 169 18 62 21
102 23 350 2 231 5 290 19 335 34 110 36 127 35 255 -2 161 17 250 67 315 18
25 56 79 84 121 58 89 118 147 218 214 40 26 78 57 83 67 5 10 15 18 22 18 14
0 31 24 63 91 24 49 95 116 154 146 40 21 88 54 147 101 34 28 42 41 47 82 6
41 11 49 37 60 26 11 30 17 25 40 -3 19 1 34 14 47 14 15 20 43 25 111 l7 90
37 10 c20 5 72 20 116 32 57 16 121 24 225 29 259 12 233 15 358 -46z m579
-3590 c-4 -3 -3 -11 2 -17 13 -17 22 -119 11 -136 -5 -8 -29 -20 -52 -25 -51
-13 -45 14 -53 -265 -3 -113 -13 -279 -22 -369 -14 -140 -14 -184 -4 -300 l12
-136 -39 -120 c-22 -66 -52 -190 -66 -275 -15 -85 -31 -163 -36 -172 -14 -26
-31 -185 -24 -223 5 -27 2 -35 -15 -44 -12 -7 -21 -17 -21 -23 0 -24 -42 -98
-56 -98 -8 0 -24 -10 -35 -21 -16 -16 -20 -29 -16 -54 4 -25 1 -38 -15 -52
-16 -14 -19 -26 -14 -54 8 -50 -11 -329 -24 -344 -5 -6 -17 -61 -26 -121 -9
-60 -31 -190 -49 -289 -19 -99 -39 -214 -46 -255 -14 -92 -31 -128 -65 -136
-26 -7 -291 0 -299 7 -2 2 0 42 5 89 5 47 14 192 21 322 10 191 10 250 0 305
-17 90 -12 496 7 515 18 18 15 33 -12 65 -19 23 -24 44 -30 125 -7 91 -6 99
14 120 26 29 23 62 -7 66 -30 4 -29 8 8 50 34 38 33 28 6 189 -9 58 -27 109
-57 169 l-43 86 27 86 c23 75 25 88 12 100 -39 40 -76 -37 -139 -289 -14 -53
-29 -105 -35 -116 -23 -41 -34 -193 -21 -274 12 -75 11 -88 -13 -120 -9 -13
-8 -20 5 -33 8 -9 20 -16 26 -16 19 0 12 -16 -11 -28 -13 -6 -40 -17 -62 -24
-45 -15 -60 -44 -53 -100 6 -42 -20 -86 -94 -163 l-38 -40 -4 -245 c-2 -135
-10 -321 -17 -413 -10 -124 -10 -173 -2 -190 6 -12 14 -89 16 -172 7 -197 9
-209 24 -228 8 -9 12 -33 10 -58 -4 -50 -1 -49 -168 -79 -132 -25 -130 -25
-130 5 0 14 -7 28 -15 31 -8 4 -13 9 -11 13 2 3 9 41 15 83 8 60 8 86 -3 124
-8 27 -17 83 -20 124 -4 41 -13 100 -20 130 -8 30 -19 80 -25 110 -5 30 -15
82 -22 115 -6 33 -14 79 -19 103 -4 24 -17 56 -29 72 -28 38 -41 150 -50 425
-6 168 -5 212 6 221 17 15 17 65 -2 91 -13 19 -13 25 0 57 8 19 15 46 15 59 0
13 7 32 15 43 23 30 19 69 -10 88 -24 16 -36 66 -16 66 5 0 14 29 21 64 9 50
9 73 0 101 -9 28 -9 59 -1 130 6 51 11 116 11 143 0 53 12 100 38 147 11 20
19 70 24 150 4 66 12 185 18 265 8 114 7 173 -5 275 -31 285 -30 318 14 483
14 50 24 53 41 13 6 -17 52 -72 101 -123 49 -51 89 -96 89 -100 0 -5 8 -8 18
-8 20 0 135 107 136 126 1 6 16 25 35 43 26 24 32 36 27 55 -3 14 -2 28 4 31
5 3 10 17 10 31 0 13 3 24 6 24 3 0 50 -9 104 -20 54 -11 125 -24 157 -29 32
-5 101 -21 153 -35 52 -15 120 -31 150 -37 30 -6 64 -15 75 -20 11 -5 58 -20
105 -35 112 -35 213 -31 277 9 24 15 45 27 47 27 3 0 36 23 73 51 37 28 84 59
103 68 19 9 39 22 43 29 4 6 13 12 19 12 6 0 8 -3 5 -7z m-1405 -150 c-11 -16
-34 -41 -51 -57 -29 -28 -31 -28 -31 -8 0 13 17 34 46 57 56 42 61 43 36 8z
m349 -1340 c37 -61 49 -92 74 -193 13 -52 26 -102 30 -112 4 -11 -6 -30 -29
-56 -40 -44 -43 -57 -19 -84 14 -15 14 -22 4 -42 -9 -15 -11 -41 -7 -72 3 -27
6 -79 5 -116 0 -65 1 -68 26 -78 24 -9 25 -12 14 -27 -19 -23 -27 -555 -8
-589 9 -17 10 -63 4 -181 -4 -87 -7 -170 -6 -186 1 -15 -3 -56 -9 -90 -6 -34
-15 -125 -20 -202 -12 -164 -36 -274 -69 -308 -15 -17 -29 -54 -41 -112 -11
-47 -31 -108 -46 -135 l-26 -48 -73 76 c-69 72 -73 78 -78 132 -4 31 -13 70
-22 86 -8 16 -15 50 -15 76 0 26 -7 73 -16 105 -9 35 -17 117 -20 208 -2 83
-9 167 -16 188 -9 28 -8 59 1 130 7 50 15 214 17 362 3 149 7 279 9 291 3 12
34 54 71 95 64 72 65 74 59 116 -9 65 -1 79 58 99 29 9 58 21 65 27 18 14 15
51 -7 71 -16 14 -17 22 -8 46 8 22 8 45 -1 88 -7 32 -9 81 -6 108 7 63 44 234
54 255 5 9 11 37 15 63 4 25 9 46 10 46 2 0 13 -17 26 -37z m411 -2182 c-3
-120 6 -147 55 -167 48 -20 73 -42 73 -65 0 -20 78 -88 136 -117 23 -12 53
-35 65 -52 59 -77 91 -108 136 -130 26 -13 71 -41 100 -62 29 -21 55 -38 60
-38 4 0 22 -14 40 -32 66 -64 37 -111 -79 -129 -77 -13 -57 -13 -218 0 -145
11 -170 19 -370 108 -30 14 -77 28 -105 33 -27 5 -70 14 -95 20 -25 7 -92 19
-149 27 -97 14 -106 18 -140 52 l-37 37 28 44 c34 53 65 134 79 204 14 71 29
106 45 106 16 0 17 6 45 151 l22 116 156 -4 156 -4 -3 -98z m-733 -205 c6 -25
11 -59 11 -76 0 -27 13 -44 75 -104 63 -60 75 -77 75 -104 0 -26 11 -44 55
-87 30 -31 55 -60 55 -65 0 -17 67 -114 100 -145 18 -16 57 -62 86 -102 30
-39 58 -75 64 -78 12 -7 13 -55 2 -72 -16 -26 -69 -33 -234 -33 -169 0 -171 0
-277 36 -58 19 -122 45 -141 58 -19 12 -51 28 -70 36 -42 16 -140 79 -140 89
0 4 -12 14 -27 22 -42 21 -49 31 -56 76 -8 49 25 169 74 265 5 9 12 36 15 58
4 23 17 57 30 76 18 26 24 49 24 87 l0 53 88 17 c48 10 94 22 102 27 8 6 29
10 46 10 29 0 33 -4 43 -44z"/>
</g>
</svg>

If I change the "fill" attribute, I only change the color of the outline. I also can't change the color of the background because the area I want to fill is a more complex shape. Blow is the PNG of the image that I converted to SVG so you get an idea of the shape.
Imgur link to picture

A: As @ccprog explained you have a hollow path already filled with black. This is how to solve the problem:

*

*I've changed the d attribute of the path to all-absolute. Ypu can do it using this pen by Lea Verou: Convert SVG path to all-relative or all-absolute

*Split the d attribute of the path by the "M" command and create other paths using the fragments as the d attribute.

*Fill the resulting paths with loud colors so that you can identify the path.

*Next you can fill them with the colors you like.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
 width="200" viewBox="0 0 370.000000 1000.000000"
 preserveAspectRatio="xMidYMid meet">

<g transform="translate(0.000000,1000.000000) scale(0.100000,-0.100000)">
<path id="outline" d="M1885,9350C1813,9341,1774,9332,1706,9307C1598,9267,1500,9072,1500,8896C1500,8820,1498,8812,1474,8789C1450,8767,1448,8760,1453,8710C1456,8679,1470,8630,1485,8600C1519,8529,1522,8517,1521,8445C1520,8398,1514,8377,1494,8348C1477,8323,1470,8305,1475,8291C1480,8275,1477,8270,1462,8270C1435,8270,1424,8253,1416,8202C1408,8151,1366,8103,1299,8070C1275,8058,1241,8037,1223,8024C1206,8011,1187,8000,1183,8000C1168,8000,1103,7927,1085,7890C1056,7833,1023,7800,901,7704C825,7645,769,7593,740,7552C571,7321,550,7289,550,7262C550,7246,544,7212,536,7186C526,7153,523,7107,527,7022C532,6903,528,6873,491,6768C473,6715,471,6686,472,6429C472,6235,469,6145,461,6137C455,6131,450,6115,450,6102C450,6089,445,6070,440,6060C434,6050,427,5990,424,5928L418,5815L478,5695C537,5579,608,5474,653,5437C665,5428,704,5405,739,5387C793,5360,810,5344,858,5275C888,5231,929,5179,948,5160C967,5141,990,5109,1001,5089C1011,5069,1030,5040,1043,5024C1089,4969,1092,4955,1071,4913C1061,4892,1044,4827,1035,4768C1019,4667,1019,4649,1035,4468C1054,4253,1054,4238,1040,3951C1033,3822,1025,3736,1016,3716C985,3644,971,3591,966,3515C963,3471,958,3403,954,3363C950,3319,952,3280,959,3259C970,3227,959,3159,938,3135C921,3116,930,3059,956,3020C976,2991,980,2977,972,2967C959,2951,934,2877,925,2827C921,2799,923,2781,935,2763C950,2740,950,2737,934,2725C917,2713,917,2706,927,2658C934,2622,935,2573,929,2505C924,2450,922,2387,925,2365C953,2112,964,2055,987,2032C1000,2019,1010,1999,1010,1987C1010,1974,1026,1886,1046,1790C1065,1694,1082,1606,1082,1595C1082,1584,1091,1523,1102,1460C1125,1328,1123,1230,1097,1202C1073,1176,1076,1161,1105,1150C1125,1142,1130,1134,1128,1113C1125,1089,1129,1085,1152,1082C1178,1079,1180,1076,1180,1030C1180,973,1173,950,1155,950C1147,950,1139,933,1135,909C1128,867,1109,809,1066,701C1014,570,1022,475,1088,441C1108,430,1136,411,1150,398C1177,372,1218,347,1270,324C1289,315,1325,296,1350,280C1375,265,1438,237,1490,218L1585,185L1800,185C1990,185,2019,187,2043,203C2065,217,2070,228,2070,260C2070,313,2059,338,2011,390C1989,415,1970,438,1970,442C1970,445,1932,492,1885,546C1838,600,1800,648,1800,652C1800,665,1846,661,1943,639C1993,627,2067,612,2105,605C2174,593,2358,520,2370,500C2383,478,2526,459,2685,457C2868,455,2929,469,2956,521C2983,574,2975,609,2924,657C2898,681,2873,700,2868,700C2863,700,2843,712,2823,728C2803,743,2757,771,2721,791C2669,819,2650,836,2632,871C2599,933,2583,948,2515,982C2447,1015,2400,1056,2400,1081C2400,1103,2335,1160,2311,1160C2274,1160,2267,1185,2274,1278C2287,1427,2289,1438,2303,1467C2319,1500,2334,1566,2356,1705C2364,1760,2380,1845,2390,1894C2401,1943,2417,2035,2426,2099C2435,2162,2446,2223,2451,2232C2456,2242,2465,2328,2471,2422C2477,2525,2487,2611,2496,2634C2507,2662,2508,2676,2500,2685C2492,2695,2493,2701,2502,2709C2567,2761,2600,2796,2605,2819C2608,2835,2622,2862,2635,2880C2648,2898,2656,2918,2652,2924C2642,2940,2649,3046,2665,3120C2673,3156,2691,3248,2706,3325C2721,3402,2746,3506,2762,3555C2806,3693,2812,3739,2799,3878C2790,3971,2790,4022,2799,4093C2806,4143,2815,4300,2820,4440C2831,4728,2834,4750,2862,4750C2873,4750,2895,4764,2912,4781C2942,4810,2943,4813,2937,4880C2934,4917,2926,4966,2919,4988C2908,5026,2909,5031,2945,5088C2985,5153,3009,5212,3010,5247C3010,5260,2995,5287,2977,5307C2954,5333,2938,5365,2928,5410C2907,5494,2893,5530,2880,5530C2875,5530,2870,5534,2870,5539C2870,5544,2865,5561,2859,5577C2834,5636,2799,5735,2799,5745C2799,5751,2802,5794,2807,5841C2812,5888,2812,5942,2807,5961C2803,5980,2797,6085,2793,6195L2788,6395L2823,6427C2872,6471,2876,6503,2845,6585C2831,6622,2820,6667,2820,6685C2820,6723,2788,6801,2764,6821C2750,6832,2749,6847,2755,6913C2759,6960,2758,6996,2752,7003C2746,7010,2737,7051,2730,7094C2724,7138,2715,7183,2710,7194C2706,7206,2697,7235,2690,7260C2665,7350,2610,7491,2590,7517C2579,7531,2570,7548,2570,7555C2570,7573,2543,7593,2460,7636C2357,7689,2357,7689,2391,7728C2407,7746,2420,7769,2420,7780C2420,7812,2401,7850,2383,7857C2348,7869,2330,7903,2330,7958C2330,8017,2310,8073,2285,8087C2270,8096,2276,8111,2338,8221C2377,8290,2421,8381,2435,8425L2462,8504L2442,8521C2422,8536,2422,8543,2430,8633C2435,8686,2437,8736,2434,8743C2431,8752,2443,8764,2467,8775C2506,8794,2602,8871,2652,8925C2719,8998,2667,9075,2520,9120C2495,9127,2471,9137,2466,9142C2460,9146,2451,9150,2444,9150C2438,9150,2413,9169,2389,9193C2326,9253,2283,9289,2247,9310C2189,9343,2007,9363,1885,9350Z" fill="black"/>
<path id="cap" d="         M2161,9299C2199,9288,2243,9268,2259,9257C2356,9184,2379,9166,2377,9164C2376,9163,2355,9166,2330,9170C2305,9175,2233,9179,2170,9179C2035,9179,1922,9154,1820,9099C1733,9053,1580,8911,1559,8858C1536,8799,1529,8831,1541,8937C1548,8996,1560,9045,1579,9085C1595,9118,1613,9160,1620,9177C1633,9211,1710,9270,1740,9270C1750,9270,1775,9277,1796,9287C1830,9301,1933,9314,2053,9318C2075,9319,2123,9311,2161,9299Z" fill="red"/>
<path id="peak" d="         M2375,9119C2413,9108,2475,9089,2512,9078C2586,9056,2649,9015,2650,8989C2650,8964,2547,8866,2468,8815L2431,8792L2425,8832C2416,8886,2359,8993,2323,9024C2269,9073,2224,9082,2083,9077C1965,9073,1948,9070,1870,9038C1823,9019,1760,8991,1730,8976C1661,8941,1681,8961,1786,9032C1852,9077,1883,9091,1956,9108C2077,9137,2081,9137,2200,9139C2280,9140,2321,9135,2375,9119Z" fill="pink" />
<path id="eyes" d="M2267,9010C2326,8976,2364,8915,2376,8833C2379,8807,2387,8777,2391,8768C2404,8744,2390,8560,2376,8560C2363,8560,2252,8616,2232,8633C2216,8646,1899,8644,1799,8630C1762,8625,1692,8607,1642,8590C1593,8574,1549,8560,1545,8560C1542,8560,1528,8585,1514,8615C1473,8709,1487,8798,1539,8771C1571,8753,1580,8758,1580,8792C1580,8828,1635,8885,1704,8920C1741,8939,1922,9019,1960,9033C1968,9036,2029,9039,2095,9039C2210,9040,2217,9039,2267,9010Z" fill="purple" />
<path id="blouse" d="M2298,8553C2359,8522,2410,8492,2410,8486C2409,8455,2331,8274,2300,8235C2296,8230,2277,8195,2257,8159L2222,8092L2250,8065C2274,8042,2279,8028,2285,7962C2292,7888,2294,7883,2336,7843C2380,7800,2392,7767,2366,7757C2358,7754,2341,7729,2328,7701L2304,7652L2346,7645C2370,7642,2404,7629,2422,7617C2440,7604,2474,7584,2497,7571C2531,7551,2544,7535,2573,7471C2592,7429,2612,7382,2618,7365C2674,7208,2719,6983,2713,6890C2709,6831,2711,6822,2734,6795C2761,6764,2785,6697,2777,6675C2774,6669,2783,6637,2796,6604C2824,6536,2827,6482,2805,6473C2796,6470,2780,6450,2770,6430C2753,6397,2750,6369,2750,6218C2749,6123,2754,6020,2761,5990C2774,5928,2774,5907,2760,5796C2752,5731,2753,5714,2765,5696C2774,5685,2785,5657,2791,5635C2797,5613,2824,5545,2851,5484C2878,5423,2900,5363,2900,5350C2900,5336,2915,5310,2936,5289C2971,5253,2972,5251,2960,5213C2953,5192,2939,5163,2928,5148C2918,5133,2898,5096,2884,5066C2863,5020,2851,5007,2802,4980C2771,4962,2727,4933,2705,4915C2683,4898,2638,4866,2605,4844C2550,4808,2540,4805,2475,4805C2437,4805,2367,4815,2320,4826C2273,4838,2204,4855,2165,4864C2127,4874,2048,4897,1990,4915C1930,4934,1881,4945,1876,4940C1871,4935,1857,4935,1844,4941C1795,4959,1693,4978,1642,4979C1613,4979,1581,4982,1571,4985C1551,4991,1538,5031,1551,5051C1555,5059,1544,5081,1520,5109C1463,5178,1437,5236,1443,5282C1450,5332,1428,5424,1390,5505C1374,5540,1360,5575,1360,5582C1359,5589,1346,5611,1330,5630C1308,5655,1300,5675,1300,5702C1300,5725,1291,5755,1276,5778C1255,5811,1253,5824,1258,5891C1261,5952,1259,5972,1245,5993C1230,6016,1230,6026,1241,6077C1248,6109,1257,6140,1262,6147C1267,6153,1275,6234,1280,6327C1287,6481,1303,6570,1322,6570C1327,6570,1330,6577,1330,6585C1330,6594,1339,6618,1350,6640C1375,6689,1375,6721,1350,6793C1338,6828,1328,6885,1326,6942C1320,7076,1254,7320,1224,7320C1200,7320,1201,7303,1234,7189C1253,7126,1271,7046,1274,7010C1286,6892,1298,6816,1314,6759L1330,6704L1286,6619L1242,6534L1236,6369C1232,6279,1225,6196,1220,6185C1216,6174,1207,6125,1201,6076C1192,6000,1193,5984,1205,5970C1223,5950,1225,5925,1216,5829C1209,5755,1209,5754,1234,5742C1259,5731,1266,5712,1261,5666C1260,5655,1271,5635,1284,5621C1310,5593,1384,5411,1396,5347C1400,5324,1398,5305,1390,5295C1373,5274,1413,5171,1467,5099C1507,5046,1511,5036,1512,4977C1514,4908,1504,4886,1467,4874C1455,4871,1421,4850,1392,4828C1345,4791,1340,4784,1340,4749C1340,4727,1336,4710,1331,4710C1318,4710,1178,4865,1159,4902C1149,4920,1132,4954,1121,4978C1110,5001,1090,5031,1078,5044C1065,5057,1054,5074,1052,5081C1050,5089,1040,5104,1030,5115C1020,5126,1005,5150,996,5168C987,5185,976,5200,971,5200C967,5200,928,5247,885,5305C815,5400,801,5414,746,5440C671,5475,626,5516,595,5579C581,5606,563,5633,555,5640C547,5647,540,5660,540,5670C540,5680,533,5693,525,5700C517,5706,500,5736,487,5764C465,5811,463,5827,467,5916C470,5972,481,6045,492,6085C510,6147,513,6187,515,6435C517,6666,520,6725,534,6770C568,6880,570,6897,569,7025C567,7186,586,7275,636,7340C654,7365,692,7419,720,7461C778,7550,838,7608,938,7675C978,7701,1016,7732,1021,7742C1026,7752,1036,7760,1043,7760C1057,7760,1074,7784,1106,7851C1130,7900,1201,7967,1260,7997C1300,8018,1348,8051,1407,8098C1441,8126,1449,8139,1454,8180C1460,8221,1465,8229,1491,8240C1517,8251,1521,8257,1516,8280C1513,8299,1517,8314,1530,8327C1544,8342,1550,8370,1555,8438L1562,8528L1599,8538C1619,8543,1671,8558,1715,8570C1772,8586,1836,8594,1940,8599C2199,8611,2173,8614,2298,8553Z" fill="darkgreen"/>
<path id="pants" d="M2877,4963C2873,4960,2874,4952,2879,4946C2892,4929,2901,4827,2890,4810C2885,4802,2861,4790,2838,4785C2787,4772,2793,4799,2785,4520C2782,4407,2772,4241,2763,4151C2749,4011,2749,3967,2759,3851L2771,3715L2732,3595C2710,3529,2680,3405,2666,3320C2651,3235,2635,3157,2630,3148C2616,3122,2599,2963,2606,2925C2611,2898,2608,2890,2591,2881C2579,2874,2570,2864,2570,2858C2570,2834,2528,2760,2514,2760C2506,2760,2490,2750,2479,2739C2463,2723,2459,2710,2463,2685C2467,2660,2464,2647,2448,2633C2432,2619,2429,2607,2434,2579C2442,2529,2423,2250,2410,2235C2405,2229,2393,2174,2384,2114C2375,2054,2353,1924,2335,1825C2316,1726,2296,1611,2289,1570C2275,1478,2258,1442,2224,1434C2198,1427,1933,1434,1925,1441C1923,1443,1925,1483,1930,1530C1935,1577,1944,1722,1951,1852C1961,2043,1961,2102,1951,2157C1934,2247,1939,2653,1958,2672C1976,2690,1973,2705,1946,2737C1927,2760,1922,2781,1916,2862C1909,2953,1910,2961,1930,2982C1956,3011,1953,3044,1923,3048C1893,3052,1894,3056,1931,3098C1965,3136,1964,3126,1937,3287C1928,3345,1910,3396,1880,3456L1837,3542L1864,3628C1887,3703,1889,3716,1876,3728C1837,3768,1800,3691,1737,3439C1723,3386,1708,3334,1702,3323C1679,3282,1668,3130,1681,3049C1693,2974,1692,2961,1668,2929C1659,2916,1660,2909,1673,2896C1681,2887,1693,2880,1699,2880C1718,2880,1711,2864,1688,2852C1675,2846,1648,2835,1626,2828C1581,2813,1566,2784,1573,2728C1579,2686,1553,2642,1479,2565L1441,2525L1437,2280C1435,2145,1427,1959,1420,1867C1410,1743,1410,1694,1418,1677C1424,1665,1432,1588,1434,1505C1441,1308,1443,1296,1458,1277C1466,1268,1470,1244,1468,1219C1464,1169,1467,1170,1300,1140C1168,1115,1170,1115,1170,1145C1170,1159,1163,1173,1155,1176C1147,1180,1142,1185,1144,1189C1146,1192,1153,1230,1159,1272C1167,1332,1167,1358,1156,1396C1148,1423,1139,1479,1136,1520C1132,1561,1123,1620,1116,1650C1108,1680,1097,1730,1091,1760C1086,1790,1076,1842,1069,1875C1063,1908,1055,1954,1050,1978C1046,2002,1033,2034,1021,2050C993,2088,980,2200,971,2475C965,2643,966,2687,977,2696C994,2711,994,2761,975,2787C962,2806,962,2812,975,2844C983,2863,990,2890,990,2903C990,2916,997,2935,1005,2946C1028,2976,1024,3015,995,3034C971,3050,959,3100,979,3100C984,3100,993,3129,1000,3164C1009,3214,1009,3237,1000,3265C991,3293,991,3324,999,3395C1005,3446,1010,3511,1010,3538C1010,3591,1022,3638,1048,3685C1059,3705,1067,3755,1072,3835C1076,3901,1084,4020,1090,4100C1098,4214,1097,4273,1085,4375C1054,4660,1055,4693,1099,4858C1113,4908,1123,4911,1140,4871C1146,4854,1192,4799,1241,4748C1290,4697,1330,4652,1330,4648C1330,4643,1338,4640,1348,4640C1368,4640,1483,4747,1484,4766C1485,4772,1500,4791,1519,4809C1545,4833,1551,4845,1546,4864C1543,4878,1544,4892,1550,4895C1555,4898,1560,4912,1560,4926C1560,4939,1563,4950,1566,4950C1569,4950,1616,4941,1670,4930C1724,4919,1795,4906,1827,4901C1859,4896,1928,4880,1980,4866C2032,4851,2100,4835,2130,4829C2160,4823,2194,4814,2205,4809C2216,4804,2263,4789,2310,4774C2422,4739,2523,4743,2587,4783C2611,4798,2632,4810,2634,4810C2637,4810,2670,4833,2707,4861C2744,4889,2791,4920,2810,4929C2829,4938,2849,4951,2853,4958C2857,4964,2866,4970,2872,4970C2878,4970,2880,4967,2877,4963Z" fill="lightgreen"/>
<path id="sleevetip" d="M1472,4813C1461,4797,1438,4772,1421,4756C1392,4728,1390,4728,1390,4748C1390,4761,1407,4782,1436,4805C1492,4847,1497,4848,1472,4813Z" fill="black"/>
<path id="hole" d="M1821,3473C1858,3412,1870,3381,1895,3280C1908,3228,1921,3178,1925,3168C1929,3157,1919,3138,1896,3112C1856,3068,1853,3055,1877,3028C1891,3013,1891,3006,1881,2986C1872,2971,1870,2945,1874,2914C1877,2887,1880,2835,1879,2798C1879,2733,1880,2730,1905,2720C1929,2711,1930,2708,1919,2693C1900,2670,1892,2138,1911,2104C1920,2087,1921,2041,1915,1923C1911,1836,1908,1753,1909,1737C1910,1722,1906,1681,1900,1647C1894,1613,1885,1522,1880,1445C1868,1281,1844,1171,1811,1137C1796,1120,1782,1083,1770,1025C1759,978,1739,917,1724,890L1698,842L1625,918C1556,990,1552,996,1547,1050C1543,1081,1534,1120,1525,1136C1517,1152,1510,1186,1510,1212C1510,1238,1503,1285,1494,1317C1485,1352,1477,1434,1474,1525C1472,1608,1465,1692,1458,1713C1449,1741,1450,1772,1459,1843C1466,1893,1474,2057,1476,2205C1479,2354,1483,2484,1485,2496C1488,2508,1519,2550,1556,2591C1620,2663,1621,2665,1615,2707C1606,2772,1614,2786,1673,2806C1702,2815,1731,2827,1738,2833C1756,2847,1753,2884,1731,2904C1715,2918,1714,2926,1723,2950C1731,2972,1731,2995,1722,3038C1715,3070,1713,3119,1716,3146C1723,3209,1760,3380,1770,3401C1775,3410,1781,3438,1785,3464C1789,3489,1794,3510,1795,3510C1797,3510,1808,3493,1821,3473Z" fill="white"/>
<path id="rightshoe" d="M2232,1291C2229,1171,2238,1144,2287,1124C2335,1104,2360,1082,2360,1059C2360,1039,2438,971,2496,942C2519,930,2549,907,2561,890C2620,813,2652,782,2697,760C2723,747,2768,719,2797,698C2826,677,2852,660,2857,660C2861,660,2879,646,2897,628C2963,564,2934,517,2818,499C2741,486,2761,486,2600,499C2455,510,2430,518,2230,607C2200,621,2153,635,2125,640C2098,645,2055,654,2030,660C2005,667,1938,679,1881,687C1784,701,1775,705,1741,739L1704,776L1732,820C1766,873,1797,954,1811,1024C1825,1095,1840,1130,1856,1130C1872,1130,1873,1136,1901,1281L1923,1397L2079,1393L2235,1389L2232,1291Z" fill="blue"/>
<path id="leftshoe" d="M1499,1086C1505,1061,1510,1027,1510,1010C1510,983,1523,966,1585,906C1648,846,1660,829,1660,802C1660,776,1671,758,1715,715C1745,684,1770,655,1770,650C1770,633,1837,536,1870,505C1888,489,1927,443,1956,403C1986,364,2014,328,2020,325C2032,318,2033,270,2022,253C2006,227,1953,220,1788,220C1619,220,1617,220,1511,256C1453,275,1389,301,1370,314C1351,326,1319,342,1300,350C1258,366,1160,429,1160,439C1160,443,1148,453,1133,461C1091,482,1084,492,1077,537C1069,586,1102,706,1151,802C1156,811,1163,838,1166,860C1170,883,1183,917,1196,936C1214,962,1220,985,1220,1023L1220,1076L1308,1093C1356,1103,1402,1115,1410,1120C1418,1126,1439,1130,1456,1130C1485,1130,1489,1126,1499,1086Z" fill="darkorange"/>
</g>
</svg>

A: Your SVG is in a state that can be developed easily into what you need. The following image shows what actually has been outlined:

As you can see, the path goes around each side of the lines. That is why a change of fill only changes the black lines: what visually seems to be a line is actually a long and small enclosed area.
You can use that state to your advantage. This is done best with a visual SVG editor of some sort - Inkscape, Sketch or Illustrator for example.

*

*Divide up the one path you currently have into its individual, closed parts. Editors have a "Break apart" command for that.

*The outermost part now encloses the whole figure. Note there should be an "empty" space between the legs. Select the outermost path and the one surrounding that space and combine them back together (actually the reverse action to the previous one).

*Move this object behind all other paths that are part of the figure and fill it with black.

*Each other of the remaining paths can now be filled with colors of your liking. since they are sitting in front of the black background part. The only black that remains visible is in the gaps and on the outside - as if it was lines.

redpajama_set_name: RedPajamaStackExchange


text:
Q: An idle video/still frame that seamlessly transitions into a short animation, then back? Putting together an interactive effect for my basement tiki bar using a Pi 3 B+. Total newbie to Python as of this morning, so I apologize for the inevitably dumb questions I'll be asking.
I have a PIR sensor that is working great, and is properly triggering a single audio/video with omxplayer, however I want to be able to go from an all-black screen that seamlessly transitions into an effect video when the sensor is triggered, then go back to that idle all-black screen after the effect video ends.
I planned to make the idle all-black video very long (hour or two) so that there was no risk of it ending while people were in the bar. Ideally, I'd like to be able to re-start this effect at any given time before that idle video file would theoretically end.
Right now my issues are about 1 second or so where we return to the Desktop before the idle file (file1) begins. I'd prefer this be completely seamless during the transition. Alongside that issue, I cannot restart the effect until file1 ends.
This is my current code:
from gpiozero import MotionSensor
import os

pir = MotionSensor(4)
file1 = "idle.mp4"
file2 = "effect.mp4"

while True:
    pir.wait_for_motion()
    print ("Effect Start")
    os.system("omxplayer -o 'local' " + file2)
    pir.wait_for_no_motion()
    print ("Effect End")
    os.system ("omxplayer -o 'local' " + file1)

Thanks in advance!

A: Sorry I wont be able to write you some code for this as I am working on my own project.
Idea to help you:
Have a variable set to 0 when PIR activates that variable changes to a 1. Change your While statement to an IF statement to play different vids.
If 1 then,
Play Selected Video
Else;
Play Black Video


text:
Q: Parallel Tasks in Data Factory Custom Activity (ADF V2) I am running Custom code activity in ADF v2 using Batch Service. Whenever this runs it only create one CloudTask within my Batch Job although I have more than two dozen parallel.Invoke methods running. Is there a way I can create multiple Tasks from one Custom Activity from ADF so that the processing can spread across all nodes in Batch Pool
I have fixed Pool with two nodes. Max Tasks are also set to 8 per node and Scheduling policy is also set to "Spread". I have only one Custom Task on my pipeline with Multiple Parallel.Invoke (Almost two Dozen).I was hoping this will create Multiple CloudTasks and will be spread Across both of my nodes as both nodes are single core. Looks like when each Custom Activity runs in ADF, it creates only one Task (CloudTask) for Batch Service.
My other hope was to use
https://learn.microsoft.com/en-us/azure/batch/tutorial-parallel-dotnet
and manually create CloudTasks in my console application and create Multiple Tasks Programatically and then run that Console Application with ADF Custom Activity but CloudTask takes JobId and Cmd. Wanted to something like following but instead of passing taskCommandLine, I wanted to pass a C# method name and parameters to execute
string taskId = "task" + i.ToString().PadLeft(3, '0');
string taskCommandLine = "ping -n " + rand.Next(minPings, maxPings +
1).ToString() + " localhost";
CloudTask task = new CloudTask(taskId, taskCommandLine);
// Wanted to do CloudTask task = new CloudTask(taskId,
SomeMethod(args));
tasks.Add(task);

Also it looks like we can't create CloudTasks by using .NET API for Batch within Custom Activity of ADF
What I wanted to Achieve?
I have data in SQL Server table and I want to run different transformations on it by slicing it Horizontally or Vertically (by picking rows or columns). I want to run those transformations in Parallel (wants to have multiple CloudTask instances so that each one can operate on a specific Column Independently and after transformation load it
into a different table). But the issue is it looks like we can't use .NET Batch Service API within ADF and the only way seems to be having multiple Custom Activities in my Data Factory pipeline.

A: Application needs to deployed on each and every node within Batch pool and CloudTasks needs to be created by calling the application with cmd
CloudTask task =
new CloudTask(
    "MyTask",
    "cmd /c %AZ_BATCH_APP_PACKAGE_MyTask%\\myTask.exe -args -here");


text:
Q: Visual Studio 2008 keeps rebuilding
Possible Duplicate:
Visual Studio keeps building everything

Visual Studio 2008 keeps rebuilding the entire project as if every implementation file was modified. This happens even if no files were modified. Hit build button twice in row, and the entire projects gets rebuild twice. This doesn't happens on another box. The OS is Windows Vista.
This is very annoying. What could cause such a behavior?
It is a C++ project.

A: Some ideas to try...
As @David Paxson said in the comments, with some languauges (e.g. C#, VB) all the projects will appear to be "built", but the compiler will skip through the ones that don't need to be built much more quickly, even though they are still listed in the output. So it may simply appear to be rebuilding everything. Also, with C#, Visual Studio sometimes runs the project several times in a row, and sometimes it will decide for no obvious reason that it needs to "rebuild" the projects, but this only usually takes a few seconds extra unless you have hundreds of projects.
Restart Visual Studio (or even reboot the PC entirely).
Do a "Rebuild All" of the entire solution to clean out any old cached information and ensure all the output files are up to date.
If you use source control, then even better is to check in all of your changes, then delete your old source code folder (or safer, rename it somewhere out of the way until you know you don't need it) and force-get all the latest source code from source control again. This means you have a totally clean starting point (a clean or rebuild-all doesn't quite clean everything away, unfortunately). I do this every 2-4 weeks to keep everything running smoothly and totally in sync with the Source Control code.
If anything modifies the datestamps of any files in your build, then this could trigger a "need" to rebuild everything. Check that your system clock is set correctly, that there aren't any datestamps of source files set to times "in the future", and there are no applications running that could possibly "touch" any of your source files.
Check this option: Tools->Options > Projects and Solutions > Build and Run : "Only build startup projects and dependencies on Run". If it is unchecked, then VS will try to rebuild all projects every time, rather than only the dependencies of the startup project. If you have a large solution with a bunch of mostly unrelated projects in it, this is a very helpful option to set.
If there are projects that you don't need to build every time, then use the Configuration Manager to disable building of those projects in your current build (or create a "Debug Fast Build" configuration so you can switch quickly between a full rebuild and a partial build). Or move projects that don't need to be built often into a separate "libraries" solution and reference/link the output files (obj or dll) form your application's Solution, so the libraries only need to be rebuilt if you edit their code.
Lastly, make sure you're doing a "Build" and not a "Rebuild" :-)


text:
Q: textbox inside a gridview lose value on postback in this code when i click on button all other textboxes that are on other row of gridview lose their values on postback what should i do ?
button add a new comment to database and rebind the gridview with a AsyncPostBack
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
    </Triggers>

    <ContentTemplate>
        <%--post GridView--%>
        <asp:GridView ID="posts" runat="server">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <%--Comments Gridview--%>
                        <asp:GridView ID="comments" runat="server"></asp:GridView>
                        <%--a Textbox and bUtton For sending new Comment--%>
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                        <asp:Button ID="Button1" runat="server" Text="Button" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </ContentTemplate>
</asp:UpdatePanel>

    protected void Button1_Click(object sender, EventArgs e)
{
    //add new comment to db here then rebind gv
    posts.DataSource = GetData();
    posts.DataBind();
}

A: It's not the postback that's losing the textbox values, it's the DataBind. Just add the comment to the db without the DataBind.


text:
Q: why when a circular superconductor cooled has magnetic filed? i see in videos youtube that when a circular cooled about 200 kelvin it has some magnetic field around it,i think this Meissner  effect is called ,
my question is how QM describe it??it is really strang.
thanks for reply

A: the magnetic field is due to meissner effect.
it states that when a superconductor transitions from its superconducting state to normal state it excludes the magnetic effect form its sides. i.e. there are no magnetic fiels left inside of it.


text:
Q: git eclipse always have to pull allready updated project I have this strange behaviour from git, and even if i'll describe it from eclipse egit plugin, from terminal i have the same issue.
I have a project in the workspace that is shared between me and other developers, when i sync the project it says to me that i have to push something like 14/16 commit ant i have to pull one, even if had no commit at all.
Every time that i do the pull it seems that the project is now synchronized, so i push "team syncronize" again and the 14/16 commit to pull appears again.
That's not the only strange thing, another one is that i can push commit to remote after i have pull those commits but the other developers couldn't, even if they do the same things that i've done, it says to them that the problem are a "dangling blob".
Before write some of the solutions that i have found and what i have try i want to say that the number of commits are practically the entire history of the project.
I have tried to use the manual gc of git in the remote repository after i have done an fsck, where i have met effectively two dangling commit (why two dangling commit and egit says one dangling blob? i don't know....), this have removed the two dangling commit, so i have deleted the project from my workspace clone it again, but the same error happens again.
So i have used this other solution http://www.tekkie.ro/news/howto-remove-all-dangling-commits-from-your-git-repository/, always on the remote repository but the problem is still the same.
So even if have read practically all the documentation i didn't undestand somethings:
1) what's the difference between dangling commit and dangling blob?
2) how a dangling commit/blob happens?
3) how can i restore the project's repository?
UPDATE
I start a bounty because i really want to undertand and solve the problem, so for that i'll be clear in what i need to understand:
I have a project that everytime i use team syncronized, want to re-pull all the history, not only to me but for every one ofe my colleague, we use gitblit as remote repos. What can i do? Where do i have to search the possible errors?
UPDATE
that's  EGIT

and that's the Terminal

A: This is only a answer to some of your issues, maybe it should a comment instead.
Commits and blobs (blobs contains file content) are all objects in the git DAG and an object becomes 'dangling' (unreachable, orphan or loose) when nothing reference it (i.e. not part of the history) and git will clean up dangling objects if you run git gc (removes dangling objects older than 2 weeks) and some git commands will also run git gc --auto when they are done with their operations.
When you make changes in the DAG (i.e. rebase, amend or re-add content to the index) some objects will be replaced with new ones and the old objects then becomes dangling.
You can run git fsck --unreachable to find objects that are dangling.
Note: Objects referenced by reflog are normally not considered dangling.
In your case you may need to run git prune, git gc --agressive or git gc --prune=now to remove all dangling objects (do not forget to make a bakup first, just in case)


text:
Q: adding equation to the R plot I was wondering how I can paste the following equation as legend or text box to my plot in R (shown below in Latex format):
$$
x_i\stackrel{{\rm iid}}{\sim}{\rm Normal}\big(\mu-\frac \alpha 2,\sigma^2\big),\quad i = 1,\ldots, N_x  \\
y_i\stackrel{{\rm iid}}{\sim}{\rm Normal}\big(\mu+\frac \alpha 2,\sigma^2\big),\quad i = 1,\ldots, N_y
$$

A: You can try the following
library(latex2exp)
plot(TeX("$x_i$ \t $\\overset{iid}{\\sim}$ \t $Normal$
          $\\left(\\mu -\\frac{\\alpha}{2} ,\\sigma^2\\right)$,\t$i = 1,\\ldots, N_x$"))

to get the following


text:
Q: Access create form to add data to nested m to n table I got three tables Orders (1) &  OrdersLinking (2) &  Products (3).
1 and 3 have a m:n relation through 2 as linking table.
How would I make a form that can create a new entry in table 1 and 3. While there are no existing entrys in 2 due to the missing IDs (not created yet).
Thanks in advance!


text:
Q: Brightness control command on "startup Applications" is not working On "Startup Applications" utility I added my suitable brightness to be configured each time OS is launched. But it is not working at all. I am having to bear system's very high default brightness.
the command is : xrandr --output LVDS1 --brightness 0.5
Startup Applications is very fine although. I have also added up firefox opening command which is opening it well.
This brightness command is working from terminal. How do i make it work from startup App ?
Thanks in advance.

A: install indicator-brightness 'bar for brightness control'
$ sudo add-apt-repository ppa:indicator-brightness/ppa
$ sudo apt-get update
$ sudo apt-get install indicator-brightness

or
make it start on boot
install
$ sudo apt-get install xbacklight
open the 'Startup Applications' then and add a 'new startup item' with the command:

xbacklight -set 40

40 is the brightness lvl
from 1 => 100
 don't use them both

A: To set-up a predefined brightness on Ubuntu startup, type in the following command:
sudo gedit /etc/rc.local

There add this line:
echo X > /sys/class/backlight/intel_backlight/brightness

just before exit 0.
BE SURE not to place a value too low in place of X otherwise you will get a black screen.
Put values like 50, 75(my default value), etc.

A: You can create a executable text file and run that at startup. Open gedit, paste that line(command) and save it. Give the file executable permissions.
now add file to the start up list.


text:
Q: Error:'NoneType' object has no attribute '_inbound_nodes' I've been trying to encode a model that uses a squeeze-exctitation block.
I'm cluless about the error. Please suggest alternatives.
import keras
from keras.models import Sequential,Model
from keras.layers import,Input,Dense,Conv2D,MaxPooling2D,Flatten,GlobalAveragePooling2D,BatchNormalization,Lambda,Conv2DTranspose,Reshape,Add,Multiply
import numpy as np
import io

x_inp=Input(shape=(6,8,128))
print(np.shape(x_inp))

def SEblock(x,cn):
   sh_x=x
   x=GlobalAveragePooling2D()(x)
   x=Dense(cn//16,activation='relu')(x)
   x=Dense(cn,activation='sigmoid')(x)
   x=Reshape((1,1,cn))(x)
   x=sh_x*x
   y=GlobalAveragePooling2D()(x)
   return y
y=SEblock(x_inp,128)

model=Model(inputs=x_inp,outputs=y)

Error message when the above code was run:
node = layer._inbound_nodes[node_index]
AttributeError: 'NoneType' object has no attribute '_inbound_nodes'

A: Replace
x=sh_x*x

with
x = Multiply()([sh_x, x])


text:
Q: Problems adding a new user to OpenLDAP I'm trying to get started with OpenLDAP and I'm following this guide https://www.itzgeek.com/how-tos/linux/centos-how-tos/step-step-openldap-server-configuration-centos-7-rhel-7.html
I've done all the steps from a fresh CentOS7 installation.
I have copy-pasted all commands and have not changed anything. Everything goes well until I want to add a user at page 2 in the guide. The guide tells me to use this command after editing the file raj.ldif:
ldapadd -x -W -D "cn=ldapadm,dc=itzgeek,dc=local" -f raj.ldif

The expected output is:
Enter LDAP Password:
adding new entry "uid=raj,ou=People,dc=itzgeek,dc=local"
$

But the actual output is:
Enter LDAP Password:
$

I tried entering another password. I also tried using a file that does not exists. Both these yields an error message, so it cannot be any of those. I'm at a loss here. What am I doing wrong?

A: I redid the whole procedure with three changes:

*

*Changed hostname to server.itzgeek.local (Same as they used in the tutorial)

*Turned off firewall with systemctl stop firewalld

*Turned off SELinux with setenforce 0
I'm not sure which of these things that did it, but I do believe it is the hostname that was the issue.

A: It looks like slapd believes you omitted any dn in your ldif.
E.g. if you attempted to add an ldif file with this content you could experience the same results:
n: uid=raj,ou=People,dc=itzgeek,dc=local
objectClass: top
objectClass: account
objectClass: posixAccount
objectClass: shadowAccount
cn: raj
uid: raj
uidNumber: 9999
gidNumber: 100
homeDirectory: /home/raj
loginShell: /bin/bash
gecos: Raj [Admin (at) ITzGeek]
userPassword: {crypt}x
shadowLastChange: 17058
shadowMin: 0
shadowMax: 99999
shadowWarning: 7


text:
Q: How to remove packet listeners of XMPPClient using Smack I developed a chat app using Smack by XMPP server(openFire). For getting incoming message, i used to PacketFilter
This is incoming msg code:-
PacketFilter filter = new MessageTypeFilter(Message.Type.chat);
        connection.addPacketListener(new PacketListener() {
            public void processPacket(Packet packet) {
                Message message = (Message) packet;
                incomemsg = message.getBody();
                if (incomemsg != null) {
                    String fromName = StringUtils.parseBareAddress(message.getFrom());
                    frmname =  message.getBody();
                    Log.i("XMPPClient", "Got text [" + message.getBody() + "] from [" + fromName + "]");
                    // Add the incoming message to the list view
                    mHandler.post(new Runnable() {
                        public void run() {
                            // show the msg of chat in right side.
                              showMessage(frmname,false);
                              scrollContainer.getFocusables(scrollContainer.getChildCount());
                        }
                    });

                }
            }
        }, filter);

But i want to remove paketListener during activity close or stop or destroy. i follow this http://community.igniterealtime.org/thread/28921 for remove packet listeners
But not found solution.
please check. thank you for your timing.

A: Here's something you could start with:
public class YourClass {
    private PacketListener packetListener;
    ....
}

Then later on once you want to instantiate the PacketListener:
packetListener = new PacketListener(
....
);
connection.addPacketListener(packetListener);

And for removing it:
connection.removePacketListener(packetListener);

A: You can try this, it worked for me:`
PacketFilter filter;
PacketListener packetListener;
filter = new MessageTypeFilter(Message.Type.chat);
packetListener = new PacketListener() {
                                public void processPacket(Packet packet) {
                                    // do something with your packet here
                                    Message message = (Message)packet;
                                    String from  = message.getFrom();
                                    String body = message.getBody();
                                    System.out.println("Message from: " + from + " " + body);
                                }
                            };
                            connection.addPacketListener(packetListener, filter);
//And when you want to remove it:
connection.removePacketListener(packetListener);


text:
Q: Как устроено перенаправление потоков данных? Я пишу свой командный интерпретатор на C наподобие bash. И возник вопрос: "Как bash перенаправляет потоки?". Я искал где только мог, но кроме инструкций по применению этой возможности я ничего не нашёл.

A: Для того, чтобы понять как работает перенаправление потоков, нужно помнить всего одну вещь: программа, запущенная с помощью exec(2), наследует открытые файловые дескрипторы процесса, вызвавшего exec(2).
Далее все просто. Допустим вы хотите перенаправить stdout какой-то утилиты в файл, например вот так:
$ ls > output
В вашем интерпретаторе для этого вы делаете вот так (псевдокод):
pid = fork()
if (!pid) { // child
  fd = open("output")
  dup2(fd, STDOUT_FILENO)
  exec("ls")
}

Для создания пайпа (|) используется аналогичный подход с той лишь разницей, что создается два процесса и у одного заменяет stdin, а у другого - stdout, на файловые дескрипторы, которые возвращает системный вызов pipe(2).


text:
Q: How to pass param inside single quotes to a postgres query? In my node app, i need to run below query and and i'm passing parameters dynamically. But it's not fetching the parameters since they are referenced inside single quotes. Suggest a solution for this.
const text = `UPDATE glacier_restore_progress
            SET
            status='completed',
            restore_end=CURRENT_TIMESTAMP,
            restore_expire=DATE_TRUNC('minutes', current_timestamp + interval '$1 minutes')
            WHERE file_path = '$2' AND date_trunc('minutes', current_timestamp - interval '$1 minutes') <= restore_start`;

const values = [restoreDuration, fileKey];
await pool.query(text, values);

and the error i get is,
"bind message supplies 2 parameters, but prepared statement \"\" requires 0"

A: You are absolutely right; parameters cannot be inside quotes. There are a few ways we can solve this:
Taking the similarly broken example SELECT * FROM employees WHERE CURRENT_TIMESTAMP - start_date < INTERVAL '$1 years';

*

*Have the client submit the "full" value: SELECT * FROM employees WHERE CURRENT_TIMESTAMP - start_date < INTERVAL $1;

*Construct string in the query: SELECT * FROM employees WHERE CURRENT_TIMESTAMP - start_date < INTERVAL ($1 || ' years');

*(interval specific) Use the fact the unit can be specified as its own keyword: SELECT * FROM employees WHERE CURRENT_TIMESTAMP - start_date < INTERVAL $1 MINUTE
My preference in this case is 1, however the most faithful to your question is 3. Be careful to use MINUTE and not MINUTES. Option 2, using the concatentation operator, is a good hack to have in your toolbelt. All answers tested in Postgres 13.
In addition to this, your parameter is likely going to bound as a number, which will get you an error. You may need to cast it to text, like so $1::TEXT
Your full query would be:
UPDATE glacier_restore_progress
SET
    status = 'completed',
    restore_end = CURRENT_TIMESTAMP,
    restore_expire = DATE_TRUNC('minutes', CURRENT_TIMESTAMP + INTERVAL $1::TEXT MINUTE)
WHERE file_path = $2
  AND DATE_TRUNC('minutes', current_timestamp - INTERVAL $1 MINUTE) <= restore_start

A: use this,
const text = `UPDATE glacier_restore_progress
        SET
        status='completed',
        restore_end=CURRENT_TIMESTAMP,
        restore_expire=DATE_TRUNC('minutes', current_timestamp + interval '1 minutes' * $1)
        WHERE file_path = $2 AND date_trunc('minutes', current_timestamp - interval '1 minutes' * $1) <= restore_start`;

const values = [restoreDuration, fileKey];
await pool.query(text, values);

this convention is mentioned here refrence


text:
Q: Automatically Coloring the Java Keywords when i am open a file in JTextpane i want apply the colors to the java keywords. When i am open a file it raise the Attempt to mutate in notification exception and program not shown completely and colors also not applied.
Here is my code,
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FileDialog;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyleContext;
import javax.swing.text.StyledDocument;

public class JavaKeywordsColor extends javax.swing.JFrame {

    private JTextPane textPane;
    private Color color = Color.BLACK;
    private int i = 0;
    private JPanel noWrapPanel;
    private JScrollPane scrollpane;
    private JTextField status;
    private StyledDocument d;
    private String[] keywords = {"import ", "class ", "int ", "public ", "private"};

    public JavaKeywordsColor() {
        initComponents();
    }

    private void initComponents() {
        tp = new javax.swing.JTabbedPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        Open = new javax.swing.JMenuItem();
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        jMenu1.setText("File");
        Open.setText("Open");
        Open.addActionListener(new java.awt.event.ActionListener() {
            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OpenActionPerformed(evt);
            }
        });
        jMenu1.add(Open);
        jMenuBar1.add(jMenu1);
        setJMenuBar(jMenuBar1);
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(tp, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE));
        layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(tp, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE));
        pack();
    }// </editor-fold>

    private void OpenActionPerformed(java.awt.event.ActionEvent evt) {
        FileDialog fd = new FileDialog(JavaKeywordsColor.this, "Select File", FileDialog.LOAD);
        fd.setVisible(true);
        String title;
        String sts;
        if (fd.getFile() != null) {
            sts = fd.getDirectory() + fd.getFile();
            title = fd.getFile();
            BufferedReader br = null;
            StringBuffer str = new StringBuffer("");
            try {
                br = new BufferedReader(new FileReader(sts));
                String line;
                try {
                    while ((line = br.readLine()) != null) {
                        str.append(line + "\n");
                    }
                } catch (IOException ex) {
                    Logger.getLogger(JavaKeywordsColor.class.getName()).log(Level.SEVERE, null, ex);
                }
            } catch (FileNotFoundException ex) {
                Logger.getLogger(JavaKeywordsColor.class.getName()).log(Level.SEVERE, null, ex);
            }
            String t = str.toString();
            final JInternalFrame internalFrame = new JInternalFrame("", true, true);
            textPane = new JTextPane();
            // textPane.setEditorKit(new WrapEditorKit());
            d = textPane.getStyledDocument();
            d.addDocumentListener(new DocumentListener() {
                @Override
                public void insertUpdate(DocumentEvent de) {
                    jColorActionPerformed(de);
                }

                @Override
                public void removeUpdate(DocumentEvent de) {
                    jColorActionPerformed(de);
                }

                @Override
                public void changedUpdate(DocumentEvent de) {
                    jColorActionPerformed(de);
                }
            });
            Document doc = textPane.getDocument();
            textPane.setFont(new java.awt.Font("Miriam Fixed", 0, 13));
            internalFrame.add(textPane);
            i += 1;
            internalFrame.setName("Doc" + i);
            this.add(new javax.swing.JScrollPane(textPane));
            noWrapPanel = new JPanel(new BorderLayout());
            noWrapPanel.add(textPane);
            scrollpane = new JScrollPane(noWrapPanel);
            internalFrame.add(scrollpane);
            internalFrame.setTitle(title);
            tp.add(internalFrame);
            tp.setSelectedIndex(i - 1);
            internalFrame.setVisible(true);
            textPane.setText(t);
        }
    }

    private void jColorActionPerformed(DocumentEvent evt) {
        replace(textPane);
    }

    public void replace(javax.swing.JTextPane jp) {
        int cur = jp.getCaretPosition();
        StyleContext sc = StyleContext.getDefaultStyleContext();
        AttributeSet aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, Color.BLUE);
        for (int ii = 0; ii < keywords.length; ii++) {
            int fromIndex = 0;
            String msg = keywords[ii];
            int nol = 0;     //number of lines upto keyword
            int len = 1;
            while (len != -1) {
                len = jp.getText().indexOf(msg, fromIndex);
                jp.setSelectedTextColor(Color.RED);
                if (len != -1) {
                    try {
                        nol = countLine(jp.getText(0, len + 1));
                    } catch (BadLocationException ex) {
                        break;
                    }
                    fromIndex = len + msg.length();
                    System.out.println("len = " + len + " nol=" + nol);
                    len -= nol;
                    jp.select(len, len + msg.length());
                    System.out.println("Selected Text = " + jp.getSelectedText());
                    jp.replaceSelection("");
                    jp.setCaretPosition(len);
                    jp.setCharacterAttributes(aset, false);
                    jp.replaceSelection(msg);
                }
            }
        }
        aset = sc.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, Color.BLACK);
        jp.setCharacterAttributes(aset, false);
        jp.setCaretPosition(cur);
    }

    public int countLine(String str) {
        int n = 0;
        for (int ii = 0; ii < str.length(); ii++) {
            if (str.charAt(ii) == '\n') {
                n++;
            }
        }
        return n;
    }

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new JavaKeywordsColor().setVisible(true);
            }
        });
    }
    private javax.swing.JMenuItem Open;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JTabbedPane tp;
}

A: The message of the exception makes it pretty clear. You are not allowed to mutate the document while the listener notification is in progress. The reason is quite clear: the modification would trigger new notifications and in programs like yours, either a StackOverflowError or an infinite loop would be provoked. It also implies that the might be reports for newer modifications at a time where other listeners not yet have learned about the old ones.
You have to schedule the modification to a later time and protect your code from reacting on your own modifications. Scheduling the update to a later time can also help regarding the performance when the user is typing fastly as you don't want to parse an entire document on every inserted character.
So you should replace the part where you add the DocumentListener
d.addDocumentListener(new DocumentListener() {
    @Override
    public void insertUpdate(DocumentEvent de) {
        jColorActionPerformed(de);
    }

    @Override
    public void removeUpdate(DocumentEvent de) {
        jColorActionPerformed(de);
    }

    @Override
    public void changedUpdate(DocumentEvent de) {
        jColorActionPerformed(de);
    }
});

to something like this:
final class UpdateTrigger implements DocumentListener, ActionListener {
  final Timer timer=new Timer(150, this);
  boolean enabled=true;
  UpdateTrigger() {
    timer.setRepeats(false);
  }
  public void insertUpdate(DocumentEvent e) {
    if(enabled) timer.restart();
  }
  public void removeUpdate(DocumentEvent e) {
    if(enabled) timer.restart();
  }
  public void changedUpdate(DocumentEvent e) {
    if(enabled) timer.restart();
  }
  public void actionPerformed(ActionEvent e) {
    enabled=false;
    try { jColorActionPerformed(null); }
    finally { enabled=true; }
  }
}
d.addDocumentListener(new UpdateTrigger());

You might find out then that your code has more issues which are beyond the scope of your question. By the way, just highlighting keywords is not enough for a correct syntax highlighting. You need a parser which understands the syntactical structure, especially comments and String literals, even for the minimum highlighting.
You should study Chapter 3 of the The Java® Language Specification to get the complete picture.


text:
Q: Strange consequences of "ref" keyword in C# to COM interop Consider an excerpt from code that can be found here:
namespace WinSearchFile
{
    public class Parser
    {
        [DllImport("query.dll", CharSet = CharSet.Unicode)]
        private extern static int LoadIFilter (string pwcsPath, ref IUnknown pUnkOuter, ref IFilter ppIUnk);

        [ComImport, Guid("00000000-0000-0000-C000-000000000046")]
        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        private interface IUnknown
        {
            [PreserveSig]
            IntPtr QueryInterface( ref Guid riid, out IntPtr pVoid );
            [PreserveSig]
            IntPtr AddRef();
            [PreserveSig]
            IntPtr Release();
        }

        private static IFilter loadIFilter(string filename)
        {
            IUnknown iunk = null;
            IFilter filter = null;

            // Try to load the corresponding IFilter
            int resultLoad = LoadIFilter( filename, ref iunk, ref filter );
            if (resultLoad != (int)IFilterReturnCodes.S_OK)
            {
                return null;
            }
            return filter;
        }
  }

Parser::loadIFilter() in that code basically calls LoadIFilter() function. The latter looks up the registry, finds which class id corresponds to the specified file extension, instantiates a corresponding COM class (calls CoCreateInstance()) and calls IPersistFile::Load() from it.
Now the problem is that the signature for LoadIFilter() is the following:
HRESULT __stdcall LoadIFilter( PCWSTR pwcsPath, __in IUnknown *pUnkOuter, __out void **ppIUnk );

so the second parameter is IUnknown* of the aggregating object. If the COM class for the extension of interest doesn't support aggregation and the IUnknown* passed is not null CoCreateInstance() returns CLASS_E_NOAGGREGATION and so does LoadIFilter().
If I remove the ref keyword from the pUnkOuter parameter in the declaration and at the site of LoadIFilter() call the function is called with null IUnknown*. If I retain the ref keyword the function is called with non-null IUnknown* and returns CLASS_E_NOAGGREGATION for classes that don't support aggregation.
My question is - why is non-null IUnknown* passed when the keyword is retained? IUnknown iunk local variable is initialized to null so where does non-null IUnknown* come from in the invoked unmanaged code?

A: When you use the ref, you're not actually sending in the null, you're sending in a reference to where that null is stored, but when you're sending in without the ref you're sending in the actual value, which is null.
So:
With ref it's a reference to a null pointer.
Without it it's just a null pointer.
Edit: If I understand your question correctly, which I'm not 100% certain off...

A: Using ref is simply wrong, your IUnknown is already passed as a pointer since it is an interface.  Passing ref would be equivalent to IUnknown**

A: The non-null bit comes from inside the method - it is instantiating an object onto the reference you've provided.  Using the ref keyword on a reference type will pass the callers reference to the object, not creating another reference to the object (which is what happens when you pass by reference normally).  Try this:
static void Main()
{
    object foo = null;
    SetMyObject(ref foo);

    bool test = foo == null;
}

public static void SetMyObject(ref object foo)
{
    foo = new object();
}

The variable test will be false.


text:
Q: Junit good practices: Do I test for runtime error condition? Let's say I have a code that does some DB work and has a happy path and the only unhappy flow, that only occurs when DB connection is down, like this:
  public Report createReport(
      String reportType, Report reportData, ReportUser reportUser, Timestamp createTs) {
    KeyHolder reportIdHolder = new GeneratedKeyHolder();
    try {
      saveReportDetails(reportType, reportData, reportUser, createTs);
    } catch (DataAccessException e) { <-------------- This extends RuntimeException
      log.error(
          "DataAccessException while trying to insert report with name {}",
          reportData.getReportName(),
          e);
      throw e;
    }
    ...
    // More of the happy path code here
  }

I've got a test for the happy path, but is it a good practice to test for the Runtime exception flow as well?
The app is a SpringBoot Rest app, so it doesn't die when the exception is rethrown after logging.


text:
Q: How can I reproduce 'Improved GAN' code? Problems with theano/cudnn/docker I've been trying to reproduce the code found here, with respect to the "Improved GANs" by OpenAI, but I'm having a lot of trouble setting the environment (a Docker container).
I just can't make Theano work properly with this code.
I created a Docker container to test it, but a segmentation fault is raised when I use the stable version of Theano installed using conda...
Some posts suggest to use the development version of Theano instead, but when I update it, Theano can't find the Cudnn anymore
(gpuarray/dnn.py", line 98, in _dnn_lib raise RuntimeError('Could not load cudnn library') RuntimeError: Could not load cudnn library)

If someone have some background with Theano/lasagne/docker could help me I would appreciate it a lot. If requested I could paste my Dockerfile, or anything that could help.

A: I managed to "fix" it using the following dockerfile.
Hope it can help someone :)
Apparently, it needed an older Theano version for it to work properly.


text:
Q: Vagrant plugin command is not available when running `vagrant plugin install` I have tried installing vagrant from both an apt repo and gem but here's the output I am getting when I try to run vagrant plugin install (clearly no plugin command in output):
Usage: vagrant [-v] [-h] command [<args>]

    -v, --version                    Print the version and exit.
    -h, --help                       Print this help.

 Available subcommands:
     box
     destroy
     gem
     halt
     init
     package
     provision
     reload
     resume
     ssh
     ssh-config
     status
     suspend
     up

I have tried installing vagrant from both apt and Rubygems and in both cases I get no plugin command. I am running Ubuntu 12.04 LTS.

A: Install Vagrant from source.
The github repo is here: https://github.com/mitchellh/vagrant
And these instructions should allow you to build and install the bleeding edge version: https://github.com/mitchellh/vagrant/wiki/Installing-Vagrant-from-source
If you want the latest stable version then once you have cloned the repo as described in the link above you should checkout the 1.2.2 tag with git checkout v1.2.2 and then build that.


text:
Q: How to select distinct data from database on the bases of catagories I have a table in database named posts in which there are five columns name
id, title , author , cata , content

*cata means categories
I want to fetch 10 rows of data of different categories
like
select * from `posts` by distinct cata

Something like.
e.g.
I want this result
1.this is gaming posts author(Mauk) cata(Gaming) content......
2.this is glossary posts author(Mauk) cata(glossary) content......
3.this is shoes posts author(Mauk) cata(shoes) content......
4.this is garments posts author(Mauk) cata(garments) content......
5.this is you tube posts author(Mauk) cata(YouTube ) content......
6.this is blogging posts author(Mauk) cata(blogging ) content......
7.this is editing posts author(Mauk) cata(editing) content......
8.this is electronics posts author(Mauk) cata(electronics) content......
9.this is programming posts author(Mauk) cata(programming ) content......
10.this is news posts author(Mauk) cata(news) content......

A: In MySQL 8+, you can do:
select p.*
from posts p
order by row_number() over (partition by cata order by id)
limit 10;

In earlier versions, you can get the most recent post for each category by doing:
select p.*
from posts p
where p.id = (select max(p2.id)
              from posts p2
              where p2.cata = p.cata
             )
limit 10;

A: Would you please check the following query
select distinct cata, id, title, autho, content from posts LIMIT 10

A: You can use top 10 and concatenating the value selected as below
Select Top 10 'this is gaming posts ' + author + '   ' +  cata + ' your content...'  from
 posts order by id ;


text:
Q: Can't justify content of grid ( Material-ui, React), Do you know how to fix? I'm developing a site with React, but I can't justify the grid items.
As you can see I also created the "divcard" class for the initial
. I tried different ways, but nothing works.
I attach the grid code, and the divcard class.
The grid code I attached is not complete. Thanks for the help
divcard: {

          backgroundColor: '#212121',
          padding: theme.spacing(3),
          flexGrow : 1,
          flex : 1,
          justifyContent: 'center',
          display: 'flex'

        }

  <Route path="/Critto" render={() =>

     <div className={classes.divcard}>

                    <Grid  container direction='row' spacing={4}  justify='center'>

                        <Grid item xs={12}>

                            <SimpleImageSlider width={600}  height = {400} images = {imagesSlider} slideDuration = '1'/>

                        </Grid>

                        <Grid item xs={6}>

                          <Card className={classes.cardstats} style = {{color : '#faf7f7', marginTop: 70}}>
                                <CardActionArea>
                                  <CardMedia
                                    className={classes.mediacard}
                                    image={TimeLine}
                                    title="Storia Della Crittografia"
                                  />
                                  <CardContent>
                                    <Typography gutterBottom variant="h5" component="h2" >
                                      Storia Crittografia
                                    </Typography>
                                    <Typography variant="body2" color="textSecondary" component="p" style = {{color : '#faf7f7'}}>
                                      grrrrr testo quiiiiiii
                                    </Typography>
                                  </CardContent>
                                </CardActionArea>
                                <CardActions>
                                  <Link to="/Critto" style = {{textDecoration : 'none '}}>
                                  <Button  variant="contained" size = 'small' className={classes.buttoncard}>
                                    Learn More
                                  </Button>

                                  </Link>
                                </CardActions>
                          </Card>

                         </Grid>


text:
Q: Intellij is not showing SceneBuilder properly I have just installed SceneBuilder in IntelliJ for JavaFX but is not showing properly. please check the below image, somehow it messes up with font.
I use MacOs BigSur version 11.3
ItelliJ version: 2021.1 CE
Does anyone know how to fix the issue?
Thank you in advance

A: Please follow the issue created for this bug: https://youtrack.jetbrains.com/issue/IDEA-266524


text:
Q: SQL Server File Operations? Using SQL Server 2005: How can I read a file into a SPROC using T-SQL?
So, imagine I have a CSV file like so:
ID,OtherUselessData
1,asdf
2,asdf
3,asdf

etc...
I basically want to do this:
Select * from mytable where id in (select id from txtFile)

A: Consider using OPENROWSET function to open/parse you CSV file and use it as a 'row source' (i.e. like a table)

A: here are some examples: http://www.simple-talk.com/sql/t-sql-programming/reading-and-writing-files-in-sql-server-using-t-sql/


text:
Q: A question on position and velocity vectors from a vector space perspective In introductory physics we are taught about position and velocity vectors. Though the representation of those vectors is identical (i.e. $x\hat{x}+y\hat{y}+z\hat{z}$) they must belong to separate vector spaces, as it would be nonsensical to add a position vector to a velocity vector. Now, when we multiply a velocity vector by time, what we get is a displacement, and this is addable to position, i.e. $\vec{x}=\vec{x}_0 + \vec{v}t$. This seems odd, as though somehow multiplying by time projects the velocity vector into the position vector space. But all we're doing is multiplying velocity by a scalar. But now we can add the result to a vector that was not in the original vector space. This is not how vector spaces work, per my understanding. What is going on when a velocity vector is multiplied by time, a scalar value, that allows the result to add with a position vector which was not part of the original vector space?

A: So my answer is that they are almost the same space $\mathbb R^3$ but not quite.
What is actually happening is that anything you regard as a physics scalar is actually an equivalence class of pairs $(m, s) \in \mathbb R\times\mathbb R_+$ where $(m, s)\equiv (M, S)$ just when $m/s = M/S$. The quantity $m$ is the measurement we actually see and the quantity $s$ is a scale factor which we attempt to determine through a process we call "calibrating our instruments." (In fact there is also a third number here which we call our uncertainty about the measurement, that depends on both uncertainty in $m$ and $s$, but let's ignore that because we can kind of tack it on later just as easily as now and doing it rigorously requires Borel sigma-algebras or the like.)
So for example you measure something with a meter stick and it tells you 100, I measure the same thing with my tape measure and I get a very different number, 39 ⅜, we do not immediately think that the world is broken, rather we think that you are measuring in centimeters and I am measuring in inches. The two are equivalent once we calibrate the meter stick and the tape measure to each other, to arrive at some common base. Moreover, we expect the exact choice of base for this number to not matter much, so we kind of have in the back of our minds a scaling isomorphism separate from the equivalence relation where we could do all the same physics with $(m, \alpha s)$ for some $\alpha$.
Given this alone, $+$ is still well-defined as $P_1+P_2=\{(m_1+m_2,s): (m_1, s)\in P_1, (m_2,s)\in P_2\}$. So like if I had chosen $k s$ I would have ended up with $(k m_1 + k m_2, ks)\equiv (m_1+m_2, s),$ so my equivalence class property is not broken. But $\cdot$ is not because the same approach yields $(k^2 m_1 m_2, k s)$. There are other definitions which work like say $(tm_1m_2/(s_1s_2), t)$ but they violate the scaling isomorphism. To get back our precious multiplication operation, we have to define an even larger space.
Here we assume that there are $n$ fundamental "dimensions" for the fundamental scale factors and we consider an equivalence class of $\mathbb R \times \mathbb R_+^n$. The trick is that we don't have just one of these, we have countably infinitely many, parameterized by a $(q_1,\dots q_n)\in\mathbb Q^n$. So now $(m, (s_1, \dots s_n))\equiv (M, (S_1,\dots S_n))$ just when
$${m_1\over s_1^{q_1}\cdot \dots  s_n^{q_n}}
\equiv{M_1\over S_1^{q_1}\cdot \dots  S_n^{q_n}}.$$
Now each one space has an internal addition operation as before, but now also we have a multiplication operation which connects any two spaces, $$(m, \mathbf s)\cdot (M, \mathbf s) = (m \cdot M, \mathbf s)$$ now works precisely because this lives in $\mathbf q+\mathbf Q$ and, had you chosen $k s_i$, you would have $k^{q_i} m ~k^{Q_i} M/(s_1^{q_1+Q_1}\dots(k s_i)^{q_i+Q_i}\dots)$ and the scale factor divides out cleanly.
You may notice that this trick just requires $\mathbb N$ for the exponent rather than the full power of $\mathbb Q$ and that is true, but defining division requires $\mathbb Z$, and it is very nice to be able to invert from square meters back down to meters so closing this under $n^{\text{th}}$ roots is valuable. Closing under real roots has on the flip side no added value for physicists as far as I know. But especially in electrodynamics with Gaussian units you do get these strange square-roots-of-cm units and so forth.
So I will also say that in practice, most people use the SI units, which have $n=7$ and $q_1$ designates scaling with mass with $m_1=s_1=1$ for one kilogram, $q_2$ with length calibrated to meters, $q_3$ with time calibrated to seconds, $q_4$ with temperature calibrated to kelvins, $q_5$ with amount of substance calibrated to moles, $q_6$ with electric current calibrated to amperes, and $q_7$ with luminous intensity calibrated to candelas. So for example a speed has the vector $\mathbf q = (0, 1, -1, 0, 0, 0, 0)$ and if we want it in kilometers per hour then it has the scale factors $\mathbf s=(1, 1000, 3600, 1,1,1,1)$ and in practice we denote the both of these as $\text{km}/\text{hr}$ in one go rather than trying to write out these two abstruse 7-component vectors.
This is all to say that when you create vector spaces on top of these scalars, you have a similar situation of networked vector spaces indexed by a $\mathbb Q^n$, and while there is a field of scalars with $\mathbf q=0$ which you can lean on now, this variable $t$ is not one of them, it has a non-zero $\mathbf q =(0,0,1,0,0,0,0)$ and therefore a scalar multiplication with it takes the space $(0,1,-1,0,0,0,0)$ to the space $(0,1,0,0,0,0,0)$ which is indeed a different vector space.
We do teach all of this but never at this level of rigor, you are much more likely to just see the named units and you are told that you cannot add two numbers unless those units are exactly the same, and you are told that they multiply like numbers but are not numbers, and you are hopefully told, although I am finding this less and less, that if you have an equation among units, say $1000\text{ m}=1\text{ km},$ or $3600\text{ s}=1\text{ hr},$ that you can use that to substitute: in this case if you had a car driving at $72 \text{ km}/\text{hr}$ you can substitute both of those units as $72\cdot(1000\text{m})/(3600 \text{s}) = 20 \text{m/s}.$
One advantage of this level of rigor is that I can tell you the fundamental idea of dimensional analysis, which is that because you can't add scalars with different $\mathbf q$, and because a Taylor series of an arbitrary smooth function would add terms with different powers, you can only take an arbitrary smooth function of a dimensionless quantity $\mathbf q=0$. This in turn creates a linear algebra problem: I know that these five quantities are the only ones that are physically relevant for this problem, I know each of their $\mathbf q_1\dots\mathbf q_5$, what are the independent linear combinations which are dimensionless? Then an arbitrary answer must be, always, some combination of the five parameters which has the right units, times an arbitrary function of the dimensionless combinations.
So for example if you want to know the radius of curvature of a particle moving with velocity $v$ and acceleration $a$, well you are asking for a length and I have a length per unit time and a length per unit squared time, it has to be $k v^2/a$ for some pure number $k$. Turns out $k=1/\sin\theta$ where $\theta$ is the angle between the vectors, dimensional analysis can't tell you that, but you got 90% of the solution "without thinking about it."

A: Who says they are separate vector spaces? You are thinking of quantum mechanics where position and velocity (momentum) belong to separate vector spaces. In classical mechanics this is not the case and in the example you provide above, both vector spaces are the same. You do not add position to velocity because they are different quantities and have different physical dimensions.
What you are confusing are the abstract (Hilbert) vector spaces we deal with in QM. In classical mechanics we are dealing with real actual dimensions given by the unit vectors i j k which "span" (define) physical (not abstract) space. So that we can add velocity and position (by using t multiplication) within that very same space.

A: What you have discovered is that "position" doesn't really live in a vector space, it lives in an affine space. Of course there are technical abstract definitions of the two, but what it boils down to is the origin.
Vector spaces don't really have one, though there is a unique null vector, $\vec 0$, that satisfies:
$$ \vec a + \vec 0 = \vec a $$
for instance. Meanwhile, the coordinate ${\bf O} = (0, 0, 0)$ is not special, and depends entirely on your choice of coordinates.
To define the position of a point, you need to define the origin and some displacement vector:
$$ {\bf A} = {\bf O} + \vec r_A $$
One can add a vector to a point to get a new point:
$$ {\bf A} +\vec r_{B-A} = {\bf B} $$
and you can subtract two points to get their vector difference:
$$ {\bf B} - {\bf A }=\vec r_{B-A} $$
but you cannot add two points:
$$ {\bf A} + {\bf B }=?$$
in a coordinate independent way.


text:
Q: azcopy task in azure devops gives me failed to enum directory but not sure why Hi all I have spent quite a bit of time and I CANNOT work out why azcopy works in a step but not when is wrapped in a stage. I need to work using stages  see below. The commented out code does not work when using stages.
Error
I get Error parsing source location "d:a\1\s\etc....  Failed to enumerate directory
I noticed
When using stages the log
AzCopy\AzCopy.exe" /Source:"D:\a\1\s\src\Dev\settings\AppSettings.json
when using step only
AzCopy\AzCopy.exe" /Source:"D:\a\1\s\src\Dev\settings
        trigger:
        - none

        variables:
        - group: AppVariables
        - group: AppVariables2
        - name: workingdirectory
          value: '$(System.DefaultWorkingDirectory)/$(AppSettingsJson)'

        resources:
          repositories:
            - repository: templates
              type: git
              name: Dev/Core

        # stages:
        # - stage: upload_Dev_File
        #   displayName: 'Upload File'
        #   jobs:
        #   - deployment: DevDeploy
        #     pool:
        #       vmImage: 'windows-latest'
        #     environment: $(DevEnvironment)
        #     strategy:
        #       runOnce:
        #         deploy:
        #          steps:
        #           - task: AzureFileCopy@3
        #             displayName: 'Deploy file to blob storage'
        #             inputs:
        #               SourcePath: $(workingdirectory)
        #               azureSubscription: '$(MyAzureSubscription)'
        #               Destination: AzureBlob
        #               storage: appStorage
        #               ContainerName: myApp
        #               BlobPrefix: Dev/Settings

        pool:
          vmImage: 'windows-latest'

        steps:
        - task: AzureFileCopy@3
          displayName: 'Deploy file to blob storage'
          inputs:
            SourcePath: $(workingdirectory)
            azureSubscription: '$(MyAzureSubscription)'
            Destination: AzureBlob
            storage: appStorage
            ContainerName: myApp
            BlobPrefix: Dev/Settings

I have also tried version 2 and 4 with no luck.Happy to do in powershell if easier. Any suggestions on what is going wrong here?
many thanks

A:
I get Error parsing source location "d:a\1\s\etc.... Failed to
enumerate directory

For this issue, I think the agent could not find the files in the s folder. This is because when the stage is run, a new agent is used to run it.
Below is my reproduction of this problem:

As workaround, we need to add a checkout step in the stage .
- stage: upload_Dev_File
  displayName: 'Upload File'
  jobs:
  - deployment: DevDeploy
    pool:
      vmImage: 'windows-latest'
    environment: $(DevEnvironment)
    strategy:
      runOnce:
        deploy:
          steps:
          - checkout: RepoName
          - task: AzureFileCopy@3
            displayName: 'Deploy file to blob storage'
            inputs:
              SourcePath: '$(workingdirectory)'
              azureSubscription: '$(MyAzureSubscription)'
              Destination: 'AzureBlob'
              storage: 'appStorage'
              ContainerName: 'myApp'
              BlobPrefix: 'Dev/Settings'

After adding checkout step, it works well: