text:
Q: Find value of $|(\overrightarrow{a} \times\overrightarrow{b}) \times\overrightarrow{c}|$

let $\overrightarrow{a} = 2 \hat {i}+ \hat {j}-2 \hat {k}$ and  $\overrightarrow{b}= \hat {i} + \hat{j}$. $\:$ if $\overrightarrow{c}$ is a vector such that $\overrightarrow{a} \cdot \overrightarrow{c}+2|\overrightarrow{c}|=0$ and $|\overrightarrow{a}-\overrightarrow{c}|= \sqrt{14}$ and angle between $\overrightarrow{a} \times \overrightarrow{b}$ and $\overrightarrow{c}$ is $30 ^\circ$. Then value of $|(\overrightarrow{a} \times\overrightarrow{b}) \times\overrightarrow{c}|$ is ?

My first approach:
$|\overrightarrow{a}-\overrightarrow{c}|=\sqrt{|\overrightarrow{a}|^2+|\overrightarrow{c}|^2-2\overrightarrow{a} \cdot\overrightarrow{c}}= \sqrt{14}$
after substituting value of $\overrightarrow{a} \cdot \overrightarrow{c}=-2|\overrightarrow{c}|$ and $|\overrightarrow{a}|=3$ in above equation. I obtained $9+|\overrightarrow{c}|^2+4|\overrightarrow{c}|=14$
$\implies$ $|\overrightarrow{c}|^2+4|\overrightarrow{c}|-5=0$
$\implies$ $|\overrightarrow{c}|=1$
$\overrightarrow{a} \times \overrightarrow{b}=2 \hat{i}-2\hat{j}+ \hat{k}$
$\implies$ $|\overrightarrow{a} \times \overrightarrow{b}|=3$
So from above two result
$|(\overrightarrow{a} \times \overrightarrow{b}) \times \overrightarrow{c}|= |\overrightarrow{a} \times \overrightarrow{b}||\overrightarrow{c}|sin(30^\circ)=(3)(1) \frac{1}{2}= \frac{3}{2}$.
My second Approach:
$|(\overrightarrow{a} \times\overrightarrow{b}) \times\overrightarrow{c}|=|(\overrightarrow{a} \cdot \overrightarrow{c})\overrightarrow{b}-(\overrightarrow{b} \cdot \overrightarrow{c})\overrightarrow{a}|$
To calculate $\overrightarrow{b} \cdot \overrightarrow{c}$ $\;$I took help of
$[\overrightarrow{a} \; \overrightarrow{b} \; \overrightarrow{c}]^2=\begin{vmatrix} \overrightarrow{a}\cdot \overrightarrow{a} & \overrightarrow{a}\cdot \overrightarrow{b}   &\overrightarrow{a}\cdot \overrightarrow{c}  \\ \overrightarrow{b}\cdot \overrightarrow{a} & \overrightarrow{b}\cdot \overrightarrow{b}   &\overrightarrow{b}\cdot \overrightarrow{c} \\ \overrightarrow{c}\cdot \overrightarrow{a} & \overrightarrow{c}\cdot \overrightarrow{b}   &\overrightarrow{c}\cdot \overrightarrow{c} \end{vmatrix}$
$\overrightarrow{a} \cdot \overrightarrow{a}=9$ & $\overrightarrow{b} \cdot \overrightarrow{b}=2$ $\overrightarrow{c} \cdot \overrightarrow{c}=1$ & $\overrightarrow{a} \cdot \overrightarrow{b}=3$ & $\overrightarrow{a} \cdot \overrightarrow{c}=-2$ and let $\overrightarrow{b} \cdot \overrightarrow{c}=x$
$[\overrightarrow{a} \; \overrightarrow{b} \; \overrightarrow{c}]=(\overrightarrow{a} \times \overrightarrow{b}) \cdot \overrightarrow{c} = |\overrightarrow{a} \times \overrightarrow{b}| |\overrightarrow{c}| cos(\theta)=\frac{3 \sqrt3}{2}$

here $\theta$ = angle between $\overrightarrow{a} \times \overrightarrow{b}$ and $\overrightarrow{c} $

$\frac {27}{4}=\begin{vmatrix} 9 & 3 & -2 \\ 3 & 2 & x \\ -2 & x & 1\end{vmatrix}$
After solving above determinant I obtained a equation which is $36 x^2+48x+23=0$
$\implies$ no real value of $x$ that is no real $\overrightarrow{b} \cdot \overrightarrow{c}$
Doubt: Why am I not getting answer using second method?

A: The first approach gives you a result for $(\vec a \times \vec b) \times \vec c \ $ as it does not test the compatibility of the given data.
Just simply applying,
$|(\overrightarrow{a} \times\overrightarrow{b}) \times\overrightarrow{c}|=|(\overrightarrow{a} \cdot \overrightarrow{c})\overrightarrow{b}-(\overrightarrow{b} \cdot \overrightarrow{c})\overrightarrow{a}|$
shows that there cannot be vectors $\vec a, \vec b$ and $\vec c$ with given conditions.
We know $|a \times b| = 3, |a| = 3, |b| = \sqrt2$
Say the angle between $\vec b$ and $\vec c$ is $\alpha$.
$\displaystyle \frac{3}{2} \ |c| = | \ (-2 \  |c|) \ (\hat i + \hat j) - \sqrt2 \ |c| \cos\alpha \ (2\hat i + \hat j - 2 \hat k) \ | $
Dividing by $|c|$ on both sides,
$\displaystyle \frac{3}{2} = |-2 \hat i - 2 \hat j - \sqrt2 \cos\alpha \ (2 \hat i + \hat j - 2 \hat k) \ |$
$\dfrac{9}{4} = (2 + 2 \sqrt2 \cos\alpha)^2 + (2+ \sqrt2 \cos\alpha)^2 + (2\sqrt2\cos\alpha)^2$
Simplifying, $ \displaystyle \cos^2\alpha + \frac{2\sqrt2}{3} \cos\alpha + \frac{4}{9} = \frac{1}{8}$
$\displaystyle \left(\cos\alpha + \frac{\sqrt2}{3}\right)^2 = - \frac{7}{72}$
which has no real solution.

A: The simple answer is that, the question is erroneous and $\overrightarrow{c}$ simply does not exist.
Note that from your calculations, $\overrightarrow{a}\cdot \overrightarrow{c}=-2|\overrightarrow{c}|$, and $|\overrightarrow{c}|=1$. Since $|\overrightarrow{a}|=3$, this means that if $\phi$ is the angle between these two vectors, then $\cos \phi=-\frac 23$. So, $\phi\approx 131°$.
Now let us demonstrate that this is impossible.
For this purpose, I shall shift to a different reference frame, as that'll help in calculations as well as intuition. Let us consider the frame where $\overrightarrow{a}=3\hat{i}$, with $\overrightarrow {b}$ lying on the $xz$ plane. In this frame, $\overrightarrow{a}×\overrightarrow{b}=3\hat{j}$. Since angle between $\overrightarrow {c}$ and $3\hat{j}$ would be $30°$ in this frame too, we can imagine $\overrightarrow {c}$ to form a cone of semi-vertical angle $30°$ with the $y$-axis, slant length $1$, and vertex at origin.
What would the maximum possible angle between this cone and the $x$- axis ($3\hat{i}$, specifically) be? It is easy to see that this angle cannot exceed $120°$. If you are having trouble gaining this intuition you can observe that the component of $\overrightarrow {c}$ along the $xz$ plane traces a circle of radius $\frac 12$, and it's vertical component is fixed at $1\cdot \cos(30°)=\frac {\sqrt 3}{2}$. Hence, in general, $\overrightarrow {c}$ in this frame is given by $$\overrightarrow {c}=\frac 12 \cos \theta\hat{i}+\frac {\sqrt 3}{2} \hat {j}+\frac 12\sin\theta\hat{k}$$
Thus, doing a dot product shows that angle cannot exceed $120°$. Since $\phi>120°$, the situation is impossible.


text:
Q: Android NumberFormatException error with a simple number input from EditText So I have a simple Edit-text with number input.
User enters his phone number and it is saved into DB obviously that is the goal.
now every time i do
int contactNumber=Integer.parseInt(mContactNumber.getText().toString());

I get an error thrown saying NumberFormatException for some reason it doesn't like a string of number. I have made sure that mContactNumber field in the android input field has the
android:input="number"

now i also tried  just to be sure
int contactNumber=Integer.parseInt(mContactNumber.getText().toString().trim());

still the same error
Guys any ideas?

A: Try putting the Type to ' long ' instead of ' int '. Hope that will work for you.

A: This might be because you are leaving the text field empty. Are you sure you are not parsing an empty string?

A: You need to put a simple condition:
if(mContactNumber.getText().length()>0)
{
    int contactNumber=Integer.parseInt(mContactNumber.getText().toString().trim());
}

A: For phone Number you can not take it as Integer. try to take it as string only and after getting that string you can do the check for the numbers only by
TextUtils.isDigitsOnly(str);

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to set 'Speaker > Mic/Line/Phono-In' volume in C# I am currently developing an application which should control an audio input and playback of local mp3 files.
I can control the incoming audio volume manually in Speaker> Properties> Levels> Mic/Line/Phono-In, in this way I can reduce it to 0 and play a local mp3.
Now I need my program in C # to perform this action automatically, basically configure the volume to 0 and 100.
Is there any way to do this in C # or will it be necessary to do a bash or something like that?
In the following image the property "Mic / Line / Phono-In" is shown, this volume is what I need to control.


text:
Q: Redirection to lightning app using apex or configuration change --- lightning only We have 2 different lightning app. we are sso enabled organization now planning to sso from another place. Is there any way to redirect the user to the different lightning app after sso validation
As we have multiple lightning apps and a user can access all of them. Say a user is working on Lightning App "APP1" and logged out after working for some time. Now when he logged back in by default he landed in "App1"
Now we don't want that. We have a different place to do single sign on to our Salesforce Org. We want if the SSO is originated from place 1 it will open "App1" if originated from place 2 it should open "App 2" ignoring which app user was during the last login. hope this helps.
Received official reply from salesforce support
"Lightning apps are not url addressable at this time."


text:
Q: Move Synology packages and ipkg applications to another volume I have just had a harddrive failing in RAID1 on my Synology DS412+, and since the drive is not available for replacement, I have upgraded to 3x 3TB plus one old 1TB (the one left in the old array). The 3x 3TB is now my "primary" volume, but since the applications are installed on the old array (the remaining 2TB, now degraded), I cannot use the applications.
The problem is not the Synology packages, but rather those installed using the ipkg package manager. How can I "transfer" those applications (if possible, all applications and their settings) to my new volume?

A: If someone is still asking himself this question four years later, then here is an answer provided by Andrew McLean : Move Application Between Volumes

*

*Stop all your applications (Package Center > Installed > Action > Stop)

sudo /var/packages/[app_name]/scripts/start-stop-status stop

*

*Move the app files from the old volume to the desired one (in this case from volume1 to volume2)

sudo mv /volume1/\@appstore/[app_name] /volume2/\@appstore/

*

*Delete the obsolete Symlink pointing at the old app path

sudo rm -fv /var/packages/[app_name]/target

*

*Create a new Sim link pointing at the new, correct app path

sudo ln -s /volume2/\@appstore/[app_name] /var/packages/[app_name]/target

*

