问:
Password reset and sign up in vue js 3
I am trying to connect my vue js application to a msal b2c backend the login is done but now i need to make a button for password reset and sign up i cant find a sign up popup anywhere and i dont know how to set up a password reset popup.

When i click the password reset link in the login popup the popup closes and nothing happens after that

The way i currently have it set up is:

LoginView.vue

```<code><template>
  <div class="grid grid-cols-12">
    <div class="default-container">
      <p>u bent nog niet ingelogd log nu in</p>
      <button type="button" @click="login">Login</button>
    </div>
  </div>
</template>

<script setup>
  import useAuthStore from '../stores/AuthStore';

  function login() {
    useAuthStore().login();
  }
</script>
</code>```

Authstore.js

```<code>import { defineStore } from 'pinia';
import AuthService from '../services/AuthService';

const clientId = import.meta.env.VITE_APP_CLIENT_ID;
const authority = import.meta.env.VITE_APP_AUTHORITY;
const scopes = [import.meta.env.VITE_APP_SCOPE_READ];

const authService = new AuthService(clientId, authority, scopes);

const useAuthStore = defineStore('AuthStore', {
  state: () => ({
    isAuthenticated: !!localStorage.getItem('apiToken'),
    apiToken: localStorage.getItem('apiToken'),
    user: JSON.parse(localStorage.getItem('userDetails')),
    error: null,
  }),
  getters: {
    isLoggedIn: (state) => state.isAuthenticated,
    currentApiToken: (state) => state.apiToken,
    currentUser: (state) => state.user,
    currentError: (state) => state.error,
  },
  actions: {
    async login() {
      try {
        const token = await authService.login();
        this.apiToken = token.apiToken;
        localStorage.setItem('apiToken', token.apiToken);
        this.isAuthenticated = true;

        fetch(`${import.meta.env.VITE_APP_API_URL}/account/current`, {
          headers: {
            Authorization: `Bearer ${token.apiToken}`,
          },
        })
          .then((response) => response.json())
          .then((data) => {
            localStorage.setItem('userDetails', JSON.stringify(data));
            this.user = data;
          });
      } catch (error) {
        this.error = error;
      }
    },
    async logout() {
      try {
        await authService.logout();
        this.user = null;
        this.apiToken = null;
        this.isAuthenticated = false;
        localStorage.removeItem('apiToken');
        localStorage.removeItem('userDetails');
      } catch (error) {
        this.error = error;
      }
    },
  },
});

export default useAuthStore;
</code>```

AuthService.js

```<code>import * as Msal from 'msal';

export default class AuthService {
  constructor(clientId, authority, scopes) {
    this.app = new Msal.UserAgentApplication({
      auth: {
        clientId,
        authority,
        postLogoutRedirectUri: window.location.origin,
        redirectUri: window.location.origin,
        validateAuthority: false,
      },
      cache: {
        cacheLocation: 'localStorage',
      },
    });

    this.scopes = scopes;
  }

  async login() {
    const loginRequest = {
      scopes: this.scopes,
      prompt: 'select_account',
    };

    const accessTokenRequest = {
      scopes: this.scopes,
    };

    let token = {};

    try {
      await this.app.loginPopup(loginRequest);
    } catch (error) {
      return undefined;
    }

    try {
      const acquireTokenSilent = await this.app.acquireTokenSilent(accessTokenRequest);
      token = {
        apiToken: acquireTokenSilent.accessToken,
        expiresOn: acquireTokenSilent.expiresOn,
      };
    } catch (error) {
      try {
        const acquireTokenPopup = await this.app.acquireTokenPopup(accessTokenRequest);
        token = {
          apiToken: acquireTokenPopup.accessToken,
          expiresOn: acquireTokenPopup.expiresOn,
        };
      } catch (errorPopup) {
        return undefined;
      }
    }

    return token;
  }

  logout() {
    this.app.logout();
  }
}
</code>```

Title: Password reset and sign up in vue js 3

Body:
I am trying to connect my vue js application to a msal b2c backend the login is done but now i need to make a button for password reset and sign up i cant find a sign up popup anywhere and i dont know how to set up a password reset popup.

When i click the password reset link in the login popup the popup closes and nothing happens after that

The way i currently have it set up is:

LoginView.vue

<template>

u bent nog niet ingelogd log nu in

      <button type="button" @click="login">Login</button>

</template>

Authstore.js

import { defineStore } from 'pinia';
import AuthService from '../services/AuthService';

const clientId = import.meta.env.VITE_APP_CLIENT_ID;
const authority = import.meta.env.VITE_APP_AUTHORITY;
const scopes = [import.meta.env.VITE_APP_SCOPE_READ];

const authService = new AuthService(clientId, authority, scopes);

const useAuthStore = defineStore('AuthStore', {
  state: () => ({
    isAuthenticated: !!localStorage.getItem('apiToken'),
    apiToken: localStorage.getItem('apiToken'),
    user: JSON.parse(localStorage.getItem('userDetails')),
    error: null,
  }),
  getters: {
    isLoggedIn: (state) => state.isAuthenticated,
    currentApiToken: (state) => state.apiToken,
    currentUser: (state) => state.user,
    currentError: (state) => state.error,
  },
  actions: {
    async login() {
      try {
        const token = await authService.login();
        this.apiToken = token.apiToken;
        localStorage.setItem('apiToken', token.apiToken);
        this.isAuthenticated = true;

        fetch(`${import.meta.env.VITE_APP_API_URL}/account/current`, {
          headers: {
            Authorization: `Bearer ${token.apiToken}`,
          },
        })
          .then((response) => response.json())
          .then((data) => {
            localStorage.setItem('userDetails', JSON.stringify(data));
            this.user = data;
          });
      } catch (error) {
        this.error = error;
      }
    },
    async logout() {
      try {
        await authService.logout();
        this.user = null;
        this.apiToken = null;
        this.isAuthenticated = false;
        localStorage.removeItem('apiToken');
        localStorage.removeItem('userDetails');
      } catch (error) {
        this.error = error;
      }
    },
  },
});

export default useAuthStore;

AuthService.js

import * as Msal from 'msal';

export default class AuthService {
  constructor(clientId, authority, scopes) {
    this.app = new Msal.UserAgentApplication({
      auth: {
        clientId,
        authority,
        postLogoutRedirectUri: window.location.origin,
        redirectUri: window.location.origin,
        validateAuthority: false,
      },
      cache: {
        cacheLocation: 'localStorage',
      },
    });

    this.scopes = scopes;
  }

  async login() {
    const loginRequest = {
      scopes: this.scopes,
      prompt: 'select_account',
    };

    const accessTokenRequest = {
      scopes: this.scopes,
    };

    let token = {};

    try {
      await this.app.loginPopup(loginRequest);
    } catch (error) {
      return undefined;
    }

    try {
      const acquireTokenSilent = await this.app.acquireTokenSilent(accessTokenRequest);
      token = {
        apiToken: acquireTokenSilent.accessToken,
        expiresOn: acquireTokenSilent.expiresOn,
      };
    } catch (error) {
      try {
        const acquireTokenPopup = await this.app.acquireTokenPopup(accessTokenRequest);
        token = {
          apiToken: acquireTokenPopup.accessToken,
          expiresOn: acquireTokenPopup.expiresOn,
        };
      } catch (errorPopup) {
        return undefined;
      }
    }

    return token;
  }

  logout() {
    this.app.logout();
  }
}


来源: stackexchange

问:
How do you configure emmet to show hints with tags in backticks?
I'm using a VS Code. I have a HTML file with section  and I tried to add function where I'm returning a HTML code in backticks. Emmet doesn't work I have to type all html tags myself. Hint is missing.</p>

ContentLicense: CC BY-SA 4.0


