files to edit to achieve custom transport

Hardware description:  NUCLEO_F446RE
RTOS: FreeRTOS
Installation type: micro_ros_setup
Version or commit hash: ROS2 foxy

Hi!
I'm trying to use CAN bus for custom transport. I read  the tutorial about micro ros custom transport and this thread(#206) but i'm having problems to navigate the directory created from tutorial. For my understanding to obtain a custom transport you need to:

modify the transport in the board
in <work_dir>/firmware/freertos_apps/microros_nucleo_f446re_expansions , here you need to change in the ./core/src/microros_transports.c the transport method, add in my case can.c and can.h and modify the .ioc accordingly.

change client transport
in <work_dir>/firmware/mcu_ws/eProsima change custom_transport.c/.h and in the CMakeLists.txt enable custom transport.

-change agent transport
in <work_dir>/src/eProsoma/Micro-XRCEE-DDS-Agent change transport/custom/CustomAgent.cpp modify init/fini/recv_message/send_message.
Am i right or i need to change something else? And i need to create a main.c like the examples in the directories or it does everthing on his own?
Thanks for your help.

This is the old way of modifiying transports, in order to apply a custom transport just:

Enable it in the colcon meta client
Enable it in the colcon meta rmw
Write your transport functions
Use the RMW API to set the transport callbacks at runtime

Regarding the agent side, maybe @Acuadros95 can tell us some more details.

To implement your custom Agent follow the steps from the provided example: link
You have to implemente the following function prototypes for your transport:

eprosima::uxr::CustomAgent::InitFunction
eprosima::uxr::CustomAgent::FiniFunction
eprosima::uxr::CustomAgent::RecvMsgFunction
eprosima::uxr::CustomAgent::SendMsgFunction

Then, define a custom endpoint to identify each client:

eprosima::uxr::CustomEndPoint

With these definitions, you can generate your custom Agent using the constructor of eprosima::uxr::CustomAgent custom_agent.
All of these steps are present on the example main function, feel free to come back if any specific problem arises.

Thank you very much for the fast answer, i try to implement all as you suggested. For now i'll close the thread.

hi again, i'm having problems with the client. The function rclc_support_init stops the program. I read the thread  https://github.com/micro-ROS/micro_ros_setup/issues/281 and https://github.com/micro-ROS/micro_ros_setup/issues/277 but
didn't find a solution. I think the problem could be in the colcon.meta:
  "names": {
        "tracetools": {
            "cmake-args": [
                "-DTRACETOOLS_DISABLED=ON",
                "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
            ]
        },
        "rcutils": {
            "cmake-args": [
                "-DENABLE_TESTING=OFF",
                "-DRCUTILS_NO_FILESYSTEM=ON",
                "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON",
                "-DRCUTILS_NO_64_ATOMIC=ON"
            ]
        },
        "microxrcedds_client": {
            "cmake-args": [
                "-DUCLIENT_PIC=OFF",
                "-DUCLIENT_PROFILE_DISCOVERY=OFF",
                "-DUCLIENT_PROFILE_UDP=OFF",
                "-DUCLIENT_PROFILE_CUSTOM_TRANSPORT=ON",
                "-DUCLIENT_PROFILE_SERIAL=OFF",
                "-DUCLIENT_PROFILE_TCP=OFF"
            ]
        },
        "rmw_microxrcedds": {
            "cmake-args": [
                "-DRMW_UXRCE_XML_BUFFER_LENGTH=400",
                "-DRMW_UXRCE_TRANSPORT=custom",
                "-DRMW_UXRCE_MAX_NODES=1",
                "-DRMW_UXRCE_MAX_PUBLISHERS=1",
                "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=1",
                "-DRMW_UXRCE_MAX_SERVICES=0",
                "-DRMW_UXRCE_MAX_CLIENTS=0",
                "-DRMW_UXRCE_MAX_HISTORY=2"
            ]
        },
        "tracetools": {
            "cmake-args": [
                "-DTRACETOOLS_DISABLED=ON",
                "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
            ]
        }
    }
}

or the way i've build and flash the system. I've done it through STM32cubeIDE following https://github.com/micro-ROS/micro_ros_stm32cubemx_utils. I've also tryied with  ros2 run micro_ros_setup configure_firmware.sh int32_publisher --transport serial but dind't work.
Thanks for the help.

hi again, i'm having problems with the client. The function rclc_support_init stops the program. I read the thread #281 and #277 but
didn't find a solution. I think the problem could be in the colcon.meta:
  "names": {
        "tracetools": {
            "cmake-args": [
                "-DTRACETOOLS_DISABLED=ON",
                "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
            ]
        },
        "rcutils": {
            "cmake-args": [
                "-DENABLE_TESTING=OFF",
                "-DRCUTILS_NO_FILESYSTEM=ON",
                "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON",
                "-DRCUTILS_NO_64_ATOMIC=ON"
            ]
        },
        "microxrcedds_client": {
            "cmake-args": [
                "-DUCLIENT_PIC=OFF",
                "-DUCLIENT_PROFILE_DISCOVERY=OFF",
                "-DUCLIENT_PROFILE_UDP=OFF",
                "-DUCLIENT_PROFILE_CUSTOM_TRANSPORT=ON",
                "-DUCLIENT_PROFILE_SERIAL=OFF",
                "-DUCLIENT_PROFILE_TCP=OFF"
            ]
        },
        "rmw_microxrcedds": {
            "cmake-args": [
                "-DRMW_UXRCE_XML_BUFFER_LENGTH=400",
                "-DRMW_UXRCE_TRANSPORT=custom",
                "-DRMW_UXRCE_MAX_NODES=1",
                "-DRMW_UXRCE_MAX_PUBLISHERS=1",
                "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=1",
                "-DRMW_UXRCE_MAX_SERVICES=0",
                "-DRMW_UXRCE_MAX_CLIENTS=0",
                "-DRMW_UXRCE_MAX_HISTORY=2"
            ]
        },
        "tracetools": {
            "cmake-args": [
                "-DTRACETOOLS_DISABLED=ON",
                "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
            ]
        }
    }
}

or the way i've build and flash the system. I've done it through STM32cubeIDE following https://github.com/micro-ROS/micro_ros_stm32cubemx_utils. I've also tryied with ros2 run micro_ros_setup configure_firmware.sh int32_publisher --transport serial but dind't work.
Thanks for the help.

Please debug and tell us where (in which line) is the system stopping. Since rclc_support_init calls your custom transports, check that there is no problem in those transports.

thank you for the answer. I think the problem is in the connection between agent and client. The client after the reset sends 31 bytes but agent after  the init tries to read 41 bytes. Is it the right behavior?
The frame sends by the client is :
can0  001   [7]  7E 00 00 18 00 80 00
can0  001   [8]  00 00 00 01 10 00 58 52
can0  001   [8]  43 45 01 00 01 0F 58 51

Yes, your custom transports are not behaving correctly. Maybe you want to share them and we can take a look.

So for the client i've used the example on STM32F446re repository and set the custom transport with
rmw_uros_set_custom_transport(
	    true, // with CAN2.0 8 B payload
	    (void *) &hcan1,
		freertos_custom_open,
		freertos_custom_close,
		freertos_custom_write,
		freertos_custom_read);

and for the write i send framed packet of CAN message with the last of variable length(i've made a change from the last message).
	cycle=len/8;
	rest=len%8;

	for(cycle;cycle>0;cycle--){
		pHeader.DLC = 8;
		ret = HAL_CAN_AddTxMessage( can, &pHeader, ptr , &pTxMailbox );
		if (ret == HAL_OK)  write += 8;
		ptr += 8;
	}
	if (rest!=0){
		pHeader.DLC = rest;
		ret = HAL_CAN_AddTxMessage( can, &pHeader, ptr , &pTxMailbox );
		if (ret == HAL_OK)  write += rest;
	}

        return (ret == HAL_OK && write==len) ? write : 0;
   }

Please share the whole code of the custom transports.

I've fixed with adding while(HAL_CAN_IsTxMessagePending(can,pTxMailbox)); after the addTxMesssage. Btw i don't understand where the issue is. The byte sent by client is the same and the requested byte are still 41 but with this line the session works.

Ok, closing

hi again,
so i've tested a bit and found a  problem in deserialization. The log from client is:
[1631689648.254658] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 6
[1631689648.254728] info     | custom_agent.cpp   | operator()               | This is an example of a custom Micro XRCE-DDS Agent INIT function | fd: 3
[1631689648.254733] info     | CustomAgent.cpp    | init                     | Custom agent status: opened | CAN_BUS agent running
[1631689653.171288] debug    | CustomAgent.cpp    | recv_message             | [==>> CAN_BUS <<==]    | client_key: 0x00000000, len: 24, data:
0000: 80 00 00 00 00 01 10 00 58 52 43 45 01 00 01 0F 58 51 F4 2D 81 00 FC 01
[1631689653.171590] info     | Root.cpp           | create_client            | create                 | client_key: 0x5851F42D, session_id: 0x81
[1631689653.171678] info     | SessionManager.hpp | establish_session        | session established    | client_key: 0x1481765933, address: ID: 1
[1631689653.171912] debug    | CustomAgent.cpp    | send_message             | [** <<CAN_BUS>> **]    | client_key: 0x5851F42D, len: 19, data:
0000: 81 00 00 00 04 01 0B 00 00 00 58 52 43 45 01 00 01 0F 00
[1631689655.452818] debug    | CustomAgent.cpp    | recv_message             | [==>> CAN_BUS <<==]    | client_key: 0x5851F42D, len: 24, data:
0000: 80 00 00 00 00 01 10 00 58 52 43 45 01 00 01 0F 58 51 F4 2D 81 00 FC 01
[1631689655.452981] info     | SessionManager.hpp | establish_session        | session re-established | client_key: 0x1481765933, address: ID: 1
[1631689655.453153] debug    | CustomAgent.cpp    | send_message             | [** <<CAN_BUS>> **]    | client_key: 0x5851F42D, len: 19, data:
0000: 81 00 00 00 04 01 0B 00 00 00 58 52 43 45 01 00 01 0F 00
[1631689658.460079] error    | InputMessage.cpp   | log_error                | deserialization error  | buffer:
[1631689658.460159] debug    | CustomAgent.cpp    | recv_message             | [==>> CAN_BUS <<==]    | client_key: 0x5851F42D, len: 0, data:
[1631689660.461112] error    | InputMessage.cpp   | log_error                | deserialization error  | buffer:
[1631689660.461183] debug    | CustomAgent.cpp    | recv_message             | [==>> CAN_BUS <<==]    | client_key: 0x5851F42D, len: 0, data:

In this moment the client sends 42 bytes to initialize a node.
The client main is the same of the example;
	rv = rmw_uros_set_custom_transport(
	    true,
	    (void *) &hcan1,
		freertos_serial_open,
		freertos_serial_close,
		freertos_serial_write,
		freertos_serial_read);

	rcl_allocator_t freeRTOS_allocator = rcutils_get_zero_initialized_allocator();

	freeRTOS_allocator.allocate = microros_allocate;
	freeRTOS_allocator.deallocate = microros_deallocate;
	freeRTOS_allocator.reallocate = microros_reallocate;
	freeRTOS_allocator.zero_allocate =  microros_zero_allocate;

	if (!rcutils_set_default_allocator(&freeRTOS_allocator)) {
	      printf("Error on default allocators (line %d)\n", __LINE__);
	  }

        allocator = rcl_get_default_allocator();
	rclc_support_init(&support, 0, NULL, &allocator);
	rclc_node_init_default(&node, "cubemx_node", "", &support);

