Support SD-SPI bus sharing. (IDFGH-160)

Due to the limited amount of IO pins on ESP32, it is desirable to share a SPI bus used for SD cards with other SPI devices such as a LCD display.  This is currently not possible with esp-idf since the sdspi_host driver assumes the SD card will be the only device on the SPI bus.
As a "workaround", I have commented out the following line:
https://github.com/espressif/esp-idf/blob/16de6bff245dec5e63eee994f53a08252be720d4/components/driver/sdspi_host.c#L279
The above allows the SD card to share the bus with another SPI device.  I have tested that both devices operate correctly when properly configured (#1080).
I would like to see SD-SPI bus sharing officially supported.  An API revision will likely be required.  The purpose of this post is to begin a conversation towards support.

This seems to be pretty hard because SPI protocol of SD cards requires CS to be low for the duration of SD transaction. Single SD transaction can consist of multiple SPI transactions. Because of this, SDSPI driver controls CS in software.
If the SPI bus is shared, then nothing prevents another task from sending a transaction to a different device in between two parts of SD card transaction. However, since SDSPI driver keeps CS asserted, this extra transaction will be received by the card as well.
If in your use case the SD card and another device are only used sequentially, then the workaround you mention will work. But in the general case of multiple tasks accessing multiple SPI devices on the same bus concurrently, it will likely not work.

I would guess there are also other drivers/apps where it is desirable to have deterministic SPI bus use: guaranteeing a group of transactions complete sequentially on the bus without interruption.
As a starting point, I propose the following:

Add a spi_device_aquire API call to the SPI driver.  This will lock a mutex and return an opaque handle for use in future API calls.
While the mutex is held, all calls to spi_device_queue_trans will block.
A new API call spi_device_queue_trans_exclusive(void* handle, ...) will be used to send/receive data while the mutex is held.  The handle is checked and an error is returned if it does not match what is returned in acquisition call above.
After all transactions are queued, the mutex is released with spi_device_release(void* handle).  If the handle does match what was returned during acquisition, an error is returned.

With the above, all current code continues to work and exclusive use of the SPI device is transparent.

@OtherCrashOverride  how does it work for you both (SD & Display) on the same bus. i tried doing it but SD card always fails. I have a display which comes with the SD card, I have been trying to make display and SD work on the same bus but so far I have no luck. @OtherCrashOverride would you mind sharing your SD card configuration please. I am curious. Thank you.

Could there at least be a Kconfig option to ignore the "return" mentioned above? That way a developer can implement their own locking mechanism if they need the bus for other devices.

@OtherCrashOverride I have modified esp-idf according to your suggestion, but cannot properly configure LCD and SPI SD. Could you please give me your configuration method?

@Abol-Wang
The LCD initialization is here:
https://github.com/OtherCrashOverride/go-play/blob/c573693f91864e116c6ccd6a18becbb020506f3b/odroid-go-common/components/odroid/odroid_display.c#L683-L711
The SD card initialization is here:
https://github.com/OtherCrashOverride/go-play/blob/c573693f91864e116c6ccd6a18becbb020506f3b/odroid-go-common/components/odroid/odroid_sdcard.c#L39-L66

Thank's in advance!
I'm using the Olimex ESP32 EVB board, and I have a lot of problems to use the SD_MMC and SPI  simultaneously, I spent a lot of time, but when I believe that's fixed another problem appears and doesn't work.
I'm using arduino libraries and platform.
The ESP32 EVB works whit SD_MMC 1 bit protocol, and need only 3 lines, 02 DAT0, 14 CLK, 15 SD_CMD, and SPI whit default whit, 02 MISO, 14 CLK, 13 MOSI, and 17 CS.  I tried to initialize before and end after every use but doesn't work. The pin MISO and MOSI are attached to the SPI or the SD and, for me, it's impossible to do.
Anyone knows how use the SD_MMC and SPI  simultaneously?

I'm facing the same problem of not being able to share the SPI bus with an SD card using the SD SPI driver.
I'm initializing the bus first with the SDSPI driver, and then I add another device (SPI/CAN controller) to the bus. The SD card is written every minute, while messages from the CAN bus are received and sent every second. I have observed the following:
The SD card is written/read with no problem as long as the system starts using the SPI/CAN interface. I measured the CS pin of the SD card module I'm using, and the whole SD writing operation (3 SPI commands) lasts less than 150 ms.
As soon as the SPI/CAN interface starts receiving/sending messages, all write/read operations on the SD card return the same errors:
sdspi_host: data CRC failed, got=0x1402 expected=0xff91
sdspi_host: 30 2c 30 2c 00 2c 30 2c 30 2c 30 2c 30 2c 30 2c
sdspi_host: sdspi_host_start_command: cmd=17 error=0x109
sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x109
sdmmc_cmd: cmd=17, sdmmc_req_run returned 0x109
diskio_sdmmc: sdmmc_read_blocks failed

I already tried using a semaphore to control the access to the SPI bus. It does not work, the writing operation fails with the same error. I have even made some small changes to the sdspi driver to use the function spi_device_acquire_bus and spi_device_release_bus along to try to guarantee that there are no pending transactions on the bus before being used again. It doesn't work either.
After  @igrr 's first response to this thread I thought that a simple mutex would solve this problem but obviously it's not that easy. Is there any way to share the SPI bus with an SD card?

Hi,
Has this issue been fixed?
We are facing a similar problem, as because of the limited number of IO we decided to share same set of SPI signals with the SD card (SPI) and other SPI devices.
Thanks

If you initialize the SD card first the bus will then be available and you can add peripherals without any IDF code changes.
Robert Vogt IV
CEO
IOSiX, LLC
1300 Tefft Ct #1
Saline, MI  48176
P: +1-855-OBD-1939
C: +1-734-730-9690
<EMAIL_ADDRESS>
On Nov 13, 2019, at 2:14 AM, Satyan Raj<EMAIL_ADDRESS>wrote:

Hi,
Has this issue been fixed?
We are facing a similar problem, as because of the limited number of IO we decided to share same set of SPI signals with the SD card (SPI) and other SPI devices.
Thanks
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

If you initialize the SD card first the bus will then be available and you can add peripherals without any IDF code changes. Robert Vogt IV CEO IOSiX, LLC 1300 Tefft Ct #1 Saline, MI 48176 P: +1-855-OBD-1939 C: +1-734-730-9690<EMAIL_ADDRESS>…
On Nov 13, 2019, at 2:14 AM, Satyan Raj @.***> wrote:  Hi, Has this issue been fixed? We are facing a similar problem, as because of the limited number of IO we decided to share same set of SPI signals with the SD card (SPI) and other SPI devices. Thanks — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

What IDF version are you using? Because in my previous tests (witn an oldish version (mid april) of the main branch) initializing the SD card first did not make any difference. The problem was visible when the second device started using the bus (there was no problem when the second device was added to the bus).

I had a hard time making SD card + TFT display work on the same SPI bus. It
would work for some time but then display would get stuck or SD card would
stop logging. I tried using the mutex/semaphore to control the CS line but
the dma contrl logic somehow did not like it. I ended up putting SD card on
a separate SPI bus.
Amar Dhore
--
Amar
On Wed, Nov 20, 2019 at 11:11 AM Alfonso H<EMAIL_ADDRESS>wrote:

If you initialize the SD card first the bus will then be available and you
can add peripherals without any IDF code changes. Robert Vogt IV CEO IOSiX,
LLC 1300 Tefft Ct #1 https://github.com/espressif/esp-idf/pull/1
Saline, MI 48176 P: +1-855-OBD-1939 C: +1-734-730-9690<EMAIL_ADDRESS>… <#m_7106927704071673194_>
On Nov 13, 2019, at 2:14 AM, Satyan Raj @.***> wrote:  Hi, Has this
issue been fixed? We are facing a similar problem, as because of the
limited number of IO we decided to share same set of SPI signals with the
SD card (SPI) and other SPI devices. Thanks — You are receiving this
because you are subscribed to this thread. Reply to this email directly,
view it on GitHub, or unsubscribe.
What IDF version are you using? Because in my previous tests (witn an
oldish version (mid april) of the main branch) initializing the SD card
first did not make any difference. The problem was visible when the second
device started using the bus (there was no problem when the second device
was added to the bus).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/espressif/esp-idf/issues/1597?email_source=notifications&email_token=AFTF7M2OQ6OKAOGE4RVSFZLQUVOURA5CNFSM4EPYVEF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEESRGUA#issuecomment-556077904,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFTF7MYGI6K6BDRSLDYZG2DQUVOURANCNFSM4EPYVEFQ
.

--
Amar Dhore

SPI bus sharing with SDSPI has been added in https://github.com/espressif/esp-idf/commit/067f3d21c9f1f3bc76361a0e3cb656216f2583ff — please see the new sdspi_host_init_device, sdspi_host_remove_device functions.

Hi,
I hacked this issue with SPI_acquire functions in release v3.3 and it was working. Now, I changed to release v4.1 and my hack not working.
Please, where are the main changes in SDSPI and MMC driver?
Thank you very much.
Vilem

Hi @zavovi, there has been a number of changes between v3.3 and v4.1... Best way to browse them is to start with git log. Assuming you are in the esp-idf directory:
git log release/v4.1...v4.0-dev -- components/driver/sd*.c

Hi @igrr , thank you. Do you know something more about SPI driver? I have already right used xSemaphoreTake and xSemaphoreGive for all tasks, where I call the SPI transactions. But it seems, that when I call some functions from FatFs, it seems, that it is processed outside the call.
For example, I call this:
tcs_err_t tcs_sdcard_read_from_file(const char * filename, tcs_buffer_t * buffer)
{
	tcs_err_t err = TCS_OK;
	int readsize = 0;

	if(!tcs_sdcardSem)
		return TCS_ERR_SDCARD_INIT;

	TCS_ASSERT(filename != NULL);
	TCS_ASSERT(buffer != NULL);
	TCS_ASSERT(tcs_sdcardSem != NULL);

	/* LOCK */
	_tcs_sdcard_lock();

	/* Open file */
	int f = open(tcs_sdcard_path(filename), O_RDONLY);
	if(f <= 0)
	{
		TCS_ERROR_PRINTF(LOG_CATEGORY, "Error when open file '%s': %d", filename, f);
		err = TCS_ERR_SDCARD_OPEN;
		goto ERROR;
	}

	TCS_WARNING_PRINTF(LOG_CATEGORY, "Pre-read...");

	/* Read file */
    readsize = read(f, tcs_buffer_get_tail(buffer), tcs_buffer_get_free_size(buffer));
    if(readsize < 0)
    {
    	err = TCS_ERR_SDCARD_READ;
    	goto ERROR;
    }

    buffer->used += readsize;

    TCS_WARNING_PRINTF(LOG_CATEGORY, "Post-read...");

ERROR:
	if(f > 0)
		close(f);

	/* UNLOCK */
	_tcs_sdcard_unlock();

	return err;
}

I get error code 0x107, it is timeout. But when I disable my TFT driver, it is working properly. It seems, that something is processed outside my call. Or I don't understand, where is the difference from v3.3.
Thank you.

SPI bus sharing with SDSPI has been added in 067f3d2 — please see the new sdspi_host_init_device, sdspi_host_remove_device functions.

Hello, is SPI and SDSPI sharing working in esp-idf release v4.0 ?

Hi all, I am sorry for long delay, but I still not solved my issue. I am really struggling with it and I am tired. Lot of month and it looks, that it is working, but not!
I have own HW, that it have same pinout for SD and TFT on SPI as M5Stack. I have M5Stack too.
The esp-idf version is 4.2 merged yesterday.
My code:

Initialized SPI in TFT driver and initialized display. - OK

Started different task for updating the TFT display. Before all SPI writes, I calling xSemaphoreTake and spi_device_acquire_bus. Then I call spi_device_queue_trans and spi_device_get_trans_result for all transactions (6).

Initialized SD card (without SPI init). - OK
Read SD card info (sdmmc_card_print_info). - OK
Check, if folder exists (used stat function). - Issue on some SD cards (ADATA 8GB is ok, GoodRAM 8 GB or SanDisk 16GB is failed with timeout - 0x107)
Create directory (mkdir). Issue same as 4
Read file from SD (open, read, close). - OK on all SD cards
Create and write into file. - OK on all SD cards
Format SD (own function made from init fatfs function). - Issue same as 4

The TFT display is still ok.
When I disable task, which is updating the TFT display, then all SDs are working properly.
It seems, that there is some timing problem. Like SPI write is still writting to display, after spi_device_get_trans_result or something like that. Maybe the SD task is stopped or something like that.
The issue LOG in point 4:
E (3422) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x107
E (3423) diskio_sdmmc: sdmmc_read_blocks failed (263)
E (4587) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x107
E (4588) diskio_sdmmc: sdmmc_read_blocks failed (263)
The BAD SD card sdmmc_card_print_info:
Name: 00000
Type: SDHC/SDXC
Speed: 20 MHz
Size: 7431MB
I see this info in LOG too:
I (2237) sdspi_transaction: cmd=52, R1 response: command not supported
I (2284) sdspi_transaction: cmd=5, R1 response: command not supported
Please, could you help me? I am solving this issue lot of months and I am really tired from it :-( Please help!!!
Thank you very much.
Best regards,
Vilem

Hi @zavovi ,
Due to the strange behavior of SD cards over SPI bus, you need to initialize the devices on the same bus in the following sequence strictly:

The CS of other devices should be hold high. Suggested way is using gpio.
Initialize the SPI bus.
The SD card should be initialized before all other devices to put it into SPI mode
Initialize other devices

This is because, the SD card will respond to the data stream (even without CS active) of other devices when it's just powered up and not in the SPI mode. But to put SD card into SPI mode, you have to avoid conflicts from other SPI slaves first. (or you can try pullups on all CS wires).

Hi @edouardreg ,
Sorry, but this is a new feature introduced in IDF v4.2 (067f3d21c9f1f3bc76361a0e3cb656216f2583ff). This involves quite a few changes and cannot be easily backported to earlier versions..

Hi @ginkgm ,
thank you for your reply.
I've tried put the SD card initialization to the first place, but no change.
Here is part of my init code:
gpio_reset_pin(APP_TFT_PIN_CS);
/* Set as output */
gpio_set_direction(APP_TFT_PIN_CS, GPIO_MODE_OUTPUT);
/* change gpio interrupt type for one pin */
gpio_set_intr_type(APP_TFT_PIN_CS, GPIO_INTR_DISABLE);
gpio_set_level(APP_TFT_PIN_CS, 1);

static sdmmc_host_t host = SDSPI_HOST_DEFAULT();
static sdspi_device_config_t slot_config = SDSPI_DEVICE_CONFIG_DEFAULT();

// Options for mounting the filesystem.
	// If format_if_mount_failed is set to true, SD card will be partitioned and
	// formatted in case when mounting fails.
static esp_vfs_fat_sdmmc_mount_config_t mount_config =
{
	.format_if_mount_failed = false,
	.max_files = 5,	/* Maximum opened files in one time */
	.allocation_unit_size = 4096 * 1024
};

spi_bus_config_t buscfg={
		.miso_io_num=TCS_SDCARD_PIN_MISO,
		.mosi_io_num=TCS_SDCARD_PIN_MOSI,
		.sclk_io_num=TCS_SDCARD_PIN_CLK,
		.quadwp_io_num=-1,
		.quadhd_io_num=-1,
		.max_transfer_sz=LV_VDB_SIZE*3+8
	};

	/* Initialize SPI bus */
	ret = spi_bus_initialize(HSPI_HOST, &buscfg, 1);
	if(ret != ESP_OK)
		return TCS_ERR_SDCARD_INIT;

ret = esp_vfs_fat_sdspi_mount(TCS_SDCARD_MNT_NAME, &host, &slot_config, &mount_config, &card);
	if (ret != ESP_OK)
	{
		TCS_ERROR_PRINTF(LOG_CATEGORY, "SD card error mount : %d (%s)\n", ret, esp_err_to_name(ret));
		err = TCS_ERR_SDCARD_MOUNT;
		goto ERROR;
	}

	// Card has been initialized, print its properties
	sdmmc_card_print_info(stdout, card);

The initialization is OK for all my SD cards. The sdmmc_card_print_info  is OK too.
After that, the TFT display is initialized OK and working properly.
After that, I want to create directory and I get this error:
E (3492) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x107
E (3493) diskio_sdmmc: sdmmc_read_blocks failed (263)
E (4825) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x107
E (4826) diskio_sdmmc: sdmmc_read_blocks failed (263)

Then I read the text file, and it is OK. Write is OK too.
I am handling CS line for TFT by GPIO in each transaction by gpio_set_level(APP_TFT_PIN_CS, 0/1);.

Here is example of my make directory function:
tcs_err_t tcs_sdcard_create_dir(const char * filename)
{
	tcs_err_t err = TCS_OK;
	esp_err_t ret;

	if(!tcs_sdcardSem)
		return TCS_ERR_SDCARD_INIT;

	TCS_ASSERT(filename != NULL);
	TCS_ASSERT(tcs_sdcardSem != NULL);

	/* LOCK */
	_tcs_sdcard_lock();

    ret = mkdir(tcs_sdcard_path(filename), 0x777);
	if(ret != ESP_OK)
	{
		TCS_ERROR_PRINTF(LOG_CATEGORY, "Error when creating directory '%s': %d", filename, errno);
		err = TCS_ERR_SDCARD_NEWDIR;
		goto ERROR;
	}

ERROR:

	/* UNLOCK */
	_tcs_sdcard_unlock();

	return err;
}

static void _tcs_sdcard_lock(void)
{
	/* Wait for the other task done the TFT (SPI) operation */
    tcs_tft_driver_take();

	app_gpio_set_pin(APP_TFT_PIN_CS);
	gpio_hold_en(APP_TFT_PIN_CS);

    /* Wait for the other task done the SD card operation */
    xSemaphoreTake(tcs_sdcardSem, portMAX_DELAY);
}

static void _tcs_sdcard_unlock(void)
{
	/* SD card operation done -> release for the other task */
	xSemaphoreGive(tcs_sdcardSem);

	gpio_hold_dis(APP_TFT_PIN_CS);
	app_gpio_clear_pin(APP_TFT_PIN_CS);

	/* TFT (SPI) operation done -> release for the other task */
	tcs_tft_driver_give();
}

Here are transfer function for TFT (called both):
static void _tcs_tft_disp_send_addr(uint16_t x1, uint16_t x2, uint16_t y1, uint16_t y2, void *color, uint32_t len)
{
    esp_err_t ret;
    int i = 0;

    //Transaction descriptors. Declared static so they're not allocated on the stack; we need this memory even when this
    //function is finished because the SPI driver needs access to it even while we're already calculating the next line.
    static spi_transaction_t trans[6];

    //In theory, it's better to initialize trans and data only once and hang on to the initialized
	//variables. We allocate them on the stack, so we need to re-init them each call.
	for (i=0; i<6; i++)
	{
		tcs_memset(&trans[i], 0, sizeof(spi_transaction_t));
		if ((i&1)==0)
		{
			//Even transfers are commands
			trans[i].length=8;
			trans[i].user=(void*)0;
		}
		else
		{
			//Odd transfers are data
			trans[i].length=8*4;
			trans[i].user=(void*)1;
		}
		trans[i].flags=SPI_TRANS_USE_TXDATA;
	}
	/* Command */
    trans[0].tx_data[0]=TCS_TFT_CMD_CASET;           //Column Address Set

    /* Data */
    trans[1].tx_data[0]=(uint8_t)(x1>>8);
    trans[1].tx_data[1]=(uint8_t)(x1&0xff);
    trans[1].tx_data[2]=(uint8_t)(x2>>8);
    trans[1].tx_data[3]=(uint8_t)(x2&0xff);

    /* Command */
    trans[2].tx_data[0]=TCS_TFT_CMD_PASET;           //Page address set

    /* Data */
    trans[3].tx_data[0]=(uint8_t)(y1>>8);
    trans[3].tx_data[1]=(uint8_t)(y1&0xff);
    trans[3].tx_data[2]=(uint8_t)(y2>>8);
    trans[3].tx_data[3]=(uint8_t)(y2&0xff);

	/* Command */
    trans[4].tx_data[0]=TCS_TFT_CMD_RAMWR;

	/* Data */
    trans[5].tx_buffer=color;        //finally send the line data
    trans[5].length=len*8;          //Data length, in bits
    trans[5].flags=0; //not SPI_TRANS_USE_TXDATA flag

	tcs_tft_driver_take();
    spi_device_acquire_bus(tcs_tft_ctx.spi, portMAX_DELAY);
	app_gpio_clear_pin(APP_TFT_PIN_CS);
    //Queue all transactions.
	for (i=0; i<6; i++)
	{
		ret=spi_device_queue_trans(tcs_tft_ctx.spi, &trans[i], portMAX_DELAY);
		TCS_ASSERT(ret==ESP_OK);
	}

    tcs_tft_ctx.send = TCS_TRUE;
}

void tcs_tft_driver_send_finish(void)
{
    spi_transaction_t *rtrans;
    esp_err_t ret;

    if(!tcs_tft_ctx.send)
    {
    	TCS_ASSERT(0);
    	return;
    }

    //Wait for all 6 transactions to be done and get back the results.
    for (int x=0; x<6; x++)
    {
        ret=spi_device_get_trans_result(tcs_tft_ctx.spi, &rtrans, portMAX_DELAY);
        TCS_ASSERT(ret==ESP_OK);
        //We could inspect rtrans now if we received any info back. The LCD is treated as write-only, though.
    }
	app_gpio_set_pin(APP_TFT_PIN_CS);
    spi_device_release_bus(tcs_tft_ctx.spi);
	tcs_tft_driver_give();

    tcs_tft_ctx.send = TCS_FALSE;
}

Hi @zavovi ,
The sdspi driver will control the bus at proper time, you don't need to manually controls it's CS. This depends on a bus acquiring feature (https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/spi_master.html#_CPPv422spi_device_acquire_bus19spi_device_handle_t10TickType_t) introduced in IDF v.3.2. This will also forbids other devices from using that bus. (https://github.com/espressif/esp-idf/blob/master/components/driver/sdspi_host.c#L455 introduced in v4.2).
Maybe your manual control breaks the GPIO logic of SDSPI?

Hi @ginkgm ,
I know, that the sdspi driver can handle the CS lines, but when I use it, then it seems, that not working nothing (read/write, mkdir, ...) with BAD SD card. When I am handling CS manually, then the read/write working.
I had the CS lines controlled from sdspi with my GOOD SD card, but now, when I am solving other my cards, I am trying all my ideas...

Ok, I changed the CS handling back to the SPI driver and leave the SD init the first, it working same. Only read/write on BAD SD cards.

Hello @ginkgm ,
I added HW PullUp to CS wires, but no change. Still cannot mkdir on my "BAD" SD cards. It works only when disable task, which flushing data to TFT display.
I don't understand, why it is not working, the FreeRTOS semaphore should block right, or not? It seems, that mkdir take more time than read/write.
Any other suggestions please?
Thank you.

@zavovi i had the same problem and it turned out to be the dma access. Try this: assign dma channel 1 to tft and dma channel to 2 sd card and see if it make any difference. Good luck.

Hello @amardhore ,
Thank you for your advice. I tried initialized HSPI for SD card with DMA 2 and VSPI for TFT with DMA 1 and then the SD card not working (cannot read/write).  Only SD init is ok.
I tried VSPI for SD and HSPI for TFT and no changed. Still SD card not working.

@zavovi  so sd init is working ok? how long is your file name? give this  a try:  in the menuconfig, try selecting long names. clean and then compile. hope it helps.
Amar

Hello @amardhore ,
my file names:
mkdir "TCS"
mkdir "TCS/trains"
mkdir "TCS/acc"
Read/write testing on config file "wifi.cfg"
I have enabled long names and maximum was increased to 60.
SD initialization is good in all my tests (shared DMA, not shared DMA, etc...). I am initializing the SD card first.
In my half-working code (read/write working, mkdir not), I can create directory, before I am refreshing the screen (TFT), when I am refreshing the screen, I cannot create directory, only read/write a file. I tried increase refresh period - no change.
Thank you,
Vilem

Can you provide a demo code that coexists with  SD card and  LCD on the sharing SPI bus?

@Alvin1Zhang: Looks like people are still struggling SPI bus issue issue with SD card.

@zavovi Can you please share the sample code, for our reference.

Hello @satyanraj,
I am sorry, I haven't got time for example for now. I am working on release of my device, which is at the end of this month. I used internal ESP32 memory as filesystem instead of SD card. For now, it is enough for me and the SD card will be enabled later.
Thank you.
Vilem

Hello @satyanraj,
I am sorry, I haven't got time for example for now. I am working on release of my device, which is at the end of this month. I used internal ESP32 memory as filesystem instead of SD card. For now, it is enough for me and the SD card will be enabled later.
Thank you.
Vilem

sure

@zavovi I have used a logic analyser and found a bug which causes this error if the other device on the SPI bus is in half-duplex mode. See: https://github.com/espressif/esp-idf/issues/7138
Hopefully this could help you.

I am writing this so that this does not happen to anyone else.
I was able to read and write on the SD using VFS but some CRC errors appeared when initializing other SPI devices in the same bus such as:
E (12401) sdmmc_cmd: sdmmc_read_sectors_dma: sdmmc_send_cmd returned 0x107
E (12401) diskio_sdmmc: sdmmc_read_blocks failed (263)
I could also see that when the SD card was inserted, the SPI communications somehow collided with the other SPI devices on the same bus. It was as if the SD always answered to SPI although its #CS pin was not asserted. This happened although the SD card was previously mounted as SPI.
The issue is now solved. The problem was the SD card. I was using a random chinatown SD card, changing the SD card did the trick for me.


Dice over all samples

I am new in Keras. I am trying to use your code in brain tumor segmentation but I confused about the dice metric. I don't know actually this code measures the dice for each image and then measures the mean value over all samples or it just measures the dice over all sample once. What I mean, consider that I have an input like (3000,218,218) includes 3000 samples. is it calculate the dice for each 218*218 image and then measure the mean over all 3000 samples or it convert this huge matrix to a vector and the measure the dice for all samples once.
Thanks

Hi, welcome to Keras community :).
The code I provided calculates Dice metric over whole batch - it doesn't average over samples.

Thanks for your response. I understand now. So, in this way, when I give a validation set, it measure the dice again over set!
I have another question! I wrote the your code using np insted of keras values. However, the dice value is different. What do you think! is there any advantage to use keras variables than numpy!?

So, in this way, when I give a validation set, it measure the dice again over set!

Exactly, so this is not a reliable metric for reporting (in a paper for example). I suggest that for validation/test you calculate the Dice metric per image (batch size 1) and then average over those.

I wrote the your code using np insted of keras values. However, the dice value is different. What do you think! is there any advantage to use keras variables than numpy!?

How large is the difference? It's normal that there is some difference, usually because default numpy uses float64 precision and Tensorflow uses float32 precision. However, if the difference is large, it might be that the implementations are different.

For instance; for 1 epoch in Keras I have dice over whole images in validation set like 0.0442, but when I save the model exactly related to that epoch and try to use model.predict function over whole same validation set, I have dice value (Numpy) around 0.0698!!
The difference is high actually if you look some other metrics like precision!!
Keras (precision:0.3563)
Numpy(recall: 0.9464)
def precision(y_true, y_pred):
true_positives = K.sum(K.round(K.clip(y_true * y_pred, 0, 1)))
predicted_positives = K.sum(K.round(K.clip(y_pred, 0, 1)))
precision = true_positives / (predicted_positives + K.epsilon())
return precision
def precision(y_true, y_pred):
true_positives = np.sum(np.round(np.clip(flair_imgs_mask_validation * result, 0, 1)))
predicted_positives = np.sum(np.round(np.clip(result, 0, 1)))
precision = true_positives / (predicted_positives)
return precision

I found some bugs in my code. So basically the values are more or less same with a few differences that can be ignored I think.
dice (Keras): 0.002789
dice (Numpy): 0.002946
and the other metrics is more or less like this in initial epochs.


NO-TICKET-repair-post-bug

Accept 'no-reuse' instead of 0 as negative for reuse
POST email_address instead of user object
Update tests

See issue here for more details:
https://github.com/alphagov/digitalmarketplace-frontend-toolkit/issues/306

Looks good - nice catch that we don't need to pass the framework in the URL too.
:+1: once tests pass.

@TheDoubleK
Also realised we were dealing with supplier_framework objects everywhere so made that clear and added a check to see that the declaration is complete before we allow reuse.
Seemed like the right thing to do.

Sorry, should have spotted this the first time round :/
Merge once Travis is happy :+1:

Going to merge this and fix the validation on the reuse page later.


fix: add implementation of hooks in abstract portal

What does this PR do?
Implements the hooks inside the abstract Portal
Related ticket
#186
Fixes #
Type of change

[ ] Chore
[x] Bug fix
[ ] New feature
[ ] Documentation update

Check list

[ ] Unit tests for any smart contract change
[ ] Contracts and functions are documented

Codecov Report

Merging #188 (9c372dc) into dev (0481ff3) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##              dev     #188   +/-   ##
=======================================
  Coverage   96.77%   96.77%
=======================================
  Files          10       10
  Lines         155      155
  Branches       40       40
=======================================
  Hits          150      150
  Misses          4        4
  Partials        1        1

Files Changed
Coverage Δ

src/example/EASPortal.sol
92.85% <ø> (ø)

src/interface/AbstractPortal.sol
100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Failed to parse Vimeo response

I am not sure but recently something changed and I am getting below error:
Failed to parse Vimeo response Error code 3
Looks lite something has been changed or altered. Now not able to get the video file url which can be downloadable. Does anyone have any workaround ?

have you find any solution?

@Krups-Sharma , @superm0  got any solution for this issue. In my app not working any videos.


Adding Sombra to Heros List

Leaving this open until the API catches up and adds the functionality.

Thank you anthok


default_branch setting in safe-settings not working

Unable to set Develop branch as default
What is actually happening?
I tried making Develop branch as default instead of main. But the below script doesn't work and main branch remains as default branch.
repository:
  default_branch: develop

What are the ways of making develop branch as default using safe-settings. Please suggest me.

Can anyone help me with this, please?

Are you trying to rename the main branch to develop or set the an existing develop branch as the default branch instead of main?

I am trying to set the existing develop branch to default instead of main branch, but not working.


Update DG

Added in proposed implementation and design consideration for

add player
add schedule
delete schedule
edit player
edit schedule
clear
view lineup

Codecov Report

Merging #264 (398facd) into master (d67130f) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #264   +/-   ##
=========================================
  Coverage     55.09%   55.09%
  Complexity      612      612
=========================================
  Files           106      106
  Lines          2817     2817
  Branches        384      384
=========================================
  Hits           1552     1552
  Misses         1111     1111
  Partials        154      154

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 d67130f...398facd. Read the comment docs.


fix: Use exp_m1 instead of subtracting directly

Added fix to use exp_m1 function to compute sf for Gumbel distribution more accurately

figured I'd also add tests to make this a notable difference. These two tests fail the previous implementation and pass this one.


Feature request: configure the TOC to be collapsed initially

Hi, in cases when spaces are precious, it would be nice if there's a configuration such that the TOC is collapsed by default (and only open with the user open it). Would you mind adding this feature?
Thanks.

It make sense, I will add this feature.
Thanks for feedback

Great.
Thank you!


HF1  - consensus - sync committees

https://notes.ethereum.org/@vbuterin/HF1_proposal#Sync-committees

spec PR has been merged: https://github.com/ethereum/eth2.0-specs/pull/2130

Going to close this one - the state transition is complete, gossip is handled under #3803 and there are separate tickets for the validator duties.


Incorrect __typename Generation on Custom Type

Before opening, please confirm:

[X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
[X] I have searched for duplicate or closed issues.
[X] I have read the guide for submitting bug reports.
[X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
18.18.2
Amplify CLI Version
12.10.1
What operating system are you using?
Mac
Amplify Codegen Command
codegen
Describe the bug
When we run Amplify codegen setup for Angular, we are getting incorrect __typename generation. Currently, on a single type only, we are getting __typename: string instead of __typename: 'TypeName'
Expected behavior
When we generate Angular Code with Codegen, the __typename should be set to the name of the custom type it belongs too
Reproduction steps
Run Amplify CodeGen with the schema listed below.
GraphQL schema(s)

# Put schemas below this line

enum WidgetType {
    ReportingLocationTrendsWidget
    ReportingLocationTimeSeriesWidget
    ReportingLocationKPIGaugeWidget
    ReportingLocationMultiTrendGraphWidget
    GaugeLocationsWidget
}

enum FlowDirection {
    IN
    OUT
}

type GaugeLocationsWidget implements Widget {
    id: ID
    order: Int
    widget_type: WidgetType
    name: String
    intent_id: String
    rows: String
    columns: String

    flow_direction: FlowDirection
    locations: [GaugeLocation]
}

type GaugeLocation {
    name: String
    label: String
    offset: Int
    color: String
}

Log output

# Put your logs below this line

✔ Generated GraphQL operations successfully and saved at src/graphql
✔ Code generated successfully and saved in file src/app/services/api.service.ts

Additional information
Right now, everything compiles and deploys correctly if we manually modify api.service.ts to update
__typename: string --> __typename: 'GaugeLocation'
This is working correctly for our other 75+ types and inputs but this one set is causing the issue.
.graphqlconfig.yml

projects:
  clientapp:
    schemaPath: ./amplify/backend/api/clientapp/build/schema.graphql
    includes:
      - src/graphql/**/*.graphql
    excludes:
      - ./amplify/**
      - src/app/services/api.service.ts
    extensions:
      amplify:
        codeGenTarget: angular
        generatedFileName: src/app/services/api.service.ts
        docsFilePath: src/graphql
        maxDepth: 5
extensions:
  amplify:
    version: 3

api.service

{
            __typename: "GaugeLocationsWidget";
            id?: string | null;
            order?: number | null;
            widget_type?: WidgetType | null;
            name?: string | null;
            intent_id?: string | null;
            rows?: string | null;
            columns?: string | null;
            flow_direction?: FlowDirection | null;
            locations?: Array<{
              __typename: string; <--------Issue is here, should be __typename: "GaugeLocation"
              name?: string | null;
              label?: string | null;
              offset?: number | null;
              color?: string | null;
            } | null> | null;
          }

An update:
When we isolate GaugeLocation as the only type in the Union, the corresponding code in api.service is generated correctly. However, as soon as we add 2nd type to the Union it fails.
If we remove GaugeLocation from the union altogether, all types in the union generate successfully.
The only difference between GaugeLocation and the rest of the type definitions is it has a complex type for one of its properties.


concept exercises: go.mod is missing

When I download a concept exercise the file go.mod is missing.
$ exercism download --exercise=annalyns-infiltration --track=go

Downloaded to
/home/user/exercism/go/annalyns-infiltration

$ tree annalyns-infiltration
annalyns-infiltration
├── annalyns_infiltration.go
├── annalyns_infiltration_test.go
├── HELP.md
├── HINTS.md
└── README.md

0 directories, 5 files

But when I download a practice exercise, that file is present and I can start solving.
$ exercism download --exercise=tree-building --track=go

Downloaded to
/home/user/exercism/go/tree-building

$ tree tree-building
tree-building
├── go.mod
├── HELP.md
├── README.md
├── tree_building.go
└── tree_building_test.go

0 directories, 5 files

I also noticed this. To give more context about the issue:
From go 1.16 and beyond, all the go commands run now in a module-aware mode. This means that they expect a go.mod file to indicate the folder is a module. So:

People with versions of go <16 won't have this problem and everything will work for them. I tested by installing several versions of go and I can confirm this is the case.
People with go > 16 have 2 options:

Add a go module in the folder with something like go mod init <exercise_name>
Set the environment variable GO111MODULE to auto. This makes go commands work in a module-aware mode if they detect a go.mod in the directory, otherwise they revert to the behavior of go <16.

But like @siebenschlaefer suggested, I think the easiest solution would be to provide the go.mod file to the student.

go 1.16 here. Can confirm.
Suggest adding go.mod files in as stated by the above two individuals.

I think we fixed this... the latest CI tests now check that every exercise directory has a go.mod file.
I ma not sure how long it takes changes in the repo to reach the website, but is anyone still seeing this now?

I'm not seeing this, I think we can close this one off @jmrunkle

At least for annalyns-infiltration I can confirm that the client now downloads a go.mod file.
The issue seems to be fixed. (But I haven't looked at all the other exercises.)


Decompress or untar the wasm binary if it is needed when pulling it via HTTP/HTTPS

Decompress or/and untar the wasm binary when it is pulled via HTTP/HTTPS.
By this, we can support the compressed stream as well (even with the wrong content-type)
In details, when pulling bytes from HTTP/HTTPS server, if the bytes do not have proper magic number for Wasm Binary,
tries to ungzip or untar based on the magic numbers of each fileformat.
In case of untar, this PR assumes that there is only one file in the same sense that OCI Image specification for Wasm binary.
Basically, it does the best effort based on the magic number of bytes.
If it fails to decompress or untar, just uses the original bytes.

@ingwonsong: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

gencheck_istio
184d8c57d2a500c843b94592cc9d88325958a8ca
link
true
/test gencheck_istio

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ingwonsong: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

gencheck_istio
184d8c57d2a500c843b94592cc9d88325958a8ca
link
true
/test gencheck_istio

lint_istio
184d8c57d2a500c843b94592cc9d88325958a8ca
link
true
/test lint_istio

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@ingwonsong: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name
Commit
Details
Required
Rerun command

integ-security-multicluster_istio
0bbf529c6cc88db4f473446b6a9d59a97d6128c2
link
true
/test integ-security-multicluster_istio

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@howardjohn Do you have any thought?

hold for address comments, feel free to remove it


Expand create keystone app CLI

Updates the create-keystone-app cli.

Add the ability to create an app in an existing empty directory
Add the ability to select from available templates
Added the blank template

I think the plan is to get away from template directory and use create-next-app like --example switch

We can still do that. Is there an issue that describes how it would work?
I don't think any future changes to create-keystone-app would need to block this. It can evolve :)

IMO, we shouldn't add more templates like this, we should rip out the templates and make create-keystone-app essentially clone the projects from demo-projects since it will solve #1377 and mean we won't have to maintain even more projects.

Generally I like the idea. Currently I don't think the demo projects are 100% what you'd want from a CLI but I think they could be aligned without too much work. I can't see someone wanting scaffold out the meetup demo as a starting point. It's really to specific. It works as a learning exercise but not so much a scaffolding project.
Having said that, I've talked with @jesstelford about the need for more a few more granular demos, for example maybe one with simple a detached React front-end that you'd deploy separately to your Keystone application. And maybe a Gatsby one as well as a few others.... what's most important here is good examples of how to structure these projects rather than the content. The current todo example is the opposite of this. To be fair warns people of this in the code and is a good into to lists etc.... Maybe it should be a pure JS example and not React.
On this note, it would also be nice if the CLI templates\demo guided not towards the desired application, ie, blog, todo, meetup, but towards the desired tech. Eg. Help me choose my stack, Mongo or Postgres + React, Next, Gatsby etc... often these are the decisions I have in mind when I start and don't mind if the example is bare bones (or virtually blank). I need just enough to show me how to work with it. I care more that webpack, babel and npm scripts etc... are configured for me.
Perhaps the end goal of the CLI does need more thought.

Makes sense 👍
The thing that I care about isn’t what projects that exist right now that we pull from, the thing I care about is not doing the templating stuff because it’s causing issues like that package manager thing and we can’t test the templates locally.
So I think the answer might be create a new directory for examples with tech stack things like you mentioned.

Sounds good @mitchellhamilton. We could also selectively include some demos as options in the CLI. That would add a manual step to include it somehow but it's a tiny bit of work and never needs updating.
The only challenge here is we're creating a dependency the demos repo and the CLI package. Is there any way to manage this so that editing the demos can't break the CLI. One solution I guess it to have a CI test for each of them?

I think having a quick smoke test that starts the app should be fine but also, I don’t think next has tests like that and they work fine with all their examples.

@mitchellhamilton I took your feedback onboard and once we land #1468 I've got some plans for a new method with the CLI I think you might like. Going to close this for now.


Could not resolve type with token 01000002 (from typeref, class/assembly ObjCRuntime.BindingImplAttribute, Xamarin.iOS, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=84e04ff9cfb79065)

I'm having this problem after updating xcode version 9.2 to 9.3 and getting the las version of stable chanel in visual studio for mac.
Any suggestion?

Package version : <IP_ADDRESS>

I'm not having this problem in the last version of xamarin.android, visual studio etc.

Need help please 🙀

I'm facing the same issue. But this is my first time using lottie for iOS, so I'm not sure.

Downgrade to 2.5.1 works.

Hey @KennethKr I'll try this after afternoon and I'll send you a feedback ! Thanks so much 😸

Working on 2.5.1 @KennethKr !!!💃

After upgrading everything today, I got the same error (VS for Mac). Downgrading to version 2.5.1 solved the issue.

After upgrading everything today, I got the same error (VS for Mac). Downgrading Lottie from Version <IP_ADDRESS> to version 2.5.1 solved the issue.
Thanx @KennethKr

I have the same issue

I have same experience. Whats going on? Regression?

As also mentioned in: https://github.com/martijn00/LottieXamarin/issues/159, https://github.com/martijn00/LottieXamarin/issues/157, https://github.com/martijn00/LottieXamarin/issues/147, and https://github.com/martijn00/LottieXamarin/issues/140
You have to be on the latest Xamarin stable to be able to run it. Otherwise there is a mismatch between the Xamarin version you compile against and which was used to build Lottie.
Version 7.5 (build 1254)
Mono <IP_ADDRESS> (2017-12/8eb8f7d5e74) (64-bit)
Mac <IP_ADDRESS> (master / 0c7c49a6)
Android Version: <IP_ADDRESS> (Visual Studio Community)
IOS Version: <IP_ADDRESS> (Visual Studio Community)
Windows Visual Studio 15.7.1


HotFix: DateTime problem

HotFix: DateTime problem  (p2)
Description
Do Day +1 => Get irreal dates like 32. Keep as 0 minutes and seconds to compare with next day.
Type of change

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

[ ] Test
[x] Documentation
[ ] Keep updated translations (.po)
[x] Update changelog

https://github.com/IciaCarroBarallobre/elixir_wordle/pull/39


CommandInput filters value and not label

https://ui.shadcn.com/docs/components/combobox#form

Type sp into Select Language
You expect Spanish to be available
It is not because the filter is run on the value instead of the label

const languages = [
  { label: "English", value: "en" },
  { label: "French", value: "fr" },
  { label: "German", value: "de" },
  { label: "Spanish", value: "es" },
  { label: "Portuguese", value: "pt" },
  { label: "Russian", value: "ru" },
  { label: "Japanese", value: "ja" },
  { label: "Korean", value: "ko" },
  { label: "Chinese", value: "zh" },
] as const

If you want to search by label, you'll need to:

Pass label to CommandInput as value

<CommandItem
value={language.label}
//  ...
>

Find language by label.toLowerCase()

{field.value
  ? languages.find(
      (language) =>
        language.label.toLowerCase() === field.value
    )?.label
  : 'Select language'}

CheckIcon should be active for language based on label.toLowerCase()

<CheckIcon
   // ...
    language.label.toLowerCase() === field.value
   // ..
/>

Hi,
what can we do if we want search by label, but when the form is submit we get the value ?
Thank you

@limitless-dev Shouldn't filtering by label be the default? It's hard for me to imagine a situation in which you want to filter by value - which is basically unknowable for the user.

Hi, what can we do if we want search by label, but when the form is submit we get the value ? Thank you

@mezzouhri
You would need to adjust the onSelect to something like this:
  onSelect={(value) => {
    form.setValue(
      'language',
      languages
        .find(
          ({ label }) => label.toLowerCase() === value
        )
        ?.label.toLowerCase() ?? 'en'
    );
  }}

@limitless-dev Shouldn't filtering by label be the default? It's hard for me to imagine a situation in which you want to filter by value - which is basically unknowable for the user.

Maybe @shadcn can advise on this and if we should make a PR?

@limitless-dev Shouldn't filtering by label be the default? It's hard for me to imagine a situation in which you want to filter by value - which is basically unknowable for the user.

Agree. Typing g for German nothing shows up, I thought it was a bug.

I created a PR for this #989 with minimal changes to the workaround I proposed above.
<CommandItem
  value={language.label}
  key={language.value}
  onSelect={() => {
  form.setValue("language", language.value)
  }}

Hi, what can we do if we want search by label, but when the form is submit we get the value ? Thank you

@mezzouhri You would need to adjust how data is being submitted, something like this:
  function onSubmit(data: z.infer<typeof FormSchema>) {
    // ...
      JSON.stringify(
        {
          ...data,
          language: languages.find(
            ({ label }) => label.toLowerCase() === data.language
          )?.value,
        },
        null,
        2
      )
    // ...
  }

Hi @limitless-dev , thank you for you response, I misspoke about what I want, in reality, I want display and search by language.label, but Item.value should be language.value.
Your logic is correct, but I found an other solution for my case, here the full example of my case (ongoing project) : www.remitlib.com.

here is my code :
//select-country.tsx

"use client";

import { useState } from "react";
import { Button } from "./ui/button";
import { cn } from "@/lib/utils";
import { Check, ChevronsUpDown } from "lucide-react";
import Image from "next/image";
import { Countries } from "@/types";
import { UseFormReturn } from "react-hook-form";
import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
} from "@/components/ui/command";
import {
  FormControl,
  FormField,
  FormItem,
  FormLabel,
  FormMessage,
} from "@/components/ui/form";
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/components/ui/popover";
import { useTranslations } from "next-intl";

type Props = {
  name: "countryFrom" | "countryTo";
  setCountry: (countryCode: string) => void;
  countries: Countries;
  form: UseFormReturn<
    {
      countryFrom: string;
      countryTo: string;
      receiveMode: string;
      sendAmount: number;
    },
    any,
    undefined
  >;
};

const SelectCountry = ({ name, setCountry, countries, form }: Props) => {
  const t = useTranslations();
  const [open, setOpen] = useState(false);

  const countryWithFlag = (code?: string) => {
    const selectedCountry = countries.find((country) => country.code === code);
    return (

        <Image
          src={selectedCountry?.flag || "/favicon.ico"}
          alt="country flag"
          className="shrink-0 me-2 w-6 h-5"
          width={24}
          height={24}
        />

{selectedCountry?.label}

    );
  };

  return (
    <FormField
      control={form.control}
      name={name}
      render={({ field }) => (
        <FormItem className="flex flex-col">
          <FormLabel>{t("comparator.sendFrom")}</FormLabel>
          <Popover open={open} onOpenChange={setOpen}>
            <PopoverTrigger asChild>
              <FormControl>
                <Button
                  variant="outline"
                  role="combobox"
                  aria-expanded={open}
                  className={cn(
                    "w-full flex flex-row",
                    !field.value && "text-muted-foreground"
                  )}
                >
                  {field.value
                    ? countryWithFlag(field.value)
                    : t("comparator.selectCountry")}
                  <ChevronsUpDown className="ms-auto h-4 w-4 shrink-0 opacity-50" />
                </Button>
              </FormControl>
            </PopoverTrigger>
            <PopoverContent className="p-0">
              <Command
                filter={(value, search) => {
                  if (
                    t(`countries.${value}`)
                      .toLowerCase()
                      .includes(search?.toLowerCase())
                  )
                    return 1;
                  return 0;
                }}
              >
                <CommandInput placeholder={t("comparator.searchCountry")} />
                <CommandEmpty>{t("comparator.countryNotFound")}</CommandEmpty>
                <CommandGroup className="max-h-[240px] overflow-y-auto">
                  {countries.map((country) => (
                    <CommandItem
                      value={country.code}
                      key={country.code}
                      onSelect={(value) => {
                        form.setValue(name, value);
                        setCountry(value);
                        setOpen(false);
                      }}
                      className="w-full"
                    >
                      <Image
                        src={country.flag}
                        alt="country flag"
                        className="shrink-0 me-2 w-5 h-3"
                        width={20}
                        height={16}
                      />

{country.label}

                      <Check
                        className={cn(
                          "ms-auto h-4 w-4",
                          country.code === field.value
                            ? "opacity-100"
                            : "opacity-0"
                        )}
                      />
                    </CommandItem>
                  ))}
                </CommandGroup>
              </Command>
            </PopoverContent>
          </Popover>
          <FormMessage />
        </FormItem>
      )}
    />
  );
};

export default SelectCountry;

//comparator.tsx

"use client";

import * as z from "zod";
import { useEffect } from "react";
import { useTranslations } from "next-intl";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { useRouter } from "next-intl/client";

import { Button } from "@/components/ui/button";
import {
  Form,
  FormControl,
  FormField,
  FormItem,
  FormLabel,
  FormMessage,
} from "@/components/ui/form";

import { Card, CardContent } from "@/components/ui/card";
import COUNTRIES from "../lib/countries.json";
import InputWithCurrency from "./input-with-currency";
import SelectCountry from "./select-country";
import SelectReceiveMode from "./select-receive-mode";
import { COUNTRY_FROM, COUNTRY_TO } from "@/lib/const";
import useCountryFrom from "@/store/use-countryFrom";
import useCountryTo from "@/store/use-countryTo";
import CurrencyTo from "./currency-to";

const Comparator = () => {
  const t = useTranslations();
  const router = useRouter();

  const countryFromCode = useCountryFrom(({ countryCode }) => countryCode);
  const setCountryFromCode = useCountryFrom(
    ({ setCountryCode }) => setCountryCode
  );
  const setCountryToCode = useCountryTo(({ setCountryCode }) => setCountryCode);

  const countries = COUNTRIES.map(({ flags, cca2, currencies }) => ({
    code: cca2.toLowerCase(),
    currency: Object.keys(currencies)[0].toLowerCase(),
    flag: flags.svg,
    label: t(`countries.${cca2.toLowerCase()}`),
  }));

  const FormSchema = z.object({
    [COUNTRY_FROM]: z.string({
      required_error: "Please select a countryFrom.",
    }),
  });

  const form = useForm<z.infer<typeof FormSchema>>({
    resolver: zodResolver(FormSchema),
  });

  useEffect(() => {
    //Add defaultValues inside a useEffect (client side), to not have hadration errors
    const defaultValues = {
      [COUNTRY_FROM]: countryFromCode,
    };
    form.reset({ ...defaultValues });
  }, []); // eslint-disable-line

  function onSubmit(data: z.infer<typeof FormSchema>) {
   console.log("data", data);
  }

  return (
    <Card className="mx-auto max-w-md sm:max-w-2xl md:max-w-3xl">
      <CardContent>
        <Form {...form}>
          <form
            onSubmit={form.handleSubmit(onSubmit)}
            className="py-4 grid grid-cols-1 md:grid-cols-3 gap-x-3 gap-y-6"
          >
            <SelectCountry
              name={COUNTRY_FROM}
              countries={countries}
              form={form}
              setCountry={setCountryFromCode}
            />

            <Button type="submit" className="self-end">
              {t("comparator.scan")}
            </Button>
          </form>
        </Form>
      </CardContent>
    </Card>
  );
};

export default Comparator;

here is my code :
//select-country.tsx

"use client";

import { useState } from "react";
import { Button } from "./ui/button";
import { cn } from "@/lib/utils";
import { Check, ChevronsUpDown } from "lucide-react";
import Image from "next/image";
import { Countries } from "@/types";
import { UseFormReturn } from "react-hook-form";
import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
} from "@/components/ui/command";
import {
  FormControl,
  FormField,
  FormItem,
  FormLabel,
  FormMessage,
} from "@/components/ui/form";
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/components/ui/popover";
import { useTranslations } from "next-intl";

type Props = {
  name: "countryFrom" | "countryTo";
  setCountry: (countryCode: string) => void;
  countries: Countries;
  form: UseFormReturn<
    {
      countryFrom: string;
      countryTo: string;
      receiveMode: string;
      sendAmount: number;
    },
    any,
    undefined
  >;
};

const SelectCountry = ({ name, setCountry, countries, form }: Props) => {
  const t = useTranslations();
  const [open, setOpen] = useState(false);

  const countryWithFlag = (code?: string) => {
    const selectedCountry = countries.find((country) => country.code === code);
    return (

        <Image
          src={selectedCountry?.flag || "/favicon.ico"}
          alt="country flag"
          className="shrink-0 me-2 w-6 h-5"
          width={24}
          height={24}
        />

{selectedCountry?.label}

    );
  };

  return (
    <FormField
      control={form.control}
      name={name}
      render={({ field }) => (
        <FormItem className="flex flex-col">
          <FormLabel>{t("comparator.sendFrom")}</FormLabel>
          <Popover open={open} onOpenChange={setOpen}>
            <PopoverTrigger asChild>
              <FormControl>
                <Button
                  variant="outline"
                  role="combobox"
                  aria-expanded={open}
                  className={cn(
                    "w-full flex flex-row",
                    !field.value && "text-muted-foreground"
                  )}
                >
                  {field.value
                    ? countryWithFlag(field.value)
                    : t("comparator.selectCountry")}
                  <ChevronsUpDown className="ms-auto h-4 w-4 shrink-0 opacity-50" />
                </Button>
              </FormControl>
            </PopoverTrigger>
            <PopoverContent className="p-0">
              <Command
                filter={(value, search) => {
                  if (
                    t(`countries.${value}`)
                      .toLowerCase()
                      .includes(search?.toLowerCase())
                  )
                    return 1;
                  return 0;
                }}
              >
                <CommandInput placeholder={t("comparator.searchCountry")} />
                <CommandEmpty>{t("comparator.countryNotFound")}</CommandEmpty>
                <CommandGroup className="max-h-[240px] overflow-y-auto">
                  {countries.map((country) => (
                    <CommandItem
                      value={country.code}
                      key={country.code}
                      onSelect={(value) => {
                        form.setValue(name, value);
                        setCountry(value);
                        setOpen(false);
                      }}
                      className="w-full"
                    >
                      <Image
                        src={country.flag}
                        alt="country flag"
                        className="shrink-0 me-2 w-5 h-3"
                        width={20}
                        height={16}
                      />

{country.label}

                      <Check
                        className={cn(
                          "ms-auto h-4 w-4",
                          country.code === field.value
                            ? "opacity-100"
                            : "opacity-0"
                        )}
                      />
                    </CommandItem>
                  ))}
                </CommandGroup>
              </Command>
            </PopoverContent>
          </Popover>
          <FormMessage />
        </FormItem>
      )}
    />
  );
};

export default SelectCountry;

//comparator.tsx

"use client";

import * as z from "zod";
import { useEffect } from "react";
import { useTranslations } from "next-intl";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { useRouter } from "next-intl/client";

import { Button } from "@/components/ui/button";
import {
  Form,
  FormControl,
  FormField,
  FormItem,
  FormLabel,
  FormMessage,
} from "@/components/ui/form";

import { Card, CardContent } from "@/components/ui/card";
import COUNTRIES from "../lib/countries.json";
import InputWithCurrency from "./input-with-currency";
import SelectCountry from "./select-country";
import SelectReceiveMode from "./select-receive-mode";
import { COUNTRY_FROM, COUNTRY_TO } from "@/lib/const";
import useCountryFrom from "@/store/use-countryFrom";
import useCountryTo from "@/store/use-countryTo";
import CurrencyTo from "./currency-to";

const Comparator = () => {
  const t = useTranslations();
  const router = useRouter();

  const countryFromCode = useCountryFrom(({ countryCode }) => countryCode);
  const setCountryFromCode = useCountryFrom(
    ({ setCountryCode }) => setCountryCode
  );
  const setCountryToCode = useCountryTo(({ setCountryCode }) => setCountryCode);

  const countries = COUNTRIES.map(({ flags, cca2, currencies }) => ({
    code: cca2.toLowerCase(),
    currency: Object.keys(currencies)[0].toLowerCase(),
    flag: flags.svg,
    label: t(`countries.${cca2.toLowerCase()}`),
  }));

  const FormSchema = z.object({
    [COUNTRY_FROM]: z.string({
      required_error: "Please select a countryFrom.",
    }),
  });

  const form = useForm<z.infer<typeof FormSchema>>({
    resolver: zodResolver(FormSchema),
  });

  useEffect(() => {
    //Add defaultValues inside a useEffect (client side), to not have hadration errors
    const defaultValues = {
      [COUNTRY_FROM]: countryFromCode,
    };
    form.reset({ ...defaultValues });
  }, []); // eslint-disable-line

  function onSubmit(data: z.infer<typeof FormSchema>) {
   console.log("data", data);
  }

  return (
    <Card className="mx-auto max-w-md sm:max-w-2xl md:max-w-3xl">
      <CardContent>
        <Form {...form}>
          <form
            onSubmit={form.handleSubmit(onSubmit)}
            className="py-4 grid grid-cols-1 md:grid-cols-3 gap-x-3 gap-y-6"
          >
            <SelectCountry
              name={COUNTRY_FROM}
              countries={countries}
              form={form}
              setCountry={setCountryFromCode}
            />

            <Button type="submit" className="self-end">
              {t("comparator.scan")}
            </Button>
          </form>
        </Form>
      </CardContent>
    </Card>
  );
};

export default Comparator;

Like this?
{countries.map((country) => (
                    <CommandItem
                      value={country.label}
                      key={country.code}
                      onSelect={() => {
                        form.setValue(name, country.value);
                        setCountry(country.value);
                        setOpen(false);
                      }}
                      className="w-full"
                    >
                      <Image
                        src={country.flag}
                        alt="country flag"
                        className="shrink-0 me-2 w-5 h-3"
                        width={20}
                        height={16}
                      />

{country.label}

                      <Check
                        className={cn(
                          "ms-auto h-4 w-4",
                          country.code === field.value
                            ? "opacity-100"
                            : "opacity-0"
                        )}
                      />
                    </CommandItem>
                  ))}

This was marked as closed because?

<EMAIL_ADDRESS>added a keywords prop to Command.Item that can be used to adjust how the filter works. You can pass both the label and value to filter by both. See the docs.
<Command.Item keywords={['fruit', 'apple']}>Apple</Command.Item>

Thank you! it worked ♥


Fix macro naming

Fixes #46

@Executor-Cheng Thanks. I will publish an updated package this week.

Published: https://www.nuget.org/packages/DNNE/1.0.17.


Fix setting opacity of background color

If setting the --gi-bg-opacity with the same class as the one that is setting the background color, then a .bg-opacity-N won't override the variable. Instead, we can use the var-with-fallback for the background-color class.

While tailwind does it the original way, I think it only works there because of the order the classes appear in the CSS file; with girouette dynamically generating the CSS, I guess sometimes it might work and other times it would not. This approach will hopefully be more robust and exhibit the desired behaviour.

If setting the --gi-bg-opacity with the same class as the one that is setting the background color, then a .bg-opacity-N won't override the variable.

To make sure that I understand correctly, can you please give a code sample which shows the problem?

When I was testing, just adding any background colour then adding an opacity later caused the issue, but I was using a non-standard build process. I will try to make a minimal example and see if it’s reproducible.

Thank you. The code sample will help for 3 reasons:

it avoids small misunderstandings when communicating about the problem,
it makes sure that the problem is solved afterward,
it opens up the possibility of having a different way to solve it.

Understood! Sorry I didn't leave one before -- I was in the process of building something else and then left on a little camping trip for a few days.

Okay, it looks like it depends on the sorting order -- from the example reagent demo in the repo, simply adding the class "bg-opacity-50" to the div with the class "bg-red-200" doesn't work. Looking at the generated CSS, we can see that this happens because the bg-red-200 class is output above the bg-opacity-50 style, so overriding doesn't work.
It will happen to work if one adds the opacity to one of the other divs, since they get output before the opacity style, in which case the bg-opacity-50 style gets precedence.
modified   example/reagent-demo/src/acme/frontend/app.cljc
@@ -7,7 +7,7 @@

    ;; Demonstrates the use of arbitrary values in flex layouts
    [:h1.flex.space-x-2
-    [:div.flex-1.p-4.text-center.rounded-lg.bg-red-200 "hello"]
+    [:div.flex-1.p-4.text-center.rounded-lg.bg-red-200.bg-opacity-50 "hello"]
     [:div.flex-2.p-4.text-center.rounded-lg.bg-green-200 "the"]
     [:div.p-4.text-center.rounded-lg.bg-blue-200 {:class "flex-9/3"} "world"]]

Thanks to your precise description, I was able to reproduce the bug on my computer.
Your patch seems to solve the problem, but I would like to solve it differently, by introducing an ordering between the different rules in the generated file. The ordering feature might be useful to the users of the library in different situations, that's why I favor this solution.

@jamesnvc I pushed a commit on master, please let me know if it totally solves the problem of this PR or not yet.

Looks good to me!


Add ability to run per key inference

This builds on top of #27603 to add support for running inference against a cohort of different models using the KeyedModelHandler. Full design is here - https://docs.google.com/document/d/1kj3FyWRbJu1KhViX07Z0Gk0MU0842jhYRhI-DMhhcv4/edit#heading=h.wskna8eurvjv
This piece adds basic support. In future prs we will need to cover:

Model updates support
Metrics improvements
Example + an E2E test (I have run this in an E2E pipeline, but decided to split the example out from this pr for size reasons)
Docs

Part of #27628

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

[x] Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
[ ] Update CHANGES.md with noteworthy changes.
[x] If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

assign to next reviewer

@tvalentyn FYI, here's an integration test built on top of this PR - https://github.com/apache/beam/pull/27880
I'm keeping it separate for now to keep this one easier to review


how can i get 1024 dimensions of each frame?

when i use pretrained 3D_resnext101 model, the dimensions of each frame is 2048. How can i get 1024 dimensions？

Why would you need 1024 ? The feature dimension for ResNet and ResNext is 2048.

What exactly do these 2048 dimensions represent?

It is the global average pooled output that you have just before the last linear layer.

so, in a sense, if you have 1024 dimensions you're interested in, @linjingxu, you could just add a layer of 1024 dimensions on the 2048 outputs, assuming you have labeled your video data in 1024 dims..

Could you help me to look at this problem? This is my debugger's result. Why in "loader" i didn't get any video tensor????   decoding video failed

This is my .csv file.  What should i do with this ??   Is there any problems?

Is ffprobe working on these videos ? Maybe to be sure that the path is correct, please replace the path with absolute path instead of relative path ?

Is ffprobe working on these videos ? Maybe to be sure that the path is correct, please replace the path with absolute path instead of relative path ?

thanks i got it！！


Fix invalid string template exression

This commit fixes invalid string template of session message text returned as part of
the bot feedback. My error btw.

We are analyzing your message: 'session.message.text'

We are analyzing your message: 'Search hotels near LAX airport'

Thanks!

Saw this too.  Deleting my pull request in favor of this one.


BUG Report

Description
1.主页有时候识别不到驱动器，需要关闭重新打开
2.鼠标点击复制、剪切、粘贴功能无法使用，键盘也是如此
3.无法完全取代系统资源管理器，在其他软件许多时候点击后跳转的是系统自带的资源管理器
4.在winrar类似的解压软件中无法做到直接拖动以解压

Sometimes the home page cannot identify the drive. I need to close and open the home page again
The copy, cut, and paste functions cannot be used, nor does the keyboard
It cannot completely replace the system resource manager. In many cases, the resource manager of the system is clicked after other software is clicked
In WINRAR similar decompression software can not be directly dragged to decompress

Steps To Reproduce
No response
Expected behavior
FIX BUG
Files Version
版本: <IP_ADDRESS> OS Version: 10.0.22000.376
Windows Version
版本	Windows 11 专业版 版本	21H2 安装日期	10.16 周六 操作系统版本	22000.376 体验	Windows 功能体验包 1000.22000.376.0
Relevant Assets/Logs
debug_fulltrust.log

its best to split all issues in a separate issues as they can be tracked better.
issue 1 is being tracked with #6182.
issues 2 and 4 more information is need as I can do them fine.
issue 3 doesn't make sense as files doesn't have resource manager.


Jupyter notebook frequently fall into a state of suspended animation

Environment data

VS Code version: 1.55.2
Jupyter Extension version (available under the Extensions sidebar): v2021.5.745244803
Python Extension version (available under the Extensions sidebar): v2021.4.765268190
OS (Windows | Mac | Linux distro) and version: MacOS 11.2.3
Python and/or Anaconda version: Python 3.7.9
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
Jupyter server running: Remote

Actual behaviour
When I scroll up and down in a jupyter notebook, there is a high probability of this notebook falling into a state of suspended animation. Any control in the red box will not respond to mouse clicks, but the controls outside the red box can work normally. But the most serious thing is that when the suspended animation occurs, the file cannot be saved, and the previous working status will be lost.

Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

Open a jupyter notebook
Scroll up and down

Logs

Output for Jupyter in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Jupyter)

User belongs to experiment group 'jupyterTestcf'
User belongs to experiment group 'pythonDiscoveryModulecf'
User belongs to experiment group 'jupyterEnhancedDataViewer'
Info 2021-04-23 10:06:47: id is 3510173a-31be-4f97-aa64-36112654c14c
Info 2021-04-23 10:06:47: Attempting to start a server because of preload conditions ...
Info 2021-04-23 10:06:47: Checking for server existence.
Info 2021-04-23 10:06:47: Checking for server usability.
Info 2021-04-23 10:06:47: Starting notebook server.
Info 2021-04-23 10:06:47: Connecting to history server
Info 2021-04-23 10:06:47: Creating jupyter server: 07f9a5e8-e934-47b1-b336-1b1565d20fc8
Info 2021-04-23 10:06:47: Creating server with settings : {"baseUrl":"http://<IP_ADDRESS>:8888/","appUrl":"","wsUrl":"ws://<IP_ADDRESS>:8888/","token":"76c153f2431fd25d29a209b59993cb6164dc025057c0513d","init":{"cache":"no-store","credentials":"same-origin"}}
Info 2021-04-23 10:06:49: Disposing session manager
Info 2021-04-23 10:06:49: SessionManager - dispose contents manager
Info 2021-04-23 10:06:49: ShutdownSessionAndConnection - dispose session manager
Info 2021-04-23 10:06:49: Finished disposing jupyter session manager
Info 2021-04-23 10:06:49: findPreferredKernel score for ML is -1
Info 2021-04-23 10:06:49: findPreferredKernel score for ML is -1
Info 2021-04-23 10:06:49: findPreferredKernel score for ML is -1
Info 2021-04-23 10:06:49: findPreferredKernel score for ML is -1
Info 2021-04-23 10:06:49: findPreferredKernel score for MLHWK is 1
Info 2021-04-23 10:06:49: findPreferredKernel score for ML is 1
Info 2021-04-23 10:06:49: findPreferredKernel score for Python 3 is 1
Info 2021-04-23 10:06:49: Find remote kernel spec, Class name = m, completed in 1442ms, has a truthy return value, Arg 1: undefined, Arg 2: {"type":"jupyter","baseUrl":"http://<IP_ADDRESS>:8888/","token":"76c153f2431fd25d29a209b59993cb6164dc025057c0513d","hostName":"<IP_ADDRESS>","localLaunch":false,"valid":true,"displayName":"http://<IP_ADDRESS>:8888/?token=76c153f2431fd25d29a209b59993cb6164dc025057c0513d","rootDirectory":"","url":"http://<IP_ADDRESS>:8888/?token=76c153f2431fd25d29a209b59993cb6164dc025057c0513d"}, Arg 3: undefined, Arg 4: <argument cannot be serialized for logging>, Return Value: {"kind":"startUsingKernelSpec","kernelSpec":{"name":"mlhwk","argv":["/home/hyb/anaconda3/envs/MLHWK/bin/python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","path":"/home/hyb/anaconda3/envs/MLHWK/bin/python","display_name":"MLHWK","metadata":{},"env":{}},"id":".mlhwk./home/hyb/anaconda3/envs/MLHWK/bin/python..MLHWK"}
Info 2021-04-23 10:06:49: Connecting to process for history server
Info 2021-04-23 10:06:49: Connecting server 07f9a5e8-e934-47b1-b336-1b1565d20fc8 kernelSpec MLHWK
Connecting to Jupyter server at http://<IP_ADDRESS>:8888/
Info 2021-04-23 10:06:49: Creating server with settings : {"baseUrl":"http://<IP_ADDRESS>:8888/","appUrl":"","wsUrl":"ws://<IP_ADDRESS>:8888/","token":"76c153f2431fd25d29a209b59993cb6164dc025057c0513d","init":{"cache":"no-store","credentials":"same-origin"}}
Info 2021-04-23 10:06:49: Found existing keyfile at /home/hyb/.vscode-server/data/User/globalStorage/ms-toolsai.jupyter/nbsecret
Info 2021-04-23 10:06:51: Checking if notebook is trusted
Info 2021-04-23 10:06:51: Check if Notebook is Trusted, Class name = p, completed in 148ms, has a falsy return value, Return Value: false
Info 2021-04-23 10:06:51: Loading web panel for file:///home/hyb/experiments-result/GAN-combine-DLG/plot.ipynb
Info 2021-04-23 10:06:51: Loading webview. View is notset
Info 2021-04-23 10:06:51: Attempting to start a server because of preload conditions ...
Info 2021-04-23 10:06:51: Loading web view...
Info 2021-04-23 10:06:51: Webview panel created.
Info 2021-04-23 10:06:52: Starting a new session for kernel id = .mlhwk./home/hyb/anaconda3/envs/MLHWK/bin/python..MLHWK, name = mlhwk
http://<IP_ADDRESS>:8888/: Kernel started: b5206bcc-55df-45cc-a6a5-271aa1faf1b4
Info 2021-04-23 10:06:53: Waiting for idle on (kernel): b5206bcc-55df-45cc-a6a5-271aa1faf1b4 -> unknown
Info 2021-04-23 10:06:53: Web view react rendered
Info 2021-04-23 10:06:53: Request for onigasm file at /home/hyb/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/out/client/node_modules/onigasm/lib/onigasm.wasm
Info 2021-04-23 10:06:53: Request for tmlanguage file.
Info 2021-04-23 10:06:53: Searching for token colors ...
Info 2021-04-23 10:06:53: Attempting search for colors ...
Info 2021-04-23 10:06:55: Searching for token colors ...
Info 2021-04-23 10:06:55: Attempting search for colors ...
Info 2021-04-23 10:06:55: Searching for token colors ...
Info 2021-04-23 10:06:55: Attempting search for colors ...
Info 2021-04-23 10:06:55: Searching for token colors ...
Info 2021-04-23 10:06:55: Attempting search for colors ...
Info 2021-04-23 10:06:56: Display prompt to trust notebook
Info 2021-04-23 10:06:56: Searching for token colors ...
Info 2021-04-23 10:06:56: Attempting search for colors ...
Warn 2021-04-23 10:06:56: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:56: Attempting search for colors ...
Warn 2021-04-23 10:06:56: Color theme Atom One Dark not found. Using default colors.
Warn 2021-04-23 10:06:56: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:56: Attempting search for colors ...
Warn 2021-04-23 10:06:56: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:56: Searching for token colors ...
Info 2021-04-23 10:06:56: Attempting search for colors ...
Warn 2021-04-23 10:06:56: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:56: Attempting search for colors ...
Warn 2021-04-23 10:06:56: Color theme Atom One Dark not found. Using default colors.
Warn 2021-04-23 10:06:56: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:56: Attempting search for colors ...
Warn 2021-04-23 10:06:56: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:57: Searching for token colors ...
Info 2021-04-23 10:06:57: Attempting search for colors ...
Warn 2021-04-23 10:06:57: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:57: Attempting search for colors ...
Warn 2021-04-23 10:06:57: Color theme Atom One Dark not found. Using default colors.
Warn 2021-04-23 10:06:57: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:57: Attempting search for colors ...
Warn 2021-04-23 10:06:57: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:57: Searching for token colors ...
Info 2021-04-23 10:06:57: Attempting search for colors ...
Warn 2021-04-23 10:06:57: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:57: Attempting search for colors ...
Warn 2021-04-23 10:06:57: Color theme Atom One Dark not found. Using default colors.
Warn 2021-04-23 10:06:57: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:57: Attempting search for colors ...
Warn 2021-04-23 10:06:57: Color theme Atom One Dark not found. Using default colors.
Info 2021-04-23 10:06:59: Displayed prompt to trust notebook & selected Trust
Info 2021-04-23 10:06:59: Trusting notebook...
Info 2021-04-23 10:06:59: Wrote trust for file:///home/hyb/experiments-result/GAN-combine-DLG/plot.ipynb to /home/hyb/.vscode-server/data/User/globalStorage/ms-toolsai.jupyter/nbsignatures/07a5e46753047c9dd70c1db9e1c3f391869e4a06718470f4cd7ffec9c9a8ade4
Info 2021-04-23 10:07:27: Finished waiting for idle on (kernel): b5206bcc-55df-45cc-a6a5-271aa1faf1b4 -> idle
Info 2021-04-23 10:07:27: Waiting for idle on (kernel): b5206bcc-55df-45cc-a6a5-271aa1faf1b4 -> idle
Info 2021-04-23 10:07:27: Finished waiting for idle on (kernel): b5206bcc-55df-45cc-a6a5-271aa1faf1b4 -> idle
Info 2021-04-23 10:07:27: Shutdown session - current session
Info 2021-04-23 10:07:27: shutdownSession b5206bcc-55df-45cc-a6a5-271aa1faf1b4, .mlhwk./home/hyb/anaconda3/envs/MLHWK/bin/python..MLHWK - start
Info 2021-04-23 10:07:27: Session can be shutdown .mlhwk./home/hyb/anaconda3/envs/MLHWK/bin/python..MLHWK
Info 2021-04-23 10:07:28: shutdownSession b5206bcc-55df-45cc-a6a5-271aa1faf1b4, .mlhwk./home/hyb/anaconda3/envs/MLHWK/bin/python..MLHWK - shutdown complete
Info 2021-04-23 10:07:28: Shutdown session - get restart session
Info 2021-04-23 10:07:28: Shutdown session -- complete
Info 2021-04-23 10:07:28: Connection complete for history server
Info 2021-04-23 10:07:28: Server started.
Info 2021-04-23 10:07:28: Compute Launch Info uri = /home/hyb/experiments-result/GAN-combine-DLG/plot.ipynb, kernelConnection id = undefined
Info 2021-04-23 10:07:28: Creating server with settings : {"baseUrl":"http://<IP_ADDRESS>:8888/","appUrl":"","wsUrl":"ws://<IP_ADDRESS>:8888/","token":"76c153f2431fd25d29a209b59993cb6164dc025057c0513d","init":{"cache":"no-store","credentials":"same-origin"}}
Info 2021-04-23 10:07:28: Disposing session manager
Info 2021-04-23 10:07:28: SessionManager - dispose contents manager
Info 2021-04-23 10:07:28: ShutdownSessionAndConnection - dispose session manager
Info 2021-04-23 10:07:28: Finished disposing jupyter session manager
Info 2021-04-23 10:07:28: Preferred kernel for file:///home/hyb/experiments-result/GAN-combine-DLG/plot.ipynb is undefined
Info 2021-04-23 10:07:28: findPreferredKernel score for ML is -1
Info 2021-04-23 10:07:28: findPreferredKernel score for ML is -1
Info 2021-04-23 10:07:28: findPreferredKernel score for ML is -1
Info 2021-04-23 10:07:28: findPreferredKernel score for ML is -1
Info 2021-04-23 10:07:28: findPreferredKernel score for MLHWK is 1
Info 2021-04-23 10:07:28: findPreferredKernel score for ML is 15
Info 2021-04-23 10:07:28: findPreferredKernel score for Python 3 is 1
Info 2021-04-23 10:07:28: Find remote kernel spec, Class name = m, completed in 14ms, has a truthy return value, Arg 1: <Uri:/home/hyb/experiments-result/GAN-combine-DLG/plot.ipynb>, Arg 2: {"type":"jupyter","baseUrl":"http://<IP_ADDRESS>:8888/","token":"76c153f2431fd25d29a209b59993cb6164dc025057c0513d","hostName":"<IP_ADDRESS>","localLaunch":false,"valid":true,"displayName":"http://<IP_ADDRESS>:8888/?token=76c153f2431fd25d29a209b59993cb6164dc025057c0513d","rootDirectory":"","url":"http://<IP_ADDRESS>:8888/?token=76c153f2431fd25d29a209b59993cb6164dc025057c0513d"}, Arg 3: {"kernelspec":{"display_name":"ML","language":"python","name":"ml"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.7.9"}}, Arg 4: undefined, Return Value: {"kind":"startUsingKernelSpec","kernelSpec":{"name":"ml","argv":["/home/hyb/anaconda3/envs/ML/bin/python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","path":"/home/hyb/anaconda3/envs/ML/bin/python","display_name":"ML","metadata":{},"env":{}},"id":".ml./home/hyb/anaconda3/envs/ML/bin/python..ML"}
Info 2021-04-23 10:07:28: Compute Launch Info uri = /home/hyb/experiments-result/GAN-combine-DLG/plot.ipynb, changed true, .ml./home/hyb/anaconda3/envs/ML/bin/python..ML
Info 2021-04-23 10:07:28: Starting a new session for kernel id = .ml./home/hyb/anaconda3/envs/ML/bin/python..ML, name = ml
http://<IP_ADDRESS>:8888/: Kernel started: 347ea974-affa-43ae-8d74-de18959105f3
Info 2021-04-23 10:07:28: Waiting for idle on (kernel): 347ea974-affa-43ae-8d74-de18959105f3 -> unknown
Info 2021-04-23 10:07:47: Finished waiting for idle on (kernel): 347ea974-affa-43ae-8d74-de18959105f3 -> idle
Info 2021-04-23 10:07:47: Started session 07f9a5e8-e934-47b1-b336-1b1565d20fc8
Info 2021-04-23 10:07:47: Waiting for idle (session) 07f9a5e8-e934-47b1-b336-1b1565d20fc8
Info 2021-04-23 10:07:47: Waiting for idle on (kernel): 347ea974-affa-43ae-8d74-de18959105f3 -> idle
Info 2021-04-23 10:07:47: Finished waiting for idle on (kernel): 347ea974-affa-43ae-8d74-de18959105f3 -> idle
Info 2021-04-23 10:07:47: Initial setup for file:///home/hyb/experiments-result/GAN-combine-DLG/plot.ipynb starting ...
Info 2021-04-23 10:07:47: UpdateWorkingDirectoryAndPath
Info 2021-04-23 10:07:47: Kernel switching to busy
Info 2021-04-23 10:07:47: Kernel switching to idle
Info 2021-04-23 10:07:47: Initial setup complete for file:///home/hyb/experiments-result/GAN-combine-DLG/plot.ipynb
Info 2021-04-23 10:07:47: Finished connecting 07f9a5e8-e934-47b1-b336-1b1565d20fc8
http://<IP_ADDRESS>:8888/: Creating new notebook
Info 2021-04-23 10:07:47: Registering commtarget jupyter.widget
Info 2021-04-23 10:07:48: Starting a new session for kernel id = .ml./home/hyb/anaconda3/envs/ML/bin/python..ML, name = ml
http://<IP_ADDRESS>:8888/: Kernel started: fe1eae57-4b0f-4ccb-b551-c9d3e4fe9f46
Info 2021-04-23 10:07:48: Waiting for idle on (kernel): fe1eae57-4b0f-4ccb-b551-c9d3e4fe9f46 -> unknown
Info 2021-04-23 10:07:49: Finished waiting for idle on (kernel): fe1eae57-4b0f-4ccb-b551-c9d3e4fe9f46 -> idle
Info 2021-04-23 10:08:00: Kernel switching to busy
Info 2021-04-23 10:08:00: Kernel switching to idle
Info 2021-04-23 10:09:07: Process Execution: > ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py -c "import notebook"
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py -c "import notebook"
Info 2021-04-23 10:09:07: Process Execution: > ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py -c "import jupyter"
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py -c "import jupyter"
Info 2021-04-23 10:09:07: Process Execution: > ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py jupyter kernelspec --version
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py jupyter kernelspec --version
Info 2021-04-23 10:09:08: Creating daemon pool for /home/hyb/anaconda3/bin/python with env variables count 68
Info 2021-04-23 10:09:08: Process Execution: > ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
Info 2021-04-23 10:09:08: Process Execution: > ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
Info 2021-04-23 10:09:08: Process Execution: > ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
> ~/anaconda3/bin/python ~/.vscode-server/extensions/ms-toolsai.jupyter-2021.5.745244803/pythonFiles/pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.jupyter_daemon -v
Info 2021-04-23 10:23:32: Kernel switching to busy
Info 2021-04-23 10:23:32: Kernel switching to idle
Info 2021-04-23 10:23:37: Kernel switching to busy
Info 2021-04-23 10:23:37: Kernel switching to idle
Info 2021-04-23 10:23:42: Kernel switching to busy
Info 2021-04-23 10:23:42: Kernel switching to idle
Info 2021-04-23 10:24:37: Kernel switching to busy
Info 2021-04-23 10:24:37: Kernel switching to idle
Info 2021-04-23 10:24:48: Kernel switching to busy
Info 2021-04-23 10:24:48: Kernel switching to idle

Hi @Ilcyb, would you be able to provide the notebook you are working with? How many plots are you trying to render here? Do you find this happening in any specific scenario?

Hi @Ilcyb, would you be able to provide the notebook you are working with? How many plots are you trying to render here? Do you find this happening in any specific scenario?

Sorry, the notebook is a private notebook. There are about 24 plots in this notebook, and I found that this situation only occurs when the MacBook is connected to a high-resolution monitor. This will not happen when you open the same notebook in Windows or use the built-in display of Macbook.

Sounds like this could be a problem in electron if it only repro's based on resolution. What's the resolution of the monitor?

Closing for lack of activity.
@Ilcyb, please reopen if you can still repro on our latest release in our new notebook interface.
To enable the new notebook interface, follow these steps: https://github.com/microsoft/vscode-jupyter/wiki/Native-Notebook-Support-in-VS-Code


Disable smart quotes

because PyPI doesn't use them.
We can turn it on later perhaps.

I want to keep the smart quotes around.


Attempt to remove required NPM modules

We should look to remove require statements and use imports for any NPM modules with available typings.

This was done in #405


Failed Access Logging - Fail2Ban Filter Example

Hi,
I've followed the guidance on Failed Access Logging and now a have failed login attempts being reported into the error log thank you! I'm having some significant issues though trying to get Fail2Ban to detect the failures. I think I may need to create a custom filter which I have no clue on how to do.
Therefore could I request some help or point me to some documentation to help with setting up the required regex/config to get it working. I would be very happy to ensure the BookStack docs are updated to help others.
Thanks in advance!
Please see below a snip from my error.log, if that helps
2021/01/02 19:56:38 [error] 390#390: *22 FastCGI sent in stderr: "PHP message: Failed login for<EMAIL_ADDRESS>while reading response header from upstream, client: <IP_ADDRESS>, server: _, reques> 2021/01/02 19:59:52 [error] 390#390: *25 FastCGI sent in stderr: "PHP message: Failed login for<EMAIL_ADDRESS>while reading response header from upstream, client: <IP_ADDRESS>, server: _, reques> 2021/01/02 21:26:32 [error] 390#390: *28 FastCGI sent in stderr: "PHP message: Failed login for<EMAIL_ADDRESS>while reading response header from upstream, client: <IP_ADDRESS>, server: _, reques>

Hi @cyb3rl4d,
I'm not 100% sure what I'm doing with fail2ban, hence the limited guidance I've provided in the docs, but the following may work.
I modelled these steps on the fail2ban installation on my Ubuntu 20.10 desktop system.
Create a /etc/fail2ban/filter.d/bookstack.conf file with the following:
[Definition]
failregex = PHP message: Failed login from .*? client: <HOST>

Within your /etc/fail2ban/jail.local file (or similar) add bookstack as a service using the filter like so:
[bookstack]

enabled = true
port = http,https
logpath = %(nginx_error_log)s
filter = bookstack

If using apache, you'll need to change nginx for apache above.
Then restart fail2ban (systemctl restart fail2ban).
When you run fail2ban-client status you should then have a bookstack item in the output.
Then you can run fail2ban-client status bookstack to see the stats for the bookstack jail. Is a good idea to do a couple of remote requests (From a phone on a mobile network is often easiest) to ensure the stats increase shortly after failed logins.
I've always found fail2ban config a bit confusing so apologies if the above does not work for you, hopefully it can at least guide you down a path to get things working.

Hi @cyb3rl4d,
I'm not 100% sure what I'm doing with fail2ban, hence the limited guidance I've provided in the docs, but the following may work.
I modelled these steps on the fail2ban installation on my Ubuntu 20.10 desktop system.
Create a /etc/fail2ban/filter.d/bookstack.conf file with the following:
[Definition]
failregex = PHP message: Failed login from .*? client: <HOST>

Within your /etc/fail2ban/jail.local file (or similar) add bookstack as a service using the filter like so:
[bookstack]

enabled = true
port = http,https
logpath = %(nginx_error_log)s
filter = bookstack

If using apache, you'll need to change nginx for apache above.
Then restart fail2ban (systemctl restart fail2ban).
When you run fail2ban-client status you should then have a bookstack item in the output.
Then you can run fail2ban-client status bookstack to see the stats for the bookstack jail. Is a good idea to do a couple of remote requests (From a phone on a mobile network is often easiest) to ensure the stats increase shortly after failed logins.
I've always found fail2ban config a bit confusing so apologies if the above does not work for you, hopefully it can at least guide you down a path to get things working.

Hi Dan,
Thanks so much for the detailed and quick response!! With your guidance I got it working!!! Thank you!!!
I was trying all kind of complex regex's (trying to follow the docs on fail2ban-regex test app, wow thats complicated!).
Anyway, it didnt work initially until I spotted the  "Failed login from" bit, in mine its "for" not "from" so by making that very small change it worked!!! thanks so much!!!

Hi Dan,
Thanks so much for the detailed and quick response!! With your guidance I got it working!!! Thank you!!!
I was trying all kind of complex regex's (trying to follow the docs on fail2ban-regex test app, wow thats complicated!).
Anyway, it didnt work initially until I spotted the  "Failed login from" bit, in mine its "for" not "from" so by making that very small change it worked!!! thanks so much!!!

@cyb3rl4d Awesome, Glad to hear that worked for you!

@cyb3rl4d Awesome, Glad to hear that worked for you!

hello
could anybody tell me how to edit nginx or php error_log to show real IPs instead of Cloudflares in the log?

@horstepipe These may help:
https://danielmiessler.com/blog/getting-real-ip-addresses-using-cloudflare-nginx-and-varnish/
https://support.cloudflare.com/hc/en-us/articles/200170786-Restoring-original-visitor-IPs


How to build an offline portable version in Windows system?

Hi,
How to build an offline portable version in Windows system? It will be more convenient for office without WAN connection.

You can use electron to build offline app.  Another choice is to setup a web server, for example nginx, to host the static files

For now, there is no official timeline to build an offline portable version. Close this issue but feel free to comment.


The "waves traveling into HoloLens person" icon is distracting when running.

I use the holographic remoting player "a lot". I love it. I would love it even more if we could do something about that icon in the middle of the screen. The one with the head profile and wi-fi waves going into it - I wish it wasn't there, or at least not dead center and brighter than the surrounding text. Often, I start the viewer, and need to look at unity and hit the play button.

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

ID: e5141cd4-aa05-46fe-9378-a9cc0ef19f76
Version Independent ID: 1a2e110d-8dae-e52b-f856-34217c6f6e54
Content: Holographic Remoting Player - Mixed Reality
Content Source: mixed-reality-docs/holographic-remoting-player.md
Product: mixed-reality
Technology: mr-dev
GitHub Login: @FlorianBagarMicrosoft
Microsoft Alias: flbagar

Thanks for the feedback. We will include improvments on that in the next updated of the Holographic Remoting Player.

Pink, version 2.1.3 of the Holographic Remoting player has been released. The icons should not block your view anymore now.

OMG so much better thanks for this!