VS2015: The components for communicating with FTP servers are not installed

Question: I have been using Visual Studio 2010 Pro for my vb.net desktop application development. I publish the apps via clickonce to a web server with ftp. My settings look like this:
Publishing folder location: ftp://www.webaddress.com/folder/
Installation folder : http://webaddress.com/folder/
This works perfect in VS2010.
I am now trying to upgrade to Visual Studio 2015 community edition. When I try to publish my app, I get the error "The components for communicating with FTP servers are not installed". I am getting this error on both computers I have installed VS2015 on.
Strangely enough, there isn't much info on this error. The only solution I've seen is to repair the installation. I did this but still a no go.. Another cause I read about is having Xamarin installed, but I have never had that installed.
Has anybody run into this and know what the fix is??

EDIT:
It appears to not actually have anything to do with installed components. After I posted this question, I realized the publish via FTP had worked earlier on a little sample Hello World project i made (brain fart). It was only once I loaded my existing project that this error started showing up.
I closed the solution, created another simple project, and still got the error. I closed visual studio, reopened the sample project, and ftp worked! I then opened my existing project and ftp worked there too?! So I don't know what the trigger is, and I haven't had it fail again yet, but maybe this info will help figure out what is causing the failure.

EDIT (3/30/2017)
Just an update - I am still having this issue. This issue happens on visual studio 2013, 2015, and 2017. I have tried reinstalling the c++ redistributable, still nothing. It seems others are having this issue with a web project but mine is a desktop app publishing with clickonce via FTP. It must be something to do with solution I am working on that was originally created in 2010, as the issue is not present in any other project.
Comment: I have this same issue now.  I'm using VS2015 Enterprise with update 1.  I swear this worked just fine yesterday.  Today, I get "The components for communicating with FTP servers are not installed." message during publishing. I tried closing VS and re-opening; didn't help.
Comment: @SteveKennedy try some combination of closing VS, reopen and create a new sample project and see if FTP publish works. If so, then reopen existing project and see if that works. I haven't had the error appear since I did this...
Comment: Thanks. I eventually had to repair the installation - which seemed to work.  I wish I would've tried to create a new project, like you said.  Might have been easier.  Thanks.
Answer: I had the same issue with Visual Studio 2017. What fixed it for me was to start the Visual Studio Installer and install the ".NET Core cross-platform development" workload.
Comment: worked for me too. this means there is some package dependency, wonder which one
Comment: THIS IS A BUG. ┓( ´∀` )┏ choose "asp.net web development" then remove others. there will be a prompt warning you relations between. ignore it. keep "desktop development" you have before and  only single "asp.net web development". it will solve the problem. but you can't modify installation again. installer will fix the installation remove broken "asp.net web development" and you will missing ftp component again.
Comment: +1, did exactly this and it worked perfect. Tried installing the C++ redistributable and still had the error. This solution is the one that worked for me. Cheers
Answer: I had the same issue in Visual Studio 2015 / Update 3. It was resolved after installing the 32-bit version of Visual C++ Redistributable Packages for Visual Studio 2013 (https://www.microsoft.com/en-us/download/details.aspx?id=40784)
See also https://github.com/aspnet/Tooling/issues/748
Comment: The download link above is broken, however if you search for `visual c++ redistributable  site:microsoft.com` on Google you'll get to the right place. Oh and, this works.
Answer: I had the same problem with Visual Studio 2015. And Publish used to work fine so I went going crazy looking for and trying different solutions.   Then I read on another thread of doing a Setup-> Repair (submitted by Erikest).  I did a Setup->Repair and the publish process now works! I think it's also possible that the Repair not only did the trick on the FTP components but also replaced the C++ redistributable (often mentioned as a solution to this problem),
Answer: This is a total work around, but I've noticed I get this error every time I open my app (that originated in VS2010) and try to publish without first opening a sample app. I created a new project and published it to my FTP server. When I receive this error, I close Visual studio, reopen and the open the sample project, publish that app, then open my real app. The publish then works.
This works every time, and seems to be a bug in Visual studio, and probably has something to do with the fact that my app was originally built in 2010.
Maybe this will help somebody else with the same issue. It's a big pain so hopefully MS gets a fix in for this.
Answer: I have been banging my head against this problem for many months, re-installed VS over and over and just did a clean install of Windows 10 in the hope it would work but to no avail. By chance I cleaned some old .accdb files from the App_Data folder that I no longer need since I converted to SQL Server database and FTP publishing now works.
So it seems VS does not like the .accdb files but was happy with .mdb files when publishing with FTP.
As soon as I put the file back in App_Data the problem returns. Hope this is some help.
Comment: This must be for a web project? Unfortunately mine is for a desktop app, I don't see an App_Data folder anywhere. Maybe it has something to do with old database files laying around though, because I do believe I have some of those.. I'll have to check. I'm still having this issue, thinking about downgrading to 2013 to see if that solves the problem
Answer: I had the same issue here, I was using the Publish right click option on the project, which had been working fine. What fixed it for me was going back through the publish options and re-testing the connection. Publish seemed to work after that. Maybe it forgot a password or settings?
I also installed the x86 C++ Redistribution Package.
Hope this helps someone who is in the same boat.
Answer: After many successful website publishes with Visual Studio 2015 Community Edition, we experienced the "components for communicating with ftp servers are not installed" issue.  :(
First attempt at resolution was uninstalling VS Community 2015, then installing VS Community 2017.  Received the same error: "components for communicating with ftp servers are not installed"    when attempting to publish our business website.
With some work, we found that by uninstalling Microsoft Web Deploy and re-installing, this seemed to fix the problem.  We can now use Visual Studio > Publish function to our ftp without problems.
See this link for download of Microsoft Web Deploy components.
https://www.microsoft.com/en-us/download/details.aspx?id=43717
Dont know what broke this VS IDE functionality, but hope this fix helps some.
Answer: I encountered the same error with Visual Studio 2019
I fixed it by using the Visual Studio Installer to install the Web Deploy (inc .netcore 2.1) under individual components
Answer: I just did a simple "repair installation" in the installer. Worked for me.
Answer: I am using Microsoft Visual Studio Community 2019 and had this problem for a while.
The problem went away after I updated about 10 NuGet updates that were over due.
Answer: I had the same problem, I closed all the open windows I closed Visual Studio and then I opened again and published and then it worked!
Answer: VS 2015.  Same description as author in his/her edits (i.e., project specific, all my other projects publish fine).  The problem started when I changed to a new target server. It took a long time to figure this out, but what worked was simply to delete the publish profile and create a new one, clean/rebuild/build, exit VS, restart VS, problem solved.
(Must be rare problem because seven years have passed since this post.  The error message is still frequently posted with very few answers.)


Create a simple forward iterator which automatically wraps at the "end" of a circular buffer

Question: I've created a simple circular buffer by inheriting std::vector and overloading its operator[] to modulo the desired index with the vector size:
template <typename T>
class circvector : public std::vector<T> {
public:
    T& operator[](size_t index) { return *(this->data() + index%this->size()); };       // modulo index by vector size when accessing with [] operator
};

int main()
{
    circvector<int> buffer;                         // create a circvector
    buffer.resize(10);                              // resize it
    std::iota(buffer.begin(), buffer.end(), 0);     // fill with monotonically increasing integers

    for (int i = 0; i < buffer.size() * 2; i++)
        std::cout << buffer[i] << " ";              // access elements with [] beyond the circvector size is safe
}

which correctly produces the output:
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9

I would also like to create a "smart" forward input iterator which supports operator++ (increment) and operator* (dereference) and which automatically "wraps" when advancing past the last element in the vector back to the beginning of the underlying vector to which it's associated.
This hypothetical iterator would allow, for example, easier execution of some functions in the algorithm library (which often take iterators as arguments) on a subset of the circvector without adding logic to check for and then split into two separate calls when the desired subset spans the end->start wrap of the circvector.
I've been reading up on creating custom iterators but descriptions get pretty hairy with information that seemingly satisfies requirements I don't think I need.  Add to that discussion of recent deprecation of std::iterator and I'm not sure where to even begin to create my own iterator, or associate it with my circvector class.
Can someone get me started with a minimally workable template to run with?
Comment: I guess an iterator over a circular buffer is against the very idea of a circular buffer. Does `std::stack` have a `begin` and an `end`? Also, if it wraps, how will some algorithms know where the end is?
Comment: Don't waste time, use the one already made e.g. https://www.boost.org/doc/libs/1_71_0/doc/html/circular_buffer.html
Comment: @ZDF I don't see why it would be against the idea.  What would be so wrong with iterating from element "begin()+8" to "begin()+12", and allow the iterator to automatically access the underlying vector elements at the start of the vector even if "+12" would otherwise increment past the last element in the vector?  Furthermore, why not allow iterating from "begin()" to "begin()+100" if one wanted to iterate over the buffer 10 times?  I agree an end() iterator wouldn't make much sense to have.
Comment: @4xy Thanks, I've run across the boost::circular_buffer before and figured I could just plug it in and try it, but I was also hoping to use this as an opportunity to learn more about custom smart iterators as well as have a solution which is only minimally modified from a std:vector for which I'm already familiar.
Comment: I do not see any practical use. A client needs `push_back` and `pop_front`.
Comment: @ZDF There is definitely a practical use... I allocate the entire buffer at the beginning with .resize() or .assign() and have no need to add or remove elements, only replace them or access them with [] operator or with my (hypothetical) iterator if I want to jump from Nth element to N+Mth element.  The push_back() and pop_front() methods would just call the underlying default std::vector methods and actually resize the buffer instead adding or subtracting from it in the circular fashion that the overloaded [] operator provides.
Comment: @4xy Looks like the boost::circular_buffer iterators do not exhibit the behavior I require. If you advance the boost::circular_buffer<>::iterator past the size of the circular_buffer, it crashes with a read access violation.
Answer: This class appears to achieve the desired behavior, though it inherits from the deprecated std::iterator class:

template <typename T>
class circvector: public std::vector<T> {
public:
    T& operator[](size_t index_) { return *(this->data() + index_%this->size()); };     // modulo index_ by vector size when accessing with [] operator

    class iterator; // forward declaration

    iterator begin() { return circvector<T>::iterator(*this, 0); }
    iterator end() { return circvector<T>::iterator(*this, this->size()); } // will be same as begin() due to modulo in iterator constructor initializer list

private:

    class iterator : public std::iterator<std::output_iterator_tag, T> {
    private:
        circvector<T>& container_;      // NOTE: ORDER MATTERS! // dependency injection
        size_t index_{ 0 };         // NOTE: ORDER MATTERS! // state of iterator

    public:
        T& operator*() const { return container_[index_]; }                                     // this uses the overloaded operator[] which includes modulo
        iterator& operator+(int N) { index_ = (index_ + N) % container_.size(); return *this; } // random increment by N
        iterator& operator++() { index_ = (index_ + 1) % container_.size(); return *this; }     // increment with modulo
        iterator operator++(int) { return ++(*this); }                                              // just calls prefix increment: operator++()
        bool operator!=(const iterator & right) const { return index_ != right.index_ % container_.size(); }
        bool operator==(const iterator & right) const { return index_ == right.index_ % container_.size(); }
        explicit iterator(circvector<T>& container, size_t index_ = 0) : container_(container), index_(index_ % container_.size()) {}       // constructor
    };
};

It was modified from https://lorenzotoso.wordpress.com/2016/01/13/defining-a-custom-iterator-in-c/
A test program is:
int main()
{
    circvector<int> buffer;
    buffer.assign({ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });

    auto start_offset{ 8 };
    auto end_offset{ start_offset + 5 };

    for (int i = 0; i < buffer.size(); i++) std::cout << buffer[i] << " ";
    std::cout << "\n";
    std::for_each(buffer.begin() + start_offset, buffer.begin() + end_offset, [](auto& i) { i = 42; });
    for (int i = 0; i < buffer.size(); i++) std::cout << buffer[i] << " ";
}

creating output:
0 1 2 3 4 5 6 7 8 9
42 42 42 3 4 5 6 7 42 42

The use of algorithms from begin() to end() of course no longer works, since begin()==end(). But you can operate on partial segments of the buffer using algorithms (like std::for_each as shown) as long as the length is 1 less than the full buffer size.


How to access virtual property from another object in my object

Question: I have a user model, and that user has a virtual country. The country has a name which I am trying to access. It just won't print out in my view, it's just blank.
My User model has this.
public string FirstName { get; set; }
public string LastName { get; set; }
public virtual Country Country { get; set; }

And the Country model has a getName for the country.
My index looks like this:
public IActionResult Index(string sortOrder, string currentFilter,string searchString, int? page)
{
    List<User> allUsers = _userManager.Users.ToList();
    return View(allUsers);
}

Now, when I try to show it on my Index page like this:
@foreach (var item in Model)
{

        <input type="checkbox" class="flat" name="table_records">

    @Html.DisplayFor(modelItem => item.FirstName) @Html.DisplayFor(modelItem => item.LastName)
    @Html.DisplayFor(modelItem => item.Email)
    @Html.DisplayFor(modelItem => item.Country.Name)
    @Html.DisplayFor(modelItem => item.City)

the firstname, lastname, email and city show up. But the Country name doesn't. How can that be?
Comment: can you paste please the body of your _userManager to show how you set the Users property? It might be a case of just adding the `dbcontext.Users.Include(x => x.Country)`
Comment: The answers below are assuming you are using Entity Framework. If you are please add the appropriate tag (Entity-Framework-6 or Entity-Framework-Core). Otherwise add some info about the ORM you are using.
Answer: Looks like the County model is never getting loaded from the database before you do the .ToList() ... After that ToList call, then the objects are detached from the database and lazy loading wont work.
Try this:
_userManager.Users.Include("Country").ToList();
Also, just taking out the ToList() call would probably allow lazy loading to work but would be a performance issue if the user list becomes large.
Thanks,
Gary
Comment: this worked! thanks! My list of users is very large. Around 9000 so wont try without ToList()
Answer: You should have no problem accessing virtual properties from the view. Make sure you are either calling Country.getName() or your Name property has a getter like
public string Name { get; }

Also by convention C# methods are Pascal Case.
Answer: Try to add the Include(x => x.Country) in the place where you set the _userManager/Users property, it should be just something like
dbcontext.Users.Include(x => x.Country)

Please notice that Include should be added before calling things like ToList();, to make sure the generated SQL query contains the needed logic.


Short question regarding flow on the general linear group

Question: Say that we have a vector field on $GL(n,R)$, given by $A \rightarrow (A,A^2)$ (I mean the matrix power here). If we try to find the flow of this vector field, I get that it should be:
$X(A,t) = e^{tA^2}A$, where $e^{tA^2}$ is the matrix exponential here. However, since I feel somewhat unsure about the material, I am not sure that my approach is correct. Could someone either give some confirmation as to that this method is correct, and if so, does it follow that our vector field will be a complete one? I strongly suspect that such is the case.
If I'm wrong I'd love some hint that might put me in the right direction.
Comment: When you say "I get that it should be", do you mean that you know from an authoritative source that this is a correct solution, or that you feel intuitively that this ought to be the solution?
Comment: Just my own limited knowledge on solving matrix differential equations. Nothing more than that. So if you have any thoughts on this, I'd love to hear it.
Answer: I have tried a bit of googling to find a sense of "the flow of a vector field" where $X(A,t)=e^{tA^2}A$ would be a correct solution, but in vain. You require $\frac{d}{dt}X(A,t) = X(A,t)^2$ and $X(A,0)=A$, right?
In that case, for $GL(1,\mathbb R)$ it reduces to an ordinary differential equation $\frac{dy}{dt}=y^2$ which is easily solved to find $y=\frac{1}{y_0^{-1}-t}$ which is significantly different from $y=e^{ty_0^2}y_0$
On the other hand, intuitively and by analogy to the real case, $X(A,t) = (A^{-1}-tI)^{-1}$ ought to work. If $A$ has a positive real eigenvalue this makes sense only for $t<1/\lambda$ where $\lambda$ is the largest such eigenvalue, but that parallels the vertical blowup of the real solution and so is to be expected. (And, applying Cramer's rule we see that the inverse really does escape to infinity before it stops making sense).
Comment: I can't seem to comment, but yes, You seem right. Where could one read more about solving differential equations like this for matrices?
Comment: @Shaf_math, You accidentally created a duplicate account; with fewer than 50 reputation points, [an account can only comment on its own questions and answers](http://meta.stackexchange.com/questions/19756/how-do-comments-work/19757#19757). I have now merged your duplicate account into your current account (the one used to ask the question), so you will now be able to comment here (and anywhere, once you have >50 points). If you have trouble logging in, or if you accidentally create duplicate accounts, simply flag one of your own questions for moderator attention, and we will help out.
Comment: @Shaf: I don't actually know how to do this systematically myself, so I cannot recommend literature, sorry. The general procedure I follow when I have to is to pretend everything are reals, be careful about the order of factors, and hope there's a natural way to generalize the solution back to matrices when I'm done. Proving the generalized solution correct must then be done in a separate step.


Problema tr escondida nao mostra no sitio certo depois de retornado json

Question: Tenho uma tabela que me lista todos os utilizadores, uma tr escondida em que quando clico no botão mostrar jogadores abre mostra essa tr com uma tabela dentro lista abaixo do utilizador que eu estou a querer mostrar os jogadores dele.
O que me esta acontecer e que por exemplo listo 6 utilizadores clico no botão mostrar jogadores do primeiro utilizador, mostra a tr escondida em ultimo lugar da tabela invés de mostrar logo abaixo primeiro utilizador
JQUERY
$(document).on("click", "#show_jogadores", function(e) {
    e.preventDefault();
    var id_agente = $(this).data("id-agente");
    $('#content-'+id_agente+'').toggle();
});

HTML

        Função

    Username
    Moeda
    Jogadores
    Credit Line
    Total disponível
    Balance
    Total Players Balance
    Crédito disponível
    Ações

@foreach($lista_tree as $agent_tree)

user_id }}" class="fa fa-plus" data-tt-parent="" style="float: left; font-size: 18px; margin: 3px 5px 0px 0px; cursor: pointer;">

user_id }}" class="fa fa-plus" data-tt-parent="" style="float: left; font-size: 18px; display: none; margin: 3px 5px 0px 0px; cursor: pointer;">

user_id }}" class="fa fa-minus" data-tt-parent="" style="float: left; font-size: 18px; display: none; margin: 3px 5px 0px 0px; cursor: pointer;">

{{ $agent_tree->sign }}

        {{ $agent_tree->username_agente }}

        {{ $agent_tree->code }}

        {{ $agent_tree->count_players }}

        {{ number_format($agent_tree->credit_line,2,",","") }} €

        {{ number_format($agent_tree->balance_agentes,2,",","") }} €

        @if($agent_tree->balance_real < 0)

 {{ number_format($agent_tree->balance_real,2,",","") }} €

        @else

 {{ number_format($agent_tree->balance_real,2,",","") }} €

        @endif

        {{ number_format($agent_tree->balance_player,2,",","") }} €

        @if($agent_tree->balance_real < 0)
            {{ number_format($agent_tree->balance_agentes -+ $agent_tree->balance_real,2,",","") }} €
        @else
            {{ number_format($agent_tree->balance_agentes - $agent_tree->balance_real,2,",","") }} €
        @endif

user_id }}" style="width: 100px; height: 30px; border: 1px solid #c2c5cd; text-align: center; line-height: 28px; float: left; border-right: none; cursor: pointer;">

JOGADORES

            user_id }}" class="fa fa-angle-down" aria-hidden="true">

user_id }}" style="width: 130px; margin-top: 30px; background-color: white; border: 1px solid #c2c5cd; z-index: 10; position: absolute; display: none; border-top: none;">

user_id }}" style="text-align: center; line-height: 30px; cursor: pointer;">INFORMAÇÕES

@endforeach

user_id }}" style="display: none;" bgcolor="#d6d6df">

                            ID do Jogador

                        Username
                        Primeiro Nome
                        Sobrenome
                        Balance
                        Ações

                     @foreach($players as $players_dados)

                            {{ $players_dados->id }}

                            {{ $players_dados->username }}

                            {{ $players_dados->f_name }}

                            {{ $players_dados->l_name }}

                            {{ number_format($players_dados->balance,2,",","") }} €

                                <button type="button" data-toggle="modal" data-target="#modal-add-credito-jogador" id="add-credito-btn-jogador" data-id-jogador="{{ $players_dados->id }}" class="btn btn-success"></button>
                                <button type="button" data-toggle="modal" data-target="#modal-update-senha" id="change-pwd-btn" data-id-jogador="{{ $players_dados->id }}" class="btn btn-success"></button>

                    @endforeach

Como podem ver na foto a seta amarela aquele conteudo deveria de mostrar abaixo do utilizador carlos e mostrou em baixo.
JSON
  $return['conteudo'] .= '

parent.'">

                    '.$botao_mais.'

'.$resultado->sign.'

                    '.$resultado->username_agente.'

                    '.$resultado->code.'

                    '.$resultado->count_players.'

                    '.number_format($resultado->credit_line,2,",","").' €

                    '.number_format($resultado->balance_agentes,2,",","").' €

                    '.$balance.'

                    '.number_format($resultado->balance_player,2,",","").' €

                   '.$credito_disponivel.'

user_id.'" style="width: 100px; height: 30px; border: 1px solid #c2c5cd; text-align: center; line-height: 28px; float: left; border-right: none; cursor: pointer;">

JOGADORES

                        user_id.'" class="fa fa-angle-down" aria-hidden="true">

user_id.'" style="width: 130px; margin-top: 30px; border: 1px solid #c2c5cd; background-color: white; position: absolute; z-index: 10; display: none; border-top: none;">

user_id.'" data-my-balance="'.Auth::user()->balance_real.'" data-my-available-credit="'.Auth::user()->credit_line.'" data-id-line="'.$resultado->balance_real.'" data-id-credit-line="'.$resultado->credit_line.'" style="text-align: center; line-height: 30px; cursor: pointer;">TRANSFERIR

user_id.'" style="text-align: center; line-height: 30px; cursor: pointer;">INFORMAÇÕES

user_id.'" style="text-align: center; line-height: 30px; cursor: pointer;">SENHA

MENSAGEM

user_id.'" style=" display:none; bgcolor="#d6d6df">

                                        ID do Jogador

                                    Username
                                    Primeiro Nome
                                    Sobrenome
                                    Balance
                                    Ações

                                '.$conteudo_players.'

        ';

    }
    return response()->json($return);
}

Comment: Não consigo ver a imagem, então me diga: ele mostra a  certa, só que por ultimo na tabela? Ou mostra a ultima  da tabela?
Comment: ele mostra a tr certa so nunca no lugar certo tem que aparecer sempre abaixo do utilizador
Comment: Se tu tirar o display none da  ela tá carregando no lugar certo?
Comment: tambem nao os utilizadores vao listando quando clico num botao mais retorna um json que tras os utilizadores filhos e essa tr escondida mas tirei o display:none e nao esta a mostrar no sitio certo
Comment: Então o problema não é nesse código js e nem no show/hide do elemento. Talvez tu deva mudar a pergunta ou ir fazendo testes isolados pra descobrir o problema. =T
Comment: Coloquei o php que e retornado tem a tal tr abaixo o problema deve ser ai veja agora se me consegue ajudar
Answer: Não estou seguro de qual pré-processador estás a utilizar para poderes usar             esses elementos @if/@foreach/etc, mas está claro que o problema está na ordem que constróis estas tabelas:

        @foreach($lista_tree as $agent_tree)

user_id }}"
                     style="/* estilos CSS */">

JOGADORES

        @endforeach

user_id }}" style="display: none;"
            bgcolor="#d6d6df">

                            @foreach($players as $players_dados)

                            @endforeach

Como vês, crias uma tabela, e depois de abrires o
 iteras sobre os utilizadores, criando uma linha
 para cada um. Depois de iterares por todos eles, crias uma última linha
, oculta, e dentro dela crias outra tabela em cujo corpo iteras sobre $players para listares os jogadores de um único utilizador (provavelmente o último).
O que queres, na realidade, é terminar aquele @endforeach imediatamente antes da tag de fechamento
 em vez de fazê-lo imediatamente após a tag
, como estás fazendo. Assim ele gerará um par de
s, uma para cada utilizador, alternadamente do utilizador e dos jogadores respetivos.
O código corrigido ficaria assim:

                Função

            Username
            Moeda
            Jogadores
            Credit Line
            Total disponível
            Balance
            Total Players Balance
            Crédito disponível
            Ações

        @foreach($lista_tree as $agent_tree)

user_id }}" class="fa fa-plus" data-tt-parent="" style="float: left; font-size: 18px; margin: 3px 5px 0px 0px; cursor: pointer;">

user_id }}" class="fa fa-plus" data-tt-parent="" style="float: left; font-size: 18px; display: none; margin: 3px 5px 0px 0px; cursor: pointer;">

user_id }}" class="fa fa-minus" data-tt-parent="" style="float: left; font-size: 18px; display: none; margin: 3px 5px 0px 0px; cursor: pointer;">

{{ $agent_tree->sign }}

                    {{ $agent_tree->username_agente }}

                    {{ $agent_tree->code }}

                    {{ $agent_tree->count_players }}

                    {{ number_format($agent_tree->credit_line,2,",","") }} €

                    {{ number_format($agent_tree->balance_agentes,2,",","") }} €

                    @if($agent_tree->balance_real < 0)

 {{ number_format($agent_tree->balance_real,2,",","") }} €

                    @else

 {{ number_format($agent_tree->balance_real,2,",","") }} €

                    @endif

                    {{ number_format($agent_tree->balance_player,2,",","") }} €

                    @if($agent_tree->balance_real < 0)
                        {{ number_format($agent_tree->balance_agentes -+ $agent_tree->balance_real,2,",","") }} €
                    @else
                        {{ number_format($agent_tree->balance_agentes - $agent_tree->balance_real,2,",","") }} €
                    @endif

user_id }}" style="width: 100px; height: 30px; border: 1px solid #c2c5cd; text-align: center; line-height: 28px; float: left; border-right: none; cursor: pointer;">

JOGADORES

                        user_id }}" class="fa fa-angle-down" aria-hidden="true">

user_id }}" style="width: 130px; margin-top: 30px; background-color: white; border: 1px solid #c2c5cd; z-index: 10; position: absolute; display: none; border-top: none;">

user_id }}" style="text-align: center; line-height: 30px; cursor: pointer;">INFORMAÇÕES

user_id }}" style="display: none;" bgcolor="#d6d6df">

                                        ID do Jogador

                                    Username
                                    Primeiro Nome
                                    Sobrenome
                                    Balance
                                    Ações

                                @foreach($players as $players_dados)

                                            {{ $players_dados->id }}

                                            {{ $players_dados->username }}

                                            {{ $players_dados->f_name }}

                                            {{ $players_dados->l_name }}

                                            {{ number_format($players_dados->balance,2,",","") }} €

                                                <button type="button" data-toggle="modal" data-target="#modal-add-credito-jogador" id="add-credito-btn-jogador" data-id-jogador="{{ $players_dados->id }}" class="btn btn-success"></button>
                                                <button type="button" data-toggle="modal" data-target="#modal-update-senha" id="change-pwd-btn" data-id-jogador="{{ $players_dados->id }}" class="btn btn-success"></button>

                                @endforeach

        @endforeach

Quanto ao teu "JSON" (na verdade, PHP que retorna um fragmento de HTML dentro de o que suponho ser um dicionário JSON), ele parece correto, assumindo que o } que puseste na antepenúltima linha (antes do return response()->json($return);) é o final de um loop que itera sobre os utilizadores e que $conteudo_players é corretamente gerado para cada utilizador nesse loop putativo. Só não percebo por que há duas maneiras de gerar a mesma tabela, mas esse código deveria estar correto.
Comment: Nao percebi como o codigo como colocou na resposta esta igual ao meu pelo menos pelo que vejo diga-me se estou enganado
Comment: Estás enganado: Nota como, no teu código, o primeiro `@endforeach` está _imediatamente antes_ da linha `` além do fim do código que puseste na pergunta (o teu html só vai até o fechamento da `` interna que contém as informações dos jogadores).
Comment: Eu nao estou a perceber peco desculpa podes editar a resposta e por como deve ficar exactamente o meu html que pus na pergunta da maneira certa
Comment: E tambem como deve ficar o JSON se faz favor eu retorno o json por jquery atraves da funcao after()
Comment: Pus o HTML corrigido, só com alguns comentários dizendo `` para chamar a atenção às diferenças com o código que postaste. Vê se resta alguma dúvida, e se puderes, explica por que e como esse _markup_ que geras por AJAX substitui o que geras usando esse código HTML + preprocessador.
Comment: Corrigi da forma que puses-te mas nao resolveu depois de listar todos eu abro cada jogador o primiero por exemplo abre abaixo de todo da tabela os utilizadores que tem o icon + carrego lista os utilizadores abaixo associados a ele se abrir nesses utilizadores a listagem dos jogadores aparece no sitio certo mas o utiliuzador pai se for ver os jogadores dele mostra no fim da tabela tambem
Comment: Não sera porque eu estou a usar isto var pai = $(this).parent().parent(); e depois para listar os users qaundo carrego no + uso isto pai.after(data.conteudo); nao sera por isso
Comment: Se `this` se refere ao `` com o ícone `+` que carregas, sim, mas pode ser que o evento esteja pendurado no `` que é o pai dele. Talvez seja mais seguro que uses `$(this).parent('tr')`, que buscará entre os ancestrais de `this` o mais recente que se adeque ao seletor que passas por parâmetro — neste caso concreto, a primeira _tag_ `` que ele encontrar. De todo modo, verifica pra mim quem é o `this` quando essa variável `pai` é definida.
Comment: sim o this se refere  acho eu normalmente o this e assim eu meti parent('tr') e ao clicar no mais nem lista nada
Comment: isto var pai = $(this).parent().parent(); foi feito por um amigo meu e funciona mas penso que nao e o mais correcto isso foi feito para que quando clicar no mais listar sempre os users associados a ele abaixo dele  pode ser isso que esta a dar problemas porque nao essa a forma correcta


Copy_from command to copy values of dictionary in a table

Question: I want to insert values that are stored in a dictionary into a table. This dictionary contains  1000000 values.
The sample of my dictionary is :
 mydictationary: {"a":1; "b":2; "c":3; "d":4}

I am looking forward to use copy_from command (psycopg2) to copy these values into a table.
Something like:
cur.copy_from (mydictationary, myTable)

But is it possible to use copy_from command inorder to copy values from dictionary??? I want to use copy_from command as this might be faster than using sql insert statement.
Answer: Normal way to do it:
cur.executemany('INSERT INTO myTable (key, value) VALUES (%s, %s)', mydictionary.items())

If you insist on using StringIO
import StringIO
dictFile = StringIO.StringIO()
for item in dictionary.iteritems():
    dictFile.write("%s\t%s\n"%item)
cur.copy_from(dictFile, 'myTable')

Comment: But can't we use copy_from command , as we used to do while copying data from stdin or from buffer?? something like: data = StringIO.StringIO() and then, copy_from(data, mytable), And also I got syntax error as, psycopg2.ProgrammingError: syntax error at or near ":"
Comment: that's because psycopg2 doesn't understand that style of arguments.


Explaining Fixed and Random Effects

Question: Let's say that I am trying to predict the Sepal Length in
Iris data from Sepal Width, Petal Width, and Petal Length variables.
Say, we noted that Petal Length and Petal Width are grouped as described by the Species variable.
I am using the following mixed-effects model for this.
libraray(lme4)

fit <- lmer(Sepal.Length ~ Sepal.Width + Petal.Length +  Petal.Width +
             (1 + Petal.Length + Petal.Width | Species), data = iris)

My question is how to explain this model concisely in plain language?
For example:
In our mixed-effect model, we considered Petal Length and Petal Width
to be random effect variables as they may contain variation that can be
explained from the Species variable. Further, we assumed all three
Sepal Width, Petal Length, and Petal Width are fixed-effect variables.
Comment: I probably wouldn't fit a mixed model to a situation like this (see [here](https://stats.stackexchange.com/a/34979/), eg), although this may be just an example to illustrate your question.
Comment: @gung, thanks a lot for pointing this out. Although this is an example, I did not realize that the number of "Species" levels has to be large. Any idea on how to determine which would be a sufficiently large number?
Comment: I don't know that there's a fixed number. You'll see different recommendations: some will say 30, others will say 100. I just wouldn't do it with 3.
Answer: What about

We assume that the sepal length of these three species of iris flowers
  depends on petal length and petal width in a somwhat similar way.
  Thus, it makes sense to learn from one species to better understand
  the relationship in the other two species.

If you want to further go into implied assumptions like exchangeability (there's of course also the linearity of the relationship, normality of random effects and so on), perhaps

We assume that we know nothing up-front about whether we would expect
  one of these three species to have a higher average sepal length, or a
  sepal length that depends more strongly on the petal length and width.

Of course, in the particular example things are especially tricky, because you only have three species so estimating the between species standard deviation is difficult. Additionally, you can know a lot from the literature without looking at the data that would make exchangeability questionable.
Answer: I typically suggest to people to write it is as follows:

To account for the correlations of sepal length measurements within a flower species we fitted a linear mixed-effects model. In the fixed-effects part, we included the linear effects of sepal width, petal length, and petal widths. In the random-effects part, we included intercepts and linear random slopes for petal length and petal width.

In case you have done so, you can also write:

The assumptions of the model were evaluated using residuals plots. The random-effects structure was selected using likelihood ratio tests, and p-values for the fixed effects coefficients are based on F- and t-tests using the Satterthwaite's approximation for the degrees of freedom. The models were fitted in R using packages lme4 and lmerTest.

Explaining Fixed and Random Effects


How to tackle this polynomial given as a determinant?

Question: Let $$p (x) = \begin{vmatrix}
1 & x & x & \dots & x & x \\
x & 1 & x & \dots & x & x \\
x & x & 1 & \dots & x & x \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
x & x & x & \dots & 1 & x \\
x & x & x & \dots & x & 1 \\
\end{vmatrix} .$$
How to find the (multiple) zeroes, the degree of the polynomial and the initial coefficient, all depending on the natural number $b$?
Comment: What $b$?There is no $b$ in your question.
Answer: Add all columns (from second one) to the first one and then substract first row from all the rest:
$$\begin{vmatrix}1+(n-1)x&x&x&\ldots&x\\0&1-x&0&\ldots&0\\0&0&1-x&\ldots&0\\..&..&..&..&..\\0&0&0&\ldots&1-x\end{vmatrix}=\left(1+(n-1)x\right)(1-x)^{n-1}$$
Answer: Hint: You can determine the characteristic polynomial of the corresponding matrix. Note that the matrix is symmetric and therefore diagonalizable. Now $-x + 1$ is an eigenvalue with a geometric multiplicity of at least $n - 1$ and the sum of all eigenvalues [according to their algebraic multiplicity] is equal to the trace of the matrix.
Once you've calculated the characteristic polynomial you can determine $p(x)$ by plugging in $\lambda = 0$.
Comment: I don't understand your question.
Comment: n-1  zeros are only 1 ?
Comment: I do not understand, which numbers are zeros ?
Comment: You first need to calculate the characteristic polynomial, then you will be able to calculate the zeroes of $p$.
Comment: Actually, you don't really *need* to exhibit the characteristic polynomial, as the determinant is simply the product of eigenvalues (but both ways to view this are equivalent, of course). @Algebra2015 see also this: http://math.stackexchange.com/questions/507641/show-that-the-determinant-of-a-is-equal-to-the-product-of-its-eigenvalues
Comment: So, how to at the end write down the polynom, depending on the natural number n ?


Leibniz-rule for Lie-derivative: special case for 1-forms

Question: I have to prove the following statement for a 1-form $\alpha\in\Omega^{1}(\mathcal{M})$ and two vector fields $X,Y\in\mathfrak{X}(\mathcal{M})$:
$$\mathrm{d}\alpha (X,Y) = X(\alpha(Y))-Y(X(\alpha))-\alpha([X,Y])$$
For this proof I have to use the general formula
$$\mathcal{L}_{u}(\omega(v_{1},\dots,v_{n})) = (\mathcal{L}_{u}\omega)(v_{1},\dots,v_{n}) + \omega(\mathcal{L}_{u}v_{1},v_{2},\dots,v_{n}) + \omega(v_{1},\mathcal{L}_{u}v_{2},v_{3},\dots,v_{n})+\dots
 +\omega(v_{1},\dots,\mathcal{L}_{u}\dots,v_{n})$$
for a k-form $\omega\in\Omega^{k}(\mathcal{M})$ and vector fields $u,v_{1},\dots,v_{n}\in\mathfrak{X}(\mathcal{M})$.
Using this formula for my special case of a 1-form $\alpha$ I received
$$\mathcal{L}_{X}(\alpha(Y))=(\mathcal{L}_{X}\alpha)(Y)+\alpha(\mathcal{L}_{X}Y)$$
Using:
(1) $\alpha(\mathcal{L}_{X}Y) = \alpha([X,Y])$
(2) $\alpha(X)\in\mathcal{C}^{\infty}(\mathcal{M})$ $\Rightarrow$ $\mathcal{L}_{X}(\alpha(Y))=X(\alpha(Y))$
(3) $(\mathcal{L}_{X}\alpha)(Y) = (\mathrm{d}i_{X} + i_{X}\mathrm{d})\alpha(Y) = \mathrm{d}\alpha(X,Y) + i_{X}\mathrm{d}\alpha(Y)$
I get the formula:
$$\mathrm{d}\alpha(X,Y) = X(\alpha(Y)) - i_{X}\mathrm{d}\alpha(Y) -\alpha([X,Y]) $$
So to finish the proof, I have to show that $i_{X}\mathrm{d}\alpha(Y) = Y(X(\alpha))$....But I can`t see why this is the case...
Can someone explain it to me?
Thank you!
Comment: You'd better start by repairing #3.  $\mathscr L_X \alpha = \iota_X(d\alpha) + d(\iota_X\alpha)$. This is not remotely what you wrote down.
Answer: First you should check the formula you are trying to prove. I think it is
$$\mathrm{d}\alpha (X,Y) = X(\alpha(Y))-\underline{Y(\alpha(X))}-\alpha([X,Y]),$$
since $X(\alpha)$ doesn't make sense.
Next as Ted Shifrin said, you should check your computation for (3). You should do
$$(\mathcal L_X \alpha)(Y) = [(\mathrm d i_X + i_X \mathrm d)\alpha] (Y) = [\mathrm d (i_X\alpha)](Y) + (i_X\mathrm d\alpha)(Y).$$
I put extra brackets to help clarify the order of operations.
For the first term, $i_X\alpha = \alpha(X)$ is a smooth function. Then using $\mathrm d f(X) = Xf$ for any function $f$,
$$[\mathrm d (i_X\alpha)](Y) = [\mathrm d(\alpha(X)](Y)=Y\alpha(X).$$
For the second term, $\mathrm d\alpha$ is a 2-form. Using $i_X\omega(Y) = \omega(X,Y)$ for any 2-form $\omega$,
$$(i_X\mathrm d\alpha)(Y) = \mathrm d\alpha(X,Y).$$


Solve equation $x^{32}=1$ in $\mathbb{Z}_{128}.$

Question:
Solve equation $x^{32}=1$ in $\mathbb{Z}_{128}.$

Attempt. Let $x \in \mathbb{Z}_{128}$ be such that $x^{32}=1$. Then $x$ is invertible, so $x$ belongs in $U(\mathbb{Z}_{128})$, the set of all invertible elements of $\mathbb{Z}_{128}$ (having $\varphi(128)=64$ elements). On the other hand, if $x\in U(\mathbb{Z}_{128})$, then $\mathrm{gcd}(x,128)=1$, so $x$ is odd, i.e. $x=2k+1$. So in order to have $x^{32}=1$, we have $(2k+1)^{32}=1$, that is $(4k^2+4k+1)^5=1$. Here is where i am stuck.
A second thought was to reduce the problem like: $x^{32}=1$, i.e. $(x^{16})^2=1$, so $x^{16}=1$ or $-1$.
Thanks in advance.
Comment: $x^2 = 1 \ \Rightarrow \ x = \pm 1$ *only* is valid in $\mathbb Z_p$, where $p$ is a prime number. So, your second try doesn't go in the right track.
Comment: @Azif00:  there are composite $n$ where $x^2\equiv 1\implies x\equiv\pm1\pmod n$ is valid (e.g., twice a prime, square of prime), but indeed it's not valid for $n=128$
Answer: Hint:
If $2\mid n-1$ then $8\mid n^2-1, 2\mid n^2+1, 2\mid n^4+1, 2\mid n^8+1, $ and $2\mid n^{16}+1$.
On the other hand, if $2\mid n$ then $2\nmid n^{128}-1$.
Answer: The multiplicative group $(\mathbb{Z}/128\mathbb{Z})^\times$ is isomorphic to $\mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/32\mathbb{Z}$, and in this group every element has order that divides $32$. It follows that every $n \in (\mathbb{Z}/128\mathbb{Z})^\times$ (that is, every residue class of an odd integer) is a solution to $x^{32} - 1 = 0$, ,and it is clear that there cannot be any other solution.
Answer: Hint
$(2k+1)^2=8k(k+1)/2+1=8c+1$ (say)
$(2k+1)^4=(8c+1)^2=16c(4c+1)+1=16d+1$(say)
and so on
Alternatively using http://mathworld.wolfram.com/CarmichaelFunction.html to validate the exponent
we need $\lambda(128)=2^{7-2}$
So, any $x$ with $(x,2)=1$ will satisfy the given congruence
Answer: It's well-known that $\Bbb Z_{128}^×$ isn't cyclic.   Since it's abelian, and has order $\varphi (128)=64$, we can get that, by FTFAG, every element has order dividing $32$ (for the orders of all the cyclic summands must divide $32$) and thus satisfies the congruence.
On the other hand, $x^{32}\cong1\pmod {128}\implies x$ is a unit.


Is it possible to check if two numbers are equal only with arithmetic operators?

Question: I'm trying to find a function f(x,y) that returns 1 if the numbers are equal or 0 otherwise.
But I cannot wrap my head around it since I can't use functions like floor/ceil/absolute val.
Comment: Are all functions you are allowed to use continuous? Are you allowed to use limits?
Comment: just arithmetic operators
Answer: This suggestion may raise a heated discussion, but
$$f(x,y)=0^{(x-y)^2}$$
works. Note that $0^0=1$ whereas $0^a=0$ for any $a>0$.
Comment: This is a very interesting and creative idea but I note that there is not a consensus on the value of $0^{0}$. Possibilities include $0$, $1$ and undefined. https://en.wikipedia.org/wiki/Zero_to_the_power_of_zero
Comment: @SimonTerrington The heated discussion has begun!
Comment: :) and by the way I don't have a better idea and I really like your answer.


Product of Stirling Numbers of the first kind

Question: I have been messing around with coefficients of various polynomials and was wondering if there was a way to reduce the following stuff.
Let polynomial, $b(x,t_i)=\sum\limits_{k=0}^{t_i}s(t_i,k)x^{t_i-k}$
Which was generated from the manipulating the falling factorial $(x+t_i-1)(x+t_i-2)...(x)$
Now let the polynomial $\prod\limits_{i=1}^{q}b(x,t_i)=\sum\limits_{k=0}^{m-q}D_k x^{m-k}$ And Where $m=\sum\limits_{i=1}^{q}t_i$
From what I have figured out each $D_k$ resembles a product of stirling numbers of the first kind.
$D_k=\sum\limits_{e_1+e_2...+e_q=k}^{}s(t_1, e_1)s(t_2, e_2)...s(t_q, e_q)$
This is kind of an unwieldy form so I was wondering if there was some way to simplify and write this in better terms. Since $\sum t_i=m$ and $\sum e_i=k$ is it possible to write this in terms of $m,k$?
Thanks guys, I know this problem is a long one and was just wondering if there was some identity to help simplify this mess.
Comment: Just to be sure about notations: usually Stirling numbers of the first kind are defined such that $$\sum_{k=0}^ns(n,k)x^k=x(x-1)\dots(x-n+1).$$ Using this identity I find that $$b(x,n)=\sum_{k=0}^ns(n,k)x^{n-k}=x^n(x^{-1})(x^{-1}-1)\dots(x^{-1}-n+1)\\=(1-x)(1-2x)\dots(1-(n-1)x).$$ Is that correct ?
Answer: If the values of $t_i$ are not specified, there cannot be any closed formula for $D_k$ depending only on $m$ and $k$, because the product of $b(x,n)$ rewrites as
$$ (1-x)^{p_1}(1-2x)^{p_2}\dots(1-rx)^{p_r}$$
where $p_k=\text{#}\{t_i\leq k\,|i=1,\dots,q\}$ and $r$ is the largest value among the $t_i$'s.
Comment: I really like the form you expressed it in. Would it be possible for you to provide a link to where you got the equations that led to your final form?
Comment: There is no reference, this is a simple counting from the expression of $b(x,n)$ I wrote in commenting your question.


Find minimum of scipy.interpolate.Rbf

Question: I'm interpolating a dataset using scipy.interpolate, which gives a heatmap (z values as a function of x, y):
rbf = scipy.interpolate.Rbf(x, y, z, function='cubic')
zi = rbf(xi, yi)

Finding the shape reveals:
zi.shape = (150L, 150L)

How can I find the minimum and maximum values of zi?
Comment: `numpy.min(zi)`, `numpy.max(zi)`? Note that you can also use `scipy.optimize.minimize()` to search for the actual extrema of the interpolating function.
Answer: finding minimum: np.min(zi)
finding maximum: np.max(zi)
Comment: Please use the edit link on your question to add additional information. The Post Answer button should be used only for complete answers to the question. - [From Review](/review/low-quality-posts/11626895)
Comment: @jezrael actually, this is the answer to the question (which explains why I only commented on it)
Comment: I posted the answer shortly after, then deleted it because it seemed trivial. Looking back, it wasn't apparent to me. I tried `scipy.optimize.minimize()`, but couldn't get it to work properly.
Comment: That would mean using something like `res=scipy.optimize.minimize(lambda xy: rbf(*xy),[x0,y0])` where you've determined `[x0,y0]` from your current solution with a rough mesh. If course if your function has only single extrema, you can choose any reasonable starting point. And this will find you the minimum position, `res.x`, so the actual minimum would be `rbf(*res.x)`. And you can find the maximum by minimizing `-rbf()`. If this doesn't help and you really need it, let me know and I'll add an answer.

Find minimum of scipy.interpolate.Rbf


java.lang.NoClassDefFoundError: org/jdom2/JDOMException and java.lang.ClassNotFoundException for xmldsig

Question: Task: Integrating my servlet filter code in the already existing project.

Technologies used: servlet filter (JDK 1.6), spring, JBoss.(I have JDK 1.8 running in my local) and the existing project is also in Java 1.8

The project compiled without any errors but when I run it on the server. I am facing NoClassDefFoundError: org/jdom2/JDOMException and NoClassDefFoundError: xmdsig exception alternatively.
What I have tried and failed with:
   - adding JDOM jar
   - adding Jdom 1.1.3 jar file
   - adding JDOM 2.0.0 jar file and migrated it to JDOM2.
   - added  xmldsig.jar
   - added javax.xml1.4.jar
but still, I keep getting the same exceptions.
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jdom2.JDOMException from [Module "deployment.dcs-adminui-1.0.0-SNAPSHOT.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 41 more

14:25:51,624 ERROR [io.undertow.request] (default task-10) UT005023: Exception handling request to /dcs-adminui-1.0.0-SNAPSHOT/: java.lang.NoClassDefFoundError: org/jdom2/JDOMException
    at com.adminui.servlet.FilterOne.doFilter(FilterOne.java:74)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jdom2.JDOMException from [Module "deployment.dcs-adminui-1.0.0-SNAPSHOT.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 41 more

14:25:51,778 ERROR [io.undertow.request] (default task-12) UT005023: Exception handling request to /dcs-adminui-1.0.0-SNAPSHOT/: java.lang.NoClassDefFoundError: org/jdom2/JDOMException
    at com.adminui.servlet.FilterOne.doFilter(FilterOne.java:74)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jdom2.JDOMException from [Module "deployment.dcs-adminui-1.0.0-SNAPSHOT.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 41 more

14:25:52,110 ERROR [io.undertow.request] (default task-13) UT005023: Exception handling request to /dcs-adminui-1.0.0-SNAPSHOT/: java.lang.NoClassDefFoundError: org/jdom2/JDOMException
    at com.adminui.servlet.FilterOne.doFilter(FilterOne.java:74)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jdom2.JDOMException from [Module "deployment.dcs-adminui-1.0.0-SNAPSHOT.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 41 more

14:25:52,380 ERROR [io.undertow.request] (default task-15) UT005023: Exception handling request to /dcs-adminui-1.0.0-SNAPSHOT/: java.lang.NoClassDefFoundError: org/jdom2/JDOMException
    at com.adminui.servlet.FilterOne.doFilter(FilterOne.java:74)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jdom2.JDOMException from [Module "deployment.dcs-adminui-1.0.0-SNAPSHOT.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 41 more

14:25:52,881 ERROR [io.undertow.request] (default task-17) UT005023: Exception handling request to /dcs-adminui-1.0.0-SNAPSHOT/: java.lang.NoClassDefFoundError: org/jdom2/JDOMException
    at com.adminui.servlet.FilterOne.doFilter(FilterOne.java:74)
    at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
    at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
    at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
    at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)
    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jdom2.JDOMException from [Module "deployment.dcs-adminui-1.0.0-SNAPSHOT.war" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:412)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:400)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    ... 41 more

Answer: There could be two scenarios :

You have two JDOM versions. One used during build process and the other used during deployment.  Your app might be still looking for a class used during build process, though it couldn't find it in the JDOM jar version deployed with your app.
(Less Likely) The JDOM jar is not available in your deployment assembly.
Answer: I had the same problem removing JDOM from .m2/repository and reinstalling helped me solve this.
Thanks


How can I increment a Windows Phone tile notifications counter with Push Notification (not knowing the actual counter value)?

Question: I am sending a XML with the "Count" parameter for tile update, and the tile is updating with that value, no problem here.
But I don't know how many pending notifications the user actually has, to increment. I see WhatsApp increments the counter immediately after I got a message. The only way to do this is to store the "unread" count in the server? I wouldn't like to do this because the user can: receive the notifications, disconnect, open the app (that will reset the counter), close, and connect to internet. When it happens, the "unread" count will be incorrect after a new notification.
(I'm using a standard tile for WP 7 compatibility)
Answer: Maybe this is a hint from the design gurus -- you might not need to show the user exactly how many unread notifications s/he has.  Instead, you could make the push notification simply set a visual flag that there are some unread notifications.  When the user opens the app, it displays all the queued notifications and resets the visual flag.  Like a knock at the door: once you go to the door, you're going to let in however many dwarves you find waiting there.
Alternatively, you could use raw push notifications sent directly to the app, and let the app locally update the count on the tile.
Comment: But that's not what I see in other apps Bobhy... And the raw notifications will only work when my app is in foreground


How to print data without overriding?

Question: I have an script that prints each letter of an string and how many times it is printed, but it is not working properly, it overrides the last letter.
For example: when you type in the textarea "assist" it should print the following:
a: 1
s: 3
i: 1
t: 1
But it only prints:
t: 1
How to print properly the string?

function ex44() {
  let string = document.getElementById("sarc4").value
  string = string.toLowerCase();
  const count = {}
  string.split("").forEach(ch => {
    if (!count[ch]) {
      count[ch] = 1
      return
    }
    count[ch]++
  })
  for (const key in count) {
    document.getElementById("result4").innerHTML = `${key} : ${count[key]}`
  }
}
 Enter text

<textarea name="sarcina4" id="sarc4" cols="60" rows="5"></textarea>

<button onclick="ex44()">Afisare</button>

Comment: unsurprising, since you are *overwriting* the `.innerHTML` of `#result4` for each `key` in `count`.
Comment: you need to accumulate those entries into a string using `+=`, and then just write that _once_ into `#result4` _outside the loop_.
Comment: It's in your `for(const key incount)` loop.
Comment: Thanks guys, sorry for disturbing, I am new to Javascript
Comment: @Andy no, no, no.   Never use `+=` on `.innerHTML`.   It requires the browser to convert the HTML back into a string, and then you modify the string, and then the browser has to convert it back into DOM, _for every iteration_.
Answer: document.getElementById("result4").innerHTML = `${key} : ${count[key]}`

Will override the innerHTML.
Consider 'adding' the content using appendChild or insertAdjacentHTML:
Is it possible to append to innerHTML without destroying descendants' event listeners?
const res = document.getElementById("result4");
for (const key in count) {
    res.insertAdjacentHTML('beforeend', `<p>${key} : ${count[key]}</p>`);
}

function ex44() {
  let string = document.getElementById("sarc4").value
  string = string.toLowerCase();
  const count = {}
  string.split("").forEach(ch => {
    if (!count[ch]) {
      count[ch] = 1
      return
    }
    count[ch]++
  })
  const res = document.getElementById("result4");
  for (const key in count) {
    res.insertAdjacentHTML('beforeend', `<p>${key} : ${count[key]}</p>`);
  }
}
 Enter text

<textarea name="sarcina4" id="sarc4" cols="60" rows="5"></textarea>

<button onclick="ex44()">Afisare</button>

Note: I've wrapped the ${key} : ${count[key]} inside a

 tag so we see each letter on a separate row

Another option is to create an output string by using map and join like so:
const output = Object.keys(count).map((key) => `<p>${key} : ${count[key]}</p>`);
document.getElementById("result4").innerHTML = output.join('');

function ex44() {
  const input = document.getElementById("sarc4").value.toLowerCase();
  const count = {}

  input.split("").forEach(ch => {
    if (!count[ch]) {
      count[ch] = 1;
    } else {
      count[ch]++
    }
  });

  const output = Object.keys(count).map((key) => `<p>${key} : ${count[key]}</p>`);
  document.getElementById("result4").innerHTML = output.join('');
}
 Enter text

<textarea name="sarcina4" id="sarc4" cols="60" rows="5">test</textarea>

<button onclick="ex44()">Afisare</button>

Comment: No, no, no.   Never use `+=` on `.innerHTML`.   It requires the browser to convert the HTML back into a string, and then you modify the string, and then the browser has to convert it back into DOM, destroying and recreating the DOM elements, _for every iteration_.
Comment: You're right @Alnitak, trying to be too fast. I've improved my answer.
Answer: Move the document.getElementById("result4").innerHTML outside the loop.
You are rewritting the innerHTML of the element with id result4 each time the loop is executing. You can update the innerHTML by appending the new striing with existing by using below to get the issue fixed.
document.getElementById("result4").innerHTML += `${key} : ${count[key]}`

The above implementation cannot be considered as a good implementation even though it's fixes your problem. Accessing DOM elements directly from script is always costly. If it's inside a loop a loop it's definitely more costly.
Instead of accessing the DOM element multiple time from a loop, you could create the template string inside the loop and assign the innerHTML only once as below. This will be better in terms of performance.

function ex44() {
  let string = document.getElementById("sarc4").value
  string = string.toLowerCase();
  let template = '';
  const count = {}
  string.split("").forEach(ch => {
    if (!count[ch]) {
      count[ch] = 1
      return
    }
    count[ch]++
  })
  for (const key in count) {
    template += `${key} : ${count[key]}`
  }
  document.getElementById("result4").innerHTML = template;
}
 Enter text

<textarea name="sarcina4" id="sarc4" cols="60" rows="5"></textarea>

<button onclick="ex44()">Afisare</button>

Comment: _someone_ will read your first line of code, and think it's a good idea, without reading the following text about the consequences.   It isn't even just about performance.  Using `+=` destroys the original child elements, _including any event handlers registered on them_.
Comment: see other comments about why you shouldn't use `+=` with `.innerHTML`.   Please, just remove that from your answer entirely.
Comment: I too don't suggest to use += with innerHTML. Please see updated answer.
Answer: You should use Object.keys(count) to foreach. And currently, you are overwriting the result's HTML on loop. So I use a newHtml variable to save it and set it into innerHTML outside loop.

function ex44() {
  let string = document.getElementById("sarc4").value
  string = string.toLowerCase();
  const count = {}
  string.split("").forEach(ch => {
    if (!count[ch]) {
      count[ch] = 1
      return
    }
    count[ch]++
  })

  var newHtml = '';
  for (const key of Object.keys(count)) {
    newHtml += `${key} : ${count[key]} <br/>`
  }
document.getElementById("result4").innerHTML = newHtml;
}
 Enter text

<textarea name="sarcina4" id="sarc4" cols="60" rows="5"></textarea>

<button onclick="ex44()">Afisare</button>

Comment: alternatively use `for (const [ch, n] of Object.entries(count))` and get the key _and_ value together.
Comment: there's absolutely nothing wrong with `for (const key in count)`.   No sane person adds enumerable properties to `Object.prototype` any more.
Comment: @Alnitak thanks for your suggestion. It's a good idea.
Answer: Cache your elements, and then use textContent to update the element text using string concatenation.

const sarc4 = document.getElementById('sarc4');
const result4 = document.getElementById('result4');

function ex44() {
  string = sarc4.value.toLowerCase();
  const count = {};
  string.split("").forEach(ch => {
    if (!count[ch]) {
      count[ch] = 1;
      return;
    }
    count[ch]++
  });
  let result = '';
  for (const key in count) {
    result += `${key}:${count[key]} `;
  }
  result4.textContent = result;
}
 Enter text

<textarea name="sarcina4" id="sarc4" cols="60" rows="5"></textarea>

<button onclick="ex44()">Afisare</button>

Comment: I wouldn't use `+=` on `.textContent` either - just accumulate into a string and update the DOM _once_.

How to print data without overriding?


Is $U(b,a)U(a,b)=1$ for the ordered exponential?

Question: Let $b>a$ be two real numbers.
The ordered exponential was defined to be
$U(b,a)=T\{\exp[\int_a^b dt'O(t')] \}$
for some operator $O$. The meaning of operator here basically meant $O(x)O(y)-O(y)O(x)\neq 0$, i.e. one could not simply switch them around easily.
Is it true that $U(b,a)U(a,b)=1$ for the ordered exponential?
(Notice that for $x>y$, $\frac{d}{dx}U(x,y)=O(x)U(x,y)$ but $\frac{d}{dy}U(y,x)=U(y,x)O(y)$, thus the simple argument one might recall through the "boundary condition" did not follow. From the Taylor expansion, the "even order" of $\int_a^b dt_n\int_a^{t_{n-1}} dt_{n-1}...O(t_n)...$ did not cancel out. Thus, the result of $U(b,a)U(a,b)$ did not appear to be trivial.)
Comment: What is this $T$ in $T\{\exp(\dots)\}$?
Comment: @user10354138 See ordered exponential.(https://en.wikipedia.org/wiki/Ordered_exponential ) It's basically inserted some theta functions for $\int dt_n ...dt_1 O(t_n)...O(t_1) \theta(t_n-t_{n-1})\theta(t_{n-1}-t_{n-2}) ...\theta(t_2-t_1) $ to make sure the $O(t_n)$ on the left was "latter" than $O(t_{n-1})$ on the left, for all $n>1$.
Answer: The derivatives of $U(a,b)$ are :
\begin{align}
\partial_a U(a,b) &= O(a) U(a,b) \\
\partial_b U(a,b) &= - U(a,b) O(b)
\end{align}
The first equation is the definition of $U(a,b)$. To derive the latter, notice that :
$$\partial_a ( \partial_b U(a,b) ) = \partial_b( O(a) U(a,b)) = O(a) \partial_b U(a,b)$$
and therefore:
$$ \partial_b U(a,b) = U(a,b) \left[ \partial_b U(a',b) |_{a' = b}\right]$$
Then, we have the integral equation : $U(a,b) = \mathbf 1+ \int_b^a O(a')U(a',b) {\rm{d}}a'$, which gives $\partial_b U(a',b) |_{a' = b} = - O(b)$.
Now, we are ready to compute :
\begin{align}
\partial_a (U(b,a) U(a,b)) &= \partial_a U(b,a) U(a,b) + U(b,a)\partial_a U(a,b)\\
&= U(b,a) [-O(a)+O(a)]U(a,b) \\
&= 0
\end{align}
and therefore :
$$U(b,a)U(a,b) = \mathbf 1$$
Comment: The first two line were correct. The $\partial_a (U(b,a) U(a,b))$ part, however, you need to specify if $b>a$ and if the condition for $U(b,a)$ still hold. If being consist with the notation of $a>b$ that was used during the derivation, then $\partial_a U(b,a)$ had not been proven. (In that case, it's of the form $-O(a) U^\dagger (b,a)$ for the anti hermitian operator. i.e. the ordering $T$ meant the $\pm O(a)$ would appear on the left hand side.)
Comment: I use $\partial_a U(a,b) = O(a)U(a,b)$ as a definition for both $ab$. Then the integral equation holds in both cases and so does the derivation of $\partial_b U(a,b) = -U(a,b)O(b)$
Comment: But $\partial_b U(b,a)=U(b,a) O(b)$ for $a>b$, there were two different differential equations involved, as mentioned in the OP. $\partial_aU(a,b)=O(a)U(a,b)$ was not a definition.


Fetching a lot of urls in python with google app engine

Question: In my subclass of RequestHandler, I am trying to fetch range of urls:
class GetStats(webapp2.RequestHandler):
    def post(self):

    lastpage = 50
    for page in range(1, lastpage):
        tmpurl = url + str(page)
        response = urllib2.urlopen(tmpurl, timeout=5)
        html = response.read()
        # some parsing html
        heap.append(result_of_parsing)

    self.response.write(heap)

But it works with ~ 30 urls (page is loading long but it is works).
In case more than 30 I am getting an error:
Error: Server Error
The server encountered an error and could not complete your request.
Please try again in 30 seconds.
Is there any way to fetch a lot of urls? May be more optimal or smth?
Up to several hundreds of pages?
Update:
I am using BeautifulSoup to parse every single page. I found this traceback in gae logs:
Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 267, in Handle
result = handler(dict(self._environ), self._StartResponse)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
return handler.dispatch()
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
  File "/base/data/home/apps/s~gae/1.379703839015039430/main.py", line 68, in post
heap = get_times(tmp_url, 160)
  File "/base/data/home/apps/s~gae/1.379703839015039430/main.py", line 106, in get_times
soup = BeautifulSoup(html)
  File "libs/bs4/__init__.py", line 168, in __init__
self._feed()
  File "libs/bs4/__init__.py", line 181, in _feed
self.builder.feed(self.markup)
  File "libs/bs4/builder/_htmlparser.py", line 56, in feed
super(HTMLParserTreeBuilder, self).feed(markup)
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/HTMLParser.py", line 114, in feed
self.goahead(0)
  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/HTMLParser.py", line 155, in goahead
startswith = rawdata.startswith
 DeadlineExceededError

Comment: do all your requests complete in under 60 seconds? You only have 60 seconds to return a request. Try putting this to a task or similar.
Comment: Look in the logs and provide more information about error. It could be just deadline error from app engine
Comment: Are all the request done to same server/domain name?
Comment: @jDourlens Yes, it is.
Comment: The server might block multiple access to his page in short amount of time from same client. Maybe for ddos or scrapping protection.. There is not much you can do as reauesting with different clients or waiting between calls (sleeping)
Comment: @jDourens So, I tested it with urllib2 just from local script on pc (without google app engine). It is works fine.
Comment: ofc that's what it is ;)
Comment: Sorry i don't know enough on appengine but look about "quotas and limit" maybe
Comment: @DmitrySadovnychyi Where can I find it?
Comment: https://cloud.google.com/appengine/docs/python/urlfetch/#Python_Quotas_and_limits
Answer: It's failing because you only have 60 seconds to return a response to the user and I'm going to guess it's taking longer then that.
You will want to use this: https://cloud.google.com/appengine/articles/deferred
to create a task that has a 10 minute time out. Then you can return instantly to the user and they can "pick up" the results at a later time via another handler (that you create). If collecting all the URLs takes longer then 10 minutes you'll have to split them up into further tasks.
See this: https://cloud.google.com/appengine/articles/deadlineexceedederrors
to understand why you cannot go longer then 60 seconds.
Comment: How can I catch the moment then my job is finished? For showing result to user.
Comment: On the initial request send them to a URL where you will later make the result available (e.g. /result/job1001 ). Then write some Javascript to refresh that page from the client's side every 10 seconds. Then, when the results are available, they will be displayed within 10 seconds the user. There are of course other options.
Answer: Edit:
Might come from Appengine quotas and limits.
Sorry for previous answer:
As this looks like a protection from server for avoiding ddos or scrapping from one client. You have few options:

Waiting between a certain number of queries before continuing.
Making request from several clients who has different IP address and sending information back to your main script (might be costly to rent different server for this..).
You could also watch if website as api to access the data you need.

You should also take care as the sitowner could block/blacklist your IP if he decides your request are not good.