The agent tries to read only 41 bytes and i think for this reason make a deserialization error. The agent receive is:
        uint8_t* ptr = buffer;
        uint8_t cycle = buffer_length/8;
        uint8_t rest = buffer_length%8;
        for(uint8_t cycle;cycle>0;cycle--){
             read(poll_fd.fd,&frame,sizeof(struct can_frame));
            memcpy(ptr,&(frame.data),8);
            ptr += 8;
            rv += 8;
        }
        if(rest!=0){
            read(poll_fd.fd,&frame,sizeof(struct can_frame));
            memcpy(ptr,&(frame.data),rest);
            rv += rest;
       }
       source_endpoint->set_member_value<uint32_t>("ID",frame.ID);
       return rv;
      }

Thank you for the help.

Please share the whole code of the custom transports and your main application.

The main application is:
uint8_t rv;
	rv = rmw_uros_set_custom_transport(
	    true,
	    (void *) &hcan1,
		freertos_serial_open,
		freertos_serial_close,
		freertos_serial_write,
		freertos_serial_read);

	rcl_allocator_t freeRTOS_allocator = rcutils_get_zero_initialized_allocator();

	freeRTOS_allocator.allocate = microros_allocate;
	freeRTOS_allocator.deallocate = microros_deallocate;
	freeRTOS_allocator.reallocate = microros_reallocate;
	freeRTOS_allocator.zero_allocate =  microros_zero_allocate;

	if (!rcutils_set_default_allocator(&freeRTOS_allocator)) {
	      printf("Error on default allocators (line %d)\n", __LINE__);
	  }

	  rcl_publisher_t publisher;
	  std_msgs__msg__Int32 msg;
	  rclc_support_t support;
	  rcl_allocator_t allocator;
	  rcl_node_t node;

	  allocator = rcl_get_default_allocator();

	rclc_support_init(&support, 0, NULL, &allocator);

	// create node
	rclc_node_init_default(&node, "cubemx_node", "", &support);

	// create publisher
	rclc_publisher_init_default(
	   &publisher,
	   &node,
	   ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
	   "cubemx_publisher");

	  msg.data = 0;
  /* Infinite loop */
  for(;;)
  {
	  rcl_ret_t ret = rcl_publish(&publisher, &msg, NULL);
	      if (ret != RCL_RET_OK)
	      {
	        printf("Error publishing (line %d)\n", __LINE__);
	      }

	      msg.data++;
	      osDelay(1000);
  }
  /* USER CODE END 5 */
}

The client custom transport is
#include <uxr/client/transport.h>

#include <rmw_microxrcedds_c/config.h>

#include "main.h"
#include "cmsis_os.h"

#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>

#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_can.h"

#ifdef RMW_UXRCE_TRANSPORT_CUSTOM

// --- micro-ROS Transports ---
#define UART_DMA_BUFFER_SIZE 256

static uint8_t can_buffer[UART_DMA_BUFFER_SIZE];
static size_t can_head = 0, can_tail = 0;
static uint8_t free_level=0;
bool freertos_serial_open(struct uxrCustomTransport * transport){
    CAN_HandleTypeDef * can = (CAN_HandleTypeDef*) transport->args;

    HAL_CAN_Start(can);

    CAN_FilterTypeDef CAN_FilterInitStructure;
    //multi-client error?
    CAN_FilterInitStructure.FilterMode = CAN_FILTERMODE_IDMASK;
    CAN_FilterInitStructure.FilterScale = CAN_FILTERSCALE_32BIT;
    CAN_FilterInitStructure.FilterIdHigh = 0x0000;
    CAN_FilterInitStructure.FilterIdLow = 0x0000;
    CAN_FilterInitStructure.FilterMaskIdHigh = 0x0000;
    CAN_FilterInitStructure.FilterMaskIdLow = 0x0000;
    CAN_FilterInitStructure.FilterFIFOAssignment = CAN_FilterFIFO0;
    CAN_FilterInitStructure.FilterActivation = ENABLE;
    CAN_FilterInitStructure.FilterBank = 16;
    CAN_FilterInitStructure.SlaveStartFilterBank = 0;
    HAL_CAN_ConfigFilter( can, &CAN_FilterInitStructure );
    HAL_CAN_ActivateNotification( transport->args, CAN_IT_RX_FIFO0_MSG_PENDING | CAN_IT_TX_MAILBOX_EMPTY );

    return true;
}

bool freertos_serial_close(struct uxrCustomTransport * transport){
    CAN_HandleTypeDef * can = (CAN_HandleTypeDef*) transport->args;
    HAL_CAN_Stop(can);
    return true;
}

size_t freertos_serial_write(struct uxrCustomTransport* transport, const uint8_t * buf, size_t len, uint8_t * err){
    CAN_HandleTypeDef * can = (CAN_HandleTypeDef*) transport->args;

    HAL_StatusTypeDef ret = HAL_ERROR;
    CAN_TxHeaderTypeDef pHeader;
    size_t write=0;
    uint8_t * ptr = buf;
    uint32_t pTxMailbox;
    uint8_t cycle,rest;
    pHeader.StdId = 0X01;//rendere modulare
    pHeader.ExtId = 0X01;
    pHeader.IDE = CAN_ID_STD;
    pHeader.RTR = CAN_RTR_DATA;
    pHeader.TransmitGlobalTime = 1;

	cycle=len/8;
	rest=len%8;

	for(cycle;cycle>0;cycle--){
		pHeader.DLC = 8;
		free_level ++;
		ret = HAL_CAN_AddTxMessage( can, &pHeader, ptr , &pTxMailbox );
		while(free_level==3);
		//while(HAL_CAN_IsTxMessagePending(can,pTxMailbox));
		if (ret == HAL_OK)  write += 8;
		ptr += 8;
	}
	if (rest!=0){
		pHeader.DLC = rest;
		free_level ++;
		ret = HAL_CAN_AddTxMessage( can, &pHeader, ptr , &pTxMailbox );
		while(free_level==3);
		//while(HAL_CAN_IsTxMessagePending(can,pTxMailbox));
		if (ret == HAL_OK)  write += rest;
	}
	while(free_level!=0);
        return (ret == HAL_OK && write==len) ? write : 0;
   }

size_t freertos_serial_read(struct uxrCustomTransport* transport, uint8_t* buf, size_t len, int timeout, uint8_t* err){

    CAN_HandleTypeDef * can = (CAN_HandleTypeDef*) transport->args;

    size_t wrote = 0;
    while ((can_head != can_tail) && (wrote < len)){
        buf[wrote] = can_buffer[can_head];
        can_head = (can_head + 1) % UART_DMA_BUFFER_SIZE;
        wrote++;
    }
    HAL_Delay(1000);
    return wrote;
}

void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan){

CAN_RxHeaderTypeDef RxHeader;
uint8_t data[8];
uint32_t index;

HAL_CAN_GetRxMessage(hcan, CAN_RX_FIFO0, &RxHeader, data);

for(index=0;index<RxHeader.DLC;index++){
can_buffer[can_tail]=data[index];
can_tail ++;
}

}

void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan){
	if(free_level>0) free_level --;
}

void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan){
	if(free_level>0) free_level --;
}

void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan){
	if(free_level>0) free_level --;
}

The agent custom is:
#include <uxr/agent/transport/custom/CustomAgent.hpp>
#include <uxr/agent/transport/endpoint/CustomEndPoint.hpp>

#include <poll.h>
#include <sys/socket.h>
#include <unistd.h>
#include <signal.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#include <linux/can/raw.h>
#include <boost/asio.hpp>
/**
 * This custom XRCE Agent example attempts to show how easy is for the user to define a custom
 * Micro XRCE-DDS Agent behaviour, in terms of transport initialization and closing, and also
 * regarding read and write operations.
 * For this simple case, an UDP socket is opened on port 8888. Additionally, some information
 * messages are being printed to demonstrate the custom behaviour.
 * As the endpoint is already defined, we are using the provided
 * `eprosima::uxr::IPv4EndPoint` by the library.
 * Other transport protocols might need to implement their own endpoint struct.
 */

int main(int argc, char** argv)
{
    eprosima::uxr::Middleware::Kind mw_kind(eprosima::uxr::Middleware::Kind::FASTDDS);
    struct pollfd poll_fd;

    /**
     * @brief Agent's initialization behaviour description.
     */
    eprosima::uxr::CustomAgent::InitFunction init_function = [&]() -> bool
    {
        struct sockaddr_can addr;
        struct can_frame frame;
        struct can_frame rec_frame;
        struct ifreq ifr;

        bool rv = false;
        poll_fd.fd = socket(PF_CAN, SOCK_RAW, CAN_RAW);

        if (-1 != poll_fd.fd)
        {
            struct sockaddr_in address{};

            strcpy(ifr.ifr_name, "can0");
            ioctl(poll_fd.fd, SIOCGIFINDEX, &ifr);

            addr.can_family  = AF_CAN;
            addr.can_ifindex = ifr.ifr_ifindex;

            if (-1 != bind(poll_fd.fd,
                           (struct sockaddr *)&addr,
                           sizeof(addr)))
            {
                poll_fd.events = POLLIN;
                rv = true;

                UXR_AGENT_LOG_INFO(
                    UXR_DECORATE_GREEN(
                        "This is an example of a custom Micro XRCE-DDS Agent INIT function"),
                    "fd: {}",
                    poll_fd.fd);
            }
        }

        return rv;
    };

    /**
     * @brief Agent's destruction actions.
     */
    eprosima::uxr::CustomAgent::FiniFunction fini_function = [&]() -> bool
    {
        if (-1 == poll_fd.fd)
        {
            return true;
        }

        if (0 == close(poll_fd.fd))
        {
            poll_fd.fd = -1;

            UXR_AGENT_LOG_INFO(
                UXR_DECORATE_GREEN(
                    "This is an example of a custom Micro XRCE-DDS Agent FINI function"),
                "fd: {}",
                poll_fd.fd);

            return true;
        }
        else
        {
            return false;
        }
    };

    /**
     * @brief Agent's incoming data functionality.
     */
    eprosima::uxr::CustomAgent::RecvMsgFunction recv_msg_function = [&](
            eprosima::uxr::CustomEndPoint* source_endpoint,
            uint8_t* buffer,
            size_t buffer_length,
            int timeout,
            eprosima::uxr::TransportRc& transport_rc) -> ssize_t
    {
        struct can_frame frame;
        uint8_t cycle,rest;

        uint8_t support[100];
        uint8_t index=0;
        uint16_t rv=0;
        uint8_t i;
        uint16_t ret;

        uint8_t* ptr = buffer;
        cycle = buffer_length/8;
        rest = buffer_length%8;
        for(cycle;cycle>0;cycle--){
            read(poll_fd.fd,&frame,sizeof(struct can_frame));
            memcpy(ptr,&(frame.data),8);
            ptr += 8;
            rv += 8;
        }
        if(rest!=0){
            read(poll_fd.fd,&frame,sizeof(struct can_frame));
            memcpy(ptr,&(frame.data),rest);
            rv += rest;
            }
        source_endpoint->set_member_value<uint32_t>(IDsource_endpoint->set_member_value<uint32_t>("ID",frame.can_id));
        return rv;

    };

    /**
     * @brief Agent's outcoming data flow definition.
     */
    eprosima::uxr::CustomAgent::SendMsgFunction send_msg_function = [&](
        const eprosima::uxr::CustomEndPoint* destination_endpoint,
        uint8_t* buffer,
        size_t message_length,
        eprosima::uxr::TransportRc& transport_rc) -> ssize_t
    {

        struct can_frame frame;
        ssize_t byte_sent = 0;
        uint8_t cycle,rest;
        uint8_t* ptr = buffer;
        int rv;
        //frame.can_id = frame.can_id | (destination_endpoint->get_addr());
        frame.can_id = frame.can_id = destination_endpoint->get_member<uint32_t>("ID");
        frame.can_id = frame.can_id | (0 << 29); //data frame
        frame.can_id = frame.can_id | (0 << 30); //standard
        frame.can_id = frame.can_id | (0 << 31); // 11 bit ID

        cycle=message_length / 8;
	    rest=message_length % 8;

	for(cycle;cycle>0;cycle--){
		frame.can_dlc = 8;
        memcpy(&(frame.data),ptr,frame.can_dlc);
		rv = write(poll_fd.fd,&frame,sizeof(struct can_frame));

		if (rv != -1)  byte_sent += 8;
		ptr += 8;
	}
	if (rest!=0){
		frame.can_dlc = rest;
        memcpy(&(frame.data),ptr,frame.can_dlc);
		rv = write(poll_fd.fd,&frame,sizeof(can_frame));
		if (rv != -1)  byte_sent += rest;
	}

        return byte_sent;
    };

    /**
     * Run the main application.
     */
    try
    {
        /**
         * EndPoint definition for this transport. We define an address and a port.
         */
        eprosima::uxr::CustomEndPoint custom_endpoint;
        custom_endpoint.add_member<uint32_t>("ID");
        /**
         * Create a custom agent instance.
         */
        eprosima::uxr::CustomAgent custom_agent(
            "CAN_BUS",
            &custom_endpoint,
            mw_kind,
            true,
            init_function,
            fini_function,
            send_msg_function,
            recv_msg_function);

        /**
         * Set verbosity level
         */
        custom_agent.set_verbose_level(6);

        /**
         * Run agent and wait until receiving an stop signal.
         */
        custom_agent.start();

        int n_signal = 0;
        sigset_t signals;
        sigwait(&signals, &n_signal);

        /**
         * Stop agent, and exit.
         */
        custom_agent.stop();
        return 0;
    }
    catch (const std::exception& e)
    {
        std::cout << e.what() << std::endl;
        return 1;
    }
}