问:
RoutingError (No route matches [GET] "/packs/application-8e6ca2ce7d44b0980e70.js"
The js code from the application fails while loading cause I made some changes with the NPM and eslint. Any solution for it?
Not going to profile tab (No routing error)</p>
```<code>import 'core-js/stable';
import 'dom4';
import WebpackerReact from 'webpacker-react';
import Profile from 'containers/Profile';
require('@rails/ujs').start();
WebpackerReact.setup({ Profile });
</code>```
```<code>Started GET "/packs/application-8e6ca2ce7d44b0980e70.js" for 172.20.0.1 at 2023-01-16 07:01:18 +0000
web_1           |
web_1           | ActionController::RoutingError (No route matches [GET] "/packs/application-8e6ca2ce7d44b0980e70.js"):
web_1           |
web_1           | actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'
web_1           | rollbar (2.22.1) lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app'
web_1           | railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call'
web_1           | activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged'
web_1           | activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged'
web_1           | activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged'
web_1           | railties (5.2.3) lib/rails/rack/logger.rb:26:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | request_store (1.4.1) lib/request_store/middleware.rb:19:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | rack (2.2.3) lib/rack/method_override.rb:24:in `call'
</code>```

Body:
The js code from the application fails while loading cause I made some changes with the NPM and eslint. Any solution for it?
Not going to profile tab (No routing error)

import 'core-js/stable';
import 'dom4';
import WebpackerReact from 'webpacker-react';
import Profile from 'containers/Profile';
require('@rails/ujs').start();
WebpackerReact.setup({ Profile });

Started GET "/packs/application-8e6ca2ce7d44b0980e70.js" for 172.20.0.1 at 2023-01-16 07:01:18 +0000
web_1           |
web_1           | ActionController::RoutingError (No route matches [GET] "/packs/application-8e6ca2ce7d44b0980e70.js"):
web_1           |
web_1           | actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call'
web_1           | rollbar (2.22.1) lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app'
web_1           | railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call'
web_1           | activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged'
web_1           | activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged'
web_1           | activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged'
web_1           | railties (5.2.3) lib/rails/rack/logger.rb:26:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | request_store (1.4.1) lib/request_store/middleware.rb:19:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call'
web_1           | newrelic_rpm (6.9.0.363) lib/new_relic/agent/instrumentation/middleware_tracing.rb:99:in `call'
web_1           | rack (2.2.3) lib/rack/method_override.rb:24:in `call'


问:
Chaning Slider Value doesn't change the output
I am creating a sound application where it uses filters such as reverb and a dynamic compressor. I tried to implement a slider to change the values of the output, release, etc.

```<code>// Dynamic Compressor

    // Method 1
    dynamicCompressor.amp(sliderDCOutput.value());
    dynamicCompressor.set(sliderDCAttack.value(), sliderDCKnee.value(), sliderDCRatio.value(), sliderDCThreshold.value(), sliderDCRelease.value());
    dynamicCompressor.drywet(sliderDCDryWet.value());

    // Method 2
    dynamicCompressor.drywet(sliderDCDryWet.value());
    dynamicCompressor.amp(sliderDCOutput.value());
    dynamicCompressor.attack(sliderDCAttack.value());
    dynamicCompressor.knee(sliderDCKnee.value());
    dynamicCompressor.ratio(sliderDCRatio.value());
    dynamicCompressor.release(sliderDCRelease.value());
    dynamicCompressor.threshold(sliderDCThreshold.value());
</code>```

I've tried using both methods, but it still doesnt change anything. I tried using the 2 methods for all the filters I'm trying to chain together. I'm not sure if it's even the slider problem or something else altogether.

Here is the whole code just in case:

```<code>let mySoundFile = "/Sounds/320952__kevcio__amen-break-f-180-bpm-16-bars.wav";
let LPfilter, wDistortion, dynamicCompressor, reverb, fft;
let playButton, stopButton, sliderVolume, startButton, skipButton, loopButton, recordButton;
let mic, recorder, soundFile, state = 0;
let sliderReverbDuration, sliderReverbDryWet, sliderReverbOutput, sliderReverbDecay, reverbReverseButton, reverseReverb = false;
let sliderLPDryWet, sliderLPOutput, sliderLPCutoffFreq, sliderLPResonance;
let sliderDCDryWet, sliderDCOutput, sliderDCAttack, sliderDCKnee, sliderDCRelease, sliderDCRatio, sliderDCThreshold;
let sliderWDDistortion, sliderWDOversample, sliderWDDryWet, sliderWDOutput;

function preload(){
    soundFormats("wav", "mp3");
    mySound = loadSound(mySoundFile);
    LPfilter = new p5.LowPass();
    wDistortion = new p5.Distortion();
    dynamicCompressor = new p5.Compressor();
    reverb = new p5.Reverb();
    fft = new p5.FFT();
    mySound.disconnect();
}

function setup() {
    createCanvas(1200, 1000);
    background(180);

    // Set up audio chain
    mySound.connect(LPfilter);
    LPfilter.chain(wDistortion, dynamicCompressor, reverb);

    // Set up other controls and buttons
    gui_configuration();
}

function draw() {
    mySound.setVolume(sliderVolume.value());

    // Low-Pass Filter
    LPfilter.amp(sliderLPOutput.value());
    LPfilter.set(sliderLPCutoffFreq.value(), sliderLPResonance.value());
    LPfilter.drywet(sliderLPDryWet.value());

    // Waveshaper Distortion
    wDistortion.amp();
    if (sliderWDOversample.value() == 0){
        wDistortion.set(sliderWDDistortion.value(), "none");
    }

    else{
        wDistortion.set(sliderWDDistortion.value(), `${sliderWDOversample.value()}x`);
    }

    wDistortion.drywet(sliderWDDryWet.value());

    // Dynamic Compressor
    dynamicCompressor.amp(sliderDCOutput.value());
    dynamicCompressor.set(sliderDCAttack.value(), sliderDCKnee.value(), sliderDCRatio.value(), sliderDCThreshold.value(), sliderDCRelease.value());
    dynamicCompressor.drywet(sliderDCDryWet.value());

    dynamicCompressor.drywet(sliderDCDryWet.value());
    dynamicCompressor.amp(sliderDCOutput.value());
    dynamicCompressor.attack(sliderDCAttack.value());
    dynamicCompressor.knee(sliderDCKnee.value());
    dynamicCompressor.ratio(sliderDCRatio.value());
    dynamicCompressor.release(sliderDCRelease.value());
    dynamicCompressor.threshold(sliderDCThreshold.value());

    // Reverb
    reverb.amp(sliderReverbOutput.value());
    reverb.set(sliderReverbDuration.value(), sliderReverbDecay.value(), reverseReverb);
    reverb.drywet(sliderReverbDryWet.value());

    let a = 490
    let b = 510
    let spectrum = fft.analyze();
    noStroke();
    fill(0, 255, 0, 200);
    for (let i = 0; i < spectrum.length; i++) {
        let x = map(i, 0, spectrum.length, a, 800);
        let h = -b + map(spectrum[i], 0, 255, b, 300);
        rect(x, a, b / spectrum.length, h);
    }

//    let c = 690;
//    let d = 510;
//    let spectrum2 = fft2.analyze();
//    noStroke()loopButton;
//    fill(0, 255, 0, 200);
//    for (let i = 0; i < spectrum2.length; i++){
//        let x = map(i, 0, spectrum2.length, c, 800);
//        let h = -b + map(spectrum2[i], 0, 255, d, 500);
//        rect(x, c, d / spectrum2.length, h)
//    }
}

function pauseSound(){
    mySound.pause();
    console.log(getAudioContext().state);
}

function playSound(){
    mySound.play();
    console.log(getAudioContext().state);
}

function stopSound(){
    mySound.stop();
    console.log(getAudioContext().state);
}

function jumpToStart(){
    mySound.jump(0);
}

function jumpToEnd(){
    let dur = mySound.duration();
    mySound.jump(dur);
    console.log(dur);
}

function loopSound(){
    mySound.loop();
}

// Handle recording of audio
function recordSound(){
    // Resume audio context if not running
    if (getAudioContext().state !== "running"){
        getAudioContext().resume();
    }

    // Check current state and perform appropriate action
    switch (state) {
        case 0: // Ready to record
            // Check if mic is enabled
            if (mic.enabled) {
                // Display recording message
                text("Recording", 505, 100);
                // Start recording
                recorder.record(soundFile);
                // Increment state
                state++;
            }
            break;
        case 1: // Recording in progress
            // Clear background
            background(180);
            // Display message
            text("Recording has been downloaded", 435, 100);
            // Stop recording
            recorder.stop();
            // Save recording to file
            save(soundFile, "output.wav");
            // Reset state
            state = 0;
            break;
        default: // Invalid state
            console.error("Invalid state");
    }
}

function reverbReverse(){
    reverseReverb != reverseReverb;
}

function gui_configuration(){
    // Pause Button
    pauseButton = createButton("Pause");
    pauseButton.position(20, 20);
    pauseButton.size(60, 60);
    pauseButton.mousePressed(pauseSound);

    // Play Button
    playButton = createButton("Play");
    playButton.position(100, 20);
    playButton.size(60, 60);
    playButton.mousePressed(playSound);

    // Stop Button
    stopButton = createButton("Stop");
    stopButton.position(180,20);
    stopButton.size(60, 60);
    stopButton.mousePressed(stopSound);

    // Master Volume Slider
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(575, 100, 100, 200);
    pop();
    sliderVolume = createSlider(0, 2, 1, 0.01);
    sliderVolume.style("transform: rotate(" + 270 + "deg);");
    sliderVolume.position(560, 200);
    text("Master Volume", 585, 130);

    // Skip to Start Button
    startButton = createButton("Skip to Start");
    startButton.position(260, 20);
    startButton.size(60, 60);
    startButton.mousePressed(jumpToStart);

    // Skip to End Button
    skipButton = createButton("Skip to End");
    skipButton.position(340, 20);
    skipButton.size(60, 60);
    skipButton.mousePressed(jumpToEnd);

    // Loop Button
    loopButton = createButton("Loop");
    loopButton.position(420, 20);
    loopButton.size(60, 60);
    loopButton.mousePressed(loopSound);

    // Record Button
    mic = new p5.AudioIn();
    mic.start();
    recorder = new p5.SoundRecorder();
    recorder.setInput(mic);
    soundFile = new p5.SoundFile();
    recordButton = createButton("Record");
    recordButton.position(500, 20);
    recordButton.size(60, 60);
    recordButton.mousePressed(recordSound);

    // Low-Pass Filter Section ////////////
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(20, 100, 200, 420);
    pop();
    text("Low-Pass Filter", 80, 130);

    // Low-Pass Filter Cutoff Frequency Slider
    sliderLPCutoffFreq = createSlider(10, 22050, 11020);
    sliderLPCutoffFreq.style("transform: rotate(" + 270 + "deg);");
    sliderLPCutoffFreq.position(10, 230);
    text("Cutoff Frequency", 30, 160);

    // Low-Pass Filter Resonance Slider
    sliderLPResonance = createSlider(0.001, 1000, 500);
    sliderLPResonance.style("transform: rotate(" + 270 + "deg);");
    sliderLPResonance.position(100, 230);
    text("Resonance", 135, 160);

    // Low-Pass Filter Dry/Wet Slider
    sliderLPDryWet = createSlider(0, 1.0, 0.5, 0.01);
    sliderLPDryWet.style("transform: rotate(" + 270 + "deg);");
    sliderLPDryWet.position(10, 430);
    text("Dry/Wet", 55, 360);

    // Low-Pass Filter Output Level Slider
    sliderLPOutput = createSlider(0, 1.0, 0.5, 0.01);
    sliderLPOutput.style("transform: rotate(" + 270 + "deg);");
    sliderLPOutput.position(100, 430);
    text("Output Level", 130, 360);

    ///////////////////////////////////////

    // Waveshaper Distortion //////////////
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(250, 540, 200, 420);
    pop();
    text("Waveshaper Distortion", 290, 570);

    // Waveshaper Distortion Amount Slider
    sliderWDDistortion = createSlider(0, 1.0, 0.5, 0.01);
    sliderWDDistortion.style("transform: rotate(" + 270 + "deg);");
    sliderWDDistortion.position(240, 670);
    text("Distortion\n Amount", 280, 590);

    // Waveshaper Oversample Slider
    sliderWDOversample = createSlider(0, 4, 2, 2);
    sliderWDOversample.style("transform: rotate(" + 270 + "deg);");
    sliderWDOversample.position(330, 670);
    text("Oversample", 365, 600);

    // Waveshaper Dry/Wet Slider
    sliderWDDryWet = createSlider(0, 4, 2, 2);
    sliderWDDryWet.style("transform: rotate(" + 270 + "deg);");
    sliderWDDryWet.position(240, 860);
    text("Dry/Wet", 285, 790);

    // Waveshaper Output Slider
    sliderWDOutput = createSlider(0, 4, 2, 2);
    sliderWDOutput.style("transform: rotate(" + 270 + "deg);");
    sliderWDOutput.position(330, 860);
    text("Output Level", 360, 790);

    ///////////////////////////////////////

    // Dynamic Compressor Section /////////
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(250, 100, 300, 400);
    pop();
    text("Dynamic Compressor", 345, 130);

    // Dynamic Compressor Attack Slider
    sliderDCAttack = createSlider(0, 1, 0.5, 0.01);
    sliderDCAttack.style("transform: rotate(" + 270 + "deg);");
    sliderDCAttack.position(220, 230);
    text("Attack", 270, 160);

    // Dynamic Compressor Knee Slider
    sliderDCKnee = createSlider(0, 40, 20);
    sliderDCKnee.style("transform: rotate(" + 270 + "deg);");
    sliderDCKnee.position(280, 230);
    text("Knee", 330, 160);

    // Dynamic Compressor Release Slider
    sliderDCRelease = createSlider(0, 1.0, 0.5, 0.01);
    sliderDCRelease.style("transform: rotate(" + 270 + "deg);");
    sliderDCRelease.position(340, 230);
    text("Release", 385, 160);

    // Dynamic Compressor Ratio Slider
    sliderDCRatio = createSlider(1, 20, 10);
    sliderDCRatio.style("transform: rotate(" + 270 + "deg);");
    sliderDCRatio.position(400, 230);
    text("Ratio", 450, 160);

    // Dynamic Compressor Threshold Slider
    sliderDCThreshold = createSlider(-100, 0, -50);
    sliderDCThreshold.style("transform: rotate(" + 270 + "deg);");
    sliderDCThreshold.position(450, 230);
    text("Threshold", 490, 160);

    // Dynamic Compressor Dry/Wet Slider
    sliderDCDryWet = createSlider(0, 1.0, 0.5, 0.01);
    sliderDCDryWet.style("transform: rotate(" + 270 + "deg);");
    sliderDCDryWet.position(280, 400);
    text("Dry/Wet", 325, 330);

    // Dynamic Compressor Output Level Slider
    sliderDCOutput = createSlider(0, 1.0, 0.5, 0.01);
    sliderDCOutput.style("transform: rotate(" + 270 + "deg);");
    sliderDCOutput.position(400, 400);
    text("Output Level", 430, 330);

    ///////////////////////////////////////

    // Reverb Section /////////////////////
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(20, 540, 200, 450);
    pop();
    text("Reverb", 105, 570);

    // Reverb Duration Slider
    sliderReverbDuration = createSlider(0, 10, 5);
    sliderReverbDuration.style("transform: rotate(" + 270 + "deg);");
    sliderReverbDuration.position(10, 670);
    text("Reverb Duration", 35, 600);

    // Reverb Decay Rate Slider
    sliderReverbDecay = createSlider(0, 100, 50);
    sliderReverbDecay.style("transform: rotate(" + 270 + "deg);");
    sliderReverbDecay.position(100, 670);
    text("Decay Rate", 135, 600);

    // Reverb Reverse Button
    reverbReverseButton = createButton("Reverse");
    reverbReverseButton.position(45, 760);
    reverbReverseButton.size(60,40);
    reverbReverseButton.mousePressed(reverbReverse);

    // Reverb Dry/Wet Slider
    sliderReverbDryWet = createSlider(0, 1.0, 0.5, 0.01);
    sliderReverbDryWet.style("transform: rotate(" + 270 + "deg);");
    sliderReverbDryWet.position(10, 900);
    text("Dry/Wet", 55, 830);

    // Reverb Output Level Slider
    sliderReverbOutput = createSlider(0, 1.0, 0.5, 0.01);
    sliderReverbOutput.style("transform: rotate(" + 270 + "deg);");
    sliderReverbOutput.position(100, 900);
    text("Output Level", 130, 830);
}
</code>```

Body:
I am creating a sound application where it uses filters such as reverb and a dynamic compressor. I tried to implement a slider to change the values of the output, release, etc.

// Dynamic Compressor

    // Method 1
    dynamicCompressor.amp(sliderDCOutput.value());
    dynamicCompressor.set(sliderDCAttack.value(), sliderDCKnee.value(), sliderDCRatio.value(), sliderDCThreshold.value(), sliderDCRelease.value());
    dynamicCompressor.drywet(sliderDCDryWet.value());

    // Method 2
    dynamicCompressor.drywet(sliderDCDryWet.value());
    dynamicCompressor.amp(sliderDCOutput.value());
    dynamicCompressor.attack(sliderDCAttack.value());
    dynamicCompressor.knee(sliderDCKnee.value());
    dynamicCompressor.ratio(sliderDCRatio.value());
    dynamicCompressor.release(sliderDCRelease.value());
    dynamicCompressor.threshold(sliderDCThreshold.value());

I've tried using both methods, but it still doesnt change anything. I tried using the 2 methods for all the filters I'm trying to chain together. I'm not sure if it's even the slider problem or something else altogether.

Here is the whole code just in case:

let mySoundFile = "/Sounds/320952__kevcio__amen-break-f-180-bpm-16-bars.wav";
let LPfilter, wDistortion, dynamicCompressor, reverb, fft;
let playButton, stopButton, sliderVolume, startButton, skipButton, loopButton, recordButton;
let mic, recorder, soundFile, state = 0;
let sliderReverbDuration, sliderReverbDryWet, sliderReverbOutput, sliderReverbDecay, reverbReverseButton, reverseReverb = false;
let sliderLPDryWet, sliderLPOutput, sliderLPCutoffFreq, sliderLPResonance;
let sliderDCDryWet, sliderDCOutput, sliderDCAttack, sliderDCKnee, sliderDCRelease, sliderDCRatio, sliderDCThreshold;
let sliderWDDistortion, sliderWDOversample, sliderWDDryWet, sliderWDOutput;

function preload(){
    soundFormats("wav", "mp3");
    mySound = loadSound(mySoundFile);
    LPfilter = new p5.LowPass();
    wDistortion = new p5.Distortion();
    dynamicCompressor = new p5.Compressor();
    reverb = new p5.Reverb();
    fft = new p5.FFT();
    mySound.disconnect();
}

function setup() {
    createCanvas(1200, 1000);
    background(180);

    // Set up audio chain
    mySound.connect(LPfilter);
    LPfilter.chain(wDistortion, dynamicCompressor, reverb);

    // Set up other controls and buttons
    gui_configuration();
}

function draw() {
    mySound.setVolume(sliderVolume.value());

    // Low-Pass Filter
    LPfilter.amp(sliderLPOutput.value());
    LPfilter.set(sliderLPCutoffFreq.value(), sliderLPResonance.value());
    LPfilter.drywet(sliderLPDryWet.value());

    // Waveshaper Distortion
    wDistortion.amp();
    if (sliderWDOversample.value() == 0){
        wDistortion.set(sliderWDDistortion.value(), "none");
    }

    else{
        wDistortion.set(sliderWDDistortion.value(), `${sliderWDOversample.value()}x`);
    }

    wDistortion.drywet(sliderWDDryWet.value());

    // Dynamic Compressor
    dynamicCompressor.amp(sliderDCOutput.value());
    dynamicCompressor.set(sliderDCAttack.value(), sliderDCKnee.value(), sliderDCRatio.value(), sliderDCThreshold.value(), sliderDCRelease.value());
    dynamicCompressor.drywet(sliderDCDryWet.value());

    dynamicCompressor.drywet(sliderDCDryWet.value());
    dynamicCompressor.amp(sliderDCOutput.value());
    dynamicCompressor.attack(sliderDCAttack.value());
    dynamicCompressor.knee(sliderDCKnee.value());
    dynamicCompressor.ratio(sliderDCRatio.value());
    dynamicCompressor.release(sliderDCRelease.value());
    dynamicCompressor.threshold(sliderDCThreshold.value());

    // Reverb
    reverb.amp(sliderReverbOutput.value());
    reverb.set(sliderReverbDuration.value(), sliderReverbDecay.value(), reverseReverb);
    reverb.drywet(sliderReverbDryWet.value());

    let a = 490
    let b = 510
    let spectrum = fft.analyze();
    noStroke();
    fill(0, 255, 0, 200);
    for (let i = 0; i < spectrum.length; i++) {
        let x = map(i, 0, spectrum.length, a, 800);
        let h = -b + map(spectrum[i], 0, 255, b, 300);
        rect(x, a, b / spectrum.length, h);
    }

//    let c = 690;
//    let d = 510;
//    let spectrum2 = fft2.analyze();
//    noStroke()loopButton;
//    fill(0, 255, 0, 200);
//    for (let i = 0; i < spectrum2.length; i++){
//        let x = map(i, 0, spectrum2.length, c, 800);
//        let h = -b + map(spectrum2[i], 0, 255, d, 500);
//        rect(x, c, d / spectrum2.length, h)
//    }
}

function pauseSound(){
    mySound.pause();
    console.log(getAudioContext().state);
}

function playSound(){
    mySound.play();
    console.log(getAudioContext().state);
}

function stopSound(){
    mySound.stop();
    console.log(getAudioContext().state);
}

function jumpToStart(){
    mySound.jump(0);
}

function jumpToEnd(){
    let dur = mySound.duration();
    mySound.jump(dur);
    console.log(dur);
}

function loopSound(){
    mySound.loop();
}

// Handle recording of audio
function recordSound(){
    // Resume audio context if not running
    if (getAudioContext().state !== "running"){
        getAudioContext().resume();
    }

    // Check current state and perform appropriate action
    switch (state) {
        case 0: // Ready to record
            // Check if mic is enabled
            if (mic.enabled) {
                // Display recording message
                text("Recording", 505, 100);
                // Start recording
                recorder.record(soundFile);
                // Increment state
                state++;
            }
            break;
        case 1: // Recording in progress
            // Clear background
            background(180);
            // Display message
            text("Recording has been downloaded", 435, 100);
            // Stop recording
            recorder.stop();
            // Save recording to file
            save(soundFile, "output.wav");
            // Reset state
            state = 0;
            break;
        default: // Invalid state
            console.error("Invalid state");
    }
}

function reverbReverse(){
    reverseReverb != reverseReverb;
}

function gui_configuration(){
    // Pause Button
    pauseButton = createButton("Pause");
    pauseButton.position(20, 20);
    pauseButton.size(60, 60);
    pauseButton.mousePressed(pauseSound);

    // Play Button
    playButton = createButton("Play");
    playButton.position(100, 20);
    playButton.size(60, 60);
    playButton.mousePressed(playSound);

    // Stop Button
    stopButton = createButton("Stop");
    stopButton.position(180,20);
    stopButton.size(60, 60);
    stopButton.mousePressed(stopSound);

    // Master Volume Slider
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(575, 100, 100, 200);
    pop();
    sliderVolume = createSlider(0, 2, 1, 0.01);
    sliderVolume.style("transform: rotate(" + 270 + "deg);");
    sliderVolume.position(560, 200);
    text("Master Volume", 585, 130);

    // Skip to Start Button
    startButton = createButton("Skip to Start");
    startButton.position(260, 20);
    startButton.size(60, 60);
    startButton.mousePressed(jumpToStart);

    // Skip to End Button
    skipButton = createButton("Skip to End");
    skipButton.position(340, 20);
    skipButton.size(60, 60);
    skipButton.mousePressed(jumpToEnd);

    // Loop Button
    loopButton = createButton("Loop");
    loopButton.position(420, 20);
    loopButton.size(60, 60);
    loopButton.mousePressed(loopSound);

    // Record Button
    mic = new p5.AudioIn();
    mic.start();
    recorder = new p5.SoundRecorder();
    recorder.setInput(mic);
    soundFile = new p5.SoundFile();
    recordButton = createButton("Record");
    recordButton.position(500, 20);
    recordButton.size(60, 60);
    recordButton.mousePressed(recordSound);

    // Low-Pass Filter Section ////////////
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(20, 100, 200, 420);
    pop();
    text("Low-Pass Filter", 80, 130);

    // Low-Pass Filter Cutoff Frequency Slider
    sliderLPCutoffFreq = createSlider(10, 22050, 11020);
    sliderLPCutoffFreq.style("transform: rotate(" + 270 + "deg);");
    sliderLPCutoffFreq.position(10, 230);
    text("Cutoff Frequency", 30, 160);

    // Low-Pass Filter Resonance Slider
    sliderLPResonance = createSlider(0.001, 1000, 500);
    sliderLPResonance.style("transform: rotate(" + 270 + "deg);");
    sliderLPResonance.position(100, 230);
    text("Resonance", 135, 160);

    // Low-Pass Filter Dry/Wet Slider
    sliderLPDryWet = createSlider(0, 1.0, 0.5, 0.01);
    sliderLPDryWet.style("transform: rotate(" + 270 + "deg);");
    sliderLPDryWet.position(10, 430);
    text("Dry/Wet", 55, 360);

    // Low-Pass Filter Output Level Slider
    sliderLPOutput = createSlider(0, 1.0, 0.5, 0.01);
    sliderLPOutput.style("transform: rotate(" + 270 + "deg);");
    sliderLPOutput.position(100, 430);
    text("Output Level", 130, 360);

    ///////////////////////////////////////

    // Waveshaper Distortion //////////////
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(250, 540, 200, 420);
    pop();
    text("Waveshaper Distortion", 290, 570);

    // Waveshaper Distortion Amount Slider
    sliderWDDistortion = createSlider(0, 1.0, 0.5, 0.01);
    sliderWDDistortion.style("transform: rotate(" + 270 + "deg);");
    sliderWDDistortion.position(240, 670);
    text("Distortion\n Amount", 280, 590);

    // Waveshaper Oversample Slider
    sliderWDOversample = createSlider(0, 4, 2, 2);
    sliderWDOversample.style("transform: rotate(" + 270 + "deg);");
    sliderWDOversample.position(330, 670);
    text("Oversample", 365, 600);

    // Waveshaper Dry/Wet Slider
    sliderWDDryWet = createSlider(0, 4, 2, 2);
    sliderWDDryWet.style("transform: rotate(" + 270 + "deg);");
    sliderWDDryWet.position(240, 860);
    text("Dry/Wet", 285, 790);

    // Waveshaper Output Slider
    sliderWDOutput = createSlider(0, 4, 2, 2);
    sliderWDOutput.style("transform: rotate(" + 270 + "deg);");
    sliderWDOutput.position(330, 860);
    text("Output Level", 360, 790);

    ///////////////////////////////////////

    // Dynamic Compressor Section /////////
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(250, 100, 300, 400);
    pop();
    text("Dynamic Compressor", 345, 130);

    // Dynamic Compressor Attack Slider
    sliderDCAttack = createSlider(0, 1, 0.5, 0.01);
    sliderDCAttack.style("transform: rotate(" + 270 + "deg);");
    sliderDCAttack.position(220, 230);
    text("Attack", 270, 160);

    // Dynamic Compressor Knee Slider
    sliderDCKnee = createSlider(0, 40, 20);
    sliderDCKnee.style("transform: rotate(" + 270 + "deg);");
    sliderDCKnee.position(280, 230);
    text("Knee", 330, 160);

    // Dynamic Compressor Release Slider
    sliderDCRelease = createSlider(0, 1.0, 0.5, 0.01);
    sliderDCRelease.style("transform: rotate(" + 270 + "deg);");
    sliderDCRelease.position(340, 230);
    text("Release", 385, 160);

    // Dynamic Compressor Ratio Slider
    sliderDCRatio = createSlider(1, 20, 10);
    sliderDCRatio.style("transform: rotate(" + 270 + "deg);");
    sliderDCRatio.position(400, 230);
    text("Ratio", 450, 160);

    // Dynamic Compressor Threshold Slider
    sliderDCThreshold = createSlider(-100, 0, -50);
    sliderDCThreshold.style("transform: rotate(" + 270 + "deg);");
    sliderDCThreshold.position(450, 230);
    text("Threshold", 490, 160);

    // Dynamic Compressor Dry/Wet Slider
    sliderDCDryWet = createSlider(0, 1.0, 0.5, 0.01);
    sliderDCDryWet.style("transform: rotate(" + 270 + "deg);");
    sliderDCDryWet.position(280, 400);
    text("Dry/Wet", 325, 330);

    // Dynamic Compressor Output Level Slider
    sliderDCOutput = createSlider(0, 1.0, 0.5, 0.01);
    sliderDCOutput.style("transform: rotate(" + 270 + "deg);");
    sliderDCOutput.position(400, 400);
    text("Output Level", 430, 330);

    ///////////////////////////////////////

    // Reverb Section /////////////////////
    push();
    fill(180);
    strokeWeight(2);
    stroke(0);
    rect(20, 540, 200, 450);
    pop();
    text("Reverb", 105, 570);

    // Reverb Duration Slider
    sliderReverbDuration = createSlider(0, 10, 5);
    sliderReverbDuration.style("transform: rotate(" + 270 + "deg);");
    sliderReverbDuration.position(10, 670);
    text("Reverb Duration", 35, 600);

    // Reverb Decay Rate Slider
    sliderReverbDecay = createSlider(0, 100, 50);
    sliderReverbDecay.style("transform: rotate(" + 270 + "deg);");
    sliderReverbDecay.position(100, 670);
    text("Decay Rate", 135, 600);

    // Reverb Reverse Button
    reverbReverseButton = createButton("Reverse");
    reverbReverseButton.position(45, 760);
    reverbReverseButton.size(60,40);
    reverbReverseButton.mousePressed(reverbReverse);

    // Reverb Dry/Wet Slider
    sliderReverbDryWet = createSlider(0, 1.0, 0.5, 0.01);
    sliderReverbDryWet.style("transform: rotate(" + 270 + "deg);");
    sliderReverbDryWet.position(10, 900);
    text("Dry/Wet", 55, 830);

    // Reverb Output Level Slider
    sliderReverbOutput = createSlider(0, 1.0, 0.5, 0.01);
    sliderReverbOutput.style("transform: rotate(" + 270 + "deg);");
    sliderReverbOutput.position(100, 900);
    text("Output Level", 130, 830);
}


问:
Gradle differences between Linux and MacOS behavior with respect to up-to-date handling
I've got a large Gradle build script that I run on several different platforms. I was very surprised to discover that it gets (or appears to get) out-of-date checking wrong on Linux.

I tried to get some feedback from a forum post:

https://discuss.gradle.org/t/macos-vs-linux-and-up-to-date-checking/44499

but no joy. Any clues most joyfully accepted.


问:
Clang-Tidy CMake VisualStudio
How to execute clang-tidy with CMake in Visual studio just as single target?
1.OS: Windows
2.IDE: Visual Studio 2022
3.LLVM: Installed
4.Clang-Tidy: 15.0.6
5.Ninja: Installed (and added to path)

CMakeLists.txt

```<code>add_custom_target(tidy
    COMMAND ${CMAKE_COMMAND} -DCLANG_TIDY_EXECUTABLE=${CLANG_TIDY_EXECUTABLE} -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} -P ./cmake/Tidy.cmake
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)
</code>```

cmake/Tidy.cmake

```<code>find_program(CLANG_TIDY_EXECUTABLE "clang-tidy")
execute_process(COMMAND run-clang-tidy -clang-tidy-binary ${CLANG_TIDY_EXECUTABLE} -p ${PROJECT_BINARY_DIR} RESULTS_VARIABLE EXIT_CODE)
if(NOT EXIT_CODE STREQUAL 0)
    message(FATAL_ERROR "Analysis failed")
