Request to add Support for DHCP Server Options

Is there a plan to support configuring DHCP server options as opposed to scope options?

@HemantMahawar

@PlagueHO I'm confused by the resource naming - shouldn't it be xDhcpServerScopeOption. I'll have a look at this...

Looks like, that if we don't specify a ScopeId that will set server options. However, the ScopeID is a key...
We could use a special 'ScopeID' name/value to signify that we want to configure server options, i.e.
xDhcpServerOption 'SetsServerOptionNotScope' {
    ScopeID = 'Server'
    Router = '<IP_ADDRESS>'
}

Thoughts @PlagueHO @KarolKaczmarek @HemantMahawar ?

My 2c:
@iainbrighton - it is definitely a real pity about the naming of this resource - it is counter intuitive - and makes it pretty difficult to create the Server level resource without confusing things even more. However, what would be consequences of correcting this name? @KarolKaczmarek - is this something that could be considered?
If the name can't be changed:
Your solution would solve the issue of setting server level options it would still leave reservation level options out in the cold. It would be awesome if there was a resource that could manage all three types (server, scope, reservation - I'm ignoring policy options though :smile:). I'm just not sure it is possible with a single resource.
The existing resource can't be used to set any other options either (option 67 on a WDS server anyone?) - if there was a possibility of re-engineering this resource it might be useful to generalize the option support so that more than DNS and router options could be set.

@iainbrighton and @PlagueHO. I agree, the current naming is not correct and needs to be changed. Just add note to readme.md to say there is a breaking change and be done with it ;-)
While we're on the topic of DHCP scope options... Many enterprise vendors use customised scope options to assist with auto provisioning of devices.
The example below is used to configure auto provisioning for HP Enterprise access points. Unfortunately I haven't converted it to Powershell yet. If your developing the DHCP scope option resource further, please keep this type of customisation in mind.
netsh dhcp server add class Colubris "Vendor Class for Colubris Products" Colubris-AP 1
netsh dhcp server add optiondef 1 MSC IPADDRESS 1 vendor=Colubris comment="List of MSC IP addressess"
netsh dhcp server set optionvalue 1 IPADDRESS vendor=Colubris <IP_ADDRESS>
-> What does it do? When you plug a HP AP into the network it looks for the custom dhcp scope options above which direct it to the provisioning server is (<IP_ADDRESS>).

@iainbrighton and @PlagueHO @Zuldan. I know this has already been said three times but I'm going add my comment for emphasis. I agree, the current naming is absolutely incorrect and should be changed.
@Zuldan . I too would like to see support for DHCP scope options. While useful as it is, without support for DHCP scope options a significant portion of the DHCP server configuration is simply untouched.
The other item that IMHO is a necessity is the scope address pool.

@roberteckdale  - I'm definitely still in favor of renaming the resource. But as it would be a breaking change, is a PR with such a change going to be accepted (assuming it is made very clear in the documentation that this is a breaking change)? If we could get a feel from the MSFT team ( @KarolKaczmarek, @HemantMahawar ) whether or not this might go through then I'd say it should be made.
I myself have many configs depending on this resource and I'm more than happy to update them all should this change be made.

I think we should rename it even though it's a breaking change, we just need to document it in version history and increase the major number of the version. It's better to do it now while we are still in the experimental phase for this module. Pinged @HemantMahawar to get his feedback as well.

@PlagueHO  @iainbrighton  Just to be clear, what is the proposed rename here?
The current resource I see mentioned is xDhcpServerOption ( I agree is mis-named,) and a suggestion of xDhcpServerScopeOption?

@TravisEz13 - good question. I actually think perhaps xDhcpOption?
This is because DHCP Options can actually be applied to Servers,Scopes,Policies and Reservations.
At the moment the resource will only apply to Scopes and Server options, but I can see it might be applied to Policies and Reservations down the track - and renaming it again would be even more of a PITA.
Although I'm not 100% happy with xDhcpOption either as the name implies changing general settings to the DHCP server.
Any other opinions? @KarolKaczmarek, @HemantMahawar, @TysonJHayes, @iainbrighton ?

@PlagueHO Another option would be to have an option sub-class on the xDhcpScope resource and just consider it to be part of the 'scope' resource, with the scope having an array of these option instances

@TravisEz13 @PlagueHO Care to elaborate on how you would see this implemented? Something like this?
[Write, ValueMap{"Server", "Scope","Policy","Reservation"},Values{"Server", "Scope","Policy","Reservation"}] String ScopeOption;

The Policy and Reservation options could be added later without breaking the schema.

@iainbrighton - I hadn't thought too far ahead on this, but yes, something like that looks right - except the name ScopeOption would be different I think. A name like DHCPOptionType might be better.
However, one possible problem with this "combined" implementation is that each DHCPOptionType requires a different set of Keys. E.g. Server requires only the Option number, but Reservation requires a Reservation Scope Id, Client ID (MAC) and option number. They would all need to be Key's but of course that isn't possible because DSC doesn't support dynamic Keys.
So perhaps this combined approach might not actually work?

How about utilizing composite resources?
For example we can have DHCPOption resource that has parameters for all option types (PolicyName, ReserverdIP, ScopeID, Server if no other type is specified), and OptionID and Value (we will have to ditch Router, DNSDomainm DNSServer parameters and only use option ids). This resource will use Get-DhcpServerv4OptionDefinition to get option's Type, MultiValued so we can run specific validation on supplied parameters.
We can probably add something like OptionValueType, OptionName, MultiValued, VendorClass, UserClass parameters so it is possible to create new option definition if such definition does not exist.
Then we will have DHCPServerOption, DHCPReservationOption etc. composite resources to configure specific type of options.

@gordonbondon - that could be an interesting solution. I've not really considered the possibility of using composite resources before. But seems like it should be worth looking into further. Any chance you could flesh out a bit more detail? I'd have a go myself but I've got a bunch of other DSC work to get through.

@PlagueHO I'll try to slap together something basic to see if this works. Not sure such concept wont be affected by issue with different keys needed you've mentioned above.
Other idea I was thinking about: move Get, Set, Test implementation with all possible parameters to separate helper module. Than dot sourcing it in resources and from resource functions calling them only with appropriate parameters. That way we can have resources with unique keys and we won't need implement everything four times for every type.

Looking forward to this guys.  VOIP handsets need like 5+ scope options.

Was there ever any development on this?  Specifically, the ability manage server level options, defining custom options and creating policies.

Hello, I'm working on a xDhcpOption to manage the full DHCP options.

@PlagueHO Will the PR #39 solve this issue?

It was actually an easy one to implement, but my problem was that the whole structure of the resources in this repo really don't align well with how DHCP Server works. I was never happy with this, which is why I didn't progress with it.
In short, MSFT_xDhcpServerOption should have been used to set Server level options - but it is used to set Scope level options which is terribly misleading. There is also no way to set Reservation level options either (although that is an edge case).
IMHO we should correct this with a breaking change that renamed MSFT_xDhcpServerOption -> MSFT_xDhcpServerScopeOption and then we could add a new resource MSFT_xDhcpServerOption and MSFT_xDhcpServerReservationOption.
I  toyed with the other method of making MSFT_xDhcpServerOption set Server, Scope and Reservation options, but I can't make that work because we'd end up with 3 keys (OptionId, ScopeId and ReservationIP) - 2 of which could be empty - which would not be acceptable.

I'm good with that, renaming MSFT_xDhcpServerOption -> MSFT_xDhcpServerScopeOption, and adding the two new resources.
I remove the 'in progress' label on this in the mean time until someone runs with this.

@PlagueHO Many thanks for the detailed answer!

Good idea about removing the in progress. It might be something I could get to work on. I'd like to begin cleaning up this module in my spare time.

And I will review if you do 😃

Hi folks, I'm working on a new resource called "MSFT_xDhcpServerOptionValue" that will implement the full "Set-DhcpServerv4OptionValue" cmdlet, so we can define any ID option in the server, scope, reservation or policy scope.

@marciorschneider that is great! Could you post the schema.mof here?

Thanks! A suggestions is that we make Ensure have the qualifier type Write and has the default value Present.
Question, the properties UserClass, ScopeId, PolicyName and ReservedIp has a description that they should not be used together with other properties, but since they are key's the properties are not able to be left out from the configuration. How should we think here?

This was the same challenge I came across when I tried to design a resource that could handle all 3 scenarios (server,scope and reserved ip). One possible solution is to do what we did in StorageDsc and use a generic id key and an idType. The idType could be server, scope or reservedip and default to scope (as this is the most common case).

Actually thinking about this further it would have other undesirable trade-offs such as for   idtype server the id would have to be empty.

