问:
i386 containers fail to start in DevOps build pipeline
In 2021, for use in Azure DevOps build pipelines, I created a container from debian:stable-slim for the platform linux/i386; this container has been and continues to work fine. However, I recently tried to update the container with the latest Debian image, and now the container starts but the first docker exec command fails with "is not running":

```<code>/usr/bin/docker create --name ed60e48196004beeaf204d6b408c0587_mercontainerregistryazurecriocontainerimagename_0b2e8b --label dc0bfb --network vsts_network_c63d4559d591450c99727c8b84620462  -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/vsts/work/1":"/__w/1" -v "/home/vsts/work/_temp":"/__w/_temp" -v "/home/vsts/work/_tasks":"/__w/_tasks" -v "/opt/hostedtoolcache":"/__t" -v "/home/vsts/agents/2.213.2/externals":"/__a/externals":ro -v "/home/vsts/work/.taskkey":"/__w/.taskkey" ***/container_test_i386_ubuntu "/__a/externals/node/bin/node" -e "setInterval(function(){}, 24 * 60 * 60 * 1000);"
WARNING: The requested image's platform (linux/386) does not match the detected host platform (linux/amd64) and no specific platform was requested
e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3
/usr/bin/docker start e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3
e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3
/usr/bin/docker ps --all --filter id=e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3 --filter status=running --no-trunc --format "{{.ID}} {{.Status}}"
e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3 Up Less than a second
/usr/bin/docker exec  e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3 sh -c "command -v bash"
##[error]Docker-exec executed: `sh -c "command -v bash"`; container id: `e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3`; exit code: `1`; command output: `Error response from daemon: Container e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3 is not running`
</code>```

The problem appears to be the i386 platform: platform amd64 works using both Debian and Ubuntu images as the base, but fails with platform i386. All the containers work when run with Docker Desktop via the docker run command.

The test Dockerfile:

```<code>ARG docker_base=debian:stable-slim
ARG docker_platform=linux/i386

FROM --platform=${docker_platform} ${docker_base}
</code>```

And the pipeline (not the actual registry):

```<code>pool:
  vmImage: ubuntu-latest

container:
  image: registry.azurecr.io/$(containerimagename)
  endpoint: registry

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'
</code>```

What works:

FROM --platform linux/amd64 debian:stable-slim

FROM --platform linux/amd64 amd64/ubuntu

What fails:

FROM --platform linux/i386 debian:stable-slim

FROM --platform linux/i386 i386/ubuntu

EDIT: the container itself is created with a pipeline:

```<code>pool:
  vmImage: 'ubuntu-latest'

steps:
- task: Docker@2
  inputs:
    containerRegistry: 'registry'
    repository: $(image_name)
    command: 'build'
    arguments: '--build-arg docker_base=$(docker_base) --build-arg docker_platform=$(docker_platform)'
    tags: |
      latest
      $(Build.BuildId)
  displayName: 'Build the Docker image for $(docker_platform)'

- task: Docker@2
  inputs:
    containerRegistry: 'registry'
    repository: $(image_name)
    command: 'push'
    tags: |
      latest
      $(Build.BuildId)
  displayName: 'Push the Docker image to $(image_name)'
</code>```

Body:
In 2021, for use in Azure DevOps build pipelines, I created a container from debian:stable-slim for the platform linux/i386; this container has been and continues to work fine. However, I recently tried to update the container with the latest Debian image, and now the container starts but the first docker exec command fails with "is not running":

/usr/bin/docker create --name ed60e48196004beeaf204d6b408c0587_mercontainerregistryazurecriocontainerimagename_0b2e8b --label dc0bfb --network vsts_network_c63d4559d591450c99727c8b84620462  -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/vsts/work/1":"/__w/1" -v "/home/vsts/work/_temp":"/__w/_temp" -v "/home/vsts/work/_tasks":"/__w/_tasks" -v "/opt/hostedtoolcache":"/__t" -v "/home/vsts/agents/2.213.2/externals":"/__a/externals":ro -v "/home/vsts/work/.taskkey":"/__w/.taskkey" ***/container_test_i386_ubuntu "/__a/externals/node/bin/node" -e "setInterval(function(){}, 24 * 60 * 60 * 1000);"
WARNING: The requested image's platform (linux/386) does not match the detected host platform (linux/amd64) and no specific platform was requested
e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3
/usr/bin/docker start e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3
e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3
/usr/bin/docker ps --all --filter id=e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3 --filter status=running --no-trunc --format "{{.ID}} {{.Status}}"
e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3 Up Less than a second
/usr/bin/docker exec  e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3 sh -c "command -v bash"
##[error]Docker-exec executed: `sh -c "command -v bash"`; container id: `e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3`; exit code: `1`; command output: `Error response from daemon: Container e985a485bdd2b9fcb22699e8fff3c599334f0d314738309227b88816e84b60b3 is not running`

The problem appears to be the i386 platform: platform amd64 works using both Debian and Ubuntu images as the base, but fails with platform i386. All the containers work when run with Docker Desktop via the docker run command.

The test Dockerfile:

ARG docker_base=debian:stable-slim
ARG docker_platform=linux/i386

FROM --platform=${docker_platform} ${docker_base}

And the pipeline (not the actual registry):

pool:
  vmImage: ubuntu-latest

container:
  image: registry.azurecr.io/$(containerimagename)
  endpoint: registry

steps:
- script: echo Hello, world!
  displayName: 'Run a one-line script'

What works:

FROM --platform linux/amd64 debian:stable-slim

FROM --platform linux/amd64 amd64/ubuntu

What fails:

FROM --platform linux/i386 debian:stable-slim

FROM --platform linux/i386 i386/ubuntu

EDIT: the container itself is created with a pipeline:

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: Docker@2
  inputs:
    containerRegistry: 'registry'
    repository: $(image_name)
    command: 'build'
    arguments: '--build-arg docker_base=$(docker_base) --build-arg docker_platform=$(docker_platform)'
    tags: |
      latest
      $(Build.BuildId)
  displayName: 'Build the Docker image for $(docker_platform)'

- task: Docker@2
  inputs:
    containerRegistry: 'registry'
    repository: $(image_name)
    command: 'push'
    tags: |
      latest
      $(Build.BuildId)
  displayName: 'Push the Docker image to $(image_name)'


来源: stackexchange

问:
Google Cloud Identity Aware Proxy (IAP) with regional load balancer on shared VPC (for Cloud Run), is it possible?
Google has recently enabled centralised load balancing with cross project service referencing.

I have successfully implemented a shared VPC with the regional load balancer in a Host project. The load balancer works in handing traffic off into a sub project backend.
This is all good.

Previously I had been using a global load balancer and was able to use Identity Aware Proxy on this service backend. Now that things are restructured, the option to use IAP has disappeared.

I am not sure whether this is a limitation of the cross project style of load balancing or whether I am missing something. The backend service in question is serverless Cloud Run.

I have tried looking at various options in the load balancer setup, backend setup, shared VPC setup but nothing seems obvious. Also reviewed the documentation, the feature being relatively new, there isn't much written on it yet.

ContentLicense: CC BY-SA 4.0


问:
PyCaret: Multiclass Classification - Problem with Function: compare_models()
I would like to classify my dataset with PyCaret. I have already read up on Pycaret, but I don't understand why I get an empty list when I create the models with the compare_models() function.

Since I am still quite new to the topic, I might have made a logical thinking error.

My goal is to predict, based on the other parameters like the weather data, the number of bikes needed (cnt)

Multiclass Classification with PyCaret
Dataset: https://www.kaggle.com/datasets/hmavrodiev/london-bike-sharing-dataset

```<code>import pandas as pd
from pycaret.classification import *
dataset = pd.read_csv('london_merged.csv')
data

dataset = dataset.sample(frac=1)
data = dataset.sample(frac=0.90, random_state=785).reset_index(drop=True)
data_unseen = dataset.drop(data.index).reset_index(drop=True)

print('Data for Modeling: ' + str(data.shape))
print('Unseen Data For Predictions: ' + str(data_unseen.shape))

# set limits
bins = [0, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000]

# Assign categories
data["cnt"] = pd.cut(data["cnt"], bins)

data = data.dropna(subset=["cnt"])

exp_mclf101 = setup(data = data, target = 'cnt', session_id=123)

compare_models()

</code>```

Output of the last part of the Code

Body:
I would like to classify my dataset with PyCaret. I have already read up on Pycaret, but I don't understand why I get an empty list when I create the models with the compare_models() function.

Since I am still quite new to the topic, I might have made a logical thinking error.

My goal is to predict, based on the other parameters like the weather data, the number of bikes needed (cnt)

Multiclass Classification with PyCaret
Dataset: https://www.kaggle.com/datasets/hmavrodiev/london-bike-sharing-dataset

import pandas as pd
from pycaret.classification import *
dataset = pd.read_csv('london_merged.csv')
data

dataset = dataset.sample(frac=1)
data = dataset.sample(frac=0.90, random_state=785).reset_index(drop=True)
data_unseen = dataset.drop(data.index).reset_index(drop=True)

print('Data for Modeling: ' + str(data.shape))
print('Unseen Data For Predictions: ' + str(data_unseen.shape))

# set limits
bins = [0, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000]

# Assign categories
data["cnt"] = pd.cut(data["cnt"], bins)

data = data.dropna(subset=["cnt"])

exp_mclf101 = setup(data = data, target = 'cnt', session_id=123)

compare_models()

Output of the last part of the Code


问:
Native Script Android run stuck on watching file changes
This is what I get when run "ns doctor android"

Native Script version: 8.4.0

Java Version: 1.8

Node Version: 16.8.1

NPM Version: 8.19

I have just created a black project and I was trying to run this to emulator/real device.

This is what I get when i run "ns run android"

It keeps watching and nothing is installed on emulator.It even detects the file changes but doesn't install anything.


问:
Query contains too many nested clauses; maxClauseCount is set to 1024
I have been getting this error when running an elastic query against and index for a search. i was not getting this error in my earlier version of elastic, but after migrating to 8.3 i am getting this error. i see that in earlier versions of elastic we were able to set the max clause count using the field "indices.query.bool.max_clause_count" in the elaaticsearch.yml file but since 8.0 this has been deprecated and will have no impact even if the property is set.
According to the elastic documentation i see that now the max clause count is dynamically calculated based on the heap size of the JVM and few other parameters as mentioned in this documentation.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-settings.html