When using framing in a micro-ROS transport the behaviour of the callbacks are:

In write callbacks: send up to len B from buf and return the number of Bytes that you had been able to send. You don't need to send whole len Bytes. In this case, you can send the 8 B that fits in the CAN payload. One restriction is that the library will keep trying to send a frame thought the write callback if it returns 1 or more. If the callback is not able to send al least 1 B of len the library will understand this as failure.

In read callbacks: you have timeout ms to receive up to len Bytes and write them in buf. But you can receive less and return the number of Bytes received.

Check my comments in your log:
[1631689648.254658] info     | Root.cpp           | set_verbose_level        | logger setup           | verbose_level: 6
[1631689648.254728] info     | custom_agent.cpp   | operator()               | This is an example of a custom Micro XRCE-DDS Agent INIT function | fd: 3
[1631689648.254733] info     | CustomAgent.cpp    | init                     | Custom agent status: opened | CAN_BUS agent running
// Here the client writes 24 B to init a XRCE session
[1631689653.171288] debug    | CustomAgent.cpp    | recv_message             | [==>> CAN_BUS <<==]    | client_key: 0x00000000, len: 24, data:
0000: 80 00 00 00 00 01 10 00 58 52 43 45 01 00 01 0F 58 51 F4 2D 81 00 FC 01
[1631689653.171590] info     | Root.cpp           | create_client            | create                 | client_key: 0x5851F42D, session_id: 0x81
// The agent receives them correctly and creates a XRCE session
[1631689653.171678] info     | SessionManager.hpp | establish_session        | session established    | client_key: 0x1481765933, address: ID: 1
// The agent answer the sesion creation request with 19 B
[1631689653.171912] debug    | CustomAgent.cpp    | send_message             | [** <<CAN_BUS>> **]    | client_key: 0x5851F42D, len: 19, data:
0000: 81 00 00 00 04 01 0B 00 00 00 58 52 43 45 01 00 01 0F 00
// Ans here the client tries to create a session one more time with 24 B. Has the client received the confirmation from the agent?
[1631689655.452818] debug    | CustomAgent.cpp    | recv_message             | [==>> CAN_BUS <<==]    | client_key: 0x5851F42D, len: 24, data:
0000: 80 00 00 00 00 01 10 00 58 52 43 45 01 00 01 0F 58 51 F4 2D 81 00 FC 01
// The agent regenerates the session as requested
[1631689655.452981] info     | SessionManager.hpp | establish_session        | session re-established | client_key: 0x1481765933, address: ID: 1
// And send the session confirmation again
[1631689655.453153] debug    | CustomAgent.cpp    | send_message             | [** <<CAN_BUS>> **]    | client_key: 0x5851F42D, len: 19, data:
0000: 81 00 00 00 04 01 0B 00 00 00 58 52 43 45 01 00 01 0F 00
[1631689658.460079] error    | InputMessage.cpp   | log_error                | deserialization error  | buffer:
// Here the canbus receiver in the agent has returned a 0 lenght, have you set transport_rc?
[1631689658.460159] debug    | CustomAgent.cpp    | recv_message             | [==>> CAN_BUS <<==]    | client_key: 0x5851F42D, len: 0, data:
[1631689660.461112] error    | InputMessage.cpp   | log_error                | deserialization error  | buffer:
[1631689660.461183] debug    | CustomAgent.cpp    | recv_message             | [==>> CAN_BUS <<==]    | client_key: 0x5851F42D, len: 0, data:

So, answering your question, those 40 and 41 that you are mentioning are just:

the number of bytes that the library wants to send (in the tx callback), and you can send less.
the number of bytes that the library can receive, but you can read less.

In the case of the agent, if you read 0 data, you have to set transport_rc.
One approach that I would take is to handle an only CAN message each time in the tx/rx callbacks
Maybe @Acuadros95 can add something else.

I think this is the most relevant part in your case:

* In **read callbacks**: you have `timeout` ms to receive up to `len` Bytes and write them in `buf`. But you can receive less and return the number of Bytes received.

You should use the timeout in both of your read functions, but focus on the Agent side first.
As @pablogs9  explained. the read function should try to read up to len bytes and return the actual data length when the timeout is completed, check this custom read function which takes the timeout into consideration: link

Ok i changed all the function and i think i'm almost fine. I have only a issue when create participant. I get the message but get DDS error. The log is
 [1631775217.406482] debug    | CustomAgent.cpp    | recv_message             | [==>> CAN_BUS <<==]    | client_key: 0x5851F42D, len: 44, data:
0000: 81 80 00 00 01 07 22 00 00 0A 00 01 01 03 00 00 14 00 00 00 00 01 00 00 0C 00 00 00 63 75 62 65
0020: 6D 78 5F 6E 6F 64 65 00 00 00 00 00
[1631775217.406782] debug    | ProxyClient.cpp    | create_participant       | DDS error              | client_key: 0x5851F42D, participant_id: 0x000(1)

Thank you very much for the support.

How are you running the agent? copy here the command.
Also, do you have a recent version of the agent and client libraries?

eprosima::uxr::CustomAgent::SendMsgFunction send_msg_function = [&](
const eprosima::uxr::CustomEndPoint* destination_endpoint,
uint8_t* buffer,
size_t message_length,
eprosima::uxr::TransportRc& transport_rc) -> ssize_t
{
    struct can_frame frame;
    int rv;
    static uint8_t byte_write=0;
    UXR_AGENT_LOG_INFO(UXR_DECORATE_BLUE("Byte"),"to write: {}",message_length);
    frame.can_id = frame.can_id = destination_endpoint->get_member<uint32_t>("ID");
    frame.can_id = frame.can_id | (0 << 29); //data frame
    frame.can_id = frame.can_id | (0 << 30); //standard
    frame.can_id = frame.can_id | (0 << 31); // 11 bit ID
    static uint8_t index=0;
    static uint8_t* ptr = buffer;

    if(index == 0 && ptr != buffer) ptr = buffer;

    if(message_length-index>=8){
	    frame.can_dlc = 8;
        memcpy(frame.data,ptr,frame.can_dlc);
	    rv = write(poll_fd.fd,&frame,sizeof(struct can_frame));
        byte_write = 8;
        index += 8;
        ptr += 8;

    }

    else{
	    frame.can_dlc = message_length-index;
        memcpy(frame.data,ptr,frame.can_dlc);
	    rv = write(poll_fd.fd,&frame,sizeof(struct can_frame));
        byte_write = frame.can_dlc;
        index += frame.can_dlc;
        ptr += frame.can_dlc;
    }
    usleep(100);
    if(index == message_length) index = 0;
     UXR_AGENT_LOG_INFO(UXR_DECORATE_BLUE("Byte"),"to write: {}",frame.can_dlc);

    //if(rv!=-1) byte_write = frame.can_dlc;
    //transport_rc = eprosima::uxr::TransportRc::ok;

return byte_write;

}
I've tried to send only up to byte but if i don't receive all the byte requested give me error that the bytes read are 0.

The DDS error is related to the interaction between the Agent and ROS2 middleware.
Which branch and commit of the agent are you using to build your custom agent?

If you receive 0 bytes you should also set transport_rc =  eprosima::uxr::TransportRc::timeout_error

https://github.com/micro-ROS/micro-ROS-Agent/tree/foxy i use this.


Fix senior lesson.

@khirayama  I have completed the review. Please, confirm comments.

I think it's all correct :+1:

Fix them!

merged!
I guess you can merge this repository. you are contributor.

I guess you can merge this repository. you are contributor.

All right.
Next it will do so.


CodeBuild role policy needs SSM and CFN permissions

CodeBuild role policy used in the pipeline needs arn:aws:iam::aws:policy/AmazonSSMReadOnlyAccess and arn:aws:iam::aws:policy/AWSCloudFormationReadOnlyAccess bc archer CLI needs access to these services while it runs in the Build stage.

I added:
AmazonSSMReadOnlyAccess, AWSCloudFormationReadOnlyAccess and ECR push permissions.


Add per-exception handling configuration

