1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance

There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge between cities fromi and toi, and given the integer distanceThreshold. Return the city with the smallest number of cities that are reachable through some path and whose distance is at most distanceThreshold, If there are multiple such cities, return the city with the greatest number. Notice that the distance of a path connecting cities i and j is equal to the sum of the edges' weights along that path.
/**
 * @param {number} n
 * @param {number[][]} edges
 * @param {number} distanceThreshold
 * @return {number}
 */
var findTheCity = function(n, edges, distanceThreshold) {
    // Initialize the distance matrix with Infinity for all pairs of cities except for a city to itself (0)
    let dist = Array(n).fill().map(() => Array(n).fill(Number.MAX_SAFE_INTEGER));
    for(let i = 0; i < n; i++) {
        dist[i][i] = 0;
    }

    // Fill in the distances for the given edges
    for(let [from, to, w

vsc_virtual_env_path

{
    "workbench.colorTheme": "Quiet Light",
    "workbench.iconTheme": "material-icon-theme",
    "workbench.tree.indent": 16,
    "workbench.tree.renderIndentGuides": "always",
    "material-icon-theme.files.color": "#42a5f5",
    "material-icon-theme.activeIconPack": "vue",
    "editor.mouseWheelZoom": true,
    "files.autoSave": "afterDelay",
    "workbench.editorAssociations": {
        "git-rebase-todo": "default"
    },
    "python.venvPath": "/Users/micmar/python_virtual_envs",
    "edit

python_on_mac_remove old python

https://stackoverflow.com/questions/72005302/completely-uninstall-python-3-on-mac

None of these answers accounts for the fact that your PATH variable is impacted. In my case, using zsh, I had to remove a line from my .zprofile. Note this means you have to restart your terminal entirely afterwards. – 

----------------------------------------------------------------------------
Removing the app does not completely uninstall that version of Python. You will need to remove the framework directorie

barraca

inicio{
"host":"180B0369F362CABA84D25FA6A380E92A",
"porta":"80F567C29681"
}fim

Download logs using logcli

#!/bin/bash
QUERY="{namespace=\"my-namespace\", pod_name=~\"my-pod\", container_name=~\"my-container\"}"
FROM="2024-07-18T21:00:00Z"
TO="2024-07-24T21:00:00Z"
logcli --addr=http://localhost:3100/ -o raw -q query "${QUERY}" --limit 3000000 --batch 1000 --forward --from ${FROM} --to ${TO} > logs.txt

912. Sort an Array

Given an array of integers nums, sort the array in ascending order and return it. You must solve the problem without using any built-in functions in O(nlog(n)) time complexity and with the smallest space complexity possible.
/**
 * @param {number[]} nums
 * @return {number[]}
 */
var sortArray = function(nums) {
    // Helper function to merge two sorted arrays
    function merge(left, right) {
        let result = [];
        let i = 0, j = 0;

        // Merge the two arrays while maintaining order
        while (i < left.length && j < right.length) {
            if (left[i] < right[j]) {
                result.push(left[i]);
                i++;
            } else {
                result.push(right[j]);
        

Edit and Hide Admin menu items admin_menu & admin_bar_menu. Also hide items from the item bar

Edit and Hide Admin menu items admin_menu & admin_bar_menu. Also hide items from the item bar
function remove_acf_menu()
{

    // provide a list of usernames who can edit custom field definitions here
    $admins = array(
        'admin',
        'levy-admin',
        'barb'
    );

    // get the current user
    $current_user = wp_get_current_user();

    // match and remove if needed
    if( !in_array( $current_user->user_login, $admins ) )
    {
        remove_menu_page('edit.php?post_type=acf'); //ACF
         remove_menu_page('tools.php'); //Tools
         remove_menu_page('edit-c

CONTROLLA RUOLO UTENTE

<?php
function check_user_role( $role, $user_id = null ) {
    if ( is_numeric( $user_id ) )
        $user = get_userdata( $user_id );
    else
        $user = wp_get_current_user();
    if ( empty( $user ) )
        return false;
    return in_array( $role, (array) $user->roles );
}

NASCONDI YOAST IN BACKEND PER RUOLO UTENTE

<?php
function wpse_init(){
    if(check_user_role( 'RUOLO' )) {
        add_filter( 'wpseo_use_page_analysis', '__return_false' );
        add_action( 'add_meta_boxes', 'disable_seo_metabox', 100000 );
    }
}
add_action('init', 'wpse_init');
function disable_seo_metabox() {
    remove_meta_box('wpseo_meta', 'sede', 'normal');
    remove_meta_box('wpseo_meta', 'magazine', 'normal');
    remove_meta_box('wpseo_meta', 'approfondimento', 'normal');
    remove_meta_box('wpseo_meta', 'evento', 'norm

RIMUOVI ADMIN NOTICE PER RUOLO UTENTE

<?php
add_action('admin_print_scripts', 'ure_remove_admin_notices');
function ure_remove_admin_notices() {
    global $wp_filter;
    if (check_user_role('RUOLO')) {
        $wp_filter['user_admin_notices']->callbacks = array();
        $wp_filter['admin_notices']->callbacks = array();
        $wp_filter['all_admin_notices']->callbacks = array();
    }
}

eduardasilva

inicio{
"host":"C7BAB2B680F271D862FD749FAF",
"porta":"E960D1"
}fim

AWS - Policy Example

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:StartInstances",
        "ec2:StopInstances"
      ],
      "Resource": "arn:aws:ec2:*:*:instance/*",
      "Condition": {
        "StringEquals": {
          "aws:ResourceTag/Owner": "${aws:username}"
        }
      }
    },
    {
      "Effect": "Allow",
      "Action": "ec2:DescribeInstances",
      "Resource": "*"
    }
  ]
}

Truncate innerHtml with saving all children html tags

class Main {
  constructor(body) {
    this.body = body;

    this.selector = {
      productDescription: ".product-card__description"
    }
  }

  init() {
    if (!this.body) return false;

    this.elements();
    this.events();
  }

  elements() {
    this.productDescriptions = document.querySelectorAll(this.selector.productDescription);
  }

  events() {
    this.truncateDescription();
  }

  // truncate product description
  truncateDescription() {
    if (!this.productDescriptions.length)

All datatypes in JS for testing

// Copied from https://javascript.plainenglish.io/structuredclone-the-easiest-way-to-deep-clone-objects-in-javascript-c503b536266b

const testData = {
  number: 123,
  string: "test",
  undefined: undefined,
  null: null,
  boolean: true,
  object: { a: 1, b: { c: 2 } },
  array: [1, 2, { d: 3 }],
  function: function() { return "hello"; },
  map: new Map([["key1", "value1"], ["key2", "value2"]]),
  set: new Set([1, 2, 3]),
  date: new Date(),
  error: new Error("An error occurred"

Nuxt unMounted時にイベントリスナーをremoveする

<template>
  <div ref="eventElement">event</div>
</template>
<script lang="ts" setup>
const eventElement = ref<HTMLDivElement | null>(null);
let eventListener: (() => void) | null = null;

onMounted(() => {
  if (!eventElement.value) return;
  eventListener = () => {
    console.log("クリック");
  };

  eventElement.value.addEventListener("click", eventListener);
});

onBeforeUnmount(() => {
  if (eventElement.value && eventListener) {
    eventElement.value.removeEventListener("click", eventListene