text:
Q: KK-theory as a stable infinity-category and KU Mod The category KK of bivariant operator K-theory (or possibly its E-theory variant) ought to be the homotopy category of something at least close to a stable infinity-category; notably in that it carries a by now well-known triangulated category structure.
What seems like a step in the direction of establishing such a stable $\infty$-category structure is in the note

*

*Michael Joachim, Stephan Stolz, An enrichment of KK-theory over the category of symmetric spectra Münster J. of Math. 2 (2009), 143–182 (pdf)

which produces

*

*an enrichment $\mathbb{KK}$ of $KK$ in symmetric spectra, in fact in KU-module spectra;

*a symmetric monoidal enriched functor $\mathbb{KK} \to \mathrm{KU} Mod$.
(A partial equivariant generalization of this is given by Mitchener in arXiv:0711.2152.)
This prompts some evident questions:

*

*Does this enrichment exhibit a presentation of a stable $\infty$-category structure (or close)?

*How far is that functor from being homotopy full and faithful?
Has anyone thought about this? What can one say?
(I see that Mahanta has a note arXiv:1211.6576 along these lines, but not sure yet if it helps with KK.)

A: $\DeclareMathOperator{\KK}{KK}$
$\DeclareMathOperator{\Ob}{Ob}$
$\DeclareMathOperator{\C}{\mathcal{C}}$
$\DeclareMathOperator{\top}{top}$
$\DeclareMathOperator{\id}{id}$
$\DeclareMathOperator{\pr}{pr}$
$\DeclareMathOperator{\N}{N}$
$\DeclareMathOperator{\HKK}{\mathbf{KK}}$
$\DeclareMathOperator{\const}{const}$
$\DeclareMathOperator{\Hom}{Hom}$
Rasmus already answered the second part of your question.  Let us construct a
stable quasi-category and a triangulated equivalence from its homotopy category
to $\KK$.  ($\Ob(\KK)$ shall be the class of separable C*-algebras.)  I know a
different, more abstract, construction, but you have heard me describe it
before.
Let $^*$ be the set of separable C*-algebras of set-rank $ω⋅2$.  Let $Δ$ be
the set of finite positive von Neumann ordinals.
For two C*-algebras $A$ and $B$ in $^*$ and $n + 1$ in $Δ$ let $^n(A, B)$ be
the set of all Kasparov cycles from $A$ to $\C(Δ^n_{\top}, B)$ – the
C*-algebra of continuous functions from the topological $n$–simplex to $B$.
Let $R$ be the strict $2$–category of sets, many-valued functions and
inclusions of functions.
Choose $n$ and $i$ in $Δ$, $γ\colon i → n$ order preserving, and $f$ in
$^n(A, B)$.  Let $γ^*$ be the set of preimages of $γ^*[f]$ in $^i(A, B)$.
The map $n + 1 ↦ ^n(A, B)$ is thus contravariantly oplaxly functorial for
order preserving maps and many-valued functions.  Let $(A, B)$ be that functor
– a simplicial $R$–set.
Let $(ϕ, ℰ, T)$ be in $^n(A, B)$.  Let $ℱ$ be the $/2$–graded Hilbert
$\C(Δ^n_{\top}, B)$–module $\C(Δ^n_{\top}, ℰ)$ with the inner product $⟨ξ, η⟩(s)
≔ ⟨ξ(s), η(s)⟩(s)$ and the module structure $(ξ⋅b)(s) ≔ ξ(s)⋅b$.  Define a
representation $ψ$ of $\C(Δ^n_{\top}, A)$ by even adjointable operators on $ℱ$ by
$ψ(a)(ξ)(s) ≔ ϕ(a(s))(ξ(s))$ and define an odd adjointable operator $S$ on $ℱ$
by $S(ξ)(s) ≔ T(ξ(s))$.  Put $M(ϕ, ℰ, T) ≔ (ψ, ℱ, S)$.
For three C*-algebras $A$, $B$ and $C$ in $^*$ and $n + 1$ in $Δ$ let
$μ^n(A, B, C)$ be the many-valued function from $^n(B, C) × ^n(A, B)$ to
$^n(A, C)$ that associates $h ∈ ^n(A, C)$ with $(f, g) ∈
^n(B, C) × ^n(A, B)$ if $[h] = [M(f)] ∘ [g] ∈ \KK(A, \C(Δ^n_{\top}, C))$.
Choose $A ∈ ^*$ and $n ∈ Δ$.  Consider $\C(Δ^n_{\top}, A)$ as a $/2$–graded
Hilbert module over itself in the usual way and let $ρ$ be the representation
of $A$ by the even operators of pointwise left-multiplication on
$\C(Δ^n_{\top}, A)$.  We write $η^n(A)$ for the many-valued function defined on
$\{0\}$ that takes as values all the Kasparov cycles equivalent to
$(ρ, \C(Δ^n_{\top}, A), 0) ∈ ^n(A, A)$.
Convince yourself of the following for all $A, B, C, D ∈ ^*$, $n + 1, i + 1 ∈
Δ$, $γ\colon i + 1 → i + 1$ order preserving:

*

*$∃f ∈ ^n(B, D): ((f, g), h) ∈ μ^n(A, B, D) ∧ ((d, e), f) ∈ μ^n(B, C, D) ⇔
      ∃j ∈ ^n(A, C): ((d, j), h) ∈ μ^n(A, C, D) ∧ ((e, g), j) ∈ μ^n(A, B, C);$

*$μ^i(A, B, C) ∘ (γ^* × γ^*) = γ^* ∘ μ^n(A, B, C):
     ^n(B, C) × ^n(A, B) → ^i(A, B);$

*$γ^* ∘ η^n(A) = η^i(A)$;

*$μ^n(A, A, B)(\id × η^n(A)) ⊇ \pr_1 ∧ μ^n(A, B, B)(η^n(B) × \id) ⊇ \pr_2.$
Thus $(^*, , μ, η)$ is a category enriched in the $2$–category of simplicial
$R$–sets.  Let us call such objects simplicial $R$–categories, as categories
enriched in simplicial sets are – also in this answer – called simplicial
categories.
Let us write $Δ^n$ for the $n$–dimensional simplicial ($R$–)simplex, $Λ^n(k)$
for its $k$–th horn and $ι(n, k)$ for the inclusion of $Λ^n(k)$ into $Δ^n$.  We
say that a simplicial $R$–set $X$ is a Kan complex if and only if for every
$n + 1$ and $k + 1$ in $Δ$ and every single-valued map $σ\colon Λ^n(k) → X$
there is a map $τ\colon Δ^n → X$ such that $σ = τ ∘ ι(n, k)$.
Claim: The simplicial $R$–set $(A, B)$ is a Kan complex for all $A$ and
$B$ in $^*$.

Proof. Pick any $n + 1$ and $k + 1$ in $Δ$.  Every single-valued map
$σ\colon Λ^n(k) → (A, B)$ determines some $f ∈ ^0(A, \C(Λ^n(k)_{\top}, B))$,
where $Λ^n(k)_{\top}$ is the corresponding $(n − 1)$–dimensional topological
horn.  The map $B ↦ ^0(A, B)$ is functorial for ${}^*$–homomorphisms and
many-valued functions; thus $f$ lifts to some $g ∈ ^0(A, \C(Δ^n_{\top}, B))$.
Use $g$ to fill in the missing values and thereby extend $σ$ to $Δ^n$.

Let $ℭ(Δ^n)$ be the canonical realisation of Δⁿ as cofibrant simplicial
category.
Let $D$ be a simplicial $R$–category.  We define the homotopy coherent nerve
$\N(D)$ of $D$ by
$$
  \N(D)(n + 1) ≔ \Hom_{\operatorname{single-valued}}(ℭ(Δ^n), D).
$$
Claim: The homotopy-coherent nerve of a simplicial $R$–category $D$ is a
quasi-category if all the simplicial arrow $R$–sets are Kan complexes.

Proof. Choose $n ≥ 2$ and $i$ with $1 ≤ i ≤ n − 1$.  Put $S ≔ ℭ(Δ^n)$ and
let $Q_k$ be the set of degenerate $k$–simplices in $S(0, n)$.  Let $L$ be the
largest simplicial subcategory of $S$ with $\Ob(L) = \Ob(S)$ and
$$
  ∀k ≥ 1\colon
  \{σ ∈ L_k(0, n) ∣ σ_0 = \{0, n\} ∧ σ_k ∪ \{i\} = \{0, \dotsc, n\}\} ⊆ Q_k.
$$
$L$ realises the horn $Λ^n(i)$ as cofibrant simplicial category.
Let $F\colon L → D$ be a functor.  We need to extend $F$ to $S$.  Because
$L(j, k)$ and $S(j, k)$ only differ for $j = 0$ and $k = n$ we only need to
extend the map $F(0; n)\colon L(0, n) → D(F(0), F(n))$ to $S(0, n)$.  The
inclusion of $L(0, n)$ into $S(0, n)$ is a cofibration.  It is also a weak
homotopy equivalence, because the geometric realisation of $S(0, n)$ is
homeomorphic to $[0, 1]^{n − 1}$, and the image of $L(0, n)$ is the contractible
subset
$$
  \{x ∈ [0, 1]^{n − 1} ∣ x_i = 1 ∨ ∃j ≠ i: (x_j = 0 ∨ x_j = 1)\}
$$
under this homeomorphism.  Therefore it is anodyne.  It has the extension
property with respect to all simplicial $R$–sets that are Kan complexes because
the inclusion of simplicial sets into simplicial $R$–sets and single-valued
maps preserves colimits.

We now know that $\HKK ≔ \N(^*, , μ, η)$ is a quasi-category.  Its objects
are elements $A$ of $^*$ paired with a choice of one element from $η^n(A)$ for
every $n + 1$ in $Δ$.  We can choose such elements canonically (see above); we
write $ι$ for this inclusion of $^*$ into $\Ob(\HKK)$.  The restriction of
$\HKK$ to $^*$ is equivalent to $\HKK$ via the inclusion.  On the other hand
also $\KK$ restricted to $^*$ is equivalent to $\KK$ via the inclusion.  For
$A$ and $B$ in $^*$, the cycles for $π(\HKK)(ι(A), ι(B))$ map onto
$\KK(A, B)$.  That map $θ$ is a bijection modulo equivalence because $θ(f) =
θ(g)$ in $\KK(A, B)$ only if $[M(h)] ∘ [f((s_0)^n(\const \{0, 1\}))] =
[g((s_0)^n(\const \{0, 1\}))]$ in $\KK(A, \C(Δ^n_{\top}, B))$ for all $n + 1$
in $Δ$ and some $h$ in $η^n(B)$.
We now only need to see that $\HKK$ is stable in a way that is compatible with
the triangulation on $\KK$.
For $0 ∈ ^*$, $ι(0)$ is a final object of $\HKK$, because $0$ is a final
object of $\KK$.
Claim:  For all matrix-stable $A, B, D$ in $^*$, $f = (ϕ, D, 0)$ in
$^0(A, D)$ and $g = (ψ, D, 0)$ in $^0(B, D)$, a map $F: Δ^1 × Δ^1 → \HKK$ is
a Cartesian square if

*

*
*

*$F_0(0; 0)
       = \{(a, b, d, h_1, h_2) ∈ A ⊕ B ⊕ D ⊕ \C([0, 1], D) ⊕ \C([0, 1], D)
           ∣ ∀d_2 ∈ D: h_1(0)⋅d_2 = ϕ(a)(d_2)
                       ∧ h_1(1) = d = h_2(1)
                       ∧ h_2(0)⋅d_2 = ψ(b)(d₂)\}$,

*

*$F_0(0; 1) = A$,

*$F_0(1; 0) = B$,

*$F_0(1; 1) = D$;

*
*

*$F_1(0, 0; 0, 1) = ((a, b, d, h_1, h_2) ↦ a_2 ↦ aa_2, A, 0)$,