I am looking to see if we can any we have to capability of figuring out what heap size of JVM would give me the desired clause count?   or what cluster specifications should i use for me to get the desired clause count??

This is the sample query i have been using.

```<code>{
            "query": {
                "bool": {
                    "must": [
                        {
                            "multi_match": {
                                "query": "this is search and test"
                            }
                        }
                    ],
                    "must_not": [
                        {
                            "match": {
                                "hideFromSearch": "true"
                            }
                        }
                    ],
                    "should": [
                        {
                            "multi_match": {
                                "query": "this is search and test",
                                "type": "phrase"
                            }
                        },
                        {
                            "multi_match": {
                                "query": "this is search and test",
                                "operator": "and"
                            }
                        }
                    ]
                }
            }
        }
</code>```

if the search keyword is anything more than 1 word.. then the search is giving the error.

Any help would be appreciated. thanks in advance guys.

Body:
I have been getting this error when running an elastic query against and index for a search. i was not getting this error in my earlier version of elastic, but after migrating to 8.3 i am getting this error. i see that in earlier versions of elastic we were able to set the max clause count using the field "indices.query.bool.max_clause_count" in the elaaticsearch.yml file but since 8.0 this has been deprecated and will have no impact even if the property is set.
According to the elastic documentation i see that now the max clause count is dynamically calculated based on the heap size of the JVM and few other parameters as mentioned in this documentation.

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-settings.html

I am looking to see if we can any we have to capability of figuring out what heap size of JVM would give me the desired clause count?   or what cluster specifications should i use for me to get the desired clause count??

This is the sample query i have been using.

{
            "query": {
                "bool": {
                    "must": [
                        {
                            "multi_match": {
                                "query": "this is search and test"
                            }
                        }
                    ],
                    "must_not": [
                        {
                            "match": {
                                "hideFromSearch": "true"
                            }
                        }
                    ],
                    "should": [
                        {
                            "multi_match": {
                                "query": "this is search and test",
                                "type": "phrase"
                            }
                        },
                        {
                            "multi_match": {
                                "query": "this is search and test",
                                "operator": "and"
                            }
                        }
                    ]
                }
            }
        }

if the search keyword is anything more than 1 word.. then the search is giving the error.

Any help would be appreciated. thanks in advance guys.


问:
Which is the name of the transition effect used with Swiper.js?
Can anyone tell me what is the name of the transition effect used in the slider here https://www.rimac-automobili.com ?
As far as I can tell it uses swiper.js, but the effect is different from the standard ones.
Many thanks.</p>


问:
decodeAudioData from partial data emitted by MediaRecorder
I got a MediaRecorder which emits audio data every 100 milliseconds:

```<code>const audioContext = new AudioContext()

export async function getMaxAmplitude(blob: Blob): Promise<number> {
  const data = await audioContext.decodeAudioData(await blob.arrayBuffer())
  const channelData = data.getChannelData(0)

  let max = 0

  // Find the highest amplitude value
  for (let i = 0; i < channelData.length; i++) {
    if (Math.abs(channelData[i]) > max) {
      max = Math.abs(channelData[i])
    }
  }

  return max
}

const stream = await navigator.mediaDevices.getUserMedia({
  audio: {
    echoCancellation: true,
    noiseSuppression: true,
    sampleRate: 44100,
  },
})

const recorder = new MediaRecorder(stream, {
  mimeType: 'audio/webm; codecs=opus',
  audioBitsPerSecond: 128000,
})

setRecorder(recorder)

recorder.ondataavailable = async (e) => {
  chunks.current.push(e.data)
  console.log('highest amplitude on current chunk', await getMaxAmplitude(e.data))
}

recorder.onstop = async () => {
  const blob = new Blob(chunks.current, {type: 'audio/webm; codecs=opus'})
  setUrl(URL.createObjectURL(blob))
  console.log('highest amplitude', await getMaxAmplitude(blob))
}

recorder.start(100)
</code>```

But trying to call decodeAudioData for the blob emitted by the ondataavailable callback will result in a DOMException:

Uncaught (in promise) DOMException: Failed to execute 'decodeAudioData' on 'BaseAudioContext': Unable to decode audio data

I am not sure how to fix that. Funnily enough, if I change the timeslice argument in .start() from 100 to 1000 the first time ondataavailable is called it works, but after that the same exception gets thrown on each callback execution.

I am not sure why this is happening. Has anybody a idea on how to fix that? Using the latest Chrome version.

Body:
I got a MediaRecorder which emits audio data every 100 milliseconds:

const audioContext = new AudioContext()

export async function getMaxAmplitude(blob: Blob): Promise<number> {
  const data = await audioContext.decodeAudioData(await blob.arrayBuffer())
  const channelData = data.getChannelData(0)

  let max = 0

  // Find the highest amplitude value
  for (let i = 0; i < channelData.length; i++) {
    if (Math.abs(channelData[i]) > max) {
      max = Math.abs(channelData[i])
    }
  }

  return max
}

const stream = await navigator.mediaDevices.getUserMedia({
  audio: {
    echoCancellation: true,
    noiseSuppression: true,
    sampleRate: 44100,
  },
})

const recorder = new MediaRecorder(stream, {
  mimeType: 'audio/webm; codecs=opus',
  audioBitsPerSecond: 128000,
})

setRecorder(recorder)

recorder.ondataavailable = async (e) => {
  chunks.current.push(e.data)
  console.log('highest amplitude on current chunk', await getMaxAmplitude(e.data))
}

recorder.onstop = async () => {
  const blob = new Blob(chunks.current, {type: 'audio/webm; codecs=opus'})
  setUrl(URL.createObjectURL(blob))
  console.log('highest amplitude', await getMaxAmplitude(blob))
}

recorder.start(100)

But trying to call decodeAudioData for the blob emitted by the ondataavailable callback will result in a DOMException:

Uncaught (in promise) DOMException: Failed to execute 'decodeAudioData' on 'BaseAudioContext': Unable to decode audio data

I am not sure how to fix that. Funnily enough, if I change the timeslice argument in .start() from 100 to 1000 the first time ondataavailable is called it works, but after that the same exception gets thrown on each callback execution.

I am not sure why this is happening. Has anybody a idea on how to fix that? Using the latest Chrome version.


问:
file1 has two frames, frame1 and frame2, frame1 variables are in file2, and file2 button command=file3. how to display file3 content in frame2

file1.py

```<code>from tkinter import *
from file2 import fun1

class Frame1(Frame):
    def __init__(self, master):
        Frame.__init__(self, master)

        self.LabelFrame1 = LabelFrame(self, bg="#caf0f8", fg="#000000", relief="flat")
        self.LabelFrame1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)
        fun1(self.LabelFrame1)

class MainWindow(Frame):
    def __init__(self, master):
        Frame.__init__(self, master)

        self.MainWindow1 = LabelFrame(self, bg="#eaf4f4", fg="#000000", relief="flat")
        self.MainWindow1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)

class Main:
    def __init__(self, master):
        super().__init__()

        self.Frame1 = Frame1(master)
        self.Frame1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=0.125)

        self.MainWindow = MainWindow(master)
        self.MainWindow.place(relx=0.127, rely=0.0, relheight=1.0, relwidth=0.873)

if __name__ == "__main__":
    root = Tk()
    app = Main(root)
    root.mainloop()
</code>```

file2.py

```<code>from tkinter import *
from file3 import fun2

def fun1(LabelFrame1):

    btn1 = Button(LabelFrame1)
    btn1.configure(text="Button 1")
    btn1.place(relx=0.1, rely=0.1, relheight=0.2, relwidth=0.8)
    btn2 = Button(LabelFrame1)
    btn2.configure(text="Button 2")
    btn2.place(relx=0.1, rely=0.5, relheight=0.2, relwidth=0.8)
    btn2.bind('<Button-1>', lambda e: fun2)
</code>```

file3.py

```<code>from tkinter import *

def fun2(MainWindow1):

    lframe1 = LabelFrame(MainWindow1)
    lframe1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)
    lbl1 = Label(lframe1, bg="#fdfdfd", fg="#000000", anchor="w", text="Name\t\t:")
    lbl1.place(relx=0.1, rely=0.1, relheight=0.2, relwidth=0.4)
    ent1 = Entry(lframe1, bg="#fdfdfd", fg="#000000", relief="flat", highlightthickness="1",
    highlightcolor="#147efb")
    ent1.place(relx=0.6, rely=0.1, relheight=0.2, relwidth=0.4)
    lbl2 = Label(lframe1, bg="#fdfdfd", fg="#000000", anchor="w", text="Address\t\t:")
    lbl2.place(relx=0.1, rely=0.5, relheight=0.2, relwidth=0.4)
    ent2 = Entry(lframe1, bg="#fdfdfd", fg="#000000", relief="flat", highlightthickness="1",
    highlightcolor="#147efb")
    ent2.place(relx=0.6, rely=0.5, relheight=0.2, relwidth=0.4)
</code>```

Here the problem m getting is, if I'm calling file3 inside class MainWindow(Frame) as

```<code>fun2(self.MainWindow1)
</code>```

it is displaying without use of button i.e. before I click on btn2

can anyone help me with how I can make it work.
m trying to make desktop application for which I had to create so many files

Body:
file1.py

from tkinter import *
from file2 import fun1

class Frame1(Frame):
    def __init__(self, master):
        Frame.__init__(self, master)

        self.LabelFrame1 = LabelFrame(self, bg="#caf0f8", fg="#000000", relief="flat")
        self.LabelFrame1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)
        fun1(self.LabelFrame1)

class MainWindow(Frame):
    def __init__(self, master):
        Frame.__init__(self, master)

        self.MainWindow1 = LabelFrame(self, bg="#eaf4f4", fg="#000000", relief="flat")
        self.MainWindow1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)

class Main:
    def __init__(self, master):
        super().__init__()

        self.Frame1 = Frame1(master)
        self.Frame1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=0.125)

        self.MainWindow = MainWindow(master)
        self.MainWindow.place(relx=0.127, rely=0.0, relheight=1.0, relwidth=0.873)

if __name__ == "__main__":
    root = Tk()
    app = Main(root)
    root.mainloop()

file2.py

from tkinter import *
from file3 import fun2

def fun1(LabelFrame1):

    btn1 = Button(LabelFrame1)
    btn1.configure(text="Button 1")
    btn1.place(relx=0.1, rely=0.1, relheight=0.2, relwidth=0.8)
    btn2 = Button(LabelFrame1)
    btn2.configure(text="Button 2")
    btn2.place(relx=0.1, rely=0.5, relheight=0.2, relwidth=0.8)
    btn2.bind('<Button-1>', lambda e: fun2)

file3.py

from tkinter import *

def fun2(MainWindow1):

    lframe1 = LabelFrame(MainWindow1)
    lframe1.place(relx=0.0, rely=0.0, relheight=1.0, relwidth=1.0)
    lbl1 = Label(lframe1, bg="#fdfdfd", fg="#000000", anchor="w", text="Name\t\t:")
    lbl1.place(relx=0.1, rely=0.1, relheight=0.2, relwidth=0.4)
    ent1 = Entry(lframe1, bg="#fdfdfd", fg="#000000", relief="flat", highlightthickness="1",
    highlightcolor="#147efb")
    ent1.place(relx=0.6, rely=0.1, relheight=0.2, relwidth=0.4)
    lbl2 = Label(lframe1, bg="#fdfdfd", fg="#000000", anchor="w", text="Address\t\t:")
    lbl2.place(relx=0.1, rely=0.5, relheight=0.2, relwidth=0.4)
    ent2 = Entry(lframe1, bg="#fdfdfd", fg="#000000", relief="flat", highlightthickness="1",
    highlightcolor="#147efb")
    ent2.place(relx=0.6, rely=0.5, relheight=0.2, relwidth=0.4)

Here the problem m getting is, if I'm calling file3 inside class MainWindow(Frame) as

fun2(self.MainWindow1)

it is displaying without use of button i.e. before I click on btn2

can anyone help me with how I can make it work.
m trying to make desktop application for which I had to create so many files


问:
Issue in using Namespace import in Vite React App, importing * as alias
I have an IconLibrary of React Components in the Icons Folder. While using plain react I use "Icons" as an alias for all the icons in the library by using the following namespace import :

import * as Icons from "@/styles/Assets/Icons";

Currently when I try to do the following in Vite App, I get the error as given in the image

Code

```<code>//namespace import
import * as Icons from "@/styles/Assets/Icons";

//function to get React Component (Icon)
const getIcon = (item) => {
        const Component = Icons[item];
        console.log(Icons);
        console.log(Component);
        return <Component />;
    };

//function call within main React component

{getIcon("VideosIcon")}

</code>```

Error:

Console log for Icons retunr the below:

Object { … }

Symbol(Symbol.toStringTag): "Module"

Tried using the following :

const icons = import.meta.glob("@/styles/Assets/Icons*.jsx");

Body:
I have an IconLibrary of React Components in the Icons Folder. While using plain react I use "Icons" as an alias for all the icons in the library by using the following namespace import :

import * as Icons from "@/styles/Assets/Icons";

Currently when I try to do the following in Vite App, I get the error as given in the image

Code

//namespace import
import * as Icons from "@/styles/Assets/Icons";

//function to get React Component (Icon)
const getIcon = (item) => {
        const Component = Icons[item];
        console.log(Icons);
        console.log(Component);
        return <Component />;
    };

//function call within main React component

{getIcon("VideosIcon")}

Error:

Console log for Icons retunr the below:

Object { … }

Symbol(Symbol.toStringTag): "Module"

Tried using the following :

const icons = import.meta.glob("@/styles/Assets/Icons*.jsx");


问:
Debezium truncating micro/nanosecond part if it is all zeros
I am using debezium source connector on my MySQL table. It has field with timestamp(6) data type. Debezium converts this to ZonedTimestamp format, which is "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'". But in doing so, if the timestamp was exactly at 0th micro/nanosecond, for ex. "2023-01-06T11:01:12.000000Z", then debezium removes the micro/nanosecond part completely. What I get at my sink connector is "2023-01-06T11:01:12Z". Is there anyway so that the micro/nanosecond part does not get removed in this case?</p>


问:
Python Docstring (numpy style) How to document ValueError raised for different reasons?
How do I document ValueError raised for different reasons in proper numpy style docstring?

For now after reading the docs I'm confused between:

```<code>Raises
------
ValueError
  if reason1
  if reason2
  if reason3
</code>```

and

```<code>Raises
------
ValueError
  if reason1
ValueError
  if reason2
ValueError
  if reason3
</code>```

Body:
How do I document ValueError raised for different reasons in proper numpy style docstring?

For now after reading the docs I'm confused between:

Raises
------
ValueError
  if reason1
  if reason2
  if reason3

and

Raises
------
ValueError
  if reason1
ValueError
  if reason2
ValueError
  if reason3


问:
Is there a way to detect if a device is specifically a Microsoft Surface Pro? (Or Surface device in general)
An AR project I'm working on splits functionality between PC, iPhones, and Androids. On PC it provides a QR to scan, on iPhones it launches quick-look, and on Androids it launches scene-viewer. The issue is that due to how Microsoft Surface devices are made/setup, they are sometimes read as mobile or tablet devices. Because of this my project attempts to launch quick-look or scene-viewer for AR, but naturally Surface devices have no such functionality.

I've thought of using pointers to detect if the device has a touch screen and is running Windows, but the issue is that that would detect all laptops with touch screens. I also attempted to use window.navigator, but it appears this is deprecated and I couldn't get it to work. Is there another way to detect if a device is specifically a Microsoft Surface device, so I can disable the AR functionality entirely for those devices?


Title: While loop to append number to list adds additional decimal figures in python

Body:
I have the following code to create a list of numbers starting at 0.05, ending at 1.25, every 0.05 step.

intervals = [0.05]
point = 0.05

while len(intervals) < 25:
    point = point + 0.05
    intervals.append(point)

print(intervals)

However, the result is the follwing list:

[0.05, 0.1, 0.15000000000000002, 0.2, 0.25, 0.3, 0.35, 0.39999999999999997, 0.44999999999999996, 0.49999999999999994, 0.5499999999999999, 0.6, 0.65, 0.7000000000000001, 0.7500000000000001, 0.8000000000000002, 0.8500000000000002, 0.9000000000000002, 0.9500000000000003, 1.0000000000000002, 1.0500000000000003, 1.1000000000000003, 1.1500000000000004, 1.2000000000000004, 1.2500000000000004]

Python seems to randomly add/substract certain decimals. How can I obtain the following desired list:

[0.05. 0.1, 0.15, 0.20, 0.25, 0.30, 0.40, ......1.20, 1.25]

What am I doing wrong?

Thanks!


问:
trouble with tripling letters
I've been assigned with the task of writing a program that triples all the letters in a string (ex: triple("Hello") should output "HHHeeelllooo")

After some time being stuck on this:

```<code>def triple(s) :
    new = ""
    i = 0
    for l in s[i]:
        new += l * 3
        i += 1
    return new
</code>```

I solved rewriting it like this, which works:

```<code>def triple(s):
    new = ""
    i = 0
    for i in range(len(s)):
        new += s[i]*3
    return new
</code>```

but, even though I found a solution, it would be really important to me to understand why the first version doesn't work, in order to avoid being stuck again in the future.

Thank you in advance to anyone who's willing to help me understand what was wrong in my logic.

Title: trouble with tripling letters

Body:
I've been assigned with the task of writing a program that triples all the letters in a string (ex: triple("Hello") should output "HHHeeelllooo")

After some time being stuck on this:

def triple(s) :
    new = ""
    i = 0
    for l in s[i]:
        new += l * 3
        i += 1
    return new

I solved rewriting it like this, which works:

def triple(s):
    new = ""
    i = 0
    for i in range(len(s)):
        new += s[i]*3
    return new

but, even though I found a solution, it would be really important to me to understand why the first version doesn't work, in order to avoid being stuck again in the future.

Thank you in advance to anyone who's willing to help me understand what was wrong in my logic.


问:
Blank Space left on the last page of google docs
How do I get how much blank space is left on the last page of google docs using appscript?

I tried this but it does not return the blank space of last page.

```<code>function margin(doc_body)

{
  var margin_top =  doc_body.getMarginTop()
  var margin_bottom =  doc_body.getMarginBottom()
  var pageHeight =  doc_body.getPageHeight() - margin_top - margin_bottom;
  return pageHeight
}
</code>```

Body:
How do I get how much blank space is left on the last page of google docs using appscript?

I tried this but it does not return the blank space of last page.

function margin(doc_body)

{
  var margin_top =  doc_body.getMarginTop()
  var margin_bottom =  doc_body.getMarginBottom()
  var pageHeight =  doc_body.getPageHeight() - margin_top - margin_bottom;
  return pageHeight
}


问:
Installing multiple versions of React with NPM
Long story short, I currently have React 16 installed and I wanted to add React 17 to check tests, migrate, etc.
Running npm install throws an error, because react-dom@17 requires react@17 and it seems to not being able to find one.
The question is - is there a way to fix this problem without using --force or --legacy-peer-deps flags?

I created aliased packages, using react-redux as an example.

```<code>"react": "^16.8.6",
"react-17": "npm:react@^17",
"react-dom": "^16.8.6",
"react-dom-17": "npm:react-dom@^17"
</code>```

Running npm install throws an error, because react-dom@17 requires react@17 and it seems to not being able to find one.

```<code>npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: platform-modules@0.0.0
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR!   dev react@"^16.8.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"npm:react@^17" from react-dom-17@17.0.2
npm ERR! node_modules/react-dom-17
npm ERR!   dev react-dom-17@"npm:react-dom@^17" from the root project
</code>```

I tried using npm overrides, as well as peerDependenciesMeta but it unfortunately didn't help.

```<code>  "overrides": {
    "react-dom-17": {
      "react": "$react-17"
    }
  },
  "peerDependenciesMeta": {
    "react-dom": {
      "optional": true
    }
  }
</code>```

react-redux package uses this approach, but it uses Yarn instead of NPM.

Body:
Long story short, I currently have React 16 installed and I wanted to add React 17 to check tests, migrate, etc.
Running npm install throws an error, because react-dom@17 requires react@17 and it seems to not being able to find one.
The question is - is there a way to fix this problem without using --force or --legacy-peer-deps flags?

I created aliased packages, using react-redux as an example.

"react": "^16.8.6",
"react-17": "npm:react@^17",
"react-dom": "^16.8.6",
"react-dom-17": "npm:react-dom@^17"

Running npm install throws an error, because react-dom@17 requires react@17 and it seems to not being able to find one.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: platform-modules@0.0.0
npm ERR! Found: react@16.14.0
npm ERR! node_modules/react
npm ERR!   dev react@"^16.8.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"npm:react@^17" from react-dom-17@17.0.2
npm ERR! node_modules/react-dom-17
npm ERR!   dev react-dom-17@"npm:react-dom@^17" from the root project

I tried using npm overrides, as well as peerDependenciesMeta but it unfortunately didn't help.

  "overrides": {
    "react-dom-17": {
      "react": "$react-17"
    }
  },
  "peerDependenciesMeta": {
    "react-dom": {
      "optional": true
    }
  }

react-redux package uses this approach, but it uses Yarn instead of NPM.


问:
VBA - Apply document formatting to open Word doc
I am using data in an Excel workbook to create an HTML string when a user clicks a button. I then use VBA to save that string as an .html file, open it in Word, and bring Word to the foreground. That all works great.

Now, I'd like to add a line(s) to the VBA to select the document formatting.

In the Word doc that opens, there's this in the ribbon:

When I hover over that formatting option, it's called "Lines (simple)." I can click it in Word, and it formats the text exactly how I want it. But, I'd like to do so automatically with the VBA over in Excel that created and launched the Word document. Unfortunately I just don't know which command or property that is and haven't been able to find it with searches or document inspection. I'd appreciate your help.


问:
Store Roles and Permissions in backend to reduce database calls
Let's suppose we have 3 microservices, one of them is the identity server. When the user login, we create a token and get his roles and permissions after validating the credentials (obviously).

So, every time the user accesses/calls the API from the other 2 microservices, we don't want to make a database call based on the token to check whether the user has access/permission for the particular API or not. Also, we don't want to store the roles and permissions in session as there could be thousands (suppose 50000) of user login in at the same time.

Can anyone suggest a solution to reduce the database call in the .NET backend only?

I thought of creating a txt file by the name of token or username and storing the roles and permissions for that user and retrieving them when required. If the token expired, will delete the txt file and create a new one with the new token name.

But I think this is not the correct way to code for major projects. So, looking for good and effective use of DOT NET features.


问:
Local development of AWS Synthetics Canaries Selenium
On documentation pages for AWS Cloudwatch Synthetics Canaries we can find code samples (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library_Python.html#CloudWatch_Synthetics_Library_Python_UIcanaries) that include imports of "aws_synthetics.selenium" module and tools like the synthetics_webdriver or synthetics_logger.

Is there any way to install this package for the purposes of local development?
This is not the AWS CDK package aws_cdk.aws_synthetics is it?

I've searched the internet for a few days and sadly found no solution and I'm using a wacky import to work around it

```<code>if os.environ.get("LOCAL"):
    from selenium import webdriver
else:
    from aws_synthetics.selenium import synthetics_webdriver as webdriver
</code>```

i would like to use the latter import locally aswell

Body:
On documentation pages for AWS Cloudwatch Synthetics Canaries we can find code samples (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library_Python.html#CloudWatch_Synthetics_Library_Python_UIcanaries) that include imports of "aws_synthetics.selenium" module and tools like the synthetics_webdriver or synthetics_logger.

Is there any way to install this package for the purposes of local development?
This is not the AWS CDK package aws_cdk.aws_synthetics is it?

I've searched the internet for a few days and sadly found no solution and I'm using a wacky import to work around it

if os.environ.get("LOCAL"):
    from selenium import webdriver
else:
    from aws_synthetics.selenium import synthetics_webdriver as webdriver

i would like to use the latter import locally aswell


问:
How to use sysprof as a regular user
I am trying to find a simple profiler on Linux. sysprof seems a good option, but I need to run it with sudo. Is there a way to run it as a normal user?

I have tried echo 0 > /proc/sys/kernel/perf_event_paranoid, as this solves the same issue for perf, but it doesn't work for sysprof.

Thank you.

Title: How to use sysprof as a regular user


问:
Disable certain elements in a JList
I have a JList in which the displayed elements/objects can be disabled. A custom ListRenderer greys them out. What I want to achieve is that list cells containing a disabled object can no longer be selected, they should be "dead".

Example:

```<code>1. Alice (enabled)
2. Cooper (disabled)
3. Rocks (enabled)
</code>```

Let's assume the selected cell is "Alice". If I click on "Cooper", I don't want the selection to change. No ListSelectionEvent should be fired, nothing should happen at all! If I navigate through the list using the cursor down key, I want the "Cooper" cell to be skipped automatically. The next cell to be selected should be "Rocks". In short: I want the list to behave as if disabled elements simply were not present (but I need them to be displayed nevertheless).

I thought I might have to write my own ListSelectionModel, but I don't see any reference to the elements in the list from there, so not sure how I could detect which objects are disabled and adjust the selection accordingly.

How can I achieve the described behavior?

Title: Disable certain elements in a JList

Body:
I have a JList in which the displayed elements/objects can be disabled. A custom ListRenderer greys them out. What I want to achieve is that list cells containing a disabled object can no longer be selected, they should be "dead".

Example:

1. Alice (enabled)
2. Cooper (disabled)
3. Rocks (enabled)

Let's assume the selected cell is "Alice". If I click on "Cooper", I don't want the selection to change. No ListSelectionEvent should be fired, nothing should happen at all! If I navigate through the list using the cursor down key, I want the "Cooper" cell to be skipped automatically. The next cell to be selected should be "Rocks". In short: I want the list to behave as if disabled elements simply were not present (but I need them to be displayed nevertheless).

I thought I might have to write my own ListSelectionModel, but I don't see any reference to the elements in the list from there, so not sure how I could detect which objects are disabled and adjust the selection accordingly.

How can I achieve the described behavior?


问:
How to resolve Possible Unhandled Promise Rejection (id: 13) TypeError: Network request failed?
I am trying to build React_Native app with Expo and was trying to integrate Stripe in it. I have some Issues that occurs:

The following is my server.mjs file:

```<code>// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys

import express from 'express'
import Stripe from 'stripe'

const app = express();
const port = 8080

// I don t put my key here(on stack) for security reason
const STRIPE_SK = "my_secret_key"
const stripe = Stripe(STRIPE_SK,{apiVersion: "2022-11-15"});

app.listen(port, () => {
    console.log(`Listening to http://localhost:${port}`);
});

app.post("/create-payment-intent", async (req, res) => {
    try{
        const paymentIntent = await stripe.paymentIntents.create({
            amount: 1099,
            currency: 'ron',
            automatic_payment_methods: {
                enabled: true,
              },
        });

        const clientSecret = paymentIntent.client_secret;

        res.json({
            clientSecret: clientSecret
        })
    } catch (e) {
        console.log(e.message);
        res.json({error: e.message})
    }
})
</code>```

The following is my Card.js file:

```<code>import { Alert, StyleSheet, Text, View } from 'react-native'
import React, { useEffect, useState } from 'react'
import { CardField, initStripe, StripeProvider, useConfirmPayment } from '@stripe/stripe-react-native'
import Dialog from "react-native-dialog"
import { auth, database } from "../../../firebase"
import { onValue, ref, set } from '@firebase/database'

const API_URL = "http://localhost:8080"

const STRIPE_PK = 'my_publish_key'

const Card = ({showCard, hideCard}) => {

    const [userId, setUserId] = useState(null)
    const [username, setUsername] = useState('')
    const [cardDetails, setCardDetails] = useState()
    const {confirmPayment, loading } = useConfirmPayment()

    useEffect(() => {
        const userId = auth.currentUser?.uid
        const userRef = ref(database, 'users/' + userId);
        onValue(userRef, (snapshot) => {
            const data = snapshot.val()
            setUserId(userId);
            setUsername(data.email)
        })
    }, [])

    const fetchPaymentIntentClientSecret = async () => {
        const response = await fetch(`${API_URL}/create-payment-intent`, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
        });

        const { clientSecret, error } = await response.json();
        return { clientSecret, error };
    };

    const handlePayPress = async () => {
        if(!cardDetails?.complete || !userId || !username) {
            Alert.alert("Please enter card details")
            return
        }
        // Gather the customer's billing information (for example, email)
        const billingDetails = {
          userId: userId,
          username: username
        };

        // Fetch the intent client secret from the backend

        try{
            const { clientSecret, error } = await fetchPaymentIntentClientSecret();
            if(error) {
                console.log("Unable to process payment")
            } else {
                const {paymentIntent, error} = confirmPayment(
                    clientSecret,
                    {
                        type: "Card",
                        billingDetails: billingDetails,
                    }
                );
                if(error) {
                    console.log(`Payment confimation error ${error.message}`);
                } else if (paymentIntent){
                    alert("Payment Succesful");
                    console.log("Payment succesful ", paymentIntent);
                }
            }
        } catch(e) {
            console.log(e)
        }
    };

    return (
        <StripeProvider
            publishableKey={STRIPE_PK}

        >
            <Dialog.Container visible={showCard}>
                <CardField
                    postalCodeEnabled={false}
                    cardStyle={styles.card}
                    style={styles.cardContainer}
                    onCardChange={cardDetails => {
                        setCardDetails(cardDetails);
                    }}
                >
                </CardField>
                <Dialog.Button
                    disabled={loading}
                    style={{color: "green"}}
                    label="Confirma"
                    onPress={handlePayPress}
                />
                <Dialog.Button
                    style={{color: "red"}}
                    label="Anuleaza"
                    onPress={hideCard}
                />
            </Dialog.Container>
        </StripeProvider>
    )
}

export default Card