*Reboot

  NB : Apps like Snapshot Replication, CrashPlan and DownloadStation had
  to be uninstalled and reinstalled manually, but for the majority of
  apps this should work.

Experimental script provided by Sebastian Ott


text:
Q: Unity Container same type name but from different Namespaces I have to build a unity container to inject dependencies in my asp.net project. In that project, I have to register two types which are from different namespaces but have the same name. So how can I register both types into one unity container?
container.RegisterType<IType, Type>()
container.RegisterType<IType, Type>();

Here ITypes and Types are from a different namespace. But have the same names. So how can I register both in one container? I'm using Unity Container version 5.2.0.0

A: I've not used Unity, but assuming it's the same as any other container, it should be as simple as this:
container.RegisterType<NamespaceA.IType, NamespaceA.Type>()
container.RegisterType<NamespaceB.IType, NamespaceB.Type>();

Essentially, types will be registered internally using their Type metadata, so the container will see them as two completely separate types, just as if they were called ITypeA and ITypeB.
Then when you inject them, you just have to make sure you're referencing the correct namespace.
If you need both of them, explicitly reference both namespaces:
public MyService(NamespaceA.IType aType, NamespaceB.IType bType)

Or, if you only need one, then simply reference the namespace with a using (or explicitly) and inject it as normal:
using NamespaceA;

public class MyService
{
    public MyService(IType aType)
    {
    }
}


text:
Q: The fundamental equations of electromagnetism I'd like to know what are the basic equations of electromagnetism, that can be used to formulate all the other laws and equations.
Those basic equations I can think of are Maxwell equations, Lorentz force equation and Coulomb's law. What are the other fundamental laws and equation?

A: You just need Maxwell's equations and the Lorentz force law. Coulombs law can be derived from Maxwell's equations.

A: The basics about the direction of force and field comes from the "Fleming's Left Hand Rule" and the "Maxwell's Corkscrew Rule". In addition to these the Lorentz force law, i.e. F=q[E+(vxB)] gives the force on a charge moving through a magnetic and electric field [Neglect E if electric field is absent.] The Biot- Savart Law gives the relation between current and magnetic field.
The Ampere's Circuital Law also plays a pivotal role in finding out magnetic field due to current through an enclosed area.
Coming to electric field due to magnetism[commonly called, Electromagnetic Induction], there exists the Lenz's Law. The concepts of motional emf and Eddy currents are essential for understanding the topic.


text:
Q: How to invoke iteration API query in Azure DevOps Services I am trying to invoke the Rest API below for getting list of work items which are mapping to a specific iteration.
https://learn.microsoft.com/en-us/rest/api/azure/devops/work/iterations/get%20iteration%20work%20items?view=azure-devops-rest-5.1
Ultimately I want to invoke this as part of the Approval step in my Release pipeline so that the approver can verify if all work items for a given iteration are in Completed state.
I have two questions:

*

*I don't know how to get the values for {team} and {iterationid}

*How do I invoke this API as part of the approval gate. Should I use a Generic service connection? What user name and password do I need to provide?

Any working example here will be really helpful.

A: *

*To get teams, you can use Teams - Get Teams on Team Project.

*Then you can find all team iterations and their ids Iterations - List

*You can use gates with azure function. Here is the example: Azure DevOps release gates with Azure Functions, PowerShell and VS Code
Additionally, you may consider to use quality gates with a work item query: Use approvals and gates to control your deployment


text:
Q: Process im trying to calculate running time is executing in 0 nanoseconds. how? Im trying to calculate my algorithm performance. Basically my algorithm solves set operations such as union, disjuction, intersection etc. My algorithm can done this operations in O(logn) to compare with similar algorithms i implement a primitive aproach to solution, blooms filter algorithm, Sorted List but when i tried to calculate running time i saw some of the operations in other algorithm takes literally 0(zero) nanosecond to complite. By the operation i mean finding union of two set each has 10000 element in it. How is that possible? you can see my project on Github.
Part that i calculate running time is at the test package
I've tried to use Jprofilier to make sure it all running on one thread
I've tried to debug between to time intervals to make sure its not neglecting calculation and finds correct results
static Duration IntersectDocumentsTime(AlgorithmInterface algorithm)
{
        Instant start = Instant.now(); // Time before calulation i tryed to put breakpoint here
        algorithm.IntersectDocuments(); // returns Term[] result of elements after union operation
        Instant end = Instant.now(); // Time after calulation
        return Duration.between(start,end); // i put a breakpoint here to see if IntersectDocuments() result is correct and actually calculated
}

This is how i print result
for (AlgorithmInterface al: Algorithms)
        {
            System.out.println("------------------------------------------------------------------------------");
            System.out.println("Algorithm: "+al.getClass().toString()+"\tOperation: Union\nTime: "
                    +OperationsInterface.AddDocumentsTime(al).toNanos()+"\tseconds");
            System.out.println("Algorithm: "+al.getClass().toString()+"\tOperation: Disjuction\nTime: "
                    +OperationsInterface.DisjointDocumentsTime(al).toNanos()+"\tseconds");
            System.out.println("Algorithm: "+al.getClass().toString()+"\tOperation: Intersection\nTime: "
                    +OperationsInterface.IntersectDocumentsTime(al).toNanos()+"\tseconds");
            System.out.println("Algorithm: "+al.getClass().toString()+"\tOperation: Subtraction\nTime: "
                    +OperationsInterface.SubtractDocumentsTime(al).toNanos()+"\tseconds");
            System.out.println("Algorithm: "+al.getClass().toString()+"\tOperation: Find\nTime: "
                    +OperationsInterface.ContainsTermTime(al,new Term("A")).toNanos()+"\tseconds");
        }
System.out.println("------------------------------------------------------------------------------");

Result looks like this

Algorithm: class Algorithms.FNA.FNA    Operation: Union
  Time: 1851133600    seconds
  Algorithm: class Algorithms.FNA.FNA Operation: Disjuction
  Time: 1799607700    seconds
  Algorithm: class Algorithms.FNA.FNA Operation: Intersection
  Time: 291703600 seconds
  Algorithm: class Algorithms.FNA.FNA Operation: Subtraction
  Time: 1022775100    seconds
  Algorithm: class Algorithms.FNA.FNA Operation: Find
  Time: 1319100   seconds

Algorithm: class Algorithms.Primitive.Primitive    Operation: Union
  Time: 81257800  seconds
  Algorithm: class Algorithms.Primitive.Primitive Operation: Disjuction
  Time: 85717600  seconds
  Algorithm: class Algorithms.Primitive.Primitive Operation: Intersection
  Time: 0 seconds
  Algorithm: class Algorithms.Primitive.Primitive Operation: Subtraction
  Time: 66472900  seconds
  Algorithm: class Algorithms.Primitive.Primitive Operation: Find
  Time: 0 seconds

Algorithm: class Algorithms.BloomsFilter.BloomsFilter  Operation: Union
  Time: 998900    seconds
  Algorithm: class Algorithms.BloomsFilter.BloomsFilter   Operation: Disjuction
  Time: 0 seconds
  Algorithm: class Algorithms.BloomsFilter.BloomsFilter   Operation: Intersection
  Time: 503800    seconds
  Algorithm: class Algorithms.BloomsFilter.BloomsFilter   Operation: Subtraction
  Time: 0 seconds
  Algorithm: class Algorithms.BloomsFilter.BloomsFilter   Operation: Find
  Time: 1312900   seconds

Algorithm: class Algorithms.SortedList.SortedList  Operation: Union
  Time: 0 seconds
  Algorithm: class Algorithms.SortedList.SortedList   Operation: Disjuction
  Time: 3721800   seconds
  Algorithm: class Algorithms.SortedList.SortedList   Operation: Intersection
  Time: 0 seconds
  Algorithm: class Algorithms.SortedList.SortedList   Operation: Subtraction
  Time: 810500    seconds
  Algorithm: class Algorithms.SortedList.SortedList   Operation: Find
  Time: 1173200   seconds

A: Don't write the micro benchmark yourself, use JMH framework. This will ensure that you are avoiding the common pitfalls e.g. tiered compilation.
In your code:
Instant start = Instant.now();
algorithm.IntersectDocuments();
Instant end = Instant.now();
return Duration.between(start,end);

the algorithm.IntersectDocuments() could have been optimized away if it has no side effects.
Do note that Instant.now() uses System.currentTimeMillis() behind the scene which is not suitable for calculating elapsed time.

A: Instant.now() will be using the current time in milliseconds. Digging in to the code you can see it uses System.currentTimeMillis().
Instead of using the above approach you can use the following code where I have used the time in nano seconds.
static long IntersectDocumentsTime(AlgorithmInterface algorithm) {
    long start = System.nanoTime();
    algorithm.IntersectDocuments();
    long end = System.nanoTime();
    long durationInNanos = end - start;
    return durationInNanos;
}


text: Q: Difference between scale_pos_weight values and max_delta_step in xgb.boost method while dealing with highly imbalanced data of two classes I have hugely imbalanced data where around 96% is class 1 and the rest is class 2, I read a lot online to solution to above problem, In XGBOOST documentation they suggested scale_pos_weight and max_delta_step to deal with imbalanced data, can someone tell me how do they prevent misclassification  and what is the difference between the two.


text:
Q: Display images from urls in a carousel from Firebase + Angular.js? I'm trying to develop a webpage which has an image carousel (from the Materialize framework) that displays a series of images from urls fetched from Firebase. To account for varying numbers of images I'm using Angular.js. Right now my HTML code for that section looks like this:

And my JavaScript looks like this:
var app = angular.module('myApp', []);
app.controller('GalleryController', ['$scope', function($scope) {
    var galleryImages = this;

    getData(function(data) {
        galleryImages.images = data["gallery"];
        $scope.$apply();
    });
}]);

function getData(completion) {
  var database = firebase.database();
  var ref = database.ref('nodes/myNode');
  ref.once('value', function(snapshot) {
    completion(snapshot.val());
  });
}

Where data["gallery"] is an array of image urls. Something to note is that if I insert a line like galleryImages.images = ["some image url here"] after var galleryImages = this, then it actually displays that image. But if I put the same line inside getData, then it doesn't work.
What am I missing?
Edit: tried using AngularFire. No success yet. Here's my new code:

And on the Javascript end:
var app = angular.module('myApp', ['firebase']);
app.controller('GalleryController', ['$scope', '$firebaseObject', function($scope, $firebaseObject) {
    var data = $firebaseObject(firebase.database().ref('nodes/myNode'));
    data.$loaded().then(function() {
        $scope.data = data;

        var object = {};
        angular.forEach($scope.data, function(value, key) { object[key] = value; });

        $scope.object = object;
   });
}]);

Printing out object indicates it actually does have a value for the key gallery, which is an array of urls. But the images still aren't displaying in the carousel.

A: I use the materialize myself with JavaScript and various API calls. I found that when waiting for a response from an API call, js goes ahead and runs the rest of the code anyways. Often times, the js that is responsible for interactive elements such as carousels loads before the API gives a response.
I simply use the setTimeout(function, time) function to run the js code responsible for loading the interactive content with a delay. I would say 2000ms is a healthy delay.
I know that carousels in materialize are initiated with $('.carousel').carousel();, so we can put that in a function and at the very bottom of a page, use the setTimeout() function to call carousel after 2 seconds.
Put this after firebase and angular code
$(document).ready(function(){
      setTimeout(initiateSlider, 2000)
});