*

*$F_1(0, 1; 0, 0) = ((a, b, d, h_1, h_2) ↦ b_2 ↦ bb_2, B, 0)$,

*$F_1(0, 1; 1, 1) = f$,

*$F_1(1, 1; 0, 1) = g$,

*$F_1(0, 1; 0, 1) = ((a, b, d, h_1, h_2) ↦ d_2 ↦ dd_2, D, 0)$;

*
*

*$F_2(0, 0, 1; 0, 1, 1)
        = ((a, b, d, h_1, h_2) ↦ ξ ↦ h_1ξ, \C([0, 1], D), 0)$,

*

*$F_2(0, 1, 1; 0, 0, 1)
        = ((a, b, d, h_1, h_2) ↦ ξ ↦ h_2ξ, \C([0, 1], D), 0)$;

Remark: Every cospan in $\HKK$ is equivalent to one as in the claim.

Proof.  Choose $n ≥ 1$ and a map $G\colon ∂Δ^n × Δ^1 × Δ^1 → \HKK$ of the
appropriate kind.  Without loss of generality we can adjust your choice of $G$
so that all the Kasparov cycles in the image come from ${}^*$–homomorphisms
(because $F_0(0; 0)$ is matrix-stable).  $G$ extends to $Δ^n × Δ^1 × Δ^1$
because $F$ determines a Cartesian square in the homotopy coherent nerve of the
topologically enriched category with $^*$ as set of objects and
${}^*$–homomorphisms with the topology of pointwise norm-convergence as mapping
spaces.

Bott periodicity therefore tells us that a suspension functor on $\HKK$ is an
equivalence.  Therefore $\HKK$ is stable.  The description of Cartesian squares
makes it clear that the triangulation on the homotopy category of $\HKK$ is
compatible with the equivalence to $\KK|^*$.

A: Answering your first question in more generality: an $\infty$-category that is enriched over spectra is a stable $\infty$-category if it is closed under finite limits.

A: There seems to be a mistake in the construction from "An enrichment..." See http://arxiv.org/pdf/1104.3441v1 page 3. That paper gives an alternative construction of a symmetric spectrum representing (equivariant) K-theory.
Concerning question 2: the induced functor $\mathrm{KK}\to\mathrm{Der}(\mathbf{K})$ is fully faithful and strongly monoidal on the bootstrap class of Rosenberg--Schochet (the localizing subcategory generated by $\mathbb C$). It cannot be fully faithful on all of $\mathrm{KK}$ because there are counterexamples to the Universal Coefficient Theorem in $\mathrm{KK}$ but not in $\mathrm{Der}(\mathbf{K})$.


text:
Q: How to cancel a requestjs download I've code similar to the following stripped down example
const req = request('http://www.my.url.here.com/file.bin') // 80 MB file
const decripher = .... // decipher from nodejs's crypto module
const output = fs.createWriteStream('result.zip');
const archive = archiver('zip', {zlib: { level: 9 } });
archive.pipe(output);

const stream = req
  .pipe(decipher)
  .on('error', (error) => {
    console.error(`Error deciphering file`)
    req.abort() // Does nothing

    decipher.unpipe() // Unpiping to prevent the next step producing a [ERR_STREAM_WRITE_AFTER_END] error

    stream.end() // End the stream as an error does not end it automatically
  })

archive.append(stream, { name: 'file.bin' });

Once an error occurs deciphering the file I don't want to download any more data. But I've noticed that in these scenarios a req.abort() does nothing.
In the end I have a file partially decrypted in the archive but it's still ~80 MBs. i.e. The entire file has been downloaded despite the error (which I setup to fire near the start of the file).
Why would this occur? How can I prevent the entire file from downloading?

A: You can destroy the underlying socket. You can get the socket in socket or response event.
const req = request(options);
req.on('response', function(response) {
    ....
    res.socket.end(); // or res.socket.destroy();
    ....
});
req.pipe(...);

Maybe in your case, modify a bit, this is basically a theory but you can do:
const req = request(options);
let sock = null;
req.on('socket', function(socket) {
    sock = socket;
}).on('error', ()=>{
    sock.destroy()//or end();
});

req.pipe(...);

redpajama_set_name: RedPajamaStackExchange


text:
Q: Overwriting function in class from another class(coffescript/javascript) Hi guys I have some issue at work that I can't handle by myself. Everything is written in coffescript but of course if someone want to help me by using JS, I don't mind, i appreciate all help :)
So let's get to it.
I'm trainee and because of my weird leader I'm forced to overwrite some function in class. So let's say I have class MyParentClass and it contains:
class @MyParentClass
  firstFunction: (var) ->
    imp
  secondFunction: (var)->
    doest matter really

So I have 2 functions in my class, but I would like only to "overwrite" first one. So my class is being used in another class:
class @ImUsingParentClass
  someFunction: ->
    new MyParentClass(some variables)

And what's more another class extends and using this class
class @ImSoLonely extends ImUsingParentClass