This PR solves two problems.
Rather than get thousands of 404 emails every day aimed at wp-admin.php and such, I decided to add some options to direct handling of these errors.
In the case that the canned exception layout isn't desired, a layout must be supplied for each status code. Hardcoding the same thing for each status code didn't seem quite right, nor was I interested in getting bogged down with which HTTP codes are kosher to ignore. I initially handled this by configuring with Hash[*(500..599).map{|x| [x, nil] }.flatten] but that's not the right way to handle this either.
My solution is to move away from the layouts config option and rename it to exceptions (I'm happy to call this anything else too) in order to provide a place that each status code can be configured to be handled differently. For example, I want 500 errors delivered, with my 'something_broke' layout, but I don't want notification of 404 errors unless they are an image:
config.exception_handler = {
    email<EMAIL_ADDRESS>    exceptions: {
        :all => { layout: 'something_broke' },
         404  => {
            deliver: proc {|e| e.request.original_fullpath =~ /jpg|png/ },
         },
    }
}

Tests were performed, but I didn't see any test suite in the repo so I wasn't able to write any. I also gave a quick glance at the 0.8 branch and saw that the configuration options look unchanged, so hopefully this is simple enough to apply there as well.

Thanks for the update, let me have a look into this

In the case that the canned exception layout isn't desired, a layout must be supplied for each status code. Hardcoding the same thing for each status code didn't seem quite right.

Agreed (originally considered this).
The only issue I had is that the entire system is based around HTTP_STATUS_CODES.
This meant that I had to ensure that all codes could be represented. Although I personally wanted a simple way to switch 40x and 50x errors, I felt it appropriate to make the system as granular as possible.
--

My solution is to move away from the layouts config option and rename it to exceptions

Good idea, especially considering the different functionality you're proposing.
In terms of the use value of this, I am seeing that you're looking at including several options within each HTTP error (layout + deliver). The deliver thing maybe. You're basically doing a per-error bool on whether reports should be sent to the listed email. You'd be better calling it email because I originally thought deliver would be shorthand for error-specific responses (which would be interesting).
In terms of the layout, the functionality remains the same, except you've included an all option. This is okay, but you've got the same issue that I had - trying to come up with a succinct way to define the various layouts (for all, 40x & 50x). I was going to just call them 4xx or 5xx but I wanted it to be as simple as possible...
config.exception_handler = {
  layouts: { 4xx: 'test', 5xx: 'test'}
}

--
In regard to your overall proposal, I think the BIG thing we could work with would be the renaming of layout to exceptions and then including multiple options for each error (layout, email/notify, deliver):
config.exception_handler = {
    email<EMAIL_ADDRESS>    exceptions: {
        all: { layout: 'something_broke' },
        5xx: {
            layout: 'test',
            deliver: proc {|e| e.request.original_fullpath =~ /jpg|png/ }
        },
        404: {
            layout: 'test',
            notify:  false,
            deliver: proc {|e| e.request.original_fullpath =~ /jpg|png/ }
        }
    }
}

This would give even greater configuration management to the errors, whilst retaining the overall structure & veracity of the solution.

Closing as I've incorporated into the next version (<IP_ADDRESS>) - I've credited you etc.

Cool, thanks!

On 25 Jun, 2018, at 11:36 PM, Richard Peck<EMAIL_ADDRESS>wrote:
Closing as I've incorporated into the next version (<IP_ADDRESS>) - I've credited you etc.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/richpeck/exception_handler/pull/63#issuecomment-400195635, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqDFOcKVlwQglsPsD183nD2_jGHZPpUks5uAdZxgaJpZM4T9AU8.


feat: Added diff() function to DataFrame

Added a diff() function to mimic the functionality of the equivalent function in pandas as best as possible.
Can calculate difference between rows and columns both forwards and backwards, in addition to difference in relation to another dataframe or series.
Added the function to the DataFrame interface.
Added unit testing with as much coverage as I could. The error that is thrown if the axis is set as something other than 0 or 1 follows the convension from a similar function, but as far as I can tell TypeScript won't let you set axis to anything besides 0 or 1, so it is untestable.
The implementation is made using the built in tensorflow functionality for pretty much everything except nudging the data to compare, and I believe this is one of the faster ways to achieve this!

Resolves #383 partially, there's no pct_change as of yet, but figuring out how to perform the calculations effectively and manipulate the dataframes took the most amount of time. I will try to implement a similar function for pct_change() as well 😃

Another comment. I have implemented the pct_change() as well, but am struggling with testing.
My expected return is for example 0.8 but JavaScript thinks it should be 0.80000000000012345 to provide a random example. Is there an easy way around this?

Another comment. I have implemented the pct_change() as well, but am struggling with testing.
My expected return is for example 0.8 but JavaScript thinks it should be 0.80000000000012345 to provide a random example. Is there an easy way around this? @risenW
Edit: Since it breaks testing I'm doing pct_change() in a separate branch. I can make a separate pull request for that in a bit, so you can see more hands on!

Yeah, I have had that issue with float values as well. You can try to truncate/floor the value.
And yes, doing pct_change in a separate PR is better.

We can cross that bridge in another PR! 👍 I'm trying to refactor and remove some duplication, should hopefully not take too long!

Alright! I think I've resolved the issues you pointed out @risenW ?
The code has become more succinct with less duplication, and tests are passing!

@NeonSpork Everything looks good here. One last thing before I merge, can you also add test for the browser version. Just copy over what you currently have to the browser test folder, and then use the namespace dfd.DataFrame or dfd.Series to create Dataframe and Series. You can see examples in the danfojs-browser/tests/ folder

Sounds great! I forgot about the browser tests, oops! Was just happy to see green checks 👍
I'll sort that out in both my PRs in a short bit!

LGTM ✅✅ Thanks for the PR @NeonSpork

LGTM ✅✅ Thanks for the awesome work @NeonSpork

My pleasure man! I'm looking forward to contributing more in the future 🚀

@NeonSpork @risenW - this feature is exactly what I am searching for, however, I cannot find it in the docs. Could you maybe point me to the documentation?

Hi! Glad you've found my contribution useful! When I wrote that contribution I also added pages to the docs, but for some reason they're not on the official documentation web page. Not sure why that is the case.
Either way the docs pages I added are still in the docs repo, and the examples and explanations for the diff() function can be found here:
https://github.com/javascriptdata/danfojs-doc/blob/master/api-reference%2Fdataframe%2Fdanfo.dataframe.diff.md
Maybe @risenW has some insight into why it's not on the main docs? Maybe the main index page doesn't include links to them?


QNAP Container Station

Forgive me, new to containers.....but I think I have this right.
If I deploy with GUI, I can remove /config "bind mount", add a new mount that mounts /config to /Containers/Crashplan-Pro/Config
Now, if I deploy with docker run it works, UNTIL I restart the container.
when I restart it mounts /config to a file within the container and not the mount point above.
Is this an issue with container station and how it works?   Is there a way to get around this?
Thanks!
my config:
docker run -d
--name=crashplan-pro
-e USER_ID=1000
-e GROUP_ID=1000
-e PUID=0
-e PGID=0
-e TZ=America/Chicago
-e CRASHPLAN_SRV_MAX_MEM=1024M
-p 5800:5800
-p 5900:5900
-v /share/containerapps/_ContainerConfigs/CrashplanPro/config:/config:rw
-v /share/containerapps/_ContainerConfigs/CrashplanPro/storage:/storage:rw
-v /share/Multimedia:/mnt/multimedia:rw
jlesage/crashplan-pro

So when using the UI, can you create the same mapping as the cli?

Hello,
Here is my config that has worked great on QNAP TVS-872XT for the last couple years.  FYI, the QNAP CS GUI is pretty much worthless...  Just use the docker run command below, and if you need to change anything, just kill the container and recreate it. I put my docker config files in a share called /share/Docker so they don't get destroyed if I kill the docker /and or upgrade it.  Everything else is ro on the shares unless I need to restore something.
Additionally, I noticed about a year or so ago that I had to start specifying the whole device path rather than /share/blah, otherwise the mappings would not work as they used to.  YMMV.
docker run --restart unless-stopped -d
--name=crashplan-pro
--restart=always
-e USER_ID=0
-e GROUP_ID=0
-p 5800:5800
-e TZ=America/Chicago
-e CRASHPLAN_SRV_MAX_MEM=16384M
-v /share/Docker/appdata/crashplan-pro:/config:rw
-v /share/CACHEDEV1_DATA/Docker:/share/Docker:ro
-v /share/CACHEDEV1_DATA/Logs:/share/Logs:ro
-v /share/CACHEDEV1_DATA/Public:/share/Public:ro
-v /share/CE_CACHEDEV2_DATA/Docs.Andrew:/share/Docs:ro
-v /share/CACHEDEV3_DATA/Movies:/share/Movies:ro
-v /share/CACHEDEV3_DATA/Music:/share/Music:ro
-v /share/CACHEDEV3_DATA/Pictures:/share/Pictures:ro
jlesage/crashplan-pro
MF

@madfusker I did create with the docker command above, the problem is when the container was restarted it seemed to mount /config and /storage with the bind mount that is shown when deployed through the GUI, vs the specified mount to the /config file in my share.
I wonder if I put the full path vs the share in if that will work?  I can try again and see what happens, I'd 100% rather use the docker run command.

Still breaks on reboot.
docker run -d
--name=crashplan-pro
-e USER_ID=1000
-e GROUP_ID=1000
-e PUID=0
-e PGID=0
-e TZ=America/New_York
-e CRASHPLAN_SRV_MAX_MEM=32768M
-p 15800:5800
-p 15900:5900
-v /share/CACHEDEV3_DATA/containerapps/_ContainerConfigs/CrashplanPro/config:/config:rw
-v /share/CACHEDEV3_DATA/containerapps/_ContainerConfigs/CrashplanPro/storage:/storage:rw
-v /share/CE_CACHEDEV1_DATA/Multimedia:/mnt/multimedia:rw
-v /share/CE_CACHEDEV1_DATA/fvfc-qnap:/mnt/fvfc-qnap:rw
-v /share/CACHEDEV3_DATA/containerapps:/mnt/containerapps:rw
-v /share/CE_CACHEDEV1_DATA/all_data:/mnt/all_data:rw
jlesage/crashplan-pro

The host paths for /config and /storage don't look correct from the UI.
Instead of -v /share/CACHEDEV3_DATA/containerapps/_ContainerConfigs/CrashplanPro/config:/config:rw, could you use -v /share/containerapps/_ContainerConfigs/CrashplanPro/config:/config:rw ?

Your configs are going to some strange location that I have never seen on any QNAP device before, and perhaps it's some temp storage location that gets wiped on reboot?
Simply create a share called "Docker" to store your docker files and then use "-v /share/Docker/appdata/crashplan-pro:/config:rw".  Problem solved and your settings will be there when you reboot!  :)

@jlesage if you look at first post I used the -v /share/containerapps/_ContainerConfigs/CrashplanPr...and it works, but it doesn't remain persistent.  I reboot and get the drives setup like the picture I posted above.  I'm at a loss.

Forgive me, new to containers.....
... the location is just mounted inside the container.

Right, which is why it gets destroyed.  It's doing exactly what you are telling it to do and writing to a tmp storage location.  If you don't know much about containers, follow the advice from others here that do and simply write the data to a persistent drive location.  This isn't an issue and can be closed.

@madfusker can we start over?
docker run -d
--name=crashplan-pro
-e USER_ID=1000
-e GROUP_ID=1000
-e PUID=0
-e PGID=0
-e TZ=America/Chicago
-e CRASHPLAN_SRV_MAX_MEM=1024M
-p 5800:5800
-p 5900:5900
-v /share/containerapps/_ContainerConfigs/CrashplanPro/config:/config:rw
-v /share/containerapps/_ContainerConfigs/CrashplanPro/storage:/storage:rw
-v /share/Multimedia:/mnt/multimedia:rw
jlesage/crashplan-pro
Based on this, I have a share called "containerapps" which is an M2 SSD on my QNAP where I'm running container station and my containers.
Using the Docker run command above, I'm mounting /config and /storage to a folder name _ContainerConfigs/CrashplanPro/..., my config files are written to this location outside of the actual container.  The configuration works when I create the container.  The problem is if I STOP and START the container, the container itself mounts /config and /storage within the container, almost like I didn't create the mounts.
If I deploy with the GUI, I can remove the default mounts and redirect.

@jlesage @madfusker well Gents sorry to keep bugging you but I figured out what I was doing.
Deploying with Docker Run worked fine and was persistent.  After deploying I was going into container station, editing the container to limit the amount of memory / cpu used and setting it to auto-restart.  When I hit save and it restarted the container, it remounted /config and /storage inside the container folder, NOT in the folder I has assigned in my docker run command.
Take-away is, deploy container and leave it alone and its fine.....

Ah, yeah, that makes sense now...  We probably need a sticky side note in the instructions specifically for QNAP'ery, that you never want to change settings with the QNAP CS GUI.  I have never had anything work right using the GUI and never use it.  If I need to make any changes to the container I simply kill it and reissue the whole docker command on the command line.  Even to change memory or CPU settings.  Just delete the whole docker reissue the docker run command above.  Everything stays in place since the docker config/data files are outside the container.

@madfusker yup that makes sense.  I'm an IT guy (heavy in infra/vmware etc), so I was 99% sure I was issuing command properly and was getting pretty pissed off when /config was getting remounted.    lol

Just as a PS to this exchange .. if you aren't used to the command line of docker I would recommend using Portainer to create the environment.  So much easier and quicker to find your way through.


Release/0.5

test upgrade to release/0.5

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.3 out of 5 committers have signed the CLA.:white_check_mark: kongjianneu:white_check_mark: I-m-SuperMan:white_check_mark: RenDongge:x: pingkai:x: xjsXjtupingkai seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


Is it possible to use a simple PaaS like Dokku with Rancher?

Yes?  If you use Dokku on a host the containers it starts will show up in Rancher.

@eneko89 We haven't tested out Dokku with Rancher, but with the native docker integration (available in Beta), any containers created outside of Docker will automatically show up in Rancher.
http://rancher.docs.rancher.com/docs/native-docker/


Usage of taskkill.exe on linux

https://github.com/profesorfalken/jPowerShell/blob/fe785459bca019e6d0dd2dda7cc7ee4074219592/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L407
The lib is not completely converted to work in linux. When closing the powershell there is still hardcoded the call to taskkill.exe, which triggers an exception.

Yes, one could implement the unix part: like "OSDetector" ... then for unix "kill -9 pid".


drive arc turn

the robot should have a command to turn for an arc
the command should drive at a specified speed
the command should drive at a specified radius
the command should drive for a specified arc length
the command should use sensors

Sure. I was thinking it would be just like turn to angle, but you specify the left and right speeds. It'd be a bit simpler, but slightly more guess-and-check-y.

Closed a long while ago


Issue on new-environments.yml

Expected Behavior
The routine should run without issue - failed on the deployment of https://github.com/ministryofjustice/modernisation-platform-environments/pull/7634
Actual Behavior
It comes up with an error (below) which should not happen.
Run files=$(git diff --name-only --diff-filter=AM @^ -- 'environments/*.json' | uniq | sed 's#environments/##' | sed 's/\.json$//' | base64 )
Error: Unable to process file command 'output' successfully.
Error: Invalid format 'ZXh0Y2xvdWQK'

Steps to Reproduce the Problem
Run the above PR.
Version
No response
Modules
No response
Account
No response

Example error (from the revert of the above code)
https://github.com/ministryofjustice/modernisation-platform/actions/runs/10631217325/job/29472804617#step:6:17

I believe this is no longer required - but @SteveLinden can you confirm - and add a description of what was required

This was fixed separately


language separation?

TechNet Forums have a language separation. What about Q&A?
https://social.technet.microsoft.com/Forums/EN-US
https://social.technet.microsoft.com/Forums/DE-DE
https://social.technet.microsoft.com/Forums/RU-RU

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 5be114f3-6668-8b9d-b698-a088050edd1e
Version Independent ID: 360c7943-63c3-72b8-ddbe-b275f86793ba
Content: Introducing Microsoft Q&A (Preview)
Content Source: teamblog/introducing-microsoft-qanda.md
Product: team-blog
GitHub Login: @saldana
Microsoft Alias: saldana

@TheAnahaym Q&A we will have language separation in the next few weeks. Note that right now we only support English and we will move to support other languages in the next few months.

Saldana, thank you for the good news!
Maybe you also could answer my other questions:
where can I read the rules?
who defines rules for the non-English QA?
who will be moderators of the non-English QA?
whom can I complain to if a moderator abuses their authority?
Thank you in advance!

@TheAnahaym we have not defined any rules yet for non-English Microsoft Q&A. We already have the locale in the URL and when there is another language supported it will be visible as the UI and the URL will be in that particular locale.
We make moderators first to Microsoft employees and other users affiliated to Microsoft, such as MVPs. We will be moderating the communities to see who can become moderators later on.
If moderators are abusing their authority, for now, you can let me know!


Updated PyTorch version from 0.3 to 1.6

Thank you @hanmingcr for the review! Sadly I don't have write permission on this repo to merge this PR, but you can feel free to clone my fork that's working: https://github.com/Vichoko/pytorch-wavenet

Model_logging.py should be changed to use tf.summary.create_file_writer('log_dir')


Web Site DNS expired?

tweeview.ml is now doing a sketchy re-direct to http://freenom.link/?k=80808080&_=1661508040
Hope you re-implement this in Aframe or Babylon or similar in a version 2.0+ with a Z-axis !

Looks like Freenom have taken back the domain. If you know of another free domain name provider, I can rehost it.
I do have a 3D version. You can see a demo at https://shkspr.mobi/blog/2021/09/visualising-twitter-conversations-in-3d-space/

Freenom have graciously restored it. Should be working now.


taskwarrior plugin autocompletion produces segfault

When I use the autocompletion function from the taskwarrior plugin (task [tabtab]) zsh crashes with a segmentation fault.
I am using zsh 5.0.2 (archlinux) and an up to date version oh-my-zsh.
If you need additional debug info, I am happy to help.

Obsolete? The segfault might not happen again but the first completion is not triggered. Adding a _task statement at the end of the _task file will make it work, as @pdvyas suggested.

At least the segfault has been fixed in zsh in September 2013 in the commit zsh-users/zsh@844e569b632fc032576edc039f793be47fde724e.

@mcornella Yes, as far as I am concerned the issue is obsolete. I'm using the fix @pdvyas suggested  and it works very well for me. Sorry for never posting back.

strange, i'm using ubuntu 14.4 zsh 5.0.2 and just installed oh-my-zsh and getting same error when tab completing.


router: do not reuse retry plugin instances

Currently each route with a configured retry policy instantiates a
single instance of the desired retry plugins. This makes the plugins
somewhat unusable because it's unable to differentiate between retries
happening for different requests.
This changes them to be instantiated once per retry state.
Refactors the retry plugin factory interface to be easier to work with.
Signed-off-by: Snow Pettersen<EMAIL_ADDRESS>Risk Level: Medium
Testing: Added unit test to ensure we're not returning the same pointer
Docs Changes: n/a
Release Notes: n/a

For context this was causing our usage of the other_priorities plugin to sometimes get multiple onHostAttempted in between onDeterminePriorityLoad, so it would sometimes skip the update and return an empty PriorityLoad which would trigger a NOT_REACHED assert

I'll do a quick scan over the comments but I believe so, considering I thought this was the case when I wrote the code :)

Tell me more..
On Oct 15, 2018 21:51, "Snow Pettersen"<EMAIL_ADDRESS>wrote:

I'll do a quick scan over the comments but I believe so, considering I
thought this was the case when I wrote the code :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/envoyproxy/envoy/pull/4697#issuecomment-429860133,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Ap4l6Na5s9tLZQKQ47ptXqiL30Sy0OiPks5ulJLGgaJpZM4XYgaL
.


Workflows only on pull request

Pull Request summary:
Running workflows only on pull request instead of push and pull request.
Description of changes:
Delating push from triggers in workflows so the run will not be duplicated like it is now. Also changing it so jobs run on any pull request instead of only pull requests to main branch.

Now only 3 jobs will run instead of 5.

Continuation to PR #175

Checklist:

[x] Make sure to run pre-commit before commiting changes
[x] Make sure all checks have passed
[x] PR description is clear and comprehensive
[x] Mentioned the issue that this PR solves (if applicable)
[x] Make sure you test the changes

This issue was migrated from an old repository: https://github.com/CiscoDevNet/catalystwan/pull/177


Timestamp with nanosecond precision (logback 1.3.0)

Starting from 1.3.0-alpha12, Logback events are now storing timestamp with nanosecond precision (using an Instant). The AbstractTimestampJsonProvider should be updated to take this enhancement into account.
A couple of questions/remarks...
(1) Backward compatibility
A new getInstant() method has been added to LoggingEvent in version 1.3.0 which was not available in previous versions.
Instead of providing two distincts artefacts (one for logback 1.2 and another for 1.3) I propose to keep only one and make use of reflection to detect at runtime if the getInstant() method is available and automatically enable nanosecond precision in our JsonProvider.
It should be noted that as of version 1.3.0-beta0 AccessEvents have not (yet) been enhanced with a getInstant() method and therefore lack nanosecond precision. Using the above mentioned strategy should help us to keep using the current AbstractFormattedTimestampJsonProvider as a base class for both the LoggingEvent and AccessEvent specialisations: getInstant() not available on AccessEvent -> nanosecond not enabled -> revert to millis as currently.
(2) Available timestamp formats and default
By default timestamps are formatted as [ISO_OFFSET_DATE_TIME]. As per the javadoc of java.time.format.DateTimeFormatter this format outputs nanoseconds but drops the insignificant leading zeros. This means that:

precision will be at most three digits (milliseconds) when used with logback 1.2
precision will be up to 9 digits (nanoseconds) when used with logback 1.3
Users should be aware they will suddenly have a higher timestamp precision just by upgrading the logback and LLE versions while keeping the same configuration. If nanosecond precision is not desired, users have the option of configuring an explicit format pattern instead of using the [ISO_OFFSET_DATE_TIME] keyword.

[UNIX_TIMESTAMP_AS_NUMBER] and [UNIX_TIMESTAMP_AS_STRING] will behave asis.
(3) Build, Testing and Dependencies
First phase: logback 1.3.0 still in BETA
Keep latest logback 1.2.x in the POM.
Build against 1.2 - execute tests with 1.2 and 1.3 (same strategy as for Jackson)
Second phase: logback 1.3.0 is GA
Bump logback to 1.3.0 in POM.
Build against 1.3 - execute tests with 1.3 and 1.2 (same strategy as for Jackson)

@philsttr What's your opinion? Any feedback?


Update libsshscan.py

Before PR:
➜  Desktop python libssh-scanner.py -t XX.YY.WW.ZZ -p 22

Status: Searching for Vulnerable Hosts...

Traceback (most recent call last):
  File "libssh-scanner.py", line 65, in <module>
    results.append([ip, args.port, bannergrab(ip, args.port)])
  File "libssh-scanner.py", line 30, in bannergrab
    s.connect((ip,port))
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
TypeError: an integer is required

With this fix:
➜  Desktop python libssh-scanner.py -t XX.YY.WW.ZZ  -p 22

Status: Searching for Vulnerable Hosts...

[*] XX.YY.WW.ZZ :22 is not vulnerable to authentication bypass (SSH-2.0-SSHD)

Scanner Completed Successfully

Thank you for the contribution!


Ktor 3.0.0 future migration, can't instantiate OpenAI client

Description
Can't instantiate OpenAI client with ktor 3.0.0-rc-1.
Exception in thread "main" java.lang.NoClassDefFoundError: io/ktor/client/plugins/contentnegotiation/ContentNegotiation
	at com.aallam.openai.client.internal.HttpClientKt$createHttpClient$configuration$1.invoke(HttpClient.kt:34)
	at com.aallam.openai.client.internal.HttpClientKt$createHttpClient$configuration$1.invoke(HttpClient.kt:24)
	at io.ktor.client.HttpClientKt.HttpClient(HttpClient.kt:42)
	at io.ktor.client.HttpClientJvmKt.HttpClient(HttpClientJvm.kt:23)
	at com.aallam.openai.client.internal.HttpClientKt.createHttpClient(HttpClient.kt:89)
	at com.aallam.openai.client.OpenAIKt.OpenAI(OpenAI.kt:60)

	at com.example.app.ChatGPTAIService.<init>(ChatGPTAIService.kt:58)

Steps to Reproduce

Add ktor 3.0.0-rc-1 dependencies
Use simple code

val config =
    OpenAIConfig(
        chatGptToken,
        organization = organization,
        logging = LoggingConfig(logger = Empty),
    )
OpenAI(config)

Run code, you will get

Environment

openai-kotlin version: 3.8.2
Kotlin version: 2.0.20
OS: macOS

Additional Info
PR https://github.com/aallam/openai-kotlin/pull/345 may help

Same issue here, the ktor API of that library must be updated to 3.0 soon.

Waiting for the official release of Ktor 3.0, but I will make a beta release in preparation for it.

Waiting for the official release of Ktor 3.0, but I will make a beta release in preparation for it.

Thx!
Waiting for it :D

Ktor 3.0 just released.
Waiting for the lib update ^^


Enhance the twitter feed in the footer

This PR fixes #861
This PR enhances the twitter feed CSS to have rounded corners.
Signed-off-by: k0more<EMAIL_ADDRESS>

sorry it took this long, I had exams and it took sometime to set up the server environment.

Oh btw can you add the hacktoberfest accepted label on this as well, it'd be really appreciated

@leecalcote coming in clutch as always 👍

@K0more LGTM!!! , Great Work

Tyty

Uh-oh. While the Twitter Feed displays with rounded corners in Chrome, it still displays with sharp corners in Safari.