endif()
</code>```

Output:

```<code>Analysis failed
</code>```

Title: Clang-Tidy CMake VisualStudio

Body:
How to execute clang-tidy with CMake in Visual studio just as single target?
1.OS: Windows
2.IDE: Visual Studio 2022
3.LLVM: Installed
4.Clang-Tidy: 15.0.6
5.Ninja: Installed (and added to path)

CMakeLists.txt

add_custom_target(tidy
    COMMAND ${CMAKE_COMMAND} -DCLANG_TIDY_EXECUTABLE=${CLANG_TIDY_EXECUTABLE} -DPROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} -P ./cmake/Tidy.cmake
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} VERBATIM)

cmake/Tidy.cmake

find_program(CLANG_TIDY_EXECUTABLE "clang-tidy")
execute_process(COMMAND run-clang-tidy -clang-tidy-binary ${CLANG_TIDY_EXECUTABLE} -p ${PROJECT_BINARY_DIR} RESULTS_VARIABLE EXIT_CODE)
if(NOT EXIT_CODE STREQUAL 0)
    message(FATAL_ERROR "Analysis failed")
endif()

Output:

Analysis failed


问:
Want YARN to edits spark's property
I am running Spark on YARN. in spark/conf/core-site.xml there are  properties like

...
<property>
   <name>...</name>
   <value>...</value>
</property>
<property>
  <name>my.target.keyA</name>
  <value>MY_TARGET_VALUE_AAA</value>
</property>
...
```
<p>Want to change <code>MY_TARGET_VALUE_AAA</code> to <code>MY_TARGET_VALUE_BBB</code> without editing any configs on Client Side but YARN itself edits it depending on some rules we've already deployed after spark submits the app to YARN.</p>
<p>So I rewrite yarn nodemanger code in <code>hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java</code></p>
<pre class="lang-java prettyprint-override"><code>@Override
  public int launchContainer(ContainerStartContext ctx) throws IOException, ConfigurationException {
    ....
    List<String> localDirs = ctx.getLocalDirs();
    List<String> logDirs = ctx.getLogDirs()

    Log.info("--------------- change start --------------------------------")
    Map<Path, List<String>> localizedResources = ctx.getLocalizedResources();
    Set<Path> paths = localizedResources.keySet();
    for (Path path : paths) {
        String pathName = path.toUri().getPath();
        if (StringUtils.isNotEmpty(pathName) && pathName.contains("__spark_conf__.zip")) {
        File[] configFiles = new File(pathName).listFiles();
        for (File configFile:configFiles){
           if (configFile.getName().equalsIgnoreCase("__spark_hadoop_conf__.xml")){
                // backup the xml
               // add MY_TARGET_VALUE_BBB to the xml
           }
        }
    }
    Log.info("--------------- change end --------------------------------")

    FsPermission dirPerm = new FsPermission(APPDIR_PERM);
     .....
   }
</code>```

then on NodeManager:

[yarn@test-nm]$ ll /data01/yarn/nm-local-dir/usercache/MY_USER/filecache/159/__spark_conf__.zip
total 612
drwx------ 2 yarn yarn   4096 Jan 13 17:15 __hadoop_conf__
-r-x------ 1 yarn yarn   2604 Jan 13 17:14 log4j.properties
-r-x------ 1 yarn yarn   8337 Jan 13 17:14 metrics.properties
-r-x------ 1 yarn yarn   4881 Jan 13 17:14 __spark_conf__.properties
-r-x------ 1 yarn yarn 298985 Jan 13 17:14 __spark_hadoop_conf___bak.xml # original xml
-rw-rw-r-- 1 yarn yarn 297313 Jan 13 17:15 __spark_hadoop_conf__.xml   # new xml
```

but my newly added MY_TARGET_VALUE_BBB doesnt work.

Title: Want YARN to edits spark's property

Body:
I am running Spark on YARN. in spark/conf/core-site.xml there are  properties like

...
<property>
   <name>...</name>
   <value>...</value>
</property>
<property>
  <name>my.target.keyA</name>
  <value>MY_TARGET_VALUE_AAA</value>
</property>
...

Want to change MY_TARGET_VALUE_AAA to MY_TARGET_VALUE_BBB without editing any configs on Client Side but YARN itself edits it depending on some rules we've already deployed after spark submits the app to YARN.

So I rewrite yarn nodemanger code in hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/DefaultContainerExecutor.java

@Override
  public int launchContainer(ContainerStartContext ctx) throws IOException, ConfigurationException {
    ....
    List<String> localDirs = ctx.getLocalDirs();
    List<String> logDirs = ctx.getLogDirs()

    Log.info("--------------- change start --------------------------------")
    Map<Path, List<String>> localizedResources = ctx.getLocalizedResources();
    Set<Path> paths = localizedResources.keySet();
    for (Path path : paths) {
        String pathName = path.toUri().getPath();
        if (StringUtils.isNotEmpty(pathName) && pathName.contains("__spark_conf__.zip")) {
        File[] configFiles = new File(pathName).listFiles();
        for (File configFile:configFiles){
           if (configFile.getName().equalsIgnoreCase("__spark_hadoop_conf__.xml")){
                // backup the xml
               // add MY_TARGET_VALUE_BBB to the xml
           }
        }
    }
    Log.info("--------------- change end --------------------------------")

    FsPermission dirPerm = new FsPermission(APPDIR_PERM);
     .....
   }

then on NodeManager:

[yarn@test-nm]$ ll /data01/yarn/nm-local-dir/usercache/MY_USER/filecache/159/__spark_conf__.zip
total 612
drwx------ 2 yarn yarn   4096 Jan 13 17:15 __hadoop_conf__
-r-x------ 1 yarn yarn   2604 Jan 13 17:14 log4j.properties
-r-x------ 1 yarn yarn   8337 Jan 13 17:14 metrics.properties
-r-x------ 1 yarn yarn   4881 Jan 13 17:14 __spark_conf__.properties
-r-x------ 1 yarn yarn 298985 Jan 13 17:14 __spark_hadoop_conf___bak.xml # original xml
-rw-rw-r-- 1 yarn yarn 297313 Jan 13 17:15 __spark_hadoop_conf__.xml   # new xml

but my newly added MY_TARGET_VALUE_BBB doesnt work.


问:
MSSQL Get latest Dataset from multiple Entries
i have a MSSQL-Table and i want to query the latest dataset for each user.

This is the table.

id = BIGINT AI NN

user =  varchar(50) NN

status  =  TEXT

insertDate = GetDate()

id
user
status
insertDate

1
test
ok
2023-01-13 08:11:03.290

2
ross
Not OK
2023-01-13 08:11:27.667

3
rachel
Not OK
2023-01-13 08:13:37.850

4
rachel
OK
2023-01-13 08:21:48.727

5
test
OK
2023-01-13 08:53:31.440

6
ross
OK
2023-01-13 09:12:50.930

And the result should be

id
user
status
insertDate

4
rachel
OK
2023-01-13 08:21:48.727

5
test
OK
2023-01-13 08:53:31.440

6
ross
OK
2023-01-13 09:12:50.930

I have tried this code

```<code> select *,

  (select MAX(id) maxId from table b WHERE a.user = b.user Group By b.user)
  from table a
</code>```

but i get all Entries instead only the last entries.

thanks in advance

Body:
i have a MSSQL-Table and i want to query the latest dataset for each user.

This is the table.

id = BIGINT AI NN

user =  varchar(50) NN

status  =  TEXT

insertDate = GetDate()

id
user
status
insertDate

1
test
ok
2023-01-13 08:11:03.290

2
ross
Not OK
2023-01-13 08:11:27.667

3
rachel
Not OK
2023-01-13 08:13:37.850

4
rachel
OK
2023-01-13 08:21:48.727

5
test
OK
2023-01-13 08:53:31.440

6
ross
OK
2023-01-13 09:12:50.930

And the result should be

id
user
status
insertDate

4
rachel
OK
2023-01-13 08:21:48.727

5
test
OK
2023-01-13 08:53:31.440

6
ross
OK
2023-01-13 09:12:50.930

I have tried this code

 select *,

  (select MAX(id) maxId from table b WHERE a.user = b.user Group By b.user)
  from table a

but i get all Entries instead only the last entries.

thanks in advance


问:
Best practice for access child of aggregate root
Hi guys I use DDD and clean arch.
I have customer domain as root aggregate and have role for an other domain model as parent of root aggregate, i want to access role in application layer, can i use directly role domain or i have to use customer domain for access it?</p>


问:
OpenSSL 3.0 missing structures definition
While migrating from OpenSSL 1.0.2 to 3.0 code compilation is failing reason being most of the structures are not defined in latest header file.

specifies undefined struct/union 'x509_st'

specifies undefined struct/union 'X509_crl_st'

specifies undefined struct/union 'x509_store_ctx_st

specifies undefined struct/union 'X509_name_entry_st'

use of undefined type 'evp_md_st'

use of undefined type 'ssl_st'

specifies undefined struct/union 'X509_extension_st

undefined struct/union 'X509_name_entry_st'

use of undefined type 'evp_md_st

What is the alternate to this, please help.
I dont find documentation related to structures in openSSL 3.0 migration guide.
Am I missing something ?


问:
turn a dataframe into another one
how to transfer the following dataframe to another one that has studid as index and asstype as columns that have the corresponding score. the new dataframe should have other columns like date_submitted, date, and weight like previous one as I need to process it further. There is a solution but it takes much time. In addition to make a new column late_submit based on the submitted_date<=date.As you can see I want to count the late submissions.

```<code>{'ass_id': {11798: 34907,
  7574: 34904,
  13142: 34908,
  8539: 34904,
  972: 34899},
 'stud_id': {11798: 2332934,
  7574: 686065,
  13142: 678659,
  8539: 644025,
  972: 682983},
 'submitted_date': {11798: 243, 7574: 70, 13142: 234, 8539: 45, 972: 24},
 'score': {11798: 63.0, 7574: 84.0, 13142: 72.0, 8539: 88.0, 972: 76.0},
 'ass_type': {11798: 'C',
  7574: 'C',
  13142: 'C',
  8539: 'C',
  972: 'T'},
 'date': {11798: 241.0, 7574: 241.0, 13142: 241.0, 8539: 241.0, 972: 24.0},
 'weight': {11798: 0.0, 7574: 0.0, 13142: 0.0, 8539: 0.0, 972: 12.5}}
</code>```

one slow solution that

```<code>def generate_df(stud_ids,assessments,max_weight,ass_num,cutoff_date):
      relative_scores = []
      late_scores = []
      scores = []

    for id in stud_ids:
        stud_assess = assessments[assessemnts.stud_id== id]
        filter_ass = stud_assess[stud_assess.date_submitted <= date_cutoff]#Only assessment submitted before or on the cutoff date
        late_ass = filter_ass[filter_ass.submitted_date >  filter_ass.date] # proportion of assessments submitted late
        late_scores.append(len(late_ass))
        scores.append(filter_ass.score.sum()) #unweighted sum of assessment scores so far
        relative_scores.append((filter_ass.score * (filter_ass.weight/max_weight)).sum()) # weighted sum of assessment scores
        assess_complete.append(len(filter_ass.score)/max_assess) #proportion of assessments completed

    return relative_scores, late_scores, raw_score
</code>```

I tried to use pivot_table as I think it it is faster (not sure hoepfully there is a faster way), but couldn't achieve what in function

```<code>def get_features(assessments):
    ass = pd.pivot_table(assessments, index=['id_student'],
    columns='assessment_type',values='score',aggfunc='first')

    return ass
</code>```

As there are experts here, I hope there is a better solution

Title: turn a dataframe into another one

Body:
how to transfer the following dataframe to another one that has studid as index and asstype as columns that have the corresponding score. the new dataframe should have other columns like date_submitted, date, and weight like previous one as I need to process it further. There is a solution but it takes much time. In addition to make a new column late_submit based on the submitted_date<=date.As you can see I want to count the late submissions.

{'ass_id': {11798: 34907,
  7574: 34904,
  13142: 34908,
  8539: 34904,
  972: 34899},
 'stud_id': {11798: 2332934,
  7574: 686065,
  13142: 678659,
  8539: 644025,
  972: 682983},
 'submitted_date': {11798: 243, 7574: 70, 13142: 234, 8539: 45, 972: 24},
 'score': {11798: 63.0, 7574: 84.0, 13142: 72.0, 8539: 88.0, 972: 76.0},
 'ass_type': {11798: 'C',
  7574: 'C',
  13142: 'C',
  8539: 'C',
  972: 'T'},
 'date': {11798: 241.0, 7574: 241.0, 13142: 241.0, 8539: 241.0, 972: 24.0},
 'weight': {11798: 0.0, 7574: 0.0, 13142: 0.0, 8539: 0.0, 972: 12.5}}

one slow solution that

def generate_df(stud_ids,assessments,max_weight,ass_num,cutoff_date):
      relative_scores = []
      late_scores = []
      scores = []

    for id in stud_ids:
        stud_assess = assessments[assessemnts.stud_id== id]
        filter_ass = stud_assess[stud_assess.date_submitted <= date_cutoff]#Only assessment submitted before or on the cutoff date
        late_ass = filter_ass[filter_ass.submitted_date >  filter_ass.date] # proportion of assessments submitted late
        late_scores.append(len(late_ass))
        scores.append(filter_ass.score.sum()) #unweighted sum of assessment scores so far
        relative_scores.append((filter_ass.score * (filter_ass.weight/max_weight)).sum()) # weighted sum of assessment scores
        assess_complete.append(len(filter_ass.score)/max_assess) #proportion of assessments completed

    return relative_scores, late_scores, raw_score

I tried to use pivot_table as I think it it is faster (not sure hoepfully there is a faster way), but couldn't achieve what in function

def get_features(assessments):
    ass = pd.pivot_table(assessments, index=['id_student'],
    columns='assessment_type',values='score',aggfunc='first')

    return ass

As there are experts here, I hope there is a better solution


问:
store bash script to github env failed
I tried to save a bash script into a github env and hope to be able to execute it later

```<code>- name: save to env
  run: |
    echo "SCRIPT=$(cat .github/script.sh)" >> $GITHUB_ENV
</code>```

I got this error

```<code>Error: Unable to process file command 'env' successfully.
Error: Invalid format '# Store the current version number in a variable'
</code>```

I script.sh content (partially)

```<code>#!/bin/bash

# Store the current version number in a variable
current_version=$(jq '.dependencies."main"' package.json | tr -d '"')
</code>```

I have no issue running sh script.sh in my local, what's wrong with my github action config?

Title: store bash script to github env failed

Body:
I tried to save a bash script into a github env and hope to be able to execute it later

- name: save to env
  run: |
    echo "SCRIPT=$(cat .github/script.sh)" >> $GITHUB_ENV

I got this error

Error: Unable to process file command 'env' successfully.
Error: Invalid format '# Store the current version number in a variable'

I script.sh content (partially)

#!/bin/bash

# Store the current version number in a variable
current_version=$(jq '.dependencies."main"' package.json | tr -d '"')

I have no issue running sh script.sh in my local, what's wrong with my github action config?


问:
Kubernetes pod - Failed to determine the https port for redirect
When i do kubectl logs pod_name -n namespace, i find this below:

```<code>warn: FileSystemXmlRepository[60]      Storing keys in a directory '/home/app/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
warn: XmlKeyManager[35]      No XML encryptor configured. Key {e4463e4a-d257-44ba-932e-494413eae8fd} may be persisted to storage in unencrypted form.
warn: WarmupServicesStartupTask      Warming up 14 controllers on http://localhost:3000
fail: WarmupServicesStartupTask      Connection refused
System.Net.Http.HttpRequestException: Connection refused
 ---> System.Net.Sockets.SocketException (111): Connection refused
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at MCS.Core.Web.Api.WarmupServicesStartupTask.<>c__DisplayClass4_0.<<StartAsync>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at MCS.Core.Web.Api.WarmupServicesStartupTask.StartAsync(CancellationToken cancellationToken)
</code>```

Hosting environment: lab Content root path: / Now listening on:
http://[::]:3000 Application started. Press Ctrl+C to shut down. warn:
HttpsRedirectionMiddleware[3]      Failed to determine the https port
for redirect.

Can someone help me to find a solution?
Thanks a lot,
Mauro.

Body:
When i do kubectl logs pod_name -n namespace, i find this below:

warn: FileSystemXmlRepository[60]      Storing keys in a directory '/home/app/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
warn: XmlKeyManager[35]      No XML encryptor configured. Key {e4463e4a-d257-44ba-932e-494413eae8fd} may be persisted to storage in unencrypted form.
warn: WarmupServicesStartupTask      Warming up 14 controllers on http://localhost:3000
fail: WarmupServicesStartupTask      Connection refused
System.Net.Http.HttpRequestException: Connection refused
 ---> System.Net.Sockets.SocketException (111): Connection refused
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at MCS.Core.Web.Api.WarmupServicesStartupTask.<>c__DisplayClass4_0.<<StartAsync>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at MCS.Core.Web.Api.WarmupServicesStartupTask.StartAsync(CancellationToken cancellationToken)

Hosting environment: lab Content root path: / Now listening on:
http://[::]:3000 Application started. Press Ctrl+C to shut down. warn:
HttpsRedirectionMiddleware[3]      Failed to determine the https port
for redirect.

Can someone help me to find a solution?
Thanks a lot,
Mauro.


问:
I want to use lua in pdns-recursor to log the responses/answers
I want to log the response to DNS queries at my pdns recursor to have resolved values at that time (for DynamicDNS etc).
So I wrote a little LUA script that logs the answers and it works so far, but it would be nice to translate the type of the DNSRecord object as the string and not as the integer value. But as I am new to lua I have no idea how to do this.

My lua script is:

```<code>function postresolve(dq)
  pdnslog("postresolve called for "..dq.qname:toString())
  local records = dq:getRecords()
  for k,v in pairs(records) do
    pdnslog(k.." "..v.name:toString().." "..v.type.." "..v:getContent())
  end
  -- default, do not rewrite this response
  return false
end
</code>```

And results look like:

```<code>Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 postresolve called for login.microsoftonline.com.
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 1 login.microsoftonline.com. 5 login.mso.msidentity.com.
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 2 login.mso.msidentity.com. 5 ak.privatelink.msidentity.com.
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 3 ak.privatelink.msidentity.com. 5 www.tm.ak.prd.aadg.akadns.net.
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 4 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.68
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 5 www.tm.ak.prd.aadg.akadns.net. 1 40.126.31.67
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 6 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.73
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 7 www.tm.ak.prd.aadg.akadns.net. 1 40.126.31.71
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 8 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.75
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 9 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.0
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 10 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.71
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 11 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.4
</code>```

It would be nice to have CNAME instead of 5 and A instead of 1 in the log. I am sure there is a function that translate it, but I cannot find it.

Thank you!

Body:
I want to log the response to DNS queries at my pdns recursor to have resolved values at that time (for DynamicDNS etc).
So I wrote a little LUA script that logs the answers and it works so far, but it would be nice to translate the type of the DNSRecord object as the string and not as the integer value. But as I am new to lua I have no idea how to do this.

My lua script is:

function postresolve(dq)
  pdnslog("postresolve called for "..dq.qname:toString())
  local records = dq:getRecords()
  for k,v in pairs(records) do
    pdnslog(k.." "..v.name:toString().." "..v.type.." "..v:getContent())
  end
  -- default, do not rewrite this response
  return false
end

And results look like:

Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 postresolve called for login.microsoftonline.com.
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 1 login.microsoftonline.com. 5 login.mso.msidentity.com.
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 2 login.mso.msidentity.com. 5 ak.privatelink.msidentity.com.
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 3 ak.privatelink.msidentity.com. 5 www.tm.ak.prd.aadg.akadns.net.
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 4 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.68
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 5 www.tm.ak.prd.aadg.akadns.net. 1 40.126.31.67
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 6 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.73
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 7 www.tm.ak.prd.aadg.akadns.net. 1 40.126.31.71
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 8 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.75
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 9 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.0
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 10 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.71
Jan 13 10:31:08 resolv-dns-2 pdns_recursor[12973]: Jan 13 09:31:08 11 www.tm.ak.prd.aadg.akadns.net. 1 20.190.159.4

It would be nice to have CNAME instead of 5 and A instead of 1 in the log. I am sure there is a function that translate it, but I cannot find it.

Thank you!


问:
HMS Core location Kit TypeError: Cannot read properties of undefined (reading 'getFusedLocationProviderClient') - Ionic/Capacitor - VueJS
I'm trying to implement HMS Core location kit into my vue ionic app.

I import HMSLocation and declare it, but when I try to use the getFusedLocationProviderClient function I get

TypeError: Cannot read properties of undefined (reading 'getFusedLocationProviderClient')

```<code>import { HMSLocation } from "@hmscore/ionic-native-hms-location/ngx";
export default {
    data() {
        return {
            hmsLocation: null,
            fusedClient: null,
            locationResult: null,
        };
    },
    mounted() {
        this.getLocation();
    },
    methods: {
        async getLocation() {
            this.hmsLocation = new HMSLocation();
            console.log(this.hmsLocation);
            this.fusedClient = this.hmsLocation.getFusedLocationProviderClient();
            this.locationResult = await this.fusedClient.getLastLocation;
        },
    },
    .....

</code>```

console.log(this.hmsLocation); returns

node_modules/@hmscore/ionic-native-hms-location/ngx

import { IonicNativePlugin } from '@ionic-native/core';
export declare class HMSLocation extends IonicNativePlugin {
    getGeofenceService(): GeofenceService;
    getGeocoderService(language: string, country?: string): GeocoderService;
    getFusedLocationProviderClient(): FusedLocationService;
    getActivityIdentificationService(): ActivityIdentificationService;
    addListener(event: Events, callback: (data: LocationResult | [] | ActivityConversionResponse | ActivityIdentificationResponse) => void): any;
    disableLogger(): Promise<void>;
    enableLogger(): Promise<void>;
}
export declare class BackgroundManager {
    private constructor();
    static notify(notificationId: number, notification: string): void;
    static makeToast(text: string, duration: number): void;
}
export interface FusedLocationService {
    disableBackgroundLocation(): Promise<void>;
    enableBackgroundLocation(notificationId: number, notification: string): Promise<void>;
    checkLocationSettings(request: LocationSettingsRequest): Promise<LocationSettingsStates>;
    flushLocations(): Promise<void>;
    getLastLocation(): Promise<Location>;
    getLastLocationWithAddress(request: LocationRequest): Promise<HWLocation>;
    getLocationAvailability(): Promise<boolean>;
    getNavigationContextState(requestType: NavigationRequestConstants): Promise<NavigationResult>;
    removeLocationUpdates(requestCode: number, type: RequestType): Promise<boolean>;
    requestLocationUpdates(requestCode: number, request: LocationRequest, callback?: (locationResult: LocationResult) => void): Promise<boolean>;
    requestLocationUpdatesEx(requestCode: number, request: LocationRequest): Promise<boolean>;
    setMockLocation(latLng: LatLng): Promise<void>;
    setMockMode(mode: boolean): Promise<void>;
    setLogConfig(logConfigSettings: LogConfigSettings): Promise<void>;
    getLogConfig(): Promise<LogConfigSettings>;
}
```

Body:
I'm trying to implement HMS Core location kit into my vue ionic app.

I import HMSLocation and declare it, but when I try to use the getFusedLocationProviderClient function I get

TypeError: Cannot read properties of undefined (reading 'getFusedLocationProviderClient')

import { HMSLocation } from "@hmscore/ionic-native-hms-location/ngx";
export default {
    data() {
        return {
            hmsLocation: null,
            fusedClient: null,
            locationResult: null,
        };
    },
    mounted() {
        this.getLocation();
    },
    methods: {
        async getLocation() {
            this.hmsLocation = new HMSLocation();
            console.log(this.hmsLocation);
            this.fusedClient = this.hmsLocation.getFusedLocationProviderClient();
            this.locationResult = await this.fusedClient.getLastLocation;
        },
    },
    .....

console.log(this.hmsLocation); returns

node_modules/@hmscore/ionic-native-hms-location/ngx

import { IonicNativePlugin } from '@ionic-native/core';
export declare class HMSLocation extends IonicNativePlugin {
    getGeofenceService(): GeofenceService;
    getGeocoderService(language: string, country?: string): GeocoderService;
    getFusedLocationProviderClient(): FusedLocationService;
    getActivityIdentificationService(): ActivityIdentificationService;
    addListener(event: Events, callback: (data: LocationResult | [] | ActivityConversionResponse | ActivityIdentificationResponse) => void): any;
    disableLogger(): Promise<void>;
    enableLogger(): Promise<void>;
}
export declare class BackgroundManager {
    private constructor();
    static notify(notificationId: number, notification: string): void;
    static makeToast(text: string, duration: number): void;
}
export interface FusedLocationService {
    disableBackgroundLocation(): Promise<void>;
    enableBackgroundLocation(notificationId: number, notification: string): Promise<void>;
    checkLocationSettings(request: LocationSettingsRequest): Promise<LocationSettingsStates>;
    flushLocations(): Promise<void>;
    getLastLocation(): Promise<Location>;
    getLastLocationWithAddress(request: LocationRequest): Promise<HWLocation>;
    getLocationAvailability(): Promise<boolean>;
    getNavigationContextState(requestType: NavigationRequestConstants): Promise<NavigationResult>;
    removeLocationUpdates(requestCode: number, type: RequestType): Promise<boolean>;
    requestLocationUpdates(requestCode: number, request: LocationRequest, callback?: (locationResult: LocationResult) => void): Promise<boolean>;
    requestLocationUpdatesEx(requestCode: number, request: LocationRequest): Promise<boolean>;
    setMockLocation(latLng: LatLng): Promise<void>;
    setMockMode(mode: boolean): Promise<void>;
    setLogConfig(logConfigSettings: LogConfigSettings): Promise<void>;
    getLogConfig(): Promise<LogConfigSettings>;
}


问:
Downloading and playing videos in iphone through phonegap
Is there any way to write an app in which we can download and play a video in our iphone using PhoneGap ?</p>

ContentLicense: CC BY-SA 3.0


问:
How should I create a PrismaAdapter
I would like to create a PrismaAdapter,the model should be a string or the PrismaModel (i dont know how to type it)  but I am struggling and I don't know if it is even possible. Here is my failed attempt.

thx for your help

```<code>import { PrismaClient } from '@prisma/client'

//type PrismaModel = keyof PrismaClient<PrismaClientOptions>
//type PrismaModel = keyof Prisma.userDelegate<GlobalReject>
//type PrismaUserModel = Prisma.userDelegate<GlobalReject>;

class PrismaAdapter {
  private prisma: PrismaClient
  private user: PrismaUserModel

  constructor() {
    this.prisma = new PrismaClient()
    this.user = this.prisma.user
  }

  async findOne(model: PrismaModel, where: object): Promise<any> {
    return await this.prisma[model].findOne({ where })
  }

  async findMany(model: string): Promise<any[]> {
    return await this.prisma[model].findMany()
  }

  async create(model: PrismaModel, data: object): Promise<any> {
    return await this.prisma[model].create({ data })
  }

  async update(model: string, where: object, data: object): Promise<any> {
    return await this.prisma[model].update({ where, data })
  }

  async delete(model: string, where: object): Promise<any> {
    return await this.prisma[model].delete({ where })
  }
}

export default PrismaAdapter

</code>```

I am expecting to use it in a Database service class.

```<code>
import PrismaAdapter from "./PrismaAdapter";

class DatabaseAdapter {
  private database: PrismaAdapter;
  private model: PrismaModel;

  constructor({database, model}: {database: PrismaAdapter, model: PrismaModel}) {
    this.database = database;
  }

  async findOne(model :PrismaModel,id: number): Promise<any> {
    return this.database.findOne(model,where: {id})
  }

  async findMany(model: string): Promise<any[]> {
    return await this.database.findMany(model)
  }

}

export default DatabaseAdapter

</code>```

And use this database Adapter in for exemple a UserRepository.

Title: How should I create a PrismaAdapter

Body:
I would like to create a PrismaAdapter,the model should be a string or the PrismaModel (i dont know how to type it)  but I am struggling and I don't know if it is even possible. Here is my failed attempt.

thx for your help

import { PrismaClient } from '@prisma/client'

//type PrismaModel = keyof PrismaClient<PrismaClientOptions>
//type PrismaModel = keyof Prisma.userDelegate<GlobalReject>
//type PrismaUserModel = Prisma.userDelegate<GlobalReject>;

class PrismaAdapter {
  private prisma: PrismaClient
  private user: PrismaUserModel

  constructor() {
    this.prisma = new PrismaClient()
    this.user = this.prisma.user
  }

  async findOne(model: PrismaModel, where: object): Promise<any> {
    return await this.prisma[model].findOne({ where })
  }

  async findMany(model: string): Promise<any[]> {
    return await this.prisma[model].findMany()
  }

  async create(model: PrismaModel, data: object): Promise<any> {
    return await this.prisma[model].create({ data })
  }

  async update(model: string, where: object, data: object): Promise<any> {
    return await this.prisma[model].update({ where, data })
  }

  async delete(model: string, where: object): Promise<any> {
    return await this.prisma[model].delete({ where })
  }
}

export default PrismaAdapter

I am expecting to use it in a Database service class.

import PrismaAdapter from "./PrismaAdapter";

class DatabaseAdapter {
  private database: PrismaAdapter;
  private model: PrismaModel;

  constructor({database, model}: {database: PrismaAdapter, model: PrismaModel}) {
    this.database = database;
  }

  async findOne(model :PrismaModel,id: number): Promise<any> {
    return this.database.findOne(model,where: {id})
  }

  async findMany(model: string): Promise<any[]> {
    return await this.database.findMany(model)
  }

}

export default DatabaseAdapter

And use this database Adapter in for exemple a UserRepository.


问:
react quill toll bar custom method (font size, etc.)
I want to add the following function to the toolbar of react quill.

num 1 ~ 20 text size custom button

More than 15 types of font styles

Any good way?

current:

```<code>  const modules = {
    toolbar: [
      // [{ font: [] }],
      [{ size: ['14px', '16px', '18px'] }],
      [{ header: [1, 2, 3, 4, 5, 6, false] }],
      ["bold", "italic", "underline", "strike"],
      [{ color: [] }, { background: [] }],
      [{ script: "sub" }, { script: "super" }],
      ["blockquote", "code-block"],
      [{ list: "ordered" }, { list: "bullet" }],
      [{ indent: "-1" }, { indent: "+1" }, { align: [] }],
      ["link", "image", "video"],
      ["clean"],
    ]
  };
</code>```

Body:
I want to add the following function to the toolbar of react quill.

num 1 ~ 20 text size custom button

More than 15 types of font styles

Any good way?

current:

  const modules = {
    toolbar: [
      // [{ font: [] }],
      [{ size: ['14px', '16px', '18px'] }],
      [{ header: [1, 2, 3, 4, 5, 6, false] }],
      ["bold", "italic", "underline", "strike"],
      [{ color: [] }, { background: [] }],
      [{ script: "sub" }, { script: "super" }],
      ["blockquote", "code-block"],
      [{ list: "ordered" }, { list: "bullet" }],
      [{ indent: "-1" }, { indent: "+1" }, { align: [] }],
      ["link", "image", "video"],
      ["clean"],
    ]
  };


问:
How to open my iOS App from Chrome via link?
The question is same as title, I already set the scheme for my iOS app and also open my app from Safari when I clicked the link. When I tried to set Chrome as my default browser then clicked the link, my app didn't open automatically or asked any permission to open it. Does anyone know what should I do?

I already put my apple-app-site-association(AASA) file on my server and set the scheme.


问:
Is is possible to globally force all async methods execute as "synchrone" in C#
I have the following example code:

public virtual async Task<TResponse> ExecuteAsync<TResponse>(Func<TServiceClient, Task<TResponse>> func)
{
    var st1 = new System.Diagnostics.StackTrace().ToString();
    try
    {
        return await func(_clientInstance);
    }
    catch (Exception ex)
    {
        ThrowServiceException(ex, st1);
    }
}

private void ThrowServiceException(Exception ex, string st1)
{
    var st2 = new System.Diagnostics.StackTrace().ToString();
    if (st1 != st2)    {    }
// ...

}
```
<p>And when I a exception is thrown, the difference between stacks before and after is similar to following.
Before:</p>
```   at Common.Autorest.AutorestClientWrapper`1.ExecuteAsync[TResponse](Func`2 func)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Common.Autorest.AutorestClientWrapper`1.ExecuteAsync[TResponse](Func`2 func)
   at Common.Autorest.AutorestClientWrapper`1.Execute[TResponse](Func`2 func)
   at BankingServiceClient.BankApi.GetBufferBalance(CancellationToken cancellationToken)
   at Engine.Services.BalanceWorker.<>c__DisplayClass18_0.<RefreshTreasuryBalance>g__ExecuteTreasuryBalanceRefresh|0(CancellationToken token)
   at Engine.Services.BalanceWorker.ExecuteBalanceRefresh(Action`1 executeRefresh, String loggingName)
   at Engine.Services.BalanceWorker.RefreshTreasuryBalance(Currency currency)
   at Engine.Services.BalanceWorker.<>c__DisplayClass14_2.<.ctor>b__4()
   at Engine.Threading.Runnable.Engine.Threading.IRunnable.RunStep()
   at Engine.Threading.Runner.ExecuteContinously()
   at System.Threading.Thread.StartHelper.Callback(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Thread.StartCallback()
```
<p>After:</p>
```   at Common.Autorest.AutorestClientWrapper`1.ThrowServiceException(Exception ex, String st1)
   at Common.Autorest.AutorestClientWrapper`1.ExecuteAsync[TResponse](Func`2 func)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.<>c.<OutputWaitEtwEvents>b__12_0(Action innerContinuation, Task innerTask)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.FinishStageThree()
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception)
   at Bank.ApiClient.BufferAccountBankAPI.GetAccountBalanceAsync(CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.<>c.<OutputWaitEtwEvents>b__12_0(Action innerContinuation, Task innerTask)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
   at System.Threading.Tasks.AwaitTaskContinuation.System.Threading.IThreadPoolWorkItem.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

```
<p>So, as you can see, stack trace is lost and it is quite hard to figure it out from where the exception is thrown.</p>
<p>I somehow understand why stack so different and I am wondering if is it possible, for debugging purposes, to force all async methods execute immediately to keep stack trace as it is before calling? Maybe with some global variable or something.</p>
<p>The solution described in Is it possible to get a good stack trace with .NET async methods? does not resolve what I want because that one just sanitized "useless" stack items, but in my case stack trace before call is totally different than after call and it seems there is no connection between before and after.</p>
<p>Edit:
Given method is called in multiple occasions.</p>
<p>Some looks like this:</p>
```public async Task<MarketLimits> GetMarketLimits(CancellationToken cancellationToken)
{
  var response = await _serviceClientWrapper.ExecuteAsync(c => c.GetLimitsAsync(cancellationToken));
  // ...
}
```
<p>Some like this:</p>
```public virtual TResponse Execute<TResponse>(Func<TServiceClient, Task<TResponse>> func)
{
    return ExecuteAsync(client => func(client)).GetAwaiter().GetResult();
}
```

Body:
I have the following example code:

public virtual async Task<TResponse> ExecuteAsync<TResponse>(Func<TServiceClient, Task<TResponse>> func)
{
    var st1 = new System.Diagnostics.StackTrace().ToString();
    try
    {
        return await func(_clientInstance);
    }
    catch (Exception ex)
    {
        ThrowServiceException(ex, st1);
    }
}

private void ThrowServiceException(Exception ex, string st1)
{
    var st2 = new System.Diagnostics.StackTrace().ToString();
    if (st1 != st2)    {    }
// ...

}

And when I a exception is thrown, the difference between stacks before and after is similar to following.
Before:

   at Common.Autorest.AutorestClientWrapper`1.ExecuteAsync[TResponse](Func`2 func)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Common.Autorest.AutorestClientWrapper`1.ExecuteAsync[TResponse](Func`2 func)
   at Common.Autorest.AutorestClientWrapper`1.Execute[TResponse](Func`2 func)
   at BankingServiceClient.BankApi.GetBufferBalance(CancellationToken cancellationToken)
   at Engine.Services.BalanceWorker.<>c__DisplayClass18_0.<RefreshTreasuryBalance>g__ExecuteTreasuryBalanceRefresh|0(CancellationToken token)
   at Engine.Services.BalanceWorker.ExecuteBalanceRefresh(Action`1 executeRefresh, String loggingName)
   at Engine.Services.BalanceWorker.RefreshTreasuryBalance(Currency currency)
   at Engine.Services.BalanceWorker.<>c__DisplayClass14_2.<.ctor>b__4()
   at Engine.Threading.Runnable.Engine.Threading.IRunnable.RunStep()
   at Engine.Threading.Runner.ExecuteContinously()
   at System.Threading.Thread.StartHelper.Callback(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Thread.StartCallback()

After:

   at Common.Autorest.AutorestClientWrapper`1.ThrowServiceException(Exception ex, String st1)
   at Common.Autorest.AutorestClientWrapper`1.ExecuteAsync[TResponse](Func`2 func)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.<>c.<OutputWaitEtwEvents>b__12_0(Action innerContinuation, Task innerTask)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining)
   at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.FinishStageThree()
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.FinishSlow(Boolean userDelegateExecute)
   at System.Threading.Tasks.Task.TrySetException(Object exceptionObject)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception, Task`1& taskField)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.SetException(Exception exception)
   at Bank.ApiClient.BufferAccountBankAPI.GetAccountBalanceAsync(CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.ExecutionContextCallback(Object s)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.<>c.<OutputWaitEtwEvents>b__12_0(Action innerContinuation, Task innerTask)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.ContinuationWrapper.Invoke()
   at System.Threading.Tasks.AwaitTaskContinuation.System.Threading.IThreadPoolWorkItem.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

So, as you can see, stack trace is lost and it is quite hard to figure it out from where the exception is thrown.

I somehow understand why stack so different and I am wondering if is it possible, for debugging purposes, to force all async methods execute immediately to keep stack trace as it is before calling? Maybe with some global variable or something.

The solution described in Is it possible to get a good stack trace with .NET async methods? does not resolve what I want because that one just sanitized "useless" stack items, but in my case stack trace before call is totally different than after call and it seems there is no connection between before and after.

Edit:
Given method is called in multiple occasions.

Some looks like this:

public async Task<MarketLimits> GetMarketLimits(CancellationToken cancellationToken)
{
  var response = await _serviceClientWrapper.ExecuteAsync(c => c.GetLimitsAsync(cancellationToken));
  // ...
}

Some like this:

public virtual TResponse Execute<TResponse>(Func<TServiceClient, Task<TResponse>> func)
{
    return ExecuteAsync(client => func(client)).GetAwaiter().GetResult();
}


问:
Rails 7 turbo_frame_tag
I have two forms on the same page.

The first one:

```<code>  <%= form_with url: admin_users_path, method: :get,
                class: "d-none d-md-inline-block me-auto w-100",
                data: {
                  autosave_delay_value: 300,
                  controller: "autosave",
                  turbo_action: "advance",
                  turbo_frame: "users"
                } do %>
    <div class="input-group input-group-merge">
      <%= text_field_tag "search", params[:search],
                                   class: "form-control bg-white",
                                   data: { action: 'keyup->autosave#save' },
                                   placeholder: t("search", scope: "shared.action_name") %>
      <span class="input-group-text bg-white">
        <%= svg_icon("search-1", height: 16) %>
      </span>
    </div>
  <% end %>
</code>```

And second one:

```<code>  <%= form_with url: admin_users_path, method: :get,
                class: "d-none d-md-inline-block me-auto w-100",
                data: {
                  controller: "autosave",
                  turbo_action: "advance",
                  turbo_frame: "users"
                } do %>
    <%= check_box_tag :confirmed, true, false,  data: { action: 'autosave#save' }%>
  <% end %>
</code>```

To display filtered data i use:

```<code>  <%= turbo_frame_tag "users" do %>
    <div class="table-responsive">
      <table class="table table-sm table-hover align-middle table-edge table-nowrap mb-0">
        <thead class="thead-light">
          <tr>....
          ....
</code>```

If I search for a user by name in the first form, for example, type "John" the url looks like this: http://localhost:3000/admin/users?search=john.
If I check the box in the second form the address changes to:
http://localhost:3000/admin/users?confirmed=true
This way I lose the search parameter.

The page is not reloaded, I just change the results.

How to pass this parameter between these forms?

Regards

Rails 7, Hotwire, Stimulus, Ruby 3.0.0, turb_frame_tag

Title: Rails 7 turbo_frame_tag

Body:
I have two forms on the same page.

The first one:

  <%= form_with url: admin_users_path, method: :get,
                class: "d-none d-md-inline-block me-auto w-100",
                data: {
                  autosave_delay_value: 300,
                  controller: "autosave",
                  turbo_action: "advance",
                  turbo_frame: "users"
                } do %>

      <%= text_field_tag "search", params[:search],
                                   class: "form-control bg-white",
                                   data: { action: 'keyup->autosave#save' },
                                   placeholder: t("search", scope: "shared.action_name") %>

        <%= svg_icon("search-1", height: 16) %>

  <% end %>

And second one:

  <%= form_with url: admin_users_path, method: :get,
                class: "d-none d-md-inline-block me-auto w-100",
                data: {
                  controller: "autosave",
                  turbo_action: "advance",
                  turbo_frame: "users"
                } do %>
    <%= check_box_tag :confirmed, true, false,  data: { action: 'autosave#save' }%>
  <% end %>

To display filtered data i use:

  <%= turbo_frame_tag "users" do %>

....
          ....

If I search for a user by name in the first form, for example, type "John" the url looks like this: http://localhost:3000/admin/users?search=john.
If I check the box in the second form the address changes to:
http://localhost:3000/admin/users?confirmed=true
This way I lose the search parameter.

The page is not reloaded, I just change the results.

How to pass this parameter between these forms?

Regards

Rails 7, Hotwire, Stimulus, Ruby 3.0.0, turb_frame_tag


问:
ModuleNotFoundError: No module named
I have a project arranged like so:

```<code>Project
└── test
    ├── main.py
    │
    └── x.py
    │
    └── y.py
</code>```

I try to run the tests by executing python -m test.main.py from the project directory, but I get an error that says ModuleNotFoundError: No module named x.

main.py contains:

```<code>from x import c, k
import y
</code>```

Why do I get this error, and how can I fix it?

Title: ModuleNotFoundError: No module named

Body:
I have a project arranged like so:

Project
└── test
    ├── main.py
    │
    └── x.py
    │
    └── y.py

I try to run the tests by executing python -m test.main.py from the project directory, but I get an error that says ModuleNotFoundError: No module named x.

main.py contains:

from x import c, k
import y

Why do I get this error, and how can I fix it?


问:
job is invoking two times by s3 notifications
i have created lambda function to invoke glue job on s3 bucket notifications. if i place any object in s3 bucket the lambda is invoking glue job correctly.

But, i have created SMB fileshare for s3 bucket, if i place any objects in that fileshare also job is invoking correctly. but the job is running two times if i placed any objects in s3 file share.

does anyone knows why this job will starts two times if i place any objects in s3 mapped drive ???

if requires i will share the code. but code seems perfect.


问:
get_post_meta() of checkboxes returning 0,1 instead of post titles
I have a travel agency wordpress website. I needed to add 'Activities' custom post type and connect activities (e.g. ATV, swimming, hiking) to tours.

Here is what I did:

Added custom post type 'Activities' and custom taxonomy 'Activities categories' with CPT UI plugin.

Edited theme built-in custom post type plugin so that it's connected to Tour custom post type. Explained:

I need all Activities to show as Checkboxes when you edit Tour, and I have accomplished that by getting all Activities Titles in an array:

```<code>    // get activities

    $argss = array(
      'post_type' => 'activities',
      'post_status' => 'publish',
      'numberposts' => -1,
    );

    $activities_posts = get_posts( $argss );

    $activities = array();

    foreach( $activities_posts as $post ) {
      $activities[] = $post->post_title;
    }
</code>```

var_dump of $activities in the plugin file:

```<code>array(2) {
  [0]=>
  string(8) "swimming"
  [1]=>
  string(3) "ATV"
}
</code>```

Passed that to postmetas

```<code>                array(
                    "section"       => "Tour Attributes",
                    "id"            => "tour_activities",
                    "type"          => "checkboxes",
                    "title"         => "Activities",
                    "description"   => "Select Activities that are available for this tour",
                    "items"         => $activities
                ),
</code>```

And that works. For example, I have added 'ATV' and 'Swimming' activities posts, and they show as checkboxes when you Edit tour:

Click for image

The problem is, I need to display available Activities in the Tour page template.

This is my page template code for loading those activities:

```<code>$tour_activities = get_post_meta($post->ID, 'tour_activities', true);

                var_dump(get_post_meta($post->ID, 'tour_activities', true));
                    if(!empty($tour_activities)) {
                        foreach ($tour_activities as $activity) {
                            echo '<h4>' . $activity . '</h4>';
                        }
                    } else {
                        echo "No activities available for this tour.";
                    }
</code>```

And the output in the tour page template is:

```<code>

                array(2) {
  [0]=>
  string(1) "0"
  [1]=>
  string(1) "1"
}
</code>```

When it should be strings 'ATV', 'swimming'

Body:
I have a travel agency wordpress website. I needed to add 'Activities' custom post type and connect activities (e.g. ATV, swimming, hiking) to tours.

Here is what I did:

Added custom post type 'Activities' and custom taxonomy 'Activities categories' with CPT UI plugin.

Edited theme built-in custom post type plugin so that it's connected to Tour custom post type. Explained:

I need all Activities to show as Checkboxes when you edit Tour, and I have accomplished that by getting all Activities Titles in an array:

    // get activities

    $argss = array(
      'post_type' => 'activities',
      'post_status' => 'publish',
      'numberposts' => -1,
    );

    $activities_posts = get_posts( $argss );

    $activities = array();

    foreach( $activities_posts as $post ) {
      $activities[] = $post->post_title;
    }

var_dump of $activities in the plugin file:

array(2) {
  [0]=>
  string(8) "swimming"
  [1]=>
  string(3) "ATV"
}

Passed that to postmetas

                array(
                    "section"       => "Tour Attributes",
                    "id"            => "tour_activities",
                    "type"          => "checkboxes",
                    "title"         => "Activities",
                    "description"   => "Select Activities that are available for this tour",
                    "items"         => $activities
                ),

And that works. For example, I have added 'ATV' and 'Swimming' activities posts, and they show as checkboxes when you Edit tour:

Click for image

The problem is, I need to display available Activities in the Tour page template.

This is my page template code for loading those activities:

$tour_activities = get_post_meta($post->ID, 'tour_activities', true);

                var_dump(get_post_meta($post->ID, 'tour_activities', true));
                    if(!empty($tour_activities)) {
                        foreach ($tour_activities as $activity) {
                            echo '
' . $activity . '
';
                        }
                    } else {
                        echo "No activities available for this tour.";
                    }

And the output in the tour page template is:

                array(2) {
  [0]=>
  string(1) "0"
  [1]=>
  string(1) "1"
}

When it should be strings 'ATV', 'swimming'


问:
Grafana 9.2.3 alert feature: How to export / import alerts as yml/json?
Is it possible to export all alerts of the Grafana 9.2.3 alerts to a json or yml file like all the other dashboards and datasources (and use it later in the provision process)?
I tried using grafana api, but it’s not returning anything.

Greetings and thanks in advance,
Faizan

curl -s -H "Authorization: Bearer api_token -X GET "https://URI/api/alerts" and it's returning []