Javascript – Loads items in the specified order and outputs an event for each change

I'm developing a script that loads a bunch of elements. Each function returns an Axios request to another endpoint.

I am trying to verify that the first request "createTransportNetworkToMap" is executed first. In this request, the value of = "loading map" is added to the variable loadingItem.

Because the previous value was null, it is assumed that the monitor will pick up the change and issue an event to another parent that will display the new value through the console.

Thereafter, the request is made and waited for it to exit to display a console log. When you're done, go to the next function that does something similar but has different values.

This is the code:

export default {
  name: "Map",
  data: function() {
    return {
      map: null,
      mapIsLoaded: false,
      loadingItem: null
    };
  },
  mounted: function() {
    this.map = loadMap();
    this.loadLayersToMap(this.map);
  },

  watch: {
    loadingItem: function() {
      EventBus.$emit("loadingItemChanged", this.loadingItem);
    },
    mapIsLoaded: function() {
      EventBus.$emit("mapIsLoaded", this.mapIsLoaded);
    }
  },
  methods: {
    loadLayersToMap: function(map) {
      Promise.all((
        this.createTransportNetworkToMap(map),
        this.createLinesToMap(map)
      ));
      this.mapIsLoaded = true;
    },
    createTransportNetworkToMap: function(map) {
      return new Promise(() => {
        this.loadingItem = "Cargando mapa";
      }).then(
        _createTransportNetworkToMap(map).then(() => {
          console.log("mapa cargado");
        })
      );
    },
    createLinesToMap: function(map) {
      return new Promise(() => {
        this.loadingItem = "Cargando líneas";
      }).then(
        _createLinesToMap(map).then(() => {
          console.log("Líneas cargadas");
        })
      );
    },
    getLoadingItem: function(item) {
      this.loadingItem = item;
    }
  }
};

Unfortunately, it does not work the way I want it and it shows me the following:

1

He does not do it in the right order, and besides, it just shows me the last change.

Dual Boot – Ubuntu loads slower than Windows

Samsung SSD 850 EVO 500GB

Windows 10

Ubuntu 19.10

Motherboard – MSI H310M Gaming Plus

CPU – Intel i5-9400 Coffee Lake 2.9GHz

Must type F11 when booting so I can select either Windows or Ubuntu. Otherwise, Windows will boot by default

Both operating systems are on the same SSD

Someone suggested giving the result of the systemd analysis guilt. So here is the link to my pastebin – https://pastebin.com/FmmJFaNL

It takes 10-15 seconds for Ubuntu to start up, compared to 5-7 seconds for Windows.

reactjs – Loads a specific scene by clicking the button

Below is the current code under App.js

import React, { Component } from "react";
import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom";

import Home from "./components/Home";
import Office from "./components/Office";
import Gym from "./components/Gym";

//export default App;
export default class App extends Component {
  // constructor(props) {
  //   super(props);
  //}
  render() {
    return (
      
        

Welcome to React Router Tutorial


); } }

I want to load a certain scene when I click on gym

This is what I tried, I wrote the Scenechange function in App.js and use an onClick function to bind it. But that does not change anything

 
  • Gym
  • Every advice is appreciated

    unity – Loads huge amounts of data in Unity3D

    I'm creating an Android app with Unity3D where users can visualize data immersively.

    The data is immutable and stored in a cPanel-hosted MySQL database.

    When the user clicks a button in the environment, the creation of a graph is started. First, contact a .php file on the server responsible for querying the database, getting the data, and deploying to the Unity controller, which then adds the points to the diagram. This works well for small amounts of data.

    To improve performance, you should export a CSV file from MySQL and transform it into a JSON file instead of querying a database or performing a MySQL transformation into a JSON file. I'm afraid this will not be enough.

    Could also extract as CSV and use a third party to read.

    How would you load the data in such a case for the best performance?

    unity – Loads a scene without being in the build settings and without using AssetBundle

    This is the next one I got:

        EditorSceneManager.OpenScene(
            AssetDatabase.GUIDToAssetPath(
                AssetDatabase.FindAssets(
                    "t:SceneAsset " + MenuSceneName,
                    new string() { "Assets" }
                )(0)
            )
        );
    

    However, this generates an error at runtime:

    InvalidOperationException: This cannot be used during play mode, please use SceneManager.LoadScene()/SceneManager.LoadSceneAsync() instead.
    

    I can not follow the suggestion because these functions require the scene to be in the build settings or in an asset bundle. So is there another option?

    I wonder how (and if) addressees achieve this. Note: I'm not ready to switch to addressables. I enjoy working with AssetBundles.

    Why?

    My game uses AssetBundles to generally load ALL, so there's only one empty scene in the build settings. During the development, I prefer not to create and load continuously from AssetBundles. Therefore, I try to dynamically load scenes without having to add them to create settings.

    installation – WordPress Installer Loads non-secure assets

    I'm trying to do a new WordPress installation online, but for some reason the assets are loaded as HTTP (not sure).

    Here is the scenario:

    • Just unpack the WordPress package on the server and access the URL
      install like (the server / domain has valid SSL
      Certificate)
    • Empty database
    • No wp-config.php file was created
    • No .htaccess file created
    • The page only redirects to the assets
      (css and js) are loaded from
    • Server Apache with PHP version 7.1.29

    If I install WordPress without SSL, it works, but I can not enable SSL later or redirect everything to SSL. It gives me ERR TOO MANY REDIRECTS problem even though I have tried all things related to mixed content issues on the internet.

    I think something is wrong with this server. But I do not know what.

    Any hints?

    Thank you in advance.

    asp.net mvc – Loads very slow SQL Server

    If the column "Coincount" in SQL specifies a value greater than 10000, the site load is too slow. Does anyone know how to solve them?

                    'MsgBox(usertable)
                    cmd.CommandText = "SELECT coincount FROM  (CoinRegister) WHERE '" & userid & "' = (userid)"
    
    
                    db.Open()
    
    
                    Using dr As SqlDataReader = cmd.ExecuteReader()
                        dr.Read()
    
    
                        If dr.HasRows = True Then
                            ' MsgBox(dr.HasRows)
    
                            hascoins = True
    
                            If userid.ToUpper = usern.ToString.ToUpper Then
    
    
                                coincount = dr.GetInt32(0)
                                'coincntlbl.Text = coincount
                            Else
                                'coincount = dr.GetInt32(0)
                                extcoincount = dr.GetInt32(0)
    
                            End If
                        Else
                            hascoins = False
    
    
    
    
                        End If
    
    
                        dr.Close()
    

    magento2 – Magento 2 Loads the UI grid only after the filter search

    I have created a custom module. In it I display product collection in the Ui grid. I have extended Magento Catalog Ui DataProvider Product ProductDataProvider Show collections.

    What is my requirement:
    I would like to view (load) the collection only after the user has selected something from the filter.

    The UI grid should not display a product until the user has searched something from the filter.

    My code for this file
    App / Code / Company / Module / Ui / DataProvider / Product / Manufacturer / ProductDataProvider.php

    collection-> addAttributeToFilter (& # 39; type_id & # 39 ;, & # 39; configurable & # 39;);
    $ this-> collection-> addAttributeToFilter (& # 39; has_options & # 39 ;, & # 39; 1 & # 39;);
    $ this-> collection-> joinField (
    "Amount",
    & # 39; # 39 ;, & cataloginventory_stock_item
    "Amount",
    & # 39; product_id = entity_id & # 39 ;,
    & # 39; {{table}}. stock_id = 1 & # 39 ;,
    & # 39; left & # 39;
    );
    }
    }