Uh-oh. While the Twitter Feed displays with rounded corners in Chrome, it still displays with sharp corners in Safari.

Is this a browser that you have access to?

Uh-oh. While the Twitter Feed displays with rounded corners in Chrome, it still displays with sharp corners in Safari.

Is this a browser that you have access to?

Yeah, I don't have a personal ios device but I have a Mac lab in my college, though I'm pretty confused about the css in safari.

@leecalcote This issue has been fixed as of issue #818

@leecalcote This issue has been fixed as of issue #818

@K0more, ok, good deal. Should we close this PR or is it still needed?

@leecalcote This issue has been fixed as of issue #818

@K0more, ok, good deal. Should we close this PR or is it still needed?

I don't think we do, apparently there were some excessive CSS that @legendarykamal fixed which was causing the sharp edges, and some overflow issues.

I don't think we need this PR, apparently there were some excessive CSS that @legendarykamal fixed which was causing the sharp edges, and some overflow issues.

Oh, I see. Ok, thank you very much for this help, @K0more. 👍


JobType struct and constants

JobType is an enum, with the job limit and name provided by separate free functions. Instead, we want JobType to be a struct that combines the priority, name, and limit together so that it is constructed with all three, making it impossible to add a job type without also specifying a priority and name.
Then we can replace the enums with global constants, like this:
extern JobType const jtACCEPT;
extern JobType const jtLEDGER_DATA;
// etc...

Done


write buildRules fail

I use xcodeproj to add a custom buildRule to buildRules of nativetarget, and then save the proj file. Customized buildrule does not take effect.

Hey, please add additional information about the issue you are seeing 🙏
We can then re-open this.


Fix test breakage due to newer Rake incompatibility

Pin max Rake version to < 11.0.
See the following for more info:
http://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@99d0fc5). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master      #54   +/-   ##
=========================================
  Coverage          ?   98.21%
=========================================
  Files             ?        1
  Lines             ?       56
  Branches          ?        0
=========================================
  Hits              ?       55
  Misses            ?        1
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99d0fc5...9f34695.


fix log_likelihood function

There is wrong statement in the function log_likelihood.
Specifically, there is an error in the calculation of the normal distribution, which I would like to correct with this request.

Hi,
I wonder if the integer division is really what’s wanted here.
In method log_likelihood line 26 with this part -(rd**2)/2/sigma2[i] since rd is an integer when I go through your test case I obtain 6.328759366440833e-15 instead of 1.2091379396665127e-07 the first time it hits line 26.
(at first rd is -1 so:
(-1)²=1 -> 1/2=0 instead of 0.5)
Is this the desired behaviour ?
If this is the calculation of the normal distribution I think it should be a floating point division.
With floating point division I got a different result for the first day, then it converges.
yours -> mine
-102.65265035957913 -> -69.65648196168772
-1.9397850625546684 -> -1.9397850625546684
-2.1269280110429727 -> -2.1269280110429727
-0.6931471805599453 -> -0.6931471805599453

@pfmonville
Thank you for pointing it out!!
It's not desired behaviour.
I'll fix it later, so please wait.

@pfmonville
I confirmed that, in the latest commit, result for the test is same as your result.
I'm not good at Ruby, so, thank you again for pointing out my mistake.


[Feature]: Improve usefullness of outlier removal for auto-scaling.

Description
Right now, it does a reasonable job in finding a range where most data sits (using quantiles, I assume), but always drops a little bit of useful data around it. The reason the current approach fails is because if you have NO outliers, it still considers for example quatiles 5% and 95% for the auto range boundaries, which just assumes 10% of your data is outliers. This is obviously wrong, as we assumed no outliers (eg: signal is a sin(x) function).
Suggested Solution
Use the range like it's implemented right now, and extend it by 5% or 10% in both directions. More specifically:
range =   # ... the current implementation with outlier removal...
range_size = range.max - range.min
range.min -= range_size * 0.05
range.max += range_size * 0.05

Now consider my no-outliers example: sin(x). The current auto-range would yield -0.95 to +0.95. The length of that interval is 1.9. Add now 5% of that (which is 0.095) on both sides, and the final range becomes: -1.145 to +1.145. There you go: the sin(x) function is now nicely displayed with a little margin on the both sides.
Alternatives
No response
Additional Context
No response

Hi @mcourteaux, thank you for bringing this to our attention. Are you running into this when clicking on the "Remove Outliers in Chart Scaling" button or when using our scikit-learn integration?

Yes, I'm talking about the "Remove Outliers in Chart Scaling" button. I have another way to think of this: remove outliers assumes you have outliers, always. Instead, I think it is more useful that it tries to only remove outliers if you have any. This feature is useful, but when you filter down on runs that don't have outliers, the range it finds becomes not useful as it cuts off useful data.

Example: this range is useless:

So, I enable outlier removal for chart scaling:

Now it zooms in to the more useful range, but always cuts away the most recent values, as those are highest and considered "outliers".

Hi @mcourteaux, thank you so much for the images they help a lot in understanding the feature request. I'll create a ticket for this and let you know if there are any updates from our engineering team.

Any update on this? This is literally a two minute fix. :disappointed:
It's literally this (Python pseudocode):
range = np.quantile(data, [0.05, 0.95])
range_size = range.max - range.min
range.min -= range_size * 0.1
range.max += range_size * 0.1
display_chart(data, y_range=range)

Hi @mcourteaux, thank you for being patient with us here. I have further escalated this issue to our team, but there has to be a discussion on how this is going to change other people's charts.

It will make charts more useful, as under most circumstances, this just show the end of most learning curves. Right now, charts showing the loss-function are always cut off towards the end, as I've shown earlier. Basically, it zooms out just a little bit after removing outliers, to include again the stuff that actually aren't outliers.

I see, I'll bring this up with our team and I'll let you know if I hear back from them.


Should node_modules be added to the repository?

Hey all,
@mikeal wrote an interesting post about dependencies on modules within Node projects: http://www.mikealrogers.com/posts/nodemodules-in-git.html
Do we want to have node_modules included in the repository to move forward with developers practising having local modules?
I'm +1 for node_modules being in the root if that's the pattern that the Node community is starting to adopt.
Cheers,
Jame

Current thinking is "support" both, but we're willing to hear what others
think. I was actually going to spike on this over the next few days.
On Thu, Dec 22, 2011 at 11:04 PM, Jaime Bueza <
<EMAIL_ADDRESS>
wrote:

Hey all,
@mikeal wrote an interesting post about dependencies on modules within
Node projects: http://www.mikealrogers.com/posts/nodemodules-in-git.html
Do we want to have node_modules included in the repository to move forward
with developers practising having local modules?
I'm +1 for node_modules being in the root if that's the pattern that the
Node community is starting to adopt.
Cheers,
Jame

Reply to this email directly or view it on GitHub:
https://github.com/WindowsAzure/azure-sdk-for-node/issues/17

As explained in : https://github.com/WindowsAzure/azure-sdk-for-node/pull/19.


swift build error

