javascript – Failed to load resource: the server responded with a status of 404 ()

tengo un problema muy raro y la verdad no se por que. Intento enviar un parámetro usando Jquery y Ajax llamado “idCategory” a un controlador en Spring pero a la hora de enviarlo sale esto en la url:

introducir la descripción de la imagen aquí

JavaScript:

introducir la descripción de la imagen aquí

Les agradecería su ayuda para solucionar este problema, muchas gracias.

forms – How to load custom menu field when editing?

I’m extremely new to Drupal so if my question is badly worded I’m sorry. Inside my menu_ui_override.module I have made a made a new field and added a custom submit handler:

function menu_ui_override_form_menu_edit_form_alter(&$form, DrupalCoreFormFormStateInterface $form_state, $form_id) {
  $form('menu_header') = array(
    '#type' => 'textfield',
    '#title' => t('Menu header'),
    '#weight' => '0',
    '#required' => FALSE,
  );

  $form('actions')('submit')('#submit')() = 'menu_ui_override_accept_menu_header_submit';
}

function menu_ui_override_accept_menu_header_submit(&$form, DrupalCoreFormFormStateInterface $form_state) {
  $values = array(
        'menu_header' => $form_state->getValue('menu_header'),
  );
  
  $connection = Drupal::database();

  $connection->update('menu_tree')
  ->fields(array(
    'menu_header' => $values('menu_header'),
  ))
  ->execute();
    
  drupal_set_message(t('Saved'));
}

This seems to save my new field but now I’m not sure how to load the data entered into that field when I go back to edit the menu after saving it. I’m also not sure where to put the logic for this part. Any help would be greatly appreciated!

memory – Computer fails to load with new RAM

I decided to upgrade my PC by increasing amount of RAM from 16GB (4 sticks, 4GB each) to 32GB (4 sticks, 8GB). However, after replacing RAM with new sticks, the computer failed to load. After launching it, some coolers make several rotations and the system fails to turn on. And several seconds later it makes another try but without any success. Old RAM stick work totally normally.