It's a little tricky because the cmdlet can set the option at four different scopes (Server, DHCP scope, policy or reserved IP), so an option could be setted 4 times.
I've improved the description and corrected the OptionValue to be "Write", what you think?
[ClassVersion("<IP_ADDRESS>"), FriendlyName("xDhcpServerOptionValue")]
class MSFT_xDhcpServerOptionValue : OMI_BaseResource
{
[key,        Description("Where to set the option value."),ValueMap{"Server","DhcpScope","Policy","ReservedIP"},Values{"Server","DhcpScope","Policy","ReservedIP"}] String ApplyTo;
[Key,        Description("Option ID, specify an integer between 1 and 255.")] uint32 OptionId;
[Write,      Description("Option data value.")] String OptionValue[];
[Key,        Description("Vendor class. Use an empty string for default vendor class.")] String VendorClass;
[Key,        Description("User class. If not used set it to an empty string. Will be ignored if ApplyTo is Policy.")] String UserClass;
[Key,        Description("Scope Id. If not used set it to an empty string. Will be ignored if ApplyTo is not DhcpScope.")] String ScopeId;
[Key,        Description("Policy name. If not used set it to an empty string. Will be ignored if ApplyTo is not Policy.")] String PolicyName;
[Key,        Description("Reserved IP. If not used set it to an empty string. Will be ignored if ApplyTo is not ReservedIP.")] String ReservedIP;
[Key,        Description("Class address family. Currently needs to be IPv4."), ValueMap{"IPv4"}, Values{"IPv4"}] String AddressFamily;
[Write,      Description("Whether the DHCP option should exist."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
};

@marciorschneider , @johlju - these are all the options I started going through when I last looked at this. I really think the only one I think that has no unwanted side effects is to split it into 4 resources - with the old DhcpServerOptions one being replaced. All the other options allow invalid configurations or are counter intuitive.

Yes, I agree that is not intuitive. Splitting it on 4 resources would be something like this:
[ClassVersion("<IP_ADDRESS>"), FriendlyName("xDhcpServerOptionValue")]
class MSFT_xDhcpServerOptionValue : OMI_BaseResource
{
[Key,        Description("Option ID, specify an integer between 1 and 255.")] uint32 OptionId;
[Write,      Description("Option data value.")] String OptionValue[];
[Key,        Description("Vendor class. Use an empty string for default vendor class.")] String VendorClass;
[Key,        Description("User class. Use an empty string for default user class.")] String UserClass;
[Key,        Description("Class address family. Currently needs to be IPv4."), ValueMap{"IPv4"}, Values{"IPv4"}] String AddressFamily;
[Write,      Description("Whether the DHCP option should exist."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
};
[ClassVersion("<IP_ADDRESS>"), FriendlyName("xDhcpScopeOptionValue")]
class MSFT_xDhcpScopeOptionValue : OMI_BaseResource
{
[Key,        Description("Scope ID.")] String ScopeId;
[Key,        Description("Option ID, specify an integer between 1 and 255.")] uint32 OptionId;
[Write,      Description("Option data value.")] String OptionValue[];
[Key,        Description("Vendor class. Use an empty string for default vendor class.")] String VendorClass;
[Key,        Description("User class. Use an empty string for default user class.")] String UserClass;
[Key,        Description("Class address family. Currently needs to be IPv4."), ValueMap{"IPv4"}, Values{"IPv4"}] String AddressFamily;
[Write,      Description("Whether the DHCP option should exist."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
};
[ClassVersion("<IP_ADDRESS>"), FriendlyName("xDhcpReservedIPOptionValue")]
class MSFT_xDhcpReservedIPOptionValue : OMI_BaseResource
{
[Key,        Description("Scope ID.")] String ScopeId;
[Key,        Description("Option ID, specify an integer between 1 and 255.")] uint32 OptionId;
[Write,      Description("Option data value.")] String OptionValue[];
[Key,        Description("Vendor class. Use an empty string for default vendor class.")] String VendorClass;
[Write,      Description("User class.")] String UserClass;
[Key,        Description("Class address family. Currently needs to be IPv4."), ValueMap{"IPv4"}, Values{"IPv4"}] String AddressFamily;
[Write,      Description("Whether the DHCP option should exist."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
};
[ClassVersion("<IP_ADDRESS>"), FriendlyName("xDhcpPolicyOptionValue")]
class MSFT_xDhcpPolicyOptionValue : OMI_BaseResource
{
[Key,        Description("Scope ID. Use an empty string to apply at server level and not scope level.")] String ScopeId;
[Key,        Description("Option ID, specify an integer between 1 and 255.")] uint32 OptionId;
[Key,        Description("Policy Name")] String PolicyName;
[Write,      Description("Option data value.")] String OptionValue[];
[Key,        Description("Vendor class. Use an empty string for default vendor class.")] String VendorClass;
[Key,        Description("Class address family. Currently needs to be IPv4."), ValueMap{"IPv4"}, Values{"IPv4"}] String AddressFamily;
[Write,      Description("Whether the DHCP option should exist."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
};

@marciorschneider @PlagueHO To me the 4 resource proposals that @marciorschneider made in the previous comment looks promising. I agree that 4 resources is the way to go. I don't have the full knowledge to determine if this replaces xDhcpServerOption (it looks like it is hard-coded to set DNS and gateway for a scope). But if you agree that the 4 resource above makes xDhcpServerOption obsolete, then we should either remove this in the PR or add an issue to remove it once the other resources are merged.
@marciorschneider Would you like to run with this to create 4 resources? It would be good if they could share code (helper functions) so that code is not duplicated where possible.

Hello folks, I wrote the 4 resources. May you please review it, @johlju? Thanks!

@marciorschneider Awesome! Will do!


Cannot import Amply from pulp

Putting this here because it only occured because i was trying to use simplicity. It doesnt happen in our standard use of Otoole/Osemosys.
It's something i noticed while trying to run: otoole convert datapackage datafile simplicity/OSeMOSYS-simplicity-11a3a26/datapackage.json ./simplicity.txt
Error: Cannot import Amply from pulp

env\Lib\site-packages\otoole\preprocess\datafile_to_datapackage.py
Fix:
-installed amply using pip install amply
-changed datafile_to_datapackage.py so it does: import amply as Amply
-It works.

Also just to note, simplicity doesnt work with Otoole v1 because it cannot do the datapackage conversion anymore.

I see the recent update. Just another note, the DiscountRateStorage csv is not in the dataset that is downloaded via wget. I will close this comment tomorrow.

Thanks for the report @H3yfinn. I've now created the new version of simplicity v1.0 and updated the readme. Let me know if you have any other problems.


Drachtio stops communicating with app

Hi Dave,
I've just had a scenario where the drachtio server simply stops communicating with the Javascript application (drachtio-srf). I have the standard errors in my Javascript, but no output in the logs.
Looking through drachtio.log, I can't see much to point me in the right direction. Is there any indication anywhere of what information is sent to the registered application, what happens if it unregisters, etc?
Thanks!

There isn't much logging when a drachtio app disconnects from the server -- just a single log message that a client tcp connection has closed.  Usually when connections are lost between the client app and server it is because the client disconnected, and if this was unexpected most commonly you will see an exception on the client side.
I don't completely understand what you are observing when you say you see the "standard errors" in the javascript.  If you have logs from the server and the app at the time the connection was lost, please post as that may be useful.
I have a few other questions:

are you using inbound or outbound connections from the app ?
how long was the connection up when it was lost or dropped?
was there any traffic over the connection at that time, or was it idle?
is it possible there is a firewall between the client app and server that knocked down the connection due to lack of activity?

with regard to the last question, note the "ping-pong" feature I added recently to keep connections open that a firewall may otherwise terminate:
https://drachtio.org/releases?type=drachtio-srf&page=4


Updated Go to 1.21, with relevant pkgs

Description
This PR fixes #301
Notes for Reviewers
Signed commits

[ ] Yes, I signed my commits.

Hey @theBeginner86 , no one has been assigned to this PR could you please give this a look?

Hey @theBeginner86 , no one has been assigned to this PR could you please give this a look?

@leecalcote , @theBeginner86

@vishalvivekm //


[boost-smart-ptr] Unable to download from mirror set

Host Environment

OS: Windows
Compiler: Visual Studio 2019

Failure logs
Building package boost-smart-ptr[core]:x64-windows-static...
-- Installing port from location: D:\source\juice\vcpkg\buildtrees\versioning_\versions\boost-smart-ptr\700532550b70d03254c77f1467ab4c01a2c6e62a
-- Downloading https://github.com/boostorg/smart_ptr/archive/boost-1.77.0.tar.gz -> boostorg-smart_ptr-boost-1.77.0.tar.gz...
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' = off
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Downloading https://github.com/boostorg/smart_ptr/archive/boost-1.77.0.tar.gz
Error: Failed to download from mirror set:
https://github.com/boostorg/smart_ptr/archive/boost-1.77.0.tar.gz: failed: status code 404

@dave-juicelabs, I can't repro this issue locally, could you try the below workaround if the issue persist?

Download https://github.com/boostorg/smart_ptr/archive/boost-1.77.0.tar.gz manually
Rename it to boostorg-smart_ptr-boost-1.77.0.tar.gz
Put it to vcpkg/downloads
./vcpkg install boost-smart-ptr:x64-windows-static

It appears this was just a small downtime for Github. It came back shortly after submitting this issue.


Create compiler test variables, and add support for AppleClang (macOS)

That did the trick. Thanks!

Ah sorry, got a bit too eager on the refactoring. Glad you got it working 👍


Ring proposal: Exterior (Grassmann) algebra of a $\Bbb Q$-vector space with a countable basis

This is an important classical example of a PI-ring where the basis of identities is known explicitly (it is the identity $[[x,y],z]$). I did not find it in DaRT.
Description
The algebra $\Bbb Q \langle e_1, e_2, \ldots \rangle/ ({e_i e_j + e_j e_i: i,j \in \Bbb N })$.
Properties
First see your own answer about $J(R)$ here.

[x] ✔ countable.
[x] :x: T-nilpotent radical. Take the generators.
[x] ✔ top simple Artinian. $R/J(R) \cong \Bbb Q$.
[x] ✔ nil radical.
[x] ✔ local.
[x] ✔ strongly $\pi$-regular. Local + nil radical means it only has units and nilpotents, and both types stabilize the chain. (Not sure if this rule is in the logic.)
[x] :x: von Neumann regular. $e_1 R e_1 = 0$.
[ ] :x: SI. Denote $\alpha e_{n_1} \ldots e_{n_k} \in J(R)$ by $\alpha \cdot n_1 \ldots n_k$ if $\alpha \not = 1$ and as $n_1 \ldots n_k$ if $\alpha = 1$. Then $(123+1256)(456+34) = 2\cdot 123456;$ $(456+34)(123+1256) = 0$; furthermore, $(456+34)7(123+1256) = 2\cdot 1234567$.
[x] :x: semiprime. $e_1 R$ has nilpotency index $2$.
[x] ✔ strongly connected.
[x] ✔ quasi-duo. There is only one maximal right ideal.
[x] :x: L/R Rickart. Too few idempotents.
[x] :x: L/R ACC/DCC annihilator. Take the products of $e_i$'s.
[x] ✔ L/R uniform. If $a \in K_R \le I_R$, take the shortest monomial term in $a$ and form a monomial product $P$ of $e_i$'s that occur only in other terms of $a$. Then $aP$ has a single monomial term. Similarly for $b \in L_R \le I_R$ we get $Q$. Then LCM of $aP$ and $bQ$ lies in $K_R \cap L_R$.
[x] ✔ L/R CS. Same argument as above.
[x] ✔ polynomial identity. The commutators only have terms of even length, so they are central.

Remarks
I hope there are no mistakes in my calculations for the reversible/SI conditions.
A definition of T-nilpotency on the corresponding property page might be useful.
I'm seeing the definition of uniform modules for the first time and have very little experience with essential submodules (it likely shows...)

Local + nil radical -> strongly π regular : it wasn't in the logic, and is pretty obvious! Nice catch.

@dyunov  Sorry, what do you mean by SI? simple-injective? self-injective? V-ring?  I actually don't recognize what the evidence is showing.

"semicommutative (SI condition, zero-insertive)"

Thanks! I believe the computations are fine. Moreover it's pretty clear to me it is 2-primal.

Just now realizing how the definition of right T-nilpotency has the sequence of products going the opposite way I thought it did.  I should review to see if there are any errors in the db based on this...


Native Editor - CTRL +S when editor has focus should save file

Be nice if this always worked but minimum would be for it to work when the editor has focus

As part of this, should fix the problem with a dirty file not asking on shutdown. Although not sure that's possible from an extension

This bug has an effect on the CTRL+S
https://github.com/microsoft/vscode/issues/76863

After you save a .ipynb file (with ctrl + s), close it and open it again, you get the clean json instead of the native editor.


'Cancel' for PromiseKit option 2

These are the diffs for option 2 of Proposal for PromiseKit cancellation support #896.  With option 2 the new cancellation code goes in a new PromiseKit extension called PMKCancel.
The repository for the new PMKCancel extension is currently hosted at https://github.com/dougzilla32/Cancel, but would be moved to https://github.com/PromiseKit/Cancel if option 2 is accepted.
There repositories with pull requests for option 2 are:

Repositories

mxcl/PromiseKit

PromiseKit/Alamofire-

PromiseKit/Bolts

dougzilla32/Cancel

PromiseKit/CoreLocation

PromiseKit/Foundation

PromiseKit/MapKit

PromiseKit/OMGHTTPURLRQ-

PromiseKit/StoreKit

PromiseKit/SystemConfiguration

PromiseKit/UIKit

Closing this pull request as it appears we are going with a variant of option #1 -- 'Cancel' for PromiseKit #899


[BUG] Autocomplete with Default Colour in Workspace Colour Customisations

Does this issue occur when all extensions are disabled?: Yes

Provide autocompletions for properties in workbench.colorCustomizations with the default colours, instead of #ff0000.

https://github.com/microsoft/vscode/issues/25633 is similar. Ok to mark as duplicate?

#25633 is similar. Ok to mark as duplicate?

Yes, sorry I didn't realize. Could you change the title of that to be a bit more concise?

https://github.com/microsoft/vscode/issues/25633 is about the current value (based on the currently selected theme) while your suggestion is about the default value (which is the color of the Default Modern theme).
I think the current color is more useful as you normally want to tune the currently visible colors.

#25633 is about the current value (based on the currently selected theme) while your suggestion is about the default value (which is the color of the Default Modern theme).
I think the current color is more useful as you normally want to tune the currently visible colors.

Yeah, sorry I meant the default for current colour.


[fix] state accumulator - do not fail when previous obj version is not found

Description
It seems that state accumulator is making an assumption on the wrapped object existing in the storage (the previous version - tombstone) when it's unwrapping it. However, if this is a wrapped object that never existed before , we don't expect to find in the storage any tombstone - thus we shouldn't panic. We currently see in DevNet this happening:
thread 'tokio-runtime-worker' panicked at 'wrapped tombstone must precede unwrapped object', crates/sui-core/src/state_accumulator.rs:173:30

Thanks @amnn @gdanezis for helping on root causing this!
Test Plan
How did you test the new or updated feature?

If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.
Type of Change (Check all that apply)

[ ] user-visible impact
[ ] breaking change for a client SDKs
[ ] breaking change for FNs (FN binary must upgrade)
[ ] breaking change for validators or node operators (must upgrade binaries)
[ ] breaking change for on-chain data layout
[ ] necessitate either a data wipe or data migration

Release notes

Re: testing -- another thought that we talked about (between @akichidis, @gdanezis and I): If the state accumulator was running during other authority tests, I would have expected it to pick up this issue, so if it isn't, then we should do that, so that we can piggyback off the test coverage there -- there is definitely a test there that creates and then immediately wraps an object, which would have picked this up.

Small update on testing -- @akichidis and I looked into it and the only tests in authority_tests that might go through this path are to do with revert_state_update which doesn't use the send_and_confirm_transaction API that state accumulator checks are plumbed into, so Tasos is adding a test to move_integration_tests.rs specifically for this flow.

Actually does this need to be behind a protocol version? @mystenmark

Actually does this need to be behind a protocol version? @mystenmark

It does not, it wouldn't change the accumulator behavior in non-crashing cases, and we aren't committing root hashes to the chain yet anyway.


Fix diff tests

It seems like we have changed some of the error messages for invalid database names and collection names.

I feel this should be fixed on FerretDB side not on dance. Partly because the previous one seems more consistent, partly because we shouldn't break existing tests...

If MongoDB returns "errmsg" : "Invalid namespace: $cmd.f" on failed database creation, isn't that what we used to have and we changed to something else :thinking:?
Anyway, this is just simple difference of error message. Let's just merge this PR for now :hugs:


[Feature Request] Support Bulk Actions

Support the possibility for bulk actions. These ones can be executed for a given selection of tables (instead of only one or all).
Use cases:

bulk table status change
bulk fix version
bulk auto-match

Galooch — 07/03/2024 5:54 PM
Curious if this may be in teh app already or if I missed it.....but would it be possible to automatically update a table's status based on its successfully validation?  That would help keep cabinets "clean" for any users who leverage those popper statuses and as   Since people might use table status for different reasons, perhaps the UX would be two checkboxes at the top of the Table Validators screen with a drop down menu of table statuses so users can choose which one it should be for a validated and unvalidated table.   Set status for validated tables [Inactive, Visible (Normal), Visible (Hidden), WIP, Ask each time], Set status for unvalidated tables [Inactive, Visible (Normal), Visible (Hidden), WIP, Ask each time].  The other use case is for folks who use Popper's mature/hidden status.  To solve this, perhaps there needs to be an "Ask" option to the drop down menu so users would need to select the status when a table validation status changes?

Fixed with 3.7.0


Library seems to be broken

When I run the first example provided I get a very poor looking result, which I've shown below.

I'd love to help address this because the API of the library is very clean and would do just what I need if I can get it to work.

Almost two years latter, I ran into the same problem.
For those who still might need it, here is the solution :  You must specify a font.
const complex = vectorizeText(text, {
font: "Arial",
triangles: true,
width: 10,
textBaseline: "top"
    });

The result is still quite angular, as there is a "simplify x0.25" hard coded in the lib. Disabling the simplificaiton also greatly improves the result.


Edit render priority

Render Priority functionality was introduced some time ago, but currently it can not be edited or set from UI
It just displays <null> for any values and dont allows set values

Guess someone should change Variant::OBJECT to Variant::INT here?
https://github.com/godotengine/godot/blob/308a6f4f99a5204682a2612d097e5c066f88196f/scene/resources/material.cpp#L83


Documentation Correction

The docs mention DOTENV_FILEPATHS in one place, but the variable is ENVDOC_FILEPATHS (as mentioned further down).

Thank you.


Syntax highlighting broken for directives + implementing an interface

Just a minor problem really, but I don't seem to be getting any syntax highlighting for a type declaration when it implements an interface.

:tada: This issue has been resolved in version 1.13.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


how to use in linux?

anyone who can tell me how to use it in centos7 ? i can not install it in linux ,it did not work

doesn't this work?
git clone --depth 1 https://github.com/denisidoro/navi /opt/navi
cd /opt/navi
./navi

and here is a step by step guide

doesn't this work?
git clone --depth 1 https://github.com/denisidoro/navi /opt/navi
cd /opt/navi
./navi

Tks for your reply.，it has been solved now. The reason is that i am not the root account and FZF mirror download speed is too slow.


Object Selection

Hi,
how to select objects and get information?

Hello,
Raycaster class is designed to assist with raycasting, which is used for mouse picking (working out what objects in the 3d space the mouse is over) amongst other things.
https://threejs.org/docs/#api/en/core/Raycaster
// calculate objects intersecting the picking ray
var intersects = raycaster.intersectObjects( scene.children );

Hello,
thank you and it is working now , but for all Objects intersect[0].object.type is "Mesh".
how to get real Object type ex: cylinder, cube ...

Could you show us more code, please?
Also, have you seen the Three.js example "interactive cubes" (source here)?

all in webgl-render :
`  private mouse = new THREE.Vector2(); INTERSECTED ;
private raycaster = new THREE.Raycaster();
@HostListener('click', ['$event']) //document:keypress
public onKeyPress(event: MouseEvent) {
this.mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
this.mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
this.myRaycaster();
}
private myRaycaster(){
const sceneComponent = this.sceneComponents.first;
const cameraComponent = this.cameraComponents.first;
var vector = new THREE.Vector3(( this.mouse.x / window.innerWidth ) * 2 - 1, -( this.mouse.y / window.innerHeight ) * 2 + 1, 0.5);
vector = vector.unproject(cameraComponent.camera);
  // update the picking ray with the camera and mouse position
    this.raycaster.setFromCamera( this.mouse, cameraComponent.camera );

    // calculate objects intersecting the picking ray
  var intersects = this.raycaster.intersectObjects( this.sceneComponents.first.getObject().children, true );

  if(intersects.length>0){
  	if ( this.INTERSECTED != intersects[ 0 ].object ) {
      if ( this.INTERSECTED )
      this.INTERSECTED = intersects[ 0 ].object;
      if(intersects[ 0 ].object.type == "Mesh"){
        this.INTERSECTED = intersects[ 0 ].object;
        this.INTERSECTED.material.emissive.setHex( 0xff0000 );
        this.render();
      }
    }
  } else {
    if ( this.INTERSECTED )
    this.INTERSECTED = null;
  }

}
`

I set up a minimal working bench to test this on the raycaster-test branch.
However, I also can't get it to work. The relevant changes are here:
https://github.com/makimenko/angular-template-for-threejs/blob/a59ff9dd1b3fb2718f51c0f0565a4d62ed631e75/src/app/app.component.ts#L38-L49
The code above always returns an empty array for intersected objects. If I intersect with all of the scene's children (i.e. relevantObjects without the filtering), then I always get intersected objets of type linesegment.

because of this true

const intersectedObjects = this.raycaster.intersectObjects(relevantObjects, true);

If true, it also checks all descendants. Otherwise it only checks intersection with the object. Default is false.

@sdavarifard Thanks, that was the issue! My test now works: https://github.com/makimenko/angular-template-for-threejs/commit/5cc24cd3798a8c717a0309102c544475943a1454.
Build instructions as in README: npm install, ng build atft, ng serve --open
Usage: right-click some of the cubes, then move the camera with the left mouse button*
*) to force rerendering. Sadly, I could not get ViewChild to work with the WebGLRenderingComponent, I always got the error "Can't construct a query for the property, since the query selector wasn't defined".

how to show selected Object info. in new ShowDialog?

@sdavarifard Which "ShowDialog" are you referring to? I know none and could not find one on the Internet (with keywords 'JS' and 'Three.js').

Sorry that my question was unclear... I am new in NG and threejs.
What I would do:
1- Click on Obj --> get Object's Info (Done)
2- Display for Example Object name,id... (selected) in new Window or Dialog such : MatDialog in ng

Instead of console.log (as shown in my raycaster-test branch), you would need to populate information for your MatDialog. I would imagine this as setting some property of a MatDialog ViewChild and then possibly triggering Angular's change detection. However, I am not actively using Angular at the moment and thus can't give you any more concrete example.
But if you come up with a minimal example, feel free to share if you want. Maybe we could integrate it in atft's showcase example.
Closing this thread unless there's more to discuss/ask. Feel free to request reopening.

yes , done with Send intersected Obj to Parent . thank you.


add service and a way to differentiate between gcloud groups and commands

This PR adds the service field to be configurable on the gcloud command. It also splits the gcloud commands that respond to group or plain gcloud command because the syntax is different. I wasn't sure how I could write tests for this so any advice/suggestion welcome.
For example:
This is a group gcloud command:
gcloud app versions delete <service> <version>
whereas this is a plain gcloud command:
gcloud app deploy <yml file> --version <version>
The group type doesn't support deploying with a yml file.
Here are the gcloud docs for reference:  https://cloud.google.com/sdk/gcloud/reference/app/

fyi I don't think I have rights to merge this to master so if you 👍 someone with admin rights should do it.


Treewide: remove inactive maintainer viric

Description of changes

https://github.com/NixOS/nixpkgs/issues/290642
Things done

Built on platform(s)

[ ] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[ ] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

For the future merger:
Can we relax the restriction here and merge it ignoring the formatter?

Okay. Than we can merge it right away.

I want to add myself for perf, ghostscript, and logrotate. Can you make that change or should I open a follow up PR?

I want to add myself for perf, ghostscript, and logrotate. Can you make that change or should I open a follow up PR?

Better:
I will remove them from this PR. This way you can adopt them right now.

As the first person to encounter the unused with error due to this, can you share your thoughts on this? 😄🎙

I will fix empty maintainer lists using the with expression in a follow up PR.

As the first person to encounter the unused with error due to this, can you share your thoughts on this? 😄🎙

I have mixed feelings about this.
In a first sight, I left the packages that way because a not so long time ago it was recommended - something about "it would be easier to add new maintainers in the future".
On the other hand, now that CI reports this as an error, there is no more room to never-ending discussions.
The net result of being shot by an error was positive!

https://github.com/NixOS/nixpkgs/pull/330664

I think overall having detection for unused with statements is quite useful, while having an exception just for maintainer fields would make it only more complex.

The discussion moved away from the actual topic of the PR AFAICS... how about we merge this?

I will fix empty maintainer lists using the with expression in a follow up PR.

I can solve this with a bit of emacs-fu. Now CI is happy!
Nonetheless the cleanup will be needed in other expressions...

I thought, I pressed the merge button already... must have timed out.

This removal PR has already been merged, despite not being grounded within community consensus. See https://github.com/NixOS/nixpkgs/pull/337478#issuecomment-2310779183
@viric  be sure that we value your involvement and any time you may have to spare, helping with the packages you've maintained and others as well, and if you decide to come back, please don't hesitate to be added to maintainers again.


Update integration tests to exercise user info claims support

We should update Okta to pass through groups.  Also we should add a GitLab based test since their OIDC code only provides groups via the user info endpoint (the ID token has minimal info).

The Okta stuff was completed in https://github.com/vmware-tanzu/pinniped/pull/322. Next step is the GitLab stuff.

The Okta stuff was completed in https://github.com/vmware-tanzu/pinniped/pull/322. Next step is the GitLab stuff.


Issue56 fix bounds fmu api

Solves #56, but int values from the _to_bound() function were always set to float in class Variable(). Changing Union[float, int] to Any solves the problem, but the check whether the correct type is used is no longer performed.

@FWuellhorst:
The validator must be executed for min and max and not for value, because a variable can also be of type bool or str. Also, in the validator isinstance(value, (float, int) returns true for bool values, since bool inherits from int. I have fixed the problems, but it is still the case that bool variables get their bounds set to minus and plus infinity, although they actually have no limits. What is your opinion about this?

@HvanderStok : Thanks for noticing. I refactored the to_bounds method into the validator to avoid future confusion. Further, I added some tests to ensure it does not break again. Please check and review if some cases are missing from your point of view.

I tested your new changes with a fmu model and everything works. The new standard bounds for the different types also make more sense now. Thanks for the fix.


Changed to install qiskit not qiskit-terra

Summary
It seems the CI actions and workflows had not been updated and still referred to and installed qiskit-terra. That is no longer part of Qiskit 1.0 and so it installed a pre-1.0 version where qiskit-terra was still there. Later it ended up installing Qiskit 1.0 and with both in the same environment things failed.
I changed the actions to no longer refer to anything as Terra and install Qiskit only.
Details and comments
Probably want to backport this to keep the stable branch running too.

This is now working better - but failing since stable released Nature is not compatible with Qiskit 1.0 in terms of using the qiskit.tools parallel_map function which was moved etc

I updated things as they were and changed qiskit-terra to qiskit. As the requirements do not call out qiskit explictly that could be possible what you say, but it still has all that stuff in there that allows it to be run off of main branches for either, not only stable. Could one simplify the CI here further - I imagine, I just updated what was there.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>
Details

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 80.571%

Totals

Change from base Build<PHONE_NUMBER>:
0.0%

Covered Lines:
141

Relevant Lines:
175

💛  - Coveralls


WIP feat: basic histoire setup

Hey there,
This is the basic histoire setup for package lunchbox.
The PR has everything we need to get started with, the only problem is that I got stuck on combining the Stories and the lunchboxApp due to the different renderers, this might be a handicap for all these types of implementations if Vue doesn't offer a Reconciliation feature
@SaFrMo Take a look to demos/Basic.story.vue and histoire.setup.ts to see if we can make it work together.

Closing for now since adding histoire isn't a priority at the moment. Appreciate the work on this though, feel free to reopen if you have more time to try it out!


nsqadmin some fields unclear

some of the fields are current state (depth, in-mem, on disk) which reset to 0 in good circumstances, while others don't reset and seem to be totals from start until now. like messages, and i think requeued/timed out as well? (i have timed out = 1 for more than hour, so i presume/hope that message has been processed just fine since then ?)

some fields include each other.  I hear Requeued includes "Timed out" for example, but not "Deferred". this is confusing.

It's a fair comment that these could be documented better. We've tried to keep the nsqadmin ui compact and have avoided paragraphs of definitions there.
In nsqadmin, the counters for message state where numbers represent actual messages are labeled as 'Message Queues'. The ones that are lifetime statistics since node or connection startup are labeled 'Statistics'.
Message Queues:

Depth: sum(message in memory + messages on disk). This is the count a client can consume immediately
In-Flight: a message sent to a client but not yet REQ or FIN'd or Timed out
Deferred: Messages that were REQ'd or Timed out and are not yet available for delivery to a client

Statistics:

Requeued: messages delivered to a client and subsequently moved to the deferred queue for later retry
Timed Out: messages delivered to a client that didn't receive a response before configured timeout that were server-side requeued.
Messages: total count of new messages

Client Connections:

In-flight: the number of messages sent to that connection not yet FIN or REQ'd
Ready Count: the max number of messages that can be in-flight on this connection
Finished: sum(FIN) responses
Requeued: sum(REQ) responses
Messages: count() messages sent

Also for context for anyone else that comes across this thread, here is an appropriate nsqadmin screenshot.

thanks a lot jehiah.


Got an MVP for jobs using the scraper.  Returns up to 15 jobs for a j…

…ob type, city, and state.  I have to redo the csv file and then push it to the db or have Julia help me with that.  I would ideally like to query the db and should be able to once I get a better collections of jobs for all the states. Thanks guys!

Andrew, you did a good job doing both with a scraper and db. Your code to retrieve data from db works, you just need to import your function which you've created in db.py to ml.py (from app.db import select_available_jobs). Also, in the select_available_jobs function you are retrieving only one column, so you don't need a star (*) in the query. You need to change .select(*columns) to .select(columns). The other thing is a table that you are retrieving data from doesn't have some cities (New York, Los Angeles), so the result is empty. But it's ok as long as it doesn't throw an error.


Changelog out of date

What happened in 1.5.2 and 1.5.3?  Your changelog is out of date, and I'd like to know if you've fixed https://github.com/mongoid/moped/issues/346.

Github will show you what commits were added between any two tags.  e.g. here's what changed between 1.5.2 and 1.5.3 https://github.com/mongoid/moped/compare/v1.5.2...v1.5.3


Update Weave Net link to newly supported fork

@rajch is the maintainer in charge of Weave Net now, he is doing the work 👏
Ref: https://github.com/kubernetes/website/pull/45202#issuecomment-1976819974
This PR supersedes and closes #45202
Supersedes #45258, revisiting #45257
I am a Kubernetes contributor in other ways for some time but I think this is my first commit in the kubernetes org. 🎉

Will work on the CLA ☑

AFAICT the PR has all the required bits now, except for an lgtm label from someone who can approve it.
The CLA is A-OK, commit sign-off etc. Let me know if I should change the commit message to follow style.

/lgtm


J08 k j08 k new automation

Attempt to fix the rebase problem with https://github.com/exercism/python/pull/2706.

Closing this.  It didn't work.


Add Elasticsearch with Kibana option

This Pull Request adds the option to add an elastic with kibana service to the application's docker-compose.yml.
I could split elastic and kibana, but I think it is very likely that users would like the ease of use of having both added at the same time.
The configuration of the containers is copied from the official Elastic docs on using it with Docker. The same configuration is also tested in an application using Elasticsearch as a Scout driver. Because such driver is a third-party package I have omitted setting the Scout driver in the .env.

Thanks for your pull request to Laravel!
Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.
If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!
If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.

I'm sorry @timrspratt but we have no plans for that. You're free to maintain your own stub.


Unity reorderable

Remove Rotorz and use Unity's InternalReorderable list in its place.

Awesome job Steve! One small thing, the command name and info text seem to be slightly misaligned vertically? Seem to be off by a pixel or two on some rows.


Memif interfaces have high latency

Expected Behavior

Latency should be consistent, regardless of the type of interface.
Current Behavior

When using memif mechanism there are occasional latency spikes.
See my comment for more details.
Steps to Reproduce

Here is the branch that contains instructions to run tests:
https://github.com/d-uzlov/deployments-k8s/tree/perf-test-1/perf-test
There are also instructions to create visual graphs for results in this branch, and for results that you may create by running the tests yourself.
Context

Initially I used a bare-metal machine from Packet provider, but then I checked and I was able to replicate the issue on my local PC in a VM.
So I think the issue should be hardware-independent.
For testing I was using virtual kind cluster(s).

Kind version: v0.17.0
Kubernetes Version: v1.26.0
NSM Version: 8a7a76dbe9267313397e7e59d6c9fb457de3a285

Graphs
The results are arranged roughly in the order that I tested things.
Each test case represented here by a single graph.
I captured many graphs from each test, but the results seems pretty consistent, there is not much variation.

Open me

My notes
There seems to be a latency spike around 50 ms.
This latency spike is the same across these test scenarios:

nsm vl3 interdomain
nsm vl3 single-cluster
nsm nse-composition

Both vl3 and nse-composition examples use memif mechanism for communication between user endpoints.
Node has latency spikes even on unrelated interfaces, if it has a connection to some vl3 network (see the k8s service but pod has vl3 interface graph).
kernel2kernel example is not affected.
Pure k8s service scenario is also not affected (when ).
These 2 scenarios make me think that my testing method should be correct, and the issue is really caused by memifs.

Also, I forgot to mention that I have already tried to disable CPU limit for forwarder and switch all of the vpp interfaces into polling mode.
This increases the throughput, and decreases typical query latency, but it doesn't affect these slow queries at all.

Also, today I have tested this with pure VPP, without NSM.
I have found something similar with VPP ping: typical ping latency is 0.1 ms, but periodically latency spikes 10x, up to 1.1 ms.
However, even 10x spike is still 50 times lower than what I see using the NSM.
I have also tried to manually set up 2 kernel interfaces, connected via memif.
There I get typical latency of 2 ms, with max latency about 4 ms. So there are no measurable issues.

I have tried running a shorter and a longer test.
I see the same behavior: every 100 ms there is a delay for 50 ms.
Run with duration 0.5s consistently got exactly 5 slow queries.
Run with duration 20s consistently got exactly 200 slow queries.
Graphs:

Open me

It seems I have found a way to fix the issue.
I tried disabling vpp statistics gathering in forwarder, and I no longer see the consistent 50 ms delays.
I have yet to test this change on a proper machine.
On dev machine I see very few spurious long queries, but these are most likely related to many other programs that I run on this machine. It's nothing like those consistent "50 ms every 100 ms" that I saw in previous tests.
Also, the throughput is much higher now.
Graphs:

Open me

To disable the stats I have just inserted return statements into these functions, at the very first line of the function:
https://github.com/networkservicemesh/sdk-vpp/blob/36ad9b74b35754a640dad9a37c76c2b882be2d31/pkg/networkservice/stats/common.go#L41
https://github.com/networkservicemesh/sdk-vpp/blob/36ad9b74b35754a640dad9a37c76c2b882be2d31/pkg/networkservice/stats/common.go#L74
For a proper fix we will obviously need some better solution.

I think I have found the root cause of the issue, and it's not related to vpp statistics at all.
Earlier I wrote that disabling CPU limits doesn't affect the issue:

Also, I forgot to mention that I have already tried to disable CPU limit for forwarder and switch all of the vpp interfaces into polling mode.

Turns out, it was wrong.
My issue was that I changed limits on forwarder. But in vl3 network forwarder is not the main component.
In vl3 network traffic is managed by VPP instance running inside the vl3 NSE.
When I disabled limits on both forwarder and vl3 NSE the issue with latency was completely solved.

It seems like the latency with CPU limits is a kubernetes issue.
By default k8s manages CPU limits in periods of 100 ms.
If the CPU limit is set to 500m, like we currently have in the vl3 NSE yaml, then for each 100 ms time period NSE is allowed to run 50 ms (in summary for all threads in the pod). As soon as the 50 ms limit is hit, all the threads in the pod are stopped until the end of the current 100 ms period.
It seems to me that it would be wise to disable CPU limits on both forwarder and vl3 NSE. And probably on any other deployment that runs VPP instance.


Update docs for direction links

The markup for direction links has been refactored to hide the arrow icon from screen readers. the docs need to be updated to reflect this change.

closed by #605


Keep window size when opening and closing menus

#I play with the window maximized but every time I open the levels menu or options or whatever and then close it, the window isn't maximized anymore. I tried enabling the option that locks the window size but that doesn't help.

I don't know how to label this as a feature request :(

Labels are assigned by admins, don't worry about it.


Added ability to use custom grid and grid cell class names.

I need this functionality for a project, so I went ahead and adding it. From my testing it works fine.
Resolves #3

I'll try to review asap.

I like the idea here, but I think the implementation is little bit overcomplicated. I'd suggest simplifying it to variables:
$im-grid-class: 'grid' !default; $im-grid-cell-class: 'grid-cell' !default;

I like the idea here, but I think the implementation is little bit overcomplicated. I'd suggest simplifying it to variables:
$im-grid-class: 'grid' !default;
$im-grid-cell-class: 'grid-cell' !default;

With that i'd remove all occurrences of:
.#{$im-grid-class}#{$im-grid-cell-class}
as they only make the code less readable and do not introduce any extra functionality. Unless I'm missing something here? What do you think?

I don't see a downside to your suggestion. I agree it will make things a little more readable.

Looking over the code more carefully, the only place I see where your suggestion would be a problem is with:
    Flexible cells
*/
.#{$im-grid-class}--flex#{$im-grid-cell-class} > .#{$im-grid-class}#{$im-grid-cell-class} {
    display: flex;
}

specifically with this selector:
.#{$im-grid-class}--flex#{$im-grid-cell-class}

Sounds good to me. I'd keep old version of this rule so we don't introduce breaking changes.


add Auburn Sounds to orgs-using-d

CC @p0nce
(SVG is added in case we need a nigher quality image)

Thanks for doing this!

The gzipped SVG is smaller than the PNG. Why bother with the PNG?

The gzipped SVG is smaller than the PNG. Why bother with the PNG?

@p0nce added some specific shading to the PNG...

It looked bad on a white background.

I thought the _hq versions are so we can easily recreate the non-_hq versions when we switch to a different size...

I'll fix it if you switch to a different size.


Also support int64 (long) for JsonValue

When assigning a int64 value to JsonValue, I get this error:
 "Could not cast or convert from System.Int64 to Manatee.Json.JsonValue."} | System.Exception {System.ArgumentException}
Is it possible to also add implicit conversion from int64?

According to MS, casting from long should work the same as casting from int.
I'll create some tests for this.

@StefH this works just fine:
long number = 500;
JsonValue json = number;

Or were you thinking of something else?  Can you post an example of what you're trying to do?

I was trying this:
var jobject = ; // This is a Newtonsoft Json object
var jsonValue = new JsonObject(jobject.ToObject<Dictionary<string, JsonValue>>());

I don't think an implicit cast is going to help you there.
(Maybe I need to create an extension lib that converts from his to mine.)
You might try running it through parsing:
var parsedJson = JsonValue.Parse(jobject.ToString());

However to do this directly, you'd need some kind of special conversion logic.

I created a test:
var target = new
	{
		LongProp = 500.0,
		stringProp = "hello",
		NestedProp = new
			{
				Culture = "en-nz"
			}
	};

var jobject = JObject.FromObject(target); // This is a Newtonsoft Json object
var asDictionary = jobject.ToObject<Dictionary<string, JsonValue>>();
var jsonValue = new JsonObject(asDictionary);

Console.WriteLine(jsonValue);

This works, but when I use 500 or 500L, it doesn't.

That said, it doesn't work for the NestedProp.  There is no conversion from an anonymous object to JsonValue, and it actually just replaces it with null.
So it's looking like you'll still need custom logic.  Or you go through parsing:
var asString = jobject.ToString();
var jsonValue = JsonValue.Parse(asString);

explicit!!!  Making them explicit casts avoids all of the conversion issues.

Now I have explicit casts that are complaining about conflicts...


Can't run basic_example_v1

Traceback (most recent call last):
  File "__main__.py", line 26, in <module>
    basic_example.run(
  File "/home/anikeev/ydb-python-sdk/examples/basic_example_v1/basic_example.py", line 307, in run
    driver.wait(timeout=5, fail_fast=True)
  File "/usr/local/lib/python3.8/dist-packages/ydb/pool.py", line 415, in wait
    self._store.add_fast_fail().result(timeout)
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 444, in result
    return self.__get_result()
  File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
ydb.issues.ConnectionFailure: Failed to resolve endpoints for database /ru-central1/.... Endpoint: ".....ydb.mdb.yandexcloud.net:2135". Error details:
 MetadataUrlCredentials: 404 Client Error: Not Found for url: http://<IP_ADDRESS>/computeMetadata/v1/instance/service-accounts/default/token.
Check that metadata service configured properly and application deployed in VM or function at Yandex.Cloud.

OS: Ubuntu 20.04.4 LTS
Python 3.8.10
python3 -m pip freeze | grep -E "(protobuf|grpcio|enum-compat)"
enum-compat==0.0.3
grpcio==1.47.0
protobuf==3.20.1

If you're running this example from YCloud VM, you can try using an external IP of the database's host instead of FQDN.

Please configure the authentication method to be used.
One option could be to use the service account key, which means that:

service account needs to be created, with the ydb.editor role
service account key file needs to be generated (yc iam key create ...)
YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS env var should point to the generated key file name


[FEAT] add "afterRefine" method

Let's say i have schema like this:
const validationSchema = z.object({
  name: z.string().min(1),
  lowerBound: z.number(),
  upperBound: z.number(),
});

i want to check if "upperBound" is greaterThan "lowerBound"
current solution (as far as i understood from searching) is to do something like this:
const baseSchema = z.object({
  name: z.string().min(1),
});
const extendedSchema = baseSchema.extend({
  lowerBound: z.number(),
  upperBound: z.number(),
}).refine((item) => baseSchema.safeParse(item) && item.upperBound > item.lowerBound);

i want to have method which will do "current checks" and will allow me to add my own on top, like this:
const validationSchema = z.object({
  name: z.string().min(1),
  lowerBound: z.number(),
  upperBound: z.number(),
}).afterRefine((item, result) => result && item.upperBound > item.lowerBound);

oh my, if its true, then its wonderful, could not find it in docs https://github.com/colinhacks/zod?tab=readme-ov-file#refine


how to compiler

HI dear author,
It's truly a honor to write a letter to you,  I'm building your project nowadays and found the error when building as following, I wonder if there is a chance that you know the reason? :)

thank you
best regards to you
William

The error meant that g++-6 was not installed on your system. Although I had hard-coded the command g++-6 in the script, it doesn't make sense to specify the version of g++ in this way. Also, g++-6 is outdated nowadays.
I just updated run_8cc.py, so please pull the change and try it again.


Build error  The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:

I cloned this repo, ran npm install and then ng serve and I get the following error on my browser 👍
Build error
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Typescript found the following errors:
/Users/coder/repos/kara/puppy-love/tmp/broccoli_type_script_compiler-input_base_path-Afc2X3rD.tmp/0/src/main.ts (3, 30): Cannot find module '@angular/http'.
at BroccoliTypeScriptCompiler._doIncrementalBuild (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:115:19)
at BroccoliTypeScriptCompiler.build (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:43:10)
at /Users/coder/repos/kara/puppy-love/node_modules/broccoli-caching-writer/index.js:152:21
at lib$rsvp$$internal$$tryCatch (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1019:11)
at lib$rsvp$asap$$flush (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1198:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
The broccoli plugin was instantiated at:
at BroccoliTypeScriptCompiler.Plugin (/Users/coder/repos/kara/puppy-love/node_modules/broccoli-plugin/index.js:10:31)
at BroccoliTypeScriptCompiler.CachingWriter [as constructor] (/Users/coder/repos/kara/puppy-love/node_modules/broccoli-caching-writer/index.js:21:10)
at BroccoliTypeScriptCompiler (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:27:5)
at Angular2App._getTsTree (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/angular2-app.js:280:18)
at Angular2App._buildTree (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/angular2-app.js:101:23)
at new Angular2App (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/angular2-app.js:42:23)
at module.exports (/Users/coder/repos/kara/puppy-love/angular-cli-build.js:6:10)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/coder/repos/kara/puppy-love/node_modules/ember-cli/lib/models/builder.js:55:19)
at Class.module.exports.Task.extend.init (/Users/coder/repos/kara/puppy-love/node_modules/ember-cli/lib/models/builder.js:89:10)
at new Class (/Users/coder/repos/kara/puppy-love/node_modules/core-object/core-object.js:18:12)
at Class.module.exports.Task.extend.run (/Users/coder/repos/kara/puppy-love/node_modules/ember-cli/lib/tasks/serve.js:15:19)
at /Users/coder/repos/kara/puppy-love/node_modules/ember-cli/lib/commands/serve.js:64:24
at lib$rsvp$$internal$$tryCatch (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1048:17)
at /Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:331:11
at lib$rsvp$asap$$flush (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1198:9)
The console log is as follows :
==> ng serve
(node:27365) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Typescript found the following errors:
/Users/coder/repos/kara/puppy-love/tmp/broccoli_type_script_compiler-input_base_path-PCRTU4nW.tmp/0/src/main.ts (3, 30): Cannot find module '@angular/http'.
at BroccoliTypeScriptCompiler._doIncrementalBuild (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:115:19)
at BroccoliTypeScriptCompiler.build (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:43:10)
at /Users/coder/repos/kara/puppy-love/node_modules/broccoli-caching-writer/index.js:152:21
at lib$rsvp$$internal$$tryCatch (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1019:11)
at lib$rsvp$asap$$flush (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1198:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
The broccoli plugin was instantiated at:
at BroccoliTypeScriptCompiler.Plugin (/Users/coder/repos/kara/puppy-love/node_modules/broccoli-plugin/index.js:10:31)
at BroccoliTypeScriptCompiler.CachingWriter [as constructor] (/Users/coder/repos/kara/puppy-love/node_modules/broccoli-caching-writer/index.js:21:10)
at BroccoliTypeScriptCompiler (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/broccoli-typescript.js:27:5)
at Angular2App._getTsTree (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/angular2-app.js:280:18)
at Angular2App._buildTree (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/angular2-app.js:101:23)
at new Angular2App (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/broccoli/angular2-app.js:42:23)
at module.exports (/Users/coder/repos/kara/puppy-love/angular-cli-build.js:6:10)
at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/models/builder.js:55:19)
at Class.module.exports.Task.extend.init (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/models/builder.js:89:10)
at new Class (/Users/coder/repos/kara/puppy-love/node_modules/core-object/core-object.js:18:12)
at Class.module.exports.Task.extend.run (/Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/tasks/serve.js:15:19)
at /Users/coder/repos/kara/puppy-love/node_modules/angular-cli/lib/commands/serve.js:64:24
at lib$rsvp$$internal$$tryCatch (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1048:17)
at /Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:331:11
at lib$rsvp$asap$$flush (/Users/coder/repos/kara/puppy-love/node_modules/rsvp/dist/rsvp.js:1198:9)
Am I missing a dependency? Could you please add some documentation for how to build and run?

I do have the same error, I thought I had to run
npm install
typings install
ng serve

But I have this broccoli error.
Great talk at ng-conf BTW :)

@codesdk @maxime1992 it looks like you need to install the @angular/http component,
go into the terminal and type:  npm i @angular/http
That's what was missing from mine also when I cloned it, have it working fine now

Hi @maxime1992 and @dkrystall
I did
npm install
typings install
npm install @angular/http
But I got this error
==> npm install @angular/http
<EMAIL_ADDRESS>/Users/coder/repos/codesdk/githubrepos/puppy-love
├── UNMET PEER DEPENDENCY<EMAIL_ADDRESS>├── UNMET PEER DEPENDENCY<EMAIL_ADDRESS>extraneous
└── UNMET PEER DEPENDENCY<EMAIL_ADDRESS>npm WARN<EMAIL_ADDRESS>requires a peer of<EMAIL_ADDRESS>but none was installed.
npm WARN<EMAIL_ADDRESS>requires a peer of<EMAIL_ADDRESS>but none was installed.
npm WARN<EMAIL_ADDRESS>requires a peer of<EMAIL_ADDRESS>but none was installed.
npm WARN<EMAIL_ADDRESS>requires a peer of<EMAIL_ADDRESS>but none was installed.
npm ERR! code 1
Ran
ng serve
And it runs fine on the browser so I guess I should close this issue?
Unless you know what is causing the npm ERR right at the end?
Also, should I do
npm install @angular/http --save ?

Created pull request
https://github.com/kara/puppy-love/pull/3

Thanks for the issue!  I'm actually trying to keep this code true to what I actually demo-ed at the conference, so I'm not accepting pull requests. But I will definitely add something to the README about the missing dependency to avoid confusion. Thanks for letting me know!


Test

Added my name to the contributors list and pushing to see if I can push correctly.

Looks good, merging pull request.


RedisClientType hard to use with createClient

The RedisClientType has two generic parameters that make it hard to use to signify the return type of createClient. In particular, the first argument modules in the declaration of createClient is a local variable that is not exported and thus cannot be easily reused in one's own code.
Maybe it's already enough to provide sufficiently general defaults for the generic arguments. If I'm not mistaken these parameters control more the configuration of the client and don't really influence the typing of the "normal" methods; so they are not that important for an user of a factory method.
Below is a similar observation from #1673.

The RedisClientType exported since 4.0.1 still does not work for me. Could not figure out how to make the exported RedisClientType, RedisClientOptions and the type returned by createClient compatible. Here is an example that illustrates the issue.
The following does not compile unless someone knows how to type RedisClientOptions correctly (refer to the code sandbox link above).
import { createClient, RedisClientOptions, RedisClientType } from "redis";

const factory = (options: RedisClientOptions<any, any>): RedisClientType => {
  return createClient(options);
};

const client: RedisClientType = factory({...});

Instead, I am doing this for now:
import { createClient} from "redis";
type RedisClientType = ReturnType<typeof createClient>;
type RedisClientOptions = Parameters<typeof createClient>[0];

const factory = (options: RedisClientOptions): RedisClientType => {
  return createClient(options);
};

const client: RedisClientType = factory({...});

Originally posted by @tbinna in https://github.com/redis/node-redis/issues/1673#issuecomment-993335708

RedisModules extends the client with the installed modules commands, RedisScripts extends it with the defined lua scripts (see here).
In case you want to ignore modules and scripts, Record<string, never> should do the trick:
RedisClientType<Record<string, never>, Record<string, never>>

Thanks! Would it then be an idea to set these generic parameters to Record<string, never> by default, i.e. RedisClientType without any generics specified is equivalent to what you wrote above?

@leibale Could you provide an example how to use a typed client with scripts?
What works for me without defining scripts:
export type RedisClientType = ReturnType<typeof createClient>

myCreateClient(port, host, pw): RedisClientType {
 const client: RedisClientType = createClient({
      socket: { port, host, tls: true },
      password: pw,
    })
  return client
}

However, once I add a script, I get a types are incompatible error.
myCreateClient(port, host, pw): RedisClientType {
 const client: RedisClientType = createClient({
      socket: { port, host, tls: true },
      password: pw,
      scripts: {
        add: defineScript({
          NUMBER_OF_KEYS: 1,
          SCRIPT: 'local val = redis.pcall("GET", KEYS[1]);' + 'return val + ARGV[1];',
          transformArguments(key: string, toAdd: number): string[] {
            return [key, toAdd.toString()]
          },
          transformReply(reply: number): number {
            return reply
          },
        }),
      },
    })
  return client
}

@restfulhead
import { createClient, defineScript, RedisModules, RedisScripts, RedisClientType } from '@node-redis/client';

interface ClientOptions<
    M extends RedisModules,
    S extends RedisScripts
> {
    port: number;
    host: string;
    pw: string;
    modules?: M;
    scripts?: S;
}

function clientFactory<
    M extends RedisModules,
    S extends RedisScripts
>(options: ClientOptions<M, S>): RedisClientType<M, S> {
    return createClient({
        socket: {
            port: options.port,
            host: options.host
        },
        password: options.pw,
        modules: options.modules,
        scripts: options.scripts
    });
}

const client = clientFactory({
    port: 6379,
    host: 'host',
    pw: 'pw',
    scripts: {
        add: defineScript({
          NUMBER_OF_KEYS: 1,
          SCRIPT: 'local val = redis.pcall("GET", KEYS[1]);' + 'return val + ARGV[1];',
          transformArguments(key: string, toAdd: number): Array<string> {
            return [key, toAdd.toString()]
          },
          transformReply(reply: number): number {
            return reply
          },
        })
    }
});

client.add('key', 1);
//     ^?

playground

Hm...thanks for the example, but what I really need is a factory that returns the type of the configured client; not the generic one. My application will use the same client everywhere, so I need a type to pass around the configured client.
For example say I'd like to pass my client to a function:
// how to best define the MyClient type here?
function doAdd(client: MyClient) {
   client.add('key', 1);
}

Now adding on to your example, the following works, but requires a lot of declaration:
export type MyClient = RedisClientType<RedisModules, {
    add: {
        NUMBER_OF_KEYS: number;
        SCRIPT: string;
        transformArguments(this: void, key: string, toAdd: number): Array<string>;
        transformReply(this: void, reply: number): number;
    } &
    {
        SHA1: string;
    }
}>

@leibale Would it be feasible to export the RedisScript and SHA1 types?
This would make the declaration (and therefore using) this library much easier:
export interface ConfiguredRedisScripts extends RedisScripts {
  add: RedisScript
}
export type MyClient = RedisClientType<RedisModules, ConfiguredRedisScripts>

function doAdd(client: MyClient) {
   client.add('key', 1);
}

@restfulhead
import { createClient } from '@node-redis/client';

export const client = createClient({
  modules: {
    // ...
  },
  scripts: {
    // ...
  }
});

export type CustomRedisClient = typeof client;

const duplicate = client.duplicate();

import { createClient } from '@node-redis/client';

const modules = {
  // ...
};

const scripts = {
  // ...
};

export type CustomRedisClient = RedisClientType<typeof modules, typeof scripts>;

export function clientFactory(): CustomRedisClient {
  return createClient({
    modules,
    scripts
  });
}

@leibale thanks for adding the defaults to the RedisClientType params. However, now the following code
import redis, { RedisClientType } from 'redis'
function createRedisClient(): Promise<RedisClientType> {
    const client = redis.createClient(...redisConfig...)
    await client.connect()
    return client
}

fails with an error of the type
error TS2322: Type 'RedisClientType<{ graph: { CONFIG_GET: typeof import("/home/runner/work/JabRefOnline/JabRefOnline/node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); configGet: typeof import("/home/runner/work/JabRefOnline/JabRefOnline/node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); ... 15 more ...; slowLog: typeo...' is not assignable to type 'RedisClientType<Record<string, never>, Record<string, never>>'.

@tobiasdiez #1984 should fix it

Thanks! I haven't had a chance to try it, but codewise it looks good to me.

I hate to bother you again, but the code from above (https://github.com/redis/node-redis/issues/1865#issuecomment-1038249865) is still not working and now fails with
Type 'import("file:///node_modules/@node-redis/client/dist/lib/client/index").RedisClientType<{ graph: { CONFIG_GET: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); configGet: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); ... 15 more ...; slowLog: typeo...' is not assignable to type 'import("file:///node_modules/redis/dist/index").RedisClientType<{ graph: { CONFIG_GET: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); configGet: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); ... 15 more ...; slowLog: typeof import("file:///node_m...'.
  Type 'RedisClientType<{ graph: { CONFIG_GET: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); configGet: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); ... 15 more ...; slowLog: typeof import("file:///node_modules/@node-redis/graph/dist/commands/SLOWLOG")...' is not assignable to type 'RedisClient<{ graph: { CONFIG_GET: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); configGet: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); ... 15 more ...; slowLog: typeof import("file:///node_modules/@node-redis/graph/dist/commands/SLOWLOG"); };...'.
    Types of property 'options' are incompatible.
      Type 'import("file:///node_modules/@node-redis/client/dist/lib/client/index").RedisClientOptions<{ graph: { CONFIG_GET: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); configGet: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); ... 15 more ...; slowLog: ty...' is not assignable to type 'import("file:///node_modules/@node-redis/client/dist/lib/client/index").RedisClientOptions<{ graph: { CONFIG_GET: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); configGet: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); ... 15 more ...; slowLog: ty...'. Two different types with this name exist, but they are unrelated.
        Type 'import("file:///node_modules/@node-redis/client/dist/lib/client/index").RedisClientOptions<{ graph: { CONFIG_GET: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); configGet: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); ... 15 more ...; slowLog: ty...' is not assignable to type 'import("file:///node_modules/@node-redis/client/dist/lib/client/index").RedisClientOptions<{ graph: { CONFIG_GET: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); configGet: typeof import("file:///node_modules/@node-redis/graph/dist/commands/CONFIG_GET"); ... 15 more ...; slowLog: ty...'. Two different types with this name exist, but they are unrelated.
          Type 'RedisScripts' is not assignable to type 'Record<string, never>'.
            'string' index signatures are incompatible.
              Type 'RedisScript' is not assignable to type 'never'.(2322)

See https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBFApgE2AZwDRwN5wEoroDCANsIgHYwAqAnmInAL5wBmUEIcA5EqmtwBQAQzS0KAYzYBXSTGAQKcCUmExEBfqXJUAFAEoAXHAAKHEOkQAeTcTKUa9RAD4cguB+WK08CfapwALwIhGgAdCqIaojaDgbunjBOyv6ODEFwSQwQrCk6MAkeWYwA4ogwAMoqwGBp1kRwiAAe6hTIaPihsVR0DFbCFLRYA7TOrsENza3tnVqpvdYjWMAUrIhQcNSuAPybcMayANYUEADuFADchZnJaNW1Cxlllfd1Vn75C87XAPQ-nh4AHrba7CU7CYC+VIRRQURASGDxAFIGDSKBKD4OQRMIA
The issue here is that the script type returned by createClient is redis.RedisScript but the default script type for RedisClientType is Record<string, never>. Would it be possible to change the default?

@leibale can this issue please be reopened, it is still not working as reported above https://github.com/redis/node-redis/issues/1865#issuecomment-1075030395. Thanks!

@tobiasdiez the default is that there are no scripts, why is that a problem?

The issue is that if you do use scripts, then you need to specify the type of the scripts everywhere. Instead of "no scripts", something like "generic scripts" would be helpful. The goal is to make the following code work
import redis, { RedisClientType } from 'redis'
function createRedisClient(): Promise<RedisClientType> {
    const client = redis.createClient(...redisConfig...)
    await client.connect()
    return client
}

function something(client: RedisClientType) {}
something(await createRedisClient())

Currently, one need to use RedisClientType<any, any, any>.

@tobiasdiez
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBFApgE2AZwDRwN5wEoroDCANsIgHYwAqAnmIlgamgLITICuJim+haAMoBjKMDAw+zdADFOFYTGAQKfZIgBmwCohFiJcAL5wNUCCDgByJC0sBuAFAPhKtPDSjxkuAF4cDuEC4D30YAC44dS0dPS8ACmwAoOTBIjwASQAFagjrRBhOKAo4AEE8AHEANQBtAEYAXUsMJOTAmCgAQ1UNaBASqABzThBKSTiOwYiKYYAjRCgASn9WlYR8wuLqiYGAOhgIQXbtAbiF+sdVo2bL9q60HqgQAjASWjikF9oItzEKAaXEpdkkgCkU4AA5Wbzd6IT4LC6rQwtIwLBzGDpoOAuVQwRwODG0BQmeSKZTFUAvYDCYAwU7LILYtxYsijXxrFg7USIDowRCkchUBLBTwSTGGeFOZLCFlUHYhLwIwIAeiVrQAegB+SVBDoAdw6NOZApgnJUOkUp2RyJBGyNo0cSPxaEJwmJCiUKjgA0o8ypAB5kaw4IgAB68ijITHSNgcbi8a5BGTBsOUSP8Fhyd1kzDIwTJ8Np6OxUUOAB8cQgEmzEUBQRAsZ4aA1EVYirdpNczbgMjb8tFXcEDoWEUyZhA6EQfuj-NGdAYftYWBkWEEpdL9MCjPg0uNbJs6E5SB5fJltMrHtUEuReoN29Ppoo5tpqOS1vWYJ39rRTi3dqobJvQ1vR0MRhCFPtvHFPFP1lCDHBVdUNSAA

Thanks but this is not really what I need. My requirements (and I believe many others are in a similar position) are as follows:

Have a factory method in one module, that creates a redis client. (This factory method is then registered in the dependency framework)
In other modules, I would like to use the redis client, i.e. as a constructor or method argument.

In both instances, I'm not really able to easily type the redis client. I could pass down the generics as you suggest with your generic function, but that is unhandy since now every other method that uses the redis client needs these generics - but in my application I only have one redis client so the generics are actually fixed.
The following code works
import redis, { RedisClientType } from 'redis'
type RedisClient = RedisClientType<redis.RedisModules, redis.RedisFunctions, redis.RedisScripts>
async function createRedisClient(): Promise<RedisClient> {
    const client = redis.createClient()
    await client.connect()
    return client
}

My suggestion is that the generics of RedisClientType default to <redis.RedisModules, redis.RedisFunctions, redis.RedisScripts> so that one can use RedisClientType directly over RedisClient.
By the way, the redis client returned by createClient has more modules than redis.RedisModules. I think redis.RedisModules should be the same as what createClient returns without any args.
Another suggestion: rename RedisClientType to RedisClient, the type suffix isn't necessary and its clear from the context that its a type.

I can't rename RedisClientType to RedisClient because:
1.1. RedisClient is the name of the class
1.2. It'll be a breaking change
RedisModules is just a generic type from @redis/client, don't confuse it with the default modules in redis, which I should probably export as well - wanna open an issue about it?
Why do you think that every method will need these generics? see this example

Makes sense, okay!
Done: https://github.com/redis/node-redis/issues/2241
What I meant is that function accepting a RedisClientType would then need generic arguments as well, e.g.

 function store<M, F, S>(client: RedisClientType<M, F, S>, value: string) {
    // use client here...
 }

This gets ugly quickly.

regarding 3 - you can use the typescript typeof operator
const client = createClient({
  // ...
});

type MyRedisClient = typeof client;

Yes, but only if you don't use a factory method to create the client, since then client is only visible in that factory method and thus its type cannot be exported to other modules (or used to annotate the return type of the factory).

Just came here to say that all of this seems far too hard and worthy of a breaking change to the type definitions. After struggling with this for far too long I just put const client = redis.createClient(redisClientOptions) as RedisClientType<any, any, any> in my factory function.

I did this, which worked for me:
`const SendHSetBatch = async <
M extends RedisModules,
F extends RedisFunctions,
S extends RedisScripts

(
redisClient: RedisClientType<M, F, S>,
input: IBatch
) => {}`

This worked for me:
`import  { createClient, RedisClientType, RedisClientOptions } from "redis";
const redisURL = process.env.REDIS_URL || "redis://localhost:6379";
const factory = (options: RedisClientOptions) : RedisClientType => {
return createClient(options) as RedisClientType;
};
const redisClient: RedisClientType = factory({url: redisURL});
redisClient.on("error", (err) => {
console.error("Error connecting to Redis:", err);
});
`

Thanks @thatcort , I my case just const client = redis.createClient(redisClientOptions) as RedisClientType was sufficient already.


[DO NOT MERGE] Testing Jenkins

Testing Jenkins

@azuresdkci retest this please

@azuresdkci retest this please

@azuresdkci test on linux

@azuresdkci retest this please

@azuresdkci retest this please

@azuresdkci retest this please

@azuresdkci retest this please

@azuresdkci retest this please

@azuresdkci retest this please

@azuresdkci retest this please

@azuresdkci retest this please

@yugangw-msft Voila


ValueError: Failed to parse the model: pybind11::init(): factory function returned nullptr

System information

OS Platform and Distribution  - Linux Ubuntu 20.04 LTS, 64bit:
TensorFlow installed from conda:
TensorFlow version 2.2.0:
Python version 3.8.5:
GCC/Compiler version 9.3.0:
CUDA/cuDNN version 11.0:
GPU model and memory GTX 1080, 12GB:

Command to export model
python export_tflite_graph_tf2.py --pipeline_config_path trening_demo/pre-trained-models/ssd_resnet50_v1_fpn_1024x1024_coco17_tpu-8/pipeline.config \
--trained_checkpoint_dir trening_demo/models/my_ssd_resnet50_v1_fpn_1024x1024_coco17_tpu-8/ \
--output_directory trening_demo/exported-models-tflite/ex_my_ssd_resnet50_v1_fpn_1024x1024_coco17_tpu-8

Command used to run the converter
import tensorflow as tf
import importlib.util
import multiprocessing

def representative_data_gen():
  dataset_list = tf.data.Dataset.list_files ('/content/model_temp/ed/*')
  for i in range(100):
    image = next(iter(dataset_list))
    image = tf.io.read_file(image)
    image = tf.io.decode_jpeg(image, channels=3)
    image = tf.image.resize(image, [1024, 1024])
    image = tf.cast(image / 255., tf.float32)
    image = tf.expand_dims(image, 0)
    yield [image]

converter = tf.lite.TFLiteConverter.from_saved_model('/content/model_temp/exported-models-tflite/ex_my_ssd_resnet50_v1_fpn_1024x1024_coco17_tpu-8/saved_model')
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
converter.inference_input_type = tf.uint8
converter.inference_output_type = tf.uint8
converter.representative_dataset = representative_data_gen

tflite_model = converter.convert()
with open('/content/model_temp/c-tflite/model.tflite', 'wb') as f:
  f.write(tflite_model)

len(tflite_model)

In the above function I am using decode_jpeg however, my photos have the extension *** .jpg.** I assume it doesn't matter
The output from the converter invocation
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/lite/python/optimize/calibrator.py in __init__(self, model_content)
     51       self._calibrator = (
---> 52           _calibration_wrapper.CalibrationWrapper(model_content))
     53     except Exception as e:

TypeError: pybind11::init(): factory function returned nullptr

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
4 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/lite/python/optimize/calibrator.py in __init__(self, model_content)
     52           _calibration_wrapper.CalibrationWrapper(model_content))
     53     except Exception as e:
---> 54       raise ValueError("Failed to parse the model: %s." % e)
     55     if not self._calibrator:
     56       raise ValueError("Failed to parse the model.")

ValueError: Failed to parse the model: pybind11::init(): factory function returned nullptr.

Link to the saved model -- ex_my_ssd_resnet50_v1_fpn_1024x1024_coco17_tpu-8
https://drive.google.com/drive/folders/1Hz4BdMw2xg5t1rRMhl0smiz17GnL-Pz5?usp=sharing
I read that this may be a problem with the TensorRT version. Right? I use google colab.

@Rariusz,
I do not have access to the link you have provided. Could you please provide the required permissions to view the files.
Also in order to reproduce the issue reported here, please provide the contents of the directory /content/model_temp/ed/. Thanks!

@amahendrakar Thank you for your answers !
Link for model (ex_my_ssd_resnet50_v1_fpn_1024x1024_coco17_tpu-8) that I need to convert to TFLite:
https://drive.google.com/drive/folders/1Hz4BdMw2xg5t1rRMhl0smiz17GnL-Pz5?usp=sharing
Contents of the directory /content/model_temp/ed/
https://drive.google.com/drive/folders/1y5AIh86wdA8ZoVxQBuOSh8ZbGGdAmIXl?usp=sharing
These are sample photos. Currently, I am mainly interested in solving the problem of converting the model to tflite.
Thank you for your help and time !!!

@Rariusz,
I was able to run the code without any issues using TF v2.2, please find the gist of it here. Thanks!

Was able to reproduce the error with TF v2.3.
However, on running the code with TF-nightly, the error changes to ValueError: Model input is not quantized. Please find the attached gist. Thanks!

@amahendrakar
Thank you for your help and time !!!. I run code with and the solution was to install tensorflow==2.2 but, now I'm back to my starting point. Please see this issue: https://github.com/tensorflow/tensorflow/issues/43959
As You will see the problem is that model is reduced to 432 bytes and that creates a problem. Thanks!

@amahendrakar
Following my previous comment, if you have an idea of how to solve my problem or a suggestion that I can use, I will be very grateful!.

@Rariusz What happens if you don't perform any optimizations on the model and convert without quantization?

@ymodak Following this issue https://github.com/tensorflow/tensorflow/issues/44561  without quantization everything work. If I run the detector for ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8 the result is

After running this command:
!python object_detection/export_tflite_graph_tf2.py \
    --pipeline_config_path "/content/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8/pipeline.config" \
    --trained_checkpoint_dir "/content/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8/checkpoint"\
    --output_directory "/content/tflite_graph"
```
The results is the same.  Now I will try to run this model on google coral. Then I will try to run this model for my data set. But there will be problems for sure...
I wonder so far why the image has a different color in the result ..


Feat/hue

Lymui
Totoro is going to review your PR

What does this PR accomplish

[x] Add a new feature supporting a new color type
[ ] Provide a fix to the current project
[x] Add new test

We will check that

[ ] Make sure to have unit test
[ ] Make sure that any test is passing
[ ] Make sure to respect that when converting a type T to return a type T Rgb

🐷 Thanks for contributing ! 🐷

Pull Request Test Coverage Report for Build 109

197 of 205 (96.1%) changed or added relevant lines in 8 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage decreased (-0.8%) to 97.581%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

lymui/tests/hex_test.c
1
2
50.0%

lymui/hsl.c
60
62
96.77%

lymui/helper.c
6
8
75.0%

lymui/hue.c
18
21
85.71%

Totals

Change from base Build 101:
-0.8%

Covered Lines:
484

Relevant Lines:
496

💛  - Coveralls


add volatile as modifier on register

We've decided to add volatile as a modifier (to registers) as an optimization hint to clients for refreshing.

They are and there is already registers to specify the interval. volatile should only be allowed on rw registers

From: Tom Ball @.>
Sent: Tuesday, August 24, 2021 2:23:28 PM
To: microsoft/jacdac @.>
Cc: Peli de Halleux @.>; Review requested @.>
Subject: Re: [microsoft/jacdac] add volatile as modifier on register (#570)
@tballmsft commented on this pull request.

In services/accelerometer.mdhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fjacdac%2Fpull%2F570%23discussion_r695227028&data=04|01|jhalleux%40microsoft.com|092441b9e0b04bf69f5508d967456ada|72f988bf86f141af91ab2d7cd011db47|1|0|637654370139898176|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=vr9FcaRNvfhbfm17%2BrN81htMNRVzVaH9M%2Btg3CT109w%3D&reserved=0:

@@ -21,15 +21,15 @@ We recommend an orientation marking on the PCB so that users can mount modules w

Registers

ro forces @ reading {

volatile ro forces @ reading {

That's a good question. Are they?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fjacdac%2Fpull%2F570%23discussion_r695227028&data=04|01|jhalleux%40microsoft.com|092441b9e0b04bf69f5508d967456ada|72f988bf86f141af91ab2d7cd011db47|1|0|637654370139908170|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=NH903ZZ76SNnl%2FF4H0Fbn%2Bc2pt0ykwhJavytVWJlXN0%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA73QKJ4QVLBVOPJ6L6P7LDT6QEVBANCNFSM5CXVVB5A&data=04|01|jhalleux%40microsoft.com|092441b9e0b04bf69f5508d967456ada|72f988bf86f141af91ab2d7cd011db47|1|0|637654370139908170|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=O9jESTZECneySmLt5yZv%2FfHD8F0FATPTpKPAFaR3qMQ%3D&reserved=0.

volatile should only be allowed on rw registers

I don't see why.

non-volatile read-only register == const

You shouldn't be able to "volatile const", agreed.

A ro register can change value because you invoked a command.

Then, I don't understand the purpose of this flag. Could you add documentation for it in the spec mardown as well?
If a ro register is marked as non-volatile, then should the client refresh it?

Yes, it is a hint for clients to do refreshing periodically.

As specified this hint is not useful, since non-volatile ro can also be modified.

The idea is that "non-volatile" registers only change because you invoked (non-get) command on the service (action or register write). Volatile registers can change for no reason obvious from looking at the bus. Thus for non-volatile you could have a caching strategy that flushes the cache whenever there is some write to the service and otherwise every 10 seconds or so (this is in case you drop some write packet). For volatile, you can cache say for 0.5s or so.

So reading is a prototypical volatile register, but most other registers are non-volatile

rw angle: i16.16 ° { typical_min=-90, typical_max=90 } @ value

I do have a question about angle of servo. Say it is at 30 degrees and then you write 90. It will take some time to move from 30 to 90. If you read the angle during this time, it may be some value between 30 and 90. Still, this is not volatile, because of the request to write 90, right?

I think if you write 90 it means you want it to go to 90, and it will read as 90 immediately. There could be another register that gives you the current angle, and we could rename this one "requested_angle".

Yes, that distinction (requested_angle, current_angle) makes sense.
Still my question stands, as the servo is in process of changing, is the current_angle register volatile?

current_angle is going to be volatile because an external force can be applied to the servo and change the angle. requested_angle is non-volatile.

Should a modified non-volative register emit a change event?


fix window function  doc string for Window length

Reference issue

closes: gh-16564
What does this implement/fix?
fix the document for window length in window functions
Additional information

hi @AtsushiSakai , I see in test_windowfunc_basics we already have these two tests :
            # Check invalid lengths
            assert_raises(ValueError, window, 5.5, *params)
            assert_raises(ValueError, window, -7, *params)

and
           # Check degenerate cases
            assert_array_equal(window(0, *params, sym=True), [])
            assert_array_equal(window(0, *params, sym=False), [])

aren't they already testing what we wanted to do?
otherwise, fixed the doc string and we are good to go .
please review and let me know ...
Thanks

It looks like there are no more comments. So let's merge it. Thank you @eshirvana


Fp6 quant from deepspeed

Feature request
https://github.com/huggingface/text-generation-inference/issues/1633
Motivation
Throughout and latency
Your contribution
@tgaddair what do you think?

Hey @flozi00, looks promising! Do you have bandwidth to open a PR for this?

Yes, probably middle or end of the week


feat: travis test

:tada: This PR is included in version 1.3.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: