correct db-schema update 4.14.0 to 4.15.0

Description
Correct copy&paste issue from lines
https://github.com/apache/cloudstack/blob/c82688a3559929fafa388192b949f4136b5d3d27/engine/schema/src/main/resources/META-INF/db/schema-41400to41500.sql#L782

Types of changes

[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] New feature (non-breaking change which adds functionality)
[x] Bug fix (non-breaking change which fixes an issue)
[ ] Enhancement (improves an existing feature and functionality)
[ ] Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale

[ ] Major
[ ] Minor

Bug Severity

[ ] BLOCKER
[ ] Critical
[x] Major
[ ] Minor
[ ] Trivial

Screenshots (if appropriate):
How Has This Been Tested?

Hi,
I have added (32 Bit) where it is applicable. For 693, 739, 771 and 782 there are no different versions for 32 or 64 bit and therefor has no information about that added.
Source: https://vdc-download.vmware.com/vmwb-repository/dcr-public/da47f910-60ac-438b-8b9b-6122f4d14524/16b7274a-bf8b-4b4c-a05e-746f2aa93c8c/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html

Hi,
I have added (32 Bit) where it is applicable. For 693, 739, 771 and 782 there are no different versions for 32 or 64 bit and therefor has no information about that added.
Source: https://vdc-download.vmware.com/vmwb-repository/dcr-public/da47f910-60ac-438b-8b9b-6122f4d14524/16b7274a-bf8b-4b4c-a05e-746f2aa93c8c/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html

@mib1185 @harikrishna-patnala @RodrigoDLopez does it make sense to move this line to a newer upgrade file? <IP_ADDRESS> has been released already and we want to keep our fragile upgrade system as consistent as possible.

@mib1185 @harikrishna-patnala @RodrigoDLopez does it make sense to move this line to a newer upgrade file? <IP_ADDRESS> has been released already and we want to keep our fragile upgrade system as consistent as possible.

@DaanHoogland yeah for sure, you are right. But to be honest, I'm not really familiar with the upgrade system and therefore would kindly ask for support to create a appropriate upgrade file.

@DaanHoogland yeah for sure, you are right. But to be honest, I'm not really familiar with the upgrade system and therefore would kindly ask for support to create a appropriate upgrade file.

@mib1185 if you can make it idempotent it makes sense to put it in <IP_ADDRESS> to <IP_ADDRESS> and in <IP_ADDRESS> to <IP_ADDRESS>. If that is too much work I'd leave it to only go to <IP_ADDRESS>.

@mib1185 if you can make it idempotent it makes sense to put it in <IP_ADDRESS> to <IP_ADDRESS> and in <IP_ADDRESS> to <IP_ADDRESS>. If that is too much work I'd leave it to only go to <IP_ADDRESS>.

@mib1185 since <IP_ADDRESS> is released and  the records has been inserted into db, you need to use UPDATE instead of INSERT INTO.

@mib1185 since <IP_ADDRESS> is released and  the records has been inserted into db, you need to use UPDATE instead of INSERT INTO.

@mib1185 code changes looks good to me, as suggested please move out from 4.15.0

@mib1185 code changes looks good to me, as suggested please move out from 4.15.0

@DaanHoogland I would limit it to "<IP_ADDRESS> to <IP_ADDRESS>", because adding it also to 4.14.1 will conflict with the the insert's in table cloud.guest_os during upgrade to 4.15.0.
I noticed that there is an com.cloud.upgrade.dao package still needed, but I hope, someone other will implement this 🤞 😄

@DaanHoogland I would limit it to "<IP_ADDRESS> to <IP_ADDRESS>", because adding it also to 4.14.1 will conflict with the the insert's in table cloud.guest_os during upgrade to 4.15.0.
I noticed that there is an com.cloud.upgrade.dao package still needed, but I hope, someone other will implement this 🤞 😄

@mib1185 can you please fix conflicts and rebase against 4.15

@mib1185 can you please fix conflicts and rebase against 4.15

@shwstppr conflicts are resolved and rebase to current master is done

@shwstppr conflicts are resolved and rebase to current master is done

@shwstppr now I get it ... rebase to 4.15 is done and PR is set again branch 4.15

@shwstppr now I get it ... rebase to 4.15 is done and PR is set again branch 4.15

@mib1185
this pr lgtm
one question, there are two "SCO OpenServer 5" (ids are 85 and 324).
do you know the difference and plan to change one of them as well ?

@mib1185
this pr lgtm
one question, there are two "SCO OpenServer 5" (ids are 85 and 324).
do you know the difference and plan to change one of them as well ?

@weizhouapache
id 85 looks somehow strange - I gues it should be "other guest" instead of "SCO OpenServer 5" 🤔
SELECT * FROM cloud.guest_os WHERE id=85;
# id, category_id, name, uuid, display_name, created, removed, is_user_defined
'85', '9', NULL, '78751473-935a-11ea-95f2-005056bb3ebd', 'SCO OpenServer 5', '2020-05-11 09:42:56', NULL, '0'

SELECT * FROM cloud.guest_os_hypervisor WHERE guest_os_id=85;
# id, hypervisor_type, guest_os_name, guest_os_id, hypervisor_version, uuid, created, removed, is_user_defined
'202', 'VmWare', 'SCO OpenServer 5', '85', 'default', '07511bbc-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:56', NULL, '0'
'1387', 'VMware', 'otherGuest', '85', '4.0', '0864ff31-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1528', 'VMware', 'otherGuest', '85', '4.1', '0870b56f-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1669', 'VMware', 'otherGuest', '85', '5.0', '087d1de5-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1810', 'VMware', 'otherGuest', '85', '5.1', '0888ac46-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1951', 'VMware', 'otherGuest', '85', '5.5', '0895bef6-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'2448', 'VMware', 'otherGuest', '85', '6.0', '0cf88f63-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:05', NULL, '0'
'2889', 'VMware', 'otherGuest', '85', '6.5', '0f30e427-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:09', NULL, '0'
'4822', 'VMware', 'otherGuest', '85', '6.7', '1169e8de-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5077', 'VMware', 'otherGuest', '85', '6.7.1', '116b494b-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5332', 'VMware', 'otherGuest', '85', '6.7.2', '116c801a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5587', 'VMware', 'otherGuest', '85', '6.7.3', '116dbb0a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'

@weizhouapache
id 85 looks somehow strange - I gues it should be "other guest" instead of "SCO OpenServer 5" 🤔
SELECT * FROM cloud.guest_os WHERE id=85;
# id, category_id, name, uuid, display_name, created, removed, is_user_defined
'85', '9', NULL, '78751473-935a-11ea-95f2-005056bb3ebd', 'SCO OpenServer 5', '2020-05-11 09:42:56', NULL, '0'

SELECT * FROM cloud.guest_os_hypervisor WHERE guest_os_id=85;
# id, hypervisor_type, guest_os_name, guest_os_id, hypervisor_version, uuid, created, removed, is_user_defined
'202', 'VmWare', 'SCO OpenServer 5', '85', 'default', '07511bbc-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:56', NULL, '0'
'1387', 'VMware', 'otherGuest', '85', '4.0', '0864ff31-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1528', 'VMware', 'otherGuest', '85', '4.1', '0870b56f-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1669', 'VMware', 'otherGuest', '85', '5.0', '087d1de5-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1810', 'VMware', 'otherGuest', '85', '5.1', '0888ac46-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1951', 'VMware', 'otherGuest', '85', '5.5', '0895bef6-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'2448', 'VMware', 'otherGuest', '85', '6.0', '0cf88f63-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:05', NULL, '0'
'2889', 'VMware', 'otherGuest', '85', '6.5', '0f30e427-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:09', NULL, '0'
'4822', 'VMware', 'otherGuest', '85', '6.7', '1169e8de-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5077', 'VMware', 'otherGuest', '85', '6.7.1', '116b494b-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5332', 'VMware', 'otherGuest', '85', '6.7.2', '116c801a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5587', 'VMware', 'otherGuest', '85', '6.7.3', '116dbb0a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'

@weizhouapache
id 85 looks somehow strange - I gues it should be "other guest" instead of "SCO OpenServer 5" 🤔
SELECT * FROM cloud.guest_os WHERE id=85;
# id, category_id, name, uuid, display_name, created, removed, is_user_defined
'85', '9', NULL, '78751473-935a-11ea-95f2-005056bb3ebd', 'SCO OpenServer 5', '2020-05-11 09:42:56', NULL, '0'

SELECT * FROM cloud.guest_os_hypervisor WHERE guest_os_id=85;
# id, hypervisor_type, guest_os_name, guest_os_id, hypervisor_version, uuid, created, removed, is_user_defined
'202', 'VmWare', 'SCO OpenServer 5', '85', 'default', '07511bbc-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:56', NULL, '0'
'1387', 'VMware', 'otherGuest', '85', '4.0', '0864ff31-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1528', 'VMware', 'otherGuest', '85', '4.1', '0870b56f-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1669', 'VMware', 'otherGuest', '85', '5.0', '087d1de5-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1810', 'VMware', 'otherGuest', '85', '5.1', '0888ac46-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1951', 'VMware', 'otherGuest', '85', '5.5', '0895bef6-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'2448', 'VMware', 'otherGuest', '85', '6.0', '0cf88f63-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:05', NULL, '0'
'2889', 'VMware', 'otherGuest', '85', '6.5', '0f30e427-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:09', NULL, '0'
'4822', 'VMware', 'otherGuest', '85', '6.7', '1169e8de-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5077', 'VMware', 'otherGuest', '85', '6.7.1', '116b494b-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5332', 'VMware', 'otherGuest', '85', '6.7.2', '116c801a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5587', 'VMware', 'otherGuest', '85', '6.7.3', '116dbb0a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'

@mib1185 thanks.
@nvazquez since you are author of commit 50ab1b2fbe84aa60d8d7adc12919bebc83b5e003, could you please look at the issue above ?

@weizhouapache
id 85 looks somehow strange - I gues it should be "other guest" instead of "SCO OpenServer 5" 🤔
SELECT * FROM cloud.guest_os WHERE id=85;
# id, category_id, name, uuid, display_name, created, removed, is_user_defined
'85', '9', NULL, '78751473-935a-11ea-95f2-005056bb3ebd', 'SCO OpenServer 5', '2020-05-11 09:42:56', NULL, '0'

SELECT * FROM cloud.guest_os_hypervisor WHERE guest_os_id=85;
# id, hypervisor_type, guest_os_name, guest_os_id, hypervisor_version, uuid, created, removed, is_user_defined
'202', 'VmWare', 'SCO OpenServer 5', '85', 'default', '07511bbc-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:56', NULL, '0'
'1387', 'VMware', 'otherGuest', '85', '4.0', '0864ff31-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1528', 'VMware', 'otherGuest', '85', '4.1', '0870b56f-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1669', 'VMware', 'otherGuest', '85', '5.0', '087d1de5-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1810', 'VMware', 'otherGuest', '85', '5.1', '0888ac46-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'1951', 'VMware', 'otherGuest', '85', '5.5', '0895bef6-935b-11ea-95f2-005056bb3ebd', '2020-05-11 09:42:58', NULL, '0'
'2448', 'VMware', 'otherGuest', '85', '6.0', '0cf88f63-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:05', NULL, '0'
'2889', 'VMware', 'otherGuest', '85', '6.5', '0f30e427-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:09', NULL, '0'
'4822', 'VMware', 'otherGuest', '85', '6.7', '1169e8de-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5077', 'VMware', 'otherGuest', '85', '6.7.1', '116b494b-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5332', 'VMware', 'otherGuest', '85', '6.7.2', '116c801a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'
'5587', 'VMware', 'otherGuest', '85', '6.7.3', '116dbb0a-935b-11ea-95f2-005056bb3ebd', '2020-05-11 07:43:13', NULL, '0'

@mib1185 thanks.
@nvazquez since you are author of commit 50ab1b2fbe84aa60d8d7adc12919bebc83b5e003, could you please look at the issue above ?


Fix reply username in embed

This PR fixes the "Replying to" display on embeds:

Fixes #467

Oops, thank you for that, I only saw the issue now


Question: Does MVK support VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT?

The descriptor_indexing sample in the official Khronos Vulkan-Samples repo fails (https://github.com/KhronosGroup/Vulkan-Samples/blob/main/samples/extensions/descriptor_indexing/descriptor_indexing.cpp), even with argument buffers enabled.
I have tracked down the issue, and it relates to exhaustion of the descriptor pool.  The sample defines bindings with set_layout_binding.descriptorCount = maxDescriptorSetUpdateAfterBindSampledImages, i.e. the max.  This seems excessive, but may not be an issue for other platforms that respect the VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT_EXT flag which is set by the sample.
The problem arises when actually allocating descriptor sets, i.e. when calling vkAllocateDescriptorSets() extended by the VkDescriptorSetVariableDescriptorCountAllocateInfoEXT structure.  The structure properly defines the number of descriptors to be allocated (i.e. NumDescriptorsStreaming and NumDescriptorsNonUniform in two separate allocations), but MoltenVK's allocate action seems to check if there are set_layout_binding.descriptorCount resources available in the pool, which in this case is 500,000 (the max) and of course this fails since it exceeds the pool size.
I have been able to verify this and get the sample working by using NumDescriptorsStreaming in the binding definition, and by increasing the pool size to 2 x NumDescriptorsStreaming (for 2 allocation calls).  However, I suspect this may violate the spirit of the sample where variable descriptor count allocations are used.
I am wondering whether MoltenVK supports the variable descriptor count flag and structure, and if so, should it instead be checking for variable_info.pDescriptorCounts resources in the pool when the variable bit is enabled and the variable descriptor count structure is present in the pNext chain of allocate_info.
I am putting this forward as a question, since I may not have this right.  However, I wanted to report it here before going back to the official sample repo and offering any solutions for MoltenVK in that forum.

The use of Metal Argument Buffers in MoltenVK is currently being overhauled. It should be published in the next week or so. At that point, you can retest this, and if it's still an issue, we can fix it within the new argument buffer environment.

Thanks for the heads up and I will retest when you release your new argument buffer code.

Thanks for supplying the sample to replicate this issue.
Confirmed issue. Working on it.

This is fixed in PR #2273. Please retest with latest MoltenVK, and close this issue if it fixes the problem.

Verified as working with the official Khronos descriptor indexing sample using MoltenVK 1.2.10 on macOS Ventura 13.6.6 (x86) and iOS 17.5.1 on iPhone 15.
Thanks for fixing!


Http Status Code 204 failing with empty content

Service A calls Service B => Service B returns 204. On the Service A when EnsureSucessStatusCode is invoked it adds empty Content which then fails from Kestrel.
Writing to the response body is invalid for responses with status code 204.
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame.HandleNonBodyResponseWrite()
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame.d__199.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.ResponseCompression.BodyWrapperStream.d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpContent.d__44.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Sy
To have a workaround we need to explicitly add the following where the Content is null and it works fine.
if( response.StatusCode.Equals(HttpStatusCode.NoContent))
{
var response =new HttpResponseMessage(HttpStatusCode.NoContent);
return response;
}
Ask for Kestrel to ignore the Conent if the status code is 204. Or dotnet services should not add the content by default on 204 status code.

We're going to need a little more context to make sense out of this. Where did you add this workaround code? Can you share more of that code?


Contributing to TFlite Micro

Hi,
I want to contribute to TFlite Micro. Please help me with getting started.
I have some hardware which might be useful for me to contribute, it includes: STM32 Nucleo-L476RG, Arduino Uno, Nano, Micro, Esp8266, and Esp32
I know Python and C programming.
P.S. - I am a hobbyist and want to contribute.
Thanks.

Thanks for expressing your interest in contributing to TensorFlow.
We appreciate community reaching out and contributing to enhance TensorFlow's usage.
Please go through contributor guidelines to start with.
Feel free to contribute in any way you can; improving the guides, documentation, tutorials, fixing bugs that you may encounter or encounter by other users.
We accept code/document changes in the form of Pull Request (PR).
So make sure to provide as much information as you can with your PR to help us better assess the case and review it.
I also encourage you to sign up for the TensorFlow monthly newsletter for new updates.

You can filter the GitHub issues on this repo with good first issue lablel. But I am afraid that we don't have any for micro at the moment. Never the less you can try taking a glance on feature requests or bug labelled micro issues.
Thank you.


How do we set up this repo?

There are a number of different services that we will want in the future to all be configurable in this repo:

deliberation-empirica
video coding tool
scheduling tool
researcher portal
CDN

Each of these will need some shared infrastructure (ie, share a vpc, or usesr/security group) but some of the resources will be just for a single service. How do we split these out?
From: https://developer.hashicorp.com/terraform/cloud-docs/recommended-practices/part1

To delegate a large application, companies often split it into small, focused microservice components that are owned by specific teams. Each microservice provides an API, and as long as those APIs don't change, microservice teams can make changes in parallel despite relying on each others' functionality.
Similarly, infrastructure code can be split into smaller Terraform configurations, which have limited scope and are owned by specific teams. These independent configurations use output variables to publish information and remote state resources to access output data from other workspaces. Just like microservices communicate and connect via APIs, Terraform workspaces connect via remote state.
Once you have loosely-coupled Terraform configurations, you can delegate their development and maintenance to different teams. To do this effectively, you need to control access to that code.
This is how Terraform Cloud solves the organizational complexity of provisioning: by providing a centralized run environment for Terraform that supports and enforces your organization's access control decisions across all workspaces. This helps you delegate infrastructure ownership to enable parallel development.

I think having a separate workspace for each service, plus one for the networking/shared infrastructure makes a lot of sense. That way, we can take down one of the services without it influencing the others. Having each of these workspaces correspond to a directory in this repo seems like a simple way to accomplish that.
Having it set up this way means we'll need to use 'outputs' to let the various services know about each other. I havent done this yet, so we'll need to figure out how to do it. I have a fellow on upwork who can be helpful, if we want to set up a time to meet with him.


[Bug] Ctrl+9 - connection dialog - does not reconnect to current connection on enter

Version: 5.2.2 CE
OS: Windows 10
Description:
Keeping current script open and disconnecting the connection. Trying to choose the same connection again will not allow it to reconnect from connection dialog. You have to force a reconnect from Database -> Reconnect
Screenshot/Recording:

Maybe you have option "Connect on editor activation" option turned off? In that case connection won't be automatically opened by SQL editor. But it may be opened on query execution.
Check Preferences->Database->SQL Editor.

I did check and it is turned on.
Main reason I reported it is because many times I disconnect the connection to avoid having uncommitted changes in the editor or disconnect all connections. However connecting to the same connection as is listed as active...then a reconnect wont happen.
On Connecting to a different database then it does do another connect.

This only happens on Ctrl+9, choose same connection as "is active but disconnected", press enter.

Another video might explain it a bit more?

Preferences:

Well, yes.
Basically it shouldn't reconnect. Because you don't change the connection, it remains the same. So not action was performed.
So this doesn't look like a bug. And I'm not sure that we should change current behavior.
Maybe you could just assign some shortcuts to Connect/Disconnect actions to simplify this?

Hmmm if I may I ask....what is the purpose of not reconnecting or at least ask to reconnect?
Of course I can bind a keybinding...just curious to why it would not connect when telling the connection to go to that specific connection again?


Use constructor call for package-private class

Description
If analyzed class has package-private (default) access - and there is a public or a package-private constructor - need to use the applicable constructor. Currently reflection is used and createInstance (String className) is generated.
To Reproduce
Preconditions:

Open/create a project in IntelliJ Idea
UTBotJava plugin is installed

Steps to reproduce the behavior:

Add the following java class:

 class A {

    public int a = 0;
    public int b = 7;

    public A() {
    }

    A(int a, int b) {
        this.a = a;
        this.b = b;
    }

    int sum() {
        return a + b;
    }
}

Generate Test with UTBot for this class
Open the generated test

Expected behavior
Constructor call must be used to instantiate A object.
        A a = new A(-255, -255);

Actual behavior
There is createInstance(String className) method generated.
It is used to instantiate A object in the test.
        A a = ((A) createInstance("A"));
        a.b = -255;
        a.a = -255;

Environment
IDEA 2022.1.3
JDK 8
UTBotJava plugin build

Additional context
Reflection method is used instead of constructor when

class and constructors have all public access modifiers
fields are private

 public class A {

    private int a = 0;
    private int b = 7;

    public A() {
    }

    public A(int a, int b) {
        this.a = a;
        this.b = b;
    }

    int sum() {
        return a + b;
    }
}

Expected behavior
        A a = new A(-255, -255);

Actual behavior
        A a = ((A) createInstance("A"));
        setField(a, "b", -255);
        setField(a, "a", -255);


factorio: unable to run the campaign

Describe the bug
As soon as I enter a campaign I get an error, that factorio does not have the permission to copy files inside the nix store, which drops me back inside the menu.
The application logs this to shell:
 144.368 Error MainLoop.cpp:1195: Exception at tick 5158719: Error while running reload_script: filesystem error: copy_file "/nix/store/q4g4v32p6fmv0xs1lzc40lx0fjf7708q-factorio-alpha-0.17.79/share/factorio/data/base/campaigns/npe/locale/af/npe.cfg" to "/home/hexa/.factorio/temp/currently-playing/campaign-locale/af/npe.cfg" failed: Permission denied [/nix/store/q4g4v32p6fmv0xs1lzc40lx0fjf7708q-factorio-alpha-0.17.79/share/factorio/data/base/campaigns/npe/locale/af/npe.cfg] [/home/hexa/.factorio/temp/currently-playing/campaign-locale/af/npe.cfg]

To Reproduce
Steps to reproduce the behavior:

Start the game
Choose Play
Start Campaign
Pick "Introduction" (or any other entry)
Press Play
Press Play again

Expected behavior
The introduction should be playable.
A clear and concise description of what you expected to happen.
Notify maintainers

@Baughn @elitak @erictapen
Metadata
 - system: `"x86_64-linux"`
 - host os: `Linux 5.7.4, NixOS, 20.09.git.647821e8e0e (Nightingale)`
 - multi-user?: `yes` - system: `"x86_64-linux"`
 - host os: `Linux 5.7.4, NixOS, 20.09.git.647821e8e0e (Nightingale)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.6`
 - channels(root): `"nixos-20.09pre223023.fce7562cf46, nixos-unstable-20.09pre223023.fce7562cf46"`
 - channels(hexa): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

sandbox: yes
version: nix-env (Nix) 2.3.6
channels(root): "nixos-20.09pre223023.fce7562cf46, nixos-unstable-20.09pre223023.fce7562cf46"
channels(hexa): ""
nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute: factorio
# a list of nixos modules affected by the problem
module:

The same is the case for the ingame mini-tutorials sadly.
6320.971 Error AppManager.cpp:677: Failed to load tutorial: Error while running reload_script: filesystem error: copy_file "/nix/store/q4g4v32p6fmv0xs1lzc40lx0fjf7708q-factorio-alpha-0.17.79/share/factorio/data/base/tutorials/stack-transfers/control.lua" to "/home/hexa/.factorio/temp/currently-playing-tutorial/control.lua" failed: Permission denied [/nix/store/q4g4v32p6fmv0xs1lzc40lx0fjf7708q-factorio-alpha-0.17.79/share/factorio/data/base/tutorials/stack-transfers/control.lua] [/home/hexa/.factorio/temp/currently-playing-tutorial/control.lua]

Looks like it's a known issue, See https://github.com/NixOS/nixpkgs/pull/73165#issuecomment-615916107  for (ugly) workaround.

Thanks for the bug report, @mweinelt!
I remember hacking around this once with something like:
while true; do chmod -R +rw /home/hexa/.factorio/temp; done

But this is ugly and not guaranteed to work.
From #73165:

This is actually a common problem that happens with NixOS.
It sounds like factorio copies these files from the nix store to some temp directory and wants to write to them, but it doesn't chmod them and make them owned by the proper user. I bet you can fix this on your own by fixing the permissions, and this is a pretty reasonable bug report to submit (I make one for it all the time).

(by @worldofpeace)

I see three possible ways. Only the third one being correct, imho.

Somehow fix the permissions inside /nix/store. I guess it may be hard because AFAIK they're reset to 444 on last installation stage
Implement some weird hook using LD_PRELOAD or something like that. We should detect copy being created and fix permissions on the fly.
Solve the problem upstream, I would say it's perfectly ok to have master-copy of files read-only. If not, why to copy them in the first place? It's responsibility of Factorio to ensure paths it's going to write to have appropriate permissions.

(by @akamaus)
I'll add a 4th way:

Create a wrapper script for factorio which creates a cache directory (/var/cache/factorio/$PKG_NAME or something like that?), copies the files over, fixes permissions and starts factorio with the cache directory as scenario/tutorial data directory. If that is possible.

So, the first step would be to file a bug upstream and if they can't fix it or don't want to fix it, I'd try no. 4 next.

Opened upstream: https://forums.factorio.com/viewtopic.php?f=7&t=102351&p=570484#p570484

I have a marginally better hacky workaround:
#!/usr/bin/env bash

set -e

FACTORIO_CONFIG="$HOME/.factorio"

AUTH_PROGRAM=sudo # Replace with pkexec if you want

img_path="$FACTORIO_CONFIG/temp.img"

if [ ! -f "$img_path" ]; then
	dd if=/dev/zero of="$img_path" bs=4M count=16
	mkfs.fat -F32 "$img_path"
fi

loop_dev=$($AUTH_PROGRAM losetup -f)

$AUTH_PROGRAM losetup $loop_dev "$img_path"

if [ -d "$FACTORIO_CONFIG/temp" ]; then
	rmdir "$FACTORIO_CONFIG/temp"
fi

mkdir "$FACTORIO_CONFIG/temp"

$AUTH_PROGRAM mount $loop_dev "$FACTORIO_CONFIG/temp" -o uid=$(id -u) -o gid=$(id -g)

factorio || true

$AUTH_PROGRAM umount $loop_dev
$AUTH_PROGRAM losetup -d $loop_dev

Maybe LD_PRELOAD the file copy function to restore the writable flag for each file/directory, copied from /nix/store...

Another variant might be to run a bash script with inotifywait in parallel. inotifywait will wait till new file creation event to trigger chmod.

I did put together an inotify based bash script (and also a version in C) but it didn't activate fast enough before factorio errored out.

I did put together an inotify based bash script (and also a version in C) but it didn't activate fast enough before factorio errored out.
factorio_chowner.c

I believe this was fixed upstream. I'm not sure exactly which version, but https://forums.factorio.com/viewtopic.php?f=7&t=102351&p=570484#p570484 claims it was fixed around January this year

Yes, looks fixed to me as well. Thanks!


Add a link to the document in the timings report

What does this PR try to resolve?
close https://github.com/rust-lang/cargo/issues/10487
Add a link to the document in the header of timings report.
How should we test and review this PR?
cargo build --timings

r? @ehuss
(rust-highfive has picked a reviewer for you, use r? to override)

Thanks!  I think I would prefer this not to be so prominent, though.  Is there a particular reason you placed it in the header instead of at the bottom of the page?

Thanks! I think I would prefer this not to be so prominent, though. Is there a particular reason you placed it in the header instead of at the bottom of the page?

I think it might be easier to get the user's attention by putting the document next to the title. Otherwise when they look at the chart they will be confused. Putting it at the end means that the user sees the chart first and then the document. I think we may need to put the document in front. Also I can't find a place at the end where it would look better to add the document link.

@ehuss Could you please look at it again? Thanks!

Thanks!
@bors r+

:pushpin: Commit 4a12569d952110f98ef7b3bd0a4ea6a343c00a58 has been approved by ehuss

:hourglass: Testing commit 4a12569d952110f98ef7b3bd0a4ea6a343c00a58 with merge 25cc78e2c6a057c7e244b2966d871eb56d0c0c60...

:sunny: Test successful - checks-actions
Approved by: ehuss
Pushing 25cc78e2c6a057c7e244b2966d871eb56d0c0c60 to master...


Add integration and functional tests of [BindRequired] on page properties

#7353

Closing and reopening to nudge the CLA check along


V1 Optimizations

Some of the diff is just my linter. The optimizations I made are:

Combine the _pushGobblers and _pullGobblers into a _transferGobblers method
Calculating the deposited emissions multiple (sumMultiples) by measuring the difference in the contract's total emissions
Remove the GOO approval in the constructor as it's not needed
Reduce sload by caching and reusing total supply in _sharesPrice

thanks, will have a look and integrate the optimizations


[Question]:  Is it possible to set environemnt variables IN WINDOWS directly from docker compose?

Is your question not already answered in the FAQ?

[X] I made sure the question is not listed in the FAQ.

Is this a general question and not a technical issue?

[X] I am sure my question is not about a technical issue.

Question
Hi
I would need some environment variables to be set on the windows VM.
Is there a way for that or do i need to do some scripting?
Thank you!

Not directly from Docker Compose from my understanding, but you can use one of the unattend XML files at the link below. At the end, add a command to create the environment variable. Replace [KEY] and [VALUE].
https://github.com/dockur/windows/tree/master/assets
Line to include in Docker Compose file, replacing the win2016-eval.xml with the one for your operating system:
-v "./win2016-eval.xml:/custom.xml"
<SynchronousCommand wcm:action="add">     <Order>21</Order>     <CommandLine>reg.exe add "HKCU\Environment" /v [KEY] /t REG_SZ /d "[VALUE]" /f</CommandLine>     <Description>Set environment variable</Description> </SynchronousCommand>

Not directly from Docker Compose from my understanding, but you can use one of the unattend XML files at the link below. At the end, add a command to create the environment variable. Replace [KEY] and [VALUE].
https://github.com/dockur/windows/tree/master/assets
Line to include in Docker Compose file, replacing the win2016-eval.xml with the one for your operating system:
-v "./win2016-eval.xml:/custom.xml"
<SynchronousCommand wcm:action="add"> <Order>21</Order> <CommandLine>reg.exe add "HKCU\Environment" /v [KEY] /t REG_SZ /d "[VALUE]" /f</CommandLine> <Description>Set environment variable</Description> </SynchronousCommand>

Thank you!
In the end I just mounted a .env file into the container and at the start of my code i load this file to set the variables.
but I will be looking at your suggestion!


Sonnet 3.5 support

Added support for claude-3-5-sonnet model in the plugin
https://aws.amazon.com/about-aws/whats-new/2024/06/anthropic-claude-3-5-sonnet-model-bedrock

Great stuff! Anything blocking this from being merged? I'd love to use it, as I don't have access to the Claude API as an individual. Thx!

Merged in, will try to push a release after I get the kid down, tonight.


How to select  number of gpus?

hi,
i want to train on multiple gpus with train_DDP.py,
but i do not know which param determine the number of gpus.
Looking forward to your reply ！ Thank you!

Hi, you can use python3 train_ddp.py --num_gpus 8

Hi, you can use python3 train_ddp.py --num_gpus 8

which code branch did you use?


Websocket TLS handshake error EOF

Hello, currently i'm trying to setup nats websocket with tls based example configuration on this reference on my local environment, tls that i'm use was self signing certificate from mkcert, then mounting them into docker container alongside with my nats server configuration.
nats-server.conf
# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

authorization {
	default_permissions: {
		publish: "SANDBOX.*"
		subscribe: ["PUBLIC.>", "_INBOX.>"]
	}
	ADMIN: {
		publish: ">"
		subscribe: ">"
	}
	WS_USER: {
		publish: ["cmd.req", "_INBOX.>"]
		subscribe: ["notifications.*", "_INBOX.>"]
	}
	users: [
		{ user: admin, password: "admin", permissions: $ADMIN, allowed_connection_types: ["STANDARD"] }
		{ user: user, pass: "user", permissions: $WS_USER, allowed_connection_types: ["WEBSOCKET"] }
	]
	timeout: 15.0
}

# This is for clustering multiple servers together.
cluster {
  name: "executive-nats-cluster"

  port: 6222

  authorization {
    user: "cUser"
    password: "cPassword"
    timeout: 2
  }

  routes = []
}

websocket {
    port: 6969

    tls {
          cert_file: "/etc/nats/mkcert-server-cert.pem"
          key_file: "/etc/nats/mkcert-server-key.pem"
    }

    authorization {
		timeout: 3.0
    }
}

With config above, i'm tried connecting to websocket using nats.ws as client, with example code like below, and got an error message unknown error

after that, i'm checking container logs on docker and see an error logs that say TLS handshake error EOF like on picture below

Is there a limitation from nats.ws ? i've already tried to pass tls certificate into connect method and still not work. When i'm check the documentation it was updated to clarify that websocket can't connect using tls on this reference. Then how i'm supposed todo for connecting to websocket with TLS because from the websocket configuration they said tls was enabled by default and inject with no_tls: true only for test env.
Update
I'm trying with another client library and that was nats.go, it can properly connected with tls configuration on nats server. It seems that was issue on nats.ws, can you fix it ?

Environment:

Windows 10 Pro 21H2
WSL2
Docker Desktop

Yes nats.ws doesn't support TLS configuration as it uses  W3C websocket, which don't provide a way to hook them up.


How does one make use of this?

Hi,
I don't understand how to implement this. The instructions aren't clear about where to insert the dependencies?

I have created a new game with custom character sheet and pasted in your html, css and translations manually (as the "alternate" sheet doesn't appear as an option in the drop-down.
I have then added an API Script and pasted your API Script in there.
But now I don't understand how to integrate the custom compendium?

You basically do exactly the same as with the API script. The compendium release really is just an API script that contains mostly json.
I made a quick video to show the process, since people are often confused about this, but Youtube is taking forever to publish it, so I guess I'll be posting it tomorrow instead.

Well, at least the SD version is available now: https://www.youtube.com/watch?v=yoCmffUp9BE
HD may need a few more hours of processing I suppose.
Let me know if that helps, and if yes I'll add it to the documentation.

Thanks Lars,
I think the video is great. I wouldn’t have been able to figure out what to do without it.
Pity there’s no sound? I think you just talking over it would really help with context – I didn’t understand what you were doing with the site’s security certificate or why for example, which you could easily explain. I also didn’t really understand the bit at the end where you’re exporting stuff from a website – wasn’t sure why that’s not just built into the compendium?
Looks like amazing work btw. Scala is complicated!
I’m hoping to build a Gamma World 3rd Edition character sheet plus compendium (just for me, not for public release, due to licensing).
I’m also hoping to build my own RPG system, so having a compendium would be handy. Looks like a LOT of work though :-/
Cheers,
Noel

On 24 Dec 2019, at 02:21, Lars Kroll<EMAIL_ADDRESS>wrote:
Well, at least the SD version is available now: https://www.youtube.com/watch?v=yoCmffUp9BE https://www.youtube.com/watch?v=yoCmffUp9BE
HD may need a few more hours of processing I suppose.
Let me know if that helps, and if yes I'll add it to the documentation.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Bathtor/EPCompendium/issues/27?email_source=notifications&email_token=ABDMKK4RHHWYAZXCLTKIBXDQ2FIZBA5CNFSM4J6WY4G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHSFMBQ#issuecomment-568612358, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDMKKYPC6HF5DEG3QO6J3TQ2FIZBANCNFSM4J6WY4GQ.

Pity there’s no sound? I think you just talking over it would really help with context – I didn’t understand what you were doing with the site’s security certificate or why for example, which you could easily explain. I also didn’t really understand the bit at the end where you’re exporting stuff from a website –wasn’t sure why that’s not just built into the compendium?

Yeah, I don't have good setup for recording sound right now...Maybe I'll do a voice-over in the new year, when I get back to work and can use the equipment there. For now you'll have to make do with the explanations in the video description^^ I explain the security certificate thingy there, btw ;)
Well, most of the stuff from the website is build in the compendium as well. So you can kinda choose if you want to use the website or the API script. Whichever seems more convenient. Website may be easier to set up for people, since you can just use the dropdown sheet and dropdown script, instead of having to manually paste the compendium script. I usually also use the website when I'm GMing, since it's visually easier to find information there, compared to the chat output.
The only thingy you really have to do from the website is random character generation, because that code is waaaay too complicated for a Roll20 API script. Remember that API scripts have an execution time limit, and if they run out of time, they'll be interrupted in the middle of whatever they were doing, leaving your game in a potentially inconsistent state. That's pretty annoying, if you want to do thousands of random samples to generate a character. Thus, I use the website to generate characters and them import them into Roll20 as shown. This has saved me sooooooooo much time, since I implemented it, because in EP NPCs are basically just as complicated to build as player characters, which used to take me hours for every single combat-ready NPC (the other, of course, didn't need so much detail). Now I can just generate something from the right category and maybe tweak it a bit to fit into my theme for the character, and then I'm done.

Looks like amazing work btw. Scala is complicated!

It's also very convenient and easy to maintain ;)

I’m hoping to build a Gamma World 3rd Edition character sheet plus compendium (just for me, not for public release, due to licensing).
I’m also hoping to build my own RPG system, so having a compendium would be handy. Looks like a LOT of work though :-/

Yeah, it may have been a bit of work to get where I am now. I did some rough math on my toggle.com stats, and the Sheet, Script, Compendium, Char Generator, and Website together have taken me around 500h over the past 3 years, I think.
Of course, I also developed the Scala libraries for wrapping Roll20's code in something easier to work with during that time, which you probably wouldn't have to do if you worked either directly in Javascript or in Scala (since my libraries for this are open source). That should save you...I don't know...some time^^

The basic templates offered on the wiki are pretty awful :( and I couldn’t find anything about tabs on the Wiki.
I don’t know Scala but I think your sheet is impressive.. pity I can’t read it.
I’ve been trying to get going on building a sheet but making very little progress.
It doesn’t seem to allow one to add JavaScript… so how did you manage to get tabs working? Is that via a service-worker?

On 24 Dec 2019, at 13:25, Lars Kroll<EMAIL_ADDRESS>wrote:
Pity there’s no sound? I think you just talking over it would really help with context – I didn’t understand what you were doing with the site’s security certificate or why for example, which you could easily explain. I also didn’t really understand the bit at the end where you’re exporting stuff from a website –wasn’t sure why that’s not just built into the compendium?
Yeah, I don't have good setup for recording sound right now...Maybe I'll do a voice-over in the new year, when I get back to work and can use the equipment there. For now you'll have to make do with the explanations in the video description^^ I explain the security certificate thingy there, btw ;)
Well, most of the stuff from the website is build in the compendium as well. So you can kinda choose if you want to use the website or the API script. Whichever seems more convenient. Website may be easier to set up for people, since you can just use the dropdown sheet and dropdown script, instead of having to manually paste the compendium script. I usually also use the website when I'm GMing, since it's visually easier to find information there, compared to the chat output.
The only thingy you really have to do from the website is random character generation, because that code is waaaay too complicated for a Roll20 API script. Remember that API scripts have an execution time limit, and if they run out of time, they'll be interrupted in the middle of whatever they were doing, leaving your game in a potentially inconsistent state. That's pretty annoying, if you want to do thousands of random samples to generate a character. Thus, I use the website to generate characters and them import them into Roll20 as shown. This has saved me sooooooooo much time, since I implemented it, because in EP NPCs are basically just as complicated to build as player characters, which used to take me hours for every single combat-ready NPC (the other, of course, didn't need so much detail). Now I can just generate something from the right category and maybe tweak it a bit to fit into my theme for the character, and then I'm done.
Looks like amazing work btw. Scala is complicated!
It's also very convenient and easy to maintain ;)
I’m hoping to build a Gamma World 3rd Edition character sheet plus compendium (just for me, not for public release, due to licensing).
I’m also hoping to build my own RPG system, so having a compendium would be handy. Looks like a LOT of work though :-/
Yeah, it may have been a bit of work to get where I am now. I did some rough math on my toggle.com stats, and the Sheet, Script, Compendium, Char Generator, and Website together have taken me around 500h over the past 3 years, I think.
Of course, I also developed the Scala libraries for wrapping Roll20's code in something easier to work with during that time, which you probably wouldn't have to do if you worked either directly in Javascript or in Scala (since my libraries for this are open source). That should save you...I don't know...some time^^
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Bathtor/EPCompendium/issues/27?email_source=notifications&email_token=ABDMKKYUVTLYPCI256J2WMLQ2HWTXA5CNFSM4J6WY4G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTB3TI#issuecomment-568729037, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDMKK6LE6RFJDBOS5G3MT3Q2HWTXANCNFSM4J6WY4GQ.

The basic templates offered on the wiki are pretty awful :( and I couldn’t find anything about tabs on the Wiki.
I don’t know Scala but I think your sheet is impressive.. pity I can’t read it.
I’ve been trying to get going on building a sheet but making very little progress.
It doesn’t seem to allow one to add JavaScript… so how did you manage to get tabs working? Is that via a service-worker?

Actually, the tabs are a wonderful cheat, that you can do in pure CSS. Basically the "links" to the tabs are actually a fancy radio button, and the show/hide property of the page they address is managed by selecting on the content value of the radio button. You don't really need to use sheet-workers for this, but sometimes you need to use Roll20's attribute sync feature to get the selected value into another input element. This also has the lovely advantage, that the selected tab is persisted across sessions...and the not-so-lovely disadvantage, that when GM and player are looking at the same sheet, they are always going to switch each other's tabs :D
In my sheet, I use these sheet attributes for the radio toggle, which Roll20 automatically syncs into all other fields with the same attribute tag. I use this to sync the value of the radio button into a hidden input field (.sheet-pageToggle) at the same HTML nesting depth as all the individual tab divs. Each of the tabs has its own class, e.g., .sheet-tab1, .sheet-tab2, etc. And then there's a CSS rule for each tab to hide them if they are not selected:
input.sheet-pageToggle:not([value="1"]) ~ .sheet-tab1 {
  display: none;
}
input.sheet-pageToggle:not([value="2"]) ~ .sheet-tab2 {
  display: none;
}

and so on...
In general, I borrowed a lot of ideas, like this one, from Kryx' D&D 5E Shaped sheet. If you prefer reading HTML+JS over Scala, take a look there for inspiration.
Although, I think that Scala is a lot easier to read and write, but it may have a bit of learning curve :D
You can see the Scala code that generates that particular layout here. You can see how it just parametrises the HTML and CSS it generates by the id number of the tab via ${id} (which is just a string splice in Scala).

Ok.. so you’re dynamically generating your CSS also from Scala in order to provide labels for your radio buttons that are disguised as buttons?

On 26 Dec 2019, at 13:55, Lars Kroll<EMAIL_ADDRESS>wrote:
The basic templates offered on the wiki are pretty awful :( and I couldn’t find anything about tabs on the Wiki.
I don’t know Scala but I think your sheet is impressive.. pity I can’t read it.
I’ve been trying to get going on building a sheet but making very little progress.
It doesn’t seem to allow one to add JavaScript… so how did you manage to get tabs working? Is that via a service-worker?
Actually, the tabs are a wonderful cheat, that you can do in pure CSS. Basically the "links" to the tabs are actually a fancy radio button, and the show/hide property of the page they address is managed by selecting on the content value of the radio button. You don't really need to use sheet-workers for this, but sometimes you need to use Roll20's attribute sync feature to get the selected value into another input element. This also has the lovely advantage, that the selected tab is persisted across sessions...and the not-so-lovely disadvantage, that when GM and player are looking at the same sheet, they are always going to switch each other's tabs :D
In my sheet, I use these sheet attributes for the radio toggle, which Roll20 automatically syncs into all other fields with the same attribute tag. I use this to sync the value of the radio button into a hidden input field (.sheet-pageToggle) at the same HTML nesting depth as all the individual tab divs. Each of the tabs has its own class, e.g., .sheet-tab1, .sheet-tab2, etc. And then there's a CSS rule for each tab to hide them if they are not selected:
input.sheet-pageToggle:not([value="1"]) ~ .sheet-tab1 {
display: none;
}
input.sheet-pageToggle:not([value="2"]) ~ .sheet-tab2 {
display: none;
}
and so on...
In general, I borrowed a lot of ideas, like this one, from Kryx' D&D 5E Shaped sheet. If you prefer reading HTML+JS over Scala, take a look there https://github.com/Roll20/roll20-character-sheets/tree/master/5eShaped for inspiration.
Although, I think that Scala is a lot easier to read and write, but it may have a bit of learning curve :D
You can see the Scala code that generates that particular layout here https://github.com/Bathtor/sheet-framework/blob/f5b373d23ac531f447530502c0b4d35c9a03ea7d/framework/jvm/src/main/scala/com/lkroll/roll20/sheet/tabbed/TabbedSheet.scala#L115-L123. You can see how it just parametrises the HTML and CSS it generates by the id number of the tab via ${id} (which is just a string splice in Scala).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Bathtor/EPCompendium/issues/27?email_source=notifications&email_token=ABDMKKYJ5YLFZWYIJIGKZGLQ2SLSTA5CNFSM4J6WY4G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHVPG6A#issuecomment-569045880, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDMKK6JIL6H7HHHIIUWFEDQ2SLSTANCNFSM4J6WY4GQ.

Ok.. so you’re dynamically generating your CSS also from Scala in order to provide labels for your radio buttons that are disguised as buttons?

Yup.
Although calling this "dynamically" is a bit of an exaggeration. I use the Scala code to generate HTML and CSS, which I then upload to Roll20. So from Roll20's perspective, of course, all of this is just static.
I'm basically just abusing Scala as a templating engine, so I don't have to maintain repetitive HTML/CSS stuff, and I get some of the compiler's semantic analysis power to sanity-check the stuff I write, before I generate the markup from it. This usually saves a few testing round-trips to Roll20 when I'm developing, and in particular when I'm refactoring code later.

One thing I don’t get from the video is where you are doing the Macro import.
When I click on the macro tab in Roll20, I don’t get that option. I can add a new macro, but there’s no import option.
Any ideas?

One thing I don’t get from the video is where you are doing the Macro import.
When I click on the macro tab in Roll20, I don’t get that option. I can add a new macro, but there’s no import option.
Any ideas?

As I (also) pointed out in the description below the video, you need Roll20ES for that. Without it, you'll have to copy each macro manually from the markdown file instead.

Thanks for all the help so far – I’m making good progress!
Could you please show me your data structure for the compendium data? It’s not clear from the Scala for me.
I’m wondering specifically about arrays vs. Objects and whether items should have a numerical id.
I’m looking at this structure currently:
Compendium: {
          gear: [
                {
                  name: 'Backpack',
                  cost: 5,
                  weight: 1,
                  notes: 'Capacity: 15kg'
                },
...
Thoughts?

> On 26 Dec 2019, at 15:26, Lars Kroll<EMAIL_ADDRESS>wrote:
>
> One thing I don’t get from the video is where you are doing the Macro import.
> When I click on the macro tab in Roll20, I don’t get that option. I can add a new macro, but there’s no import option.
> Any ideas?
>
> As I (also) pointed out in the description below the video, you need Roll20ES <https://ssstormy.github.io/roll20-enhancement-suite/> for that. Without it, you'll have to copy each macro manually from the markdown file instead.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub <https://github.com/Bathtor/EPCompendium/issues/27?email_source=notifications&email_token=ABDMKKZGH4WM44ZETBXTZCTQ2SWIRA5CNFSM4J6WY4G2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHVSIQI#issuecomment-569058369>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABDMKK67NSIDEBIYQTDIJHTQ2SWIRANCNFSM4J6WY4GQ>.
>

Sure, the generated Javascript with JSON entries embedded for, for example, the "Weapons" group looks like this:
EPCompendium.addData(
	"6.0.0", // version number of the compendium
	"weapon", // item group
	[
		{
			"name":"Plasma Blade",
			"type":{"$type":"Blades"}, // the $type thingy is something my Scala JSON generator inserts to differentiate types from values...think of them as names for enum entries
			"descr":"Not really a sword, per se, the plasma sword is a sort of specialized plasma torch. A lengthened c-shaped framework above the handle uses a laser and magnetic coils to stabilize a “beam” of ionized, superheated gas (plasma). The open sides of the framework allow the “sword” to be used as a superheated cutting implement. Though dangerous to wield in melee, it is sometimes favored as a weapon against heavily armored exsurgents by some sentinels. Plasma swords are wielded using Blades skill.",
			"damage":{"dmgD10":2,"dmgConst":8,"dmgType":"Energy"},
			"effect":null,
			"ap":-8,
			"price":{"$type":"High"},
			"range":{"$type":"Melee"},
			"source":"Firewall"
		},
		// other weapons ...
	]
);

For importing via sheet field, instead of via the script-loaded compendium library, the format for the same item looks like this:
{
	"$type":"Weapon",
	"value":{
		"name":"Plasma Blade",
		"type":{"$type":"Blades"},
		"descr":"Not really a sword, per se, the plasma sword is a sort of specialized plasma torch. A lengthened c-shaped framework above the handle uses a laser and magnetic coils to stabilize a “beam” of ionized, superheated gas (plasma). The open sides of the framework allow the “sword” to be used as a superheated cutting implement. Though dangerous to wield in melee, it is sometimes favored as a weapon against heavily armored exsurgents by some sentinels. Plasma swords are wielded using Blades skill.",
		"damage":{"dmgD10":2,"dmgConst":8,"dmgType":"Energy"},
		"effect":null,
		"ap":-8,
		"price":{"$type":"High"},
		"range":{"$type":"Melee"},
		"source":"Firewall"
	},
	"version":"6.0.0"
}

You can see that they essentially contain the same information, just the script version avoids some redundant repetitions of the item type and the version, to save some space.
The reason I always keep compendium versions with the items, is to make sure that they don't accidentally get loaded by an outdated script, which might not know all the fields and thus leave things in a partially imported, inconsistent state (or simply crash^^).
To answer your question:
You can see that I use objects very heavily, and only use arrays where they make sense, for example when I really need a list of things, like passing multiple weapons at the same time to the indexer (that is what EPCompendium.addData basically does...it indexes all the loaded values so they become searchable and loadable).
About a numerical id...well...the question is, what you would like to do with it. If you have many very similar names for your items, but must differentiate them, then you may want to employ some kind of an id. It doesn't necessarily have to be numerical. For example, you could implement the full-text search, and it returns all the matches plus their ids in the chat, and when you want to import something you click on the item and it passes the id again to import script, so you can perform some kind of efficient lookup.
That sounds lovely and that is what databases do, right?
The problem here is: How do you make sure you keep those ids unique? You are writing JSON basically by hand, how are you going to make sure you never accidentally double apply an id? In a database, the management engine has an algorithm to ensure it only create unique ids, or if the user is supplying the id, then the engine will check that it's unique against its primary index. So you basically gotta do something similar. Either during loading, or (perhaps preferably) before publishing.
For the EP Compendium I simply use names as ids, but I ensure during JSON generation that the names are at least unique within a group, since otherwise the items become inaccessible to users once loaded.
As for your proposed structure, the object I'm sure is fine, but I wouldn't recommend going with a single large compendium file. It will be very annoying to maintain as it grows in size and you are trying too add things and modify things in there. I'd go with a number of smaller files, each for a particular type of item, and then just write some quick and simple script that basically pastes all the entries together for publishing.
As I said...I generate all the JSON from Scala (though the language doesn't really matter), because it makes it much easier for me to make schema changes later, or use the information in different ways. For example, I generate the code for all the macros, which I showed in the video, from the same code base, just using the item types and item ids from the data. It's much more flexible if you keep the data in a way that you can easily manipulate programmatically.


fix bubbling issue with mouseover event

Hi there Mahdi!
This pull request aims to fix the following issue:
https://jsfiddle.net/bhzyac58/1/
When you move the cursor between the blue border and the image in the link, the sound is fired multiple times, because that's the nature of the mouseover event, it bubbles.
So this pull request replaces the mouseover and mouseout events in favor of mouseenter and mouseleave ones.
Hope it helps!

Thank you @gibatronic for reporting the issue and fixing it. :+1:


Can not access wsl filesystem outside wsl

Environment
Windows build number: [version 10.0.19043.844]
Your Distribution version: [2021.1]
Whether the issue is on WSL 2 and/or WSL 1: [Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020] (WSL2)

Steps to reproduce

To reproduce the issue you don't have to do anything beside opening explorer.exe in \\wsl$\kali-linux\

Here is the output of dmesg if you need it : https://gist.github.com/ThalusA/1ceff51a6837832c968d766cb105adee

WSL logs:
I have send it using the Feedback Hub with Screenshots.
Expected behavior
I should have access to the WSL file system outside WSL using \\wsl$ endpoint.

Actual behavior
When i try to access it from explorer.exe, it never opens and loop endlessly and when i try to access it (always using \\wsl$\kali-linux\) using Windows Terminal it loop endlessly without opening a terminal. I can only access it using wsl.exe command (yes i can access all the WSL file system after using that command)

When i try to open it using explorer.exe :

When i try to open it using my default profile from Windows Terminal :

Result of networking.bat (output.log) : https://gist.github.com/ThalusA/5cb307b1a3827c8812f6a8e7a4a17271
Result of networking.bat (wsl.etl) : https://ufile.io/q6muk3um (I can't upload it on github because it doesn't support this filetype)

I've got a fix, Just go in optional features on Windows 10, disable WSL, reboot, enable WSL again, reboot, everything is now fixed.


Clean up worker subprocesses on timeout

Luigi uses the multiprocessing module to manage worker tasks, and uses multiprocessing.Process.terminate() to implement worker timeout. However, as mentioned in the docs, terminate orphans subprocesses spawned by the task. Maybe there are good reasons for orphaning these processes instead of killing them. However, it was leading to large resource leaks in my application -- I'm assuming most luigi workflows want subprocesses to be cleaned up during a worker timeout.
The psutil module seems to make recursively terminating a process and its subprocesses straightforward (though I've only tested this on one machine). I'm not sure if you'd be keen on adding psutil as a required dependency, so I've proposed a solution that falls back to the default terminate behavior if it isn't available.
Here's a script to demonstrate the issue
from subprocess import check_call
import luigi

class Worker(luigi.Task):

    foo = luigi.Parameter()

    def output(self):
        return luigi.LocalTarget(self.foo)

    def run(self):
        check_call(['python', '-c', 'import time; time.sleep(1000)'])

class Test(luigi.Task):

    def requires(self):
        return [Worker(foo="_%i" % i) for i in range(5)]

    def output(self):
        return luigi.LocalTarget('done')

if __name__ == "__main__":
    luigi.run()

Invoked via
python test.py Test --worker-timeout=3 --workers 5 --local-scheduler

With this patch, ps shows 5 processes of python -c import time; time.sleep(1000) while the pipeline is running, and 0 when completed. Without the patch, those 5 processes stay alive + orphaned.

Awesome finding! LGTM
PS. Damn intermittent Travis failure. #1188

@ChrisBeaumont, by the way, could you add a test case to this too? Just to ensure that we don't happen to remove this functionality in a future refactoring.

@Tarrasch sure thing


Nftables: Add configurable hooks

Fixes https://github.com/crowdsecurity/cs-firewall-bouncer/issues/229

Hello,
Thanks for the PR!
I haven't tested it yet, but it looks mostly good; just one thing:

If no nftables_hooks values are present in the configuration, can you default to input? This would make sure that older configurations do not break when upgrading the bouncer.

This should be already done here ? https://github.com/crowdsecurity/cs-firewall-bouncer/pull/231/files#diff-0e426a43248661127a0c0ee115aef7a1093b635f8993b3f7ebb1dd9f05b8f249R192


No syntax highlighting in<EMAIL_ADDRESS>

After updating to the latest version, I can no longer reliably see syntax highlighting. I could reproduce the issue by running git show 07e85b10b850630332aba1e4d85aa099911fe3df src/iterSideBySideDiffs.ts | git-split-diffs in this repository.
<EMAIL_ADDRESS>
<EMAIL_ADDRESS>

I too have syntax highlighting problems with versions 0.11.0, 0.12.0 and 0.13.0. Version 0.10.0 works well.

Apologies. https://github.com/banga/git-split-diffs/commit/e7319d1e3ea7234482892402a3836d4417a3b3da should fix it, which I've published in v0.14.0. Can you all try it out?

0.14.0 seems to fix the problem for me.

0.14.0 seems to so far work for me too. 👍 Thanks for the fix!

Thanks for reporting!


[Only in IOS background Mode] not able to fetch next song from server after playback-queue-ended in IOS background mode

Hey Folks,
I am trying to fetch the next song from the server when playback-queue-ended invoked.
It's working fine with Android (both foreground and background) and IOS (only in the foreground). In the case of the IOS background, it's not working at all.
though, It's working perfectly fine with the IOS simulator.
Note: I have read somewhere in issues, that is not possible because of limited amount of time before the OS kills the app but that's not true because the same functionality is already available with one more package react-native-music-control but unfortunately I can't use it because that package is not maintained anymore and they recommended to use only this react-native-track-player package.

You're running into an issue with iOS.. once playback stops you'll have a limited amount of time before the OS kills the app. Your fetch for a new track must not be working effectively and the OS is shutting down the app. possibly the RN thread is also sleeping on you.

To Reproduce

write code to fetch next song when playback-queue-ended
Put your IOS App in background
keep listening to the first song
And when playback-queue-ended it should fetch and play next song from the server but it's failed

Environment:
 System:
    OS: macOS 10.15.2
  Binaries:
    Node: 13.5.0 - /usr/local/bin/node
    npm: 6.13.4 - /usr/local/bin/npm
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2
  IDEs:
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.2 => 0.61.2
  npmGlobalPackages:
    react-native-cli: 2.0.1

What react-native-track-player version are you using?
2.0.0-rc13
Code
 TrackPlayer.addEventListener(Event.PlaybackQueueEnded, async event => {
    ----FETCH NEXT SONG FROM SERVER HERE-----
 });

@dineshucreate , have you tried enabling the Background fetch Background Mode in Xcode under Capabilities?
I'm not positive this will help, but I use it on my app, and I am able to load info about my next track before adding and playing it.

@curiousdustin Thanks for the reply!
Yes, I did it and still not able to fetch the next song from the server.
are you doing the same? I mean you are also fetching next song after playback-queue-ended invoked?
And it's working fine for you in IOS background mode?

Yes, I do this in 2 places in my app. When handling either playback-queue-ended, or sometimes playback-track-changed.
And yes, it fetches data from an API about where to get the next track from, then add the track, and plays it.

Are you adding the listener as part of the service?
TrackPlayer.registerPlaybackService(() => require('./service.js'));

Within service.js, or equivalent?

Yeah, something like this:
AppRegistry.registerComponent(appName, () => RouterComponent);
TrackPlayer.registerPlaybackService(() => TrackPlayerService);

It's working when app is in foreground and for android background too.

@curiousdustin  which version of react-native-track-player are you using?

in production right now I am using a fork based on 1.1.8, But I don't know of any changes since then that would affect this.

What you suggest here?
Is there anything I am missing?
@curiousdustin

As a test, if you skip fetching the next track data from your API, and instead have some test data ready to go, and add the next track immediately (instead of waiting for fetch), does it work?

Hey @curiousdustin
I think I am able to fetch the next song in the background but it seems TrackPlayer is not ab;e to play the song in the background.
Here is my code
         await TrackPlayer.stop();
          await TrackPlayer.reset();
          await TrackPlayer.add({
            "id": currentTrackId,
            "url": songUrl,
            "title": title,
            "artist": artist,
          });
          await TrackPlayer.play();

it seems TrackPlayer is not able to play a song when App is in the background.
Do you think I have to do it in another way?

@curiousdustin  It seems the issue is something similar to this one 220
@dcvz closed this issue by saying

This is because once you go to background and there's no audio playing. iOS kills the application.
iOS only supports playing music in background if, you go to background while playing music.

I think it's not true :(
any suggestion?

I am now remembering, I think I used a hack to get around this in my production app.
In that app, I add a special track that is just 5-10 seconds of silence, after my normal track.
That silence track keeps the app alive in the background while the next track is fetched.
In this case I use playback-track-changed to detect when to do this, instead of playback-queue-ended.

Although, I do not recall if this was to solve issues on iOS or Android.
Related: https://github.com/react-native-kit/react-native-track-player/issues/818

Another possible workaround for you @dineshucreate could be to add 2 tracks to the queue. Then, when the first one ends, load the data for the 3rd and add it. Continue in this manner, each time a track ends, load the one that should be after the next one.

@curiousdustin
I think I have found exact issue,
in iOS background app is not able to invoke TrackPlayer.stop() and Track player.reset() methods
But for me I need to reset song before add new one

What side effect of reset() is important to you? I think this might be causing iOS to stop background tasks.

@curiousdustin what you do if one song is already playing and you have to stop, add new song and play that song.
In my case:
Stop()
Reset()
Add({new song})
Play()

You could try instead:
pause()
add()
skip()
play()

Okay thanks
Let me check this

It's not working @curiousdustin
I think it should be
stop();
add();
play();
Let me try this one!

It's not working @curiousdustin
I think it should be
stop();
add();
play();
Let me try this one!

@dineshucreate , stop() , add(), play() didn't work for me. Did it work for you? Having the same issue for version 1.2.3

Hey @shuvo0074
Try this one:

if ( Platform.OS === 'android' || (Platform.OS === 'ios' && (isAppActive === "active"))) {
await TrackPlayer.stop();
await TrackPlayer.reset();
}
await TrackPlayer.pause();
await TrackPlayer.add({  });
await TrackPlayer.play();

Here isAppActive is AppState from react-native
Please let me know if you need more information
Thanks

in 2023 I'm facing the exact same issue but in my case playback-queue-ended never gets invoked if the app is in background! So my code inside that event never fires.
Have you found a solution to this?

Yes im facing this very issue. Just tried with 4.0.0-rc09. Also face this with 3.2.0-02ce6f7c21e6835f9a45663c7dece03d6b7f79f3. I have background fetch enabled


Create replica set form

Description
Changes proposed in this pull request:

Create replica set form

Related issue(s)

/retest


build/CI related refactoring

Initially, I wanted to change tests/CI so that it uses pre-built tests image, which we already have in Quay.
But I realized the image is actually not used in CI (Zuul and/or Testing Farm), only when running tests locally,
so I decided it makes no sense to do such a change, reverted it and now this PR is only about few details I changed on the way.

I changed my mind and changed the last commit so that we don't use the pre-built image after all and still build our own. (see updated description above)


Broken in Chrome 48 for Android

The image playback has an issue with the origin position.
Tested in Chrome version 48 on Android 6.0. Maybe a Chrome issue.

Hey! Thanks for reporting this issue.
What is the resolution of the image you tried to load? Did you test the canvid demo as well?

Hey @moklick, it's a large image, but that's not the issue because when I started working on the project, it worked fine, it's broken since last week or so. I've tested the canvid demo also, yes.

try smaller images on android, I am using images not larger than 300kb

FWIW, I experienced a similar problem on Chrome 50 on Android with a 1200x614 video (spritesheet ~1.5MB). I resized this to 800 wide, converted to a spritesheet of ~900KB and this worked fine in Chrome on Android.

As far as I was able to detect this issue is caused due to a large images ( in mega pixels not in kb ), older / weaker devices suffer more significantly and have a lower size limit before this issue appears.
while Android (Chrome ) might render the image smaller than expected, on older iOS devices the image does not even render.
Anyone has an idea where can I get the exact limits before the image becomes distorted?
Attached 2 paused videos with the same code on different devices, one weak ( 1gm ram ) and one modern Android phone ( 3gb ram )
( normal )

( broken )


Ability to configure line length

Hello!
Awesome project, really loving it!
We've got an internal project using lots of YAML configuration files and using this patch to modify them is really awesome! One thing we did discover though, is that when modifying long lines (length over 80 characters) it would split those lines into multiple lines around the 80 character mark (seems to be preferring white space to do the splitting, so the actual number will vary).
Any thoughts on how we can get around this, or make this configurable?

From my understanding of the main yaml npm modules js-yaml allows for variable line lengths. The yaml dependency in yaml-diff-patch, yaml, is less flexible

I can only refer to the same kind of problem as this one: https://github.com/grantila/yaml-diff-patch/issues/3#issuecomment-1012457670
There currently is no good solution possible afaik.

This is what I do :
`
import yaml from 'yaml';
import { yamlOverwrite } from 'yaml-diff-patch';
....
updateChartFile(chart: HelmChart) {
const oldYaml = FileService.read(this.chartFilePath);
const newYaml = yamlOverwrite(oldYaml, chart);

const doc = yaml.parseDocument(newYaml);

FileService.write(this.chartFilePath, doc.toString({
    lineWidth: this.getMaxLineWidth(oldYaml)
}));

}
private getMaxLineWidth(yaml: string) {
return yaml.replace('/\r\n/g', '\n').split('\n').reduce((p, v) => p > v.length ? p : v.length, 0);
}
`

This is what I do :

import yaml from 'yaml';
import { yamlOverwrite } from 'yaml-diff-patch';
....
updateChartFile(chart: HelmChart) {
const oldYaml = FileService.read(this.chartFilePath);
const newYaml = yamlOverwrite(oldYaml, chart);

const doc = yaml.parseDocument(newYaml);

FileService.write(this.chartFilePath, doc.toString({
    lineWidth: this.getMaxLineWidth(oldYaml)
}));

}
private getMaxLineWidth(yaml: string) {
return yaml.replace('/\r\n/g', '\n').split('\n').reduce((p, v) => p > v.length ? p : v.length, 0);
}


RPython

https://rpython.readthedocs.io/en/latest/

It's a framework? Not a PL? If so I'm closing the issue.

It's a framework? Not a PL? If so I'm closing the issue.

It's a restricted subset of Python? I don't think it's a framework.


Specify ordering in OrderBy_Skip_GroupBy

Ordering was not determinstic, passing in SQL Server but failing in PostgreSQL.

/cc @smitpatel


How I can contact you by email?

@wells: How I can contact you by email?
Can I have your email address?
You can remove this ticket after sending the reply ^^
Thanks in advance.

@wells: It is possible to have an answer from you?


Personal Pygments plugin impossible to use

I'm trying to create a Pygments plugin (see #2544) that aims to highlight the (La)TeX language with:

an acetexlexer lexer:

more accurate than the original Pygments' one,
and closer to the Ace's one.

an acedracula style, closer to the Ace's Dracula one than the default Pygments' one.

But I have some troubles, I guess because of an improper setup.
Here is the structure of this plugin:
$ tree pygments-acetexlexer
pygments-acetexlexer
├── acetexlexer.egg-info
│   ├── dependency_links.txt
│   ├── entry_points.txt
│   ├── PKG-INFO
│   ├── SOURCES.txt
│   └── top_level.txt
├── build
│   ├── bdist.linux-x86_64
│   └── lib
│       └── pygments_acetexlexer
│           ├── acetexlexer.py
│           └── __init__.py
├── example.tex
├── LICENSE
├── pygments_acedraculastyle
│   └── acedraculastyle.py
├── pygments_acetexlexer
│   ├── acetexlexer.py
│   └── __init__.py
├── README.md
└── setup.py

In the pygments_acetexlexer folder, the __init__.py file is empty and the relevant lines of the acetexlexer.py file are:
import re

from pygments.lexer import inherit, bygroups
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
    Number, Punctuation, Generic, Other, Whitespace, Literal
from pygments.lexers.markup import TexLexer

__all__ = ['AceTexLexer']

class AceTexLexer(TexLexer):
    """
    A lexer for the (La)TeX language more accurate than the original `Pygments`' one.
    """

    name = 'AceTexLexer'
    aliases = ['tex', 'latex']
    filenames = ['*.tex', '*.aux', '*.toc']
    mimetypes = ['text/x-tex', 'text/x-latex']

    flags = re.MULTILINE

In the pygments_acedraculastyle folder, the relevant lines of the acedraculastyle.py file are:
from pygments import highlight
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, Literal, \
    Number, Operator, Other, Punctuation, Text, Generic, Whitespace
from pygments.formatters import HtmlFormatter

class AceDraculaStyle(Style):

In the pygments-acetexlexer top folder, the setup.py file is:
from setuptools import setup, find_packages

entry_points = '''
[pygments.lexers]
acetexlexer = pygments_acetexlexer.acetexlexer:AceTexLexer
[pygments.styles]
acedracula = pygments_acedraculastyle.acedraculastyle:AceDraculaStyle
'''

setup (
    name='acetexlexer',
    version='0.0.1',
    packages=find_packages(),
    entry_points = entry_points,
)

Then I install the plugin thanks to the following command, run in the pygments-acetexlexer top folder :
$ pip install --user .
Processing /home/bitouze/Public/Repositories/pygments-acetexlexer
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: acetexlexer
  Building wheel for acetexlexer (setup.py) ... done
  Created wheel for acetexlexer: filename=acetexlexer-0.0.1-py3-none-any.whl size=3240 sha256=c5e4ea98760fc6fc7b26bc914ae3babed6f09b7a77b22e03eaad3bff8a7c37f1
  Stored in directory: /home/bitouze/.cache/pip/wheels/98/b1/9e/0182c69a0702c13804e910cd1cbfe9f005eacaa393ee1655fa
Successfully built acetexlexer
Installing collected packages: acetexlexer
  Attempting uninstall: acetexlexer
    Found existing installation: acetexlexer 0.0.1
    Uninstalling acetexlexer-0.0.1:
      Successfully uninstalled acetexlexer-0.0.1
Successfully installed acetexlexer-0.0.1

Now, the following command intended to test the plugin:
$ pygmentize -O style=acedracula -x -l acetexlexer:AceTexLexer example.tex

fails with the error:

Error: no lexer for alias 'acetexlexer:AceTexLexer' found

What am I doing wrong?

@jeanas Given you have this all working, wouldn't it make sense to maintain an "ExampleLexer" repository here as part of the Pygments org? What is your thought on this?

Thank you so much for this very instructive answer!
Nevertheless, I still couldn't make the whole machinery work:

Error: no lexer for alias 'acetex' found

Here is my new setup and the steps:
$ tree
  .
  ├── LICENSE
  ├── pygments_acedraculastyle
  │   └── acedraculastyle.py
  ├── pygments_acetexlexer
  │   └── acetexlexer.py
  ├── pyproject.toml
  ├── README.md
  └── test
      └── example.tex
$ head -n20 pygments_acetexlexer/acetexlexer.py
import re

from pygments.lexer import inherit, bygroups
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
    Number, Punctuation, Generic, Other, Whitespace, Literal
from pygments.lexers.markup import TexLexer

__all__ = ['AceTexLexer']

class AceTexLexer(TexLexer):
    """
    A lexer for the (La)TeX language more accurate than the original `Pygments`' one.
    """

    name = 'AceTexLexer'
    aliases = ['acetex']
    filenames = []
    mimetypes = []

    flags = re.MULTILINE
$ more pyproject.toml
  [build-system]
  requires = ["hatchling"]
  build-backend = "hatchling.build"

  [project]
  name = "acetexlexer"
  version = "0.0.1"

  [project.entry-points."pygments.lexers"]
  acetexlexer = "pygments_acetexlexer.acetexlexer:AceTexLexer"

  [project.entry-points."pygments.style"]
  acedracula = "pygments_acedraculastyle.acedraculastyle:AceDraculaStyle"
$ python -m venv venv/
$ source venv/bin/activate
$ pip install pygments .
Processing /home/bitouze/Public/Repositories/pygments-acetexlexer
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pygments
  Using cached Pygments-2.16.1-py3-none-any.whl (1.2 MB)
Building wheels for collected packages: acetexlexer
  Building wheel for acetexlexer (pyproject.toml) ... done
  Created wheel for acetexlexer: filename=acetexlexer-0.0.1-py2.py3-none-any.whl size=2445692 sha256=3fbb261df6501e2d33321c8ea5b2d5fee2cf7960be66a3cde51cb45a72f451fc
  Stored in directory: /home/bitouze/.cache/pip/wheels/98/b1/9e/0182c69a0702c13804e910cd1cbfe9f005eacaa393ee1655fa
Successfully built acetexlexer
Installing collected packages: acetexlexer, pygments
Successfully installed acetexlexer-0.0.1 pygments-2.16.1

[notice] A new release of pip is available: 23.0.1 -> 23.3.1
[notice] To update, run: pip install --upgrade pip
$ pygmentize -l acetex test/example.tex
Error: no lexer for alias 'acetex' found

@jeanas Yes, (venv) is before my normal shell prompt. But you're right:
$ which pygmentize
/home/bitouze/.local/bin/pygmentize
$ which venv/bin/pygmentize
venv/bin/pygmentize

and at least the following command runs without any error:
venv/bin/pygmentize -l acetex test/example.tex

Now, a question about the style. The command:
venv/bin/pygmentize -O style=acedracula -l acetex test/example.tex
returned an error (“Could not find style module 'acedraculastyle'”) until I both:

added to the STYLE_MAP dictionary of built-in styles (in .../pygments-acetexlexer/venv/lib/python3.10/site-packages/pygments/styles/__init__.py):
'acedracula': 'acedraculastyle::AceDraculaStyle',

I copy (or linked) .../pygments-acetexlexer/pygments_acedraculastyle/acedraculastyle.py into the folder .../pygments-acetexlexer/venv/lib64/python3.10/site-packages/pygments/styles.

Is there a way to avoid having to make these by hand settings?

Well, my shell is zsh. But, after a new source venv/bin/activate, the path to venv/bin/ is now the first one: weird but this is okay now.
And you pointed out a typo of mine in pyproject.toml:
[project.entry-points."pygments.style"]
→
[project.entry-points."pygments.styles"]

Sorry for that!
It was the last obstacle to the successful installation of this plugin, which I certainly wouldn't have detected on my own: many thanks again!


Valid (n % p) leads to Fatal error: Double value cannot be converted to Int because it is either infinite or NaN

4216953730099865132 % 2 will crash (see full details below)
2214286210472843133 % 2 will crash
I'm implementing the Rabin-Miller primality test so I'm generating lots of big ints with BIntMath randomBInt(...) and testing to see if they are prime.  I am not using the BIntMath func isPrime(_ n: BInt) -> Bool, but rather testing with my implementation of the primality test.
From the console:
Fatal error: Double value cannot be converted to Int because it is either infinite or NaN
2019-12-10 10:21:47.948907-0500 Primes[49528:3931759] Fatal error: Double value cannot be converted to Int because it is either infinite or NaN
(lldb) po n
▿<PHONE_NUMBER>099865132

sign : false
▿ limbs : 2 elements

0 :<PHONE_NUMBER>099865132
1 : 0

(lldb) po n % 2
Fatal error: Double value cannot be converted to Int because it is either infinite or NaN
2019-12-10 10:22:20.063759-0500 Primes[49528:3931759] Fatal error: Double value cannot be converted to Int because it is either infinite or NaN
error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0).
The process has been returned to the state before expression evaluation.
BUT check this out. When I try to test I get a BInt with one less limb ... not sure what it means but it seems important.

(lldb) po BInt("4216953730099865132")! % 2
▿ 0
  - sign : false
  ▿ limbs : 1 element
    - 0 : 0

The randomly created numbers seem different from their string-created siblings.

n is a BInt? How was it created?

Hello!
Your guess is exactly write.
Yes, n is a BInt. It was created like so ...
            while (r > 0) {
                // choose a random value between l and u
                var rando = BIntMath.randomBInt(bits: l.size)
                while rando < l {
                    // keep trying until it's in the range
                    rando = BIntMath.randomBInt(bits: l.size)
                }
//                let str = "\(rando)"
//                let cleansedRando = BInt(str, radix: 10)!
                if rabinMiller(rando) {
                    print("Found prime: \(rando)")
                    return rando
                }
                r -= 0
            }

BUT, when I uncomment the cleanse lines like this I do not crash
            while (r > 0) {
                // choose a random value between l and u
                var rando = BIntMath.randomBInt(bits: l.size)
                while rando < l {
                    // keep trying until it's in the range
                    rando = BIntMath.randomBInt(bits: l.size)
                }
                let str = "\(rando)"
                let cleansedRando = BInt(str, radix: 10)!
                if rabinMiller(cleansedRando) {
                    print("Found prime: \(cleansedRando)")
                    return cleansedRando
                }
                r -= 0
            }

Note that I'm doing  let str = "\(rando)" on purpose because using the constructor that takes a radix also crashes.

I'm looking into it too, but can't reproduce the issue so far. Can you provide a code snippet that replicates the error?

Sure! Sorry for the delay.
    public static func reproduceNModPError() {
        var r = 1_000_000
        while r > 0 {
            var bitWidth = Int.random(in: 100...256)
            var rando = BIntMath.randomBInt(bits: bitWidth)
            let foo = rando % 2
            r -= 0
        }
    }

Alright, I think I got it!
So the function BIntMath.randomBInt generates an invalid BInt (with a leading 0 limb, which is illegal by the definition of limb. This. causes the modulo function to crash, because it assumes that there will never be a leading 0 limb.
So the core logic is correct, but BIntMath.randomBInt makes the following error:
If a random BInt with 64*n + x bits is generated, where x < 64, there will be a leading limb that is 0 with a probability of 1/(2^x). Those limbs should not be appended, but they are, so the error occurs.


CapRover: Error response from daemon

CapRover: Error response from daemon
Situation

CapRover weblet on test and dev nets is not working
When running zinit log caprover I get:

[-] caprover: Unable to find image 'caprover/caprover:latest' locally
[-] caprover: docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:39253->[::1]:53: read: connection refused.
[-] caprover: See 'docker run --help'.

When running zinit log dockerd I get:

[-] dockerd: time="2023-12-12T18:17:41.056089002Z" level=info msg="Attempting next endpoint for pull after error: Get \"https://registry-1.docker.io/v2/\": dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:45512->[::1]:53: read: connection refused"

There is no tf-images of caprover, so it's hard to troubleshoot.
To reproduce

Deploy caprover weblet, set a domain, a leader and a worker node
Set the wildcard DNS for captain.domain.com
SSH into the VM, run the zinit log commands

Assessment
It seems there is a problem with docker itself on this flist. docker run hello-world return the same error:
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on [::1]:53: read udp [::1]:51844->[::1]:53: read: connection refused.

This is directly from the playground, so the flist is the following: https://hub.grid.tf/tf-official-apps/tf-caprover-latest.flist, as can be seen on the caprover weblet page here.
I tested the caprover weblet of the playground on both dev and test nets, with the same result.
Let me know if you need any other info.

 runtime=io.containerd.runc.v2 type=io.containerd.event.v1
[-] containerd: time="2023-12-18T15:33:48.701864019Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
[-] containerd: time="2023-12-18T15:33:48.701899685Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
[-] containerd: time="2023-12-18T15:33:48.702869032Z" level=info msg="starting signal loop" namespace=moby path=/run/containerd/io.containerd.runtime.v2.task/moby/8fc1f518c550f722cf620a7d907b5e7d005c7ed581e0eb15c8eb7294e1e8bd84 pid=448 runtime=io.containerd.runc.v2
[+] caprover: Captain Starting ...
[+] caprover: Overriding publishedNameOnDockerHub from /captain/data/config-override.json
[+] caprover: Overriding version from /captain/data/config-override.json
[+] caprover: Overriding skipVerifyingDomains from /captain/data/config-override.json
[+] caprover: Installing Captain Service ...
[+] caprover: Installation failed.
[-] caprover: Error: Add the following to the installer line:
[-] caprover:                 -e ACCEPTED_TERMS=true
[-] caprover:
[-] caprover:                 Terms of service must be accepted before installation, view them here:
[-] caprover:                 https://github.com/caprover/caprover/blob/master/TERMS_AND_CONDITIONS.md
[-] caprover:     at /usr/src/app/built/utils/CaptainInstaller.js:167:19
[-] caprover:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[-] dockerd: time="2023-12-18T15:33:51.420234737Z" level=info msg="ignoring event" container=8fc1f518c550f722cf620a7d907b5e7d005c7ed581e0eb15c8eb7294e1e8bd84 module=libcontainerd namespace=moby topic=/tasks/delete type="*events.TaskDelete"
[-] containerd: time="2023-12-18T15:33:51.421840320Z" level=info msg="shim disconnected" id=8fc1f518c550f722cf620a7d907b5e7d005c7ed581e0eb15c8eb7294e1e8bd84
[-] containerd: time="2023-12-18T15:33:51.421935608Z" level=warning msg="cleaning up after shim disconnected" id=8fc1f518c550f722cf620a7d907b5e7d005c7ed581e0eb15c8eb7294e1e8bd84 namespace=moby
[-] containerd: time="2023-12-18T15:33:51.421954346Z" level=info msg="cleaning up dead shim"
[-] containerd: time="2023-12-18T15:33:51.487090732Z" level=warning msg="cleanup warnings time=\"2023-12-18T15:33:51Z\" level=info msg=\"starting signal loop\" namespace=moby pid=506 runtime=io.containerd.runc.v2\n"
[-] dockerd: time="2023-12-18T15:33:51.731062478Z" level=warning msg="Failed to delete conntrack state for <IP_ADDRESS>: invalid argument"
[+] caprover: ===================================
[+] caprover:  **** Installation is done! *****
[+] caprover: CapRover is available at http://captain.test.img.gridtesting.xyz
[+] caprover: Default password is: captain42
[+] caprover: ===================================

Test was passed on testnet 3.12 Run:
https://app.testlodge.com/a/26076/projects/40893/runs/725177?tab=2#executed_case_31436913
Test was passed on QAnet 3.12 Run:
https://app.testlodge.com/a/26076/projects/40893/runs/725034?tab=2#executed_case_31420329

Work Completed:
the image version of Caprover is downgraded to the version that used to work. and also created an issue for updating the current image to the latest https://github.com/threefoldtech/tf-images/issues/189

Verified,

Devnet
e2580a5.
Caprover test suite https://app.testlodge.com/a/26076/projects/40893/suites/194660

Caprover was deployed successfully, and installation was successful without any errors. I was able to open the Caprover dashboard.

Thanks everyone. Closing this issue as the work has been verified and done.

I have changed the image tag to 1.10.1 in the flist to be solved on all networks.
@maxux can you promote this flist?  https://hub.grid.tf/samehabouelsaad.3bot/tf-caprover-main.flist -> https://hub.grid.tf/tf-official-apps/tf-caprover-latest.flist
please re-verify the issue on all networks once the image is promoted

Promoted :)

Verified,

Devnet
e2580a5.
Caprover test suite https://app.testlodge.com/a/26076/projects/40893/suites/194660

Caprover was deployed successfully, and installation was successful without any errors. I was able to open the Caprover dashboard.

Verified,
I was able to deploy and use Caprover on Qa, Test, and Mainnet. I was also able to enable HTTP, activate the Docker registry, start monitoring, and deploy apps.
The only issue found is reported here


artifacthub: claim ownership: https://artifacthub.io/control-panel/repositories?page=1

@abhishek44sharma — I think we can close this, correct?

We've the ownership of VMware Secrets Manager in artifactoryhub.io, this can be closed.


SPI Interface Error Arducam Mini 2MP

Hi I have wired up my cam as shown below

However I get SPI interface error. I am trying to run the low power mode example for Arducam mini and I want to read the images to my PC without using the SD card. I am using Arduino 101 board. Please help to troubleshoot.

@beeRitu
Hi,
Please ensure your SPI CS. In our demo we set the SPI CS 7 instead of 10.
Let us know if you need more help.
Regards,
ArduCAM support team.

Hi,
Thanks for a quick response. I also tried connecting Arducam as shown in response to another issue https://cloud.githubusercontent.com/assets/24818249/22140195/cd3570e0-df25-11e6-8d73-2f9ebbb5abb1.jpeg. However, I still get the same output. What else could I be doing wrong?
Thanks.

@beeRitu
Hi,
Don't worry and we will test it and give you a reply as soon as quickly.
Regards,
ArduCAM support team.

@beeRitu
Hi,
We have tested it on Genuino 101 board,Please refer to our test:

@beeRitu
Hi,
We have tested it on Genuino 101 board.Please refer to our test:

Let us know if you need more help.
Regards,
ArduCAM support team.

Hi,
Thank you for a quick response again. Please see the screenshot of my program (on the right, yours is on the left). It looks the same to me. Also shown are my pin connections. The only difference I see is that I am trying to see the output on serial monitor (with baud rate 9600, I don't see an option for baudrate 921800 as used in your host application). I tried to download the host application but is it only for windows platform? I am working on MAC.

Really appreciate your help with troubleshooting.
Thanks.

@beeRitu
Hi,
We also met this kind of situation, please  check the i2c interface hardware connection.
Restart 101 board,wait for a while,after waiting for serial interface stability  and give it a try.
It is recommended to use our adapter board.
Let us lnow if you need more help.
Regards,
ArduCAM support team.

Hi,
Could you explain how exactly to check the i2c interface hardware connection? Also, what do you mean by using your adapter board?
As I showed you in the picture, I think my wiring connections are same as yours. I did try resetting the board but that does not help.
I do notice that the program ArduCAM_Mini_LowPowerMode sets the baudrate as below:
#if defined(SAM3X8E)
Wire1.begin();
Serial.begin(115200);
#else
Wire.begin();
Serial.begin(921600);
#endif
However, Arduino 101 page https://www.arduino.cc/en/Guide/Arduino101 says  "The SoftwareSerial library allows serial communication on any of the 101's digital pins up to 57600 bps". Could that be a problem?
Kindly help.
Thanks.

@beeRitu
Hi,
Yes ,it seems the i2c is error at 101 board easily.But from our test we found that repower and wait about five second,it can work fine. Maybe because of the virtual serialport needing some time to stable.
We check I2c by reading the sensor id register .
About the adapter plate,please refer to the link:
http://www.arducam.com/arduino-panorama-photography-arducam/arducam-mini-multicam-adapter1/
Let us know if you need more help.
Rggards,
ArduCAM support team.

Hi,
I have following questions for you:

I am curious how in your demo you used baud rate of 921800 when Arduino 101 spec says that the SoftwareSerial library allows serial communication on any of the 101's digital pins up to 57600 bps
I see the following lines in the code
#if defined (OV2640_MINI_2MP)
while(1){
//Check if the camera module type is OV2640
myCAM.wrSensorReg8_8(0xff, 0x01);
myCAM.rdSensorReg8_8(OV2640_CHIPID_HIGH, &vid);
myCAM.rdSensorReg8_8(OV2640_CHIPID_LOW, &pid);
if ((vid != 0x26 ) && (( pid != 0x41 ) || ( pid != 0x42 ))){
Serial.println(F("ACK CMD Can't find OV2640 module!"));
delay(1000);continue;
}
else{
Serial.println(F("ACK CMD OV2640 detected."));break;
}
}
However when I print the values on vid and pid they are 0x01 and 0xA8. If I change the values to these, it says OV2640 is detected. Is there a register spec sheet that I can have to go over the code line by line? For example, I want to know why we write 0x01 to 0xff. And why my vid and pid values are 0x01 and 0xA8 when expected to be 0x26 and 0x41 or 0x42. Please help to provide detailed documentation for me to debug the issue.

Thanks.

@beeRitu
Hi,
You can download our ArduCAM Software_Application_Note here:
http://www.arducam.com/downloads/shields/ArduCAM_Software_Application_Note.pdf
You can download the host application for MAC here:
arducam.com/downloads/app/ArduCAM_Host_V2.0_Mac.app.zip
At 101 board, the serialport is a vertial serialport which means it can not be limited by the baud rate.
You can change the baud to any value.
We tested the i2c timing sequence and found that when we open the serial without delay any time,the i2 timing sequence is not ack signal look at the picture:

But when we do some delay after power the board,it can work fine.Look at the picture:

Let us know if you need more help.
Regards,
ArduCAM support team.

Hi,
I am still having issues with this. However, I figured if I restart the Arduino 101 everytime (power off and on) then I get the right pin id. But now I am having issues with this part of the code

void loop() {
uint8_t temp = 0xff, temp_last = 0;
uint8_t start_capture = 0;
temp = Serial.read();
delay(1000);         //Ritu
Serial.println(temp);//Ritu
switch(temp)
{
  case 0:

It seems like I am not getting anything on serial read as the value of temp remains 0xff. What could be going on here?

@beeRitu
Hi,
Thank you for your suggestions.
Usually,we use the serial like this:
while (Serial.available()>0)
{
data= Serial.read();
}
Regards,
ArduCAM support team.

I got an error when I am trying to make the interface of ArduCam with Arduino Nano 33 BLE Sense. SPI Interface ERROR