问:
Passing image data from screen to component
I am unable to pass the photo data from the takePicture function in CameraScreen.tsx to the AddNewPostButton.tsx component to insert the photo into the firebase database. My idea of using useContext is not working and I don't know how to solve it.

I tried to send photos from the CameraScreen screen to the AddNewPostButton component using the useContext mechanism, but I couldn't do it and I don't know how to do it.

CameraScreen.tsx
"Cannot assign argument of type 'string | undefined' to parameter of type 'string | null'.
Type 'undefined' cannot be assigned to type 'string | null'."

```<code>import React, { useContext, useState, createContext } from 'react';
import { Pressable, Center, Modal, Button, Stack, Input, TextArea, Icon, Text, View } from 'native-base';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import { addDoc, Timestamp, collection } from 'firebase/firestore';
import { db } from '../firebaseConfig';
import { AuthContext } from '../utils/AuthStateListener';
import type { StackNavigationProp } from '@react-navigation/stack';
import { useNavigation } from '@react-navigation/native';
import { RootStackParamList } from '../stacks/RootStack';

type photoButton = StackNavigationProp<RootStackParamList>;

export const ImageContext = createContext<{ image: string | null, setImage: (newImage: string | null) => void }>({
  image: null,
  setImage: () => {},
});

function AddNewPostButton() {
  const { currentUser, userProfile } = useContext(AuthContext);
  //const [image, setImage] = useState<string | null>(null);
  const navigation: photoButton = useNavigation();
  const { image, setImage } = useContext(ImageContext);
  /* const setImage = (newImage: string | null) => {
    ImageContext.setImage(newImage);
  } */

  const [modalVisible, setModalVisible] = React.useState(false);
  const [newPost, setNewPost] = React.useState({
    title: '',
    description: '',
    location: '',
    photo: ''
  });
  if (image) console.log(image);
  const handleChange = (name: string, value: string) => {
    setNewPost((prev) => ({ ...prev, [name]: value }));
  };

  const addNewPost = async () => {
    await addDoc(collection(db, 'publicPosts'), {
      title: newPost.title,
      description: newPost.description,
      location: newPost.location,
      date: Timestamp.fromDate(new Date()),
      photo: image ? image : '',
      likes: 0,
      authorId: currentUser?.uid,
      authorName: userProfile?.name,
    });
    setNewPost({
      title: '',
      description: '',
      location: '',
      photo: ''
    });
    setModalVisible(false);
    setImage('');
  };

  return (
    <>
      <Modal isOpen={modalVisible} onClose={setModalVisible}>
        <Modal.Content>
          <Modal.CloseButton />
          <Modal.Header>Dodaj ogłoszenie</Modal.Header>
          <Modal.Body>
            <Stack space={1} w="75%" maxW="300px" mx="auto">
              <Input
                variant="outline"
                placeholder="Tytuł nowego ogłoszenia"
                onChangeText={(value) => handleChange('title', value)}
              />
              <Input
                variant="outline"
                placeholder="Lokalizacja"
                onChangeText={(value) => handleChange('location', value)}
              />
              <TextArea
                variant="outline"
                placeholder="Opis ogłoszenia"
                onChangeText={(value) => handleChange('description', value)}
              />
            </Stack>
            <View>
              <Button
                onPress={() => {
                  navigation.navigate({
                    name: 'Camera',
                    key: 'CameraScreen',
                  });
                  //navigation.navigate({name:'Camera'})
                  setModalVisible(false);
                }}>
                <Text>Dodaj zdjęcie</Text>
              </Button>
            </View>
          </Modal.Body>
          <Modal.Footer>
            <Button.Group space={2}>
              <Button
                variant="ghost"
                colorScheme="blueGray"
                onPress={() => {
                  setModalVisible(false);
                }}>
                Anuluj
              </Button>
              <Button
                onPress={() => {
                  addNewPost();
                }}>
                Zapisz
              </Button>
            </Button.Group>
          </Modal.Footer>
        </Modal.Content>
      </Modal>
      <Pressable
        opacity={modalVisible === true ? 1 : 0.5}
        py="3"
        flex={1}
        onPress={() => {
          setModalVisible(true);
        }}>
        <Center>
          <Icon mb="1" as={<MaterialCommunityIcons name="plus-box" />} color="white" size="sm" />
          <Text color="white" fontSize="12">
            Dodaj
          </Text>
        </Center>
      </Pressable>
    </>
  );
}

export default AddNewPostButton;

</code>```
```<code>import { Camera, CameraType } from 'expo-camera';
import { useState, useRef, useContext } from 'react';
import { StyleSheet, Text, TouchableOpacity, View, Dimensions, Alert } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { ImageContext } from '../components/AddNewPostButton';

const screenWidth = Dimensions.get('window').width;

function CameraScreen() {
  const [type, setType] = useState(CameraType.back);
  const [permission, requestPermission] = Camera.useCameraPermissions();
  const { image, setImage } = useContext(ImageContext);

  let camera = useRef<Camera>(null);

  if (!permission) {
    return <View />;
  }

  if (!permission.granted) {
    return (
      <Text>Brak dostępu do kamery</Text>
    );
  }

  const takePicture = async () => {
    if (camera.current) {
      try {
        const options = { quality: 0.5, base64: true, orientation: 'portrait' };

        const data = await camera.current.takePictureAsync(options);

        setImage(data.base64);
      } catch (error) {
        console.error(error);
        Alert.alert('Wystąpił błąd podczas dodawania zdjęcia');
      }
    }
  }

  return (
    <View style={styles.container}>
      <Camera ref={camera} style={styles.camera} type={type}>
        <View style={styles.cameraControls}>
          <TouchableOpacity
            style={styles.flipButton}
            onPress={() => {
              setType(
                type === CameraType.back
                  ? CameraType.front
                  : CameraType.back
              );
            }}>
            <Ionicons name="ios-camera-reverse-outline" size={64} color="#fff" />
          </TouchableOpacity>
          <TouchableOpacity
            style={styles.captureButton}
            onPress={() => takePicture()}>
            <Ionicons name="ios-camera" size={64} color="#fff" />
          </TouchableOpacity>
        </View>
      </Camera>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#000',
    alignItems: 'center',
    justifyContent: 'center',
  },
  camera: {
    width: screenWidth,
    height: screenWidth + 200,
  },
  cameraControls: {
    width: '100%',
    height: '100%',
    alignItems: 'center',
    justifyContent: 'space-evenly',
    flexDirection: 'row',
    paddingHorizontal: 16,
    paddingVertical: 16,
  },
  flipButton: {
    alignSelf: 'flex-end',
  },
  captureButton: {
    alignSelf: 'flex-end',
  },
  text: {
    fontSize: 14,
  },
});

export default CameraScreen;
</code>```
```<code>import React, { useContext } from 'react';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Timestamp } from 'firebase/firestore';
import ToggleDarkMode from '../components/DarkModeToggle';
import Header from '../components/Header';
import HomeScreen from '../screens/HomeScreen';
import PostDetailsScreen from '../screens/PostDetailsScreen';
import Signup from '../screens/SignupScreen';
import SigninScreen from '../screens/SigninScreen';
import { AuthContext } from '../utils/AuthStateListener';
import ResetPassword from '../screens/ResetPassword';
import HeaderNavigateBackButton from '../components/HeaderNavigateBackButton';
import UserDetailsScreen from '../screens/UserDetailsScreen';
import CameraScreen from '../screens/CameraScreen';

export type RootStackParamList = {
  Home: undefined;
  Signup: undefined;
  Signin: undefined;
  ResetPassword: undefined;
  UserDetails: undefined;
  Camera: {
    param: string;
  };
  Details: {
    post: {
      title: string;
      description: string;
      date: Timestamp;
      location: string;
      likes: number;
    };
  };
};

const Stack = createNativeStackNavigator<RootStackParamList>();

// Functions to prevent eslint error of declaring component inside parent component
function ToggleDarkModeComponent() {
  return <ToggleDarkMode />;
}

function HeaderComponent() {
  return <Header />;
}

function NavigateBackButtonComponent() {
  return <HeaderNavigateBackButton />;
}

function RootStack() {
  const { currentUser } = useContext(AuthContext);

  return (
    <Stack.Navigator
      initialRouteName="Home"
      screenOptions={{
        headerStyle: { backgroundColor: '#86efac' },
        headerRight: ToggleDarkModeComponent,
      }}>
      <Stack.Screen
        name="Home"
        component={HomeScreen}
        options={{
          headerTitle: HeaderComponent,
        }}
      />
      {!currentUser ? (
        <>
          <Stack.Screen
            name="Signin"
            component={SigninScreen}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
          <Stack.Screen
            name="Signup"
            component={Signup}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
          <Stack.Screen
            name="ResetPassword"
            component={ResetPassword}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
        </>
      ) : (
        <>
          <Stack.Screen
            name="Details"
            component={PostDetailsScreen}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
          <Stack.Screen
            name="UserDetails"
            component={UserDetailsScreen}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
          <Stack.Screen
            name="Camera"
            component={CameraScreen}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
        </>
      )}
    </Stack.Navigator>
  );
}

export default RootStack;
</code>```

Body:
I am unable to pass the photo data from the takePicture function in CameraScreen.tsx to the AddNewPostButton.tsx component to insert the photo into the firebase database. My idea of using useContext is not working and I don't know how to solve it.

I tried to send photos from the CameraScreen screen to the AddNewPostButton component using the useContext mechanism, but I couldn't do it and I don't know how to do it.

CameraScreen.tsx
"Cannot assign argument of type 'string | undefined' to parameter of type 'string | null'.
Type 'undefined' cannot be assigned to type 'string | null'."

import React, { useContext, useState, createContext } from 'react';
import { Pressable, Center, Modal, Button, Stack, Input, TextArea, Icon, Text, View } from 'native-base';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import { addDoc, Timestamp, collection } from 'firebase/firestore';
import { db } from '../firebaseConfig';
import { AuthContext } from '../utils/AuthStateListener';
import type { StackNavigationProp } from '@react-navigation/stack';
import { useNavigation } from '@react-navigation/native';
import { RootStackParamList } from '../stacks/RootStack';

type photoButton = StackNavigationProp<RootStackParamList>;

export const ImageContext = createContext<{ image: string | null, setImage: (newImage: string | null) => void }>({
  image: null,
  setImage: () => {},
});