const styles = StyleSheet.create({
    cardContainer: {
        // flex: 1,
        alignSelf: 'center',
        margin: 10,
        height: 50,
        width: '90%',
        color: 'grey'
    },
    card: {
        backgroundColor: 'grey'
    },
})
</code>```

With this code I am trying to add and get informations to and from Stripe payments. At start I use two things:

Start local host with nodemon server.mjs and gets:

2. Start expo project with npx expo start.

The Issue after entering the card details correct and hitting button that activates handlePayPress function is the following:

```<code> WARN  Possible Unhandled Promise Rejection (id: 13):
TypeError: Network request failed
http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:21526:33
http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:26585:26
_callTimer@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:26524:17
callTimers@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:26680:19
__callFunction@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:20182:36
http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:19944:31
__guard@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:20134:15
callFunctionReturnFlushedQueue@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:19943:21
callFunctionReturnFlushedQueue@[native code]
</code>```

Body:
I am trying to build React_Native app with Expo and was trying to integrate Stripe in it. I have some Issues that occurs:

The following is my server.mjs file:

// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys

import express from 'express'
import Stripe from 'stripe'

const app = express();
const port = 8080

// I don t put my key here(on stack) for security reason
const STRIPE_SK = "my_secret_key"
const stripe = Stripe(STRIPE_SK,{apiVersion: "2022-11-15"});

app.listen(port, () => {
    console.log(`Listening to http://localhost:${port}`);
});

app.post("/create-payment-intent", async (req, res) => {
    try{
        const paymentIntent = await stripe.paymentIntents.create({
            amount: 1099,
            currency: 'ron',
            automatic_payment_methods: {
                enabled: true,
              },
        });

        const clientSecret = paymentIntent.client_secret;

        res.json({
            clientSecret: clientSecret
        })
    } catch (e) {
        console.log(e.message);
        res.json({error: e.message})
    }
})

The following is my Card.js file:

import { Alert, StyleSheet, Text, View } from 'react-native'
import React, { useEffect, useState } from 'react'
import { CardField, initStripe, StripeProvider, useConfirmPayment } from '@stripe/stripe-react-native'
import Dialog from "react-native-dialog"
import { auth, database } from "../../../firebase"
import { onValue, ref, set } from '@firebase/database'

const API_URL = "http://localhost:8080"

const STRIPE_PK = 'my_publish_key'

const Card = ({showCard, hideCard}) => {

    const [userId, setUserId] = useState(null)
    const [username, setUsername] = useState('')
    const [cardDetails, setCardDetails] = useState()
    const {confirmPayment, loading } = useConfirmPayment()

    useEffect(() => {
        const userId = auth.currentUser?.uid
        const userRef = ref(database, 'users/' + userId);
        onValue(userRef, (snapshot) => {
            const data = snapshot.val()
            setUserId(userId);
            setUsername(data.email)
        })
    }, [])

    const fetchPaymentIntentClientSecret = async () => {
        const response = await fetch(`${API_URL}/create-payment-intent`, {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json',
          },
        });

        const { clientSecret, error } = await response.json();
        return { clientSecret, error };
    };

    const handlePayPress = async () => {
        if(!cardDetails?.complete || !userId || !username) {
            Alert.alert("Please enter card details")
            return
        }
        // Gather the customer's billing information (for example, email)
        const billingDetails = {
          userId: userId,
          username: username
        };

        // Fetch the intent client secret from the backend

        try{
            const { clientSecret, error } = await fetchPaymentIntentClientSecret();
            if(error) {
                console.log("Unable to process payment")
            } else {
                const {paymentIntent, error} = confirmPayment(
                    clientSecret,
                    {
                        type: "Card",
                        billingDetails: billingDetails,
                    }
                );
                if(error) {
                    console.log(`Payment confimation error ${error.message}`);
                } else if (paymentIntent){
                    alert("Payment Succesful");
                    console.log("Payment succesful ", paymentIntent);
                }
            }
        } catch(e) {
            console.log(e)
        }
    };

    return (
        <StripeProvider
            publishableKey={STRIPE_PK}

        >
            <Dialog.Container visible={showCard}>
                <CardField
                    postalCodeEnabled={false}
                    cardStyle={styles.card}
                    style={styles.cardContainer}
                    onCardChange={cardDetails => {
                        setCardDetails(cardDetails);
                    }}
                >
                </CardField>
                <Dialog.Button
                    disabled={loading}
                    style={{color: "green"}}
                    label="Confirma"
                    onPress={handlePayPress}
                />
                <Dialog.Button
                    style={{color: "red"}}
                    label="Anuleaza"
                    onPress={hideCard}
                />
            </Dialog.Container>
        </StripeProvider>
    )
}

export default Card

const styles = StyleSheet.create({
    cardContainer: {
        // flex: 1,
        alignSelf: 'center',
        margin: 10,
        height: 50,
        width: '90%',
        color: 'grey'
    },
    card: {
        backgroundColor: 'grey'
    },
})

With this code I am trying to add and get informations to and from Stripe payments. At start I use two things:

Start local host with nodemon server.mjs and gets:

2. Start expo project with npx expo start.

The Issue after entering the card details correct and hitting button that activates handlePayPress function is the following:

 WARN  Possible Unhandled Promise Rejection (id: 13):
TypeError: Network request failed
http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:21526:33
http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:26585:26
_callTimer@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:26524:17
callTimers@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:26680:19
__callFunction@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:20182:36
http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:19944:31
__guard@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:20134:15
callFunctionReturnFlushedQueue@http://192.168.100.5:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:19943:21
callFunctionReturnFlushedQueue@[native code]


问:
How to get IPV4 from current device inside network in DART
I'm trying to develop an open source script to connect to linux computers using an ssh connection. To be more specific I'm planning to do this to facilitate the work in wholesale networks that in my region change the internal ip from store to store as follows:

store1: 192.168.1.xxx
store2: 192.168.2.xxx
store3: 192.168.3.xxx

normally around here this type of wholesale has a range of fixed ips for the POS (sales computers), and goes from 201 to 253 since 254 is usually the gateway. so if you have 30 POS in a store, their ips will be from 201 to 230.

i need my code to work in any of the stores, from any wholesale network that will use the script without much difficulty.

i want to make a list of ips as follows:

List<String> pos = ['192.168.$n.xxx, 192.168.$n.xxx, 192.168.$n.xxx'];

"n" being the third part of the internal ip of the device that is running the script.

since this would cause employees who do not have access to the code to use it only in their own unit, since all normally have vpn closed to each other. the user must not have the option to say which store he is in, the script must know by itself

here goes all my code so far:

```<code>import 'dart:io';
import 'package:dart_ipify/dart_ipify.dart';

void main() async{

  final ipfull = await Ipify.ipv4();
  List<String> splitip = ipfull.split('.');
  print('IPV4: $ipfull');
  print('IPV4 in parts: $splitip');

  print('Functions: P (Power ON)     R (Reboot)     O (PowerOff)');

  String? function = stdin.readLineSync();

  List<dynamic> pdvs = [];

  print('Enter the POS numbers and type "e" to end and "c" to'
      'make a correction to an added POS');

  while (true) {
    String? input = stdin.readLineSync();
    if (input == 'e') {
      break;
    } else if(input == 'c') {
      print('What number do you want to remove?');
      String? inputc = stdin.readLineSync();
      pdvs.remove(inputc);
    } else if (input == 'v') {
      print("Current list: $pdvs");
    } else {
      pdvs.add(input);
    }
  }

  if(function == 'l'){
    print('Turning on POS $pdvs');
  } else if(function == 'r'){
    print('Restarting POS $pdvs');
    for(String p in pdvs){
      print('192.168.10.2$p');
    }
  } else if(function == 'd'){
    print('Turning OFF POS $pdvs');
  } else{
    print('unknown function');
  }

}
</code>```

I apologize in advance for my English which is not very good.

there may be some translation error in the code because I wrote a lot in my own language and translated it here while asking this question, but the code is running perfectly and without errors. the problem is that it does not work as expected

I expected this part of the code:

```<code>final ipfull = await Ipify.ipv4();
  List<String> splitip = ipfull.split('.');
  print('IPV4: $ipfull');
  print('IPV4 in parts: $splitip');
</code>```

return the internal ip of the device that runs the code

Internal IPV4 from CMD

which in this case would be 192.168.10.245

and then I could use ${splitip[2]} to get the 3rd part of the ip which is what interests me

i tried to use ipify but it is returning my fortigate ip

Body:
I'm trying to develop an open source script to connect to linux computers using an ssh connection. To be more specific I'm planning to do this to facilitate the work in wholesale networks that in my region change the internal ip from store to store as follows:

store1: 192.168.1.xxx
store2: 192.168.2.xxx
store3: 192.168.3.xxx

normally around here this type of wholesale has a range of fixed ips for the POS (sales computers), and goes from 201 to 253 since 254 is usually the gateway. so if you have 30 POS in a store, their ips will be from 201 to 230.

i need my code to work in any of the stores, from any wholesale network that will use the script without much difficulty.

i want to make a list of ips as follows:

List<String> pos = ['192.168.$n.xxx, 192.168.$n.xxx, 192.168.$n.xxx'];

"n" being the third part of the internal ip of the device that is running the script.

since this would cause employees who do not have access to the code to use it only in their own unit, since all normally have vpn closed to each other. the user must not have the option to say which store he is in, the script must know by itself

here goes all my code so far:

import 'dart:io';
import 'package:dart_ipify/dart_ipify.dart';

void main() async{

  final ipfull = await Ipify.ipv4();
  List<String> splitip = ipfull.split('.');
  print('IPV4: $ipfull');
  print('IPV4 in parts: $splitip');

  print('Functions: P (Power ON)     R (Reboot)     O (PowerOff)');

  String? function = stdin.readLineSync();

  List<dynamic> pdvs = [];

  print('Enter the POS numbers and type "e" to end and "c" to'
      'make a correction to an added POS');

  while (true) {
    String? input = stdin.readLineSync();
    if (input == 'e') {
      break;
    } else if(input == 'c') {
      print('What number do you want to remove?');
      String? inputc = stdin.readLineSync();
      pdvs.remove(inputc);
    } else if (input == 'v') {
      print("Current list: $pdvs");
    } else {
      pdvs.add(input);
    }
  }

  if(function == 'l'){
    print('Turning on POS $pdvs');
  } else if(function == 'r'){
    print('Restarting POS $pdvs');
    for(String p in pdvs){
      print('192.168.10.2$p');
    }
  } else if(function == 'd'){
    print('Turning OFF POS $pdvs');
  } else{
    print('unknown function');
  }

}

