Use multiple Slick slideshows on one page

Question: I am a beginner in web development, as part of my end-of-year project I have to create a website.
Here is my problem:
On my home page I have 3 sliders that I made with Slick, which are exactly the same. When I only put one in, it works well. But as soon as I duplicate them to have my 3 sliders, the sliders and the arrows no longer work or work but on another slider.
So my question is how can I use my 3 sliders individually?
Here is my HTML

Activités aquatiques

Jet-ski

                        Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore labore ipsa perspiciatis inventore eos, ex laborum quis, veniam repellat nobis voluptatibus consequuntur modi nam debitis?
                        Necessitatibus, ea voluptate?

Jet-ski

                        Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore labore ipsa perspiciatis inventore eos, ex laborum quis, veniam repellat nobis voluptatibus consequuntur modi nam debitis?
                        Necessitatibus, ea voluptate?

Jet-ski

                        Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore labore ipsa perspiciatis inventore eos, ex laborum quis, veniam repellat nobis voluptatibus consequuntur modi nam debitis?
                        Necessitatibus, ea voluptate?

Jet-ski

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore

Jet-ski

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore

Activités aquatiques

Jet-ski

                        Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore labore ipsa perspiciatis inventore eos, ex laborum quis, veniam repellat nobis voluptatibus consequuntur modi nam debitis?
                        Necessitatibus, ea voluptate?

Jet-ski

                        Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore labore ipsa perspiciatis inventore eos, ex laborum quis, veniam repellat nobis voluptatibus consequuntur modi nam debitis?
                        Necessitatibus, ea voluptate?

Jet-ski

                        Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore labore ipsa perspiciatis inventore eos, ex laborum quis, veniam repellat nobis voluptatibus consequuntur modi nam debitis?
                        Necessitatibus, ea voluptate?

Jet-ski

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore

Jet-ski

Lorem ipsum dolor sit amet consectetur, adipisicing elit. Molestias, officiis dolore

Here is my JS :
$('.post-wrapper').slick({
    slidesToShow: 3,
    slidesToScroll: 1,
    autoplay: false,
    nextArrow: $('.next'),
    prevArrow: $('.prev'),
});

Thank you.
Comment: Does this answer your question? [Multiple Slick Sliders Issue](https://stackoverflow.com/questions/35618158/multiple-slick-sliders-issue)
Comment: did you check this? https://github.com/kenwheeler/slick/issues/1341
Answer: This should work:
Replace the class selector .post-wrapper by ids:
$('#slideshow1').slick({...});
$('#slideshow2').slick({...});
$('#slideshow3').slick({...});

Notice that you need to call a separate slick for each slide show. (Now you could even set different slick options for each of them, yey!)
Do not forget to assign those ids:

 ...

 ...

 ...

Best wishes for you web developing :-)
Comment: Oh I'm sorry i'm new here.

I change the id on .post-wrapper, now i have my 3 slides, but when i click on the arrows of the 1st, 2nd and 3rd sliders it only works on the 3rd slider.
Comment: Look, the slick developer has dozens of slides on a single page: https://kenwheeler.github.io/slick/ I suggest you check his HTML and JS source code to find differences between yours and his.
Comment: Is your page publicly accessible? Then feel free to share the URL :-)
Answer: I've find the issue.
I had to change the .next and .prev classes on the  and put different names on each slider and do the same in js.
$('#slideshow1').slick({
    slidesToShow: 3,
    slidesToScroll: 1,
    autoplay: false,
    nextArrow: $('.next1'),
    prevArrow: $('.prev1'),
  });

  $('#slideshow2').slick({
    slidesToShow: 3,
    slidesToScroll: 1,
    autoplay: false,
    nextArrow: $('.next2'),
    prevArrow: $('.prev2'),
  });

  $('#slideshow3').slick({
    slidesToShow: 3,
    slidesToScroll: 1,
    autoplay: false,
    nextArrow: $('.next3'),
    prevArrow: $('.prev3'),
  });

});


Exposed view filtering on a related node's value

Question: I have a view with a list of nodes. Each node has a number of related nodes which I want to display below the parent node. This works fine.
However, when I go to filter the listing on values in one of the related nodes, then an empty set is returned.
I'm guessing it's trying to filter the parent nodes on this value, and not the related nodes. How can I remedy this?
Comment: I think I've just answered my own question. By checking 'Require this relationship' this solves the problem (I think).
Comment: http://stackoverflow.com/questions/11025797/drupal-7-using-views-relationships-with-filters
Comment: :-) I think the recommended practice would be answer your own question so it does not appear in list of unanswered questions, just like I did here - http://drupal.stackexchange.com/questions/34274/unexpected-session-reset-when-making-authenticated-user-rest-requests-using-serv/34411#34411
Answer: When adding a new relationship, ensure that you select 'Require this relationship'. Also, when adding a filter, ensure that you select the relevant relationship from the list where necessary.


Importar projeto github no STS (Spring)

Question: Estou com dificuldades em importar um projeto com spring do github,sendo que consigo importar o projeto com exito quando é no eclipse oxygen na perspectiva java(Desktop).

Procedimento utilizado de importação  :

Vou na pasta do meu sts que estão meus projetos
Uso o comando init
Uso o comando remote add origin servidor(Sincronizar meu git com o github)
Uso o comando clone(pra baixar meu projeto do github)
Import->General->Existing Projects in worckspace->Select root
directory
Vou na pasta aonde clonei o projeto
ERRO

No projects are found to import

Projeto que gostaria de baixar
Comment: quais a configurações do projeto? ele é um projeto eclipse? é um projeto maven? gradle?
Comment: Eu consegui resolver tinha me esquecido de fechar a pergunta,tinha que importar como maven
Answer: Não estava importanto ,pois é um projeto Maven ou seja tem que importar como Maven
->Existing Maven Projects
Comment: Valeu Felipe!!!

Importar projeto github no STS (Spring)


Prove that a certain series grows as $O(\log n)$