function AddNewPostButton() {
  const { currentUser, userProfile } = useContext(AuthContext);
  //const [image, setImage] = useState<string | null>(null);
  const navigation: photoButton = useNavigation();
  const { image, setImage } = useContext(ImageContext);
  /* const setImage = (newImage: string | null) => {
    ImageContext.setImage(newImage);
  } */

  const [modalVisible, setModalVisible] = React.useState(false);
  const [newPost, setNewPost] = React.useState({
    title: '',
    description: '',
    location: '',
    photo: ''
  });
  if (image) console.log(image);
  const handleChange = (name: string, value: string) => {
    setNewPost((prev) => ({ ...prev, [name]: value }));
  };

  const addNewPost = async () => {
    await addDoc(collection(db, 'publicPosts'), {
      title: newPost.title,
      description: newPost.description,
      location: newPost.location,
      date: Timestamp.fromDate(new Date()),
      photo: image ? image : '',
      likes: 0,
      authorId: currentUser?.uid,
      authorName: userProfile?.name,
    });
    setNewPost({
      title: '',
      description: '',
      location: '',
      photo: ''
    });
    setModalVisible(false);
    setImage('');
  };

  return (
    <>
      <Modal isOpen={modalVisible} onClose={setModalVisible}>
        <Modal.Content>
          <Modal.CloseButton />
          <Modal.Header>Dodaj ogłoszenie</Modal.Header>
          <Modal.Body>
            <Stack space={1} w="75%" maxW="300px" mx="auto">
              <Input
                variant="outline"
                placeholder="Tytuł nowego ogłoszenia"
                onChangeText={(value) => handleChange('title', value)}
              />
              <Input
                variant="outline"
                placeholder="Lokalizacja"
                onChangeText={(value) => handleChange('location', value)}
              />
              <TextArea
                variant="outline"
                placeholder="Opis ogłoszenia"
                onChangeText={(value) => handleChange('description', value)}
              />
            </Stack>
            <View>
              <Button
                onPress={() => {
                  navigation.navigate({
                    name: 'Camera',
                    key: 'CameraScreen',
                  });
                  //navigation.navigate({name:'Camera'})
                  setModalVisible(false);
                }}>
                <Text>Dodaj zdjęcie</Text>
              </Button>
            </View>
          </Modal.Body>
          <Modal.Footer>
            <Button.Group space={2}>
              <Button
                variant="ghost"
                colorScheme="blueGray"
                onPress={() => {
                  setModalVisible(false);
                }}>
                Anuluj
              </Button>
              <Button
                onPress={() => {
                  addNewPost();
                }}>
                Zapisz
              </Button>
            </Button.Group>
          </Modal.Footer>
        </Modal.Content>
      </Modal>
      <Pressable
        opacity={modalVisible === true ? 1 : 0.5}
        py="3"
        flex={1}
        onPress={() => {
          setModalVisible(true);
        }}>

          <Icon mb="1" as={<MaterialCommunityIcons name="plus-box" />} color="white" size="sm" />
          <Text color="white" fontSize="12">
            Dodaj
          </Text>

      </Pressable>
    </>
  );
}

export default AddNewPostButton;

import { Camera, CameraType } from 'expo-camera';
import { useState, useRef, useContext } from 'react';
import { StyleSheet, Text, TouchableOpacity, View, Dimensions, Alert } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { ImageContext } from '../components/AddNewPostButton';

const screenWidth = Dimensions.get('window').width;

function CameraScreen() {
  const [type, setType] = useState(CameraType.back);
  const [permission, requestPermission] = Camera.useCameraPermissions();
  const { image, setImage } = useContext(ImageContext);

  let camera = useRef<Camera>(null);

  if (!permission) {
    return <View />;
  }

  if (!permission.granted) {
    return (
      <Text>Brak dostępu do kamery</Text>
    );
  }

  const takePicture = async () => {
    if (camera.current) {
      try {
        const options = { quality: 0.5, base64: true, orientation: 'portrait' };

        const data = await camera.current.takePictureAsync(options);

        setImage(data.base64);
      } catch (error) {
        console.error(error);
        Alert.alert('Wystąpił błąd podczas dodawania zdjęcia');
      }
    }
  }

  return (
    <View style={styles.container}>
      <Camera ref={camera} style={styles.camera} type={type}>
        <View style={styles.cameraControls}>
          <TouchableOpacity
            style={styles.flipButton}
            onPress={() => {
              setType(
                type === CameraType.back
                  ? CameraType.front
                  : CameraType.back
              );
            }}>
            <Ionicons name="ios-camera-reverse-outline" size={64} color="#fff" />
          </TouchableOpacity>
          <TouchableOpacity
            style={styles.captureButton}
            onPress={() => takePicture()}>
            <Ionicons name="ios-camera" size={64} color="#fff" />
          </TouchableOpacity>
        </View>
      </Camera>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#000',
    alignItems: 'center',
    justifyContent: 'center',
  },
  camera: {
    width: screenWidth,
    height: screenWidth + 200,
  },
  cameraControls: {
    width: '100%',
    height: '100%',
    alignItems: 'center',
    justifyContent: 'space-evenly',
    flexDirection: 'row',
    paddingHorizontal: 16,
    paddingVertical: 16,
  },
  flipButton: {
    alignSelf: 'flex-end',
  },
  captureButton: {
    alignSelf: 'flex-end',
  },
  text: {
    fontSize: 14,
  },
});

export default CameraScreen;

import React, { useContext } from 'react';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { Timestamp } from 'firebase/firestore';
import ToggleDarkMode from '../components/DarkModeToggle';
import Header from '../components/Header';
import HomeScreen from '../screens/HomeScreen';
import PostDetailsScreen from '../screens/PostDetailsScreen';
import Signup from '../screens/SignupScreen';
import SigninScreen from '../screens/SigninScreen';
import { AuthContext } from '../utils/AuthStateListener';
import ResetPassword from '../screens/ResetPassword';
import HeaderNavigateBackButton from '../components/HeaderNavigateBackButton';
import UserDetailsScreen from '../screens/UserDetailsScreen';
import CameraScreen from '../screens/CameraScreen';

export type RootStackParamList = {
  Home: undefined;
  Signup: undefined;
  Signin: undefined;
  ResetPassword: undefined;
  UserDetails: undefined;
  Camera: {
    param: string;
  };
  Details: {
    post: {
      title: string;
      description: string;
      date: Timestamp;
      location: string;
      likes: number;
    };
  };
};

const Stack = createNativeStackNavigator<RootStackParamList>();

// Functions to prevent eslint error of declaring component inside parent component
function ToggleDarkModeComponent() {
  return <ToggleDarkMode />;
}

function HeaderComponent() {
  return ;
}

function NavigateBackButtonComponent() {
  return <HeaderNavigateBackButton />;
}

function RootStack() {
  const { currentUser } = useContext(AuthContext);

  return (
    <Stack.Navigator
      initialRouteName="Home"
      screenOptions={{
        headerStyle: { backgroundColor: '#86efac' },
        headerRight: ToggleDarkModeComponent,
      }}>
      <Stack.Screen
        name="Home"
        component={HomeScreen}
        options={{
          headerTitle: HeaderComponent,
        }}
      />
      {!currentUser ? (
        <>
          <Stack.Screen
            name="Signin"
            component={SigninScreen}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
          <Stack.Screen
            name="Signup"
            component={Signup}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
          <Stack.Screen
            name="ResetPassword"
            component={ResetPassword}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
        </>
      ) : (
        <>
          <Stack.Screen
            name="Details"
            component={PostDetailsScreen}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
          <Stack.Screen
            name="UserDetails"
            component={UserDetailsScreen}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
          <Stack.Screen
            name="Camera"
            component={CameraScreen}
            options={{
              headerLeft: NavigateBackButtonComponent,
            }}
          />
        </>
      )}
    </Stack.Navigator>
  );
}

export default RootStack;


来源: stackexchange

问:
How to watch localeStorage changes in Pinia state?
I have an item called nuxt-color-mode saved in localeStorage. It has either dark or light value. And I would like to watch the value of this item from any component. So I put the Setup & Option Stores that I tried for now! By the way I'm using Nuxt 3!

'~/stores/colorTheme.ts/'

import { defineStore } from "pinia";

// Option Stores
export const useColorThemeStore = defineStore('colorThemeStore', {
    state: async () => {
        return { mode: await localStorage.getItem('nuxt-color-mode')};
    },
    getters: {},
    actions: {}

});

//Setup Stores
export const useColorThemeStore = defineStore('colorThemeStore', async () => {

    const colorMode = await localStorage.getItem('nuxt-color-mode');
    const mode = ref(colorMode);

    return { mode }

});
```
<p>'~/component/Portfolio.vue'</p>
<pre class="lang-vue prettyprint-override"><code><script setup lang="ts">
   import { useColorThemeStore } from '~/stores/colorTheme';

   const mode  = useColorThemeStore(); // Got undedfined!

   watch(mode, () => {
      console.log('Mode = ', mode) // Doesn't watch or print anything!
   })
</script>
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have an item called nuxt-color-mode saved in localeStorage. It has either dark or light value. And I would like to watch the value of this item from any component. So I put the Setup & Option Stores that I tried for now! By the way I'm using Nuxt 3!

'~/stores/colorTheme.ts/'

import { defineStore } from "pinia";

// Option Stores
export const useColorThemeStore = defineStore('colorThemeStore', {
    state: async () => {
        return { mode: await localStorage.getItem('nuxt-color-mode')};
    },
    getters: {},
    actions: {}

});

//Setup Stores
export const useColorThemeStore = defineStore('colorThemeStore', async () => {

    const colorMode = await localStorage.getItem('nuxt-color-mode');
    const mode = ref(colorMode);

    return { mode }

});

'~/component/Portfolio.vue'


问:
MetalLB - admission webhooks - denied the request: resource must be created in operators namespace. What does it mean?
I am trying to create a self-hosted k3s cluster to explore the world of k8s.

I have used kubectl apply to apply the manifest at (not at the same time):

https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml

https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-frr.yaml

https://raw.githubusercontent.com/metallb/metallb/v0.13.6/config/manifests/metallb-frr.yaml

I am trying to add ipAddressPool, BGPPeer and BGPAdvertisement to MetalLB and am facing an issue where the relevant webhooks:

ipaddresspoolvalidationwebhook.metallb.io

bgppeersvalidationwebhook.metallb.io

bgpadvertisementvalidationwebhook.metallb.io

Are returning with: admission webhook denied the request: resource must be created in operators namespace

I don't know what this response means or how to resolve it.

Manifests:

```<code>apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  namespace: metallb-system
  name: bgp-pool
spec:
  addresses:
    - 172.31.20.1/24
    - 2001:db8::c00b:beef::/80
</code>```
```<code>apiVersion: metallb.io/v1beta2
kind: BGPPeer
metadata:
  name: router
  namespace: metallb-system
spec:
  myASN: 64521
  peerASN: 64520
  peerAddress: 172.30.0.1
  bfdProfile: bfdprofile
</code>```
```<code>apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement
metadata:
  name: bgp-pool
  namespace: metallb-system
spec:
  ipAddressPools:
  - bgp-pool