I apologize in advance for my English which is not very good.

there may be some translation error in the code because I wrote a lot in my own language and translated it here while asking this question, but the code is running perfectly and without errors. the problem is that it does not work as expected

I expected this part of the code:

final ipfull = await Ipify.ipv4();
  List<String> splitip = ipfull.split('.');
  print('IPV4: $ipfull');
  print('IPV4 in parts: $splitip');

return the internal ip of the device that runs the code

Internal IPV4 from CMD

which in this case would be 192.168.10.245

and then I could use ${splitip[2]} to get the 3rd part of the ip which is what interests me

i tried to use ipify but it is returning my fortigate ip


问:
How can i translate this HAML code part into HTML? And this SCSS to CSS?
I'm still studying programming and websites development, and i found this code in HAML and SCSS code, but i dont understand yet, and i want to modificate some aspects but in HTML and CSS.
There is the part of HAML code

```<code>.grain
.intro
  .center
    .core
    .outer_one
      -(1..36).each do
        .outer_one__piece
    .outer_two
      -(1..36).each do
        .outer_two__piece
    .outer_three
      -(1..36).each do
        .outer_three__piece
    .outer_four
      -(1..36).each do
        .outer_four__piece
    .outer_five
      -(1..36).each do
        .outer_five__piece
    .pieces
      .future_ui__piece
        %span Warp drive
        .line
        .tip
          Yes, commander!
      .future_ui__piece
        %span Teleport
        .line
        .tip
          Beam me up!
      .future_ui__piece
        %span Fusion core
        .line
        .tip
          Engineering!
      .future_ui__piece
        %span Laser target
        .line
        .tip
          Charge laz0rs!
      .future_ui__piece
        %span Shields
        .line
        .tip
          Status report!
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
</code>```

And there is the SCSS

```<code>/* Variables */

// Core
$core_width: 50px;
$core_color:#de0b46;
$core_glow:0px 0px 70px 20px #de0b46;

// Outer 1
$outer_one_offset: 120px;
$outer_one_width: 10px;
$outer_one_height: 30px;
$outer_one_color: #de0b46;
$outer_one_glow: 0px 0px 20px 0px #de0b46;

// Outer 2
$outer_two_offset: 290px;
$outer_two_width: 28px;
$outer_two_height: 5px;
$outer_two_color: #de0b46;
$outer_two_glow: 0px 0px 20px 0px #de0b46;

// Outer 3
$outer_three_offset: 440px;
$outer_three_width: 55px;
$outer_three_height: 5px;
$outer_three_color: #55E2F9;
$outer_three_glow: 0px 0px 20px 0px #55E2F9;

// Outer 4
$outer_four_offset: 440px;
$outer_four_width: 6px;
$outer_four_height: 5px;
$outer_four_color: #de0b46;
$outer_four_glow: 0px 0px 20px 0px #de0b46;

// Outer 5
$outer_five_offset: 410px;

// Menu items
$menu_offset: 540px;
$menu_height: 20px;
$menu_color: transparent;
$menu_glow: 0px 0px 25px rgba(222, 11, 70, 0.27);

/* Placeholders */

%center{
  left:0;
  right:0;
  top:50%;
  position:absolute;
  margin:auto;
  transform:translateY(-50%);
}

%decal{
  position:absolute;
  width:$core_width;
  height:$core_width;
  left:50%;
}

%fade_loop{
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      animation:fade 5s ($i/10 + 0s) infinite;
    }
  }
}

%fade_loop_alt{
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      animation:fade 7s ($i/10 + 0s) infinite;
    }
  }
}

%circ_loop{
  position: absolute;
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      border-radius:2px;
      transform:rotateZ($i*10 + (0deg));
    }
  }
}

%circ_loop_quart{
  position: absolute;
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      border-radius:2px;
      transform:rotateZ($i*4 + (0deg));
    }
  }
}

%circ_loop_quart_alt{
  position: absolute;
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      border-radius:2px;
      transform:rotateZ($i*4 + (0deg) - 180);
    }
  }
}

/* Styles */

.intro{

}
body{
  height:100vh;
  animation:intro_box 1s 1s forwards;
  opacity:0;
  perspective-origin: 50% -10%;
  margin:0;
  padding:0;
  font-family:montserrat;
  perspective:800;
  background: radial-gradient(ellipse at top left, rgba(222, 11, 70, 0.26) -160%, rgba(255, 255, 255, 0) 103%), -webkit-radial-gradient(center, ellipse cover, #0C1019 0%, #0B0B0E 100%);
  overflow:hidden;
  .grain{
    transform:scale(1) !important;
  background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/overlay.png");
  left: 0;
  right: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 100;
  pointer-events: none;
  top: 0;
  opacity: 1;
  bottom: 0;
}
  .center{
    @extend %center;
    transform: translateY(-21px) translateZ(-870px) rotateX(69deg) rotateY(-26deg) rotatez(-647deg) scale(0.9);
    height:$core_width;
    width:$core_width;
    animation:wiggle 20s infinite linear;
    .core{
      width:$core_width;
      height:$core_width;
      border-radius:$core_width;
      background:$core_color;
      box-shadow:$core_glow;
    }
    .outer_one{
      @extend %decal;
      transform:translateX(-$outer_one_offset) translateY(-50%);
        &__piece{
          width: $outer_one_width;
          height: $outer_one_height;
          background: $outer_one_color;
          box-shadow:$outer_one_glow;
          transform-origin: $outer_one_offset 0px;
          @extend %circ_loop;
          }
    }
    .outer_two{
      @extend %decal;
      transform:translateX(-$outer_two_offset) translateY(-50%);
        &__piece{
          width: $outer_two_width;
          height: $outer_two_height;
          background: $outer_two_color;
          box-shadow:$outer_two_glow;
          transform-origin: $outer_two_offset 0px;
          @extend %circ_loop;
          @extend %fade_loop;
          }
    }
    .outer_three{
      @extend %decal;
      transform:translateX(-$outer_three_offset) translateY(-50%);
        &__piece{
          width: $outer_three_width;
          height: $outer_three_height;
          background: $outer_three_color;
          box-shadow:$outer_three_glow;
          transform-origin: $outer_three_offset 0px;
          @extend %circ_loop_quart;
          @extend %fade_loop;
          }
    }
    .outer_four{
      @extend %decal;
      transform:translateX(-$outer_four_offset) translateY(-50%);
        &__piece{
          width: $outer_four_width;
          height: $outer_four_height;
          background: $outer_four_color;
          box-shadow:$outer_four_glow;
          transform-origin: $outer_four_offset 0px;
          @extend %circ_loop_quart_alt;
          @extend %fade_loop_alt;
          }
    }
    .outer_five{
      @extend %decal;
      transform:translateX(-$outer_five_offset) translateY(-50%);
        &__piece{
          width: $outer_four_width;
          height: $outer_four_height;
          background: $outer_four_color;
          box-shadow:$outer_four_glow;
          transform-origin: $outer_five_offset 0px;
          @extend %circ_loop_quart_alt;
          @extend %fade_loop_alt;
          }
    }
    .pieces{
      @extend %decal;
      transform:translateX($menu_offset) translateY(-50%);
      .tip{
        font-size: 17px;
        position: absolute;
        left: 105%;
        opacity:0;
        transition:all .2s .3s;
        font-weight: 400;
        color: #85DFE4;
        width: 100%;
        top: 70px;
      }
      span{
        position: absolute;
        top: 19px;
        width: 270px;
        LEFT: 34PX;
        transform: translateZ(-770px) rotateZ(0deg);
        transition:all .2s .1s;
      }
      .line{
            width: 0px;
    height: 5px;
    left: -547px;
    transform: rotatez(4deg);
    top: 17px;
    background: #DE0B46;
    position: absolute;
        opacity:0;
      }
      .future_ui__piece{
        border: 3px solid #DE0B46;
        position: absolute;
        font-weight:900;
        padding:30px;
        font-size:30px;
        box-shadow: 0px 0px 25px rgba(222, 11, 70, 0.27);
        transform-style: preserve-3d;
        transition: all 1s .1s;
        color: white;
        text-align: left;
        @for $i from 1 through 36{
          &:nth-of-type(#{$i}){
            transform:rotateZ($i*10 + (0deg) - 55) rotateY(0deg);
            width: 220 + random(73) + px;
            &:hover{
              cursor:pointer;
              color:white;
              animation:blink .4s .4s;
              background:#DE0B46;
              transform:rotate($i*10 + (0deg) - 55) translatex(20px);
              box-shadow: 0px 0px 55px rgba(222, 11, 70, 0.77);
              span{
                position: absolute;
                top: 12px;
                width: 270px;
                text-shadow: 0px 13px 0px rgba(30, 30, 30, 0.4);
                left:240px;
                transform: translateZ(100px) rotateZ(0deg);
              }
              .tip{
                opacity:1;
                left: 110%;
              }
              .line{
                opacity:1;
                width:547px;
                transition:all .4s .2s;
              }
            }
          }
        }
        height: $menu_height;
        background: $menu_color;
        color:white;
        border-radius:100px !important;
        box-shadow:$menu_glow;
        transform-origin: - $menu_offset 0px;
        @extend %circ_loop;
      }
      .blank{
        opacity:0.1;
        background:none;
        pointer-events:none;
        box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.27);
        border:6px solid #3D4B6D !important;
      }
    }
  }
}

/* animations */

@keyframes spin{
  0%{transform:rotate(0deg)}
  100%{transform:rotate(360deg)}
}

@keyframes fade{
  0%{opacity:0;}
  50%{opacity:1;}
  100%{opacity:0;}
}

@keyframes blink{
  0%{opacity:1}
  25%{opacity:0}
  50%{opacity:1}
  75%{opacity:0}
  100%{opacity:1}
}
@keyframes in{
  0%{opacity:0}
  100%{opacity:1}
}
@keyframes inalt{
  0%{opacity:0}
  50%{opacity:1}
  100%{opacity:0}
}
@keyframes wiggle{
  0%{transform: translateY(0) translateZ(-840px) rotateX(64deg) rotateY(-21deg) rotatez(80deg) scale(0.9);}
  25%{transform: translateY(0) translateZ(-820px) rotateX(66deg) rotateY(-24deg) rotatez(84deg) scale(0.9);}
  50%{transform: translateY(0) translateZ(-840px) rotateX(62deg) rotateY(-23deg) rotatez(82deg) scale(0.9);}
  75%{transform: translateY(0) translateZ(-840px) rotateX(63deg) rotateY(-19deg) rotatez(78deg) scale(0.9);}
  100%{transform: translateY(0) translateZ(-840px) rotateX(64deg) rotateY(-21deg) rotatez(80deg) scale(0.9);}
}

@keyframes intro_box{
  0%{opacity:0;transform:scale(0)}
  20%{opacity:1;transform:scale(1.2)}
  40%{transform:scale(0.89)}
  60%{transform:scale(1.04)}
  80%{transform:scale(0.98)}
  100%{opacity:1;transform:scale(1)}
}
</code>```