function initiateSlider() {
  $('.carousel').carousel();
}

After 2 seconds, the API call should have been handled so the website can load properly.


text:
Q: Laravel 5.4 Nested Loop with Grouped dataset "Filters" table looks like following:
id |  group   |       label       |        value
----+----------+-------------------+----------------

 12 | deadline | 1 to 3 days       | 1 AND 3
 14 | price    | Any               | 0
 15 | price    | Less than 1000    | 0 AND 1000
 16 | price    | 1000 to 10000     | 1000 AND 10000
 22 | location | Any               | 0
 23 | location | New York          | newyork
 24 | location | California        | california
 25 | location | Alabama           | alabama

I need to show chunk of "label" under the "group".
My controller:
public function index(){
        $filters = Filters::all();
        return view('frontend.request', compact('filters'));
    }

My view has:
<?php foreach ($filters as $filter) { ?>

                        {{ $filter->group }}

                                    <input type="checkbox" name="{{ $filter->group }}" value="{{ $filter->any }}">{{ $filter->label }}

                <?php } ?>

I want to show all labels under the group within one box and so on. The above codes create different boxes for each label which is not right.
I believe, its got to be nested loop but I'm having difficult writing it on Laravel. Any idea how it should be?
Note: This thread gives partial answer but we don't know chunk size in my case: Laravel 5.1 - Nested Loop - Blade Templating

A: You could use Laravel's groupBy() collection method;
https://laravel.com/docs/5.4/collections#method-groupby
Controller:
public function index(){
    $filters = Filters::all();
    $groups = $filters->groupBy('group');
    return view('frontend.request', compact('groups'));
}

View:
@foreach ($groups as $group => $filters)

        {{ $group }}
        @foreach($filters as $filter)

                        <input type="checkbox" name="{{ $filter->group }}" value="{{ $filter->any }}">{{ $filter->label }}

        @endforeach

@endforech


text:
Q: If $H$ is not normal subgroup of $G$ then there are two left cosets of $H$ which multiplication is not a left coset of $H$ Let $G$ be a group and $H$ be a not normal subgroup of $G$. I need to prove that there are two left cosets of $H$: $g_1H,g_2H$ such that $g_1Hg_2H$ is not a left coset of $H$.
I tried to assume the contrary and get to that $H$ is normal, which will mean a contradiction. I tried just using definitions or to find an homomorphism which I can apply the first isomorphism theorem with maybe. However, it didn't work out for me.
Any help would be appreciated.

A: Suppose that the product of every left cosets is a left coset. This implies that for every $g$, $gHg^{-1}H=lH$, we deduce that $1=gg^{-1}\in lH$. This implies that $l\in H$ and $gHg^{-1}H=H$, we deduce that for every $h\in H$, $ghg^{-1}=ghg^{-1}1\in gHg^{-1}H=H$. This implies that $gHg^{-1}=H$ and $H$ is normal.

A: Aliter:
Assuming the negation of the conclusion, it follows that $(aH)(bH) = (ab)H$ (since cosets partition $G$ and $ab\in (aH)(bH)$). It follows that $H(aH) = aH$.   If $h\in H$, then $hah\in H(aH) = aH$ so that $ha = ah'$ for some $h'\in H$. Hence $Ha\subseteq Ha$. Now since both left cosets and right cosets partition $G$, no inclusion can be proper. Hence, $Ha = aH$ for every $a\in G$ so that $H$ is normal.


text:
Q: R, ggplot - Density plot shows gaps I've been encountering some sort of bug when trying to plot a 2d density plot using ggplot2's function stat_density2d. When I only try to plot the outlines for the graph it seems to work fine:
ggplot(mydata, aes(x=x_loc, y=y_loc)) + stat_density2d(aes(fill = ..level..))

However when I try to fill in the layers using geom = "polygon"
ggplot(mydata, aes(x=x_loc, y=y_loc))+stat_density2d(aes(fill = ..level..), geom = "polygon")

I get this:

This looks like it is giving geometry errors for some reason, but I'm not sure why. I've tried to work around this but I can't seem to find a solution. I've updated my R version and all my packages but it doesn't fix it.
As a reproducible example:
matrix = matrix(c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,1,2,3,1,2,3,1,2,3,1,2,
3,1,2,3,1,2,3,18,12,20,24,22,35,18,12,19,20,5,16,11,7,10,5,1,3), nrow = 18)

ggplot(as.data.frame(matrix), aes(x=V1, y=V2)) +
stat_density2d(aes(fill = ..level..), geom = "polygon")

Which has the similar problems, for instance on the sides and on the top and bottom:

If anybody could help me with this that would be great, have stuck at this for several hours now.
Thanks in advance!

A: As mentioned in @joran's comment, this question seems to be of a similar ilk. The default clipping values seem to be causing the problem. The following works for me:
library(ggplot2)

matrix = matrix(c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,1,2,3,1,2,3,1,2,3,1,2,
3,1,2,3,1,2,3,18,12,20,24,22,35,18,12,19,20,5,16,11,7,10,5,1,3), nrow = 18)

ggplot(as.data.frame(matrix), aes(x=V1, y=V2)) +
stat_density2d(aes(fill = ..level..), geom = "polygon")+
lims(x = c(-1,8),y = c(-.25,4.25))


text:
Q: Why JobScheduler is not working as expected I am using JobScheduler to run the job every 15 mins. But It is not working as expected. Here I attached my code.
public class WorkScheduler extends JobService {

    private static final String TAG = "Jobschedulerexample";
    private boolean jobCanceled = false;
    private SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");

    @Override
    public boolean onStartJob(JobParameters jobParameters) {

        Log.d(TAG,"Started at ==> "+ sdf.format(new Date()));
        Log.d(TAG,"Job Started");
        doBackgroundWork(jobParameters);
        return true;
    }

    @Override
    public boolean onStopJob(JobParameters jobParameters) {

        Log.d(TAG, "Job cancelled before completion");
        jobCanceled = true;
        return true;
    }

    private void doBackgroundWork(final JobParameters params) {
        new Thread(new Runnable() {
            @Override
            public void run() {

                for (int i = 0; i < 10; i++) {
                    Log.d(TAG, "run: " + i);
                    if (jobCanceled) {
                        return;
                    }

                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }

                Log.d(TAG, "Job finished");
                Log.d(TAG,"Ended at ==> "+ sdf.format(new Date()));
                jobFinished(params, true);
            }
        }).start();
    }
}

My utility class for Job service
public class WorkSchedulerUtility {

    private static final int JOB_ID = 123;
    private static WorkSchedulerUtility mInstance;
    private final int REFRESH_INTERVAL = 15 * 60 * 1000;

    private WorkSchedulerUtility(){

    }

    public static WorkSchedulerUtility getInstance(){
        if(mInstance == null){
            mInstance = new WorkSchedulerUtility();
        }
        return mInstance;
    }

    private static final String TAG = "Jobschedulerexample";

    public void scheduleJob(Context context) {
        ComponentName componentName = new ComponentName(context, WorkScheduler.class);

       /* JobInfo info = new JobInfo.Builder(JOB_ID, componentName)
                .setPersisted(true)
                .setPeriodic(REFRESH_INTERVAL)
                .build();*/

        JobInfo info = new JobInfo.Builder(JOB_ID, componentName)
                .setPersisted(true)
                .setBackoffCriteria(REFRESH_INTERVAL, JobInfo.BACKOFF_POLICY_LINEAR)
                .setMinimumLatency(1000 * 6)
                .build();

        JobScheduler scheduler = (JobScheduler) context.getSystemService(JOB_SCHEDULER_SERVICE);
        int resultCode = scheduler.schedule(info);
        if (resultCode == JobScheduler.RESULT_SUCCESS) {
            Log.d(TAG, "Job scheduled");
        } else {
            Log.d(TAG, "Job scheduling failed");
        }
    }

    public void cancelJob(Context context) {
        JobScheduler scheduler = (JobScheduler) context.getSystemService(JOB_SCHEDULER_SERVICE);
        scheduler.cancel(123);
        Log.d(TAG, "Job cancelled");
    }

}

I planned to run the job for every 15 mins. But it is not start job every 15 mins. I will attach the output.

Started at ==> 15:10:49  Ended at ==> 15:10:59  Started at ==>
  15:25:59  Ended at ==> 15:26:09  Started at ==> 15:56:10  Ended at ==>
  15:56:20  Started at ==> 16:41:44  Ended at ==> 16:41:54

I don't know why it is not working for every 15 mins. And also I want to start the job at specific time. For example every day at 8o'Clock. How to achive that using JobSceduler.

A: JobScheduler is not guaranteed to run your job every 15 minutes, but when it sees fit. See this answer.


text:
Q: How to get a instance of DbContext from pool with dependency injection during method? I want to have DbContext in a function from the pool during a using scope
I already tried to add IServiceProvider to the factory and let the factory resolve the context and put it into a UoW but then it tells me the same contains is used in other threads.
services.AddDbContextPool<EmployeeContext>(options => options.UseSqlServer(connection));
...
using (var unitOfWork = factory.CreateUnitOfWork())
{
}

I want to create a unit-of-work scope within a function which is using the DbContextPool of dependency injection.

A: You can create a scope inside your method but first you have to inject IServiceScopeFactory to your class.
using Microsoft.Extensions.DependencyInjection;

public class SomeService
{
    private readonly IServiceScopeFactory _serviceScopeFactory;

    public SomeService(IServiceScopeFactory serviceScopeFactory)
    {
        _serviceScopeFactory = serviceScopeFactory;
    }

    public Task DoStuff()
    {
        using (var serviceScope = _serviceScopeFactory.CreateScope())
        {
            var unitOfWork =  serviceScope.ServiceProvider.GetRequiredService<UnitOfWork>();
        }
    }
}

Keep in mind that the object you created will be disposed when you dispose the scope. Also, if you don't dispose the scope, you will get memory leaks


text:
Q: Execution trapped inside the button I have a method called inside a button that run almost an infinite loop. I can't access the other buttons while running this method.
How I make to free the interface to access other buttons while running this method?
//methods inside the button
this.setCrawlingParameters();
webcrawler = MasterCrawler.getInstance();
webcrawler.resumeCrawling(); //<-- the infinite loop method

A: you need to use a SwingWorker
The way Swing works is that it has one main thread, the Event Dispatch Thread(EDT) that manages the UI.  In the Swing documentation, you will see that it is recommended to never to long-running tasks in the EDT, because, since it manages the UI, if you do something computationally heavy your UI will freeze up.  This is exactly what you are doing.
So you need to have your button invoke a SwingWorker so the hard stuff is done in another thread.  Be careful not to modify UI elements from the SwingWorker; all UI code needs to be executed in the EDT.
If you click the link for SwingWorker, you will see this:

Time-consuming tasks should not be run
on the Event Dispatch Thread.
Otherwise the application becomes
unresponsive. Swing components should
be accessed on the Event Dispatch
Thread only

as well as links to examples on how to use a SwingWorker.

A: Start a new Thread:
// In your button:
Runnable runner = new Runnable()
{
    public void run()
    {
         setCrawlingParameters(); // I removed the "this", you can replace with a qualified this
         webcrawler = MasterCrawler.getInstance();
         webcrawler.resumeCrawling(); //<-- the infinite loop method
    }
}
new Thread(runner, "A name for your thread").start();