When I ran the swift build command, i got the following error :(
<unknown>:0: error: no such file or directory: 'build'

Please add
/swift-latest.xctoolchain/usr/bin
to your PATH

You can make the tools available for use from the terminal with the following command:
On OSX
$ export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:"${PATH}"
On Linux
$ export PATH=/path/to/Swift/usr/bin:"${PATH}"

I believe the issue has to do with release vs development snapshots.
Reference: https://github.com/apple/swift-package-manager#installing

I found out the problem is that the path /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin should come before the rest of the default path, so the dev version installed in the path above takes precedence over the Swift version bundled with Xcode.
Although the instructions display the export line correctly, this is not an explicit instruction.

@itsaboutcode are you using Xcode swift? you need swift 2.2-dev or + to be able to use swift build command

@matteocrippa - Yap. Using XCode version of swift. I believe I will need swiftenv to mange them :(

prob is even faster to use instead docker, I managed to use swiftenv without any success so far.

I've been trying to build for a while on OS X.  Even tried using build-osx.sh.
Now getting this error:

Linking Executable:  .build/debug/KituraSample
ld: library not found for -lcurlHelpers for architecture x86_64

And there's still an error in the file names:

*** No rule to make target `Packages/Kitura-net*/Makefile'.  Stop.

Shouldn't it be KituraNet-* ?

Hey we have been updating and fixing things a lot over this weekend. Please try updating with a git pull and deleting your Packages folder. The development branch should work with the 2/25 binary.

Fixed from IBM-Swift/Kitura#175

KituraSample builds now but still fails:

mel$ ./KituraSample
dyld: Library not loaded: ./.build/debug/libcurlHelpers.dylib
Referenced from: /Users/mel/Kitura/.build/debug/./KituraSample
Reason: image not found
Trace/BPT trap: 5

It works. Many thanks for your patience. Perhaps mention in README that you call KituraSample as:

./build/debug/KituraSample

because library load appears to be hard coded: ./.build/debug/libcurlHelpers.dylib

after path specified you need to run ./swift/utils/build-script


Cannot override non-schema type

I'm using MongoDB and would like to expose some objects to the front-end.
Unfortunately they use a custom data type called "ObjectId" which is annoying.
It doesn't support ToSchema. My attempts to emulate it have failed.
I try the following
fn custom_type() -> Object {
    Object::new()
        .schema_type(SchemaType::String)
        .format(SchemaFormat::Custom("email".to_string()))
        .description("this is the description")
}

#[derive(Debug, Serialize, Deserialize, Clone, Validate, ToSchema)]
pub struct Device {
    #[salvo(parameter(schema_with = custom_type))]
    pub _id: ObjectId,
}

I still get the error
the trait bound bson::oid::ObjectId: salvo::prelude::ToSchema is not satisfied
Any ideas?

How about this:
#[derive(Debug, Serialize, ToSchema)]
pub struct ResBody {
    #[salvo(schema(value_type = String, additional_properties = true))]
    pub user_id: UserId,
}

@chrislearn thanks that works great!
Now i have to figure out the next error, no sure if this is Mongo or Salvo related, can't find any stack trace.
Kind: expected map containing extended-JSON formatted ObjectId, instead found { "id": [101, 164, 92, 104, 163, 255, 148, 98, 60, 96, 36, 28] }, labels: {}


Display rate limit errors message from API response

Closes #2738.

Codecov Report

Merging #2767 into canary will increase coverage by 0.03%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           canary    #2767      +/-   ##
==========================================
+ Coverage   13.89%   13.92%   +0.03%
==========================================
  Files         262      262
  Lines       10560    10584      +24
  Branches     1365     1364       -1
==========================================
+ Hits         1467     1474       +7
- Misses       8944     8961      +17
  Partials      149      149

Impacted Files
Coverage Δ

src/util/handle-error.ts
26.92% <0%> (-1.21%)
:arrow_down:

src/util/dev/router.ts
78.57% <0%> (-4.77%)
:arrow_down:

src/util/dev/yarn-installer.ts
80.95% <0%> (-3.8%)
:arrow_down:

src/util/output/create-output.ts
37.5% <0%> (-3.41%)
:arrow_down:

src/util/dev/builder-cache.ts
73.36% <0%> (-1.51%)
:arrow_down:

src/util/dev/builder.ts
72.1% <0%> (-1.02%)
:arrow_down:

src/util/get-files.ts
90.1% <0%> (-0.91%)
:arrow_down:

src/util/dev/server.ts
62.4% <0%> (-0.08%)
:arrow_down:

src/commands/remove.js
0% <0%> (ø)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5eca7cf...1e6a818. Read the comment docs.


Machine win-6 went dead from network monitoring website.

Machine win-6 went dead from network monitoring website.

Windows OS was prompting on screen to finish setup, when click on "cancel" the screen went away and then boot up and bring Windows back online.


One UI 3.0 Dimensions Screen Width is not returning the correct value

Description
Hello,
Two users recently reported that the screen is too big and doesn't fit on Samsung Galaxy S20 Ultra devices using Android 11.
React Native version:
System:
    OS: Linux 5.8 Pop!_OS 20.10
    CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
    Memory: 8.12 GB / 15.64 GB
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 12.18.2 - /usr/bin/node
    Yarn: Not Found
    npm: 6.14.8 - /usr/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: javac 14 - /usr/lib/jvm/jdk-14/bin/javac
    Python: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.4 => 0.63.4
  npmGlobalPackages:
    *react-native*: Not Found

Snack, code example, screenshot, or link to a repository:
I use Dimensions.get("window").width make the elements on screen responsive. In One UI 3.0, when the device resolution is set to WQHD, elements are being scaled.
Code:
import React from 'react';
import {View, Text, Dimensions} from 'react-native';

export default class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      width: Dimensions.get('window').width,
      height: Dimensions.get('window').height,
      window: Dimensions.get('window'),
      screen: Dimensions.get('screen'),
    };
  }
  render() {
    return (
      <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
        <View
          style={{
            height: 50,
            width: this.state.width,
            backgroundColor: 'green',
          }}>
          <Text>Full width view</Text>
        </View>
        <Text style={{fontSize: this.state.width / 15, textAlign: 'center'}}>
          This is a text 15
        </Text>
        <Text style={{fontSize: this.state.width / 13, textAlign: 'center'}}>
          This is a text 13
        </Text>
        <Text style={{textAlign: 'center'}}>
          screen:{JSON.stringify(this.state.screen)}
        </Text>
        <Text style={{textAlign: 'center'}}>
          window:{JSON.stringify(this.state.window)}
        </Text>
      </View>
    );
  }
}

Screenshots:
S20 Ultra Android 11 WQHD

S20 Ultra Android 11 FHD

I hope the issue is clear.

Same problem with the Samsung Galaxy Note 20 Ultra. I think the issue is related to One UI 3.0.

Same problem with the Samsung Galaxy Note 20 Ultra. I think the issue is related to One UI 3.0.

Setting the device's screen resolution to 2400x1080 fixes the issue. The problem only appears when the device's screen resolution is set to 3200x1400.

Setting the device's screen resolution to 2400x1080 fixes the issue. The problem only appears when the device's screen resolution is set to 3200x1400.

@nkrkv I've solved the problem with
let scaleFactor = Dimensions.get("screen").scale / Dimensions.get("window").scale;
const screen_height = Dimensions.get("window").height * scaleFactor;
const screen_width = Dimensions.get("window").width * scaleFactor;

Thus you scale the elements back to their original size.

@nkrkv I've solved the problem with
let scaleFactor = Dimensions.get("screen").scale / Dimensions.get("window").scale;
const screen_height = Dimensions.get("window").height * scaleFactor;
const screen_width = Dimensions.get("window").width * scaleFactor;

Thus you scale the elements back to their original size.

@trizin It works as an emergency kludge but be aware that the bug also affects animations with useNativeDriver: true. Looks like the animated transforms live in another system of coordinates. A workaround is still to be discovered.

@trizin It works as an emergency kludge but be aware that the bug also affects animations with useNativeDriver: true. Looks like the animated transforms live in another system of coordinates. A workaround is still to be discovered.

As for animations, it looks like applying an interpolation from [0, 1] to [0, scaleFactor] to all translateX and translateY around the app fixes them. Here scaleFactor is computed as in the @trizin comment:
let scaleFactor = Dimensions.get("screen").scale / Dimensions.get("window").scale;

Nevertheless, this is a big and fragile hack. Looking forward for more details.

As for animations, it looks like applying an interpolation from [0, 1] to [0, scaleFactor] to all translateX and translateY around the app fixes them. Here scaleFactor is computed as in the @trizin comment:
let scaleFactor = Dimensions.get("screen").scale / Dimensions.get("window").scale;

Nevertheless, this is a big and fragile hack. Looking forward for more details.

I'm also experiencing this issue on Samsung Galaxy S20 phones. Unfortunately, this hack does not help in my case, as I intentionally use unscaled pixel sizes for most elements in my app, which means that the incorrect scale factor blows my whole layout up too big for the screen. Would love to see a fix for this soon.

I'm also experiencing this issue on Samsung Galaxy S20 phones. Unfortunately, this hack does not help in my case, as I intentionally use unscaled pixel sizes for most elements in my app, which means that the incorrect scale factor blows my whole layout up too big for the screen. Would love to see a fix for this soon.

@trizin was the reproduction you included in your original issue part of a standalone repository? If so, could you upload and link it to this bug? I just created a new React Native in an attempt to get a minimum reproduction case myself, but I'm seeing correct scaling. No idea where this clean app differs from my production one.

@trizin was the reproduction you included in your original issue part of a standalone repository? If so, could you upload and link it to this bug? I just created a new React Native in an attempt to get a minimum reproduction case myself, but I'm seeing correct scaling. No idea where this clean app differs from my production one.

@Shanghai- That was a project I've created to explain the issue. Unfortunately, I've deleted the project from the disk. The project didn't have any external dependencies, only an App.js file which I shared up there. Create a project with RN 0.63.4 and change the App.js with the code I shared. This should be enough to reproduce the issue.

@Shanghai- That was a project I've created to explain the issue. Unfortunately, I've deleted the project from the disk. The project didn't have any external dependencies, only an App.js file which I shared up there. Create a project with RN 0.63.4 and change the App.js with the code I shared. This should be enough to reproduce the issue.

Create a project with RN 0.63.4 and change the App.js with the code I shared. This should be enough to reproduce the issue.

I did exactly that, but the scaling is working correctly in the resulting test app. And if I swap over to my app on the same phone, it still scales wrong. Either there's another layer missing that creates the issue, or it's not consistent (which seems unlikely).

Create a project with RN 0.63.4 and change the App.js with the code I shared. This should be enough to reproduce the issue.

I did exactly that, but the scaling is working correctly in the resulting test app. And if I swap over to my app on the same phone, it still scales wrong. Either there's another layer missing that creates the issue, or it's not consistent (which seems unlikely).

I don't believe this applies just to values from Dimensions, but rather all views are scaled up. As can be seen in the original two screenshots, the unstyled text "Full width view" is larger in the first screenshot.
In our app we have the same issue, that a) Dimensions returns incorrect values and that b) all elements have gotten larger. This seems to be limited to Samsung devices only and can usually be triggered by rotating the device a few times.
What confuses me though, why aren't more people experiencing this issue? Is this due to some obscure combination of libraries?

Adding on to what's already been said, I believe the root cause has to do with OneUI 3.0. It seems like devices on OneUI 2.5 do not experience this, but some devices on 3.0 do. My theory based on what I've heard from others is that the latest OneUI builds that are rolling out right now actually fix this. I'm wary to upgrade myself, even though I have an update pending, because then I might not be able to repro this bug and have a hope at finding a workaround for it.
By the way, here's an anonymized data set I collected that I'm basing my guesses on.

Device name
Device model
OneUI Version
Android Version
OS build number
System resolution
Repro/no repro?
Any additional   notes/observations

S20 Ultra 5G
SM-G988U1
3.0
11
RP1A.200720.012.G988U1UEU1CTKJ
WQHD+
Repro
This is the OneUI   build with the suspected bug

S20 Ultra 5G
SM-G988U1
3.0
11
RP1A.200720.012.G988U1UEU1CTKJ
FHD+
No repro

S20 Ultra 5G
SM-G988U1
3.0
11
RP1A.200720.012.G988U1UEU1CTKJ
WQHD+
No repro

S20 Ultra 5G
SM-G988U1
3.0
11
RP1A.200720.012.G988U1UEU1CTKJ
FHD+
No repro

S20 Ultra 5G
SM-G988U1
3.0
11
RP1A.200720.012.G988U1UEU1CTLB
WQHD+
No Repro
Updated Jan 25,   fixed the issue. We think this is the latest build with the fix

S20 Ultra 5G
SM-G988U1
2.5
10
QP1A.190711.020.G988U1UES1BTK1
WQHD+
No Repro

Galaxy S9
SM-G960U1
2.5
10
QP1A.190711.020.G960U1UEU8FTL2
WQHD+
No Repro

Galaxy S9
SM-G960U1
2.5
10
QP1A.190711.020.G960U1UEU8FTL2
FHD+
No Repro

S20 Ultra 5G
SM-G988U1
2.5
10
CP1A.190711.020.G988U1UES1BTIG
FHD+
No Repro

S20 5G
SM-G981U
2.1
10
QP1A.190711.020.G981USQU1ATD1
WQHD+   FHD+
No repro

Galaxy Fold
SM-F916U
2.5
10
QP1A.190711.020.F916USQU0ATFE

No repro

Galaxy Note 20   Ultra
SM-N986U1
3.0
11
RP1A.200720.012.N986U1UEU1CTLB
HD+ (1544x720)
No repro
Samsung Software   Update from 1/21

Galaxy Note 20   Ultra
SM-N986U1
3.0
11
RP1A.200720.012.N986U1UEU1CTLB
WQHD+
No repro

Galaxy Note 20   Ultra
SM-N986U1
3.0
11
RP1A.200720.012.N986U1UES1CUA1
WQHD+ and FHD+
No repro
Samsung Software   Update from 2/1

S20 Ultra 5G
SM-G988U1
3.0
11
RP1A.2000720.012.G988U1UEU1CTKJ
WQHD+
Repro
Reproes across app   launches

That being said, I do think there is an app level workaround that exists for devices on bugged builds of OneUI. Even if this eventually goes away by itself if we do nothing (as OneUI builds roll out naturally over time), it would be great to understand what that workaround is so that RN apps that are experiencing this can use that as a short term solution.
I believe this app level workaround is a really subtle Android thing. I don't think it's necessarily a react-native thing. Here's why:
@trizin posted a great App.tsx snippet on how to repro this bug. But I bootstrapped a vanilla<EMAIL_ADDRESS>project (link) and pasted that App.tsx in and this does not repro. (as @Shanghai- pointed out). However, if I paste that same JS source into another app that does repro, I can see this happen. Additionally, there are other RN apps where this doesn't happen and it's not immediately obvious why some are impacted while others are not.
This leads me to believe that there is some obscure, unexpected line(s) of code that can workaround this issue. The trouble is that this is hard to find, and there's not much alternative besides brute force trial and error. It would be helpful if we could get confirmation that there even is a bug in OneUI and what that bug is, how it was patched, etc, so we could understand how to work around it.
I've tried a number of things to find it, with no success. I've tried replacing various files of an app where this issue is present with corresponding files from the vanilla RN 63 project linked above where this issue is not present. If anyone else is able to dig around and come up with any leads, it would be really awesome if they could share them on this thread. Here are the areas I've tried and didn't come up with anything meaningful.

Android manifest
project level build.gradle
app level build.gradle
Removing linked native modules
MainActivity
MainApplication

I would love to see how these findings compare to what the previous commenters on this thread are seeing.

Possible hint: below are two screenshots from a single user showing the same screen. First screenshot is how things should look like, second screenshot is how things do look like after rotating the app a few times or sometimes after starting the app directly.

Note how in the second screenshot everything is rendered slightly larger except the grey bar behind the number? The text and images are all standard RN elements with usually fixed sizes (image top right is supposed to be 40x40). The grey bar however is a react-native-svg Rect element with a fixed height of 16 (https://github.com/react-native-svg/react-native-svg). So whatever react-native-svg is doing for rendering is not affected by this, regular RN elements are though.  We're using<EMAIL_ADDRESS>

Important note re @luisnaranjo733's device table: I can still reproduce this on build RP1A.200720.012.G988U1UEU1CTLB with a Samsung S20. Everything is fine on app launch, but rotating the phone into landscape mode (if the app supports it) induces the same scaling issue, and it remains after rotating back to portrait. So updated builds still don't completely fix this issue, only mitigate it for portrait-only apps.

This doesn't repro for me anymore. It may have been fixed by the OS. I believe this issue can be closed now.

We had a similar incorrect resolution issue but in an Android app.
It may be worth going direct to Samsung Developer support for help. We were impressed - normally big companies like Samsung aren't interested, so kudos to them for listening.
In case there's a connection, our feedback from Samsung dev support is that our specific issue (which is just the same as the above - a 1080 wide screen returning a resolution of 810, and only on Android 11 One UI 3.0) is due to be fixed in the OS in software version EUBA or EUB9.
However no date was confirmed - but 1-2 months is the estimate.

I'm closing the issue since it has been resolved with the new One U.I update.


Ability to Build project

Cool plugin, it would be awesome to have a "Build" or "Build/Run" button

Do you find yourself needing to build/run your project while Xcode isn't frontmost? For my Stream Deck, I've just been using a keyboard shortcut action that pushes ⌘B, ⌘R, etc.

I'm using react native and Xcode is only my build tool, so remotely triggering a rebuild while not having Xcode in focus (I mainly use VSCode) would be great!


NEXT-18937 fix snippet special characters

1. Why is this change necessary?
The cache for translations seems to use the values of some elements for the cache key (e.g. "translator.Hagebuttenpulver BIO/KBA" contains reserved characters "{}()/@:"). The Symfony CacheItem defines some reserved characters: https://github.com/symfony/symfony/blob/6.2/src/Symfony/Component/Cache/CacheItem.php#L110
There is no check in Snippets / Theme usage of snippets which restricts the use of those special characters.
2. What does this change do, exactly?
The Translator::buildName seems to be a valid position for this fix. The only Class calling it seems to be https://github.com/shopware/platform/blob/v<IP_ADDRESS>/src/Core/Framework/Adapter/Cache/CacheInvalidationSubscriber.php#L223 - so this might be another valid option
The approach replacing is to replace those special characters with "r" because just using and empty string might be dangerous (e.g when using other very similar snippets). My first idea was to use htmlspcialcharacters but the "/" is not included there.
3. Describe each step to reproduce the issue or behaviour.
Additional info at:
https://issues.shopware.com/issues/NEXT-18937
https://forum.shopware.com/t/contains-reserved-characters/90228
4. Please link to the relevant issues (if any).
Fixes https://issues.shopware.com/issues/NEXT-18937
5. Checklist

[X] I have rebased my changes to remove merge conflicts
[ ] I have written tests and verified that they fail without my change
[X] I have created a changelog file with all necessary information about my changes
[ ] I have written or adjusted the documentation according to my changes
[ ] This change has comments for package types, values, functions, and non-obvious lines of code
[X] I have read the contribution requirements and fulfil them.

Hi @keulinho is the unit test enough or do you want more detailed integrations testing there?

Hello,
thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/NEXT-24716
Please use this issue to track the state of your pull request.

Hey @florianliebig thanks again for your contribution, your changes are merged! :tada: :blue_heart:


Data reception from atecc608 implementation

Reading atecc information with this tool ends with timeout and I'm not sure it's correctly implementing the accesses on the chip regarding read direction at least.
N.B.: I'm using the atecc608a instead of the atecc608b, I'm not sure it should change something.
However, my first question would be has it been tested yet on atecc608b or is it still under development for the following aspects?
After some investigation, it appears Microchip's crypto lib and this tool don't work the same way (my observations with "get info" feature).
Cryptoauthlib (custom code following lib samples)

wake up with low pulse for >50us on SDA
tx get info command: 0x60W, 0x03, 0x07, 0x30, 0x00, 0x00, 0x00, 0x03, 0x5D
wait command timing
tx reset address counter: 0x60W, 0x00
rx polling, receive 0x60R, 0x07 + NAK (not ready)
rx polling, receive the result, info : 0x60R, 0x00, 0x00, 0x60, 0x02, 0x80, 0x38
--> I receive 0x00, 0x00, 0x60, 0x02 for the info which is correct for a atecc608a.

gateway-mfs-rs (info command)

wake up with 0x00 data sent on the bus
tx get info command: 0x60W, 0x03, 0x07, 0x30, 0x00, 0x00, 0x00, 0x03, 0x5D
wait command timing
rx receive the result 0x60R, 0x07 and get stuck here with SCL which continue for a byte and SDA which get low.
--> timeout on the bus, retry for 10 times and error

I tried to change timing and let more time to the atecc but it doesn't seems related to that.
The cryptoauthlib implements polling while this tool doesn't but my impression is more there is some inconsistent state inside the atecc without the reset address counter command before reading.
While it's maybe due to the atecc608a usage, I'm just pointing this out because it doesn't follow the Microchip code, calib_execute_command for example and could probably cause some other issues or instabilities.
Also, I can't find a clear explanation in the atecc's datasheet which would define one solution or the other to be the right one.
Any feedback on that would be appreciated.

Well, modifying your tool to follow the cryptoauthlib doesn't fix the issue. It's probably more related to i2cdev (working solution is based on bare metal).

Well, I have finally a bug in my i2c platform driver (i2c-at91-master). Bug related to DMA and fifo...


Incorrect link (Part 3, Section IV, Step 7)

The torrent link for the OLD 3DS firmware.bin leads to the NEW 3DS firmware.bin. Mirrors are correct though. I just changed the link address myself so I could torrent it. Thanks in advanced.

fixed


dual stack proxy config missing a svc IP in virtualHost domains list

Is this the right place to submit this?

[X] This is not a security vulnerability or a crashing bug
[X] This is not a question about how to use Istio

Bug Description
In dual stack k8s svcs get assigned an IPv4 and an IPv6 address. Only 1 of those addresses is being populated into the domains list in the routes. This has some effects on things like AuthorizationPolicy where they won't be applied correctly to the missing IP which is flowing through a passthrough. Not exhaustively tested but in my first quick check it did fail shut at least denying traffic that should have been allowed.
The IP Family address which get's populated is the one which appears first in the list.
abbreviated proxy-config route & k8s svc:
❯ istioctl pc routes sleep-9454cc476-jrgnj.default --name 8000 -ojson
[
    {
        "name": "8000",
        "virtualHosts": [
            {
                "name": "httpbin.httpbin.svc.cluster.local:8000",
                "domains": [
                    "httpbin.httpbin.svc.cluster.local",
                    "httpbin.httpbin",
                    "httpbin.httpbin.svc",
                    "[fd00:10:96::bc57]"
                ],
REMAINDER OMITTED FOR BREVITY...

❯ k get svc -n httpbin httpbin -o yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: httpbin
    service: httpbin
  name: httpbin
  namespace: httpbin
spec:
  clusterIP: fd00:10:96::bc57
  clusterIPs:
  - fd00:10:96::bc57
  - <IP_ADDRESS>
  ipFamilies:
  - IPv6
  - IPv4
REMAINDER OMITTED FOR BREVITY...

Version
❯ istioctl version
client version: 1.18.0
control plane version: 1.18.0
data plane version: 1.18.0 (7 proxies)

❯ kubectl version --short
Client Version: v1.27.1
Kustomize Version: v5.0.1
Server Version: v1.27.3

FWIW this behavior has also been observed on multiple Istio 1.17 versions

Additional Information
No response
Affected product area

[ ] Ambient
[ ] Docs
[ ] Installation
[X] Networking
[ ] Performance and Scalability
[ ] Extensions and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure
[ ] Upgrade
[ ] Multi Cluster
[ ] Virtual Machine
[ ] Control Plane Revisions

How does this impact authz? authz is applied before route?

I'll have to dive deeper to answer that. The failure is repeatable though and testing (locally) with an istiod image built from #45564 it's being applied like I would expect now.

It would be good to provide some info (maybe privately, just in case). This should not happen

Happy to. It's nearly 7:00 here though and I need to step away. Maybe after the WG meetings tomorrow we could huddle for 15 and I'll demo it.

Near as I can surmise the failure mechanism is:

client-side route doesn't match due to the missing IP; traffic sent as passthrough without mTLS identity
server-side rbac uses source identity; doesn't match the passthrough traffic which lacks identity
traffic matches no allow policy and is denied

rbac=trace logs from destination sidecar proxy
# WITHOUT FIX
❯ k logs -n httpbin deploy/httpbin -c istio-proxy --since=1m -f
2023-06-21T18:55:09.386258Z	debug	envoy rbac external/envoy/source/extensions/filters/http/rbac/rbac_filter.cc:114	checking request: requestedServerName: , sourceIP: <IP_ADDRESS>:57164, directRemoteIP: <IP_ADDRESS>:57164, remoteIP: <IP_ADDRESS>:57164,localAddress: <IP_ADDRESS>:80, ssl: none, headers: ':authority', '<IP_ADDRESS>:8000'
':path', '/status/200'
':method', 'GET'
':scheme', 'http'
'user-agent', 'curl/8.1.2'
'accept', '*/*'
'allowed', 'true'
'x-forwarded-proto', 'http'
'x-request-id', 'd8f0c092-4a51-4cbc-a5b3-59fd7804c7bb'
'x-envoy-attempt-count', '1'
'x-b3-traceid', '02be9f8237cbe1904dd18fbdc6741aad'
'x-b3-spanid', '4dd18fbdc6741aad'
'x-b3-sampled', '0'
, dynamicMetadata: 	thread=42
2023-06-21T18:55:09.386296Z	debug	envoy rbac external/envoy/source/extensions/filters/http/rbac/rbac_filter.cc:158	enforced denied, matched policy none	thread=42

# STARTING ISTIOD WITH CODE FIX
2023-06-21T18:56:43.367842Z	info	xdsproxy	connected to upstream XDS server: istiod.istio-system.svc:15012
2023-06-21T18:56:52.591234Z	debug	envoy rbac external/envoy/source/extensions/filters/http/rbac/rbac_filter.cc:114	checking request: requestedServerName: outbound_.8000_._.httpbin.httpbin.svc.cluster.local, sourceIP: <IP_ADDRESS>:33256, directRemoteIP: <IP_ADDRESS>:33256, remoteIP: <IP_ADDRESS>:33256,localAddress: <IP_ADDRESS>:80, ssl: uriSanPeerCertificate: spiffe://cluster.local/ns/default/sa/sleep, dnsSanPeerCertificate: , subjectPeerCertificate: , headers: ':authority', '<IP_ADDRESS>:8000'
':path', '/status/200'
':method', 'GET'
':scheme', 'http'
'user-agent', 'curl/8.1.2'
'accept', '*/*'
'allowed', 'true'
'x-forwarded-proto', 'http'
'x-request-id', 'c7934267-28fc-460b-ab0c-5fc37fc03839'
'x-envoy-attempt-count', '1'
'x-b3-traceid', '33d8d37e7455c876313dd86e2676d6c3'
'x-b3-spanid', '313dd86e2676d6c3'
'x-b3-sampled', '0'
'x-forwarded-client-cert', 'By=spiffe://cluster.local/ns/httpbin/sa/httpbin;Hash=f5fa6425b5d033a35ff5777645796c6dc4d783cfcdf7578b68f28102024294ee;Subject="";URI=spiffe://cluster.local/ns/default/sa/sleep'
, dynamicMetadata: 	thread=43
2023-06-21T18:56:52.591275Z	debug	envoy rbac external/envoy/source/extensions/filters/http/rbac/rbac_filter.cc:154	enforced allowed, matched policy ns[httpbin]-policy[httpbin]-rule[0]	thread=43

More complicated than originally thought. Multiple code paths which need different conversions.

PR is up for review


linter test

Description
Changes proposed in this pull request:

...
...
...

Related issue(s)

/test pre-serverless-controller-lint

/test pre-serverless-controller-lint


Bump python functions-framework==1.4.4

Would you mind updating cmd/python/functions_framework/converter/requirements.txt as well? That's the default when no requirements.txt is provided.

builders/gcf/python38/acceptance/acceptance_test.go also needs a version bump