I've tried using this HAML code part at somes websites, but it didn't work. And about SCSS i didn't tried to translate yet, but i will search.

Body:
I'm still studying programming and websites development, and i found this code in HAML and SCSS code, but i dont understand yet, and i want to modificate some aspects but in HTML and CSS.
There is the part of HAML code

.grain
.intro
  .center
    .core
    .outer_one
      -(1..36).each do
        .outer_one__piece
    .outer_two
      -(1..36).each do
        .outer_two__piece
    .outer_three
      -(1..36).each do
        .outer_three__piece
    .outer_four
      -(1..36).each do
        .outer_four__piece
    .outer_five
      -(1..36).each do
        .outer_five__piece
    .pieces
      .future_ui__piece
        %span Warp drive
        .line
        .tip
          Yes, commander!
      .future_ui__piece
        %span Teleport
        .line
        .tip
          Beam me up!
      .future_ui__piece
        %span Fusion core
        .line
        .tip
          Engineering!
      .future_ui__piece
        %span Laser target
        .line
        .tip
          Charge laz0rs!
      .future_ui__piece
        %span Shields
        .line
        .tip
          Status report!
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank
      .future_ui__piece.blank

And there is the SCSS

/* Variables */

// Core
$core_width: 50px;
$core_color:#de0b46;
$core_glow:0px 0px 70px 20px #de0b46;

// Outer 1
$outer_one_offset: 120px;
$outer_one_width: 10px;
$outer_one_height: 30px;
$outer_one_color: #de0b46;
$outer_one_glow: 0px 0px 20px 0px #de0b46;

// Outer 2
$outer_two_offset: 290px;
$outer_two_width: 28px;
$outer_two_height: 5px;
$outer_two_color: #de0b46;
$outer_two_glow: 0px 0px 20px 0px #de0b46;

// Outer 3
$outer_three_offset: 440px;
$outer_three_width: 55px;
$outer_three_height: 5px;
$outer_three_color: #55E2F9;
$outer_three_glow: 0px 0px 20px 0px #55E2F9;

// Outer 4
$outer_four_offset: 440px;
$outer_four_width: 6px;
$outer_four_height: 5px;
$outer_four_color: #de0b46;
$outer_four_glow: 0px 0px 20px 0px #de0b46;

// Outer 5
$outer_five_offset: 410px;

// Menu items
$menu_offset: 540px;
$menu_height: 20px;
$menu_color: transparent;
$menu_glow: 0px 0px 25px rgba(222, 11, 70, 0.27);

/* Placeholders */

%center{
  left:0;
  right:0;
  top:50%;
  position:absolute;
  margin:auto;
  transform:translateY(-50%);
}

%decal{
  position:absolute;
  width:$core_width;
  height:$core_width;
  left:50%;
}

%fade_loop{
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      animation:fade 5s ($i/10 + 0s) infinite;
    }
  }
}

%fade_loop_alt{
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      animation:fade 7s ($i/10 + 0s) infinite;
    }
  }
}

%circ_loop{
  position: absolute;
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      border-radius:2px;
      transform:rotateZ($i*10 + (0deg));
    }
  }
}

%circ_loop_quart{
  position: absolute;
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      border-radius:2px;
      transform:rotateZ($i*4 + (0deg));
    }
  }
}

%circ_loop_quart_alt{
  position: absolute;
  @for $i from 1 through 36{
    &:nth-of-type(#{$i}){
      border-radius:2px;
      transform:rotateZ($i*4 + (0deg) - 180);
    }
  }
}

/* Styles */