text:
Q: He dropped it by accidentally He was holding a handtowel.

He dropped it by accidentally.

Would "drop" indicate the mean of slip from hand on purpose?
Would it make people misunderstanding of using the word "drop"?

A: No, either

He dropped it by accident.

or

He dropped it accidentally.

but no, the verb "drop" does not imply anything about intentionality.  You can drop something accidentally or on purpose.


text:
Q: typedef fixed length array I have to define a 24-bit data type.I am using char[3] to represent the type. Can I typedef char[3] to type24? I tried it in a code sample. I put typedef char[3] type24; in my header file. The compiler did not complain about it. But when I defined a function void foo(type24 val) {} in my C file, it did complain. I would like to be able to define functions like type24_to_int32(type24 val) instead of type24_to_int32(char value[3]).

A: To use the array type properly as a function argument or template parameter, make a struct instead of a typedef, then add an operator[] to the struct so you can keep the array like functionality like so:
typedef struct type24 {
  char& operator[](int i) { return byte[i]; }
  char byte[3];
} type24;

type24 x;
x[2] = 'r';
char c = x[2];

A: You want
typedef char type24[3];

C type declarations are strange that way.  You put the type exactly where the variable name would go if you were declaring a variable of that type.

A: Here's a short example of why typedef array can be confusingly inconsistent.  The other answers provide a workaround.
#include <stdio.h>
typedef char type24[3];

int func(type24 a) {
        type24 b;
        printf("sizeof(a) is %zu\n",sizeof(a));
        printf("sizeof(b) is %zu\n",sizeof(b));
        return 0;
}

int main(void) {
        type24 a;
        return func(a);
}

This produces the output
sizeof(a) is 8
sizeof(b) is 3

because type24 as a parameter is a pointer.  (In C, arrays are always passed as pointers.)  The gcc8 compiler will issue a warning by default, thankfully.

A: The typedef would be
typedef char type24[3];

However, this is probably a very bad idea, because the resulting type is an array type, but users of it won't see that it's an array type. If used as a function argument, it will be passed by reference, not by value, and the sizeof for it will then be wrong.
A better solution would be
typedef struct type24 { char x[3]; } type24;

You probably also want to be using unsigned char instead of char, since the latter has implementation-defined signedness.

A: From R..'s answer:

However, this is probably a very bad idea, because the resulting type
  is an array type, but users of it won't see that it's an array type.
  If used as a function argument, it will be passed by reference, not by
  value, and the sizeof for it will then be wrong.

Users who don't see that it's an array will most likely write something like this (which fails):
#include <stdio.h>

typedef int twoInts[2];

void print(twoInts *twoIntsPtr);
void intermediate (twoInts twoIntsAppearsByValue);

int main () {
    twoInts a;
    a[0] = 0;
    a[1] = 1;
    print(&a);
    intermediate(a);
    return 0;
}
void intermediate(twoInts b) {
    print(&b);
}

void print(twoInts *c){
    printf("%d\n%d\n", (*c)[0], (*c)[1]);
}

It will compile with the following warnings:
In function 'intermediate':
warning: passing argument 1 of 'print' from incompatible pointer type [enabled by default]
    print(&b);
     ^
note: expected 'int (*)[2]' but argument is of type 'int **'
    void print(twoInts *twoIntsPtr);
         ^

And produces the following output:
0
1
-453308976
32767

A: Building off the accepted answer, a multi-dimensional array type, that is a fixed-length array of fixed-length arrays, can't be declared with
typedef char[M] T[N];  // wrong!

instead, the intermediate 1D array type can be declared and used as in the accepted answer:
typedef char T_t[M];
typedef T_t T[N];

or, T can be declared in a single (arguably confusing) statement:
typedef char T[N][M];

which defines a type of N arrays of M chars (be careful about the order, here).

A: Arrays can't be passed as function parameters by value in C.
You can put the array in a struct:
typedef struct type24 {
    char byte[3];
} type24;

and then pass that by value, but of course then it's less convenient to use: x.byte[0] instead of x[0].
Your function type24_to_int32(char value[3]) actually passes by pointer, not by value. It's exactly equivalent to type24_to_int32(char *value), and the 3 is ignored.
If you're happy passing by pointer, you could stick with the array and do:
type24_to_int32(const type24 *value);

This will pass a pointer-to-array, not pointer-to-first-element, so you use it as:
(*value)[0]

I'm not sure that's really a gain, since if you accidentally write value[1] then something stupid happens.


text:
Q: JQuery not being run in IE8 I'm having an issue with a site I'm building.
One feature of the site is a survey which asks for information.  One type of question is a 'Visual Choice Question' that shows images that can be clicked.  These images correspond to (hidden) checkboxes, which record their answers.  A checked item is given a border, which results in a nice visual experience for our users.
Those users in IE8, however, can't click images - <img> tags within labels aren't clickable in IE8, and the :checked CSS selector isn't usable.  Our stakeholders are fine with IE8 having a degraded experience, but it has to work for them.
In order for IE8's experience to degrade gracefully, I wrapped the survey in an IE8-only div (using Conditional Comments so that only IE8 and below would get it) and wrote a line or two of CSS so that the checkboxes would be visible.
Unfortunately, the checkboxes are outside of a floating element, and thus render very far from where the element is.
I wrote some jQuery that would detach the checkboxes and re-attach them within the floating elements.  I wrapped this jQuery in the same sort of conditional comments, tested it in IE11's Developer Toolbar-enabled IE8 mode, and pushed the code to the server.
It fails on real IE8.  The code, including the jQuery which is wrapped in conditional comments, works on IE11's emulated IE8 but not on real IE8.
What can I do to resolve this?
Here's a jsFiddle which shows a simplified version of a survey question.  The code in the javascript panel is wrapped in <!--[if lte IE 8]> tags on the final page.

A: You're over-complicating the solution with using all these conditional hacks.
All you need to do is address the one issue you're facing with IE8, it doesn't support the clicking of labels.
You can do this simply by binding the click event of the labels directly to the inputs themselves.
This should work for your needs (include it somewhere after jQuery is loaded).
<!--[if lte IE 8]>
<script type="text/javascript">
$(function () {
    $("label").click(function(){
        if ($(this).attr("for") != "")
            $("#" + $(this).attr("for")).click();
    });
});
</script>
<![endif]-->

IMPORTANT: Make sure the for="" on your labels matches the id="" on your inputs.


text:
Q: How can I specify time limit to a chrome push notification I used Service Worker to send Push Notifications to chrome browser.
I used below code to receive notification from server
 var url = "path/to/your/json/file/json-data.php?param="+Math.random();
 self.addEventListener('push', function(event) {
  event.waitUntil(
    fetch(url).then(function(response) {
      if (response.status !== 200) {
        // Either show a message to the user explaining the error
        // or enter a generic message and handle the
        // onnotificationclick event to direct the user to a web page
        console.log('Looks like there was a problem. Status Code: ' + response.status);
        throw new Error();
      }

      // Examine the text in the response
      return response.json().then(function(data) {
        if (data.error || !data.notification) {
          console.log('The API returned an error.', data.error);
          throw new Error();
        }
        var title = data.notification.title;
        var message = data.notification.message;
        var icon = data.notification.icon;

        return self.registration.showNotification(title, {
          body: message,
          icon: icon,
          data: {
            url: data.notification.url
          }
        });
      });
    }).catch(function(err) {
      console.log('Unable to retrieve data', err);

      var title = 'An error occurred';
      var message = 'We were unable to get the information for this push message';
      var icon = 'img/design19.jpg';
      var notificationTag = 'notification-error';
      return self.registration.showNotification(title, {
          body: message,
          icon: icon,
          tag: notificationTag
        });
    })
  );
});

// The user has clicked on the notification ...
self.addEventListener('notificationclick', function(event) {
  console.log(event.notification.data.url);
  // Android doesn't close the notification when you click on it
  // See: http://crbug.com/463146
  event.notification.close();

  // This looks to see if the current is already open and
  // focuses if it is
  event.waitUntil(
    clients.matchAll({
      type: "window"
    })
    .then(function(clientList) {
      for (var i = 0; i < clientList.length; i++) {
        var client = clientList[i];
        if (client.url == '/' && 'focus' in client)
          return client.focus();
      }
      if (clients.openWindow) {
        return clients.openWindow(event.notification.data.url);
      }
    })
  );
});

Notification is displaying but it is closing after a few seconds. I don't need to close the notification. The user explicitly closes the notification. Tell me the code to stop closing the notification. Once the notification is displayed it is not closing forever. User explicitly close the notification

A: return self.registration.showNotification(title, {
          body: message,
          icon: icon,
          tag: notificationTag
        });
You can add requireInteraction: true to the notification porperties dictionary. This will make it stay on screen. Note that this is not guaranteed to work in all platforms but today at least it works ok in chrome desktop.


text:
Q: golang gorp insert multiple records Using gorp how can one insert multiple records efficiently? i.e instead of inserting one at a time, is there a batch insert?

var User struct {
   Name string
   Email string
   Phone string
}
var users []Users
users = buildUsers()
dbMap.Insert(users...) //this fails compilation
//I am forced to loop over users and insert one user at a time. Error Handling omitted for brevity

Is there a better mechanism with gorp? Driver is MySQL.

A: As I found out on some other resource the reason this doesn't work is that interface{} and User{} do not have the same layout in memory, therefore their slices aren't of compatible types. Suggested solution was to convert []User{} into []interface{} in for loop, like shown here: https://golang.org/doc/faq#convert_slice_of_interface
There is still on caveat: you need to use pointers for DbMap.Insert()function.
Here's how I solved it:
s := make([]interface{}, len(users))
for i, v := range users {
    s[i] = &v
}
err := dbMap.Insert(s...)

Note that &v is important, otherwise Insert will complain about non-pointers.

A: It doesn't look like gorp has anything that gives a wrapper for either raw SQL or multi value inserts (which is always SQL dialect dependent).
Are you worried about speed or transactions?  If not, I would just do the inserts in a for loop.


text:
Q: ntohl() vs htonl() in Little Endian Kindly clarify my doubt as i got so confused with the below stuff and i couldnt get a
    clean anwser any where else on net.
#include<stdio.h>
int main()
{
   int a = 0x44332211;
   printf("Network - 0x%x\n", htonl(a));// Host to network
   printf("Host    - 0x%x\n", ntohl(a));// Network to host
   return 0;
}

Output:
 Network - 0x11223344
 Host    - 0x11223344

Here htonl(0x44332211) => i am converting little endian(LE) to BE. So output will be 0x11223344. That i understood. My problem is with ntoh(). Now ntohl(0x44332211) => what?
Here i am executing both the commands on 1 terminal. So  host to  network, ie hton() means my terminal to network. That makes sense. But here ntohl() means what? ntohl() comes into picture if we have:
a PC A----(ie hton)sending data over network------>(ie ntoh) to PC B?

Also ntoh expects a network byte order ie Big endian. Kindly intepret what ntohl() means above and why its  printed same as 0x11223344 and why not 0x44332211?

