python 3.x – For each loop that ‘consumes’ two element at once

Well here is a solution that works fine:

mylist = ( 0, 2, 4, 6, 8, 10 )

myIter = iter( mylist)
for arg1_2 in myIter:
    arg2_2 =  next( myIter )
    print ( arg1_2, arg2_2 )

However what I don’t like about my solution above is. Somehow it looks ugly.

I mean its not very nice to read in the way of ‘speaking’ code. At the first place it should be more obvious what the code is doing. Something like this would be much more beautiful:

def TakeTwo( list):
    #ToDo: Return an iterator for the list that returns a two-tuple

for ( arg1_2, arg2_2 ) in TakeTwo( mylist):
    print ( arg1_2, arg2_2 )

However can someone help me out about implementing that ‘TakeTwo’ iterator?
I have some idea that it would be nice to use a generator instead of just returning a two-tuple list.

sharepoint enterprise – Timer Service Recycle not working properly and OWSTIMER consumes a lot of RAM

We are having a high usage of RAM in our producction enviroment because the timer service isn’t recycling (I think).

The Timer Service Recycle is throwing Success in its history, but it doesn’t restarts the Timer Job Service, also it doesn’t enter the 10 minutes warning proccess, I’m not finding anything in the logs and the time completion for the job shows 00:00:00 and the RAM usage stays the same.

In another server I work, this time stays at 00:10:00 or more, and after that the service restarts and the RAM usage goes down.

Searchview with Recyclerview in Android using Volley per pagin How to add search filters to the last page in a recycler view that consumes ten page?