So it's almost over :)
I have to change firstFunction from MyParentClass in ImSoLonely.
I was reading some stuff about creating MyParentClass as abstract one (it's working in coffescript) but still I have no idea how to use it in ImSoLonely, how to execute another class(function?) that overwrites firstFunction.
Much thanks in advance!!!!!
And if you can't read this code please let me now and I'll try to convert it into javascript one.
Sorry for my bad English but I hope it's understandable.


text:
Q: Hexagonal tilling of hemi-sphere I need to have hexagonal grid on a spherical surface. like shown here.

Right now I am doing a hexagonal flattened grid.

and the projecting it onto the surface of a hemisphere. Like here,
But as you can see, the funny artifact is hexagons on the edge are disproportionately large. There should be a better way to do this so that all the hexagons are near equal in their size.

I had tried the solution like @spektre had suggested but my code was producing following plot.

i was using the a=sqrt(x*x+y*y)/r * (pi/2) because i wanted to scale a that goes from [0,r] to z [0,r] so angle a has bounds of [0,pi/2].
But with just a=sqrt(x*x+y*y)/r it works well.

New Development with the task, New problem

I have the problem that now, the hexagons are not equal through out the shapes. I want a uniform shape (area wise) for them across the dome and cylinder. I am confused on how to manage this?

A: Here is what I have in mind:

*

*create planar hex grid on XY plane
center of your grid must be the center of your sphere I chose (0,0,0) and size of the grid should be at least the 2*radius of your sphere big.

*convert planar coordinates to spherical
so distance from (0,0,0) to point coordinate in XY plane is arclength traveling on surface of your sphere so if processed point is (x,y,z) and sphere radius is r then latitude position on sphere is:
a=sqrt(x*x+y*y)/r;

so we can directly compute z coordinate:
z=r*cos(a);

and scale x,y to surface of sphere:
a=r*sin(a)/sqrt(x*x+y*y);
x*=a; y*=a;

If the z coordinate is negative then you have crossed half sphere and should handle differently (skip hex or convert to cylinder or whatever)
Here Small OpenGL/C++ example for this:
//---------------------------------------------------------------------------
const int _gx=15;           // hex grid size
const int _gy=15;
const int _hy=(_gy+1)<<1;   // hex points size
const int _hx=(_gx+1);
double hex[_hy][_hx][3];    // hex grid points
//---------------------------------------------------------------------------
void hexgrid_init(double r) // set hex[][][] to planar hex grid points at xy plane
    {
    double x0,y0,x,y,z,dx,dy,dz;
    double sx,sy,sz;
    int i,j;
    // hex sizes
    sz=sqrt(8.0)*r/double(_hy);
    sx=sz*cos(60.0*deg);
    sy=sz*sin(60.0*deg);

    // center points arrounf (0,0)
    x0=(0.5*sz)-double(_hy/4)*(sz+sx);
    y0=-double(_hx)*(sy);
    if (int(_gx&1)==0) x0-=sz+sx;
    if (int(_gy&1)==0) y0-=sy; else y0+=sy;

    for (y=y0,i=0;i<_hy;i+=2,y+=sy+sy)
     for (x=x0,j=0;j<_hx;j++,x+=sz)
        {
        hex[i][j][0]=x;
        hex[i][j][1]=y;
        hex[i][j][2]=0.0;
        x+=sz+sx+sx; j++; if (j>=_hx) break;
        hex[i][j][0]=x;
        hex[i][j][1]=y;
        hex[i][j][2]=0.0;
        }

    for (y=y0+sy,i=1;i<_hy;i+=2,y+=sy+sy)
     for (x=x0+sx,j=0;j<_hx;j++,x+=sx+sx+sz)
        {
        hex[i][j][0]=x;
        hex[i][j][1]=y;
        hex[i][j][2]=0.0;
        x+=sz; j++; if (j>=_hx) break;
        hex[i][j][0]=x;
        hex[i][j][1]=y;
        hex[i][j][2]=0.0;
        }

    }
//---------------------------------------------------------------------------
void hexgrid_half_sphere(double r0) // convert planar hex grid to half sphere at (0,0,0) with radius r0
    {
    int i,j;
    double x,y,z,a,l;
    for (i=0;i<_hy;i++)
     for (j=0;j<_hx;j++)
        {
        x=hex[i][j][0];
        y=hex[i][j][1];
        z=hex[i][j][2];
        l=sqrt(x*x+y*y);    // distance from center on xy plane (arclength)
        a=l/r0;             // convert arclength to angle
        z=r0*cos(a);        // compute z coordinate (sphere)
        if (z>=0.0)         // half sphere
            {
            a=r0*sin(a)/l;
            }
        else{               // turn hexes above half sphere to cylinder
            z=0.5*pi*r0-l;
            a=r0/l;
            }
        x*=a;
        y*=a;
        hex[i][j][0]=x;
        hex[i][j][1]=y;
        hex[i][j][2]=z;
        }
    }
//---------------------------------------------------------------------------
void hex_draw(int x,int y,GLuint style)     // draw hex x = <0,_gx) , y = <0,_gy)
    {
    y<<=1;
    if ((x&1)==0) y++;
    if ((x<0)||(x+1>=_hx)) return;
    if ((y<0)||(y+2>=_hy)) return;
    glBegin(style);
    glVertex3dv(hex[y+1][x  ]);
    glVertex3dv(hex[y  ][x  ]);
    glVertex3dv(hex[y  ][x+1]);
    glVertex3dv(hex[y+1][x+1]);
    glVertex3dv(hex[y+2][x+1]);
    glVertex3dv(hex[y+2][x  ]);
    glEnd();
    }
//---------------------------------------------------------------------------

And usage:
hexgrid_init(1.5);
hexgrid_half_sphere(1.0);

int x,y;
glColor3f(0.0,0.2,0.3);
for (y=0;y<_gy;y++)
 for (x=0;x<_gx;x++)
  hex_draw(x,y,GL_POLYGON);
glLineWidth(2);
glColor3f(1.0,1.0,1.0);
for (y=0;y<_gy;y++)
 for (x=0;x<_gx;x++)
  hex_draw(x,y,GL_LINE_LOOP);
glLineWidth(1);

And preview:

For more info and ideas see related:

*

*Make a sphere with equidistant vertices

*Turning a cylinder into a sphere without pinching at the poles


text:
Q: Iterate through each digit in a number I am trying to create a program that will tell if a number given to it is a "Happy Number" or not. Finding a happy number requires each digit in the number to be squared, and the result of each digit's square to be added together.
In Python, you could use something like this:
SQUARE[d] for d in str(n)

But I can't find how to iterate through each digit in a number in Java. As you can tell, I am new to it, and can't find an answer in the Java docs.

A: Assuming the number is an integer to begin with:
int num = 56;
String strNum = "" + num;
int strLength = strNum.length();
int sum = 0;

for (int i = 0; i < strLength; ++i) {
  int digit = Integer.parseInt(strNum.charAt(i));
  sum += (digit * digit);
}

A: I wondered which method would be quickest to split up a positive number into its digits in Java, String vs modulo
  public static ArrayList<Integer> splitViaString(long number) {

    ArrayList<Integer> result = new ArrayList<>();
    String s = Long.toString(number);

    for (int i = 0; i < s.length(); i++) {
      result.add(s.charAt(i) - '0');
    }
    return result; // MSD at start of list
  }

vs
  public static ArrayList<Integer> splitViaModulo(long number) {

    ArrayList<Integer> result = new ArrayList<>();

    while (number > 0) {
      int digit = (int) (number % 10);
      result.add(digit);
      number /= 10;
    }
    return result; // LSD at start of list
  }

Testing each method by passing Long.MAX_VALUE 10,000,000 times, the string version took 2.090 seconds and the modulo version 2.334 seconds. (Oracle Java 8 on 64bit Ubuntu running in Eclipse Neon)
So not a lot in it really, but I was a bit surprised that String was faster

A: You can use a modulo 10 operation to get the rightmost number and then divide the number by 10 to get the next number.
long addSquaresOfDigits(int number) {
    long result = 0;
    int tmp = 0;
    while(number > 0) {
        tmp = number % 10;
        result += tmp * tmp;
        number /= 10;
    }
    return result;
}

You could also put it in a string and turn that into a char array and iterate through it doing something like Math.pow(charArray[i] - '0', 2.0);

A: In the above example we can use:
int digit = Character.getNumericValue(strNum.charAt(i));

instead of
int digit = Integer.parseInt(strNum.charAt(i));

A: You can turn the integer into a string and iterate through each char in the string. As you do that turn that char into an integer

A: This code returns the first number (after 1) that fits your description.
public static void main(String[] args) {
    int i=2;
    // starting the search at 2, since 1 is also a happy number
    while(true) {
        int sum=0;
        for(char ch:(i+"").toCharArray()) { // casting to string and looping through the characters.
            int j=Character.getNumericValue(ch);
            // getting the numeric value of the current char.
            sum+=Math.pow(j, j);
            // adding the current digit raised to the power of itself to the sum.
        }
        if(sum==i) {
            // if the sum is equal to the initial number
            // we have found a number that fits and exit.
            System.out.println("found: "+i);
            break;
        }
        // otherwise we keep on searching
        i++;
    }
}


text:
Q: If $H \leq G$ and $|H|=p$ where $p$ is prime, is $H$ a normal subgroup? Currently reading Gallian's book "Contemporary Abstract Algebra" and while reading the section on Normal Subgroups, I made myself this question and I can't see that there is an exercise or anything in the book where they ask me this, so I was wondering.

A: No, and the already given answer has a nice example. But I thought I would just add a word on how to broach your own question: You are asking about whether, under some conditions, a subgroup must be normal. If true, then it would be nice to prove; if false, then it would be nice to find a counterexample. A while back I wrote another post (MSE 1214719) on how to find a counterexample for another group theory question; it may be worth a read.
In this case, an important fact to remember is that in an abelian group, every subgroup is a normal subgroup. So, if you are going to look for a counterexample, then you would be best suited to begin your search in a nonabelian group.
Recall - or read for the first time, in which case you may wish to prove them! - the following facts: first, the smallest nonabelian group is $S_3$, which has six elements; second, a group is divisible by the order of any of its subgroups (this is Lagrange's Theorem), so subgroups of $S_3$ must have order $1$, $2$, $3$, or $6$ (and, in this case, each exists); third, if the order of a group divided by the order of a subgroup yields $2$, then the subgroup is normal (I've heard this called the index two theorem).
So: If we start with a nonabelian group, then it makes sense to try the smallest one, i.e., $S_3$ with its $6$ elements. For it to serve as a counterexample, you want it to have prime order to satisfy the constraints in your query - so we should pick a subgroup of size $2$ or $3$ - and we want it not to be normal - so we should avoid picking a subgroup of size $3$ in this case, since $6/3 = 2$ would make the subgroup normal by the above-mentioned index two theorem.
All this would lead one to pick exactly one of the two element subgroups of $S_3$, which is precisely the counterexample given in an earlier answer! Still, hopefully this write-up gives some insight into how you can broach your next conjecture.

A: This is not true. Consider a subgroup $H$ generated by a $2$-cycle $(12)$ in a symmetric group $S_3.$ Then
$$H \cdot (13)=\{(12), \text{id} \} \cdot (13) =\{(132), (13)\},$$
$$(13) \cdot H=(13) \cdot \{(12), \text{id} \}= \{(123), (13)\}.$$
Thus,
$$ H \cdot (13) \neq (13) \cdot H,$$
implying that $H$ is not normal in $S_3.$

A: $H$ is not necessarily normal. Let $G = S_3$ and $H = \langle (1 \ 2) \rangle$. Then $|H| = 2$ but $H$ is not normal. For instance:
$$(1 \ 2 \ 3)(1 \ 2)(1 \ 2 \ 3)^{-1} = (1 \ 2 \ 3)(1 \ 2)(2 \ 1 \ 3) = (2 \ 3) \notin H.$$

A deeper investigation: Suppose $|G| = pm$ where $p$ is prime and does not divide $m$.
$G$ will necessarily have at least one subgroup $H$ of order $p$. In this case, $H$ will be normal if and only if $H$ is the only subgroup of order $p$. These observations follow from the Sylow Theorems.
When $G = S_3$: We can use this observation to say that since there are $3$ subgroups of order $2$, none of them are normal.


text:
Q: Scala efficiently convert Seq[A] to frequency map Map[A, Int] I implemented four correct versions of this function. I'd like a semi-idiomatic Scala version that runs faster and more in line with the Java-like implementations.
groupByAndCount: Cleanest and most elegant. Unfortunately, it's slow.
foldImmutable: Fully internally immutable. Runs even slower.
iterateToMutable: Simple mutable version. Still slow.
iterateToJavaMutable: Uses a Java (mutable) HashMap which offers a compute function so the code can avoid separate get/set functions for each element iteration.
fixedTypeLongCustomMap: This is using a custom non-generics collection it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap and runs the fastest.
Here are some jmh benchmarks:
Benchmark                                     Mode  Cnt  Score   Error  Units
FreqMapGenerationJava.fixedTypeLongCustomMap  avgt    5  0.255 ± 0.061   s/op
FreqMapGenerationJava.foldImmutable           avgt    5  3.728 ± 0.318   s/op
FreqMapGenerationJava.groupByAndCount         avgt    5  1.315 ± 0.405   s/op
FreqMapGenerationJava.iterateToJavaMutable    avgt    5  0.654 ± 0.080   s/op
FreqMapGenerationJava.iterateToMutable        avgt    5  1.356 ± 0.240   s/op

Here is full Scala code:
  def foldImmutable[A](l: Seq[A]): immutable.Map[A, Int] = {
    def foldF(m: immutable.Map[A, Int], a: A): immutable.Map[A, Int] = {
      m + (a -> (m.getOrElse(a, 0) + 1))
    }

    l.foldLeft(immutable.Map[A, Int]())(foldF)
  }

  def groupByAndCount[A](l: Seq[A]): immutable.Map[A, Int] =
    l.groupBy(x => x).mapValues(l => l.size)

  def iterateToMutable[A](l: Seq[A]): mutable.Map[A, Int] = {
    val m = mutable.Map[A, Int]()
    for (a <- l) {
      m(a) = m.getOrElse(a, 0) + 1
    }
    m
  }

  def iterateToJavaMutable[A](l: Seq[A]): java.util.Map[A, Int] = {
    val m = new java.util.HashMap[A, Int]()
    for (a <- l) {
      m.compute(a, (k, v) => if (v == null) 1 else v + 1)
    }
    m
  }

  def fixedTypeLongCustomMap(l: Seq[Long]): Long2IntOpenHashMap = {
    val m = new Long2IntOpenHashMap
    for (a <- l) {
      m.addTo(a, 1)
    }
    m
  }

A: Check this:
def foldImmutableAggregate[A](l: Seq[A]) : Map[A, Int] = {
  l.aggregate(Map[A, Int]())({ (sum, ch) => sum ++ Map(ch -> (sum.getOrElse(ch, 0) + 1)) }, (a, b) => a ++ b)
}

or
def foldImmutableAggregate[A](l: Seq[A]) : Map[A, Int] = {
  l.par.aggregate(Map[A, Int]())({ (sum, ch) => sum ++ Map(ch -> (sum.getOrElse(ch, 0) + 1)) }, (a, b) => a ++ b)
}

to process the Seq in chunks

A: Have you tried Scala standard library groupBy on both mutable and immutable collections
on Immuable Seq
scala> Seq(1, 2, 2, 2, 1, 1, 1, 4, 4).groupBy(identity).mapValues(_.size)
res16: scala.collection.immutable.Map[Int,Int] = Map(2 -> 3, 4 -> 2, 1 -> 4)

on mutable ListBuffer
scala> ListBuffer(1, 2, 1, 2).groupBy(identity).mapValues(_.size)
res17: scala.collection.immutable.Map[Int,Int] = Map(2 -> 2, 1 -> 2)


text:
Q: Error of transaction stuck in previous delete (I think at least) I'm having a problem which happens when i try to delete a few registers from the database.
The problem is when one of those people that I'm trying to delete have an bill registered or another thing that I can't delete. Occurs error on 'SaveChenges()' because people have reference on another table, and will catch my exception and supposedly try to delete the next 'people', BUT in this next people occurs the same error, and in the 'Exception.InnerException' that shows me, there is the same Id of my previous 'people', and in this way my register are never deleted, unless no one of those peoples that I'm trying to delete occurs an error, or I'm trying to delete one by one for another route ("which uses the same 'DeletePeople(People people)'")
public IActionResult DeletePeople(long[] ids){
    var peoples = _peopleRepository.GetPeoples(ids);

    var nonDeleted = 0;

    foreach (var people in peoples){
        var deleted = DeletePeople(people);

        if(!deleted)
           nonDeleted++;
    }

     return Json(new { nonDeleted, total = peoples.Count() });
}

public bool DeletePeople(People people){
   var transaction = _peopleRepository.BeginTransaction();

   try{
       _contactsPeopleRepository.RemoveRange(people.Contacts);

       _contactRepository.RemoveRange(people.Contacts.Select(x => x.Contact))

       if(people.Client != null)
           _clientRepository.Remove(people.Client);

       //
       Remove a few other things witch have reference with 'people' at the same way
       //

       _peopleRepository.Remove(people)
       _peopleRepository.SaveChanges();

       transaction.Commit();

       return true;
   }
   catch{
       transaction.Rollback();

       return false;
   }
}

Below is my 'GetPeoples' on the repository.
public IEnumerable<People> GetPeoples(long[] ids){
    return GetAll()
        .Include(x => x.Client)
        //Here there are a few more includes that I try to remove
        .Where(x => ids.Contains(x.Id))
}

(My English is not very good, but I tried my best to describe my problem)
I tried to use asynchronous methods, and get the peoples from my database one by one inside my method 'DeletePeople(People people)', which in this case use to receive just and 'id', but nothing seems to work. And also, I tried to research if someone else already have this problem and found nothing :(

A: The issue will be most likely due to a "poisoned" DbContext in your Repository. If a DB operation fails then the DbContext change tracking needs to be flushed. The DbContext behind your repositories change tracking remembers everything you do, regardless of whether a transaction was rolled back or not. Normally the quick & dirty fix would involve Disposing the DbContext and re-creating it. However when you have several repositories with the same reference managed by an IoC container that's not the most straight forward.
See: DbContext discard changes without disposing
I recommend cheching out Gary Pendlebury's updated solution down near the end.
For other references, you should be checking to see whether a Person can be deleted or not based on usage before attempting to delete, no just kicking off a delete and hoping for no exception. Exception handling should be the exception, not a normal program flow.
So for instance, before deleting a Person:
if (!PersonRepository.PersonIsInUse(personId))
    PersonRepository.Delete(personId);
else
    // TODO: Log/present a suitable message.

Where PersonInUse does a .Any() check against any and all entities that reference the Person record.
This is typically a driver to consider soft-delete systems where instead of Deleting important records like People which will be potentially referenced and needed for historical sake, you use a flag on each record for something like IsActive. To remove a Person so they will not show up in further query results etc. you would set IsActive = False and all queries would be written to ignore IsActive. (EF can also support global filters like this as well) This way you don't risk invalid relationships when you try to remove a record.
For parent-child "owned" relationships like People & Contacts should be set up in the database to perform a cascade delete rather than coding explicit deletes for related entities.


text:
Q: Create an interface for heterogeneous sources I'm studying patterns writing my own examples. But sometimes I got stuck...
I have four stores:
Store1: meat, ice cream and toilet paper.
Store2: ice cream.
Store3: meat.
Store4: ice cream, pasta, vegetables.
Sometimes I want meat from all stores.
Sometimes only ice cream from all stores.
Sometimes only ice cream from a single store.
How should I design an interface for those classes considering not every method would be implemented in every class? I mean, there's no get_ice_cream for the Store2 since there's no meat in the Store2.
Interface segregation could lead to an "interface explosion".
In other hand... people says that multiple inheritance is a bad decision in almost of cases.
I'm stuck trying to deal with that problem.
It would be very nice to have an way to add new Stores and make my IceCream concrete class be able to get all the ice cream from a list of Store objects simply executing the same get_ice_cream method.
Thanks for any help?

A: Create a store factory that gives you each type of store.
Those stores should inherit from a generalStore abstract class that defines all those methods and return a productNotFoundException or whatever :)
In each store override what actually exists and when asking for a product, use a try/catch.
You could also have all products inherit from a general product that returns a product that has all getters return null before overriding.


text:
Q: Why is the default size of nvarchar is 255 (MSSQL Server)? Why is the default size of nvarchar is 255 (MSSQL Server)?
I mean why not 256?
And should I use nvarchar(63) instead of nvarchar(64) and so on ... 127 instead 128?
I tried to Google this question and I didn't find any comprehensive answer.

Edited:
About default size: It is just my assumption. Hibernate and EclipseLink (java persistence frameworks) convert String to nvarchar(255) so I thought this is so kind of standard.

A: The documentation is quite clear:

When n is not specified in a data definition or variable declaration
  statement, the default length is 1. When n is not specified when using
  the CAST and CONVERT functions, the default length is 30.

ALWAYS use a length specification for these variables.
As for your second question.  The types varchar and nvarchar encode the length of the value for each value.  I am not sure if SQL Server uses 1 byte for lengths up to 255 and then 2 bytes for lengths up to 4000/8000.  The max does use 4-bytes.  (And all of them can now spill over to additional pages.) In general, for variable character strings, you should use a value that is amply large for whatever you want to include, so you don't have to change the length using alter table.  Only the necessary storage for a particular value is used, so a slightly longer declaration does not affect performance.
Note that for char and nchar, you want the shortest possible length because the column will actually occupy that storage space.


text:
Q: OpenOCD read_bank command asks for more arguments We are trying to read out portions of our STM32F0x microcontrollers with OpenOCD, which we also use to program them. However, the flash read_bank command doesn't work as documented. Whatever we input, the error is:
flash read_bank 0 test.bin: command requires more arguments

We invoke it for example by:
sudo openocd -f interface/stlink-v2.cfg -f target/stm32f0x_stlink.cfg -c "init" -c "reset init" -c "flash read_bank 0 test.bin" -c "exit"

Other flash operations work as expected, such as:
openocd -f interface/stlink-v2.cfg -f target/stm32f0x_stlink.cfg -c init -c "flash info 0" -c exit

or
openocd -f interface/stlink-v2.cfg -f target/stm32f0x_stlink.cfg -c init -c "flash banks" -c exit

The command flash read_bank seems to be very rarely used. This is at least, was my google search said. Does anybody have an idea on how to use this command?

A: The flash read_bank comannd requires 2 more arguments: Offset and length.
So on a STM32 MCU I you could use
flash read_bank 0 test.bin 0x8000000 0x4000
to read the first 16KB of the flash memory.
Remember there is a "help" command in OpenOCD, too.


text:
Q: Vscode Shortcut for run script on terminal? There is a way that allows me that when I am editing a js file I can through a shortcut: open the terminal and run it automatically:
1- Open terminal
2- node my-file.js
Right now it only manages to open terminal with shortcut "ctrl + ´" but then I have to type "node my-file.js"

A: There is easy way to run JavaScript, no configuration needed:

*

*Install the Code Runner Extension

*Open the JavaScript code file in vscode, then use shortcut Control+Alt+N (or ⌃ Control+ Option+N on macOS), or press F1 and then select/type Run Code, the code will run and the output will be shown in the Output Window.


text:
Q: CSS: Menu elements positioning
The picture above is the result of my html:

...

...

...

...

...

            Item 5

Link 1

Link 2

Link 3

Link 4

...

...

...

Link 1, 2 etc are menu elements, in this case of menu "Item 5". To make them be aligned vertically, the width of their
s is set to 100%. But because of that, all menu elements cover the whole space, beginning at the left edge. I need them to start under in this case "Item 5", or whatever menu the mouse is hovering over now.
Could you please help?
Thanks.
CSS:
#navi ul {
list-style: none;
margin: 0 0 0 58px; }