A: Assuming your program is running on a little-endian machine (e.g. x86), ntohl(a) will return 0x11223344 (i.e. it will flip the byte ordering of your 0x11223344 value, just like htonl() does).
On the other hand, if your program is running on a big-endian machine (e.g. a PowerPC Mac), then ntohl(a) and htonl(a) will both return a, verbatim, since the machine's internal/host format is already the same as the network format.
There's also the (at least theoretical) possibility that your program is running on some unusual hardware that uses a numeric representation that is neither big-endian nor little-endian.  In that case, the htonl() and ntohl() functions for that environment would have been programmed to do the right thing (whatever that might be) to convert that machine's internal representation to the standard network representation (which is big-endian) and back.
The expected usage pattern for these function is this:

*

*Anytime you are about to send a long to the network, call htonl() on it and send that value instead.

*Anytime you have just received a long from the network, call ntohl() on it and use that value instead.

That way any variances between the host computer's numeric representation and the network/big-endian representation are automatically handled for you inside htonl() and ntohl(), and you don't have to worry about writing (and testing!) separate conversion code for every computer architecture your program might possibly ever run on.

A: Just stumbled upon this post. I agree with Jeremy's answer, but just wanted to add one more point:
When in doubt, go to the source code. If you look at ntoh() and hton() definition in GCC library:
<netinet/in.h>
#  if __BYTE_ORDER == __LITTLE_ENDIAN
#define ntohl(x)     __bswap_32 (x)
#define htonl(x)     __bswap_32 (x)
#endif

So, both ntohl() and htonl() are merely byte swaps defined in byteswap.h. That is why your output is the same for both these macros.
Now, why are they same ???
Well, the author intended ntohl() to be called on Network Endian Data (typically contents of a received packet buffer) and similarly, htonl() to be called on Host Endian Data (data written by the host).
In your case, you are calling both these macro's on the same Host Endian data and that is the problem.
Guess I am late to reply. However, I hope the next visitor finds this answer useful :)


text:
Q: Android Studio plugin for capture Strings I'm searching a plugin for Android Studio that help me catch the Strings in my APP, I don't use the recomendations of the Android and make my APP using Strings hardcoded.
How do you capture the Strings of codes of automatic way?
[I've searched in the google (web) but I can't find anyone]

A: I'm not exactly sure what you are asking, but if you are wondering how you can find all of your hardcoded strings, you can find them through Android Lint. In android studio go to Analyze -> Inspect Code. Then in the results expand Android Lint. Hardcoded text will be one of the items shown.

A: If you mean searching your entire project for a specific string, you can use command line. Open the terminal window to the location of your project and

*

*If you have git installed, use git grep 'your keyword'

*If you are on a Linux or Unix machine, try using grep -r "your keyword" .
Both commands find all matches for your keyword in all files in the directory of the terminal window, and their subdirectories.


text:
Q: Where can I find out more about the Outlook 2007/Microsoft word html layout engine? I want to write an app that will render html using Outlook 2007/Microsoft Word 2007's html layout engine ...
I'm trying to do some research but keep coming up empty unlike with the IE HTML layout engine, for example, http://en.wikipedia.org/wiki/Trident_(layout_engine)
I just want a code name, dll location, a point in the right direction ... something ...
Thanks for your help in advance

A: I believe what you are looking for is the MS Word OLE component. You can basically embed Word in your application using OLE and there should be a lot of OLE documentation on MSDN.
Examples using VBA: http://support.microsoft.com/kb/237337
MS Office Developer Portal: http://msdn.microsoft.com/en-us/office


text:
Q: Optimal MySQL my.cnf setting for large Magento site on a dedicated server Our dedicated server is running a large Magento store with a MySQL database approximately 250MB in size.
The server spec is listed as having 5 Xeon 2Ghz processors (4MB cache) and 12GB of memory.
I'd have thought the above spec was sufficient to run even Magento very speedily, however although the site isn't slow, it's really not as fast as it should be.
The current MySQL my.cnf file is as follows:
skip-innodb

ft_min_word_len=3
query_cache_limit = 4M
query_cache_size = 16M ## 32MB for every 1GB of RAM
query_cache_type = 1
max_user_connections = 50
max_connections = 50
interactive_timeout = 300
wait_timeout = 200
connect_timeout = 200
thread_cache_size = 32
key_buffer_size = 64M ## 128MB for every 1GB of RAM
join_buffer_size = 1M
max_connect_errors = 20
max_allowed_packet = 12M
table_cache = 1024
record_buffer = 1M
sort_buffer_size = 1M ## 1MB for every 1GB of RAM
read_buffer_size = 1M ## 1MB for every 1GB of RAM
read_rnd_buffer_size = 1M ## 1MB for every 1GB of RAM
thread_concurrency = 4 ## Number of CPUs x 2
myisam_sort_buffer_size = 32M
tmp_table_size = 16M
max_heap_table_size = 12M

[safe_mysqld]
open_files_limit = 2048

[mysqldump]
quick
max_allowed_packet = 12M

I've seen a suggested my.cnf for a magento dedcidcated DB server (2GB ram) of:

query_cache_size = 512M
query_cache_limit = 256M
tmp_table_size = 256M
key_buffer_size = 64M
read_buffer_size = 128M
read_rnd_buffer_size = 128M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 128M
myisam_max_extra_sort_file_size = 128M
myisam_repair_threads = 2
myisam_recover
innodb_additional_mem_pool_size = 256M
innodb_log_buffer_size = 128M
innodb_log_file_size = 128M
innodb_log_files_in_group = 2
innodb_flush_log_at_trx_commit = 0
innodb_buffer_pool_size = 512M
innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:256M:autoextend
innodb_autoextend_increment=32

I was wondering if anyone may be able to suggest the best values for the my.cnf parameter given our spec?
Also if there is anything I should be aware of when tinkering with them, such as: set this too high and expect catastrophic failure.
Any thoughts would be much appreciated. Cheers.

A: MySQL is usually the last bottleneck on a Magento store when you are performance testing for an individual user. Nevertheless, your my.cnf does not look optimal for a Magento store, nor for that server specification. I wrote a detailed answer about MySQL load for Magento here,
https://serverfault.com/a/367856/113375
At present, your best efforts would be to focus on improving your page load times via other means (change host/optimise template etc.) and address the database last; this really only comes into play for concurrency testing and transactional load.
From http://docs.sonassihosting.com/go_dedicated.pdf
Depending on the architecture of your CPU and bus speed - using the figures below, the BEST you would be able to achieve is a 0.8s PHP page render time (excl. images/js/css).

Giving you a rough idea of what hardware to select
There are two figures you need to bear in mind when choosing a server, concurrency and page load time. Concurrency is how many customers your server can support at any time. Individual page load time is how fast the page actual loads for a single customer.
It is possible to have:

*

*A slow page load time and low concurrency support (low clock speed CPU (GHz), few cores)

*A fast page load time, but low concurrency support (high clock speed CPU (GHz), few cores)

*A slow page load time, but high concurrency support (low clock speed CPU (GHz), lots of cores)

*A fast page load time and high concurrency support (high clock speed CPU (GHz), lots of cores)

You can choose your hardware based on this.
Concurrency
a) A standard Magento demo store is capable of delivering roughly 230 uniques per GHz, per hour.
b) A typical web store, with admin user activity, development activity, product addition/deletion can see this degrade by around 100%, to 115 uniques per GHz, per hour.
c) A store with a poorly built/heavy template can further reduce the figure by another 100-200%, to 50 uniques per GHz, per hour.
When we quote figures, we use option b).
Individual Page load time
A standard Magento demo store (CE or EE – when FPC is disabled) is capable of loading the homepage in:
0.7 seconds  2.4GHz  CPU
0.6 seconds  2.8GHz  CPU
0.51 seconds 3.3GHz  CPU
0.48 seconds 3.46GHz CPU

But again, a badly built/heavy template will cause this figure to increase exponentially. When we quote figures, we use the demo store template with sample data as an example.

Above source extracted from http://docs.sonassihosting.com/go_dedicated.pdf
I would assume that as you've got 5 CPUs - that you are using a VPS (cloud or otherwise), if so, I/O will likely be your bottleneck, both for disk and network. Unfortunately, due to the contended nature of VPS - they are never really ideal for Magento hosting - unless the person/company managing it has a very in-depth knowledge of Magento optimisation and the hardware is not contended.
From http://www.webhostchat.co.uk/dedicated-servers-vps-colocation/27555-magento-hosting-please-advise-what-i-may-need-2-sites-1-magento-install.html

Downsides of VPS for Magento
Every user has root access. This means that other VPS nodes on your system can be cranking bonnie/iperf/hping and subsequently hammering the resources that can't be partitioned/split off - HDD I/O, network or interrupts. So even if you have guaranteed CPU/RAM - you are subject to the shared subsystem.
You've got limited CPU and RAM. Yes, you can scale up/down - but at the end of the day, a small Magento store benefits from a minimum of 2GB RAM allocated to the MySQL instance alone, in conjunction with a rule of thumb of 1GB RAM/logical CPU core. So at the very least, a VPS should have 3GB RAM and 1 CPU core - which at most (when properly tuned) will be capable of serving around 1,500 unique visitors per day, for a transacting Magento store - assuming no HDD I/O or network I/O bottlenecks.
You have to manage it yourself. Its odd that nowadays an e-commerce website owner and operator also should be responsible for setting up, monitoring and managing their hosting infrastructure. The store owner should focus on what they are good at - running their business, not concerned with trying to resolve bugs, tune performance or administer a command line Linux server. Worst case scenario resulting in blind panic when something goes wrong that they simply don't have the experience to deal with.

Above source extracted from http://www.webhostchat.co.uk/dedicated-servers-vps-colocation/27555-magento-hosting-please-advise-what-i-may-need-2-sites-1-magento-install.html
For a better/more accurate answer, post some more details about your store -

*

*What is the level of daily unique visitors?

*Number of page views per visitor?

*What country will visitors predominantly be from?

*Do you anticipate the site traffic growing over the next 12 months, if so, by how much?

*Does your site offer digital downloads?

*Number of store views?

*Number of products in catalogue?

*Number of categories in catalogue?

*Number of attributes in catalogue?

*Number of attribute sets in catalogue?

*Current disk space usage?

*Current bandwidth usage?

*Transactions per day?

A: I'll Skip the large amount of text I could write and get Straight to the point.
Have a look at these for a moment:
max_user_connections = 50
max_connections = 50

Apache runs by default 500 connections.
At the moment if 50 request go to MySQL / MySqlI any more will be rejected.


text:
Q: How to calculate EPS q/q in pinescript I am new in pine script and I would like to calculate EPS q/q (for example, Q42020/Q42019) of one stock and print the result percentage wise.
Is it possible to do that?

A: To get financial data, use the function financial. For more information about what data you can get, read the article


text:
Q: WooCommerce: Create script for (http) cronjob How do I create a script in WooCommerce which can progress orders and is callable by a (http) cronjob from outside?
Example: myshop.com/myscript should be called by a cronjob. The script itself should be able to execute the following:
$order = new WC_Order( $order_id );
$mailer = $woocommerce->mailer();

This code is possible in my theme's functions.php. But how do I include the "WooCommerce Core" (?) in a "normal" php script or where do I have to create a new script, that the Core is available and the script is callable from outside?

A: Now my solution looks like this:

*

*creating a shortcode in my functions.php like this
function handle_orders()  {
   // handle my orders and write debug info in $r
   return $r;
}

add_shortcode('handle_orders', 'handle_orders');

*including my [handle_orders] shortcode in a new page and give it a url like '/cronjob-handle-orders'

*letting the (http) cronjob call my created url