I am doing a search filter by identity document in a Recyclerview that is per page, the problem is that at the time of making the filter it only looks for the first diez that is the current page. How would I filter the search from the current page until last page?

    public int getItemCount() {
        return this.itemsMostrados.size();

    public void filtrar(String query) {
        this.itemsMostrados = new ArrayList<>();

        if (query.length() == 0) {
            itemsMostrados = listaActas;
        } else {
            ActasActivity actas= new ActasActivity();
            for (Datum data: listaActas) {
                if (data.getBeneficiario().getNumDocumento().contains(query)
                    //|| (data.getBeneficiario().getNombre().toLowerCase() + " " + data.getBeneficiario().getApellido().toLowerCase()).contains(text.toLowerCase())
                    || (data.getBeneficiario() != null ? data.getBeneficiario().getNombre() : "No registra" + " " + data.getBeneficiario() != null ? data.getBeneficiario().getApellido() : "No registra").contains(query)
                    //|| data.getPoblacion().getNombre().toLowerCase().contains(text.toLowerCase())
                    //|| data.getMunicipio().getMunicipio().toLowerCase().contains(text.toLowerCase())
                    ) {


            txtResults.setText(itemsMostrados.size() + "");



    public void actualizar() {
        itemsMostrados = listaActas;

In this activity I try to create the condition to filter search to the last page but still continue to filter only the first 10 of the current page

  public void obtenerActas(boolean inicializar) {

        if (inicializar) {
            current_page = 1;
            last_page = 1;
            last_size_pages = 0;

        final Promise<RespuestaActasDTO, BusinessException, RespuestaActasDTO> mPromise = actasService.obtenerActas(current_page);
        mPromise.done(result -> {
            if (progressDialog.isShowing()) {

            actualizarListadoActas(result, inicializar);

            if (progressBar.getVisibility() == View.VISIBLE) {

        }); -> {
            if (progressDialog.isShowing()) {

            if (progressBar.getVisibility() == View.VISIBLE) {

            Toast.makeText(mContexto, "Ocurrió un error consultando las actas", Toast.LENGTH_SHORT).show();

    public void actualizarListadoActas(RespuestaActasDTO respuestaActasDTO, boolean inicializar) {

        // logica para controlar la pagina a consumir y saber cual es la ultima pagina
        last_page = respuestaActasDTO.getLastPage();

        if (current_page < last_page) {
            current_page++;//ENUMEREME DESDE LA PAGINA ACTUAL


        if (actasAdapter == null || inicializar) {
            listaActas = new ArrayList<>();
            listaActas = respuestaActasDTO.getData();

            actasAdapter = new RecyclerActasAdapter(mContexto, listaActas, layoutResultados, txtResults);
        } else {
            //página actual <   última página
            if (current_page < last_page) {

                agregarUltimaConsulta = true;
            } else if (current_page == last_page) {
                if (agregarUltimaConsulta) {
                    agregarUltimaConsulta = false;
                    last_size_pages = respuestaActasDTO.getData().size();
                    ultimaLista = respuestaActasDTO.getData();

                } else if (last_size_pages != respuestaActasDTO.getData().size()) {
                    // limpiar ultimos registros para volverlos a agregar

                    ultimaLista = respuestaActasDTO.getData();
                    last_size_pages = respuestaActasDTO.getData().size();

        // Logical END to control the page to consume and know which is the last page ------>>>>

        if (agregarEventoBuscar) {
            agregarEventoBuscar = false;
            // buscador
            inputBuscar.setOnQueryTextListener( new SearchView.OnQueryTextListener() {
                public boolean onQueryTextSubmit(String query) {
                    actasAdapter.filtrar(inputBuscar.getQuery().toString() );
                    return true;

                public boolean onQueryTextChange(String newText) {
                    return false;
            } );


Observation: I only filter the query if I scroll to the last page, Thanks for your support

itunes – How is it that the podcast app consumes so much GPU?

I installed a 15-inch MacBook Pro 2015 with Catalina and was wondering why my fans go crazy when I play a podcast with the Podcasts app. Htop showed no unusual CPU activity, but then iStats noticed that the GPU was quite high.

I just wonder how that should work. I got the impression that it was the CPU that did the audio playback. I don't remember this happening in iTunes.

You can see the sharp valley in the graphic when I stopped the capsule:

Enter the image description here

mysql – The MariaDB server consumes the entire CPU

I am working with a system that retrieves, stores, and transfers data using some API requests.

We use a table to store unprocessed data that is retrieved via InnoDB via API requests. The size for the individual table is approx. 40 GB.

Incidentally, the system I am talking about was manufactured some time ago
with Joomla 3.7.3.

The server we use is

  • CentOS 7
  • Number of CPUs 8
  • Total memory 16380312 kB
  • Total swap 4194300 kB

Some of the warnings I get are

  • Broken connections Documentation 1.2 k
  • Creates tmp disk tablesDocumentation 230.1 k
  • Handler read rndDocumentation 42.7 M.
  • Handler read rnd nextDocumentation 37.5 G.
  • Innodb buffer pool reads Documentation 2.6 G.
  • Innodb line lock time maxDocumentation 843
  • Innodb Row Lock is waiting for documentation 34.2 k
  • Opened table documentation 742
  • Select the full joinDocumentation 6.3 k
  • Check area checkDocumentation 78.3 k
  • Slow queries Documentation 9
  • Sort merge passes Documentation 1
  • Table locks were waiting for documentation 2.5 k

We tried adding more CPUs to the machine but were useless. Since the system uses Joomla and we made a lot of changes to the core, we have no idea what we can do to improve something, as major changes to the system may cause problems.

Please make some suggestions. Any type of input is appreciated.
Thank you in advance.

Windows 10 Update consumes all internet channels

I noticed that Windows 10 completely consumes the entire internet channel when upgrading.
So that other computers in the local network can only surf the Internet after the update has been completed.

Windows Update makes many connections to update servers (more than 20) and tries to reach the maximum speed.

But why? This is a background service that shouldn't distract the user from his work. This almost blocks the internet for all users who use the same internet connection. My ISP gives 10 Mbit / s, LAN is 1 Gbit / s.

Nor do I see that "delivery optimization" can save by downloading and distributing updates once via LAN traffic. I had a computer with all the updates, but the second one is still downloading updates from the Internet.

Linux – Apache 2.4 consumes too little memory

I have a weird problem with Apache. It seems that it uses too little memory. My average Apache process size is 17 MB and I checked between 20:00 and 20:05. I have 483 connections to the server. As far as I know, Apache needs a worker for every request / connection, so it needs 483 * 17 MB of RAM. That's over 8GB. What surprised me, it only consumed 200MB.


  ServerLimit 520
  MaxRequestWorkers 500
  MaxConnectionsPerChild 50


ss -ant | grep :443 | wc –l

Average Apache process size:

ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
17 MB

CPU statistics from sar:

08:00:01 PM     CPU     %user     %nice   %system   %iowait    %steal     %idle
08:00:01 PM     all     11.4%      0.0%      2.1%      0.1%      0.0%     86.5%
08:05:01 PM     all     41.2%      0.0%      5.8%      0.8%      0.0%     52.3%
08:10:00 PM     all     14.6%      0.0%      3.0%      0.3%      0.0%     82.1%
08:10:01 PM     all     12.8%      0.0%      2.3%      0.0%      0.0%     84.9%
08:15:01 PM     all      7.7%      0.0%      1.8%      0.1%      0.0%     90.4%

RAM stats from sar

08:00:01 PM kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty
08:00:01 PM     12.7G     13.1G      1.8G     12.3%      4.1M    592.8M      5.3G     36.8%      1.3G    272.1M     20.0M
08:05:01 PM     12.5G     12.9G      2.0G     13.7%      4.1M    639.5M      5.6G     38.3%      1.4G    306.6M     10.8M
08:10:00 PM     12.5G     12.9G      2.0G     13.9%      4.1M    668.7M      5.6G     38.3%      1.4G    326.6M      8.8M

The entire server is delayed every day at a certain time and consumes 90% of the CPU (but not exclusively at this time).

Good day,

This may be tedious, as it is a problem I have been fighting for a long time, but I desperately need help and I hope someone out there has some ideas for me. My server technicians have only a few ideas for changing the software.

We have a dedicated computer with around 150 active websites (all WordPress) and e-mail addresses for some of them. Every day around 4pm, all websites slow down, emails are not delivered on time (my tests show that they arrive one hour later), and running SSH on the server looks like almost all of them individual website blocks the server at the same time (even development pages where no traffic should actually take place). We've been dealing with it for a while, trying out a bunch of things that we thought might be the culprit.

Each site has the same plugin suite, Wordfence for security, and Backupbuddy for backup. In our first round of changes, we found that Wordfence was doing scans at this time of day. We went to every single website and turned off the scanning feature of WordFence (not ideal). We thought this would have helped, but that might be coincidence when the problem started again.

Then we took a closer look at the top-level command and found that doing an everyday kill on all sites ran cron jobs and some seemed to be connected to the backup plug-in. That's why we have disabled our backup plugin on every website. That seemed to help for a day, but it can also be a coincidence. Because the problem still exists and has gotten worse in the last few days.

Now my server people are saying again and again that they are just random processes and the server is just overloaded, but why every day at the same time? You can see how the running processes jump from about 14 to 50, 60, 80, and so on.

Now, looking at the topmost command being executed, it does not seem to be a cron job, it just contains random commands like /index.php and /wp-login.php. The normal stuff you'd expect, but it really gets worse when it happens, and on sites that I know are not getting visitors.

My server people suggest switching to Cloud Linux, which I do not oppose, but I wanted to get some advice first, as apparently no one has a clue and just shoots in the dark.

Has anyone ever seen such a thing? My knowledge of all this is limited and self-taught, but any help is greatly appreciated.

Restarting HTTP and SQL resolved the issue. In most cases, the problem will be restored after a few seconds.

I will try to describe our specific situation more precisely.

150 (ish) sites running WordPress are not all up-to-date (as some would have custom plugins or obsolete designs and would require work, the customer is unwilling to make any changes to the update). Most are running on PHP 5.6 (another thing I need to fix, but we need time we do not have).

Drive is 90% full what I know is also no idea, but expensive in the workaround.

Server specifications are:
Intel Xeon
E3-1270 V2
3.5 GHz
Four core
800 gb ssd
Mirror drive for the fuse

Cpanel / WHM / MySQL

I can provide any other information I need to get to the bottom of it because my clients are not happy.

Should I have this kind of problem with these server specifications and so many sites? Or is something going on?

Is the outdated PHP my problem or the sites or the storage space? I just do not know what would cause more than 100 websites to access the server and let it crawl at the same time.

Thanks in advance for any help you can provide.

windows – Virtual machine that consumes a duplicate CPU resource in the host operating system

I am using Hyper-V on the Windows 10 Pro host operating system, and the virtual operating system is Windows Server 2012.
I only use one VM at a time to check the CPU utilization of VPS with respect to the host operating system. Note : VM has the same cores as hardware (no resource limit)

I do not know why the CPU utilization of the host operating system is almost twice that of the VM.

37% CPU in VPS and 69% CPU in the host operating system

As shown in the picture above, the CPU utilization of the virtual machine is only 37%, while the CPU utilization of the host operating system is 68%.

Result in different tests (1 VM each):

** VM CPU Usage (%): Host CPU Usage (%) **
13%: 35%
37%: 69%
50%: 96%

I have tested this in above VMWare The result is almost the same.

I only use one running VM at a time, and there is no hardware resource constraint. I have tested it in different hardware and different VMs. The result is almost the same.

After practical results. Does this mean that I can only use 50% of the CPU of HOST OS (hardware) with Hyper-V or VMWare?