.intro{

}
body{
  height:100vh;
  animation:intro_box 1s 1s forwards;
  opacity:0;
  perspective-origin: 50% -10%;
  margin:0;
  padding:0;
  font-family:montserrat;
  perspective:800;
  background: radial-gradient(ellipse at top left, rgba(222, 11, 70, 0.26) -160%, rgba(255, 255, 255, 0) 103%), -webkit-radial-gradient(center, ellipse cover, #0C1019 0%, #0B0B0E 100%);
  overflow:hidden;
  .grain{
    transform:scale(1) !important;
  background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/overlay.png");
  left: 0;
  right: 0;
  margin: auto;
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 100;
  pointer-events: none;
  top: 0;
  opacity: 1;
  bottom: 0;
}
  .center{
    @extend %center;
    transform: translateY(-21px) translateZ(-870px) rotateX(69deg) rotateY(-26deg) rotatez(-647deg) scale(0.9);
    height:$core_width;
    width:$core_width;
    animation:wiggle 20s infinite linear;
    .core{
      width:$core_width;
      height:$core_width;
      border-radius:$core_width;
      background:$core_color;
      box-shadow:$core_glow;
    }
    .outer_one{
      @extend %decal;
      transform:translateX(-$outer_one_offset) translateY(-50%);
        &__piece{
          width: $outer_one_width;
          height: $outer_one_height;
          background: $outer_one_color;
          box-shadow:$outer_one_glow;
          transform-origin: $outer_one_offset 0px;
          @extend %circ_loop;
          }
    }
    .outer_two{
      @extend %decal;
      transform:translateX(-$outer_two_offset) translateY(-50%);
        &__piece{
          width: $outer_two_width;
          height: $outer_two_height;
          background: $outer_two_color;
          box-shadow:$outer_two_glow;
          transform-origin: $outer_two_offset 0px;
          @extend %circ_loop;
          @extend %fade_loop;
          }
    }
    .outer_three{
      @extend %decal;
      transform:translateX(-$outer_three_offset) translateY(-50%);
        &__piece{
          width: $outer_three_width;
          height: $outer_three_height;
          background: $outer_three_color;
          box-shadow:$outer_three_glow;
          transform-origin: $outer_three_offset 0px;
          @extend %circ_loop_quart;
          @extend %fade_loop;
          }
    }
    .outer_four{
      @extend %decal;
      transform:translateX(-$outer_four_offset) translateY(-50%);
        &__piece{
          width: $outer_four_width;
          height: $outer_four_height;
          background: $outer_four_color;
          box-shadow:$outer_four_glow;
          transform-origin: $outer_four_offset 0px;
          @extend %circ_loop_quart_alt;
          @extend %fade_loop_alt;
          }
    }
    .outer_five{
      @extend %decal;
      transform:translateX(-$outer_five_offset) translateY(-50%);
        &__piece{
          width: $outer_four_width;
          height: $outer_four_height;
          background: $outer_four_color;
          box-shadow:$outer_four_glow;
          transform-origin: $outer_five_offset 0px;
          @extend %circ_loop_quart_alt;
          @extend %fade_loop_alt;
          }
    }
    .pieces{
      @extend %decal;
      transform:translateX($menu_offset) translateY(-50%);
      .tip{
        font-size: 17px;
        position: absolute;
        left: 105%;
        opacity:0;
        transition:all .2s .3s;
        font-weight: 400;
        color: #85DFE4;
        width: 100%;
        top: 70px;
      }
      span{
        position: absolute;
        top: 19px;
        width: 270px;
        LEFT: 34PX;
        transform: translateZ(-770px) rotateZ(0deg);
        transition:all .2s .1s;
      }
      .line{
            width: 0px;
    height: 5px;
    left: -547px;
    transform: rotatez(4deg);
    top: 17px;
    background: #DE0B46;
    position: absolute;
        opacity:0;
      }
      .future_ui__piece{
        border: 3px solid #DE0B46;
        position: absolute;
        font-weight:900;
        padding:30px;
        font-size:30px;
        box-shadow: 0px 0px 25px rgba(222, 11, 70, 0.27);
        transform-style: preserve-3d;
        transition: all 1s .1s;
        color: white;
        text-align: left;
        @for $i from 1 through 36{
          &:nth-of-type(#{$i}){
            transform:rotateZ($i*10 + (0deg) - 55) rotateY(0deg);
            width: 220 + random(73) + px;
            &:hover{
              cursor:pointer;
              color:white;
              animation:blink .4s .4s;
              background:#DE0B46;
              transform:rotate($i*10 + (0deg) - 55) translatex(20px);
              box-shadow: 0px 0px 55px rgba(222, 11, 70, 0.77);
              span{
                position: absolute;
                top: 12px;
                width: 270px;
                text-shadow: 0px 13px 0px rgba(30, 30, 30, 0.4);
                left:240px;
                transform: translateZ(100px) rotateZ(0deg);
              }
              .tip{
                opacity:1;
                left: 110%;
              }
              .line{
                opacity:1;
                width:547px;
                transition:all .4s .2s;
              }
            }
          }
        }
        height: $menu_height;
        background: $menu_color;
        color:white;
        border-radius:100px !important;
        box-shadow:$menu_glow;
        transform-origin: - $menu_offset 0px;
        @extend %circ_loop;
      }
      .blank{
        opacity:0.1;
        background:none;
        pointer-events:none;
        box-shadow: 0px 0px 10px rgba(255, 255, 255, 0.27);
        border:6px solid #3D4B6D !important;
      }
    }
  }
}

/* animations */

@keyframes spin{
  0%{transform:rotate(0deg)}
  100%{transform:rotate(360deg)}
}

@keyframes fade{
  0%{opacity:0;}
  50%{opacity:1;}
  100%{opacity:0;}
}

@keyframes blink{
  0%{opacity:1}
  25%{opacity:0}
  50%{opacity:1}
  75%{opacity:0}
  100%{opacity:1}
}
@keyframes in{
  0%{opacity:0}
  100%{opacity:1}
}
@keyframes inalt{
  0%{opacity:0}
  50%{opacity:1}
  100%{opacity:0}
}
@keyframes wiggle{
  0%{transform: translateY(0) translateZ(-840px) rotateX(64deg) rotateY(-21deg) rotatez(80deg) scale(0.9);}
  25%{transform: translateY(0) translateZ(-820px) rotateX(66deg) rotateY(-24deg) rotatez(84deg) scale(0.9);}
  50%{transform: translateY(0) translateZ(-840px) rotateX(62deg) rotateY(-23deg) rotatez(82deg) scale(0.9);}
  75%{transform: translateY(0) translateZ(-840px) rotateX(63deg) rotateY(-19deg) rotatez(78deg) scale(0.9);}
  100%{transform: translateY(0) translateZ(-840px) rotateX(64deg) rotateY(-21deg) rotatez(80deg) scale(0.9);}
}

@keyframes intro_box{
  0%{opacity:0;transform:scale(0)}
  20%{opacity:1;transform:scale(1.2)}
  40%{transform:scale(0.89)}
  60%{transform:scale(1.04)}
  80%{transform:scale(0.98)}
  100%{opacity:1;transform:scale(1)}
}

I've tried using this HAML code part at somes websites, but it didn't work. And about SCSS i didn't tried to translate yet, but i will search.


问:
is there a way to change directory as a different user?
In order for the whole script to work, it needs to be run as the logged on user, however I have to change the directory to a folder that requires elevated credentials to open.

cd "C:\privatefolder\application"
.\program.vsto -credential $credential

When it comes to running the install I'm able to do -credential to run it as elevated, but it looks like change directory doesn't have the same options.

I'm a powershell novice since my job is mainly hardware support so you may have to explain it like I'm a caveman.


问:
How to debug jenkins exception: org.jenkinsci.remoting.util.ExecutorServiceUtils$FatalRejectedExecutionException
In jenkins system log, I see a huge number of exception like the following one (~1 per second)

`Jan 06, 2023 4:15:24 PM SEVERE com.google.common.util.concurrent.AggregateFuture log

Got more than one input Future failure. Logging failures after the first
org.jenkinsci.remoting.util.ExecutorServiceUtils$FatalRejectedExecutionException: Cannot execute the command java.util.concurrent.FutureTask@1f48e80f. The executor service is shutting down
at hudson.remoting.SingleLaneExecutorService.execute(SingleLaneExecutorService.java:116)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at jenkins.util.InterceptingExecutorService.submit(InterceptingExecutorService.java:46)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$5.onSuccess(CpsFlowExecution.java:925)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$5.onSuccess(CpsFlowExecution.java:921)
at org.jenkinsci.plugins.workflow.support.concurrent.Futures$1.run(Futures.java:147)
at org.jenkinsci.plugins.workflow.support.concurrent.DirectExecutor.execute(DirectExecutor.java:33)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1270)
at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:761)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.addListener(AbstractFuture.java:136)
at org.jenkinsci.plugins.workflow.support.concurrent.Futures.addCallback(Futures.java:157)
at org.jenkinsci.plugins.workflow.support.concurrent.Futures.addCallback(Futures.java:97)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.runInCpsVmThread(CpsFlowExecution.java:921)
at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.getCurrentExecutions(CpsFlowExecution.java:1012)
at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$StepExecutionIteratorImpl.apply(FlowExecutionList.java:215)
at org.jenkinsci.plugins.workflow.steps.StepExecution.applyAll(StepExecution.java:179)
at org.jenkinsci.plugins.workflow.steps.StepExecution.applyAll(StepExecution.java:187)
at org.jenkinsci.plugins.workflow.steps.WaitForConditionStep$Execution.retry(WaitForConditionStep.java:121)
at org.jenkinsci.plugins.workflow.steps.WaitForConditionStep$Execution.access$000(WaitForConditionStep.java:70)
at org.jenkinsci.plugins.workflow.steps.WaitForConditionStep$Callback.onSuccess(WaitForConditionStep.java:181)
at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:372)
at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
at com.cloudbees.groovy.cps.Next.step(Next.java:83)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:158)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:152)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:152)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:187)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:420)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:95)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:330)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:294)
at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)`

Looking at the call stack, I've no idea where it comes from.
How can I debug that ?


问:
MySQL option --federated not known - Debian
After an update, I need to re-activate federated option on MySQL 8.0.31.

I have modify /etc/mysql/my.cnf to add federated option and restart MySQL but:

Mysql return mysql: [ERROR] unknown option '--federated'

my.cnf file

```<code># The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
</code>```

mysqld.cnf

```<code># Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation.  The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA

#
# The MySQL  Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysqld]
federated
bind-address    = 0.0.0.0
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
datadir         = /var/lib/mysql
log-error       = /var/log/mysql/error.log

slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow-queries.log
long_query_time = 2

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION
wait_timeout=28800
connect-timeout=600
interactive-timeout=600
</code>```

skip-federated not exist in /etc/mysql/conf.d/ conf files.

If I show engines;, I have this response:

ARCHIVE
YES
Archive storage engine
NO
NO
NO

BLACKHOLE
YES
/dev/null storage engine (anything you write to it disappears)
NO
NO
NO

MRG_MYISAM
YES
Collection of identical MyISAM tables
NO
NO
NO

FEDERATED
NO
Federated MySQL storage engine

MyISAM
YES
MyISAM storage engine
NO
NO
NO

PERFORMANCE_SCHEMA
YES
Performance Schema
NO
NO
NO

InnoDB
DEFAULT  Supports transactions, row-level locking, and foreign keys
YES
YES
YES

MEMORY
YES
Hash based, stored in memory, useful for temporary tables
NO
NO
NO

CSV
YES
CSV storage engine
NO
NO
NO

I don't understand why it doesn't work, because FEDERATED plugin exist.

If I start with systemctl and --federated option I have this error:

systemctl : option non reconnue '--federated'

English version

systemctl : option not reconized/known '--federated'

Thanks for your help.

Edit: I have test this solution How can I enable the federated engine in mysql after installation?
but you can see that it didn't work since I have the federated line in my.cnf and also in the list of engines without it working and pass to Yes

Body:
After an update, I need to re-activate federated option on MySQL 8.0.31.

I have modify /etc/mysql/my.cnf to add federated option and restart MySQL but:

Mysql return mysql: [ERROR] unknown option '--federated'

my.cnf file

# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock

# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

mysqld.cnf

# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation.  The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA

#
# The MySQL  Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysqld]
federated
bind-address    = 0.0.0.0
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
datadir         = /var/lib/mysql
log-error       = /var/log/mysql/error.log

slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow-queries.log
long_query_time = 2

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION
wait_timeout=28800
connect-timeout=600
interactive-timeout=600

skip-federated not exist in /etc/mysql/conf.d/ conf files.

If I show engines;, I have this response:

ARCHIVE
YES
Archive storage engine
NO
NO
NO

BLACKHOLE
YES
/dev/null storage engine (anything you write to it disappears)
NO
NO
NO

MRG_MYISAM
YES
Collection of identical MyISAM tables
NO
NO
NO

FEDERATED
NO
Federated MySQL storage engine

MyISAM
YES
MyISAM storage engine
NO
NO
NO

PERFORMANCE_SCHEMA
YES
Performance Schema
NO
NO
NO

InnoDB
DEFAULT  Supports transactions, row-level locking, and foreign keys
YES
YES
YES

MEMORY
YES
Hash based, stored in memory, useful for temporary tables
NO
NO
NO

CSV
YES
CSV storage engine
NO
NO
NO

I don't understand why it doesn't work, because FEDERATED plugin exist.

If I start with systemctl and --federated option I have this error:

systemctl : option non reconnue '--federated'

English version

systemctl : option not reconized/known '--federated'

Thanks for your help.

Edit: I have test this solution How can I enable the federated engine in mysql after installation?
but you can see that it didn't work since I have the federated line in my.cnf and also in the list of engines without it working and pass to Yes


问:
printing with printf in /init
I am playing with linux booting for educationl purposes.
Here is my micromalistic init program:

#include <stdio.h>

int main () {
        printf ("hello\n");
        while (1) { }
        return 0;
}
```
<p>Compiled with <code>gcc -static init.c -o initrd/init</code></p>
<p>ramdisk:</p>
```cd initrd
find .|cpio --quiet -H newc -o | gzip -9 -n > ../myinitrd.gz
```
<p>As you can see <code>/init</code> is the only file in ram disc.</p>
```qemu-system-x86_64 -m 2G -accel kvm -kernel bzImage -append "init=/init" -initrd myinitrd.gz
```
<p>Last lines I see in VM output:</p>
```[    0.803476] Run /init as init process
[    0.804003] init (70) used greatest stack depth: 14696 bytes left
```

It seems init loaded, but printf() message does not het through. Why?

Title: printing with printf in /init

Body:
I am playing with linux booting for educationl purposes.
Here is my micromalistic init program:

#include <stdio.h>

int main () {
        printf ("hello\n");
        while (1) { }
        return 0;
}

Compiled with gcc -static init.c -o initrd/init

ramdisk:

cd initrd
find .|cpio --quiet -H newc -o | gzip -9 -n > ../myinitrd.gz

As you can see /init is the only file in ram disc.

qemu-system-x86_64 -m 2G -accel kvm -kernel bzImage -append "init=/init" -initrd myinitrd.gz

Last lines I see in VM output:

[    0.803476] Run /init as init process
[    0.804003] init (70) used greatest stack depth: 14696 bytes left

It seems init loaded, but printf() message does not het through. Why?