A: I know it's an old question, but I found myself in the same situation later today, here is what I did :
in the functions.php of your theme
if (isset($_GET['my_cron_call'])){
    include_once 'inc/cron.php';
    add_action('init','my_cron',11);
}

in a sub directory ./inc/ put your file cron.php and wrote a my_cron function as the entry point.
function my_cron(){
    //do here whatever you want in a wordpress / woocommerce context
    //$order = new WC_Order( $order_id );
}

you can then call your wp url with your cron :
curl https://your-wordpress.org/?my_cron_call


text: Q: Does the five lemma hold true for Lie algebras? According to wikipedia, the Five Lemma is true in Abelian categories. But the category of Lie algebras is not Abelian. Then is the Five Lemma still true for Lie Algebras?


text:
Q: Characterisation of measurability for $\mathbb{R}\cup\{\pm\infty\}$-valued functions Let $(X,\mu,\mathcal{A})$ be a measure space. $f\colon X\to \mathbb{R}$ is $\mu$-measurable if $f$ is a $\mu$-a.e. limit of simple functions $f_j\colon X\to\mathbb{R}$. Functions $f\colon X\to\bar{\mathbb{R}}$, however, are said to be $\mu$-measurable if $f^{-1}(\pm\infty),f^{-1}(O)\in\mathcal{A}$ for all $O$ open in $\mathbb{R}$.
I know the definitions coincide if we consider $f\colon X\to \mathbb{R}$ to be a function with values in $\bar{\mathbb{R}}$. But, if we speak about convergence in $\bar{\mathbb{R}}$, is the pointwise limit $f\colon X\to \bar{\mathbb{R}}$ of a sequence of simple functions $f_j\colon X\to\mathbb{R}$ not necessarily $\mu$-measurable?

A: The pointwise limit you mention is indeed $\mu$-measurable.
More generally, if $f_n:X\to\bar{\mathbb R}$ is $\mu$-measurable for $n=1,2,\dots$ and a set $A\in\mathcal A$ exists with $\mu(A)=0$ and: $$x\in A^{\complement}\implies \lim_{n\to\infty}f_n(x)\text{ exists in }\bar{\mathbb R}$$ then any function $f:X\to\bar{\mathbb R}$ that equals this limit on $A^{\complement}$ is $\mu$-measurable.
It is not needed here that the $f_n$ are simple and/or take values in $\mathbb R$.


text:
Q: SCRIPT5007: Unable to get property 'cssRules' of undefined or null reference IE8 Issue i have implemented jwplayer 6 into my project and i get an error in IE8 Console
SCRIPT5007: Unable to get property 'cssRules' of undefined or null reference
jwplayer.html5.js, line 9 character 34
Whats cause this issue
Here is the screen shot  and link http://dev.www.infopave.com/Page/Index/PRESENTATIONS
Click on any video link and see the console in IE8,IE9 any help will be highly appriciated.
Thanks
Here is my code
// Get Jwplayer Events and submit to google analytics add by noor03/12/2014

function LoadVideoDynamically(VideoFileName, VideoFileTitle, VideoPageURL) {
jwplayer("mediaplayer").setup({
    file: VideoFileName, //exp //file: 'rtmp://s1nu7pjztotbeg.cloudfront.net/cfx/st/mp4:Help/How_To/GettingStarted_V2-Med_x264.mp4',
    width: "100%",
    height: "545",
    autostart: true,
    events: {
        onComplete: function (event) {
            ga('send', 'event', 'Video Completes', ''+VideoFileName+'', '' + VideoFileTitle + '');
        },
        onReady: function (event) {
            ga('send', 'event', 'Video Plays', '' + VideoFileName + '', '' + VideoFileTitle + '');
        }
    }
});

function setText(id, messageText) {
    document.getElementById(id).innerHTML = messageText;
}

}

A: I was getting this bug too. It appears that there's a jwplayer bug in IE8 that they haven't addressed yet. I didn't look too much into it, but it looks like it's possible IE8 doesn't load stylesheets before JS, making something like document.styleSheets[0].cssRules a null object. The bug seems to go away after a full page load (second iteration through the code), but at that point it's too late.
http://www.longtailvideo.com/support/forums/jw-player/bug-reports/30546/cssrules-error-in-ie8-script5007/
http://www.longtailvideo.com/support/forums/jw-player/bug-reports/35845/ssheetcssrules-is-null-or-not-an-object-error-in-ie8/
Anyway, my quick fix was to prevent the html5 js from loading in IE8:
<!--[if (gt IE 8)|!(IE)]><!-->
  <script src="jwplayer.html5.js" type="text/javascript"></script>
<!--<![endif]-->

IE8 uses the flash version, so it doesn't need this code.

A: Better way is add this two block too:
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!--[if (gt IE 8)|!(IE)]><!-->
<script src="jwplayer.html5.js" type="text/javascript"></script>
<!--<![endif]-->


text:
Q: Is there an R function to convert columns to given types? I'm looking for an R function that would do type conversion conversion for a data frame using the list of desired column types as an argument, i.e. something like
df = data.frame(x="1", y="2")
df2 = convert(df, col.types=c("integer", "character"))

where df2 columns would have the specified types. I played with type_convert function from tidyverse which is close to what I want, but not quite it. For example, it seems to require column names
df2 = type_convert(df, col_types=cols(x=col_integer(),y=col_character())
which I can't provide in advance (it doesn't throw an error without column names, but doesn't do what I want it to do, either). Also, I would like to specify column types as a character vector (like read.csv functions do) and not in the cumbersome way type_convert does it with col_ functions.
My end goal is to extend read.csv functionality by parsing files that aren't rectangular, but consist of rectangular blocks, e.g. something like
2019-10-20 13:09:10
x: 1 S 16
y: 10 25 35 600 final
in a text file should be read into a data frame with columns
t="2019-10-20 13:09:10", x1=1, x2="S", x3=16, y1=10, y2=25, y3=35, y4=600, y5="final"
Column names and types will be given at run time, I just don't want them hardcoded so I'd end up with dozens of distinct R functions, 1 for each distinct format.
If there is code that already does that, please let me know.
Thanks!
Best regards,
  Nikolai

A: There is a simple solution in the package hablar
library(hablar)
library(dplyr)
df <- data.frame(x="1", y="2", z = "4")

df %>%
  convert(int(x, z),
          chr(y))

You can simply put multiple column names to convert multiple columns, e.g. z and z to integer as in the example above.


text:
Q: How to read values from XML String from Web Service my source like this in C#:
string xml = null;
WebRequest req = WebRequest.Create("https://www.freegeoip.net/xml");
req.Credentials = CredentialCache.DefaultCredentials;
WebResponse res = req.GetResponse();
Stream dataStream = res.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
xml = reader.ReadToEnd();
reader.Close();

res.Close();

am getting response like this :
<?xml version="1.0" encoding="UTF-8"?>
    <Response>
        <IP>162.158.50.10</IP> //IP address
        <CountryCode>IN</CountryCode>   //Country Code
        <CountryName>India</CountryName>//Country Name
        <RegionCode>MH</RegionCode> //Region Code
        <RegionName>Maharashtra</RegionName>
        <City>Mumbai</City>
        <ZipCode></ZipCode>
        <TimeZone>Asia/Kolkata</TimeZone>
        <Latitude>18.975</Latitude>
        <Longitude>72.8258</Longitude>
        <MetroCode>0</MetroCode>
    </Response>

/// XMl Reponse END///////////////////////////////
  I want pass parameters to Database like :
 objLogDetails.IPAddress  = ???? //Here i want to pass IP :162.158.50.10 from XMl string

A: HEre are two methods, one using xpath and the other using linq 2 xml:
using System;
using System.Linq;
using System.Xml;
using System.Xml.Linq;

namespace stackexchange
{
    class Program
    {
        private static string theXml = @"<?xml version='1.0' encoding='UTF-8'?>
    <Response>
        <IP>162.158.50.10</IP> //IP address
        <CountryCode>IN</CountryCode>   //Country Code
        <CountryName>India</CountryName>//Country Name
        <RegionCode>MH</RegionCode> //Region Code
        <RegionName>Maharashtra</RegionName>
        <City>Mumbai</City>
        <ZipCode></ZipCode>
        <TimeZone>Asia/Kolkata</TimeZone>
        <Latitude>18.975</Latitude>
        <Longitude>72.8258</Longitude>
        <MetroCode>0</MetroCode>
    </Response>";
        static void Main(string[] args)
        {
            XmlDocument xml = new XmlDocument();
            xml.LoadXml(theXml);
            XmlNode ip = xml.SelectSingleNode("/Response/IP");
            Console.Out.WriteLine($"Ip Address: {ip.InnerText}");

            XElement root = XElement.Parse(theXml);
            XElement address = (from a in root.Descendants() where a.Name == "IP" select a).Single();
            Console.Out.WriteLine($"Ip Address: {address.Value}");
        }
    }
}

A: What you can do here, is use an XElement to get items from the response and insert into your request.
You can do so like this:
//sets the node or remove
     public static void SetOrRemoveNodeValue(XElement root, string xPath, string attributeName, string value)
            {
                XElement currentNode = root.XPathSelectElement(xPath);
                if (currentNode != null)
                {
                    if (currentNode.Attributes().FirstOrDefault(att => att.Name.LocalName.Equals(attributeName)) != null)
                    {
                        if (value == string.Empty)
                        {
                            currentNode.Attribute(attributeName).Remove();
                        }
                        else
                        {
                            currentNode.Attribute(attributeName).Value = value;
                        }
                    }

then use it like this:
 Formatter.SetOrRemoveNodeValue("node", "your value type", "your value");

To extract value from the response, simply use:
currentNode.XPathSelectElement("//Response").Element("Ip").value;

Or simply
currentNode.XPathSelectElement("//Ip").value;

A: Trying This Code ..
private string mStrXMLStk = Application.StartupPath + "\\Path.xml";
private System.Xml.XmlDocument mXDoc = new XmlDocument();
mXDoc.Load(mStrXMLStk);
XmlNode XNode = mXDoc.SelectSingleNode("/Response");
if (XNode != null)
{
   if (XNode != null)
   {
       int IntChildCount = XNode.ChildNodes.Count;
       for (int IntI = 1; IntI <= 1; IntI++)
       {
            string LocalName = XNode.ChildNodes[IntI].LocalName;
            XmlNode Node = mXDoc.SelectSingleNode("/Response/" + LocalName);
            string _ip = Node.InnerText;
            MessageBox.Show("IP" + _ip);
       }
   }
}

Completely worked


text:
Q: if Syntax in pine script I'm new to pinescript and I can't figure out what's wrong with my if syntax. Please help
//@version=4

strategy(title="Weighted Moving ATR", shorttitle="WMATR Stra Test", overlay = true)

//Changing inputs based on ticker
if (syminfo.ticker == "AAPL")
     LenWATR = 43
     MultWATR = 1
else if (syminfo.ticker == "AAL")
     LenWATR = 21
     MultWATR = 1

I keep getting line 13: Mismatched input 'LenWATR' expecting 'end of line without line continuation'.

A: You don't need parenthesis. Also if you are using = in your if statement blocks you are initializing variables in a local scope. If the variables exist elsewhere value assignment should use :=

A: The reason you're getting the error is because the indentation is wrong.
You're indenting with 5 whitespaces, but indententations should be a multiple of 4 whitespaces.
You could also write it like this:
//@version=4
strategy(title="Weighted Moving ATR", shorttitle="WMATR Stra Test", overlay = true)

var int LenWATR  = na
var int MultWATR = na

//Changing inputs based on ticker
LenWATR := if syminfo.ticker == "AAPL"
    43
else if syminfo.ticker == "AAL"
    1
else
    99 // default value

MultWATR := if syminfo.ticker == "AAL"
    1
else if syminfo.ticker == "AAL"
    1
else
    77 // default value

//Changing inputs based on ticker: short version
LenWATR  := syminfo.ticker == "AAPL" ? 43 : syminfo.ticker == "AAL" ? 1 : 99
MultWATR := syminfo.ticker == "AAPL" ?  1 : syminfo.ticker == "AAL" ? 1 : 77

plot(na)


text:
Q: Final charges on Capacitors connected in a curcuit Capacitor C1 is charged to a Potential Difference of 10V.
It's capacitance is 2 microFarad.
Capacitor C2 is charged to a Potential Difference of 15V.
It's capacitance is 4 microFarad.
Now the positive plate of C1 is connected to the positive plate of C2 through a wire. And the same is done for the negative plates. What will be final charge on each capacitor plate ?

I tried a solution, but I got 2 answers. In one the charges on C1 are 80/3 and -80/3 and those on C2 are 160/3 and -160/3 whereas in the other answer, the charges on C1 are -80 and +80 and those on C2 are 160 and -160.
I got two answers because I used a modulus while finding the potential difference. And both these solutions seem probable, except in the second one, the polarity of the capacitor is getting reversed. Can that happen ?
Edit :
Here is what I did. Since the region between the 2 plates of a capacitor is not conducting, no charge gets across this region. Then the total charge in half of the curcuit remains constant and equal to 80.
Now, the potential difference between plates of 1 capacitor is Q/C isn't it ? But in this process Q is the absolute value of the charge on any plate of the capacitor. For this, I had to use V1 = mod(x)/C1, supposing final charge on C1 to be x and its new potential difference to be V1, similarly V2 = mod (80-x)/C2.
And since there is no other component in the curcuit, V1 has to be equal to V2.  Equating the 2 mods, gives 2 solutions.
What mistake am I making ? Also is there any better method to do this question ?

A: There is no need for taking the mod of the charge. The voltage has the same sign as the charge. So if you start out with +20 µC on one capacitor (they give the + sign for a reason - so that's the side where we will put the positive charge) and +60 µC on the other (from $Q=CV$) then it follows that the total of redistributed charge is 80 µC as you correctly stated.  After the capacitors are connected, the voltage on each is the same, so
$$\frac{q_1}{q_2} = \frac{C_2}{C_1}\\
\text{and}\\
q_1 + q_2 = 80 µC$$
The (single, correct) answer then follows.
There is no reason to invoke the modulus - the voltages have to be the same in both magnitude and sign when they are connected.


text:
Q: Categorical Principal Components Analysis I performed a Categorical Principal Components Analysis in ordinal data and I created 3 dimensions. Should I use the component loadings or the object scores, as my new 3 variables?

A: You probably had several ordinal variables, so your objects were described by several traits and you wanted to collapse this long description into few new traits. You succeeded an now your objects are described by 3 new traits.
This description is in object scores. Component loadings tell you how original variables were transformed to new ones.
So you should use object scores (I guess, since you write nothing about what you actualy want to do).

A:

These are my results. It is the first time that I use this technique, so I am quite curious. I can conclude that it is not quite obvious which questions belong to the dimensions 1, 2 and 3.


text:
Q: Why are my elements displacing? I've made a small sample website, and I'm just wondering:
Why are my elements displacing when I resize the window?
Is there a way to stop this?
index.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Clean Layout Demo</title>
<link href="css/cleanLayout.css" rel="stylesheet" type="text/css" />

Famous Quotes

Home | Icons

Famous Quotes

"Be who you are and say what you feel, because those who mind don't matter, and those who matter don't mind."

- Dr. Seuss

"A person who never made a mistake, never tried anything new."

- Albert Einstein

"Shoot for the moon.  Even if you miss, you'll land among the stars."

- Brian Litrell

"Obstacles are things a person sees when he takes his eyes off the goal."

- E. Joseph Cossman

This is the main pages code
and
this is the css:
@charset "utf-8";
@font-face {
    font-family: Clean_Layout;
    src:url(../fonts/GeosansLight.ttf)
}

html {
    background-color: #CCC;
}

#header {
    font-family: Clean_Layout;
    font-size:64px;
    text-align:center;
    color:#333;
    background: #999;
    border:2px solid #666;
    border-radius:16px;
    -moz-border-radius:16px;
    -webkit-border-radius:16px;
    padding-top:22px;
    padding-bottom:0;
    width:600px;
    height:100px;
    margin-bottom:5px;
}

#menu {
    font-family: Arial, Helvetica, sans-serif;
    font-size:13px;
    text-align:center;
    color:#333;
    width:500px;
    background-color:#999;
    border:1px solid #666;
    -moz-border-radius:3px;
    -webkit-border-radius:3px;
    border-radius:3px;
    margin-top:3px;
    margin-bottom:5px;
    padding-top:1px;
padding-bottom:1px;
}

#menu a:link {
    text-decoration:none;
    color:#333;
}

#menu a:visited {
    color:#333;
}