#navi li {
float: left;
padding: 5px 6px 5px 10px;
height: 33px;
font-size: 20px;
background-position: right 18px;
background-repeat: no-repeat;
overflow: hidden; /* if text-resize, this'll keep the nav the same size */}

#navi li:last-child {
background-image: none;
}

#navi li a {
display: block;
line-height: 24px;
overflow: hidden;
color: #002665;}

#navi li:hover {
background:black;
}

#navi li ul {
display:none;
}

#navi li:hover ul {
display:block;
position:absolute;
top:100%;
left:0px;
width:100%;
color:white;
}
#navi li ul li {
position:relative;
width:100%;
padding:15px 0px;
background:black;
text-indent:10px;
font-size: 14px;
font-family: "helveticaregular","HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
z-index: 1;
}

#navi li ul li img:hover,#navi li ul a:hover li img{
border-bottom:1px white solid;
margin-bottom:-1px;
}
#navi li ul li:hover {
background:black;
text-decoration:underline;
}
#navi ul li a{
color:#F5F5F5;
background-color: transparent;
font-size: 20px;
font-family: "Arial Narrow", Helvetica, "helveticaregular","HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "Lucida Grande", sans-serif;
}

A: It appears you want to make a drop down menu?
What you need to do is set the second level ul position to absolute.
ul li ul {
     position: absolute;
}

The parent container will need its position set to relative

A: Could you make the upper level div like so? That might help.

Item mark up here.


text:
Q: Problems with secondary hdd in grub I had some problems installing Linux mint and or any other Linux distribution in combination with Windows. When I booted my machine it would hang before the grub bootloader showed up. Now i have some free time I decided to give it another shot and even ended up having a successful dualboot with arch Linux and Windows 8.1.
I accomplished this result by removing my secondary hdd from my laptop and install both operating systems on my msata ssd. However when I insert this hdd again I am getting the same issue as explained above "hangs on welcome to grub".
So I pretty much narrowed down the issue to  the fact that inserting my second hdd breaks my bootloader (removing the hdd solves the issue).  But I am still not sure what causes my second hdd to break grub.
I completely formatted the hdd on another Windows 8.1 machine using the disk utility provided by Windows 8.1. Yet this did not solve my issue either.
I've had a dual boot with Ubuntu 12.04 &  Windows 8.1 running just fine like half a year ago on the same configuration. Also when I use the default Windows 8.1 bootloader it works just fine (for Windows only obviously).
I also tried installing Ubuntu 14.04 but the same issue here.
Does anyone know how to solve this issue. Could it be that Ubuntu 12.04 was using another version of grub?
Update 1
Output of sudo parted /dev/sdb print (tested in try ubuntu)
Number  Start   End    Size   Type     File system  Flags
1      1049kB  215GB  215GB  primary  ntfs
2      215GB   500GB  285GB  primary  ntfs
Update 2
I completely wiped the disk and used sudo shred -v /dev/sdb to make sure nothing on that disk could interfere with the booting of grub. I also tried another disk I had lying around but same issue here.
Update 3
So yeah, after running out of options with GRUB I tried installing Lilo as my last resort. IT WORKS! It might be a little slow but it is booting my system just fine :D

A: So I ended up installing LILO as bootloader which works just fine. It kinda confirms the theory that there might be something wrong with the newer versions of GRUB.
Here are the install instructions:
First remove GRUB bootloader:
sudo pacman -Rsn grub

For installing packages that are not listed in the arch repo by default we need development tools:
sudo pacman -S base-devel

Now download the tarbal from here and extract it using:
tar -xf lilo.tar.gz

Now cd into the newly created directory and install LILO using:
sudo makepkg -sci

Edit the lilo configuration file so everything points to the correct disk and partitions (check partitions with sudo fdisk -l.
Also check this for reference.
sudo nano /etc/lilo.conf

Finally install LILO to your disk using:
sudo lilo

Remember to run the last command after every kernel update!
This might not be the actual answer to my question but atleast it solves the problem I was trying to deal with. I think I might help other people with this and therefore I am marking this as answer. Please feel free to post more possible solutions. If I have some free time I will try them.


text:
Q: Can not change output for multiplot mode, GNUPLOT? I am trying to plot multiple output files in gnuplot using "do for sprintf". My code is
reset
#set encoding utf8
set encoding iso_8859_1
set terminal postscript eps enhanced color font 'Times-Bold' 25

do for [t=1:4] {

#set output 'LeftChiral_DOS.png'
set output sprintf('Trial-Ru%d-d-up.eps',t)

set size  1.0, 0.94

datafile1 = sprintf('Ru%d-up.dat',t)
datafile2 = sprintf('Ru%d-down.dat',t)

set multiplot layout 1,2

set style data linespoints
#
set origin 0.2, 0

set  noxzeroaxis
set tics out
set border linewidth 2.
set style line 1 lc rgb "red" lt 1 lw 1.5 pt 7
set style line 2 lc rgb "blue" lt 1 lw 2.0
set style line 3 lc rgb "green" lt 1 lw 2.0
set style line 4 lc rgb "black" lt 2 lw 1.5 dt 2
#
set key
set key vertical at 0.9,1.6
set key font ",20"
set noxtics
set ylabel "Energy (eV)"
set xtics ( " {/Symbol G} " 0, " Y " 0.09049, " C " 0.14273, " Z "   0.23322," D " 0.27012, " E " 0.36061," A " 0.41285, " B " 0.50334, " {/Symbol G} " 0.54024)

set origin 0.1,0

set yrange[   -8.0:   4.0]
set xrange[   0.000:    0.54024 ]
 unset key
 weight=15

 plot datafile1 u ($1):2:($3*weight) every 3 w points lw 2 lc rgb "#FF0000" pt 6

 plot datafile2 u ($1):2:($3*weight) every 3 w points lw 2 lc rgb "#FF0000" pt 6
 }

As you can see I used do for and sprintf to output multiple files for each value of t variable.
But gnuplot giving me error "Cannot change output for multiplot mode"
Can anyone please help me to solve this issue.
Thanks

A: So I was wrong in my comment. You just need to unset multiplot before setting again the output. So here a minimal example to make your error again (using minimal example is important when you post on stackoverflow)
#!/usr/bin/gnuplot
set term pdf
do for [t=1:4] {

  set output "test_".t.".pdf"
  set multiplot

  f(x)=x*t
  g(x)=-x*t
  set xrange [0:100]
  plot g(x)
  plot f(x)
}

By adding unset multiplot at the end, you will create you four multiplot files without errors:
#!/usr/bin/gnuplot
set term pdf
do for [t=1:4] {

  set output "test_".t.".pdf"
  set multiplot

  f(x)=x*t
  g(x)=-x*t
  set xrange [0:100]
  plot g(x)
  plot f(x)
  unset multiplot
}

I suppose that's because as said by the manual:

The command set multiplot places gnuplot in the multiplot mode, in
  which several plots are placed on the same page, window, or screen.

it makes no sense to put plots in different files while putting them in the same file.


text:
Q: How do you create a 'remote' branch locally: within ~/Library? I want to create a 'remote' branch at:

$~/Library/Application Support/GIT Repository

...from which I can push/pull from another local 'work directory'.

I believe I should use the following:

git remote add ...

But I need to generate a *.git target file.  I'm not sure of the correct syntax.

Revision

1) First I go to the destination ('remote') directory to create a .git repository:

$~/Library/Application Support/GIT Repository:git init

Initialized empty Git repository in /Users/Ric/Library/Application
  Support/GIT Repository/.git

2) Return to source (workarea).  In this example, using 'burp' project:

$~/workarea/burp:ls
burp/       burp.xcodeproj/
$~/workarea/burp:

3) Attempt to create a remote directory:

$~/workarea/burp:git add myRemoteBurp ~/Library/Application\ Support/GIT\ Repository/.git

Got a fatal error:

fatal: /Users/Ric/Library/Application Support/GIT Repository/.git:
  '/Users/Ric/Library/Application Support/GIT Repository/.git' is
  outside repository

Checking for remote-repository infrastructure:
$~/workarea/burp:ls "/Users/Ric/Library/Application Support/GIT Repository/.git"
HEAD        branches/   config      description hooks/      info/       objects/    refs/

...I'm lost here.

A: from the other "work directory" you can do:
git remote add lib_repo ~/Library/Application\ Support/GIT\ Repository/.git

and then you will be able to:
git push lib_repo master

or
git pull lib_repo master

obviously it works as well the other way around.

Ok, you say you're not confused about git remote add and git add, but you actually are, or you wouldn't have any issues.
Your error:

fatal: /Users/Ric/Library/Application Support/GIT Repository/.git: '/Users/Ric/Library/Application Support/GIT Repository/.git' is outside repository

is only caused because when you're doing:
git add myRemoteBurp ~/Library/Application\ Support/GIT\ Repository/.git

what you're asking git to do is to add the files myRemoteBurp and ~/Library/Application\ Support/GIT\ Repository/.git within the current repository's index. This is the step to do before doing a commit in your normal git flow:
echo "Hello World" > README.md
git add README.md
git ci -m "added README file placeholder"
git push origin master

And thus, the error git is giving you is perfectly legitimate, as git cannot add files from outside the workspace's path within the repository's index.
What I told you to do is something different, it's about remotes. A remote is just another repository your current repository can push to/pull from.
A remote can be hosted at github, bitbucket or gitlab, but it can also be hosted on a server you can SSH to, or within another directory on your computer. And that last case seems to be what you were asking for.
So let's start over and follow my directions:
% cd "/Users/Ric/Library/Application Support/GIT Repository"
% git init
% cd ~/workarea/burp
% git add remote other "/Users/Ric/Library/Application Support/GIT Repository/.git"
% git push other master