My motherboard specification says that such amount and type of RAM is supported (https://www.gigabyte.com/Motherboard/GA-Z68P-DS3-rev-10/sp#sp). Here’s a cite:

  • 4 x 1.5V DDR3 DIMM sockets supporting up to 32 GB of system memory
  • Dual channel memory architecture
  • Support for DDR3 2133/1866/1600/1333/1066 MHz memory modules
  • Support for non-ECC memory modules
  • Support for Extreme Memory Profile (XMP) memory modules

The store where I bought them also confirms their compatibility before I made this order.

I tried the following:

  • Reset CMOS in BIOS by extracting a small battery under the video card;
  • Insert RAM sticks in all slots one by one;
  • Change RAM sticks’ location in different DIMM slots, in different combinations;
  • Manually set the memory modules’ frequency in BIOS to 1866 MHz.

Technical info:

  • Motherboard – Gigabyte Z68P-DS3 (Socket 1155);
  • New RAM – HyperX DDR3-1866 16384MB PC3-14900 (Kit of 2×8192) FURY Black (HX318C10FBK2/16), 2 pairs;
  • Windows 10 (x64).

I’m thinking, should I return the RAM back to the store or there is a way to make it working on my PC.

Any help is highly appreciated. Thank you in advance! 🙂

addEventListener not working on SharePoint list form load

I have a SharePoint list form and I prepopulated certain fields with sharepont user properites. I also decided to use DOM development for form manipulation on the list form. Using the DOM, I was able to successfully disable certain form elements. I also have a checkbox at the beginning of the form that is supposed to hide certain fields when checked. For some reason, my eventlistener on the checkbox isn’t working like it should.

In the developer tool when looking at the SharePoint list form, I get the following error: ‘Unable to get property ‘addEventListener’ of undefined or null reference
The error points to this line:
document.querySelector('input(title="anonymous")').addEventListener('click',getProperties);

(function(){
  getProperties();
})();

document.querySelector('input(title="anonymous")').addEventListener('click',getProperties);

function getProperties(){
        var web = _spPageContextInfo.webAbsoluteUrl;
        var endPointUrl = web + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties";

        axios.get(endPointUrl).then(function(response) {
            var properties = response.data.UserProfileProperties;
            var displayName = response.data.DisplayName;
            var nameAry = displayName.split(" ");
            if (document.querySelector('input(title="Anonymous")') == false) {
                alert("Anonymous Code");
            }

            var fName = document.querySelector('input(title="First Name")');
            fName.value = nameAry(1);
            fName.disabled = true;

            var lName = document.querySelector('input(title="Last Name")')
            lName.value = nameAry(0);
            lName.disabled = true;

            var eMail = document.querySelector('input(title="Email Address")');
            eMail.value = response.data.Email;
            eMail.disabled = true;
            for (var i = 0; i < properties.length; i++) {
                //Office Phone Number
                if (properties(i).Key == "Office") {
                    var oSymbold = document.querySelector('input(title="Office Symbol")')
                    oSymbold.value = properties(i).Value;
                    oSymbold.disabled = true;
                }
            }
        });
        }

Here’s the weird part, I’m able to run the same exact code(slight modifications) in codepen but reading from typicode/json instead of a SharePoint list and it works perfectly. Here’s the codepen

Any idea why it’s not working in SharePoint?

Any assistance you can provide would be much appreciated. I’ve been tackling this for two days.

Rust server load testing – Game Development Stack Exchange

I am looking to stress test my Rust game server and monitor CPU, RAM and FPS. I could not find much around.

I general I think I will need a good amount of compute power, bunch of cloud based VM which generate the load through UDP using some headless client.

Monitoring CPU and RAM should be fairly easy, but how about the in game FPS?
Also I could not find much about Rust clients that could simulate a player.

Thanks

High CPU load on EC2 with Nginx/Celery/Django causes server to fail

I am running a Django web app on an EC2 server using Nginx, and uWSGI. I also have Celery running some background tasks (no CRON jobs, just on occasional user actions).

The app is in early closed Beta with no users currently active.

Over the past three days, the server would fall over after experiencing super high CPU loads, seemingly randomly (see screengrab).

Before this, the app was running without issue for weeks. I made some programmatic changes to the website, but not to the server configuration (consolidating models mostly).

I tried to pick something up from the logs (Nginx access.log, error.log and Django debug.log), but I don’t see any errors or oddities (don’t have access to the logs right now).

In addition, I experienced a similar effect when migrating model changes (in venv) if I haven’t restarted the server beforehand. Sometimes, even when restarting the server, it would become so slow I would have to wait several minutes for Celery to restart.

I need help to find a starting point to investigate the problem. Any ideas?

Server Load

javascript – Is it possible to load data from the server using a HTTP POST request within a Magento Module js file?

Is it possible to load data from the server using an HTTP POST request within a Magento Module js file?

File located in
app/code/MyVendor/myCustomModule/view/frontend/web/js/mycustom.js

Example request:

   function test(){
      $.post("sample_data.php", function(data, status){
        alert("Data: " + data + "nStatus: " + status);
      });
    };

On the frontend I get 403 error when the sample_data.php is called

ubuntu – My site has stopped working (Cloudflare 522 error), minimal server load (Nginx + Apache + WordPress)

I run multiple websites being served on a stand alone Ubuntu machine, all of them use same nginx + apache setup.
However one of these sites has begun to act very strangely today.
It’s the only site on the server that uses Cloudflare, and on several occasions today the site has failed to load for periods of 30-60 minutes (like this – https://bobcares.com/wp-content/uploads/cloudflare_error_522_connection_timed_out.png), before recovering.
Often a page on the site would load albeit incredibly slowly, as if the speed was capped to a few kBps. Pages would take several minutes to load and some of the resources would fail to load.

I first noticed the issue earlier today when it was reported by a user. I did nothing on the server end beside check the server load via ssh and check my webserver logs, and within 30 minutes it had resolved.
Since then the same issue has re-occurred several more times for 30-60 minutes at a time, before mysteriously resolving and I have no idea why.

On each occasion there was not an excessive amount of requests being channelled through the site, there was very little in my processes taking up resources on the server.

If there was anything wrong with my server setup beneath the webserver then it would have affected my other sites’ performance, but it was just this one site that was repeatedly having issues, and will probably continue to.
And my server has remained relatively unchanged recently.

Any ideas how I can diagnose this problem? So far I have found nothing wrong, but then again I have done no alterations to the server recently.
I’ve tried everything I know besides rebooting the server as I want to get to the bottom of this.