#menu a:hover {
    color:#222;
}

#menu a:active {
    color:black;
}

#content {
    font-family:Clean_Layout;
    font-size:24px;
    color:#333;
    background: #999;
    border:3px solid #666;
    border-radius:16px;
    -moz-border-radius:16px;
    -webkit-border-radius:16px;
    width:825px;
    overflow:auto;
    padding-top:5px;
    padding-bottom:5px;
    padding-left:10px;
    padding-right:10px;
    margin-bottom:50px;
}

hr {
    width:120px;
    color:#666;
}

Hope the code helps

A: Here is a fiddle of the page:
http://jsfiddle.net/jasongennaro/rFESw/
The elements on your page are moving when the page is resized because you have used

to center the page.
But this is what happens when your page is fluid.
If you want the elements to be static you need to give them absolute or fixed positions.
Here's a decent overview of positioning: http://www.alistapart.com/articles/css-positioning-101/


text:
Q: How can I generate vertically oriented subtables and leave a space between them? How can I convert the table into vertically oriented subtables and leave a space between them?
\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage[svgnames]{xcolor}
\usepackage{tabularray}
\definecolor{lightblue}{HTML}{DDEBF7}
\definecolor{white}{HTML}{FFFFFF}
\definecolor{darkblue}{HTML}{2D87D1}

\begin{document}

\end{singlespace}
\arrayrulecolor{colour11}
\strutlongstacks{T}
\begin{singlespace}
\scriptsize
\begin{tabular}{c|>{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm} | >{\centering\arraybackslash}m{0.7cm}}
\caption{Z4 Ttest.}\\
\endfirsthead
\caption{ \textit{(continued)}Z4 Ttest.}\\
\rowcolor{darkblue}
\color{white}{\textbf{Sample}} & \color{white}{\textbf{Ag}} & \color{white}{\textbf{Al}} & \color{white}{\textbf{As}} & \color{white}{\textbf{Ba}} & \color{white}{\textbf{Be}} & \color{white}{\textbf{Bi}} & \color{white}{\textbf{Ca}} & \color{white}{\textbf{Cd}} & \color{white}{\textbf{Ce}}\\
\endhead
\rowcolor{darkblue}
\color{white}{\textbf{Sample}} & \color{white}{\textbf{Ag}} & \color{white}{\textbf{Al}} & \color{white}{\textbf{As}} & \color{white}{\textbf{Ba}} & \color{white}{\textbf{Be}} & \color{white}{\textbf{Bi}} & \color{white}{\textbf{Ca}} & \color{white}{\textbf{Cd}} & \color{white}{\textbf{Ce}}\\
\rowcolor{white}
- & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 \\
\hline
\rowcolor{lightblue}
- & ppm & \% & ppm & ppm & ppm & ppm & \% & ppm & ppm \\
\hline
\rowcolor{white}
{\textbf{FR-1B-003}} & 0.56 & 15.45 & 426 & 280 & 3.55 & 0.28 & 1.72 & 0.22 & 50.4 \\
\hline
\rowcolor{lightblue}
{\textbf{FR-1B-004}} & 0.69 & 13.2 & 158 & 40 & 2.72 & 0.32 & 1.21 & 0.13 & 46.3 \\
\hline
\rowcolor{white}
{\textbf{FR-1B-007}} & 0.05 & 9.61 & 165 & 150 & 3.06 & 0.29 & 0.66 & 0.02 & 76 \\
\hline
\rowcolor{lightblue}
{\textbf{FR-1B-010}} & 0.04 & 8.1 & 63.3 & 930 & 2.27 & 0.29 & 0.92 & 0.07 & 72.7 \\
\hline
\rowcolor{white}
{\textbf{FR-1B-011}} & 0.11 & 15.3 & 209 & 250 & 3.12 & 0.34 & 1.64 & 0.17 & 74.6 \\
\hline
\rowcolor{darkblue}
\color{white}{\textbf{Sample}} & \color{white}{\textbf{Co}} & \color{white}{\textbf{Cr}} & \color{white}{\textbf{Cs}} & \color{white}{\textbf{Cu}} & \color{white}{\textbf{Fe}} & \color{white}{\textbf{Ga}} & \color{white}{\textbf{Ge}} & \color{white}{\textbf{Hf}} & \color{white}{\textbf{In}} \\
\rowcolor{white}
- & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 \\
\hline
\rowcolor{lightblue}
- & ppm & ppm & ppm & ppm & \% & ppm & ppm & ppm & ppm \\
\hline
\rowcolor{white}
{\textbf{FR-1B-003}} & 9.3 & 12 & 67 & 29.9 & 4.13 & 39.9 & 0.11 & 6.6 & 0.09 \\
\hline
\rowcolor{lightblue}
{\textbf{FR-1B-004}} & 12.7 & 24 & 61.5 & 21.7 & 4.21 & 43.4 & 0.12 & 4.2 & 0.064 \\
\hline
\rowcolor{white}
{\textbf{FR-1B-007}} & 17.4 & 26 & 127 & 17 & 5.14 & 26.4 & 0.22 & 3.4 & 0.061 \\
\hline
\rowcolor{lightblue}
{\textbf{FR-1B-010}} & 1.6 & 66 & 78.2 & 5.9 & 1.77 & 21.5 & 0.11 & 5 & 0.073 \\
\hline
\rowcolor{white}
{\textbf{FR-1B-011}} & 2.1 & 54 & 40.5 & 4.5 & 2.82 & 29.8 & 0.13 & 6.2 & 0.082 \\
\hline
\end{tabular}

\end{document}