</code>```

Pod Status:

```<code>$ kpod
NAMESPACE        NAME                                                              READY   STATUS      RESTARTS   AGE
kube-system      calico-node-f4dsm                                                 1/1     Running     0          68m
kube-system      local-path-provisioner-79f67d76f8-scwdt                           1/1     Running     0          92m
kube-system      coredns-597584b69b-ljxd9                                          1/1     Running     0          92m
kube-system      calico-kube-controllers-798cc86c47-9h6mz                          1/1     Running     0          68m
kube-system      calico-node-dhtt7                                                 1/1     Running     0          68m
kube-system      calico-node-dbm2f                                                 1/1     Running     0          68m
olm              olm-operator-56cf65dbf9-t4r9k                                     1/1     Running     0          54m
olm              catalog-operator-6b8c45596c-m6fxf                                 1/1     Running     0          54m
olm              packageserver-6d7b8cd74-dqgdl                                     1/1     Running     0          40m
olm              packageserver-6d7b8cd74-ncphw                                     1/1     Running     0          40m
olm              operatorhubio-catalog-np4f7                                       1/1     Running     0          40m
olm              00ae99ed4d0c9f0380e2866691b8643f32e9c345efa7942e3572d090556hpc8   0/1     Completed   0          37m
operators        metallb-operator-controller-manager-f59767f58-mtd48               1/1     Running     0          36m
operators        metallb-operator-webhook-server-7f79999bb7-v94hm                  1/1     Running     0          36m
metallb-system   controller-66f6c8999f-kvxkp                                       1/1     Running     0          21m
metallb-system   speaker-bnxxd                                                     4/4     Running     0          21m
metallb-system   speaker-dqcn9                                                     4/4     Running     0          21m
</code>```

Logs

metallb-operator-webhook-server

```<code>$ k logs metallb-operator-webhook-server-7f79999bb7-v94hm -n operators
{"branch":"dev","caller":"main.go:155","commit":"dev","goversion":"gc / go1.18.3 / amd64","level":"info","msg":"MetalLB controller starting (commit dev, branch dev)","ts":"2022-12-29T20:40:23Z","version":""}
{"caller":"k8s.go:389","level":"info","msg":"Starting Manager","op":"Run","ts":"2022-12-29T20:40:24Z"}
{"action":"webhooks enabled","caller":"webhook.go:55","level":"info","op":"startup","ts":"2022-12-29T20:40:24Z"}
{"level":"info","ts":1672346424.0781536,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=AddressPool"}
{"level":"info","ts":1672346424.0788455,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=AddressPool","path":"/validate-metallb-io-v1beta1-addresspool"}
{"level":"info","ts":1672346424.0794268,"logger":"controller-runtime.webhook.webhooks","msg":"Starting webhook server"}
{"level":"info","ts":1672346424.0799024,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-addresspool"}
{"level":"info","ts":1672346424.080218,"logger":"controller-runtime.certwatcher","msg":"Updated current TLS certificate"}
{"level":"info","ts":1672346424.080664,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/convert"}
{"level":"info","ts":1672346424.0814717,"logger":"controller-runtime.builder","msg":"Conversion webhook enabled","GVK":"metallb.io/v1beta1, Kind=AddressPool"}
{"level":"info","ts":1672346424.081652,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=IPAddressPool"}
{"level":"info","ts":1672346424.081719,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=IPAddressPool","path":"/validate-metallb-io-v1beta1-ipaddresspool"}
{"level":"info","ts":1672346424.0819142,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-ipaddresspool"}
{"level":"info","ts":1672346424.0821607,"logger":"controller-runtime.certwatcher","msg":"Starting certificate watcher"}
{"level":"info","ts":1672346424.0823011,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta2, Kind=BGPPeer"}
{"level":"info","ts":1672346424.083003,"logger":"controller-runtime.webhook","msg":"Serving webhook server","host":"","port":9443}
{"level":"info","ts":1672346424.0831902,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta2, Kind=BGPPeer","path":"/validate-metallb-io-v1beta2-bgppeer"}
{"level":"info","ts":1672346424.0839014,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta2-bgppeer"}
{"level":"info","ts":1672346424.084423,"logger":"controller-runtime.builder","msg":"Conversion webhook enabled","GVK":"metallb.io/v1beta2, Kind=BGPPeer"}
{"level":"info","ts":1672346424.0847147,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=BGPAdvertisement"}
{"level":"info","ts":1672346424.0849228,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=BGPAdvertisement","path":"/validate-metallb-io-v1beta1-bgpadvertisement"}
{"level":"info","ts":1672346424.0854847,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-bgpadvertisement"}
{"level":"info","ts":1672346424.0860505,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=L2Advertisement"}
{"level":"info","ts":1672346424.0861676,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=L2Advertisement","path":"/validate-metallb-io-v1beta1-l2advertisement"}
{"level":"info","ts":1672346424.0863633,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-l2advertisement"}
{"level":"info","ts":1672346424.086669,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=Community"}
{"level":"info","ts":1672346424.087227,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=Community","path":"/validate-metallb-io-v1beta1-community"}
{"level":"info","ts":1672346424.0876715,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-community"}
{"level":"info","ts":1672346424.087925,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=BFDProfile"}
{"level":"info","ts":1672346424.0879838,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=BFDProfile","path":"/validate-metallb-io-v1beta1-bfdprofile"}
{"level":"info","ts":1672346424.0881443,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-bfdprofile"}
</code>```

metallb-operator-controller-manager

```<code>$ k logs metallb-operator-controller-manager-f59767f58-mtd48 -n operators
1.6723464002770052e+09  INFO    setup   git commit:     {"id": "=dev"}
1.6723464006334805e+09  INFO    controller-runtime.metrics      Metrics server is starting to listen    {"addr": ":0"}
1.6723464006350648e+09  INFO    platform        detecting platform version...
1.6723464006471622e+09  INFO    platform        PlatformInfo [Name: Kubernetes, K8SVersion: 1.25, OS: linux/amd64]
1.6723464006474972e+09  INFO    setup   starting manager
1.6723464006485376e+09  INFO    Starting server {"path": "/metrics", "kind": "metrics", "addr": "[::]:33419"}
I1229 20:40:00.650000       1 leaderelection.go:248] attempting to acquire leader lease operators/metallb.io.metallboperator...
I1229 20:40:00.679813       1 leaderelection.go:258] successfully acquired lease operators/metallb.io.metallboperator
1.672346400680695e+09   INFO    Starting EventSource    {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB", "source": "kind source: *v1beta1.MetalLB"}
1.6723464006810224e+09  INFO    Starting Controller     {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB"}
1.6723464006801696e+09  DEBUG   events  Normal  {"object": {"kind":"Lease","namespace":"operators","name":"metallb.io.metallboperator","uid":"4aed740a-9ffd-4207-940f-941905ac353e","apiVersion":"coordination.k8s.io/v1","resourceVersion":"2812"}, "reason": "LeaderElection", "message": "metallb-operator-controller-manager-f59767f58-mtd48_bb8c2886-579c-4666-ade5-95d9f366f330 became leader"}
1.6723464007836418e+09  INFO    Starting workers        {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB", "worker count": 1}
</code>```

What does work

The BFDProfile does get accepted by the validation hooks.  The ipAddressPool, BGPPeer and BGPAdvertisement manifests have been built using the documentation at https://metallb.universe.tf/configuration/.

I have tried removing the metallb-operator and the whole metallb manifest and even destroying and recreating the cluster and cannot find any reference to this error after hours searching.

I expect the admission webhooks to accept the manifests as they have been built using the official documentation.

Body:
I am trying to create a self-hosted k3s cluster to explore the world of k8s.

I have used kubectl apply to apply the manifest at (not at the same time):

https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml

https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-frr.yaml

https://raw.githubusercontent.com/metallb/metallb/v0.13.6/config/manifests/metallb-frr.yaml

I am trying to add ipAddressPool, BGPPeer and BGPAdvertisement to MetalLB and am facing an issue where the relevant webhooks:

ipaddresspoolvalidationwebhook.metallb.io

bgppeersvalidationwebhook.metallb.io

bgpadvertisementvalidationwebhook.metallb.io

Are returning with: admission webhook denied the request: resource must be created in operators namespace

I don't know what this response means or how to resolve it.

Manifests:

apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  namespace: metallb-system
  name: bgp-pool
spec:
  addresses:
    - 172.31.20.1/24
    - 2001:db8::c00b:beef::/80

apiVersion: metallb.io/v1beta2
kind: BGPPeer
metadata:
  name: router
  namespace: metallb-system
spec:
  myASN: 64521
  peerASN: 64520
  peerAddress: 172.30.0.1
  bfdProfile: bfdprofile

apiVersion: metallb.io/v1beta1
kind: BGPAdvertisement
metadata:
  name: bgp-pool
  namespace: metallb-system
spec:
  ipAddressPools:
  - bgp-pool

Pod Status:

$ kpod
NAMESPACE        NAME                                                              READY   STATUS      RESTARTS   AGE
kube-system      calico-node-f4dsm                                                 1/1     Running     0          68m
kube-system      local-path-provisioner-79f67d76f8-scwdt                           1/1     Running     0          92m
kube-system      coredns-597584b69b-ljxd9                                          1/1     Running     0          92m
kube-system      calico-kube-controllers-798cc86c47-9h6mz                          1/1     Running     0          68m
kube-system      calico-node-dhtt7                                                 1/1     Running     0          68m
kube-system      calico-node-dbm2f                                                 1/1     Running     0          68m
olm              olm-operator-56cf65dbf9-t4r9k                                     1/1     Running     0          54m
olm              catalog-operator-6b8c45596c-m6fxf                                 1/1     Running     0          54m
olm              packageserver-6d7b8cd74-dqgdl                                     1/1     Running     0          40m
olm              packageserver-6d7b8cd74-ncphw                                     1/1     Running     0          40m
olm              operatorhubio-catalog-np4f7                                       1/1     Running     0          40m
olm              00ae99ed4d0c9f0380e2866691b8643f32e9c345efa7942e3572d090556hpc8   0/1     Completed   0          37m
operators        metallb-operator-controller-manager-f59767f58-mtd48               1/1     Running     0          36m
operators        metallb-operator-webhook-server-7f79999bb7-v94hm                  1/1     Running     0          36m
metallb-system   controller-66f6c8999f-kvxkp                                       1/1     Running     0          21m
metallb-system   speaker-bnxxd                                                     4/4     Running     0          21m
metallb-system   speaker-dqcn9                                                     4/4     Running     0          21m

Logs

metallb-operator-webhook-server

$ k logs metallb-operator-webhook-server-7f79999bb7-v94hm -n operators
{"branch":"dev","caller":"main.go:155","commit":"dev","goversion":"gc / go1.18.3 / amd64","level":"info","msg":"MetalLB controller starting (commit dev, branch dev)","ts":"2022-12-29T20:40:23Z","version":""}
{"caller":"k8s.go:389","level":"info","msg":"Starting Manager","op":"Run","ts":"2022-12-29T20:40:24Z"}
{"action":"webhooks enabled","caller":"webhook.go:55","level":"info","op":"startup","ts":"2022-12-29T20:40:24Z"}
{"level":"info","ts":1672346424.0781536,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=AddressPool"}
{"level":"info","ts":1672346424.0788455,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=AddressPool","path":"/validate-metallb-io-v1beta1-addresspool"}
{"level":"info","ts":1672346424.0794268,"logger":"controller-runtime.webhook.webhooks","msg":"Starting webhook server"}
{"level":"info","ts":1672346424.0799024,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-addresspool"}
{"level":"info","ts":1672346424.080218,"logger":"controller-runtime.certwatcher","msg":"Updated current TLS certificate"}
{"level":"info","ts":1672346424.080664,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/convert"}
{"level":"info","ts":1672346424.0814717,"logger":"controller-runtime.builder","msg":"Conversion webhook enabled","GVK":"metallb.io/v1beta1, Kind=AddressPool"}
{"level":"info","ts":1672346424.081652,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=IPAddressPool"}
{"level":"info","ts":1672346424.081719,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=IPAddressPool","path":"/validate-metallb-io-v1beta1-ipaddresspool"}
{"level":"info","ts":1672346424.0819142,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-ipaddresspool"}
{"level":"info","ts":1672346424.0821607,"logger":"controller-runtime.certwatcher","msg":"Starting certificate watcher"}
{"level":"info","ts":1672346424.0823011,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta2, Kind=BGPPeer"}
{"level":"info","ts":1672346424.083003,"logger":"controller-runtime.webhook","msg":"Serving webhook server","host":"","port":9443}
{"level":"info","ts":1672346424.0831902,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta2, Kind=BGPPeer","path":"/validate-metallb-io-v1beta2-bgppeer"}
{"level":"info","ts":1672346424.0839014,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta2-bgppeer"}
{"level":"info","ts":1672346424.084423,"logger":"controller-runtime.builder","msg":"Conversion webhook enabled","GVK":"metallb.io/v1beta2, Kind=BGPPeer"}
{"level":"info","ts":1672346424.0847147,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=BGPAdvertisement"}
{"level":"info","ts":1672346424.0849228,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=BGPAdvertisement","path":"/validate-metallb-io-v1beta1-bgpadvertisement"}
{"level":"info","ts":1672346424.0854847,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-bgpadvertisement"}
{"level":"info","ts":1672346424.0860505,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=L2Advertisement"}
{"level":"info","ts":1672346424.0861676,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=L2Advertisement","path":"/validate-metallb-io-v1beta1-l2advertisement"}
{"level":"info","ts":1672346424.0863633,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-l2advertisement"}
{"level":"info","ts":1672346424.086669,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=Community"}
{"level":"info","ts":1672346424.087227,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=Community","path":"/validate-metallb-io-v1beta1-community"}
{"level":"info","ts":1672346424.0876715,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-community"}
{"level":"info","ts":1672346424.087925,"logger":"controller-runtime.builder","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","GVK":"metallb.io/v1beta1, Kind=BFDProfile"}
{"level":"info","ts":1672346424.0879838,"logger":"controller-runtime.builder","msg":"Registering a validating webhook","GVK":"metallb.io/v1beta1, Kind=BFDProfile","path":"/validate-metallb-io-v1beta1-bfdprofile"}
{"level":"info","ts":1672346424.0881443,"logger":"controller-runtime.webhook","msg":"Registering webhook","path":"/validate-metallb-io-v1beta1-bfdprofile"}

metallb-operator-controller-manager

$ k logs metallb-operator-controller-manager-f59767f58-mtd48 -n operators
1.6723464002770052e+09  INFO    setup   git commit:     {"id": "=dev"}
1.6723464006334805e+09  INFO    controller-runtime.metrics      Metrics server is starting to listen    {"addr": ":0"}
1.6723464006350648e+09  INFO    platform        detecting platform version...
1.6723464006471622e+09  INFO    platform        PlatformInfo [Name: Kubernetes, K8SVersion: 1.25, OS: linux/amd64]
1.6723464006474972e+09  INFO    setup   starting manager
1.6723464006485376e+09  INFO    Starting server {"path": "/metrics", "kind": "metrics", "addr": "[::]:33419"}
I1229 20:40:00.650000       1 leaderelection.go:248] attempting to acquire leader lease operators/metallb.io.metallboperator...
I1229 20:40:00.679813       1 leaderelection.go:258] successfully acquired lease operators/metallb.io.metallboperator
1.672346400680695e+09   INFO    Starting EventSource    {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB", "source": "kind source: *v1beta1.MetalLB"}
1.6723464006810224e+09  INFO    Starting Controller     {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB"}
1.6723464006801696e+09  DEBUG   events  Normal  {"object": {"kind":"Lease","namespace":"operators","name":"metallb.io.metallboperator","uid":"4aed740a-9ffd-4207-940f-941905ac353e","apiVersion":"coordination.k8s.io/v1","resourceVersion":"2812"}, "reason": "LeaderElection", "message": "metallb-operator-controller-manager-f59767f58-mtd48_bb8c2886-579c-4666-ade5-95d9f366f330 became leader"}
1.6723464007836418e+09  INFO    Starting workers        {"controller": "metallb", "controllerGroup": "metallb.io", "controllerKind": "MetalLB", "worker count": 1}

What does work

The BFDProfile does get accepted by the validation hooks.  The ipAddressPool, BGPPeer and BGPAdvertisement manifests have been built using the documentation at https://metallb.universe.tf/configuration/.

I have tried removing the metallb-operator and the whole metallb manifest and even destroying and recreating the cluster and cannot find any reference to this error after hours searching.

I expect the admission webhooks to accept the manifests as they have been built using the official documentation.


问:
macOS in Jenkins batch command is not working
I am trying to execute windows batch command in Jenkins from macOS and not succeed, walk through the internet try to find a way how I can create artifact (file) in Jenkins command line with this code echo Hello World! >> config.txt from macOS but couldn't succeed, if anyone who had experience and can suggest solution it will be appreciated.

This is the place where I added to command

This is the output of build


问:
Improve performance API CAll in R with furrr
The code below performs an API request. Basically I inform two cities (origin and destination) and I must return which bus companies makes the connection between these cities. If there is not a line between these cities just ignores. Each city is represented by a 3-digit code and it forms the input parameter of the requests.

```<code>library(data.table)
library(RCurl)
library(jsonlite)
library(dplyr)
library(tidyverse)
library(furrr)

#sample of data
from_to_df <- data.frame(
  origin =  200:300,
  destination = 300:400) %>%
    filter(origin != destination) %>%
    mutate(parameter = paste("origem=",origin,"&destino=",destination,"&__RequestVerificationToken=Z-wXmGOb9pnQbmkfcQXmChT-6uc3YfGjftHwK4HnC9SDCaKmzIafo7AI3lChBY6YDBHdpT_X98mSHGAr_YrTNgKiepKxKraGu7p6PI7dV4g1", sep ="")
           )

download_lines <- function(from_to_df){

  from_to_lines <- list(origin = vector("list", length = 1000000),
                        destination = vector("list", length = 1000000),
                        company = vector("list", length = 1000000))

  headers = c(
    "Accept" = "application/json, text/javascript, */*; q=0.01",
    "Accept-Language" = "en-US,en;q=0.9",
    "Connection" = "keep-alive",
    "Content-Type" = "application/x-www-form-urlencoded; charset=UTF-8",
    "Cookie" = "__RequestVerificationToken_L1RyYW5zcG9ydGVDb2xldGl2bw2=tY-yKlWmbZvAJzMHmITkohPiIos5XkjDBwf1ZBfP_bYWdXJMBF2Qw3z_B-LRVo0kXjdnHqDqsbZ04Zij_PM-wAf4DWVKfnQskOhqo4ANSRc1",
    "Origin" = "http://extranet.artesp.sp.gov.br",
    "Referer" = "http://extranet.artesp.sp.gov.br/TransporteColetivo/OrigemDestino?fbclid=IwAR3_hZwajHk_iyU085S1LDTqLCOYLHIZ5K825XgPGcB4tMI0EuCJpQNrJHM",
    "User-Agent" = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
    "X-Requested-With" = "XMLHttpRequest"
  )
  z <- 1
  for (j in 1:nrow(from_to_df)) {
    res <- postForm("http://extranet.artesp.sp.gov.br/TransporteColetivo/OrigemDestino/GetGrid", .opts=list(postfields = from_to_df[[j, "parameter"]], httpheader = headers, followlocation = TRUE), style = "httppost")
    if (res != "[]"){
      from_to_lines$origin[[z]] <- from_to_df[[j, "origin"]]
      from_to_lines$destination[[z]] <- from_to_df[[j, "destination"]]
      from_to_lines$company[[z]] <- jsonlite::fromJSON(res)[[2]]
      z <- z + 1
      }
    }
  return(from_to_lines)
  }

from_to_df_lines <- download_lines(from_to_df)

</code>```

The program itself works and I can list the companies. The problem is that I need to make about 415000 requests. From the tests I've performed all these requests it's going to take more than 12 hours to finish. In a previous post it was suggested to use the furr package in order to perform the different requests in parallel. This is a package that I do not yet master well. I Try to adapt the program as below (download_lines_furrr) using the future_pwalk function

```<code>download_lines_furrr <- function(from_to_df){

  from_to_lines <- list(origin = vector("list", length = 1000000),
                         destination = vector("list", length = 1000000),
                          company = vector("list", length = 1000000))

  #RCURL
  headers = c(
    "Accept" = "application/json, text/javascript, */*; q=0.01",
    "Accept-Language" = "en-US,en;q=0.9",
    "Connection" = "keep-alive",
    "Content-Type" = "application/x-www-form-urlencoded; charset=UTF-8",
    "Cookie" = "__RequestVerificationToken_L1RyYW5zcG9ydGVDb2xldGl2bw2=tY-yKlWmbZvAJzMHmITkohPiIos5XkjDBwf1ZBfP_bYWdXJMBF2Qw3z_B-LRVo0kXjdnHqDqsbZ04Zij_PM-wAf4DWVKfnQskOhqo4ANSRc1",
    "Origin" = "http://extranet.artesp.sp.gov.br",
    "Referer" = "http://extranet.artesp.sp.gov.br/TransporteColetivo/OrigemDestino?fbclid=IwAR3_hZwajHk_iyU085S1LDTqLCOYLHIZ5K825XgPGcB4tMI0EuCJpQNrJHM",
    "User-Agent" = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
    "X-Requested-With" = "XMLHttpRequest"
  )
  z <- 1

    res <- postForm("http://extranet.artesp.sp.gov.br/TransporteColetivo/OrigemDestino/GetGrid", .opts=list(postfields = from_to_df[["parameter"]], httpheader = headers, followlocation = TRUE), style = "httppost")
    if (res != "[]"){
      from_to_lines$origin[[z]] <- from_to_df[["origin"]]
      from_to_lines$destination[[z]] <- from_to_df[["destination"]]
      from_to_lines$company[[z]] <- jsonlite::fromJSON(res)[[2]]
      z <- z + 1

    }

  return(from_to_lines)

}

future::plan(future::multisession)
future_pwalk(from_to_df, download_lines_furrr)
</code>```

, but this error always occurs:

Error in ...furrr_fn(...) :
unused arguments (origin = 200, destination = 300, parameter = "origem=200&destino=300&__RequestVerificationToken=Z-wXmGOb9pnQbmkfcQXmChT-6uc3YfGjftHwK4HnC9SDCaKmzIafo7AI3lChBY6YDBHdpT_X98mSHGAr_YrTNgKiepKxKraGu7p6PI7dV4g1")

I would like to know how to adapt this routine with FURRR or another way to reduce the execution time of requests.

Body:
The code below performs an API request. Basically I inform two cities (origin and destination) and I must return which bus companies makes the connection between these cities. If there is not a line between these cities just ignores. Each city is represented by a 3-digit code and it forms the input parameter of the requests.

library(data.table)
library(RCurl)
library(jsonlite)
library(dplyr)
library(tidyverse)
library(furrr)

#sample of data
from_to_df <- data.frame(
  origin =  200:300,
  destination = 300:400) %>%
    filter(origin != destination) %>%
    mutate(parameter = paste("origem=",origin,"&destino=",destination,"&__RequestVerificationToken=Z-wXmGOb9pnQbmkfcQXmChT-6uc3YfGjftHwK4HnC9SDCaKmzIafo7AI3lChBY6YDBHdpT_X98mSHGAr_YrTNgKiepKxKraGu7p6PI7dV4g1", sep ="")
           )

download_lines <- function(from_to_df){

  from_to_lines <- list(origin = vector("list", length = 1000000),
                        destination = vector("list", length = 1000000),
                        company = vector("list", length = 1000000))

  headers = c(
    "Accept" = "application/json, text/javascript, */*; q=0.01",
    "Accept-Language" = "en-US,en;q=0.9",
    "Connection" = "keep-alive",
    "Content-Type" = "application/x-www-form-urlencoded; charset=UTF-8",
    "Cookie" = "__RequestVerificationToken_L1RyYW5zcG9ydGVDb2xldGl2bw2=tY-yKlWmbZvAJzMHmITkohPiIos5XkjDBwf1ZBfP_bYWdXJMBF2Qw3z_B-LRVo0kXjdnHqDqsbZ04Zij_PM-wAf4DWVKfnQskOhqo4ANSRc1",
    "Origin" = "http://extranet.artesp.sp.gov.br",
    "Referer" = "http://extranet.artesp.sp.gov.br/TransporteColetivo/OrigemDestino?fbclid=IwAR3_hZwajHk_iyU085S1LDTqLCOYLHIZ5K825XgPGcB4tMI0EuCJpQNrJHM",
    "User-Agent" = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
    "X-Requested-With" = "XMLHttpRequest"
  )
  z <- 1
  for (j in 1:nrow(from_to_df)) {
    res <- postForm("http://extranet.artesp.sp.gov.br/TransporteColetivo/OrigemDestino/GetGrid", .opts=list(postfields = from_to_df[[j, "parameter"]], httpheader = headers, followlocation = TRUE), style = "httppost")
    if (res != "[]"){
      from_to_lines$origin[[z]] <- from_to_df[[j, "origin"]]
      from_to_lines$destination[[z]] <- from_to_df[[j, "destination"]]
      from_to_lines$company[[z]] <- jsonlite::fromJSON(res)[[2]]
      z <- z + 1
      }
    }
  return(from_to_lines)
  }

from_to_df_lines <- download_lines(from_to_df)

The program itself works and I can list the companies. The problem is that I need to make about 415000 requests. From the tests I've performed all these requests it's going to take more than 12 hours to finish. In a previous post it was suggested to use the furr package in order to perform the different requests in parallel. This is a package that I do not yet master well. I Try to adapt the program as below (download_lines_furrr) using the future_pwalk function

download_lines_furrr <- function(from_to_df){

  from_to_lines <- list(origin = vector("list", length = 1000000),
                         destination = vector("list", length = 1000000),
                          company = vector("list", length = 1000000))

  #RCURL
  headers = c(
    "Accept" = "application/json, text/javascript, */*; q=0.01",
    "Accept-Language" = "en-US,en;q=0.9",
    "Connection" = "keep-alive",
    "Content-Type" = "application/x-www-form-urlencoded; charset=UTF-8",
    "Cookie" = "__RequestVerificationToken_L1RyYW5zcG9ydGVDb2xldGl2bw2=tY-yKlWmbZvAJzMHmITkohPiIos5XkjDBwf1ZBfP_bYWdXJMBF2Qw3z_B-LRVo0kXjdnHqDqsbZ04Zij_PM-wAf4DWVKfnQskOhqo4ANSRc1",
    "Origin" = "http://extranet.artesp.sp.gov.br",
    "Referer" = "http://extranet.artesp.sp.gov.br/TransporteColetivo/OrigemDestino?fbclid=IwAR3_hZwajHk_iyU085S1LDTqLCOYLHIZ5K825XgPGcB4tMI0EuCJpQNrJHM",
    "User-Agent" = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
    "X-Requested-With" = "XMLHttpRequest"
  )
  z <- 1

    res <- postForm("http://extranet.artesp.sp.gov.br/TransporteColetivo/OrigemDestino/GetGrid", .opts=list(postfields = from_to_df[["parameter"]], httpheader = headers, followlocation = TRUE), style = "httppost")
    if (res != "[]"){
      from_to_lines$origin[[z]] <- from_to_df[["origin"]]
      from_to_lines$destination[[z]] <- from_to_df[["destination"]]
      from_to_lines$company[[z]] <- jsonlite::fromJSON(res)[[2]]
      z <- z + 1

    }

  return(from_to_lines)

}

future::plan(future::multisession)
future_pwalk(from_to_df, download_lines_furrr)

, but this error always occurs:

Error in ...furrr_fn(...) :
unused arguments (origin = 200, destination = 300, parameter = "origem=200&destino=300&__RequestVerificationToken=Z-wXmGOb9pnQbmkfcQXmChT-6uc3YfGjftHwK4HnC9SDCaKmzIafo7AI3lChBY6YDBHdpT_X98mSHGAr_YrTNgKiepKxKraGu7p6PI7dV4g1")

I would like to know how to adapt this routine with FURRR or another way to reduce the execution time of requests.


问:
How can I set text orientation in Excel using matlab actxserver?
I'm using matlab actxserver to make a excel table. I want to change the orientation of text in a cell. I have checked some VBA codes. But I don't know how to transform a VBA command in Matlab code. I have tried:

eSheet.Range.Orientation=90;
eSheet.Range.XlOrientation=-4171;
```

(https://learn.microsoft.com/en-us/office/vba/api/excel.xlorientation)
(https://learn.microsoft.com/en-us/office/vba/api/excel.range.orientation)
They don't work.

What's the correct syntax to do this?

Body:
I'm using matlab actxserver to make a excel table. I want to change the orientation of text in a cell. I have checked some VBA codes. But I don't know how to transform a VBA command in Matlab code. I have tried:

eSheet.Range.Orientation=90;
eSheet.Range.XlOrientation=-4171;

(https://learn.microsoft.com/en-us/office/vba/api/excel.xlorientation)
(https://learn.microsoft.com/en-us/office/vba/api/excel.range.orientation)
They don't work.

What's the correct syntax to do this?


问:
Python binary search tree bug
I have been trying for the last 2 days to implement a binary search tree in python.

Tree node:

```<code>class tree_node:
    def  __init__(self,val,rightChild,leftChild):
        self.val = val
        self.rightChild = rightChild
        self.leftChild = leftChild
</code>```

Binary search tree:

```<code>class binary_tree:
    def __init__(self,baseNode):
        self.baseNode = baseNode
    def addTreeNode(self,treeNode):
        current = self.baseNode
        prev = None
        while current:
            prev = current
            if treeNode.val<current.val:
                current = current.rightChild
            elif treeNode.val>current.val:
                current = current.leftChild
        if treeNode.val<prev.val:
            prev.rightChild  = treeNode
        elif treeNode.val>prev.val:
            prev.leftChild = treeNode
    def print_tree(self):
        def dfs(node):
            if node:
                 print("",node.val)
                 dfs(node.rightChild)
                 dfs(node.leftChild)
        dfs(self.baseNode)
    def deleteNode(self,treeNode):
        current = self.baseNode
        prev = None
        while current:
            prev = current
            if treeNode.val<current.val:
                current = current.rightChild
                if current == treeNode:
                    break
            elif treeNode.val>current.val:
                current = current.leftChild
                if current == treeNode:
                    break
        if not  current.rightChild and not current.leftChild:
            if current == prev.rightChild:
                prev.rightChild = None
                current = None
            elif current == prev.leftChild:
                prev.leftChild = None
                current = None
        elif (current.rightChild and not current.leftChild) or (current.leftChild and not current.rightChild):
            if current.val>self.baseNode.val:
                if not current.leftChild:
                    prev.leftChild = current.rightChild
                    current = None
                else:
                    prev.leftChild = current.leftChild
                    current = None
            elif current.val<self.baseNode.val:
                if not current.leftChild:
                    prev.rightChild = current.rightChild
                    current = None
                else:
                    prev.rightChild = current.leftChild
                    current = None
        elif current.rightChild and current.leftChild:
             if  current == prev.rightChild:
                prev.rightChild = current.rightChild
                prev.rightChild.rightChild = current.leftChild
                current= None
             elif current == prev.leftChild:
                prev.rightChild = current.rightChild
                prev.rightChild.rightChild = current.leftChild
                current = None
</code>```

I put these tree nodes in the binary search tree:

```<code>zero = tree_node(0,None,None)
minusone = tree_node(-1,None,None)
one = tree_node(1,None,None)
minustwo = tree_node(-2,None,None)
two= tree_node(2,None,None)
three= tree_node(3,None,None)
minussevenhalves= tree_node(-7/2,None,None)
four= tree_node(4,None,None)
minusfour= tree_node(-4,None,None)
minusfive= tree_node(-5,None,None)
minusonehalf = tree_node(-1/2,None,None)
onehalf = tree_node(1/2,None,None)
six = tree_node(6,None,None)
threehalves = tree_node(3/2,None,None)

bst = binary_tree(zero)
bst.addTreeNode(one)
bst.addTreeNode(two)
bst.addTreeNode(minusonehalf)
bst.addTreeNode(minustwo)
bst.addTreeNode(minusone)
bst.addTreeNode(three)
bst.addTreeNode(minusfive)
bst.addTreeNode(minussevenhalves)
bst.addTreeNode(four)
bst.addTreeNode(minusfour)
bst.addTreeNode(onehalf)
bst.addTreeNode(six)
bst.addTreeNode(threehalves)
</code>```

I succesively print the tree and delete a node to see if my code is correct:

```<code>bst.print_tree()
Output:0
-0.5
-2
-5
-3.5
-4
-1
 1
 0.5
 2
 1.5
 3
 4
 6
print("Removing node with value -2")
bst.deleteNode(minustwo)
bst.print_tree()
Output:0
-0.5
-5
-1
-3.5
-4
 1
 0.5
 2
 1.5
 3
 4
 6
 print("Removing node with value -7/2")
 bst.deleteNode(minussevenhalves)
 bst.print_tree()
 Output:0
 -0.5
 -5
 -4
 -3.5
 -4
  1
  0.5
  2
  1.5
  3
  4
  6
  print("Removing node with value 4")
  bst.deleteNode(four)
  bst.print_tree()
  Output: 0
  -0.5
  -5
  -4
  -3.5
  -4
   1
   0.5
   2
   1.5
   3
   6

</code>```

So as you can see there is a problem when deleting a item with 1 child in the right side of the tree.

So I went investigating the problem.And I realised that the node with val -1 has 2 children but the

2nd child doesnt appear before trying to delete the node with val -7/2.What is going on here?

Title: Python binary search tree bug

Body:
I have been trying for the last 2 days to implement a binary search tree in python.

Tree node:

class tree_node:
    def  __init__(self,val,rightChild,leftChild):
        self.val = val
        self.rightChild = rightChild
        self.leftChild = leftChild

Binary search tree:

class binary_tree:
    def __init__(self,baseNode):
        self.baseNode = baseNode
    def addTreeNode(self,treeNode):
        current = self.baseNode
        prev = None
        while current:
            prev = current
            if treeNode.val<current.val:
                current = current.rightChild
            elif treeNode.val>current.val:
                current = current.leftChild
        if treeNode.val<prev.val:
            prev.rightChild  = treeNode
        elif treeNode.val>prev.val:
            prev.leftChild = treeNode
    def print_tree(self):
        def dfs(node):
            if node:
                 print("",node.val)
                 dfs(node.rightChild)
                 dfs(node.leftChild)
        dfs(self.baseNode)
    def deleteNode(self,treeNode):
        current = self.baseNode
        prev = None
        while current:
            prev = current
            if treeNode.val<current.val:
                current = current.rightChild
                if current == treeNode:
                    break
            elif treeNode.val>current.val:
                current = current.leftChild
                if current == treeNode:
                    break
        if not  current.rightChild and not current.leftChild:
            if current == prev.rightChild:
                prev.rightChild = None
                current = None
            elif current == prev.leftChild:
                prev.leftChild = None
                current = None
        elif (current.rightChild and not current.leftChild) or (current.leftChild and not current.rightChild):
            if current.val>self.baseNode.val:
                if not current.leftChild:
                    prev.leftChild = current.rightChild
                    current = None
                else:
                    prev.leftChild = current.leftChild
                    current = None
            elif current.val<self.baseNode.val:
                if not current.leftChild:
                    prev.rightChild = current.rightChild
                    current = None
                else:
                    prev.rightChild = current.leftChild
                    current = None
        elif current.rightChild and current.leftChild:
             if  current == prev.rightChild:
                prev.rightChild = current.rightChild
                prev.rightChild.rightChild = current.leftChild
                current= None
             elif current == prev.leftChild:
                prev.rightChild = current.rightChild
                prev.rightChild.rightChild = current.leftChild
                current = None

I put these tree nodes in the binary search tree:

zero = tree_node(0,None,None)
minusone = tree_node(-1,None,None)
one = tree_node(1,None,None)
minustwo = tree_node(-2,None,None)
two= tree_node(2,None,None)
three= tree_node(3,None,None)
minussevenhalves= tree_node(-7/2,None,None)
four= tree_node(4,None,None)
minusfour= tree_node(-4,None,None)
minusfive= tree_node(-5,None,None)
minusonehalf = tree_node(-1/2,None,None)
onehalf = tree_node(1/2,None,None)
six = tree_node(6,None,None)
threehalves = tree_node(3/2,None,None)

bst = binary_tree(zero)
bst.addTreeNode(one)
bst.addTreeNode(two)
bst.addTreeNode(minusonehalf)
bst.addTreeNode(minustwo)
bst.addTreeNode(minusone)
bst.addTreeNode(three)
bst.addTreeNode(minusfive)
bst.addTreeNode(minussevenhalves)
bst.addTreeNode(four)
bst.addTreeNode(minusfour)
bst.addTreeNode(onehalf)
bst.addTreeNode(six)
bst.addTreeNode(threehalves)

I succesively print the tree and delete a node to see if my code is correct:

bst.print_tree()
Output:0
-0.5
-2
-5
-3.5
-4
-1
 1
 0.5
 2
 1.5
 3
 4
 6
print("Removing node with value -2")
bst.deleteNode(minustwo)
bst.print_tree()
Output:0
-0.5
-5
-1
-3.5
-4
 1
 0.5
 2
 1.5
 3
 4
 6
 print("Removing node with value -7/2")
 bst.deleteNode(minussevenhalves)
 bst.print_tree()
 Output:0
 -0.5
 -5
 -4
 -3.5
 -4
  1
  0.5
  2
  1.5
  3
  4
  6
  print("Removing node with value 4")
  bst.deleteNode(four)
  bst.print_tree()
  Output: 0
  -0.5
  -5
  -4
  -3.5
  -4
   1
   0.5
   2
   1.5
   3
   6

So as you can see there is a problem when deleting a item with 1 child in the right side of the tree.

So I went investigating the problem.And I realised that the node with val -1 has 2 children but the

2nd child doesnt appear before trying to delete the node with val -7/2.What is going on here?


问:
What does input[[...]] do in a shiny observe event?
In the below code, I'm trying to understand what the input[[...]] in the two commented observeEvent() functions do. Could someone please explain?

I'm trying to adapt this code so the function of the individual delete action buttons rendered under each added table can be consolidated into a single selectInput() or selectizeInput() box, showing all tables available for deletion, and then I can remove these individual table delete buttons. I need to understand this input[[...]] part in the below code first, so perhaps I can do the equivalent with selectInput() or selectizeInput(). I've only used input$... before in referring to action buttons or other user input widgets for an observeEvent().

Code:

```<code>library(shiny)
library(rhandsontable)

data1 <- data.frame(row.names = c("A","B","C","Sum"),"Col 1"=c(1,1,0,2),check.names=FALSE)

ui <- fluidPage(
  br(),
  actionButton("addTbl","Add table"),
  br(),br(),
  tags$div(id = "placeholder",
           tags$div(
             style = "display: inline-block",
             rHandsontableOutput("hottable1")
           )
  )
)

server <- function(input, output, session) {
  uiTbl <- reactiveValues(div_01_tbl = data1) # mod
  rv <- reactiveValues()

  observeEvent(input$hottable1, {uiTbl$div_01_tbl <- hot_to_r(input$hottable1)}) # mod

  output$hottable1 <- renderRHandsontable({rhandsontable(uiTbl$div_01_tbl, useTypes = TRUE)}) # mod

  observeEvent(input$addTbl, {
    divID <- paste0("div_", if(input$addTbl+1 < 10){"0"},input$addTbl+1) # mod
    dtID <- paste0(divID, "_DT")
    btnID <- paste0(divID, "_rmv")
    uiTbl[[paste0(divID,"_tbl")]] <- data1 # captures initial dataframe values

    insertUI(
      selector = "#placeholder",
      ui = tags$div(
        id = divID,
        style = "display:inline-block;",
        rHandsontableOutput(dtID),
        actionButton(btnID, "Delete", class = "pull-left btn btn-danger"),
      )
    )

    output[[dtID]] <- renderRHandsontable({
      req(uiTbl[[paste0(divID,"_tbl")]])
      rhandsontable(uiTbl[[paste0(divID,"_tbl")]], useTypes = TRUE)
    })

    # print(btnID)

    # what does input[[dtID]] below do?
    observeEvent(input[[dtID]], {uiTbl[[paste0(divID,"_tbl")]] <- hot_to_r(input[[dtID]])})

    # what does input[[btnID]] below do?
    observeEvent(input[[btnID]],{
      removeUI(selector = paste0("#", divID))
      rv[[divID]] <- NULL
      uiTbl[[paste0(divID,"_tbl")]] <- NULL
    },
    ignoreInit = TRUE,
    once = TRUE
    )
  })

  observe({
    tables_list <- reactiveValuesToList(uiTbl)
    tables_list <- tables_list[order(names(tables_list))]
    table_lengths <- lengths(tables_list)
    cumsum_table_lengths <- cumsum(table_lengths)[table_lengths != 0L]

    for(i in seq_along(cumsum_table_lengths)){
      names(uiTbl[[names(cumsum_table_lengths[i])]]) <- paste("Col", cumsum_table_lengths[i])
    }
  })
}

shinyApp(ui, server)
</code>```

Body:
In the below code, I'm trying to understand what the input[[...]] in the two commented observeEvent() functions do. Could someone please explain?

I'm trying to adapt this code so the function of the individual delete action buttons rendered under each added table can be consolidated into a single selectInput() or selectizeInput() box, showing all tables available for deletion, and then I can remove these individual table delete buttons. I need to understand this input[[...]] part in the below code first, so perhaps I can do the equivalent with selectInput() or selectizeInput(). I've only used input$... before in referring to action buttons or other user input widgets for an observeEvent().

Code:

library(shiny)
library(rhandsontable)

data1 <- data.frame(row.names = c("A","B","C","Sum"),"Col 1"=c(1,1,0,2),check.names=FALSE)

ui <- fluidPage(
  br(),
  actionButton("addTbl","Add table"),
  br(),br(),
  tags$div(id = "placeholder",
           tags$div(
             style = "display: inline-block",
             rHandsontableOutput("hottable1")
           )
  )
)

server <- function(input, output, session) {
  uiTbl <- reactiveValues(div_01_tbl = data1) # mod
  rv <- reactiveValues()

  observeEvent(input$hottable1, {uiTbl$div_01_tbl <- hot_to_r(input$hottable1)}) # mod

  output$hottable1 <- renderRHandsontable({rhandsontable(uiTbl$div_01_tbl, useTypes = TRUE)}) # mod

  observeEvent(input$addTbl, {
    divID <- paste0("div_", if(input$addTbl+1 < 10){"0"},input$addTbl+1) # mod
    dtID <- paste0(divID, "_DT")
    btnID <- paste0(divID, "_rmv")
    uiTbl[[paste0(divID,"_tbl")]] <- data1 # captures initial dataframe values

    insertUI(
      selector = "#placeholder",
      ui = tags$div(
        id = divID,
        style = "display:inline-block;",
        rHandsontableOutput(dtID),
        actionButton(btnID, "Delete", class = "pull-left btn btn-danger"),
      )
    )

    output[[dtID]] <- renderRHandsontable({
      req(uiTbl[[paste0(divID,"_tbl")]])
      rhandsontable(uiTbl[[paste0(divID,"_tbl")]], useTypes = TRUE)
    })

    # print(btnID)

    # what does input[[dtID]] below do?
    observeEvent(input[[dtID]], {uiTbl[[paste0(divID,"_tbl")]] <- hot_to_r(input[[dtID]])})

    # what does input[[btnID]] below do?
    observeEvent(input[[btnID]],{
      removeUI(selector = paste0("#", divID))
      rv[[divID]] <- NULL
      uiTbl[[paste0(divID,"_tbl")]] <- NULL
    },
    ignoreInit = TRUE,
    once = TRUE
    )
  })

  observe({
    tables_list <- reactiveValuesToList(uiTbl)
    tables_list <- tables_list[order(names(tables_list))]
    table_lengths <- lengths(tables_list)
    cumsum_table_lengths <- cumsum(table_lengths)[table_lengths != 0L]

    for(i in seq_along(cumsum_table_lengths)){
      names(uiTbl[[names(cumsum_table_lengths[i])]]) <- paste("Col", cumsum_table_lengths[i])
    }
  })
}

shinyApp(ui, server)


问:
How to pass Dataflow PColl dict into DLP?
I running a Dataflow pipeline where I am reading postgres data via pysql_beam.sql_io.sql.ReadFromSQL, and trying to pass that data into a dataframe. I've been able to get the data into the below format using

```<code>beam.Map(lambda _, dict_iter: pd.DataFrame(dict_iter),dict_iter=beam.pvalue.AsIter(data),)
</code>```

with "data" being my pcoll. The issue is that the rows are being repeated throughout the dataframe, and I'm not sure how keep only the first iteration. Has anyone encountered something like this before? Or is there a better way to go about pulling this data into a dataframe?

Code

```<code>def run():
    pipeline_options = PipelineOptions()
    options = pipeline_options.view_as(SQLOptions)
    with beam.Pipeline(options=options) as p:

        data = (p | ReadFromSQL(host=options.host, port=options.port,
                                        username=options.username,
                                        password=options.password,
                                        database=options.database,
                                        query= f"select name, email, phone, ip_address from {options.source} LIMIT {options.limit}",
                                        wrapper=PostgresWrapper #add notes about wrapper options
                                        )

        values = data | 'Format  data' >> beam.Map(lambda _, dict_iter: pd.DataFrame(dict_iter),dict_iter=beam.pvalue.AsIter(data),)

        values | 'To csv' >> beam.io.WriteToText('file name',
                                        num_shards = 1,
                                        file_name_suffix='.csv',
                                        shard_name_template = ''
                                                   )
</code>```

Note I am trying to get this into a dataframe so that I can run a DLP function on the data, then write to BQ. The DLP function I'm using is

```<code>def dlp_apply(df):

    col_list = ['email', 'phone','ip_address']
    for i in col_list:
        df[(i)]=df.apply(lambda row: deidentify_with_mask(project='project_id',input_str=row[(i)],info_types=info_types) ,axis=1)

    return df
</code>```

The csv output above is just for testing, won't be in the final pipeline.

Input (from ReadFromSQL pcoll, fake data)

```<code>{'name': 'a', 'email': 'k', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'b', 'email': 'l', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'c', 'email': 'm', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'd', 'email': 'n', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'e', 'email': 'o', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'f', 'email': 'p', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'g', 'email': 'q', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'h', 'email': 'r', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'i', 'email': 's', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'j', 'email': 't', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
</code>```

Output

```<code>        name     email   phone            ip_address
0        a       k       111-222-3333     00.0.000.000
1        b       l       111-222-3333     00.0.000.000
2        c       m       111-222-3333     00.0.000.000
3        d       n       111-222-3333     00.0.000.000
4        e       o       111-222-3333     00.0.000.000
5        f       p       111-222-3333     00.0.000.000
6        g       q       111-222-3333     00.0.000.000
7        h       r       111-222-3333     00.0.000.000
8        i       s       111-222-3333     00.0.000.000
9        j       t       111-222-3333     00.0.000.000
        name     email   phone            ip_address
0        a       k       111-222-3333     00.0.000.000
1        b       l       111-222-3333     00.0.000.000
2        c       m       111-222-3333     00.0.000.000
3        d       n       111-222-3333     00.0.000.000
4        e       o       111-222-3333     00.0.000.000
5        f       p       111-222-3333     00.0.000.000
6        g       q       111-222-3333     00.0.000.000
7        h       r       111-222-3333     00.0.000.000
8        i       s       111-222-3333     00.0.000.000
9        j       t       111-222-3333     00.0.000.000
        name     email   phone            ip_address
0        a       k       111-222-3333     00.0.000.000
1        b       l       111-222-3333     00.0.000.000
2        c       m       111-222-3333     00.0.000.000
3        d       n       111-222-3333     00.0.000.000
4        e       o       111-222-3333     00.0.000.000
5        f       p       111-222-3333     00.0.000.000
6        g       q       111-222-3333     00.0.000.000
7        h       r       111-222-3333     00.0.000.000
8        i       s       111-222-3333     00.0.000.000
9        j       t       111-222-3333     00.0.000.000
......
</code>```

Thanks so much for your advice! Happy to provide more detail if needed!

I've been trying to maybe add commas to the end of each line in the input, as I believe that the issue is that each row is being read in as an individual dictionary, but I am looking to see if there are more elegant/best practice solutions instead.

Body:
I running a Dataflow pipeline where I am reading postgres data via pysql_beam.sql_io.sql.ReadFromSQL, and trying to pass that data into a dataframe. I've been able to get the data into the below format using

beam.Map(lambda _, dict_iter: pd.DataFrame(dict_iter),dict_iter=beam.pvalue.AsIter(data),)

with "data" being my pcoll. The issue is that the rows are being repeated throughout the dataframe, and I'm not sure how keep only the first iteration. Has anyone encountered something like this before? Or is there a better way to go about pulling this data into a dataframe?

Code

def run():
    pipeline_options = PipelineOptions()
    options = pipeline_options.view_as(SQLOptions)
    with beam.Pipeline(options=options) as p:

        data = (p | ReadFromSQL(host=options.host, port=options.port,
                                        username=options.username,
                                        password=options.password,
                                        database=options.database,
                                        query= f"select name, email, phone, ip_address from {options.source} LIMIT {options.limit}",
                                        wrapper=PostgresWrapper #add notes about wrapper options
                                        )

        values = data | 'Format  data' >> beam.Map(lambda _, dict_iter: pd.DataFrame(dict_iter),dict_iter=beam.pvalue.AsIter(data),)

        values | 'To csv' >> beam.io.WriteToText('file name',
                                        num_shards = 1,
                                        file_name_suffix='.csv',
                                        shard_name_template = ''
                                                   )

Note I am trying to get this into a dataframe so that I can run a DLP function on the data, then write to BQ. The DLP function I'm using is

def dlp_apply(df):

    col_list = ['email', 'phone','ip_address']
    for i in col_list:
        df[(i)]=df.apply(lambda row: deidentify_with_mask(project='project_id',input_str=row[(i)],info_types=info_types) ,axis=1)

    return df

The csv output above is just for testing, won't be in the final pipeline.

Input (from ReadFromSQL pcoll, fake data)

{'name': 'a', 'email': 'k', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'b', 'email': 'l', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'c', 'email': 'm', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'd', 'email': 'n', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'e', 'email': 'o', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'f', 'email': 'p', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'g', 'email': 'q', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'h', 'email': 'r', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'i', 'email': 's', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}
{'name': 'j', 'email': 't', 'phone': '111-222-3333', 'ip_address': '00.0.000.000'}

Output

        name     email   phone            ip_address
0        a       k       111-222-3333     00.0.000.000
1        b       l       111-222-3333     00.0.000.000
2        c       m       111-222-3333     00.0.000.000
3        d       n       111-222-3333     00.0.000.000
4        e       o       111-222-3333     00.0.000.000
5        f       p       111-222-3333     00.0.000.000
6        g       q       111-222-3333     00.0.000.000
7        h       r       111-222-3333     00.0.000.000
8        i       s       111-222-3333     00.0.000.000
9        j       t       111-222-3333     00.0.000.000
        name     email   phone            ip_address
0        a       k       111-222-3333     00.0.000.000
1        b       l       111-222-3333     00.0.000.000
2        c       m       111-222-3333     00.0.000.000
3        d       n       111-222-3333     00.0.000.000
4        e       o       111-222-3333     00.0.000.000
5        f       p       111-222-3333     00.0.000.000
6        g       q       111-222-3333     00.0.000.000
7        h       r       111-222-3333     00.0.000.000
8        i       s       111-222-3333     00.0.000.000
9        j       t       111-222-3333     00.0.000.000
        name     email   phone            ip_address
0        a       k       111-222-3333     00.0.000.000
1        b       l       111-222-3333     00.0.000.000
2        c       m       111-222-3333     00.0.000.000
3        d       n       111-222-3333     00.0.000.000
4        e       o       111-222-3333     00.0.000.000
5        f       p       111-222-3333     00.0.000.000
6        g       q       111-222-3333     00.0.000.000
7        h       r       111-222-3333     00.0.000.000
8        i       s       111-222-3333     00.0.000.000
9        j       t       111-222-3333     00.0.000.000
......

Thanks so much for your advice! Happy to provide more detail if needed!

I've been trying to maybe add commas to the end of each line in the input, as I believe that the issue is that each row is being read in as an individual dictionary, but I am looking to see if there are more elegant/best practice solutions instead.


问:
How to save div elements in form post
I have a form currently with a text area.

However, I want it to have rich-text formatting (bold, bullet points etc..) and for that, I have found Quill, which is amazing.

I'm not sure how to get the contents of div id=editor and save that to the Django function, because it won't be part of the post, will it?

```<code><link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">

<!-- Create the editor container -->
<div id="editor">
  <p>Hello World!</p>
  <p>Some initial <strong>bold</strong> text</p>
  <p><br></p>
</div>

<!-- Include the Quill library -->
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>

<!-- Initialize Quill editor -->
<script>
  var quill = new Quill('#editor', {
    theme: 'snow'
  });
</script>
</code>```

Title: How to save div elements in form post

Body:
I have a form currently with a text area.

However, I want it to have rich-text formatting (bold, bullet points etc..) and for that, I have found Quill, which is amazing.

I'm not sure how to get the contents of div id=editor and save that to the Django function, because it won't be part of the post, will it?

<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">

Hello World!

Some initial bold text


问:
Working on Chalice project. Running an env.sh shell script won't set env variables, but running `export DB_USERNAME=example` sets it. Why?
I am working on a chalice project. I need to set environment variables locally in order to connect to the DB using peewee.

I wrote a simple shell script called env.sh:

#!/bin/sh

export APP_NAME=example
export DB_HOST=example
export DB_PORT=example
export DB_NAME=example
export DB_USERNAME=example
export DB_PASSWORD=example
```

I expected that running ./env.sh will set all the env variables. But when I execute the chalice application, I get errors indicating that these variables are not defined.

If I go into the terminal and run these commands individually like export APP_NAME=example, the variables are set and the application successfully reads them.

I am using a virtual env with poetry (poetry shell) with python3.9, so it might have to do with that, but I am not sure how to wrap my head around this. I also tried poetry run env.sh and removed the shebang from the top of the script, but none of these worked.

Can you help me figure out why this is happening and how to make that script work?

Body:
I am working on a chalice project. I need to set environment variables locally in order to connect to the DB using peewee.

I wrote a simple shell script called env.sh:

#!/bin/sh

export APP_NAME=example
export DB_HOST=example
export DB_PORT=example
export DB_NAME=example
export DB_USERNAME=example
export DB_PASSWORD=example

I expected that running ./env.sh will set all the env variables. But when I execute the chalice application, I get errors indicating that these variables are not defined.

If I go into the terminal and run these commands individually like export APP_NAME=example, the variables are set and the application successfully reads them.

I am using a virtual env with poetry (poetry shell) with python3.9, so it might have to do with that, but I am not sure how to wrap my head around this. I also tried poetry run env.sh and removed the shebang from the top of the script, but none of these worked.

Can you help me figure out why this is happening and how to make that script work?


问:
Match query with relationship is taking too long to retrieve results does it mean we need to upgrade Neo4j or memory allocated?
I'm trying to understand why below query is taking too long to retrieve results. I have mocked up the values used but the below query is right and is returning 40 records (a node has 8 diff values and z node has 5 diff values so total 40 combinations). It's taking 2.5 min to return those 40 records. Please let me know what the issue is here. I'm suspecting this to be Neo4j version and infrastructure we're using right now in production.

After the below query we have algo.kShortestPaths.stream so the whole thing together is taking more than 5 min. What do you suggest? Is there no other way where we can handle such combinations (a and z node combinations > 40) within 5 min?

Infrastructure details: Neo4j 3.5 community edition

2 separate datacenters, sync job - 64GB mem 16GB CPU 4 cores

Cypher Query:

```<code>MATCH (s:SiteNode {siteName: 'siteName1'})-[rl:CONNECTED_TO]-(a:EquipmentNode)
    WHERE a.locationClli = s.siteName AND toUpper(a.networkType) = 'networkType1' AND NOT (toUpper(a.equipmentTid) CONTAINS 'TEST')
    WITH a.equipmentTid AS tid_A
    MATCH pp = (a:EquipmentNode)-[rel:CONNECTED_TO]-(a1:EquipmentNode)
    WHERE a.equipmentTid = tid_A AND ALL( t IN relationships(pp)
    WHERE t.type IN ['Type1'] AND (t.totalChannels > 0 AND t.totalChannelsUsed < t.totalChannels) AND t.networkId IN ['networkId1'] AND t.status IN ['status1', 'status2'] )
    WITH a
MATCH (d:SiteNode {siteName: 'siteName2'})-[rl:CONNECTED_TO]-(z:EquipmentNode)
    WHERE z.locationClli = d.siteName AND toUpper(z.networkType) = 'networkType2' AND NOT (toUpper(z.equipmentTid) CONTAINS 'TEST')
    WITH z.equipmentTid AS tid_Z, a
    MATCH pp = (z:EquipmentNode)-[rel:CONNECTED_TO]-(z1:EquipmentNode)
    WHERE z.equipmentTid=tid_Z AND ALL(t IN relationships(pp)
    WHERE t.type IN ['Type2'] AND (t.totalChannels > 0 AND t.totalChannelsUsed < t.totalChannels) AND t.networkId IN ['networkId2'] AND t.status IN ['status1', 'status2'])
WITH DISTINCT z, a
return a.equipmentTid, z.equipmentTid
</code>```

This query was built to handle small combinations upto 4 total a and z node combinations but today we might have combinations greater than 10 or 40 or 100 so this is timing out. I'm not sure if there's a better way to write the query to improve performance assuming the community edition is good enough for our case.

Body:
I'm trying to understand why below query is taking too long to retrieve results. I have mocked up the values used but the below query is right and is returning 40 records (a node has 8 diff values and z node has 5 diff values so total 40 combinations). It's taking 2.5 min to return those 40 records. Please let me know what the issue is here. I'm suspecting this to be Neo4j version and infrastructure we're using right now in production.

After the below query we have algo.kShortestPaths.stream so the whole thing together is taking more than 5 min. What do you suggest? Is there no other way where we can handle such combinations (a and z node combinations > 40) within 5 min?

Infrastructure details: Neo4j 3.5 community edition

2 separate datacenters, sync job - 64GB mem 16GB CPU 4 cores

Cypher Query:

MATCH (s:SiteNode {siteName: 'siteName1'})-[rl:CONNECTED_TO]-(a:EquipmentNode)
    WHERE a.locationClli = s.siteName AND toUpper(a.networkType) = 'networkType1' AND NOT (toUpper(a.equipmentTid) CONTAINS 'TEST')
    WITH a.equipmentTid AS tid_A
    MATCH pp = (a:EquipmentNode)-[rel:CONNECTED_TO]-(a1:EquipmentNode)
    WHERE a.equipmentTid = tid_A AND ALL( t IN relationships(pp)
    WHERE t.type IN ['Type1'] AND (t.totalChannels > 0 AND t.totalChannelsUsed < t.totalChannels) AND t.networkId IN ['networkId1'] AND t.status IN ['status1', 'status2'] )
    WITH a
MATCH (d:SiteNode {siteName: 'siteName2'})-[rl:CONNECTED_TO]-(z:EquipmentNode)
    WHERE z.locationClli = d.siteName AND toUpper(z.networkType) = 'networkType2' AND NOT (toUpper(z.equipmentTid) CONTAINS 'TEST')
    WITH z.equipmentTid AS tid_Z, a
    MATCH pp = (z:EquipmentNode)-[rel:CONNECTED_TO]-(z1:EquipmentNode)
    WHERE z.equipmentTid=tid_Z AND ALL(t IN relationships(pp)
    WHERE t.type IN ['Type2'] AND (t.totalChannels > 0 AND t.totalChannelsUsed < t.totalChannels) AND t.networkId IN ['networkId2'] AND t.status IN ['status1', 'status2'])
WITH DISTINCT z, a
return a.equipmentTid, z.equipmentTid

This query was built to handle small combinations upto 4 total a and z node combinations but today we might have combinations greater than 10 or 40 or 100 so this is timing out. I'm not sure if there's a better way to write the query to improve performance assuming the community edition is good enough for our case.


问:
Typescript: Graphql code generator cannot generate types - plugin_helpers_1.DetailedError is not a constructor
I am having trouble generating types with graphql code-gen.

When I try running the generator, I get an error that says:

Generate outputs   ❯ Generate to src/lib/graphql.tsx
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ plugin_helpers_1.DetailedError is not a constructor

In my vscode, a problem is identified as follows:

```<code>Cannot find type definition file for 'express-unless'.
  The file is in the program because:
    Entry point for implicit type library 'express-unless'
</code>```

I have seen this post and have tried deleting my node_modules and yarn.lock and re-installing. I get the same error message and vscode problem when I tried.

I don not know what either of these error messages is trying to communicate. Any ideas on how to solve this issue?

My tsconfig has:

```<code>{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "baseUrl": "./src",
    "paths": {
      "components/*": [
        "components/*"
      ],
      "lib/*": [
        "lib/*"
      ]
    },
    "strictFunctionTypes": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true
  },
  "exclude": [
    "node_modules"
  ],
  "include": [
    "next-env.d.ts",
    "src/**/*.ts",
    "src/**/*.tsx"
  ]
}
</code>```

Body:
I am having trouble generating types with graphql code-gen.

When I try running the generator, I get an error that says:

Generate outputs   ❯ Generate to src/lib/graphql.tsx
✔ Load GraphQL schemas
✔ Load GraphQL documents
✖ plugin_helpers_1.DetailedError is not a constructor

In my vscode, a problem is identified as follows:

Cannot find type definition file for 'express-unless'.
  The file is in the program because:
    Entry point for implicit type library 'express-unless'

I have seen this post and have tried deleting my node_modules and yarn.lock and re-installing. I get the same error message and vscode problem when I tried.

I don not know what either of these error messages is trying to communicate. Any ideas on how to solve this issue?

My tsconfig has:

{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "baseUrl": "./src",
    "paths": {
      "components/*": [
        "components/*"
      ],
      "lib/*": [
        "lib/*"
      ]
    },
    "strictFunctionTypes": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true
  },
  "exclude": [
    "node_modules"
  ],
  "include": [
    "next-env.d.ts",
    "src/**/*.ts",
    "src/**/*.tsx"
  ]
}


问:
How can I overcome "Failed to load model class 'VBoxModel' from module @jupyter-widgets/controls" error?
I am stuck at perhaps a very simple problem but I've searched the internet to no avail.

I am attempting to run the following lines in a jupyter notebook (its connected to a rented GPU):

```<code># Hugging Face Login
from huggingface_hub import notebook_login

notebook_login()
</code>```

and I keep receiving this error:

[Open Browser Console for more detailed log - Double click to close
this message] Failed to load model class 'VBoxModel' from module
'@jupyter-widgets/controls' Error: Module @jupyter-widgets/controls,
version ^1.5.0 is not registered, however,         2.0.0 is
at f.loadClass (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js?v=40eaa5b8e976096d50b2:1:74977)
at f.loadModelClass (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:10729)
at f._make_model (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:7517)
at f.new_model (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:5137)
at f.handle_comm_open (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:3894)
at _handleCommOpen (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js?v=40eaa5b8e976096d50b2:1:73393)
at b._handleCommOpen (https://uaxtfom41wgmr3-8888.proxy.runpod.net/static/lab/jlab_core.4566032f8b9a1bbebc97.js?v=4566032f8b9a1bbebc97:2:1001335)
at async b._handleMessage (https://uaxtfom41wgmr3-8888.proxy.runpod.net/static/lab/jlab_core.4566032f8b9a1bbebc97.js?v=4566032f8b9a1bbebc97:2:1003325)

Body:
I am stuck at perhaps a very simple problem but I've searched the internet to no avail.

I am attempting to run the following lines in a jupyter notebook (its connected to a rented GPU):

# Hugging Face Login
from huggingface_hub import notebook_login

notebook_login()

and I keep receiving this error:

[Open Browser Console for more detailed log - Double click to close
this message] Failed to load model class 'VBoxModel' from module
'@jupyter-widgets/controls' Error: Module @jupyter-widgets/controls,
version ^1.5.0 is not registered, however,         2.0.0 is
at f.loadClass (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js?v=40eaa5b8e976096d50b2:1:74977)
at f.loadModelClass (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:10729)
at f._make_model (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:7517)
at f.new_model (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:5137)
at f.handle_comm_open (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/150.b0e841b75317744a7595.js?v=b0e841b75317744a7595:1:3894)
at _handleCommOpen (https://uaxtfom41wgmr3-8888.proxy.runpod.net/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.40eaa5b8e976096d50b2.js?v=40eaa5b8e976096d50b2:1:73393)
at b._handleCommOpen (https://uaxtfom41wgmr3-8888.proxy.runpod.net/static/lab/jlab_core.4566032f8b9a1bbebc97.js?v=4566032f8b9a1bbebc97:2:1001335)
at async b._handleMessage (https://uaxtfom41wgmr3-8888.proxy.runpod.net/static/lab/jlab_core.4566032f8b9a1bbebc97.js?v=4566032f8b9a1bbebc97:2:1003325)