What have I done here? Within the ~/workarea/burp repository I've added a new remote called other (and you can choose whatever name you want, the usage being that origin is the central repository where you share your work with your colleagues when that applies).
If you look in the configuration file of ~/workarea/burp you'll see the new remote added:
% cat ~/workarea/burp/.git/config
…
[remote "other"]
    url = /Users/Ric/Library/Application Support/GIT Repository/.git
    fetch = +refs/heads/*:refs/remotes/other/*

I hope this time around I'll have done a better job at explaining all that to you ☺
HTH


text:
Q: looking to make a group inside of a member page Looking for an structure of how to build a group inside pool of a members.
memeber are going to be group by interests fields rows. The memeber who has the same insterets fields value and nickname value will belong to certain group, they can join, be invited. also any member will have the power of forming or creating a group. how would be the database structure for that? so far I have a member tables to start with.

A: Make a group table . Make a Member table  and
have Group-id as an foreign key into the Member table
that way you can list the number of members in a single group.
Have the nick name and value fields in the group and the power to make a group
all these seems to be flags now it depends you can have
member rights table or incorporate all that in to a single table.
hope that will at least give you an idea of db structure


text:
Q: About the finished, $\aleph_0$...-compactness Definitions :

$(E,d)$ a metric space is finished-compact if any covering of $E$ by open, we can extract a finite subcover
$(E,d)$ is $\aleph_0$-compact if for any infinite covering of $E$ by open, we can extract a countable subcover

Remark :

we can imagine what's $\aleph_i$-compactness.
we known the space $(E,d)$ with $\aleph_0$-compactness is exactly the space $(E,d)$ separable.

Question :

What is we known about the $\aleph_i$-compactness for $i\in \mathbb N^*$ ?

A: I think you are asking about cardinal functions on metric spaces. First, the property you call $\aleph_0$-compact is more usually known as Lindelöf. As you say, it is well-known that for a metric space $E$, it is Lindelöf iff it is separable (iff it is second-countable iff it is c.c.c.). Of course, for topological spaces in general, no implication holds in either direction.
For metric spaces, this equivalence holds for the generalization of these properties to cardinals. A reference for this is the Handbook of Set-Theoretic Topology, edited by Kunen and Vaughan.
The density (sometimes called density character to distinguish it from other meanings of density) $d(X)$ of a topological space $X$ is the minimal cardinality of a dense subset (this exists by well-orderedness of cardinals). So "$X$ is separable" is the same as $d(X) = \aleph_0$. The Lindelöf number $L(X)$ is the smallest infinite cardinal $\kappa$ such that for each open cover there is a subcover of cardinality $\leq \kappa$. So "$X$ is Lindelöf" is the same as $L(X) = \aleph_0$. (These definitions come from pages 11-12 of the aforementioned book.)
Now, for a metric space $E$, $d(E) = L(E)$ (see Theorem 8.1 (c) on pages 32-33), which is the generalization that I think you are looking for. Unfortunately, the proof given there treats the notion of a "$\sigma$-discrete base" and its existence in any metric space as well known, so I'll provide a little more information.
In the Handbook, $\sigma$-discrete is defined in chapter 9 (on page 350) and what you need to do to get a $\sigma$-discrete base in a metric space is to take the open cover of $E$ by open balls of radius $2^{-n}$ (for each $n \in \mathbb{N}$) and take a $\sigma$-discrete refinement of it using Theorem 2.8 of Chapter 9 (page 357). I suppose the reason the existence of a $\sigma$-discrete base is considered standard is that it is one direction of Bing's metrization theorem, and can be found in textbooks such as Engelking's General Topology, Theorem 4.4.3.


text:
Q: Hibernate query with fetch question I have a 2 entities in a One-To-Many relationship:
OfficeView.java:
public class OfficeView implements java.io.Serializable {

    private Integer officeId;
    private String addr1;
    private String city;
    private String state;
    private String zip;
    private List<Devices> devices;

getters and setters

    @OneToMany(mappedBy = "officeView", fetch = FetchType.EAGER)
    public List<Devices> getDevices() {
        return devices;
    }

    public void setDevices(List<Devices> devices) {
        this.devices = devices;
    }

}

Devices.java:
public class Devices implements java.io.Serializable {

    private Integer devId;
    private String devName;
    private Date lastUpdate;
    private OfficeView officeView;

getters and setters

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "office_id")
    public OfficeView getOfficeView() {
        return officeView;
    }

    public void setOfficeView(OfficeView officeView) {
        this.officeView = officeView;
    }

}

For some devices, in the table there are 2 almost identical entries except for lastUpdate. I always want to retrieve the most recent entry in the table. And only that entry.
For example you have 2 entries for this device:
SSA-PITTSB-PA-NEF82   2009-10-12 23:51:07
SSA-PITTSB-PA-NEF82   2009-10-15 14:19:35
When I load the OfficeView instance for the office containing this (and other devices) I only want to fetch the most recent of these 2 devices. In the database, I can get that short list from the devices table with this SQL query:
select t.* from
  (select dev_id, dev_name, max(last_update) maxValue
from devices
  group by dev_name) x
join devices t on x.dev_name=t.dev_name
and x.maxValue=t.last_update

SSA-PITTSB-PA-NEF82     2009-10-15 14:19:35
This is a seam application and OfficeViewHome.java, from which the query is called, extends EntityHome.  I think the correct way to do this is to overload loadInstance with a customized query.
I just have no idea how to construct the query.   How do I do this?
I know how to write the join query in SQL to join the oFfice_view and devices tables and get all the correct data.  But I can't use this query to load the instance (as in createNativeQuery) because the data from the devices table needs to be loaded as a list of Devices objects.
I really hope this makes sense because I am utterly stumped.
april26

A: You'll have to override collection loader - be aware that this is a Hibernate extension to JPA standard. You can use an SQL query to do this instead of writing HQL - indeed, writing HQL may be somewhat troublesome in this scenario.
@Loader(namedQuery = "latestDevices")
@NamedNativeQuery(name="latestDevices", query="...", resultClass = Devices.class)
@OneToMany(mappedBy = "officeView", fetch = FetchType.EAGER)
public List<Devices> getDevices() {
  return devices;
}

The actual query is the one you wrote above with additional condition on office_id, whose parameter value is going to be supplied by Hibernate:
select t.* from
 (select dev_id, dev_name, max(last_update) maxValue
    from devices
   group by dev_name) x
  join devices t on x.dev_name=t.dev_name
   and x.maxValue=t.last_update
   and t.office_id = ?

If the names are not unique throughout you'll have to rewrite the above to explicitly join office on id for the inner select because you can't repeat the ? placeholder.
Be very careful with updating / deleting Devices through collection on Office, Hibernate attempts to optimize certain operations and may end up deleting devices for given Office that weren't retrieved by above select.


text:
Q: Sass css not working on ubuntu? Not listening or compiling Sass should be relatively easy to set up, which I did.
Oddly enough I set up a folder such as
cd Desktop/sass

then activate...
sass --watch style.s.css:style.css

All seems well...
>>> Sass is watching for changes. Press Ctrl-C to stop.
      write style.css
[Listen warning]:
  Listen will be polling for changes. Learn more at https://github.com/guard/listen#polling-fallback.

Run a quick test in style.s.css...save...
body{
    background-color: #fff;
}

According to tutorial, it should "detect" changes (because it's listening) and compile them, while notifying via terminal. But that does not happen.
So to jog it, I CTRL-C and run the command again...
Get an error (on valid css?)
Sass is watching for changes. Press Ctrl-C to stop.
      error style.s.css (Line 2: Invalid CSS after "#fff": expected expression (e.g. 1px, bold), was ";")
[Listen warning]:
  Listen will be polling for changes. Learn more at https://github.com/guard/listen#polling-fallback.

This is quite a mystery. It hardly seems as though it should go wrong...
What is happening here to cause it not to listen and throw silly errors?

A: Solved it.
Reason: Developer is idiot.
I had style.s.css whereas it should have been style.scss


text:
Q: How to find the the start and end of a yesterday with Noda Time? I'm trying to get the the first/last milliseconds from yesterday (which probably applies to other dates too) with Noda Time, and I think I'm close but not sure if I have done this right.
If I could convert yesterday.AtMidnight() to Ticks I could then add the number of ticks in a day  minus 1 to give me the end time. Does this make sense and is it the most correct usage of Noda Time given my requirements?
Thank you, Stephen
//Come up with the begin and end parameters in milliseconds for a Oracle query

//Assumption is that this code will run from Midnight to 4AM
//Assumption is this application code will run on servers in the Midwest USA
//Assumption is the database servers are on the West coast USA

Instant now = SystemClock.Instance.Now;
Duration duration = Duration.FromHours(24);
LocalDate yesterday = now.InUtc().Minus(duration).Date;

Console.WriteLine(yesterday.AtMidnight());

// add a day minus one tick

UPDATE
The Noda docs show that Period.Between might be useful too, so I will test that out.

A: Doesn't seem like it should be any more difficult than this:
public static void DefineYesterday( out LocalDateTime yesterdayStartOfDay , out LocalDateTime yesterdayEndOfDay )
{
  BclDateTimeZone tz         = NodaTime.TimeZones.BclDateTimeZone.ForSystemDefault() ;
  LocalDateTime   now        = SystemClock.Instance.Now.InZone(tz).LocalDateTime ;
  LocalDateTime   startOfDay = now.PlusTicks( - now.TickOfDay ) ;

  yesterdayStartOfDay = startOfDay.PlusDays(  -1 ) ;
  yesterdayEndOfDay   = startOfDay.PlusTicks( -1 ) ;

  return;
}


text:
Q: ScrollView with Constraint Layout ( White Space at Top ) I've been using ScrollView as parent and Constraint Layout as Child. The Children of Constraint layout is bound between the top and the bottom of its parent ( Let us say View 1).
When I add another TextView ( View 2 ) and bounds as 50 width and wrap_content as height.Now if I add Long text value, Both View 1 and View 2 Starts going down and If I increase the amount text and its starts going out of the screen.
Any Solution for this
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/scroller"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="true"
    android:clipToPadding="true"
    android:descendantFocusability="beforeDescendants"
    android:fillViewport="true"
    android:focusableInTouchMode="true"
    android:scrollbars="vertical"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    tools:context=".MainActivity">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:id="@+id/line1"
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:text="Hello Wosaddsadasrld!"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/line2"
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:text="Hello Wosaddsadajhsf
            iabdjkjasbdjsjabdsajbjahsbdjabshjdsajbs
            ajbjhbdsjabshbdbhjbasjhbhadjbjhabsjadbjdbs
            ajbdbashbbasdbhdbashjbjkvdsbkjvdbsjkbdsvsrld!"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/line1" />

        <TextView
            android:id="@+id/line3"
            android:layout_width="50dp"
            android:layout_height="0dp"
            android:gravity="center"
            android:text="Bagadehs"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/line2" />

        <TextView
            android:id="@+id/line4"
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="sdfdsf"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/line3" />

        <TextView
            android:id="@+id/line5"
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="rtte"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/line4" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>

Kindly see the Scroll bars
enter image description here


text:
Q: Conversion of RDD to Dataframe I read a csv file to RDD and trying to convert it to DataFrame. But, it throughs error.
scala> rows.toDF()
<console>:34: error: value toDF is not a member of org.apache.spark.rdd.RDD[Array[String]]
              rows.toDF()

scala> rows.take(2)
    Array[Array[String]] = Array(Array(1, 0, 3, "Braund, ...

What am I doing wrong?

A: When you want to convert an RDD to a DataFrame, you'll need to create an SQLContext and import it's implicit functions like @zero323 suggested.
import sqlContext.implicits._
rows.toDF

In case your RDD is a RDD[Row] , the following will be needed
import org.apache.spark.sql.Row
rows.map(Row.fromSeq(_)).toDF


text:
Q: serialize variable merge? I want to add data of ExtrasGroupID variable into options serialize variable (or what is other way), how can that be done?
Example below:
var ExtrasGroupID = $("#SelectExtrasGroup option:selected").val();
var options = $("#FormExtrasOptionsList").serialize();

$.post("ajax.php", options,
  function(data)  {
        console.log(data)
  });

A: Try this:
var ExtrasGroupID = $("#SelectExtrasGroup option:selected").val();
var options = $("#FormExtrasOptionsList").serialize();

// make sure you set an appropriate key for the new value
options = options + '&' + $.param({ 'select-extras-group': ExtrasGroupID });

...

Edit: More info on $.param: http://api.jquery.com/jQuery.param/

A: You could also do a one liner:
var ExtrasGroupID = $("#SelectExtrasGroup option:selected").val();
var options = $("#FormExtrasOptionsList").serialize();

$.post("ajax.php", (options = options.split('&')).concat(['extras_group_id='+ExtrasGroupID]).join('&'),
    function(data)  {
        console.log(data)
});

A: You can use .add:
var options = $("#FormExtrasOptionsList").add(ExtraGroupId).serialize();


text:
Q: Sorting PLOTLY bar for ascending or descending I'm trying to sort a within-group of my horizontal-graphic, so I can check for each category (y axis) the descending order for each one.
I'll example in figures, as shown:
Figure 1: the graphic in the basic format
None modification made so far in Category's Order
Figure 2: the graphic after commanding update_yaxes = 'total descending'
We can see that Plotly has ordered according to total sum of each category 'Produt Line'
Figure 3: the graphic after commanding DataFrame sort_values for each city
We can now see that Plotly has maintened order of Figure 2, but now it also ordered for City's total sum
What I really intend to is to have an specific order for each category, showing the ascending for each one of them, desconsidering total sum of cities, for example.
Does anyone can help?
I thank you in advance for attention.


text:
Q: Toggling between two radio buttons I have read multiple stackoverflow posts but none have seemed to help me understand where my error is. I am trying to have two radio buttons that by default the long form is checked and the short form is not checked, but if the short form is checked the the long form is not checked. If one were to also un-check the short form then the long form should defaultly be checked off.
<input type="radio" id="shortForm" onChange="toggle(this);"> Short Form
<input type="radio" id="longForm" onChange="toggle(this);"> Long Form

function toggle(chkBox)
{
    if (chkBox.checked)
    {
        var previousCheckId;

        if (previousCheckId)
        {
            document.getElementById(previousCheckId).checked = false;
        }
        previousCheckId = chkBox.getAttribute('id');
    }
}

http://jsfiddle.net/na8qL/
I am trying to avoid using jquery and just use pure javascript and html.
I got this so far but my words are not aligned properly? How can I make them alligned?
<input type="radio" id="shortForm" name="frm"style="position:absolute; top:10px; right:875px"> Short Form </input>
<input type="radio" id="longForm" name="frm" style="position:absolute; top:10px; right:475px"> Long Form </input>

A: No need of JavaScript. Give names to the elements:
<input type="radio" id="shortForm" name="frm"> Short Form
<input type="radio" id="longForm" name="frm"> Long Form

JSFiddle: http://jsfiddle.net/bjyjv/


text:
Q: How to reposition rowList dropdown in jqgrid's pager? I would like to re-position the rowList dropdown (defined as rowList:[10,20,30]) to the left side of the pager rather than the default right-hand side position. How is that achieved?
thanks.

A: I believe this is not possible with the API. If you really must do this, try something like the following:
For a pager defined like so,

Add this to your gridComplete event:
$(' #grid_pager_center tr').prepend(  $(' #grid_pager_center td:last') );


text:
Q: RewriteRule causes 500 error Here is my rule:
RewriteRule ^forward/?$ forward.php?url=$1 - [NC,L]

This is what I would like:
Browser URL: http://mydomain.com/forward/http://anydomainhere.com
Rewritten to: http://mydomain.com/forward.php?url=http://anydomainhere.com
This will be the last rule evaluated if a match is made. Right now it gives me a 500 error and I can't figure out why.

A: Remove hyphen from your rewrite rule and it should work:
RewriteRule ^forward(/.*)?$ forward.php?url=$1   [NC,L]

A: An error 500 usually means that the server configuration is wrong, in your case the rewrite rules. You can usually look up details in Apache's error logs about what exactly is happening. In your case, it seems that your rewrite rule is syntactically wrong.
This works for me:
RewriteRule ^forward/(.*)$ forward.php?url=$1 [NC,L]

A: You cannot use RewriteRule to capture a URL with // since that is stripped down to a single / by Apache. Use ReeriteCond with %{THE_REQUEST} variable instead:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+forward/([^?\s]+) [NC]
RewriteRule ^ forward.php?url=%1 [L,NE,QSA]


text:
Q: How to separate each value for each textbox It seems that when I try to retrieve a data for a certain id it populates it's data to all textbox present.
Here is my addrow script that adds a new row of textboxes:
function addRow(tableID) {

        var table = document.getElementById(tableID);

        var rowCount = table.rows.length;
        var row = table.insertRow(rowCount);

        var colCount = table.rows[1].cells.length;

        for(var i=0; i<colCount; i++) {

            var newcell = row.insertCell(i);

            newcell.innerHTML = table.rows[1].cells[i].innerHTML;

        }
    }

Here is my html file
 <input type="text" name="personId" class="personId" size="30" onchange="test()"/>
 <input type="text" name="personName" class="personName" size="30" disabled/>

Here is the test script which appends that data to the textbox:
 function test(){

var $cell = $('.personId');
var cellData = $cell.html();
$cell.data('value', cellData);

//Code here to pass the personId in to an ajax and return it's corresponding personName

 success:   function(data) {

    $('.personName').val(data.person);

 }
}

What happens is that when I have 3 rows of personId and personName and I enter one personId all the textboxes in the 3 rows returns the personName. The goal is that when I enter an personId in one row pesonName should only reflect on the textbox i'm currently entering the personId. Please help. Thank you so much.

A: Follow the comments for understanding code.

var personVal =1; //personVal to create dynamic id

$(document).on('keyup','.personId', function() {
   var personId = $(this).val();

   //Code here to pass the personId to an ajax and return it's corresponding personName
   //ajax success code here
   //and success code like
   // success: function(data) {
       var currentPersonVal=this.id.split('-')[1];
       var personName="#personName-"+currentPersonVal;
       $(personName).val(currentPersonVal);//name hardcoded for your understanding, you need to add 'data.person'
   //}
});

function addRow(tableID) {
        var table = document.getElementById(tableID);
        personVal =personVal+1 //increase personVal by 1
        var rowCount = table.rows.length;
        var row = table.insertRow(rowCount);
        var colCount = table.rows[0].cells.length;
        //generate textbox here with dynamic id by adding personVal at the end of id and '-'(dash) is used to split id later
        var newcell = row.insertCell(0);
        newcell.innerHTML = "<input type='text' id='personId-"+personVal+"' class='personId' size='30' />";
        var newcell = row.insertCell(1);
        newcell.innerHTML = "<input type='text' id='personName-"+personVal+"' class='personName' size='30' disabled/>";

    }

    <input type="text" id="personId-1" class="personId" size="30" />
    <input type="text" id="personName-1" class="personName" size="30" disabled/>

<input type="button" value="Add Row" onclick="addRow('table1Id');"/>

Let me know if you don't understand anything.

A: You can give personId by data attribute like :
<input type="text" name="personId" data-personId = "1" class="personId" size="30" onchange="test()"/>

And then after that you can get that personId in like :
$('.personId').attr('data-personId');

A: In your html file change test() to test(this):
  <input type="text" name="personId" data-personId = "1" class="personId" size="30" onchange="test()"/>

& change your test function to this :
       function test(e){

           // remove this
           // var $cell = $('.personId');
            var cellData = $(e).html();
            $(e).data('value', cellData);

            //Code here to pass the personId in to an ajax and return it's corresponding personName

            success:   function(data) {

              $(e).closest('.personName').val(data.person);

     }
    }


text:
Q: Avoid react-native navigator scene overlapping I have a ScrollView with a list of items. When I click on one item I navigate to a new scene (slide in from the right). However, during the transition period the two scenes overlap; they are fine after the animation/transition is done.
Here's an example:

and heres the related code:
render() {
    return (
      <Navigator
       initialRoute={routes.frontpage()}
       renderScene={(route, navigator) => {
        if(route.index === 1) {
          return (
            <TouchableHighlight
              onPress={() => navigator.pop()}>
            <View style={{flex: 1}}>
              <Text style={styles.header}> other </Text>
              <Text> {route.post.title} </Text>
            </View>
            </TouchableHighlight>
          )
        }
         return (
          <View style={{flex: 1}}>
            <Text style={styles.header}> Frontpage </Text>
            <ScrollView>
              {
                this.props.posts.map(post => (
                  <TouchableHighlight
                    key={post.created}
                    onPress={() => {
                      if (route.index === 0) {
                        return navigator.push(routes.post(post))
                      }

                      navigator.pop();
                    }}>
                    <View>
                      <PostSummary
                        title={post.title}
                        upvotes={post.ups}
                        author={post.author}
                        subreddit={post.subreddit}
                        created={post.created_utc}
                      />
                    </View>
                  </TouchableHighlight>
                ))
              }
            </ScrollView>
          </View>
         )
       }}
     />
    )
  }

Any ideas on how to solve this?

A: Navigator uses animations during transitions between two scenes. In your case it uses fade during the transition. How about using a different animation. Navigator has Scene Transitions feature that you may try to change the animation.


text:
Q: Facing issue after implementing Sharing Test Context between Cucumber Step Definitions using PicoContainer I have implemented a shared Test Context between Cucumber Step Definitions using PicoContainer.
Please find the complete code which I have written in the below shared drive.
https://drive.google.com/file/d/1bBxOJDW7auqN_CX9tc0KEDo-TiPzew6m/view?usp=sharing
Before implementing PicoContainer i have only one Step definition class after implementing it I created two separate step def classes for Home Page and Login Page.
Please find the below feature which i am automating. After i implemented share Test Context only first scenario is running successfully,  while running Second scenario New browser is opening then failing it with NullPointerException.
Feature: Login Action

 Scenario Outline: Successful Login with Valid Credentials
    Given User is on Home Page
    When User Navigate to LogIn Page
    And User enters "<username>" and "<password>"
    Then Message displayed Login Successfully
    Examples:
    | username   | password |
    | username@gmail.com | userpassword |

Scenario: Successful LogOut
    When User LogOut from the Application
    Then Message displayed LogOut Successfully

Please help me to fix this issue..


text:
Q: Why the image gets pixelated when using the transform property I want to make a rotating animation for the search icon, that when the input gets focused, then the icon rotates 90 degrees around the Y-axis, and then the text cursor appears, so it's like the search icon being transformed into the text cursor (try it with the code snippet below), but when I apply the transform property to the icon which is a png image, it gets pixelated and it doesn't look good, Is there a way to fix this problem?
Here's the difference:

.Navbar {
    display: flex;
    padding: 50px;
    align-items: center;
    justify-content: center;
}
.Navbar .SearchBox {
    position: relative;
}
.Navbar .SearchBox input {
    background-color: darkgray;
    border-style: none;
    color: transparent;
    padding: 0px 16.5px 0px 10px;
    font-family: 'vazir';
    border-radius: 6px;
    height: 35px;
    outline: none;
    width: 300px;
    direction: rtl;
}
.Navbar .SearchBox img {
    height: 17px;
    position: absolute;
    top: 9px;
    right: 8px;
    transform: rotateY(0deg);
    transition: transform .3s ease-out;
}
.Navbar .SearchBox input:focus {
    color: white;
    transition: color 0s ease .3s;
}
.Navbar .SearchBox input:focus + img {
    transform: rotateY(90deg);
    transition: transform .3s ease-out;
}
<!DOCTYPE html>

    <meta charset="UTF-8">
    <link rel="stylesheet" href="style.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

            <input type="text">

A: This happens because when you define a transformation on the element it will create a new stacking context which will make the element have its own path in the renderer. Chrome apparently applies a different antialiasing algorithm for such elements in their own stacking context.
To workaround that, you can simply omit that rule and let the transition start from initial:

body{ background: #333 }
img { height: 17px; }
.transform {
  transition: transform .3s ease-out;
}
:hover>.transform {
  transform: rotateY(90deg);
}


text:
Q: Compering number to a current month in MS Access I have a data table that looks like this:

Id
Month
Number

e1
9
2

e2
10
3

e3
10
1

e4
9
3

The month column is an integer. I want to get a sum of number both for October and September, but by using a reference to a current month and last month, as if the data is going to change in time.
I've tried using  MONTH(DATE()):
SELECT Sum(dt.Number)
FROM dt
WHERE dt.Month = MONTH(DATE());

as well as
WHERE CInt(dt.Month) = CInt(MONTH(DATE()));

But it didn't work (it's not error, it just don't return anything).
I will be greatful for any ideas.

A: Try this:
SELECT Sum(dt.Number) AS SumOfNumber
FROM dt
HAVING (((dt.Month)=Month(Date())));

A: You can use In the current month or the previous month:
Select
    Sum([Number]) As Total
From
    dt
Where
    dt.Month In (Month(Date(), (Month(Date()) + 12 - 2) Mod 12 + 1);


text:
Q: Scala: working with video I've been hard pressed to find anything in search engines. It seems that adding "video" to the search query makes the search engines think that I want to watch a video [tutorial].
How do I read, play, and potentially (though this is not presently necessary) edit video files with Scala?
What libraries are available? What general useful information can you give?

A: I'm not much aware of any video processing libraries specifically for Scala, but you can use pretty much anything that works for Java. Out of my head, I would suggest taking a look at Processing and its video library. You might then go directly to the source libraries they use, e.g. gstreamer-java.


text:
Q: Change classes of a dataframe like other dataframe I have a data frame (DataFrame1) with this classes (only I print the 4th first classes):
> str(DataFrame1)
'data.frame':   11170 obs. of  30 variables:
 $ Var1          : int  20112 20112 20112 20121 20142 20142 20142 20122 20142 20142 ...
 $ Var2          : Factor w/ 4003 levels "1042209","1042210",..: 1 2 5 6 7 8 9 10 11 12 ...
 $ Var3          : Factor w/ 6 levels "2010/11","2011/12",..: 2 2 2 3 5 5 5 3 5 5 ...
 $ Var4          : Factor w/ 2 levels "1","2": 2 2 2 1 2 2 2 2 2 2 ...

And I create a new data frame with exactly the same columns (in the same order with the same significance).
> str(DataFrame2)
'data.frame':   7 obs. of  30 variables:
 $ Var1          : Factor w/ 5 levels "20102","20132",..: 1 3 5 5 5 4 2
  ..- attr(*, "names")= chr  "b1" "b2" "b3" "b4" ...
 $ Var2          : Factor w/ 6 levels "270620","28078",..: 2 3 3 4 5 6 1
  ..- attr(*, "names")= chr  "b1" "b2" "b3" "b4" ...
 $ Var3          : Factor w/ 4 levels "2010/11","2013/14",..: 1 3 4 4 4 3 2
  ..- attr(*, "names")= chr  "b1" "b2" "b3" "b4" ...
 $ Var4          : Factor w/ 2 levels "1","2": 2 1 1 1 1 2 2
  ..- attr(*, "names")= chr  "b1" "b2" "b3" "b4" ...

I want to join this dataframes with rbind, but I recieve an error, because the classes are different. So, I've changed the classes:
class(DataFrame2[,1])<-class(DataFrame1[,1])
class(DataFrame2[,2])<-class(DataFrame1[,2])
class(DataFrame2[,3])<-class(DataFrame1[,3])
class(DataFrame2[,4])<-class(DataFrame1[,4])

But the classes still different:
> str(DataFrame2)
'data.frame':   7 obs. of  30 variables:
 $ Var1          : atomic  1 3 5 5 5 4 2
  ..- attr(*, "levels")= chr  "20102" "20132" "20141" "20142" ...
 $ Var2          : Factor w/ 6 levels "270620","28078",..: 2 3 3 4 5 6 1
 $ Var3          : Factor w/ 4 levels "2010/11","2013/14",..: 1 3 4 4 4 3 2
 $ Var4          : Factor w/ 2 levels "1","2": 2 1 1 1 1 2 2

If I do rbind I recieve the same error.
Why in the numeric and integer classes appears atomic?
What can I do for the classes of DataFrame2 be the same as in DataFrame1?

A: The problem seems to be that the first column of your second data.frame is a factor. Try converting it to an integer by using
DataFrame2$Var1 <- as.integer(as.character(DataFrame2$Var1))

Note that it is absolutly necessary to first convert to a character. This is due to the following behaviour:
a <- as.factor(200:205)
as.integer(a)
[1] 1 2 3 4 5 6

However calling as.character() first gives the desired result:
as.integer(as.character(a))
[1] 200 201 202 203 204 205


text:
Q: How to make a specific leave event for each card in Dulst? We want to make a effect that trigger a customized leaveBoard event, for example, when a card with ciid=137 leaves board, we want a leave137 event triggered.

A: Open a new card in your Rule cards, in effect build, click Code and copy & paste the code below
- effectName: cards
  ruleTrigger:
    primary: start
    player: each player
  action:
    primary: trigger on event
    event:
      primary: leavesBoard
  target:
    primary: card
    criteria:
      from: board
      player: owner
- effectName: card
  action:
    primary: each
  target:
    primary: card
    criteria:
      passing: cards
  effectComplete:
    primary: nothing
- effectName: leaveEvent
  action:
    primary: assign variable
  target:
    primary: value
    value: leave$ciid
  effectComplete:
    primary: trigger next effect
- action:
    primary: trigger event
    event:
      primary: $leaveEvent
  target:
    primary: game
  effectComplete:
    primary: nothing


text:
Q: Lagrangian Multipliers exercise Let $M = \{(x, y, z) \in {\rm I\!R}^3 : F(x,y,z) = 0\}$ and let $F(x,y,z) = (3x^2z + y^2 + z^3-1, \, x + z-1)$ .
Does the function $f(x, y, z) = x$ have any extrema in $M$?
We are asked in advance to prove that $M$ is a manifold. Thus I believe that we have to use the method of Lagrangian Multipliers to solve the exercise, but I can't seem to solve the system.
This is what I have so far:

\begin{cases} (1,0,0) = \lambda_{1}(6xz,\,2y,\,3z^2) + \lambda_{2}(1,\,0,1)
\\3x^2z + y^2 + z^3=1  \\ x+z = 1 \end{cases}


text:
Q: Collectd's curl_json plugin not sending data to graphite I've implemented curl_jason plugin to recolect and send LoadBalancer metrics to my RabbitMQ to be graphed in Graphite. Thing is, it's not sending any data, while it is working just fine (and great) with other plugins like memory, cpu, df root, network, etc. I've tried to troubleshoot following this suggestion: https://serverfault.com/questions/499378/collectd-stores-nan-instead-of-correct-value-in-ubuntu-12-04, but there're no issues coming out.
Here's my collectd.conf: https://gist.github.com/Mariano-gon/8732467
Here're the last lines of collectd.log when I start it: https://gist.github.com/Mariano-gon/8732488
The request is made against Rackspace API where my LoadBalancer is located, and if run manually, the curl gets me a json response perfectly normal.
Here's a snippet of it: https://gist.github.com/Mariano-gon/8732518
I've tried to add a new header in collectd.conf: Header "Accept: /", but didn't work.
Finally, collectd does not create any new folders besides network, df, memory, cpu, etc (all plugins that are correctly working and sending data) when started.
Hope this info helps and any comment will be really appreciated. Thanks!

A: I had same issue, but managed to solve it. Decided to add my solution, to save knowledge.
I'm running collectd on Debian Jessie with network plugin(data sent to one master server). If you have another OS update commands and paths accordingly.
Personally I had few issues. In curl_json plugin configuration I used single quotes instead of double quotes. I've found this with
journalctl -u collectd.service

Next issue was related to plugin documentation. Which I read not carefully enough. You MUST add all "type" fields you used in plugin configuration to types.db to ALL servers where data from this plugin will be used:
TypesDB "/usr/share/collectd/types.db"
TypesDB "/etc/collectd/my_types.db"

In my case, I had to add custom types.db to original server where data is collectd and master server to which data is sent for storage.
Keep in mind that you cannot mention in collectd.conf only custom types.db. You'll need both.


text:
Q: No module named pymssql when using MsSqlOperator I'm using Composer version 1.2.0-1.9.0, and I'm trying to use a MsSqlOperator in one of my DAGs. However, when published, Airflow gave me the error: No module named 'pymssql'.
Now, I could install it as a PyPi package, but shouldn't it be supported natively? Even if not, can't I include the mssql subpackage when creating an environment?

A: If you want to add additional packages which are not part of the base environment, in the Cloud Composer console, when clicking on your environments name you have a tab named PYPI PACKAGES. There you can specify the Python package and version you would like to add to your environment.
You can also do it programmatically by creating a requirements.txt file indicating the additional packages you want and pass it to your Composer environment using the gcloud commands. The needed gcloud command is the one below.
gcloud composer environments update ENVIRONMENT-NAME \
--update-pypi-packages-from-file requirements.txt \
--location LOCATION


text:
Q: Step by Step debugging with DevExtreme i'm new in devextreme development, i would like to develop an android application. Can i debug step by step, using breakpoints a devextreme application on simulator or device?
I tried Courier App on Android and it seems you can only run the app,not debug.
Also simulator on chrome doesn't stop on breakpoints.

A: I see the following ways to go:

*

*for desktop you can debug your application in DevExtreme simulator with developer tools available (e.g. DevTools for Chrome). Just open DevTools and set necessary breakpoints or put debugger; line in your code where you need to debug.

*for device use remote debugging available in Chrome. Check out how to use it https://developer.chrome.com/devtools/docs/remote-debugging


text:
Q: Comparing between Calendar's DAY_OF_WEEK constants and Enum of days of weeks I have an EnumSet<Days>, where Days is an Enum of all the days of the week, starting with Sunday at ordinal 0. I am receiving an integer from someCalendar.get(Calendar.DAY_OF_WEEK), which is a constant representing a day of the week starting with Sunday at 1, up through Saturday at 7. I need to know if the day of the week represented by that integer is in my EnumSet. Would it be reasonable to say:
private EnumSet<Days> selectedDays;
private final Days[] allDays = Days.values();

private boolean checkDayOfWeek(int day){
    return (selectedDays.contains(allDays[day - 1]));
}

The constants in Calendar are published in the API, so is it reasonable to assume they will not change? Is there a more elegant solution that I'm not seeing? Do they remain the same regardless of locality? The only other idea I've had is a series of ugly if-statements.


text:
Q: Background fetch not working - Not firing notification I'm trying to implement Background Fetch API in my app for that I've configured as below.
I've enabled Background Fetch from Capabilities.
In AppDelegate.swift
Added this in didFinishLaunchingWithOptions method
UIApplication.shared.setMinimumBackgroundFetchInterval(30)

Implemented this method too to perform task.
func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {

    debugPrint("New notification fired from AppDelegate...!!")

    let notif = UNMutableNotificationContent()
    notif.title = "New notification from App delegate"
    notif.subtitle = "Cool App!"
    notif.body = "I liked it!"

    UNUserNotificationCenter.current().requestAuthorization(options: [.sound, .badge, .alert], completionHandler: { (isGranted, error) in

        DispatchQueue.main.async {
            let notifTrigger = UNTimeIntervalNotificationTrigger(timeInterval: 0.1, repeats: false)
            let request = UNNotificationRequest(identifier: "myNotification", content:  notif, trigger: notifTrigger)

            UNUserNotificationCenter.current().add(request) { (error) in
                if error != nil{
                    print(error!)
                } else {
                    // do something
                }
            }
        }
    })

}

After configuring all the things local notification not firing. Why so?
Am I missing something?
I've also tried this tutorial
Any help will be appreciated!

A: You are not calling completionHandler in performFetchWithCompletionHandler. I am able to test BackgroundFetch with below code:
DispatchQueue.main.async {
                let notifTrigger = UNTimeIntervalNotificationTrigger(timeInterval: 6.0, repeats: false)
                let request = UNNotificationRequest(identifier: "myNotification", content:  notif, trigger: notifTrigger)

                UNUserNotificationCenter.current().add(request) { (error) in
                    if error != nil{
                        print(error!)
                        completionHandler(.failed) // Add this line
                    } else {
                        completionHandler(.noData) // Add this line
                    }
                }
            }

You can test Background Fetch with below steps:

*

*Run your application.

*Goto Xcode toolbar.

*Select Debug > Simulate Background Fetch.

Now you will able to Test Background Fetch.

A: There is similar question about this:
Background Fetch Does Not Appear to Fire

Try to force it to run on the simulator, If fetch event works in
  simulator, that proves that everything is correctly set up. There's
  nothing you can do but wait.


text:
Q: What is the visualization of light according to Maxwell's theory of Electromagnetic wave? The theory must imply a visualization. I am not being able to think or find any.
I know the sine wave representation. But light obviously not goes like a physical string. right?

A: Light has two vector field components. An electric field $(\vec{E})$ and a magnetic field $(\vec{B})$ component. $(\vec{E})$ and $(\vec{B})$ components are perpendicular to each other and to the propagation of light. Here  is a visual representation of the electromagnetic wave.


text:
Q: Outlook add-in organization specific configuration from file I am developing an Outlook Add-in for multiple organizations. Each organization requires a different configuration for the Add-in.
I would like to have a function that checks if there are any values in RoamingSettings, and if not read the settings from a file.
Can I run a setup function before a task pane is opened or a button is clicked?
Alternatively how about creating and accessing custom settings through Microsoft Graph for the organization in the add-in?

A: It isn't possible to execute code prior to the Add-in being launched. It also isn't possible to read from RoamingSettings for several reasons; most notably because Add-ins are executed within a sandboxed browser environment may be running on a non-Windows machine (Mac, iOS, Android, Web)
Keep in mind that the Add-in isn't installed in their Outlook client, it is installed to their mailbox on the backend. They are also scoped to the mailbox item rather than the application. Without this it, add-ins wouldn't be able to operate across platforms (Outlook for Windows, Outlook for Mac, Outlook on the Web, etc.).
If you need to have configuration settings applied at the organization level and pushed out to any user, I would suggest storing them on your backend.
You can either use Exchange ID Tokens to identify the organization the user belongs too or request use the SSO functionality to fetch the tenant information from Microsoft Graph.
I've used Exchange ID Tokens for this in a number of add-ins. I generally use Azure Table Storage to store the settings (super inexpensive, very fast and easy to grab data via a couple of REST calls).


text:
Q: Linear transformation given equation of plane in $\mathbb R^3$ and line in $\mathbb R^2$ I'm struggling with this question from a past exam…
Find all linear transformations $T:\mathbb{R}^3 \to \mathbb{R}^2, (x,y,z) \to (u,v)$ which map the plane in $\mathbb{R}^3$ given by $x+y+z=1$ on the line in $\mathbb{R}^2$ given by $u-2v=2$
I think I understand the normal process (using standard bases to find the coordinate vectors) but can't understand how that works in this instance.
Is the answer that there are no linear transformations because the zero vector is not part of either equation?
Any help or suggestions much appreciated! Thanks!

A: You know that$$T(x,y,z)=(a_{11}x+a_{12}y+a_{13}x,a_{21}x+a_{22}y+a_{23}z),$$for some $a_{11},a_{12},a_{13},a_{21},a_{22},a_{23}\in\mathbb R$. You want them to be such that $T(1,0,0)$, $T(0,1,0)$, and $T(0,0,1)$ all belong to the given line. This means that$$\left\{\begin{array}{l}a_{11}-2a_{21}=2\\a_{12}-2a_{22}=2\\a_{13}-2a_{23}=2.\end{array}\right.$$So, the solution is:$$T(x,y,z)=\bigl((2a+2)x+(2b+2)y+(2c+2)z,ax+by+cz\bigr),$$with $a,b,c\in\mathbb R$.


text:
Q: Blocking write-access to a specific branch in a single mercurial repository Is it possible to write some manner of hook in mercurial that will reject changesets that effect a specific named branch in a repository?
We have a managed project and would like to allow any developers to push their changes to our repository so long as they are in their own named branch.  We'd like to block any attempts to write to the default branch from outsiders (we would, internally, merge their branches over).

A: It looks like you could do this with pretxnchangegroup or pretxncommit, but you'd have to do the legwork (poking into the changesets and finding out which branch they affect) yourself.
See the Mercurial book section on hooks

A: With a small registration process, you could give each of them a complete repository, which admittadly isn't quite as convient as branches.  A variation is to us a service like BitBucket to handle some of the fork tracking for you.


text:
Q: Query only Document objects using Data Model in SOAP API I can query the objects through SOAP API for the list of objects. But I  require only the Document, Note and Attachment objects. How can I query the objects using the describeSObjectResult call?
The data model is described here

A: If I have understood your question correctly, the following code should help.
Map<String, SObjectType> objMap =  Schema.getGlobalDescribe();
        SObjectType type = objMap.get('snoteandattachment'); // sdocument for Document
        Schema.DescribeSObjectResult typeDetails = type.getDescribe();
        Map<String, Schema.SObjectField> fieldMap =  typeDetails.fields.getMap(); // to get a map of all the fields from DescribeSObjectResult object.

A: You should be able to use direct queries via SOAP API to retrieve records for these objects for e.g
Document
select id, name from Document
Attachment
select id, name from Attachment
Note
select id, body from Note


text:
Q: Oracle NLS lang issues I have a weird problem with UTF8 in oracle 10g. The db charset is US7ASCII, and I don't know how the vendor system does the inserts (they won't share their code) - I'm just trying to extract data for a report.
I can extract them by returning the fields with rawtohex(column), then using a separate program to convert the hex to unicode in java/c#.
This should work with the driver in any application by changing the registry, but now I'm trying to do this within a query w/SQL*Plus and I get a variety of wrong results.
AMERICAN_AMERICA.US7ASCII
Keratry, Émile

AMERICAN_AMERICA.AL32UTF8
Keratry, E��mile

AMERICAN_AMERICA.US8PC437
Keratry, E■■mile

Correct
Keratry, Émile

Dump:
Typ=1 Len=39: 75,101,114,97,116,114,121,44,32,69,204,129,109,105,108,101,44,32,9
9,111,109,116,101,32,100,101,44,32,49,56,51,50,45,49,57,48,52,46,32

Returning the diacritics correctly has to be possible, but I'm stumped. Anyone have any ideas?

A: The situation is as follows:
You have an US7ASCII database that stores UTF-8 codes of accented Latin letters. An application stores this data by passing these codes via OCI with NLS_LANG set to .US7ASCII or not set at all. This is a bad application from Oracle NLS point of view but this is not the question here.
An interesting aspect is that the example data you shown is stored in Unicode denormalized form, in which the accented letter É (E acute) is stored as uppercase U+0045 LATIN CAPITAL LETTER E (e.g. usual ASCII E) followed by the Unicode character U+301 COMBINING ACUTE ACCENT. This form is correct Unicode but it is less common than the usual combined form, in which É is stored as its own combined code U+00C9 LATIN CAPITAL LETTER E WITH ACUTE. Some devices may be unable to display the two characters correctly as one accented letter.
To get the data for the report, spool it from SQL*Plus with NLS_LANG=.US7ASCII to a file but switch off terminal output. The Command Prompt (US Windows) works in OEM code page 437 (US8PC437) and it will not be able to display the UTF-8 codes you get from this spool. When you look at the spooled file in a web browser configured for UTF-8, you should be able to see the data correctly. Notepad or Notepad++ should also be able to show the file correctly (I have checked them on Win10).
Note that setting NLS_LANG to anything but .US7ASCII will make Oracle attempt to convert from US7ASCII to the character set specified. This will obviously make garbage out of the (incorrectly) stored UTF-8 codes.