A: One way is to use \rotatebox{}{} from graphicx. Just put each table in a separate command. In order to keep each caption with a corresponding table, I enclosed the pairs in each minipage. Because now captions are not inside floats, we need \captionof{}{} instead, which is defined in the caption package. If you wish to put the whole construct in a table environment, change \begingroup...\endgroup to \begin{table}...\end{table}.
Note. Your code doesn't compile in the time of writing this. I've got to remove a few bits. You would probably need to add the missing parts again.
I also suggested (in the code) a few of improvements: \newcolumntype, multiple column definition, and a custom macro \cbf. The former lets you define a custom column type and avoid repetition. The latter only saves space and is not so significant; I personally use macros in this kine of situations. The construct *{N}{D} is to define N-number of columns of the same type D. It also safe space and eliminate repetitions.
The example
\documentclass{article}
\usepackage[margin=20mm]{geometry}
\usepackage[avgnames,table]{xcolor}
% \usepackage{tabularray}   % Not used - removed
\usepackage{graphicx}       % Added for rotatebox
\usepackage{array}          % Added for newcolumntype
\usepackage{caption}        % Added for captionof
% \usepackage{setspace}     % Required for \begin{singlespacing}..\end{singlespacing}

\definecolor{lightblue}{HTML}{DDEBF7}
\definecolor{white}{HTML}{FFFFFF}
\definecolor{darkblue}{HTML}{2D87D1}

\arrayrulecolor{darkblue}   % color11 is undefined !!!
\newcolumntype{M}{>{\centering\arraybackslash}m{1cm}}
\newcommand\cbf[2][white]{\textcolor{#1}{\bfseries #2}}

\begin{document}
% \strutlongstacks{T}       % Example doesn't compile with this

\begingroup
    \centering
    \begin{minipage}[t]{0.28\textwidth}
        \centering
        \parbox[t][1.2cm]{\linewidth}{\captionof{table}{Z4 Ttest.}}\par
        \rotatebox{90}{%
            \begin{tabular}{c *{9}{| M}}
                \rowcolor{darkblue}  \cbf{Sample} & \cbf{Ag} & \cbf{Al} & \cbf{As} & \cbf{Ba} & \cbf{Be} & \cbf{Bi} & \cbf{Ca} & \cbf{Cd} & \cbf{Ce} \\
                \rowcolor{white}     - & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 \\
                \hline
                \rowcolor{lightblue} - & ppm & \% & ppm & ppm & ppm & ppm & \% & ppm & ppm \\
                \hline
                \rowcolor{white}     \textbf{FR-1B-003} & 0.56 & 15.45 & 426 & 280 & 3.55 & 0.28 & 1.72 & 0.22 & 50.4 \\
                \hline
                \rowcolor{lightblue} \textbf{FR-1B-004} & 0.69 & 13.2 & 158 & 40 & 2.72 & 0.32 & 1.21 & 0.13 & 46.3 \\
                \hline
                \rowcolor{white}     \textbf{FR-1B-007} & 0.05 & 9.61 & 165 & 150 & 3.06 & 0.29 & 0.66 & 0.02 & 76 \\
                \hline
                \rowcolor{lightblue}
                {\textbf{FR-1B-010}} & 0.04 & 8.1 & 63.3 & 930 & 2.27 & 0.29 & 0.92 & 0.07 & 72.7 \\
                \hline
                \rowcolor{white}     \textbf{FR-1B-011} & 0.11 & 15.3 & 209 & 250 & 3.12 & 0.34 & 1.64 & 0.17 & 74.6 \\
                \hline
            \end{tabular}}
    \end{minipage}
    \begin{minipage}[t]{0.28\textwidth}
        \centering
        \parbox[t][1.2cm]{\linewidth}{\captionof{table}{Z4 Ttest.\\\textit{(continued)}}}\par
        \rotatebox{90}{%
            \begin{tabular}{c *{9}{| M}}
                \rowcolor{darkblue}  \cbf{Sample} & \cbf{Co} & \cbf{Cr} & \cbf{Cs} & \cbf{Cu} & \cbf{Fe} & \cbf{Ga} & \cbf{Ge} & \cbf{Hf} & \cbf{In} \\
                \rowcolor{white}     - & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 & ME-MS61 \\
                \hline
                \rowcolor{lightblue} - & ppm & ppm & ppm & ppm & \% & ppm & ppm & ppm & ppm \\
                \hline
                \rowcolor{white}     \textbf{FR-1B-003} & 9.3 & 12 & 67 & 29.9 & 4.13 & 39.9 & 0.11 & 6.6 & 0.09 \\
                \hline
                \rowcolor{lightblue} \textbf{FR-1B-004} & 12.7 & 24 & 61.5 & 21.7 & 4.21 & 43.4 & 0.12 & 4.2 & 0.064 \\
                \hline
                \rowcolor{white}     \textbf{FR-1B-007} & 17.4 & 26 & 127 & 17 & 5.14 & 26.4 & 0.22 & 3.4 & 0.061 \\
                \hline
                \rowcolor{lightblue} \textbf{FR-1B-010} & 1.6 & 66 & 78.2 & 5.9 & 1.77 & 21.5 & 0.11 & 5 & 0.073 \\
                \hline
                \rowcolor{white}     \textbf{FR-1B-011} & 2.1 & 54 & 40.5 & 4.5 & 2.82 & 29.8 & 0.13 & 6.2 & 0.082 \\
                \hline
            \end{tabular}}
    \end{minipage}
    \par
\endgroup

\end{document}

EDIT. There's also an option to parameterised a new column type
\newcolumntype{M}[1]{>{\centering\arraybackslash}m{#1}}

and use it with an argument
% ...
    \begin{tabular}{c *{9}{| M{1cm}}}
    % ...


text:
Q: Migrate application from Wildfly 8.1 to Wildfly 10.1.0 When deploying my application (perfectly running on Wildly 8.1) to Wildfly 10.1.0 i get the following error:
15:01:34,829 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool --
   83) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./app-admin: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./app-admin: java.lang.RuntimeException: javax.servlet.ServletException: UT010013: Could not instantiate com.enterprise.application.web.listeners.UserListener
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: javax.servlet.ServletException: UT010013: Could not instantiate com.enterprise.application.web.listeners.UserListener
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:236)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
Caused by: javax.servlet.ServletException: UT010013: Could not instantiate com.enterprise.application.web.listeners.UserListener
at io.undertow.servlet.core.ManagedListener.start(ManagedListener.java:50)
at io.undertow.servlet.core.ApplicationListeners.start(ApplicationListeners.java:159)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:175)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:171)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.api.LegacyThreadSetupActionWrapper$1.call(LegacyThreadSetupActionWrapper.java:44)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:234)
... 8 more
Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)
at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)
at org.jboss.as.ee.component.ComponentRegistry$ComponentManagedReferenceFactory.getReference(ComponentRegistry.java:149)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$6.createInstance(UndertowDeploymentInfoService.java:1379)
at io.undertow.servlet.core.ManagedListener.start(ManagedListener.java:48)
... 20 more
Caused by: org.jboss.weld.exceptions.WeldException: WELD-000049: Unable to invoke private void com.enterprise.application.web.listeners.UserListener.initTransactionContent() on com.enterprise.application.web.listeners.UserListener@638ad521
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:100)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.postConstruct(DefaultLifecycleCallbackInvoker.java:81)
at org.jboss.weld.injection.producer.BasicInjectionTarget.postConstruct(BasicInjectionTarget.java:126)
at org.jboss.as.weld.deployment.processors.WeldComponentIntegrationProcessor$3.run(WeldComponentIntegrationProcessor.java:195)
at org.jboss.as.weld.deployment.processors.WeldComponentIntegrationProcessor$AbstractInjectionTargetDelegatingInterceptor.processInvocation(WeldComponentIntegrationProcessor.java:259)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:107)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
... 25 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.jboss.weld.injection.producer.DefaultLifecycleCallbackInvoker.invokeMethods(DefaultLifecycleCallbackInvoker.java:98)
... 49 more
Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.RequestScoped
at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:689)
at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:90)
at org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:83)
at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99)
at org.jboss.weldx.servlet.http.HttpServletRequest$1568423357$Proxy$_$$_WeldClientProxy.getSession(Unknown Source)
at com.enterprise.application.web.listeners.UserListener.initTransactionContent(UserListener.java:43)
... 54 more

I think that I have problems with CDI because the error occur in a @PostConstruct method of class UserListener where CDI injected HttpServletRequest (with @Inject) is used.
Some more details of application:

*

*BOM version used 8.1.0.Final (tried also with 9.0.0.Beta2)


text:
Q: Local declaration of 'imgView' hides instance variable (app crashes) If I debug my app. The app crashes in this line of code and I get this warning:
Warning:
Local declaration of 'imgView' hides instance variable

Line of code:
[brightnessFilter forceProcessingAtSize:imgView.sizeInPixels];

Block of code:
- (IBAction)sliderBrightness:(id)sender {

    UIImage *inputImage = imgView.image;

    sourcePicture = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES];
    brightnessFilter = [[GPUImageBrightnessFilter alloc] init];

    GPUImageView *imgView = (GPUImageView *)self.view;
    [brightnessFilter forceProcessingAtSize:imgView.sizeInPixels];

    [sourcePicture addTarget:brightnessFilter];
    [brightnessFilter addTarget:imgView];

    [sourcePicture processImage];
}

Can someone help me to solve the problem?

A: Andrey gave you the basics. To be very specific.
Here is your current code:
- (IBAction)sliderBrightness:(id)sender {

    UIImage *inputImage = imgView.image; // <--- This line refers to an instance var

    sourcePicture = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES];
    brightnessFilter = [[GPUImageBrightnessFilter alloc] init];

    GPUImageView *imgView = (GPUImageView *)self.view; <--- This line defines a local
    [brightnessFilter forceProcessingAtSize:imgView.sizeInPixels];

    [sourcePicture addTarget:brightnessFilter];
    [brightnessFilter addTarget:imgView];

    [sourcePicture processImage];
}

Look at the to comments I added that start with " <--- This line". The first one marks your reference to an instance variable imgView.
The second comment marks a place where you define a different, local variable with the same name, imgView.
If you intend to use a different local variable, change that name to something else, like
    GPUImageView *theGPUimgView = (GPUImageView *)self.view;

If you intend to change the instance variable, then make it an assignment, and get rid of the variable declaration:
   imgView = (GPUImageView *)self.view;

I'm guessing that you want the second case, where you change the contents of the instance variable, but I'm not sure. It's your code.

A: Replace this code:
GPUImageView *imgView = (GPUImageView *)self.view;
[brightnessFilter forceProcessingAtSize:imgView.sizeInPixels];

[sourcePicture addTarget:brightnessFilter];
[brightnessFilter addTarget:imgView];

with this code:
GPUImageView *imgView2 = (GPUImageView *)self.view;
[brightnessFilter forceProcessingAtSize:imgView2.sizeInPixels];

[sourcePicture addTarget:brightnessFilter];
[brightnessFilter addTarget:imgView2];

You have 2 variables with the name imgView which is giving you the warning, but there is no reason for this to cause the crash. The crash is because of some other reason which is outside of the code you have provided.

A: You have declared two variables(Local and Instance) with name imgView.Change the local variable instance of GPUImageView from imgView to some other name say gpuimgView
- (IBAction)sliderBrightness:(id)sender {

    UIImage *inputImage = imgView.image;

    sourcePicture = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES];
    brightnessFilter = [[GPUImageBrightnessFilter alloc] init];

    GPUImageView *gpuimgView = (GPUImageView *)self.view;//changed to gpuimgView
    [brightnessFilter forceProcessingAtSize:gpuimgView.sizeInPixels];

    [sourcePicture addTarget:brightnessFilter];
    [brightnessFilter addTarget:gpuimgView];

    [sourcePicture processImage];
}

Hope it will helps you....