Question: The problem below is an exercise that came up during self-study. I cannot even easily convince myself of its truth.
Problem: There is a sequence of reals $1 = a_1 \leq a_2 \leq \ldots \leq a_n$ satisfying $a_{i+1}-a_i \leq \sqrt{a_i}$ for all $1 \leq i < n$. Prove that $$\sum_{i=1}^{n-1} \frac{a_{i+1}-a_i}{a_i} \leq O(\log n).$$
As a first step, letting $f(n)$ denote the LHS in the desired inequality, we can write $$f(n) = \sum_{i=1}^{n-1} \frac{1}{\sqrt{a_i}}.$$ My next thought is to show that this is less than a series that we know grows as $O(\log n)$, maybe the harmonic series, but I am stuck at this point.
Comment: Welcome to MSE. Please edit the question text to show what you've tried so far, and especially anything you had difficulty with, and possibly also provide other context such as where the question comes from. Thanks.
Comment: Is the sequence infinite or finite? Asymptotic analysis of this sort usually only makes sense if we are allowed to take $n \to \infty$, but here it seems $n$ is fixed.
Comment: Yes, it is implicit that we take $n \to \infty$. Sorry for the informal statement, I tried to copy the problem here without much modification.
Answer: Note that $$a_{k+1} \le a_k+\sqrt{a_k} < a_k + \sqrt{a_k}+\tfrac{1}{4} = \left(\sqrt{a_k}+\tfrac{1}{2}\right)^2,$$ i.e. $\sqrt{a_{k+1}} < \sqrt{a_k}+\tfrac{1}{2}$ for all $k$. Hence, we can use induction to show that $\sqrt{a_n} \le \tfrac{n+1}{2}$ for all $n$.
Then for all $n$, we have:
\begin{align*}
\sum_{k = 1}^{n-1}\dfrac{a_{k+1}-a_k}{a_k} &\le \sum_{k = 1}^{n-1}\dfrac{a_{k+1}-a_k}{\left(\sqrt{a_{k+1}}-\tfrac{1}{2}\right)^2} & \text{since} \ \sqrt{a_{k+1}} < \sqrt{a_k}+\tfrac{1}{2}
\\
&= \sum_{k = 1}^{n-1}\int_{a_k}^{a_{k+1}}\dfrac{1}{\left(\sqrt{a_{k+1}}-\tfrac{1}{2}\right)^2}\,dx
\\
&\le \sum_{k = 1}^{n-1}\int_{a_k}^{a_{k+1}}\dfrac{1}{\left(\sqrt{x}-\tfrac{1}{2}\right)^2}\,dx & \text{since} \ \dfrac{1}{(\sqrt{x}-\tfrac{1}{2})^2} \ \text{is decreasing}
\\
&= \int_{1}^{a_n}\dfrac{1}{\left(\sqrt{x}-\tfrac{1}{2}\right)^2}\,dx
\\
&= \left[2\log\left(2\sqrt{x}-1\right) - \dfrac{2}{2\sqrt{x}-1}\right]_{1}^{a_n}
\\
&= 2\log\left(2\sqrt{a_n}-1\right) - \dfrac{2}{2\sqrt{a_n}-1} + 2
\\
&\le 2\log\left(2\sqrt{a_n}-1\right)+2
\\
&\le 2 \log n + 2. & \text{since} \ \sqrt{a_n} \le \tfrac{n+1}{2}
\end{align*}
Therefore, $\displaystyle\sum_{k = 1}^{n-1}\dfrac{a_{k+1}-a_k}{a_k} = O(\log n)$ as desired.
Comment: Thank you. Could you also briefly explain the thought process that lead you to the initial steps? I can see how it falls into place once you write the inequality using $\sqrt{a_{k+1}} < \sqrt{a_k} + \frac{1}{2}$, but I find it difficult to think of trying your initial steps.
Comment: I was playing around with writing the sum as a Riemann sum for some integral (a technique which I've used on many similar problems), and eventually got to a point where I needed an upper bound on $a_n$. If we had $a_{k+1} = a_k+\sqrt{a_k}$ for all $k$ (instead of $\le$), then you can play around with it to see that $a_k$ grows quadratically, which sort of motivates finding a quadratic upper bound for $a_k$.
Comment: I see, thank you very much.


'install' of pip failed at Pycharm, but worked at Jupyternotebook. Why?

Question: I'm only super beginner using Python. And I'm looking for help.
My objective is to install 'selenium' through Pycharm.
I've tried this method:
pip install selenium

My Pycharm was able to recognize 'pip' but not 'install'.
I've tried several methods to solve this.

Using Python3.9 interpreter (failed)
Using Conda interpreter (failed)
re-installing pip (failed)
installing selenium @ Jupyternotebook (worked)
directly adding the package through Pycharm Interpreter settings (worked)

I some how figured it out through the two methods below, but I would like to make *'pip'*  working on my Pycharm. And I think this is the problem of **path setting**, because *'pip install'* worked at Jupyternotebook. Does anybody have solution to this situation?
.

Operating System : MacOS

Conda Path : /Users/****/opt/anaconda3/envs/pythonProject/bin/python

Python Path : /usr/local/bin/python3.9
Comment: Welcome to Stack Overflow. What do you mean by "failed"? What do you mean by "recognize"? Please show us exactly how you try these installations, and [exactly](https://meta.stackoverflow.com/questions/359146) what happens when you try them.
Comment: use `python -m pip install selenium`
Answer: You have multiple pythons installed, one that is being used in the jupyter-notebook kernel, one in pycharm, and one in the conda environment. You could install pip for all these pythons.
You can check you pycharm python interpreter in pycharm settings by following: PyCharm | Preferences | Project | Python Interpreter. And you can also set PyCharm to use the python that jupyter-notebook is using. jupyter-notebook kernels can be viewed via: jupyter kernelspec list


Drill-down contextual filtering

Question: I've created a view called "Upcoming Events" that presents upcoming events in chronological order at the url /upcoming-events/all. Each event has associated tags. Currently my contextual filter is set so that replacing all in the url with a valid tag will present just events with that tag. Tags are set up as links with the url /upcoming-events/[field_tags].
My question is two-fold. How do I set up the contextual filter so that adding more tags on the end of the url (/upcoming-events/happy-hours/drupal/ for example) will further narrow the results presented to the user? Also, how do I set up the tag links to append the field tag to the end of the url rather than replace it?
Answer: If you click on More link under the contextual filter settings, there is an option to allow multiple values.
Enabling this option, you can use URLs like /upcoming-events/happy-hours,drupal to show events having both happy-hours and drupal tags.

Drill-down contextual filtering


SQL Server stored procedure passing parameters into variables

Question: I have a big query which works and I want to write a stored procedure for it.
I'm getting this error:

the OLE DB provider SQLNCLI11" for linked server "theServer" does not contain the table ""@dbName"."dbo"."tableName"

What I am trying to do:
create PROCEDURE [sys.sp_myProcedure]
(
 @dbName varchar(30) output,
 @rid varchar (10) output,
 @mdate output
 )
AS
BEGIN
declare @prt varchar(12)
declare @pid int
declare @cid int
--declare @rid int
declare @aid int

    SET NOCOUNT ON;
set @cid= (select CID from  theServer.[@dbName].dbo.tableName where RID= @rid)
set @pid= (select PID from  theServer.[@dbName].dbo.tableName where RID= @rid)
set @aid= (select aid from  theServer.[@dbName].dbo.tableName where RID= @rid)
--then my query begins

theServer.[@dbName].dbo.tablename is a linked server.
What I want to do is:
execute [sys.sp_myProcedure] 'someDbname', '123', '2012-03-03'

and the parameters passed here would set/update the variables @dbName, @rid, @mdate  at runtime. ( @mdate I have it further away in the query, it's too big to adapt it with myTable and to change all the sensitive data).
How can I do this ?? (using SQL Server 2012)
edit (based on the comments and answers):
so, it's @thatString = '--insert the query here ' . Then, in my case how can i set those variables according to the parameters inside the query? Should i do it with replace? like this: set @thatString= replace(@thatString, dbName, @dbname) ?
**
edit 2
**
set @sql = '
use [someDbName];
use [123];
use [2012-03-03];

select ... '
set @sql = replace (@sql, 'someDbName', @dbName)
set @sql = replace (@sql, '123', @rid)
set @sql = replace (@sql, '2012-03-03', @mdate)
execute @sql
end

Did i get it right? is the execute @sql in the right place?
I'm asking cause it doesnt work. i'm getting the name ' --part of my query here' is not a valid identifier
Comment: You can't parameterize *names* in T-SQL. You'll have to construct the whole thing as a large string and pass it to `EXEC` (a.k.a. dynamic SQL)
Comment: Side note: you should **not** use the `sp_` prefix for your stored procedures. Microsoft has [reserved that prefix for its own use (see *Naming Stored Procedures*)](http://msdn.microsoft.com/en-us/library/ms190669%28v=sql.105%29.aspx), and you do run the risk of a name clash sometime in the future. [It's also bad for your stored procedure performance](http://www.sqlperformance.com/2012/10/t-sql-queries/sp_prefix). It's best to just simply avoid `sp_` and use something else as a prefix - or no prefix at all!
Comment: I see, please see my edit and tell me if I got the idea
Comment: oh, didnt know that. thanks
Answer: Names of databases or other objects cannot be specified dynamically from variables. The workaround is to compose a dynamic SQL query in a string, into which you concatenate the required names, and then execute (@thatString).
(You might think you can employ use, but it is scoped such that you would have to include the rest of your query within the same executed string.)
--
Edit with more info as requested. You can compose the string however you like. If you need any more guidance, there are plenty of pages that discuss dynamic T-SQL. But hey, two ideas:
set @myDynamicQuery =
'
    use [' + @myDynamicDatabase + '];

    select BLAH from WHOM where DATA = ''what'';
';

or if you will be using the name a lot, you could reduce the hassle caused by breaking in and out of single quotes as follows - though I personally never use this as I don't like how it looks:
set @myDynamicQuery =
'
    use [A_RARE_PLACEHOLDER];

    select BLAH from WHOM where DATA = ''what'';

    -- lots more uses of A_RARE_PLACEHOLDER
';

set @myDynamicQuery = replace(
    @myDynamicQuery,
    'A_RARE_PLACEHOLDER',
    @myDynamicDatabase
);

Then execute (@myDynamicQuery);
Comment: you are right, you answered my question, hence the accept. I solved the problem related to the syntax. now i have a temporary table space allocation problem. But as you said, that's another question
Comment: thanks for this, but i'm new to this. Just to make sure: am i declaring @myDynamicDatabase in the stored procedure declaration? Also can i use this 3 times (cause i have 3 parameters?) like this: `use [' + @dbName + '];`
then `use [' + @rid+ '];` 'use [' + @mDate+ '];`
Comment: Have you actually tried any of this? If so, please follow the IT standard: What have you tried? What did you expect to happen? What happened instead? Also, it's odd that you removed your accept vote, since I did answer the question you originally asked. If - after actually trying the code - you have different questions, they should be asked separately; I'm not an expert on SO, but I think continually moving the goalposts of an existing question is poor etiquette.


How to get the values on the other form

Question: I would like to save the form field values by using mymodule_admin(). How can I get the values saved in mymodule_admin() on the other form without using the database?
function subscription_admin() {
  $form = array();
  $form['txtSubscription'] = array(
        '#type' => 'textfield',
        '#title' => t('Enter The Subscription Amount'),
        '#default_value' => variable_get('txtSubscription', '500'),
        '#size' => 20,
        '#maxlength' => 20,
        '#description' => t('This text field tells the subscription generation amount'),
        '#required' => TRUE,
  );
return system_settings_form($form);
}

This is the admin view form. If the administrator user changes the value, it would be changed.
Comment: As per my understanding you have retrieve the value which is entered in subscription_admin() correct?
Comment: yeah!! you are right !!
Comment: use the below answer is correct by using variable_get
Answer: mymodule_admin() is not the function that does the trick saving your variables. It's system_settings_form().
You can retrieve variables saved by system_settings_form() using variable_get() function.
So, in your case, you can get the value like this:
$txtSubscription = variable_get('txtSubscription', '');

Second parameter of the variable_get function will be returned if the variable is not set (not necessarily empty).
Notice that we used the same key as your form array's key.
During the Drupal bootrap, all variables are loaded to $GLOBALS (Thanks to kiamlaluno for the correction). Do not use this to store all your data because all of these variables will be loaded on every bootstrap.

How to get the values on the other form


Find $x$ if $AD=CB$. Justify geometrically.

Question:
I need help with this geometry question. Find $x$ if $AD=CB$. Justify geometrically.
I tried plotting it on GeoGebra and found that $x=30\unicode{176}$ but I don't know how to prove it, I also tried with a system of linear equations but it has no solution:
$\begin{cases}70\unicode{176}+x_2+x_3=180\unicode{176}\\[5pt]
70\unicode{176}+x_1+40\unicode{176}+x_2=180\unicode{176}\\[5pt]
40\unicode{176}+x_1+\left(180\unicode{176}-x_3\right)=180\unicode{176}\end{cases}$
I also tried drawing the heights of the $2$ triangles to get right triangles but I end up with more unknowns.
Thanks in advance.
Comment: @Narasimham, I'm reminded of a description I once heard. Something along the lines of: "Geometry is the science of drawing correct conclusions from terribly incorrect drawings."
Comment: @OP, it's not a big issue but the points are mislabelled. I believe this has confused many people. It is best if you fix it
Comment: AD, BC  lengths are not equal in the given sketches.
Answer: Pick $D'$ on $AC$ such that $CD'=CB$. Then triangle $CBD'$ is isosceles with a top angle of $40^\circ$. The remaining two angles are $70^\circ$.
Now take a look at points $D,D'$. By hypothesis $AD=CD'$ so $D,D'$ are symmetric with respect to the midpoint of $AC$.
Moreover, $BD, BD'$ are also symmetric with respect to the bisector of the angle $\angle ABC$ since $\angle ABD = \angle D'BC = 70^\circ$.
This is only possible if the triangle $ABC$ is isosceles and $AB=BC$. This gives $\angle B = 100^\circ$ and $\angle DBC = 30^\circ$.

To conclude that the triangle is isosceles do the following

consider a triangle $AD'B'$, translating the triangle $DCB$ until $AD'$ and $DC$ overlap.

then $\angle ABD'= \angle AB'D'$, showing that $A,D',B,B'$ are on the same circle

by construction $BB'||AC$, thus  $A,D',B,B'$ are the vertices of an isosceles trapeze. The non-parallel edges and diagonals are equal, implying that the triangle $ABC$ is isosceles also.
Comment: @CalvinLin I think the intended meaning was: $BD$ and $BD'$ are symmetric wrt the bisector of angle $ABC$. Then the solution seems to work, but the conclusion that $ABC$ is isosceles if far from trivial and, in my opinion, requires some explanation.
Comment: @timon92: I added some explanation. I wouldn't say that the conclusion is "far from trivial". In any case where both symmetry with respect to a midpoint and the corresponding angle bisector is present, the only option is to have complete symmetry.
Comment: @CalvinLin: I meant that the lines $BD, BD'$ are symmetric with respect to the angle bisector.
Comment: @BeniBogosel Thanks for more detailed explanation. Could you please clarify why $AA'=CC'$?
Comment: @timon92: Sorry... I don't know what I was thinking. The previous argument had an error. I updated it with, hopefully, a correct one.
Comment: Now it looks correct. Nice proof!
Comment: Ah, you completed the proof in a much different manner than I expected, and I agree that it is correct. $\quad$ I had a short one-line argument assuming that you meant the points $D, D'$ were symmetric about the angle bisector, which was how I thought you were arguing. $\quad$ With this proof, the limiting case of $ x = 0 ^\circ$ also results in $A = D'$ so $ ABB'$ is just a triangle, and we can draw no conclusions about the side lengths.
Answer: If you're familiar with sine rule, then apply it to $BDC$ and $BDA$ to get
$$\frac{BC}{\sin 40^\circ + x }  = \frac{BD}{\sin 40^\circ}, \frac{AD}{\sin 70^\circ} = \frac{BD}{\sin 70^\circ - x}.$$
Since $BC = AD$, hence
$$ \frac{\sin 40^\circ + x } {\sin 40^\circ} = \frac{BC}{BD} = \frac{AD}{BD} = \frac {\sin 70^\circ} {\sin 70^\circ - x}.$$
Thus (with a bit of work), $x = 0^\circ, 30^\circ$.
Note: It is arguable if $ x = 0^\circ$ is a valid solution, as one may argue that the diagram indicates $  0^\circ < x < 110^\circ $. However, it bears to bote that for $x = 0^\circ$, we do have $BC = AD$.
Answer: Let $X$ be the circumcenter of $ABD$. Since $\angle ABD = 70^\circ$, we have $\angle XDA = 90^\circ - \angle ABD = 20^\circ$.
Let $Y$ be so that $XDCY$ is a parallelogram. Note that $ACYX$ is an isosceles trapezoid because $AC\parallel XY$ and $AX=DX=CY$. Also note that $\angle YCD =\angle XDA = 20^\circ$, hence
$$\angle BCY = \angle BCD - \angle YCD = 40^\circ - 20^\circ = 20^\circ.$$
We are given $BC=AD$. Hence by SAS the triangles $XDA$, $YCB$ are congruent. In particular $YB=XA=XB$.
Since $ACYX$ is an isosceles trapezoid, the segments $AC$, $YX$ have the same perpendicular bisector, call it $\ell$. Since $BX=BY$, the point $B$ lies on $\ell$. Hence the whole figure is symmetric. In particular $\angle CAB = \angle BCA = 40^\circ$, hence $\angle ABC = 100^\circ$ and $\angle DBC = 30^\circ$.
Comment: Nice solution!!
Comment: Ahhhh... K, adding that in would be helpful the symmetry. I was looking into how we can prove $AB = BC$ to get symmetry, but you were using symmetry to conclude that $AB = BC$.
Answer: $$ AD=BC=1;$$
Mark angles by angle chasing ( angle sum 180 and external angle sum equals sum of two internal angles )
$$AP+PD= h \cot (70 -x)+h \cot (40 + x)=1,~h / BC=  1. \sin (40) $$
Solving numerically we directly get
$$ x=30, h\approx 0.643788;$$
This can be also put down by inspection or by careful trial & error.

EDIT1;
Next, the numerical solution  $DBC'=x=180$ deg (continuation of BD) also supplies a second solution. The second possible construction satisfying same geometry is sketched below superimposed with the first one.
It is noted in conclusion that
$$ BA = BC= BC'=AD.$$


Three level mixed-effects (crossed and nested) model in stata

Question: I am trying to fit a 3 level random and crossed effects model to a continuous outcome to estimate the respective variance components of each level of the 3  (for doctors)

Level 3: Physicians ID
Level 2: Patient's ID
Level 1: stage ( 1 and 2)

For this study, each doctors have predicted the mortality rate for all the patients in two times. Thus clinician and patient is crossed effect and patient and stage is nested ( I think).
I presumed that Physicians id is crossed with patient and patient is nested with stage.
I tried the crossed random effects model for this data
Model1:
xtmixed  mortality_est || doctorsid:R. patient|| doctorsid:R.stage

Model2:
xtmixed  mortality_est || doctorsid:R. patient|| doctorsid:R. stage|| patient:

xtmixed  mortality_est ||stage:||doctorsid:R.patient||z:, variance

but did not converge
Any suggestion will be very appreciated.
Comment: What is the size and structure of your data?
Comment: There are nine doctors and 9 patients. Each doctor see each patient and predicted the mortality rate.This is repeated measures at 2 times (stage 1 and stage2). Thus crossed effect for doctors and patient and nested effect for patients and stage(not sure). Any advice would be much appreciated.
Answer: It is difficult to expect that you can fit a nice normal distribution to 9 points, and that's what you are trying to achieve with the doctors and patients. Now, fitting a normal distribution with 2 points for stage is just impossible. I think Stata may not even be able to identify the variance parameter for stage here. You have to model that as a fixed effect. I would go as far as to say that you would want to treat everything as fixed effects, and just run
anova mortality_est doctorsid patient stage

To me, is an example where the complicated model is unnecessary (the perfect is the enemy of the good), and whoever is forcing you to fit the multilevel model to this data must be pretty evil (reviewer, adviser, instructor...).
If your ultimate goal is some sort of doctors' ICC or interrater agreement something, then I could see the point of the exercise, but again with just 9 observations, your variance component estimate will be woefully unstable, and effectively your CI for the ICC would look like (-0.1,0.8) or something like that. In the best case scenario of homoskedastic normal data, it is a (scaled) chi-square with 7 degrees of freedom (I think), so it has a mean of 7, a variance of 14, a standard deviation of 3.74, skewness of 1.07, and an excess kurtosis of 1.71; few statisticians would be happy to bet their publications on a $\chi^2_7$. In the worst case with doctor-patient interactions and heteroskedasticity, you may end up with something closer to chi-square with 1 or 2 d.f., and that isn't something you can really work with as a variance estimate.
Comment: Thank you very much StasK. Finally I ended up the anova cammand and completed the analysis.


How to specialize scatter plots in r?

Question: First of all when I tried to draw regression line, an error occured.
I have two datas to compare;
dismax<-list(1.14, 2.281, 2.825, 2.965)
normax<-list(1.8, 2, 2.4, 2.6)

With the code below, I've plotted scatter diagram.
plot(normax, dismax, main="Minute Max.",
       xlab="Historical Values ", ylab="Disaggregated Values", pch=19)

Then I tried to draw regression line with this code;
abline(lm(normax~dismax), col="red")

And the error occured;

Error in model.frame.default(formula = normax ~ dismax,
  drop.unused.levels = TRUE) :    invalid type (list) for variable
  'normax'

How can I solve this?

And second question;
As you will see X axis is ending with 2.6, and Y axis is ending with 3.0
But I want both axes to end with same number. For ex. if the max. value in lists (dismax, normax) is 3, then I want to see "3" for both axes. In other words, my diagram should be square.
Answer: First,  lm is looking for vectors,  not lists so start with
dismax<-c(1.14, 2.281, 2.825, 2.965)
normax<-c(1.8, 2, 2.4, 2.6)

To get the axis labels you want try asp=1
plot(normax, dismax, main="Minute Max.", asp=1,
       xlab="Historical Values ", ylab="Disaggregated Values", pch=19)
abline(lm(normax~dismax), col="red")

Comment: This worked, but when I tried with another data, axis labels are getting different. For ex. dismax<-c(0.435, 0.854, 1.214, 2.298) normax<-c(1.7, 3.3, 3.3, 5.2) with these data.

How to specialize scatter plots in r?


How to convert DateTime to Timestamp before saving in Firestore in Flutter?

Question: I picked a "date" form datePicker and wanted to save that date (type as DateTime) to Firestore in Timestamp type.
I used Firestore.fromDate(date) but it stores data in Firestore as a map(nanoseconds, seconds).
Comment: `DateTime.now().millisecondsSinceEpoch` to store date in int then u can decode it while using https://api.dart.dev/stable/2.8.2/dart-core/DateTime/millisecondsSinceEpoch.html
Comment: @GJJ2019 Thanks for your help but if there is any way to store date in timestamp, that will be better because the code that our team wrote for react native app is too big now to change data type.
Answer: Use the Firebase Timestamp class as:
Timestamp.fromMicrosecondsSinceEpoch(myDateTime.microsecondsSinceEpoch)

There are many other constructors, take a look at the docs.


1 channel input to VGG16 instead of 3 channel input

Question: More of a novice question though, I am using VGG16 as feature extractor. I have used 3 channel images as input. Now I want to use 1 channel images as input. As VGG-16 is trained on 3 channel images, can I use 1 channel images as input?
Answer: Okay I get to an answer.
First of all, VGG16 requires 3 channel input and then minimum size of an image should be 32×32.
So, if you have 1 channel input convert hem to 3 channel as below:
<code>#let' convert images to 3 channels
X_train=np.dstack([X_train] * 3)
X_val =np.dstack([X_val ]*3)
test_images =np.dstack([test_images]*3)

X_train = X_train.reshape(-1, 28,28,3)
X_val= X_val.reshape (-1,28,28,3)
test_images= test_images.reshape (-1,28,28,3)

X_train.shape, X_val.shape, test_images.shape
</code>
Then convert the image shape more than 32×32. I did for 48×48:
<code># Resize the images 48*48 as required by VGG16

from keras.preprocessing.image import img_to_array, array_to_img

X_train = np.asarray([img_to_array(array_to_img(im, scale=False).resize((48,48))) for im in X_train])
X_val = np.asarray([img_to_array(array_to_img(im, scale=False).resize((48,48))) for im in X_val])
test_images = np.asarray([img_to_array(array_to_img(im, scale=False).resize((48,48))) for im in test_images])
#train_x = preprocess_input(x)
X_train.shape, X_val.shape, test_images.shape
</code>


What is Object Scope in Oop?

Question: Hi I read this definition on internet..

A destructor is a special member function of a class that is executed
  whenever an object of it's class goes out of scope or whenever the
  delete expression is applied to a pointer to the object of that class.

I tried this code..
#include <iostream>
using namespace std;
class Name{
    public:
        void Fun(){
            cout << "Function" << endl;
        }
        Name(){
            cout << "Constructor" << endl;
        }
        ~Name(){
            cout << "Destructor" << endl;
        }
};
int main(){
    Name obj;
    obj.Fun();
    cout << "End" << endl;
    return 0;
}

It's calling destructor at the end of program..!! Mean object scope is the end of program? Sorry I'm little confused...
Comment: It's the end of the `main()` function, when the local object `obj` goes out of scope.
In your case, `main()` is also the end of the program, but that's not the normal case.
Comment: You mean obj scope is main body? same as local variable?
Comment: It IS local variable. In this case - yes, the scope is `main()` body.
Answer: In your case the end of the scope of obj is at the end of the main function, but it could be any other scope depending on where you define obj. Example:
int main(){
    // open a new scope here
    {
        // now 'obj' will be in the new scope
        Name obj;
        obj.Fun();
    }
    // the scope ended here, 'obj' destroyed now
    cout << "End" << endl;
    return 0;
}

You can find more information here, look at "Basic concepts" for "Scope" and "Lifetime".
Comment: Good Example..!! Nice one..!! Thumbs up.. :)
Answer: Scope is a region in program that defines life time of objects defined within it. In nearly all cases it is defined by curly brackets. So when you have definition of function it's body defines a scope.
main is no special in any way in regard to definition of scope.
Some more cases:
int fun(){ // one scope

  for(int i = 0; i < 1337; ++i){ // another scope
    //note that i is defined within `for` scope not outside
  }

  if(true){ // same here
  }

  { // you can even start and end scope at will
     A a;
  } // a will die here

  { // sometimes it is useful for redeclaring a variable, probably not best practice
     A a; // this is legal
  }
}

Answer: The object obj that you have created is a variable and as any variable it has scope. Scope is defined by curly brackets in which variable was created. In your case the scope of obj that you created is main function, because it is placed between curly brackets of that function. And when main function ends, your object is not available anymore (it is available only within that function) and that is why destructor is called.
You can also define scope of your own by just putting your object into curly brackets like that:
main(){
    cout<<"scope of the main function"<<endl;

    {
        cout <<"scope where obj created"<<endl;
        Name obj;
    }
    cout << "obj destroyed"<<endl;

    cout << "End of main" <<endl;
}

Answer: In your case its C# program, In the case of object ends it availability after the program ends i.e. after the main is executed the object finds its destructor if it's not available by programmer then its system generated destructor will be executed an it will destroy all the object and frees up the  memory..
Comment: It might also be when the garbage collector do a sweep. Which can happen at any time during the run

What is Object Scope in Oop?


Least area of a triangle.

Question:
A straight line $L$ with negative slope passes through the point $(8,2)$ and cuts the positive axes at points $P$ and $Q$, then find minimum area of $\triangle{OPQ}$ ($O$ is origin).

Book hint:
They wrote area is minimum when $(8,2)$ is the mid point of $PQ$.
I don't understand this, please help.
Comment: Perhaps the hint should say when $(8,2)$ is the midpoint of the line segment $PQ$? If it was the midpoint of the triangle, there wouldn't be a line passing through it.
Answer: Hint: fold it!

The area of the $POQ$ triangle equals $16$ (i.e. the area of the rectangle with vertices at $O,(8,0),(8,2),(0,2)$) plus the area of the region given by the light orange and rose triangles. This region always encloses the previous rectangle, hence has an area $\geq 16$. Equality is attained only when $(8,2)$ is the midpoint of $PQ$, leading to $[POQ]=32$.
Answer: the line through $P(8;2)$ is given by $$y=m(x-8)+2$$ and thus the Point on the $x$ axes is $$x=\frac{8m-2}{m}$$ and on the $y$-axes $y=-8m+2$ and the area of the triangle
$A=\frac{1}{2}\frac{(2-8m)(8m-2)}{m}$
differentiating with respect to $m$ we get
$$A'(m)=\frac{-2(4m-1)(4m+1)}{m^2}$$
solving the equation $A'(m)=0$ we get $m=\frac{-1}{4}$ and $A''(-\frac{1}{4})=256>0$ so we get a Minimum.
Comment: Where did the y go in the second step? Did you make it equal 0? If so, why?

Least area of a triangle.


Apply type constructor to components of a record type

Question: Given a fixed type constructor T, and a record type R, is there a mechanism to create a declaration for the record type whose components are those of R, but with T applied to the type.
For example, with T being Maybe, and R,
data Foo {
  bar :: Int,
  baz :: Bool
}

the mechanism should give,
data Foo {
  bar :: Maybe Int,
  baz :: Maybe Bool
}

Or possibly,
data FooOpt {
  barOpt :: Maybe Int,
  bazOpt :: Maybe Bool
}

where the Opt suffix is specified as a parameter.
Comment: Could you solve this with something as simple as `data Foo f { bar :: f Int, baz :: f Bool }`, then `type FooOpt = Foo Maybe`? Or do you need the type safety of separate types?
Comment: Do you actually need a proper `data` declaration (in that case there's no way around TH), or do you only need _some type that's isomorphic_ to the modified `R`? In that case a solution with generics alone might be possible (which of course requires a `Generic` instance for `R`, but that shouldn't be a hurdle).
Comment: generics-sop can do something like that http://stackoverflow.com/questions/39020787/is-there-a-way-to-apply-maybe-constructor-to-each-field-of-record-with-generics
Comment: No, I cannot touch the original type.
Comment: Are you sure you can't generalize the original type, so to use a nearly isomorphic one instead as Alexis suggests? Otherwise, I guess Template Haskell is your only option, but I wonder why you really need this.
Comment: Is [this question](http://stackoverflow.com/questions/38229211/how-can-i-represent-data-with-optional-fields-at-the-type-level) close enough to your goal?
Answer: You can parametrize your type with another type (usually a functor) and do
data Foo f {
   bar :: f Int
   baz :: f Bool
}

And they use Foo Identity and Foo Maybe. The problem with this is Foo Identity doesn't give you {bar :: Int, baz :: Bool} but {bar :: Identity Int, baz :: Identity Bool}. It's semantically equivalent but a pain in practice because you have to unwrap all field from Identity.
The advantages however, is you can write method which are generic on f and work for both Foo Identity and Foo Maybe. You can get rid of the Identity by using type families.
type family EraseIdentity f a where
     EraseIdentity Identity a = a
     EraseIdentity f a = f a

 data Foo f = Foo {
      bar :: EraseIdentity f Int
      baz :: EraseIdentity f Bool
 }

Type families are function on types, and what you are saying here is , transforms Identity a to a. Now Foo Identity is a { bar :: Int, baz :: Bool}.
Comment: Nice. I didn't know about EraseIdentity


How to change/adapt loss function while using "class" incremental learning

Question: As a beginner on class incremental learning and trying to understand the general concept. In class incremental learning, we have a model that can make a classification between classes A, B, and C. By using data from another class D, we want to apply class incremental learning to obtain a model which can predict classes among A, B, C and D without training all data with all classes from scratch.
My question is, since our softmax (that we use to calculate loss (cross-entropy loss)) has a fixed size (3 in case of A, B, and C classes), how this can be possible? Do we change the loss in class incremental learning? How to deal with that?
Note 1: The video I watched to get an idea about class incremental learning is iCaRL- incremental Classifier and Representation Learning.
Note 2: I saw the catastrophic forgetting issue, but my question does not cover this. It is (I suppose) more straightforward.
Answer: In class incremental learning, we do change the softmax function and associated loss in each stage of learning.
Class incremental learning is a fairly new field of research, and one of the earliest and among the most influential papers in this field is iCaRL: Incremental Classifier and Representation Learning by Rebuffi et al. (2017). There, this change of loss function is detailed in section 2.3 and Algorithm 3. The augmented loss function includes the classification loss corresponding to new data and also the distillation loss, which preserves previously learned discriminative information. Incorporating the distillation loss in the augmented loss function mitigates the chance of catastrophic forgetting as well.


How to use window.onload when HTML rendered in Vue

Question: My API returns me the HTML. It has an option to switch between multiple languages and the content for all languages is already embedded in the single HTML.
There is an onload function inside the HTML that sets the default language.
function toggleLanguage(language) {
        // Hide all content
        document.querySelectorAll('[data-language]').forEach(function(el) {
            el.style.display = 'none';
        });

        // Show content for the selected language
        document.querySelectorAll('[data-language="' + language + '"]').forEach(function(el) {
            el.style.display = 'block';
        });
}

window.onload = function() {
    toggleLanguage('english');
};

Additional Charges & Terms

Cargos y condiciones adicionales

I'm using v-html inside my Vue file to render the content received from API

My issue here is window.onload is not getting triggered and I'm seeing the content in all languages.
Comment: "My issue here is window.onload is not getting triggered" ... have you verified this? console.log something in the handler to see if it outputs.
Answer: You are looking for the mounted lifecycle hook. Here is how you can use that:
Your HTML:

Script:

Comment: I will make the API call to retrieve HTML and show it in an Dialog up on click of a particular button on the page. I have also tried making the call in mounted and it looks the same. Nothing changed
Answer: you can  make the call  in  nextTick api
import { nextTick} from 'vue'
// after api call
factsLabelTemplate.value = response.data
nextTick(()=>{
    toggleLanguage('english');
})

Comment: I see below error as `toogleLanguage` is part of the rendered HTML and not in my Vue code.
error  'toggleLanguage' is not defined  no-undef
Comment: If the response is a complete webpage  that contains html ,body ,script,and so on, you can create a iframe element to load it.


Problemas com $http e ng-repeat angularjs iniciante $$hashKey

Question: Olá sou iniciante no Angular e estou achando muito bacana, meu problema é o seguinte:
tenho um ng-repeat que funciona direitinho quando pego a fonte de dados de uma variável javascript assim:
var alertsq = [
{
    "alert":"mediun",
    "nt":"28",
    "nu":"28",
    "no":"34",
    "dtini":"2012/Jul/23",
    "no":"3",
    "dtoc":"23/7/2012",
    "dtuo":"25/7/2012",
    "id":"227529436529033216",
    "msg":"Uh oh, this could be bad. Check the door lock vendor before you book you next hotel room: http://t.co/n56emZf2"
},
{
    "alert":"mediun",
    "nt":"28",
    "nu":"28",
    "no":"34",
    "dtini":"2012/Jul/23",
    "no":"3",
    "dtoc":"23/7/2012",
    "dtuo":"25/7/2012",
    "id":"227529436529033216",
    "msg":"Uh oh, this could be bad. Check the door lock vendor before you book you next hotel room: http://t.co/n56emZf2"
}];

Meu controller que pega a variável alertsq e seta no escopo é assim:
app.controller("alertsController", function(){
    console.log(alertsq);
    this.alerts = alertsq;
});

O bacana é que isso funciona e minha lista no *ng-repeat* é preenchida lindamente, mas quando utilizo o $http para carregar um conteúdo JSON de um arquivo o mesmo não preenche a lista: ó código do controller é assim:
app.controller("alertsController", function($http,$scope){
    $http({
        url: "data/alerts.json",
        dataType: "json",
        method: "GET",
        headers: {
          "Content-Type": "application/json"
        }
    }).success(function(data){
        $scope.alerts = data;
        console.log($scope.alerts);
    }).error(function(error){
        console.log(data);
        console.log(error);
    });
});

O legal é que o JSON esta vindo certinho a saída do navegador no primeiro caso em
que a lista é preenchida é assim:
mainController controller.js:7

 [Object, Object, Object, Object, Object, Object, Object]
     0: Object
     $$hashKey:"object:4"
     alert: "mediun"
     dtini: "2012/Jul/23"
     dtoc: "23/7/2012"
     dtuo: "25/7/2012"
     id: "227529436529033216"
     msg: "Uh oh, this could be bad. Check the
     door lock vendor before you book you next hotel room:
     http://t.co/n56emZf2"
     no:"3"
     nt: "28"
     nu: "28"__proto__:
    Object1:
    Object2:

E esta é a saída do console quando busco por $http o JSON:
 [Object, Object, Object, Object, Object, Object, Object]
 0: Object
 alert: "mediun"
 dtini: "2012/Jul/23"
 dtoc: "23/7/2012"
 dtuo: "25/7/2012"
 id: "227529436529033216"
 msg: "Uh oh, this could be bad. Check the
 door lock vendor before you book you next hotel room:
 http://t.co/n56emZf2"
 no:"3"
 nt: "28"
 nu: "28"__proto__:
Object1:
Object2:

O detalhe é que na saída obtida pelo JSON através do $http não existe o atributo  $$hashKey, E assim a lista no ng-repeat não é preenchida :(, alguém pode me ajudar a resolver isso?
Agradeço a atenção!
Comment: Olá a solução para o meu problema aqui:
[Problemas com ng-repeat][1]

  [1]: http://stackoverflow.com/questions/27390959/dificult-reading-json-and-add-ng-repeat-list-list-is-not-completed-http-has/27393640#27393640
Comment: A requisição do json está ok, provavelmente o erro está na iteração com o html. Veja seu código rodando normalmente http://plnkr.co/edit/Y36tkeVAIPEFp22WnLqi?p=preview
Comment: Faltou colocar o html do ng-repeat
Comment: @WagnerMonteverde Então responda você mesmo com o link pro SOEn, mas traduza os parágrafos da resposta pra que ela não seja sinalizada como "apenas um link"
Comment: Se você postar o seu HTML já ajudaria... pois o problema como citado, é seu HTML não sua requisição http, nem controller, nem nada...
Answer: Olá, tive problemas com json trazendo objetos javascript, ng-repeat não consegue trabalhar com objetos, tive que usar um filter object2Array.
ng-repeat="item in items | object2Array "

minhaApp.filter('object2Array', function(){
    return function(input){
        return angular.fromJson(input);//out;
    }
});

Answer: Vamos la, coisas que achei estranhas:
}).success(function(data){
        $scope.alerts = data;
        console.log($scope.alerts);
    }

Você esta retornando um JSON logo o formato padrão de chegada dele é:
{index:valor}

Na atribuição esse dataque você esta atribuindo ao $scope.alerts deveria ser um data.index, por que realmente o data ta te retornando um conjunto de objetos e não um arrayList
Bom, não sei se esse pode ser o erro, mas se quiser tentar fica dica :D
OBS: Em vez de configurar $http use ja os pré definidos pelo próprio angular! Exemplo:
$http.get('linkdarequisição')
    .success(function(data){
       //codigo
    })


What is the ball associated with a certain metric?

Question: I do not understand what the ball associated with a certain metric is. How do you obtain the radius and centre of such ball? Should you just take an arbitrary point?
Comment: Then for each arbitrary point there is a ball with r>0?
Comment: For every metric space $X$ with metric denoted $d$, and for every point $p \in X$, and for every real number $r > 0$, the ball in $X$ with center $p$ and radius $r$ is defined to be the set $\{y \in X \mid d(x,y) < r\}$.
Comment: In what context have you encountered "**the** ball associated with a certain metric" as if there were just one such ball?
Comment: Both the center and the radius have to be given to specify a ball. Typically metric spaces have a very large number of distinct balls (for example, any pair of real numbers $(x,r)$ with $r>0$ specifies a ball in the real numbers).
Comment: We use the term *ball* generically with metric $d$ to mean the set "centered" at  $x$ having radius $r$ that @LeeMosher describes.  The actual shape could be quite different from "round", use of the word *ball* notwithstanding.
Answer: For a metric $d$ on a set $S$ and for $p\in S$ and for $r\in \Bbb R$ the $open$ ball $B_d(p,r)$ is defined as $$B_d(p,r)=\{q\in S: d(q,p)<r\}.$$ Non-positive values of $r$ are rarely mentioned because $B_d(p,r)=\emptyset$ when $r\leq 0.$
When only one metric $d$ is under discussion, $B_d(p,r)$ is often written as  $B(p,r).$
Some people write $B_r(p)$ instead, which I think is harder to read, and can become awkward when $r$ is defined by a formula instead of a single letter.
$p$ is called a center of $B_d(p,r)$ and $r$ is called a radius of $B_d(p,r).$ (Note: Not necessarily "the" center nor "the" radius. See below.)
In some metric spaces (...e.g. $S=\Bbb R$ with $d(p,q)=|p-q|...),$ if $r,r'>0$ and $B(p,r)=B(p',r')$ then $p=p'$ and $r=r'.$  But in general this may not happen.
The simplest example is to let $S$ have more than one member, and let $d(p,p')=1$ when $p,p'$ are unequal members of $S$. (This is called the discrete metric on $S.$)   Then for any $p,p'\in S$ we have $B_d(p,2)=B_d(p',3)=S. $ And for any $r,r'\in (0,1]$ and any $p\in S$ we have $B_d(p,r)=B_d(p,r')=\{p\}.$
Comment: @RossMillikan.  I said the ball is empty for r<0. The def'n makes sense for r<0. It's just  that the case r<0 is not very interesting


Overriding/customizing Drupal modules

Question: I would like to override custom user template in my Drupal 7 installation. The question is - should I edit the template file in the main module or copy the module to my theme's folder and edit it there? In case of the second option, how can I do it?
Comment: Which template are you editing specifically? You should almost definitely not edit the template file in the module itself...
Answer: You should definitely create a subtheme to customize the look and feel. Otherwise, every time you upgrade core you will have to reapply your changes. You can subtheme the default Drupal 7 theme (Bartik) by following these steps.
Once you have done that, copy the user-profile.tpl.php file into your subtheme directory (/sites/all/themes/mytheme).
Finally, make the changes you want to make to user-profile.tpl.php

Overriding/customizing Drupal modules


Randomizar divs jQuery

Question: Fala galera!
Tenho o seguinte código. O que estou tentando é que apareça as 6 divs aleatoriamente. Já tentei de diversar formas mas sem resultado.
Se alguém puder ajudar agradeço.
PS: Não posso colocar as divs dentro do HTML, tem que ser via jquery.

var dfl1 = '
teste 1
'
var dfl2 = '
teste 2
'
var dfl3 = '
teste 3
'
var dfl4 = '
teste 4
'
var dfl5 = '
teste 5
'
var dfl6 = '
teste 6
'

var imagesdfl = [dfl1, dfl2, dfl3, dfl4, dfl5, dfl6];
$(imagesdfl[Math.floor(Math.random() * imagesdfl.length)]).appendTo('#load-content-d');

Answer: Utilizando a lib lodash, bastaria fazer o sort dinâmico com o comando shuffle. Veja abaixo como ficaria:

var dfl1 = $('
teste 1
');
var dfl2 = $('
teste 2
');
var dfl3 = $('
teste 3
');
var dfl4 = $('
teste 4
');
var dfl5 = $('
teste 5
');
var dfl6 = $('
teste 6
');

var arr = [];
arr.push(dfl1, dfl2, dfl3, dfl4, dfl5, dfl6);
arr = _.shuffle(arr);

$("#load-content-d").html(arr);

Com Java Script puro:
Código do sortear retirado daqui.

function shuffle(array) {
  var currentIndex = array.length,
    temporaryValue, randomIndex;

  // While there remain elements to shuffle...
  while (0 !== currentIndex) {

    // Pick a remaining element...
    randomIndex = Math.floor(Math.random() * currentIndex);
    currentIndex -= 1;

    // And swap it with the current element.
    temporaryValue = array[currentIndex];
    array[currentIndex] = array[randomIndex];
    array[randomIndex] = temporaryValue;
  }

  return array;
}

var dfl1 = $('
teste 1
');
var dfl2 = $('
teste 2
');
var dfl3 = $('
teste 3
');
var dfl4 = $('
teste 4
');
var dfl5 = $('
teste 5
');
var dfl6 = $('
teste 6
');

var arr = [];
arr.push(dfl1, dfl2, dfl3, dfl4, dfl5, dfl6);
arr = shuffle(arr);

$("#load-content-d").html(arr);

Comment: Obrigado pela dica Bruno!
Interessante essa lib, mas será que não tem outro método que não tenha que usar outras libs?
Comment: Coloquei um exemplo com javascript puro.
Comment: Muito obrigado Bruno!
Comment: Eduardo, se foi resolvido, marque minha resposta como aceita para seu problema. ;) Um bom fim de semana pra ti!
Comment: Valeu Bruno! Bom final de semana pra você também.

Randomizar divs jQuery


Let T be a linear operator on an inner product space V. Let $U_1=T+T^{*}$ and $U_2=T T^{*}$. Prove $U_1=U_1^{*}$ and $U_2=U_2^{*}$

Question: Let T be a linear operator on an inner product space V. Let $U_1=T+T^{*}$ and $U_2=T T^{*}$. Prove $U_1=U_1^{*}$ and $U_2=U_2^{*}$
How am I supposed to prove this? This doesn't tell it's finite-dimensional.
Comment: For what it's worth, I'm pretty sure the exercise intended $V$ to be finite-dimensional. Infinite-dimensional inner product spaces may be "incomplete", in which case the adjoint becomes a little trickier to work with (to the point where $T + T^*$ doesn't obviously make sense).
Answer: Use the following: $(A+B)^{*}=A^{*}+B^{^*}$, $(AB)^{*}=B^{*}A^{*}$ and $A^{**}=A$.


Prove that an equation has no elementary solution

Question: There are methods proving that a polynomial isn't solvable in radical extensions (see Abel–Ruffini theorem) or proving that an integral or a differential equation has no solutions expressible through elementary functions (Risch Algorithm and differential Galois theory).
But I've never seen a proof that proves an equation (like $xe^x=1$) not be solvable in terms of elementary functions. Is there a mathematical theory on that?
Is there a proof that the solutions of $xe^x=1$ cannot be expressed using basic arithmetic, trig, exponentials, logarithms and a composition of them?
Answer: A solution of an equation is elementary iff it is an elementary number.
Polynomial functions, rational functions and irrational algebraic functions of one variable are algebraic elementary functions. Their solutions are algebraic numbers. An algebraic number is elementary iff it can be represented as a radical expression. The problem when an equation of algebraic functions is solvable by radicals is solved by Galois theory. You are asking for solvability of equations of transcendental elementary functions in terms of elementary expressions.
1.)
This part answers when it is possible to find an elementary solution only by transforming the equation only by elementary operations that are readable from the equation.
This task can be related to the question of existence of closed-form inverses of the functions which are contained in the equation: If only elementary expressions are allowed, an equation $F(x)=0$ with elementary function $F$ given in closed form can be transformed according to $x$ simply by reading off the partial inverses of $F$ from the equation only if all partial inverses needed are elementary functions.
The incomprehensibly unfortunately hardly noticed theorem of Joseph Fels Ritt in Ritt, J. F.: Elementary functions and their inverses. Trans. Amer. Math. Soc. 27 (1925) (1) 68-90 answers which kinds of Elementary functions can have an inverse which is an Elementary function.
Risch also proved this theorem in Risch, R. H.: Algebraic Properties of the Elementary Functions of Analysis. Amer. J. Math 101 (1979) (4) 743-759 by his structure theorem for Elementary functions.
2.)
A method of proof for certain transcendental equations is given in Rosenlicht, M.: On the explicit solvability of certain transcendental equations. Publications mathématiques de l'IHÉS 36 (1969) 15-22.
Two methods for simpler transcendental elementary equations are given in [Lin 1983] Ferng-Ching Lin: Schanuel's Conjecture Implies Ritt's Conjectures. Chin. J. Math. 11 (1983) (1) 41-50 and in [Chow 1999] Chow, T.: What is a closed-form number. Am. Math. Monthly 106 (1999) (5) 440-448. Both need the proof of Schanuel's conjecture what currently is an unsolved mathematical problem.


Sort a 2D list by two fields

Question: Suppose I have a 2D list:
data = []
data.append([7, 12, 19, 'Type1', 'New'])
data.append([1, 2, 21, 'Type3', 'New'])
data.append([12, 7, 22, 'Type2', 'Active'])
data.append([3, 0, 22, 'Type3', 'Active'])
data.append([0, 1, 18, 'Type2', 'Closed'])
data.append([13, 11, 19, 'Type1', 'Closed'])

I would like to sort this 2d list by the fourth and fifth columns. I'd like column 4 to be sorted ascending, but column 5 to be in order of New, Active, Closed.
Desired 2d list:
[7, 12, 19, 'Type1', 'New'])
[13, 11, 19, 'Type1', 'Closed'])
[12, 7, 22, 'Type2', 'Active'])
[0, 1, 18, 'Type2', 'Closed'])
[1, 2, 21, 'Type3', 'New'])
[3, 0, 22, 'Type3', 'Active'])

This line gets me close, but not quite:
sortedData = sorted(data, key=lambda x:(x[3],x[4]))

Any suggestions on sorting by two fields?
Answer: You can construct a dictionary priority mapping and then use a tuple sort key:
priorities = {v: k for k, v in enumerate(['New', 'Active', 'Closed'])}

res = sorted(data, key=lambda x: (x[3], priorities[x[4]]))

print(res)

[[7, 12, 19, 'Type1', 'New'],
 [13, 11, 19, 'Type1', 'Closed'],
 [12, 7, 22, 'Type2', 'Active'],
 [0, 1, 18, 'Type2', 'Closed'],
 [1, 2, 21, 'Type3', 'New'],
 [3, 0, 22, 'Type3', 'Active']]

Comment: awesome, thanks! I can't wrap my head around priorities[x[4]]. Mind explaining?
Comment: `priorities` is a dictionary, `x[4]` represents the last value in each sublist. so `priorities[x[4]]` looks up the this key in the dictionary `priorities`. So the result will be `0`, `1`, or `2`. `print(priorities)` if you want to see the dictionary.
Comment: Thanks for the explanation, makes a lot of sense now.

Sort a 2D list by two fields


Issues to install packages in latest version of RStudio and R Versions (3.5.1 / 3.5.3)

Question: I am unable to install packages (rtexttools and depend on maxent both lunch errors debt that the were removed recently from the CRAN repository) through latest version of RStudio and R Version.3.5.1 and 3.5.3.
I tried also installing them manually, format .tar, but nothing happened the the error remained.
The error:

install.packages("RTextTools")
Installing package into 'C:/Users/dramosd/Documents/R/win-library/3.5'
  (as 'lib' is unspecified)
Warning in install.packages :
    package 'RTextTools' is not available (for R version 3.5.3)
Comment: Possible duplicate of [How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?](https://stackoverflow.com/questions/25721884/how-should-i-deal-with-package-xxx-is-not-available-for-r-version-x-y-z-wa)
Answer: Some packages are not available to download via CRAN, In that case you can use below function to install R package directly from there github repo.
Try this-
library(devtools)
install_github("timjurka/RTextTools/RTextTools")

**Note- RTextTools is no longer actively maintained by developer. So, above method may not work.
Please check there website for more info-
http://www.rtexttools.com/install.html


Error Mulitple Definition of

Question: I need some help with this program I am writing in class. When ever I get ready to compile it it gives me an error that there are multiple definitions and i have tried to figure out what the mistake is but i cant. your help would be be helpful and thanks in advance.
It seems that the problem is with main.cpp, person.h, and person.cpp.
main.cpp
#include <iostream>
#include "person.cpp"
using namespace std;

int main(int argc, char *argv[])
{
   Person p1;
   p1.setFirstName("Carlos");
   p1.setLastName("Martinez");
   p1.setMiddleInit('X');
   p1.setStreetAddress("Avenue");
   p1.setCity("Atlanta");
   p1.setState("GA");
   p1.setZipCode("568467");
   p1.setHomePhone("829385925");
   p1.setWorkPhone("990128399");
   cout << p1.getFirstName() << endl;
   cout << p1.getLastName() << endl;
   cout << p1.getMiddleInit() << endl;
   cout << p1.getStreetAddress() << endl;
   cout << p1.getCity() << endl;
   cout << p1.getState() << endl;
   cout << p1.getZipCode()<< endl;
   cout << p1.getHomePhone() << endl;
   cout << p1.getWorkPhone() << endl;
   //system("PAUSE"); // only needed for devc++
   return 0;
}

person.h
#include "date.h"
#ifndef PERSON_H
#define PERSON_H

class Person {

    public:
    Person();
    ~Person();

    Date dateOfBirth;
    void setLastName(char*);
    void setFirstName(char*);
    void setMiddleInit(char);
    void setStreetAddress(char*);
    void setCity(char*);
    void setState(char*);
    void setZipCode(char*);
    void setHomePhone(char*);
    void setWorkPhone(char*);

    char* getLastName();
    char* getFirstName();
    char getMiddleInit();
    char* getStreetAddress();
    char* getCity();
    char* getState();
    char* getZipCode();
    char* getHomePhone();
    char* getWorkPhone();

    private:
    char lastName[21];
    char firstName[16];
    char middleInit;
    char streetAddress[26];
    char city[21];
    char state[3];
    char zipcode[11];
    char homePhone[13];
    char workPhone[13];
};
#endif

person.cpp
#include <string.h>
#include "person.h"
Person::Person(){}

Person::~Person(){}

void Person::setLastName(char *s)
{
    strcpy(lastName,s);
}

char* Person::getLastName()
{
    static char temp[21];
    strcpy(temp,lastName);
    return temp;
}

void Person::setFirstName(char *s)
{
    strcpy (firstName,s);
}

char* Person::getFirstName()
{
    static char temp[16];
    strcpy (temp,firstName);
    return temp;
}

void Person::setMiddleInit(char s)
{
middleInit = s;
}

char Person::getMiddleInit()
{
return middleInit;
}

void Person::setStreetAddress(char *s)
{
   strcpy(streetAddress,s);
}

char* Person::getStreetAddress()
{
static char temp[26];
strcpy (temp, streetAddress); // street is copied to temp which is returned
return temp;
}

void Person::setCity(char *s)
{
   strcpy(city,s);
}

char* Person::getCity()
{
static char temp[21];
strcpy (temp, city); // city is copied to temp which is returned
return temp;
}

void Person::setState(char *s)
{
   strcpy(state,s);
}

char* Person::getState()
{
static char temp[3];
strcpy (temp, state); // state is copied to temp which is returned
return temp;
}

void Person::setZipCode(char *s)
{
   strcpy(zipcode,s);
}

char* Person::getZipCode()
{
static char temp[11];
strcpy (temp, zipcode); // zipcode is copied to temp which is returned
return temp;
}

void Person::setHomePhone(char *s)
{
   strcpy(homePhone,s);
}

char* Person::getHomePhone()
{
static char temp[13];
strcpy (temp, homePhone); // homephone is copied to temp which is returned
return temp;
}

void Person::setWorkPhone(char *s)
{
   strcpy(workPhone,s);
}

char* Person::getWorkPhone()
{
static char temp[13];
strcpy (temp, workPhone); // work phone is copied to temp which is returned
return temp;
}

I also have a date.h and date.cpp but that does not seem to be the problem.
date.h
#ifndef DATE_H
#define DATE_H

class Date {
public:
    Date();
    ~Date();
    void setDate( int, int, int );
    int getDay(); // method or function to retrieve a day value
    int getMonth(); // method or function to retrieve a month value
    int getYear(); // method or function to retrieve a year value
    private:
    int day; // data member of this class
    int month; // data member of this class
    int year; // data member of this class
};

#endif

date.cpp
#include <iostream>
#include <string>
#include "date.h"
using namespace std;

    Date::Date(){
    day = 1;    // this and the following lines insure that Date objects
    month = 1;  // start in a consistent state
    year = 1900;
    }

    // the following destructor releases resources used by objects of type Date
    // when they no longer exist
    Date::~Date()
    {
    }

    void Date::setDate( int d, int m, int y )
    {
    if ( y >= 1900 )
    year = y; // validates that year is 1900 or greater
    else{
    year = 1900;
    cout << "Invalid year! " << y << endl;
    }

    if ( m >= 1 && m <= 12)
    month = m;

    else{
    month = 1;
    day = 1;
    cout << "Invalid month!" << endl;}

    if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
    {
    if ( d >= 1 && d <= 31 )
    day = d;

    else   {
    day = 1;
    cout << "Invalid day! " << d << endl;
    }
    }

    else {   if ( m == 4 || m == 6 || m == 9 || m == 11 )
    {
    if ( d >= 1 && d <= 30 )
    day = d;
    else
    {
    day = 1;
    cout << "Invalid day! " << d << endl;
    }
    }
    else
    {
    if ( m = 2 )
    {
    if ( y % 4 == 0 && y % 400 != 0 )
    {
    if ( d >= 1 && d <= 29 )
    day = d;
    else
    {
    day = 1;
    cout << "Invalid day! " << d << endl;
    }
    }
    else
    {
    if ( d >= 1 && d <= 28 )
    day = d;
    else
    {
    day = 1;
    cout << "Invalid day! " << d << endl;
    }
    }
    }
    }
    }
    } // end of functionint
    Date::getDay()
    {
    int temp;
    temp = day;
    return temp;}

    int Date::getMonth()
    {
    int temp;
    temp = month;
    return temp;
    }

    int Date::getYear()
    {   int temp;
    temp = year;
    return temp;
    }

here are the errors
Comment: `#include "person.cpp"` -> `#include "person.h"`
Comment: Post errors here directly as text.
Comment: https://stackoverflow.com/questions/1686204/why-should-i-not-include-cpp-files-and-instead-use-a-header
Comment: @Mike Kinghan that was the problem with me including person.cpp instead of person.h thank you
Comment: If a class doesn't seem to be the problem, then omit it from the code!
Answer: In main.cpp, change "person.cpp" to "person.h", as Mike Kinghan said.
Also, in person.h, you should include the date.h file after the header guard:
#ifndef PERSON_H
#define PERSON_H

#include "date.h"
...
#endif

Comment: thanks, will change. I runs perfectly now!

Error Mulitple Definition of


Android Retrofit api call with space in parameter

Question: I am trying to make an API call using Retrofit 1.x:
@POST("/test?api-version=1.0")
void createMyStuff(
        @Header("X-Signature") String authorization,
        @Query(value="nickname") String nickname,
        @Query("language") String language,
        Callback<MyAPIResponse> cb);

the issue is :  nickname can have spaces in it.
   So, before make the call,  if nickname is "John  Doe" (two spaces),  I replace space in it and send it like :  "John%20%20Doe" in the API call.
It fails with 400, Bad request.
The URL reported in the errorResponse object is :
    https://.com/foo/test?nickname=john%2520%2520doe&language=en-US
Notice that the %20 is replaced by  %2520
What I investigated : there isn't a definite answer. Someone on SO suggested in a thread to use FunName(value="apiname",encodeValue=true)
 But the encodeValue isn't resolving.
I also tried encoding with UTF-8 and it doesnt work. I am not sure about URL encoding since this is not really URL and will be only part of it.
Appreciate any help.
Comment: Just out of curiosity have you tried just passing it the string without being encoded in any way? So just pass it 'John Doe'.  %25 is the encoding for a '%' so it seems like it's taking 'john%20%20doe' and encoding it automatically thus giving you the 'john%2520%2520doe'
Comment: yes i did send with spaces. :-)  so have to resort to all these things.  That gave a 400 bad request as well.
Comment: Darn, worth a shot haha. Have you tried using @Path instead of @Query? So something like:
`@POST("test?api-version=1.0&nickname={name}&language={lang}")
void createMyStuff(
    @Header("X-Signature") String authorization,
    @Path("name") String nickname,
    @Path("lang") String language);`
Comment: didn't work  :   Declaration  :   @POST("/room?api-version=1.0&nickname={name}&language={lang}")
    void createRoomWithVoice(
            @Header("X-Signature") String authorization,
            @Path(value="name") String nickname,
            @Path(value="lang") String language,
            Callback cb);     10-12 22:59:16.290 W/System.err: Caused by: java.lang.IllegalArgumentException: MyApi.createMySTuff: URL query string "api-version=1.0&nickname={name}&language={lang}" must not have replace block.
Comment: Okay, what if you go back to the original way with Query params but you use `@EncodedQuery` this time and pass it a string you manually encoded. So basically exact same thing you were doing at first but swap out `@Query` for `@EncodedQuery`
Comment: Have you found any solution? I am facing the same problem
Comment: I m facing the same solution.. What will be the solution ? plz suggest.
Comment: @techtinkerer If you have solved problem, please add your answer.
Answer: In Retrofit2 Parameter names and values are URL encoded by default. You need to add encoded = true to change this behaviour.
void createMyStuff(
    @Header("X-Signature") String authorization,
    @Query(value="nickname", encoded = true) String nickname,
    @Query("language") String language,
    Callback<MyAPIResponse> cb);

Comment: So what you mean is that retrofit does the encoding for you? no need to use %20 with spaces?
Answer: Actually %25 is encoding of % so when you put %20 it encodes % to %25 and 20 remains same. so you have to false its encoding in @Query parameter
@Query(value="nickname",encodeValue = false) String nickname

Now you can call it with %20 it will work fine
createMyStuff("Auth","John%20%20Doe","lang",new Callback<MyResponse>{....});


Show price after selected a element in drop list

Question: Long ago, I search all over the web but I was unable to find a solution that suits me. I have to write what I want the forum to find help that suits me.
To begin, I have a drop-down which offers several choices. Here is the list
<Form name = "sellalcatel" form method = "post" action = "traitement.php" onchange = "return vefify ();">
    <Select name = "Alcatel">
        <Option> Please Select <option>
        <Option value = "Alcatel-1230 + ZTE811"> Alcatel 1230 (ZTE 811) </ option>
        <Option value = "Alcatel-1231"> Alcatel 1231 </ option>
        <Option value = "Alcatel-351"> Alcatel 351 </ option>
    </ Select>

        Country <input type = "text" size = "40">

 Name <INPUT NAME = "Name" SIZE = 40>

 Enter your Mail <input name = "email" placeholder = "email@example.com" required>

        <Input name = "button" type = "submit" value = "unlock"> </ input>

</ Form>

I want that after the selection of the drop-down list to display the price depending on the selection: for example, if the customer chose the first that should show $ 3 usd, if the second Usd $ 4, $ 2 for the third usd so on.
NB ~ I want to recover the money but simply display it without reloading the page, many of the sites proposed to make a BDD but my problem is that I do not know how to put the price in the database and also the attribute to its correct value in the dropdown.
So is there any other solutions to display the price or can I get help or a database like I want to aficher price?
Comment: You can use Javascript to achieve what you want to do in your system. And also, include what you have started, the code you are working on right now. Check this also - [ask].
Comment: Just use plain JavaScript to get the value of the select item that was clicked and display it inside another element. You don't need a server-sided script for this.
Comment: Logan wayne thanks for you answer,my html code dont print in true format
Comment: It's good now.can have a exemple to show the price in this form with javascript ?
Comment: @Babyhay - where do you get the options for your `alcatel` dropdown? Is this fix? And where would you get the corresponding USD value of the selected option?
Comment: Spencer wieczorek , i dont want to show value in quote,i want to show a price
Comment: @logan wayne I want show the price in below the dropdown liste
Comment: I try to do with  but i dont know how to show price
Comment: sorry if my english is bad so I do not speak English, it is the quality of this forum that requires me to come register
Comment: We already know that you want to show the price depending on the selected options from your dropdown, but what I'm asking is "is the options for your dropdown fix? Or do you get the options from your database? And how about the corresponding price of those options? Where do you suppose to get it?".
Comment: yes, my dropdown working properly, I have not put all the code in the forum because it is long, I already test how to retrieve the selected data, my biggest problem is for display prices, people tell me to create the database but I do not know how to put the price in the database and also assign each award has its model in the value list
Comment: If i know how the price for this droplist, i can do for the others
Answer: The best way to achieve this is to use javascript.
<select id="dropdown">
  <option value="1.00">$1.00</option>
  <option value="12.43">$12.43</option>
  <option value="37.21">$37.21</option>
</select>

JavaScript:
var e = document.getElementById("dropdown");
var value = e.options[e.selectedIndex].value; // The value
var text = e.options[e.selectedIndex].text; // The text

Or jQuery:
$("#dropdown :selected").text(); // The text
$("#dropdown").val(); // The value

The data attribute allows you to add custom data to a HTML element.
E.G
HTML
<option data-price="12" value="1.00">$1.00</option>

Jquery
$(this).data("price")

Comment: @Ryan the problem is that I'll lose the selected model, there are models that have the same price. I want to display a price that is within the value and depends on the model name that are in the list
Comment: Thank you very much Ryan
Answer: To achieve the feature you want for your system, you can use Javascript. But for my answer, we will be using jQuery, which is a Javascript library.
Download jQuery first, then call it in your header:

Option 1:
Lets create a div on where we can display the price:

Then lets add an id tag on your select:
<select name="Alcatel" id="alcatel">

If your options are fix, you can manually create conditions for each options on your javascript.
$(document).on("change", "#alcatel", function(){

    var alcatelval = $(this).val();

    if(alcatelval == 'Alcatel-1230 + ZTE811'){
        $("#result").text('USD 399');
    } else if(alcatelval == 'Alcatel-1231'){
        $("#result").text('USD 299');
    } else if(alcatelval == 'Alcatel-351'){
        $("#result").text('USD 169');
    }

});

You can check this jsfiddle for example.

Option 2:
Put all of the options in your database, along with the corresponding prices:
phone_tb:
phone_id | brand_id | model | price
---------+----------+-------+--------
    1    |     1    | 1230  |  399
    2    |     1    | 1231  |  299
    3    |     1    | 351   |  169

brand_tb:
brand_id | brand_desc
---------+------------
    1    |  Alcatel
    2    |  Samsung
    3    |  Apple

Then fetch the options for your drop-down, where you can include the price along with the model and description, so you won't have to use Javascript in order to learn the price of a device:
<select name="Alcatel" id="alcatel">
<?php

    $stmt = $YourDBConnection->prepare("SELECT a.phone_id, a.model, a.price, b.brand_desc FROM phone_tb a LEFT JOIN brand_tb b ON a.brand_id = b.brand_id");
    $stmt->execute();
    $stmt->bind_result($phoneid, $model, $price, $brand);
    while($stmt->fetch()){
        echo '<option value="'.$phoneid.'">'.$brand.'-'.$model.' - '.price.'</option>';
    }
    $stmt->close();

?>
</select>

Comment: If i want to show a one price after select an element in ther liste,a one price for all element in the liste,how i can do it?


Factor rotation methods (varimax, quartimax, oblimin, etc.) - what do the names mean and what do the methods do?

Question: Factor analysis has several rotation methods, such as varimax, quartimax, equamax, promax, oblimin, etc. I am unable to find any information that relates their names to their actual mathematical or statistical doings. Why is it called "equa-max" or "quarti-max"? In what way are the axes or matrices rotated so they have such name?
Unfortunately, most of them were invented in 1950s-1970s, so I cannot contact their authors.
Comment: I edited your question and its title so it is better formed. Feel free to edit it or revert the changes if you don't agree with them. The question is quite interesting so in my opinion it is important for it to be well-formed.
Comment: @Tim, I edited further, and in particular added the recently created [factor-rotation] tag which you perhaps have not encountered yet.
Answer: This answer succeeds this general question on rotations in factor analysis (please read it) and briefly describes a number of specific methods.
Rotations are performed iteratively and on every pair of factors (columns of the loading matrix). This is needed because the task to optimize (maximize or minimize) the objective criterion simultaneously for all the factors would be mathematically difficult. However, in the end the final rotation matrix $\bf Q$ is assembled so that you can reproduce the rotation yourself with it, multiplying the extracted loadings $\bf A$ by it, $\bf AQ=S$, getting the rotated factor structure matrix $\bf S$. The objective criterion is some property of the elements (loadings) of resultant matrix $\bf S$.
Quartimax orthogonal rotation seeks to maximize the sum of all loadings raised to power 4 in $\bf S$. Hence its name ("quarti", four). It was shown that reaching this mathematical objective corresponds enough to satisfying the 3rd Thurstone's criterion of "simple structure" which sounds as: for every pair of factors there is several (ideally >= m) variables with loadings near zero for any one of the two and far from zero for the other factor. In other words, there will be many large and many small loadings; and points on the loading plot drawn for a pair of rotated factors would, ideally, lie close to one of the two axes. Quartimax thus minimizes the number of factors needed to explain a variable: it "simplifies" the rows of the loading matrix. But quartimax often produces the so called "general factor" (which most of the time is not desirable in FA of variables; it is more desirable, I believe, in the so called Q-mode FA of respondents).
Varimax orthogonal rotation tries to maximize variance of the squared loadings in each factor in $\bf S$. Hence its name (variance). As the result, each factor has only few variables with large loadings by the factor. Varimax directly "simplifies" columns of the loading matrix and by that it greatly facilitates the interpretability of factors. On the loading plot, points are spread wide along a factor axis and tend to polarize themselves into near-zero and far-from-zero. This property seems to satisfy a mixture of Thurstones's simple structure points to an extent. Varimax, however, is not safe from producing points lying far away from the axes, i.e. "complex" variables loaded high by more than one factor. Whether this is bad or ok depends of the field of the study. Varimax performs well mostly in combination with the so called Kaiser's normalization (equalizing communalities temporarily while rotating), it is advised to always use it with varimax (and recommended to use it with any other method, too). It is the most popular orthogonal rotation method, especially in psychometry and social sciences.
Equamax (rarely, Equimax) orthogonal rotation can be seen as a method sharpening some properties of varimax. It was invented in attempts to further improve it. Equalization refers to a special weighting which Saunders (1962) introduced into a working formula of the algorithm. Equamax self-adjusts for the number of the being rotated factors. It tends to distribute variables (highly loaded) more uniformly between factors than varimax does and thus further is less prone to giving "general" factors. On the other hand, equamax wasn't conceived to give up the quartimax's aim to simplify rows; equamax is rather a combination of varimax and quartimax than their in-between. However, equamax is claimed to be considerably less "reliable" or "stable" than varimax or quartimax: for some data it can give disastrously bad solutions while for other data it gives perfectly interpretable factors with simple structure. One more method, similar to equamax and even more ventured in quest of simple structure is called parsimax ("maximizing parsimony") (See Mulaik, 2010, for discussion).
I am sorry for stopping now and not reviewing the oblique methods - oblimin ("oblique" with "minimizing" a criterion) and promax (unrestricted procrustes rotation after varimax). The oblique methods would require probably longer paragraphs to describe them, but I didn't plan any long answer today. Both methods are mentioned in Footnote 5 of this answer. I may refer you to Mulaik, Foundations of factor analysis (2010); classic old Harman's book Modern factor analysis (1976); and whatever pops out in the internet when you search.
See also The difference between varimax and oblimin rotations in factor analysis; What does "varimax" mean in SPSS factor analysis?
Later addendum, with the history and the formulae, for meticulous
Quartimax
In the 1950s, several factor analysis experts tried to embody Thurstone's qualitative features of a "simple structure" (See footnote 1 here) into strict, quantitative criteria:

Ferguson reasoned that the most parsimonious disposition of points (loadings) in the space of factors (axes) will be when, for most pairs of factors, each of the two axes pierces its own clot of points, thus maximizing its own coordinates and minimizing the coordinates onto the perpendicular axis. So he suggested to minimize the products of loadings for each variable in pairs of factors (i,j), summed across all variables: $\sum^p\sum_{i,j;i<j}(a_i a_j)^2$ ($a$ is a loading, an element of a p variables x m factors loading matrix $\bf A$, in this case we mean, the final loadings - after a rotation).
Carroll also thought of pairs of factors (i,j) and wanted to minimize $\sum_{i,j;i<j}\sum^p(a_i^2 a_j^2)$. The idea was that for each pair of factors, the loadings should mostly be unequal-sized or both small, ideally a zero one against a nonzero or zero one.
Neuhaus and Wrigley wanted to maximize the variance of the squared values of loadings in the whole $\bf A$, in order the loadings to split themselves into big ones and near-zero ones.
Kaiser also chose variance, but variance of the squared loadings in rows of $\bf A$; and wanted to maximize the sum of these variances across the rows.
Saunders offered to maximize the kurtosis in the doubled distribution of the loadings (i.e., every loading from $\bf A$ is taken twice - with positive and with negative sign, since the sign of a loading is basically arbitrary). High kurtosis in this symmetric around zero distribution implies maximization of the share (contribution) of extreme (big) loadings as well of near-zero loadings, at the expense of the moderate-size loadings.

It then occurred (and it can be shown mathematically) that, in the milieu of orthogonal rotation, the optimization of all these five criteria is in fact equivalent from the "argmax" point of view, and they all can boil down to the maximization of
$Q= \sum^p\sum^m a^4$,
the overall sum of the 4-th power of loadings. The criterion therefore was called the quartimax. To repeat what was said in the beginning of the answer, quartimax minimizes the number of factors needed to explain a variable: it "simplifies" the rows of the loading matrix. But quartimax not rarely produces the so called "general factor".
Varimax
Having observed that quartimax simplifies well rows (variables) but is prone to "general factor", Kaiser suggested to simplify $\bf A$'s columns (factors) instead. It was put above, that Kaiser's idea for quartimax was to maximize the summed variance of squared loadings in rows of $\bf A$. Now he transposed the proposal and suggested to maximize the summed variance of squared loadings in columns of $\bf A$. That is, to maximize $\sum^m[\frac{1}{p} \sum^p (a^2)^2 - \frac{1}{p^2} (\sum^p a^2)^2]$ (the bracketed part is the formula of the variance of p squared values $a$), or, if multiplied by $p^2$, for convenience:
$V = \sum^m[p \sum^p (a^2)^2 - (\sum^p a^2)^2] = p \sum^m\sum^p (a^4) - \sum^m(\sum^p a^2)^2 = pQ - W$
where $V$ is the varimax criterion, $Q$ is the quartimax criterion, and $W$ is the sum of squared variances of the factors (after the rotation) [a factor's variance is the sum of its squared loadings].
[I've remarked that Kaiser obtained varimax by simply transposing the quartimax's problem - to simplify columns in place of rows, - and you may switch places of m and p in the formula for $V$, to get the symmetric corresponding expression, $mQ – W^*$, for quartimax. Since we are rotating columns, not rows, of the loading matrix, the quartimax's term $W^*$, the sum of squared communalities of the variables, does not change with rotation and therefore can be dropped from the objective statement; after which can also drop multiplier m - and stay with sole $Q$, what quartimax is. While in case of varimax, term $W$ changes with rotations and thus stays an important part of the formula, to be optimized along with it.]
Kaiser normalization. Kaiser felt dissatisfied with that variables with large communalities dictate the rotation by $V$ criterion much more than variables with small communalities. So he introduced normalizing all communalities to unit before launching the procedure maximizing $V$ (and, of course, de-normalizing back after the performed rotation - communalities don't change in an orthogonal rotation). Per tradition, Kaiser normalization is often recommended to do – mainly with varimax, but sometimes along with quartimax and other rotation methods too, because, logically, it is not tied with varimax solely. Whether the trick is really beneficial, is an unsettled issue. Some software do it by default, some – by default only for varimax, still some – don't set it to be a default option. (In the end of this answer, I have a remark on the normalization.)
So was varimax, who maximizes variances of squared loadings in columns of $\bf A$ and therefore simplifies the factors – in exact opposition to quartimax, who did that in rows of $\bf A$, simplifying the variables. Kaiser demonstrated that, if the population factor structure is relatively sharp (i.e., variables tend to cluster together around different factors), varimax is more robust (stable) than quartimax to removal of some variables from the rotation operation.
Equamax and Parsimax
Saunders decided to play up the fact that quartimax and varimax are actually one formula, $pQ - cW$, where $c=0$ (and then p traditionally is dropped) for quartimax and $c=1$ for varimax. He experimented with factor analytic data in the search of a greater value for coefficient $c$ in order to accentuate the varimaxian, non-quartimaxian side of the criterion. He found that $c=m/2$ often produces factors that are more interpretable than after varimax or quartimax rotations. He called $pQ – \frac{m}{2}W$ equamax. The rationale to make $c$ dependent on m was that as the number of factors grows while p does not, the a priori expected proportion of variables to be loaded by any one factor diminishes; and to compensate it, we should raise $c$.
In a similar pursuit of further "bettering" the generic criterion, Crawford arrived at yet another coefficient value, $c = p(m−1)/(p+m−2)$, depending both on m and p. This version of the criterion was named parsimax.
It is possible further to set $c=p$, yielding criterion facpars, "factor parsimony", which, as I'm aware, is very seldom used.
(I think) It is still an open question if equamax or parsimax are really better than varimax, and if yes, then in what situations. Their dependence on the parameters m (and p) makes them self-tuning (for advocates) or capricious (for critics). Well, from purely math or general data p.o.v., raising $c$ means simply pushing factors in the direction of more equal final variances, - and not at all making the criterion "more varimax than varimax" or "balanced between varimax and quartimax" w.r.t. their objective goals, for both varimax and quartimax optimize well to the limit what they were meant to optimize.
The considered generic criterion of the form $pQ - cW$ (where Q is quartimax, $\sum^p\sum^m a^4$, and W is the sum of squared factor variances, $\sum^m(\sum^p a^2)^2$, is known as orthomax. Quartimax, varimax, equamax, parsimax, and facpars are its particular versions. In general, coefficient $c$ can take on any value. When close to +infinity, it produces factors of completely equal variances (so use that, if your aim is such). When close to -infinity, you get loadings equal to what you get if you rotate your loading matrix into its principal components by means of PCA (without centering the columns). So, value of $c$ is the parameter stretching the dimension "great general factor vs all factors equal strength".
In their important paper of 1970, Crawford & Ferguson extend the varying $c$ criterion over to the case of nonorthogonal factor rotations (calling that more general coefficient kappa).
Literature

Harman, H.H. Modern factor analysis. 1976.
Mulaik, S.A. Foundations of factor analysis. 2010.
Clarkson, D.B. Quartic rotation criteria and algorithms // Psychometrica, 1988, 53, 2, p. 251-259.
Crawford, C.B., Ferguson, G.A. A general rotation criterion and its use in orthogonal rotation // Psychometrica, 1970, 35, 3, p. 321-332.

Comparing main characteristics of the criteria
I've been generating p variables x m factors loading matrices as values from uniform distribution (so yes, that was not a sharp, clean factor structure), 50 matrices for each combination of p and m/p proportion, and rotating each loading matrix by quartimax (Q), varimax (V), equamax (E), parsimax (P), and facpars (F), all methods accompanied by Kaiser normalization. Quartimax (Q0) and varimax (V0) were also tried without Kaiser normalization. Comparisons between the criteria on three characteristics of the rotated matrix are displayed below (for each matrix generated, the 7 values of the post-rotational characteristic were rescaled into the 0-1 range; then means across the 50 simulations and 95% CI are plotted).
Fig.1. Comparing the sum of variances of squared loadings in rows (maximizing this is the quartimax's prerogative):
Comment: Superiority of quartimax over the other criteria tend to grow as p increases or as m/p increases. Varimax most of the time is second best. Equamax and parsimax are quite similar.
Fig.2. Comparing the sum of variances of squared loadings in columns (maximizing this is the varimax's prerogative):
Comment: Superiority of varimax over the other criteria tend to grow as p increases or as m/p increases. Quartimax's tendency is opposite: as the parameters increase it loses ground. In the bottom-right part, quartimax is the worst, that is, with large-scale factor analysis it fails to mimic "varimaxian" job. Equamax and parsimax are quite similar.
Fig.3. Comparing inequality of factor variances (this is driven by coefficient $c$); the variance used as the measure of "inequality":
Comment: Yes, with growing $c$, that is, in the line Q V E P F, the inequality of factor variances falls. Q is the leader of the inequality, which tells of its propensity for "general factor", and at that its gap with the other criteria enlarges as p grows or m/p grows.
Comparing inequality of factor variances (this is driven by coefficient $c$); proportion "sum of absolute loadings of the strongest factor / average of such sums across the rest m-1 factors" was used as the measure of "inequality":
This is another and more direct test for the presence of "general factor". The configuration of results was almost the same as on the previous picture Fig.3, so I'm not showing a picture.
Disclaimer. These tries, on which the above pics are based, were done on loading matrices with random nonsharp factor structures, i.e. there were no specially preset clear clusters of variables or other specific structure among the loadings.
Kaiser normalization. From the above Fig.1-2 one can learn that versions of quartimax and varimax without the normalization perform the two tasks (the maximizations) markedly better than when accompanied by the normalization. At the same time, absence of the normalization is a little bit more prone to "general factor" (Fig.3).
The question whether Kaiser normalization should be used (and when), seems still open to me. Perhaps one should try both, with and without the normalization, and see where the applied factor interpretation was more satisfying. When we don't know what to choose based on math grounds, it's time we resort to "philosophical" consideration, what are set contrasted, as usual. I could imagine of two positions:

Contra normalization. A variable with small communality (high uniqueness) is not much helpful with any rotation. It contains only traces of the totality of the m factors, so lacks a chance to get a large loading of any of them. But we are interpreting factors mostly by large loadings, and the smaller is the loading the harder is to sight the essence of the factor in the variable. It would be justified even to exclude a variable with small communality from the rotation. Kaiser normalization is what is counter-directed to such motive/motif.
Pro normalization. Communality (non-uniqueness) of a variable is the amount of its inclination to the space of m factors from the outside (i.e., it is the magnitude of its projection into that space). Rotation of axes inside that space is not related with that inclination. The rotation – solving the question which of the m factors will and which will not load the variable – concerns equally a variable with any size of communality, because the initial suspense of the said "internal" decision is sharp to the same degree to all variables with their "external" inclination. So, as long as we are choosing to speak of the variables and not their projections inside, there's no reason to spread them weights depending on their inclinations, in the act of rotation. And, to manage to discern the essence of a factor in the variable under any size of the loading – is a desideratum (and theoretically a must) for an interpreter of factors.

Orthogonal analytic rotations (Orthomax) algorithm pseudocode
Shorthand notation:
*    matrix multiplication (or simple multiplication, for scalars)
&*   elementwise (Hadamard) multiplication
^    exponentiation of elements
sqrt(M)    square roots of elements in matrix M
rsum(M)    row sums of elements in matrix M
csum(M)    column sums of elements in matrix M
rssq(M)    row sums of squares in matrix M, = rsum(M^2)
cssq(M)    column sums of squares in matrix M, = csum(M^2)
msum(M)    sum of elements in matrix M
make(nr,nc,val)   create nr x nc matrix populated with value val

A is p x m loading matrix with m orthogonal factors, p variables

If Kaiser normalization is requested:
    h = sqrt(rssq(A)). /*sqrt(communalities), column vector
    A = A/(h*make(1,m,1)). /*Bring all communalities to unit

R is the orthogonal rotation matrix to accrue:
Initialize it as m x m identity matrix

Compute the initial value of the criterion Crit;
the coefficient c is: 0 for Quartimax, 1 for Varimax, m/2 for Equamax,
p(m-1)/(p+m-2) for Parsimax, p for Facpars; or you may choose arbitrary c:
Q = msum(A^4)
If "Quartimax"
    Crit = Q
Else
    W = rssq(cssq(A))
    Crit = p*Q – c*W

Begin iterations

    For each pair of factors (columns of A) i, j (i<j) do:
        ai = A(:,i) /*Copy out the
        aj = A(:,j) /*two factors

        u = ai^2 – aj^2
        v = 2 * ai &* aj
        @d = 2 * csum(u &* v)
        @c = csum(u^2 – v^2)
        @a = csum(u)
        @b = csum(v)

        Compute the angle Phi of rotation of the two factors in their space
        (coefficient c as defined above):
        num = @d – c * 2*@a*@b/p
        den = @c – c * (@a^2 - @b^2)/p
        Phi4 = artan(num/den) /*4Phi (in radians)
        If den>0 /*4Phi is in the 1st or the 4th quadrant
            Phi = Phi4/4
        Else if num>0 /*4Phi is in the 2nd quadrant (pi is the pi value)
            Phi = (pi + Phi4)/4
        Else /*4Phi is in the 3rd quadrant
            Phi = (Phi4 – pi)/4

        Perform the rotation of the pair (rotate if Phi is not negligible):
        @sin = sin(Phi)
        @cos = cos(Phi)
        r_ij = {@cos,-@sin;@sin,@cos} /*The 2 x 2 rotation matrix
        A(:,{i,j}) = {ai,aj} * r_ij /*Rotate factors (columns) i and j in A
        R(:,{i,j}) = R(:,{i,j}) * r_ij /*Update also the columns of the being accrued R

        Go to consider next pair of factors i, j, again copying them out, etc.

    When all pairs are through, compute the criterion:
    Crit = … (see as defined above)

End iterations if Crit has stopped growing any much (say, increase not greater than
0.0001 versus the previous iteration), or the stock of iterations (say, 50) exhausted.

If Kaiser normalization was requested:
     A = A &* (h*make(1,m,1)) /*De-normalize

Ready. A has been rotated. A(input)*R = A(output)

Optional post-actions, for convenience:
1) Reorder factors by decreasing their variances (i.e., their cssq(A)).
2) Switch sign of the loadings so that positive loadings prevail in each factor.

Quartimax and Varimax are always positive values; others can be negative.
All the criteria grow on iterations.

Answer: Rotation methods optimise heuristic fuctions with the aim of "simplifying" factor loadings. Simplicity can be defined in many different ways. The most commonly used ones come from Thurnstone [2]: sparsity, column simplicity and parsimony, row-simplicity (or complexity). Most rotation criteria address one or the other of both, their names are not really important.
Single criteria are included in families of criteria: the most comprehensive one is the  Crawford-Ferguson one, which is equivalent to the Orthomax family for orthogonal rotations. These families provide a weighing of both simplicity requirements controlled by different parameters. By changing these, almost all known rotation criteria can be obtained. An excellent and accessible overview of rotation methods is the Browne paper.
[1] M. Browne, An overview of analytic rotation in exploratory factor analysis, Multivariate Behavioral Research 36 (2001), pp. 111–150.
[2]  L. Thurstone, Multiple-factor analysis, The University of Chicago Press, 1947
Comment: Thank you for your time that you gave to answer that question of mine dear Marco. However, the central point of my question was about "what the rotation names are meaning in relation to their mathematical or statistical manipulations they are doing in the data". Why their inventors or other people gave the name "Varimax" to that specific method of rotation as well to the other types of rotation methods ? What it was its meaning;  @ttnphns answered that question quite well. If you think you can add more information on that topic feel free to do it! :) Thank you again for your time.