Issue with transaction variable and chained rule

Hi,
The following type of rules worked fine with apache/modsecurity 2.9.x to reject requests if they don't match the specified combination of HTTP method and URI
SecAction "phase:1,id:1234567,pass,setvar:TX.match="0",nolog"
SecRule REQUEST_FILENAME "^/public/post$" "phase:1,id:2,t:none,chain,nolog,setvar:TX.match="1",SkipAfter:marker"
SecRule REQUEST_METHOD "^POST$" "t:none,nolog"
#======= EOC
SecMarker marker
SecRule TX:match "0" "phase:1,id:12,log,msg:'no match',deny,status:403"

A GET request to /public/post would fail as TX.match would not be set or unset on the failing chained rule (I have no setup to play around with this combination at the moment to produce a debug log)
With nginx 1.23.2 and libmodsecurity v3.2.0 requests with REQUEST_FILENAME not matching a valid URL will be rejected but testing the HTTP method is not working anymore.
...783] [] [4] Initializing transaction
...783] [] [4] Transaction context created.
...783] [] [4] Starting phase CONNECTION. (SecRules 0)
...783] [] [9] This phase consists of 1 rule(s).
...783] [] [4] Starting phase URI. (SecRules 0 + 1/2)
...783] [/public/post] [4] Starting phase REQUEST_HEADERS.  (SecRules 1)
...
...783] [/public/post] [4] (Rule: 12345699) Executing unconditional rule...
...783] [/public/post] [4] Running [independent] (non-disruptive) action: setvar
...783] [/public/post] [8] Saving variable: TX:match with value: '0'
...783] [/public/post] [9] Running action: nolog
...783] [/public/post] [4] Running (disruptive)     action: pass.
...783] [/public/post] [8] Running action pass
...783] [/public/post] [4] (Rule: 1234567) Executing operator "Rx" with param "^/public/post$" against REQUEST_FILENAME.
...783] [/public/post] [9] Target value: "/public/post" (Variable: REQUEST_FILENAME)
...783] [/public/post] [9] Matched vars updated.
...783] [/public/post] [4] Running [independent] (non-disruptive) action: setvar
...783] [/public/post] [8] Saving variable: TX:match with value: '1'
...783] [/public/post] [4] Rule returned 1.
...783] [/public/post] [4] Executing chained rule.
...783] [/public/post] [4] (Rule: 0) Executing operator "Rx" with param "^POST$" against REQUEST_METHOD.
...783] [/public/post] [9] Target value: "GET" (Variable: REQUEST_METHOD)
...783] [/public/post] [4] Rule returned 0.                            (***)
...783] [/public/post] [9] Matched vars cleaned.                       (***)
...783] [/public/post] [4] (Rule: 123456100) Executing operator "Rx" with param "0" against TX:match.
...783] [/public/post] [9] Target value: "'1'" (Variable: TX:match)    (!!!)
...783] [/public/post] [4] Rule returned 0.
...783] [/public/post] [9] Matched vars cleaned.
...
...783] [/public/post] [9] Return code `200' is not interesting to audit logs, relevant code(s): '^(?:5|4(?!04))'.

at (***) TX.match is not reset to '0' and the test at (!!!) fails and therefore the request is (erroneously) accepted.
Am I missing something on how to migrate rules from 2.x to 3.x or can I provide other details for clarification?
Thanks
Server (please complete the following information):

ModSecurity version (and connector): ModSecurity v3.2.0 with nginx-connector latest from git
WebServer: nginx-1.23.2
OS (and distro): alpine container

Rule Set (please complete the following information):

Running any public or commercial rule set? no

Hello @ktptemfau ,
A couple of initial notes:

"libmodsecurity v3.2.0": That wouldn't be your ModSecurity version. libModSecurity releases are all 3.0.x, with the most recent being v3.0.8
I'm surprised the first two lines of rules that you provided work. Use of the double quotes with setvar should have caused a parsing error. Usually one uses either no quotes at all ( setvar:TX.match=0 ) or single quotes ( ``setvar:'TX.match=0'``` )

I just something similar to your sample rules in my test setup (ModSecurity 3.0.8 with nginx 1.20.1) and it worked as expected.
The most notable thing in your debug log output is that ModSecurity has been told by nginx that it is a 'GET' request ( Target value: "GET" (Variable: REQUEST_METHOD) ).
One thing to check is your access log. Is the entry being included there with POST or GET?
One other possibility is that the request is arriving at nginx originally as a POST request but that it is getting changed into a GET request by nginx itself. This can happen, for example with nginx error-redirect configurations. It doesn't seem particularly likely to be your issue but it's probably worth checking your nginx config with this in mind.

Hi @martinhsv,
sorry - I confused some version infos

ModSecurity-nginx v1.0.3
libmodsecurity.so.3.0.8
nging 1.23.2

those are the version I use taken from logfile and the file system.
And you are completely right concerning the double quotes - this happend when I condensed my ruleset for the issue. So - to prevent any copy+paste errors I created a reduced set based on your notes
SecAction "phase:1,id:12345678,pass,setvar:TX.match=0,nolog"
SecRule REQUEST_FILENAME "^/public/get$" "phase:1,id:123456781,t:none,chain,nolog,setvar:TX.match=1,SkipAfter:mark_1"
SecRule REQUEST_METHOD "^GET$" "t:none,nolog"
SecRule REQUEST_FILENAME "^/public/post$" "phase:1,id:123456782,t:none,chain,nolog,setvar:TX.match=1,SkipAfter:mark_2"
SecRule REQUEST_METHOD "^POST$" "t:none,nolog"
SecMarker mark_1
SecMarker mark_2
SecRule TX:match 0 "phase:1,id:123456783,log,msg:'URI not matched',deny,status:403"

This happens when curling
$ curl -ivk https://<IP_ADDRESS>:8443/public/post
> GET /public/post HTTP/1.1
> Host: <IP_ADDRESS>:8443
> User-Agent: curl/7.88.1-DEV
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx/1.23.2
< Date: Wed, 01 Mar 2023 19:30:50 GMT
< Content-Type: application/octet-stream
< Content-Length: 32
< Connection: keep-alive
< Last-Modified: Tue, 28 Feb 2023 15:02:14 GMT

creating the follwing entries in the  nginx access log
2023/03/01 19:30:44 [notice] 1#1: ModSecurity-nginx v1.0.3 (rules loaded inline/local/remote: 0/25/0)
2023/03/01 19:30:44 [notice] 1#1: using the "epoll" event method
2023/03/01 19:30:44 [notice] 1#1: nginx/1.23.2
2023/03/01 19:30:44 [notice] 1#1: built by gcc 12.2.1 20220924 (Alpine 12.2.1_git20220924-r4)
2023/03/01 19:30:44 [notice] 1#1: OS: Linux 6.1.12-arch1-1
2023/03/01 19:30:44 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
2023/03/01 19:30:44 [notice] 1#1: start worker processes
2023/03/01 19:30:44 [notice] 1#1: start worker process 11
<IP_ADDRESS> - - [01/Mar/2023:19:30:50 +0000] "GET /public/post HTTP/1.1" 200 32 "-" "curl/7.88.1-DEV" "-"
2023/03/01 19:30:50 [info] 11#11: *1 client <IP_ADDRESS> closed keepalive connection
2023/03/01 19:32:29 [notice] 1#1: signal 28 (SIGWINCH) received
2023/03/01 19:32:29 [notice] 11#11: signal 28 (SIGWINCH) received
2023/03/01 19:32:29 [info] 11#11: epoll_wait() failed (4: Interrupted system call)
2023/03/01 19:32:29 [notice] 1#1: signal 28 (SIGWINCH) receive

The complete modsec_debug.log looks like this
..`3308] [] [4] Initializing transaction
..3308] [] [4] Transaction context created.
..3308] [] [4] Starting phase CONNECTION. (SecRules 0)
..3308] [] [9] This phase consists of 2 rule(s).
..3308] [] [4] Starting phase URI. (SecRules 0 + 1/2)
..3308] [/public/post] [4] Starting phase REQUEST_HEADERS.  (SecRules 1)
..3308] [/public/post] [9] This phase consists of 8 rule(s).
..3308] [/public/post] [4] (Rule: 200000) Executing operator "Rx" with param "^(?:application(?:/soap\+|/)|text/)xml" against REQUEST_HEADERS:Content-Type.
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] (Rule: 200001) Executing operator "Rx" with param "^application/json" against REQUEST_HEADERS:Content-Type.
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] (Rule: 12345678) Executing unconditional rule...
..3308] [/public/post] [4] Running [independent] (non-disruptive) action: setvar
..3308] [/public/post] [8] Saving variable: TX:match with value: 0
..3308] [/public/post] [9] Running action: nolog
..3308] [/public/post] [4] Running (disruptive)     action: pass.
..3308] [/public/post] [8] Running action pass
..3308] [/public/post] [4] (Rule: 123456781) Executing operator "Rx" with param "^/public/get$" against REQUEST_FILENAME.
..3308] [/public/post] [9] Target value: "/public/post" (Variable: REQUEST_FILENAME)
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] (Rule: 123456782) Executing operator "Rx" with param "^/public/post$" against REQUEST_FILENAME.
..3308] [/public/post] [9] Target value: "/public/post" (Variable: REQUEST_FILENAME)
..3308] [/public/post] [9] Matched vars updated.
..3308] [/public/post] [4] Running [independent] (non-disruptive) action: setvar
..3308] [/public/post] [8] Saving variable: TX:match with value: 1
..3308] [/public/post] [4] Rule returned 1.
..3308] [/public/post] [4] Executing chained rule.
..3308] [/public/post] [4] (Rule: 0) Executing operator "Rx" with param "^POST$" against REQUEST_METHOD.
..3308] [/public/post] [9] Target value: "GET" (Variable: REQUEST_METHOD)
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] (Rule: 123456783) Executing operator "Rx" with param "0" against TX:match.
..3308] [/public/post] [9] Target value: "1" (Variable: TX:match)
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] Starting phase REQUEST_BODY. (SecRules 2)
..3308] [/public/post] [9] This phase consists of 7 rule(s).
..3308] [/public/post] [4] (Rule: 200007) Executing operator "Ge" with param "1000" against ARGS.
..3308] [/public/post] [9] Target value: "0" (Variable: ARGS)
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] (Rule: 200002) Executing operator "Eq" with param "0" against REQBODY_ERROR.
..3308] [/public/post] [9] Target value: "0" (Variable: REQBODY_ERROR)
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] (Rule: 200003) Executing operator "Eq" with param "0" against MULTIPART_STRICT_ERROR.
..3308] [/public/post] [9] Target value: "" (Variable: MULTIPART_STRICT_ERROR)
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] (Rule: 200004) Executing operator "Eq" with param "1" against MULTIPART_UNMATCHED_BOUNDARY.
..3308] [/public/post] [9] Target value: "" (Variable: MULTIPART_UNMATCHED_BOUNDARY)
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] (Rule: 200005) Executing operator "StrEq" with param "0" against TX:regex(^MSC_).
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
..3308] [/public/post] [4] Starting phase RESPONSE_HEADERS. (SecRules 3)
..3308] [/public/post] [9] This phase consists of 2 rule(s).
..3308] [/public/post] [4] Not appending response body. Response Content-Type is application/octet-stream. It is not marked to be inspected.
..3308] [/public/post] [4] Not appending response body. Response Content-Type is application/octet-stream. It is not marked to be inspected.
..3308] [/public/post] [4] Starting phase RESPONSE_BODY. (SecRules 4)
..3308] [/public/post] [4] Response body is disabled, returning... 1
..3308] [/public/post] [4] Starting phase LOGGING. (SecRules 5)
..3308] [/public/post] [9] This phase consists of 2 rule(s).
..3308] [/public/post] [8] Checking if this request is suitable to be saved as an audit log.
..3308] [/public/post] [8] Checking if this request is relevant to be part of the audit logs.
..3308] [/public/post] [9] Return code `200' is not interesting to audit logs, relevant code(s): `^(?:5|4(?!04))'.

I don't understand why TX.match is not reset to 0 after the chained rule fails .
..3308] [/public/post] [4] Executing chained rule.
..3308] [/public/post] [4] (Rule: 0) Executing operator "Rx" with param "^POST$" against REQUEST_METHOD.
..3308] [/public/post] [9] Target value: "GET" (Variable: REQUEST_METHOD)
..3308] [/public/post] [4] Rule returned 0.
..3308] [/public/post] [9] Matched vars cleaned.
>>> should this clear TX.match?
..3308] [/public/post] [4] (Rule: 123456783) Executing operator "Rx" with param "0" against TX:match.
..3308] [/public/post] [9] Target value: "1" (Variable: TX:match)
>>> shouldn't TX.match be "0" here?

I just something similar to your sample rules in my test setup (ModSecurity 3.0.8 with nginx 1.20.1) and it worked as expected.
Would you mind to share the relevant rules you used to test verbatim?

Thanks for your time

Changing the rules to this
SecAction "phase:1,id:12345678,pass,setvar:TX.match=0,nolog"

SecRule REQUEST_FILENAME "^/public/get$" "phase:1,id:123456781,t:none,chain,nolog"
SecRule REQUEST_METHOD "^GET$" "t:none,nolog,setvar:TX.match=1,SkipAfter:mark_1"
SecRule REQUEST_FILENAME "^/public/post$" "phase:1,id:123456782,t:none,chain,nolog"
SecRule REQUEST_METHOD "^POST$" "t:none,nolog,setvar:TX.match=1,SkipAfter:mark_2"

SecMarker mark_1
SecMarker mark_2

SecRule TX:match "@eq 0" "phase:1,id:123456783,log,msg:'URI not on AllowList',deny,status:418"

makes everything work as wished - request are only accepted when the tupel REQUEST_FILENAME/REQUEST_METHOD is defined.
Thanks


Replace --dev flag with settings.DEBUG_JS.

We introduced a --dev flag to compile_frontend in 2bcb424, but this
flag should be coupled to the existing DEBUG_JS settings variable.
This patch reverts the --dev flag and uses DEBUG_JS in its place.
The --no-install flag is retained, since there isn't a corresponding
settings variable.
h/t @cmc333333 @tadgh-ohiggins @xtine

Easy peasy


Timeout when building source

2nd install here. When there are about 12-10 packages left to build, install wont go past that, giving the following error:
Warning: Problem : timeout...

1 dependency of derivation ... soundwire-3.0
same for
home-manager-path
home-manager-genera..
user-environment
etc
nixos-system-laptop

1 dependency of derivation ... soundwire-3.0
same for
home-manager-path
home-manager-genera..
user-environment
etc
nixos-system-laptop

after running nix log for source.drv
i got this:
webarchive:// georigielabs.net ://SoundWire_Server_linux64.tar.gz
failed to connect to web.archive.org pott 443... cannot download source from any mirrof.

This is strange... So the link to download the package is down so this is why you get a timeout. I removed the package in question from the config, you should be able to pull the changes and build now.
Thanks you notifying me about this, and let me know if it works now :+1:

Yup. Might need a new mirror for the soundwire :p

I was about to open an issue for it on the nixpkgs repo but it seems to work again. Maybe it was just a small downtime of the server. So I re-added it to the config and it doesn't seem to cause any issues.
Let me know if it is also fixed for you.

Works as of now. Closing issue. Thanks for your implication.


about pkl

photo_data = pickle.load(open('feature/photo-resnet50_64-265.pkl', 'rb'))
where do i get this file.I have installed the dataset and there is no file with extension .pkl .
as i am having issue " No such file or directory: 'feature/photo-resnet50_64-265.pkl' "

.pkl files are the extracted features of the testing dataset.
You need to get it through the trained model.
You can refer to feature_extract.py


feat: Add initial next.js web ui

:warning: Please install the  to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.92%. Comparing base (2594e73) to head (0a45d5d).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main       #4   +/-   ##
=======================================
  Coverage   94.92%   94.92%
=======================================
  Files          11       11
  Lines         276      276
=======================================
  Hits          262      262
  Misses         14       14

Flag
Coverage Δ

unittests
94.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


The table with name 'sylius.odiseo_vendor' already exists.

Hello,
When I try to override the model with the configuration like this:
sylius_resource:
    resources:
        odiseo_sylius_vendor_plugin.vendor:
            classes:
                model: App\Entity\Vendor\Vendor

use Odiseo\SyliusVendorPlugin\Entity\Vendor as BaseVendor;
use Doctrine\ORM\Mapping as ORM;

/**
 * Class Vendor
 *
 * @package App\Entity\Vendor
 * @ORM\Entity
 * @ORM\Table(name="odiseo_vendor")
 */
class Vendor extends BaseVendor
[...]

and when I try to update schema i got this error:
The table with name 'sylius.odiseo_vendor' already exists.
Can you help me ?
thank :)

Hi @lucassimonin. Have you tried adding the "mapped-superclass" annotation?

hi @bigboss86, I tried but it's doesn't works :/


Soft wrap for CJK

Fix: atom/atom#1783.
Summary

Use measureText(), so you can use proportional font.
Use Automattic/node-canvas instead of document.createElement("canvas").
But chromium can use document... maybe, so can remove node-canvas in Atom etc...
Specify font-size, font-family, and the base character.
Specs use 'Georgia', 'Courier New', and 'Noto Sans (with CJK)' fonts.
Selectable simple soft wrap or line breaking rule soft wrap with a proportional font.
Line breaking rule refer to wikipedia:Line breaking rules in East Asian languages.

Please fix me!

Need to add args new SoftWrapsTransform(...) in TextDisplayDocument with font-size and font-family.
Add Chinese and Korean texts to the specs.
Poor performance (-д-;

:+1: but nobody responds... This bug is so major to me but it seems Atom team don't think so.

I support you both!  I cannot use Atom unless this issue is resolved.

Hi there. Thanks for doing all this work and investigation. Apologies for the delayed response. We've been pretty focused on a few big things for 1.0 and have let things get backed up a bit. It looks like a lot of careful thought went into this.
Unfortunately, we've decided not to continue forward with text-document because it was too big of a change. Most of the work has been folded into Atom's existing editor implementation, which isn't as pretty but is also integrated and already working, which has its advantages. Probably should have stuck with iterating on that to begin with, but we needed to explore. We would however be very interested in integrating what you've learned on this repo in atom/atom itself.
It seems like this PR should really be broken into two different steps. First, we need to update our approach to character measurement in Atom in general, to be something much more along the lines of what you're implementing. As you can imagine, we don't want to just measure characters for the purposes of soft wrapping. We use these measurements for positioning the cursor and other elements of the UI, so we should integrate soft wrap with that.
In atom/atom#6803 there's been some progress on updating measurement, but so far we've found a canvas based approach to be too slow. I will write a better explanation of the situation in that PR if you're still interested in pushing this forward.
Once our measurement issues are fixed, the DisplayBuffer of the current implementation in atom/atom is where we'd need to apply this change. Just a warning: We have some pretty dramatic changes planned at some point for that layer to clean up the representation and make it more compact, but we should be able to coordinate with you.

@nathansobo Does it mean I can reopen https://github.com/atom/atom/pull/6425?

Yes. Sorry for the runaround. Appreciate your patience as we figure things out.

I'll comment on that PR when I get back to my computer.

I see. I'm waiting to be fixed in a better way.
(If none, I'll be troubled, because I have wrote that my soft-wrap package will be needed in Atom 1.0...(TдT))
I have a little skill, but I'll help you as much as possible.

@raccy Would there be any value in just soft-wrapping at N characters but actually counting those characters correctly? Do CJK characters vary in width so dramatically that this wouldn't be useful? Then we could apply a solution for variable-width soft wrap in a subsequent step.

@nathansobo When we use monospace font (MS ゴシック, Osaka, etc.), YES.
Almost Japanese programers write code with monospace font. Reason:

With some traditional multibyte encoding (Shift_JIS, EUC-JP), the string width equals the number of bytes that needed to represent it.
Japanese printed matter (news papers, books, etc.) use monospace font, so we are familiar it.

So my package (japanes-wrap) counts just x0/x1/x2 width of each characters, it is enough for me.
But, please note that some characters (Greek/Coptic and Cyrillic) are different width depending on the font.
Sorry I don't know well Chinese and Korean. Also please see and ask the same question in atom/atom#1738.

I've noticed that Visual Studio Code, which is based on Atom but uses a different editor, doesn't have this problem and has soft-wrap as expected. Hopefully they open-source it soon, so that their implementation could be understood.


Add Get-WebListenerUrl examples to WebListener App documentation

per https://github.com/PowerShell/PowerShell/pull/4905#pullrequestreview-65030961
Need to add Get-WebListenerUrl examples to the WebListener App REAMDME.md

Also need to update the user agents and correct the user agent listed for the /Delay/ test


instance variable '@current_thread' of Fiber must be Atomic(Thread | Nil), not Nil with -Ddebug_raise

test.cr
puts "foo"

Running this with the -Ddebug_raise flag produces:
crystal test.cr -Ddebug_raise
Showing last frame. Use --error-trace for full trace.

Error: instance variable '@current_thread' of Fiber must be Atomic(Thread | Nil), not Nil

Instance variable '@current_thread' was used before it was initialized in one of the 'initialize' methods, rendering it nilable

This feels like a semantic bug, but needs a reduced example. Full trace ends up at:
...
In src/crystal/thread_local_value.cr:7:17

 7 | th = Thread.current
                 ^------
Error: instantiating 'Thread.class#current()'

In src/crystal/system/unix/pthread.cr:62:3

 62 | {% if flag?(:android) || flag?(:openbsd) %}
      ^
Error: expanding macro

There was a problem expanding macro 'macro_4468702496'

Called macro defined in src/crystal/system/unix/pthread.cr:62:3

 62 | {% if flag?(:android) || flag?(:openbsd) %}

Which expanded to:

 >  1 |
 >  2 |     @[ThreadLocal]
 >  3 |     @@current : Thread?
 >  4 |
 >  5 |     # Returns the Thread object associated to the running system thread.
 >  6 |     def self.current : Thread
 >  7 |       # Thread#start sets @@current as soon it starts. Thus we know
 >  8 |       # that if @@current is not set then we are in the main thread
 >  9 |       @@current ||= new
 > 10 |     end
 > 11 |
 > 12 |     # Associates the Thread object to the running system thread.
 > 13 |     protected def self.current=(@@current : Thread) : Thread
 > 14 |     end
 > 15 |
Error: instantiating 'new()'

In src/crystal/system/unix/pthread.cr:42:25

 42 | @main_fiber = Fiber.new(stack_address, self)
                          ^--
Error: instantiating 'Fiber.class#new(Pointer(Void), Thread)'

Error: instance variable '@current_thread' of Fiber must be Atomic(Thread | Nil), not Nil

Instance variable '@current_thread' was used before it was initialized in one of the 'initialize' methods, rendering it nilable

  src/fiber.cr:124

        @current_thread.set(thread)

Triggered by raise referencing STDERR  through inspect_with_backtrace if the flag is set, as far as I understand it.

Maybe this should use Crystal::System.print_error to be safe?


Rename field names

Check all our generated field names and update them for RC3. For example resource to related etc...

this will also solve #71

also to keep in ind the field ids for relationships does not exist any longer and every relationship has it's own entry now in a to-many
 "data": [
  { "type": "articles", "id": "1" },
  { "type": "articles", "id": "2" }
]


Azure Event Hubs binder url fixed on docs

Fixed broken links for Azure Event Hubs Binder.

@fernandoBRS Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@fernandoBRS Thank you for signing the Contributor License Agreement!

It seems this fix is not available on https://spring.io/projects/spring-cloud-stream yet. In general, when will the fix be synced to the spring.io? Thank you.


all keys should be set on the NXP NTAG 424 DNA card

the bolt card extension readme states "For this extension only two keys need to be set" and "Card Auth key (K0) can be omitted" however this is not compliant with the recommendations by the chip manufacturer NXP
NTAG 424 DNA – Secure NFC T4T compliant IC
<IP_ADDRESS> AppKey

Remark: It is highly recommended to change all 5 keys at personalization,
even if not all keys are used in the application.

this is fixed in
https://github.com/lnbits/lnbits/pull/1005/files#diff-c50047d4b10cf734a8f32f2f3fff7194fe093b26beefdb71f07b382b2b9e8aa9


Added Computer Networking Resources.

Otherwise looks great

Yes, I have updated the name ...please check.


edd25519 dev seed for //Alice Sliceproduces wrong address

I have a very simple unit test here because I want to use Alice in some dev setups:
    test('test alice works', () async {
      final pair = await KeyPair.fromMnemonic('//Alice');

      expect(
        pair.address,
        '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY',
      );
    });

However, the test fails. Is there anything I am missing?

Expected: '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY'
  Actual: '5FA9nQDVg267DEd8m1ZypXLBnvN7SFxYwV7ndqSYGiN9TTpu'
   Which: is different.
          Expected: 5GrwvaEF5zX ...
            Actual: 5FA9nQDVg26 ...
                     ^
           Differ at offset 1

The expected addresss is definitely correct:
subkey inspect //Alice                                                                               ok | 16:35:57
Secret Key URI `//Alice` is account:
  Secret seed:       0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a
  Public key (hex):  0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
  Public key (SS58): 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
  Account ID:        0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
  SS58 Address:      5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY

Minimal test example, which is failing: https://github.com/encointer/encointer-wallet-flutter/blob/bcf4bfc6ad77f98272910b9389b24de9993ee690/packages/ew_keyring/test/keyring_test.dart#L27

Hi @clangenb, the key derivation is correct, the issue is  the keytype, you want a sr25519 keypair, while polkadart currently only supports ed25519 keys, you can use subkey for testing:
$ subkey inspect --scheme=Ed25519 "//Alice"
Debug URI: "//Alice"
Debug URI: "//Alice"
from_phrase: "//Alice"
from_phrase: "bottom drive obey lake curtain smoke basket hold race lonely fit walk"
mnemonic: "bottom drive obey lake curtain smoke basket hold race lonely fit walk"
Pair::from_string_with_seed
Secret Key URI `//Alice` is account:
  Network ID:        substrate
 Secret seed:       0xabf8e5bdbe30c65656c0a3cbd181ff8a56294a69dfedd27982aace4a76909115
  Public key (hex):  0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee
  Account ID:        0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee
  Public key (SS58): 5FA9nQDVg267DEd8m1ZypXLBnvN7SFxYwV7ndqSYGiN9TTpu
  SS58 Address:      5FA9nQDVg267DEd8m1ZypXLBnvN7SFxYwV7ndqSYGiN9TTpu

But the key type you want is SR25519:
$ subkey inspect --scheme=Sr25519 "//Alice"
Debug URI: "//Alice"
Debug URI: "//Alice"
from_phrase: "//Alice"
from_phrase: "bottom drive obey lake curtain smoke basket hold race lonely fit walk"
mnemonic: "bottom drive obey lake curtain smoke basket hold race lonely fit walk"
Pair::from_string_with_seed
Secret Key URI `//Alice` is account:
  Network ID:        substrate
 Secret seed:       0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a
  Public key (hex):  0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
  Account ID:        0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
  Public key (SS58): 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
  SS58 Address:      5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY

The reason why we don't support Sr25519 yet is because it depends on this library, which doesn't exists an equivalent in Dart yet:
https://github.com/w3f/schnorrkel
Contributions are welcome!

@clangenb
Implementation of sr25519 is under progress: https://github.com/leonardocustodio/polkadart/tree/justkawal/schnorrkel

Alright, stupid me, shoud known that. Thanks for the quick response!


Pub type

Add a pub $typename syntax to the macro to set the generated enum's visibility to public.
I use the type in several modules, so I prefer to declare it only once as public and use it afterwards. Not sure if it makes sense (or if splitting the macro like I did is the right way to do it).

I think it's sensible to allow people to make the type pub. Your approach seems good to me, but I'm still new to macros.

This, along with #7, has been released in 0.2.0.


[AutoRelease] t2-storagemover-2023-09-28-93342(can only be merged by SDK owner)

https://github.com/Azure/sdk-release-request/issues/4587
Live test success
https://dev.azure.com/azure-sdk/internal/_build?definitionId=5935

issue link:https://github.com/Azure/sdk-release-request/issues/4587


wal: fix the unexpectedEOF error in the last wal.

It is safe to repair the unexpectedEOF error in the last wal. raft
will not send out message before the entry successfully committed
into wal. Thus we can safely truncate the last entry in the wal
to repair.

@yichengq fixed. please try again. :)

lgtm


Coredns getting preempted by other pods even though they are set to preempt never

Environmental Info:
K3s Version: k3s version v1.18.10+k3s1 (6fa97306)

Node(s) CPU architecture, OS, and Version: Linux k3s-node1 5.4.51-v7+ rancher/k3s#1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux

Cluster Configuration: single raspberry pi 3B

Describe the bug: when starting too many pods for the node to handle, k3s terminates the coredns pod(s) in favour of the pod I attempt to start even though the new pod's preemption policy in the policy class it belongs to is set to "never".

**Steps To Reproduce:**1. k3s is installed using the Ansible playbook.
2. Set the following extra_server_args in order to reserve resources on the node:
--disable traefik --kubelet-arg system-reserved=cpu=100m,memory=100Mi --kubelet-arg kube-reserved=cpu=200m,memory=400Mi

Priorityclass with following information is created:

apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
  name: high-priority-nonpreempting
value: 900000
preemptionPolicy: Never
globalDefault: false
description: "High priority but will not kill other pods"

Create enough pods with this priorityclass that the node can't start them all.
 It should surely have a higher priority than "0".

Actual behavior: coredns gets preempted and terminated.

Additional context / logs:
Output of describe pod coredns[xxx]
Name:           coredns-7944c66d8d-t9lvb
Namespace:      kube-system
Priority:       0
Node:           <none>
Labels:         k8s-app=kube-dns
                pod-template-hash=7944c66d8d
Annotations:    <none>
Status:         Pending
IP:
IPs:            <none>
Controlled By:  ReplicaSet/coredns-7944c66d8d
Containers:
  coredns:
    Image:       rancher/coredns-coredns:1.6.9
    Ports:       53/UDP, 53/TCP, 9153/TCP
    Host Ports:  0/UDP, 0/TCP, 0/TCP
    Args:
      -conf
      /etc/coredns/Corefile
    Limits:
      memory:  170Mi
    Requests:
      cpu:        100m
      memory:     70Mi
    Liveness:     http-get http://:8080/health delay=60s timeout=5s period=10s #success=1 #failure=5
    Readiness:    http-get http://:8181/ready delay=10s timeout=5s period=10s #success=1 #failure=5
    Environment:  <none>
    Mounts:
      /etc/coredns from config-volume (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from coredns-token-97v4g (ro)
Conditions:
  Type           Status
  PodScheduled   False
Volumes:
  config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      coredns
    Optional:  false
  coredns-token-97v4g:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  coredns-token-97v4g
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  beta.kubernetes.io/os=linux
Tolerations:     CriticalAddonsOnly
                 node-role.kubernetes.io/master:NoSchedule
                 node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age    From               Message
  ----     ------            ----   ----               -------
  Warning  FailedScheduling  2m37s  default-scheduler  0/1 nodes are available: 1 Insufficient memory.
  Warning  FailedScheduling  2m36s  default-scheduler  0/1 nodes are available: 1 Insufficient memory.

Output of kubectl get pods --all-namespaces -o custom-columns=NAME:.metadata.name,PRIORITY:.spec.priorityClassName:
local-path-provisioner-6d59f47c7-mssbn    <none>
coredns-7944c66d8d-t9lvb                  <none>
sonarr-deployment-55f9df6b5-qdnwz         high-priority-nonpreempting

Shows that coredns and other default pods have no priorityclass name

Yes, we should probably be setting priorityClassName for the packaged components.

Just a few questions because I'm actually an absolute noob at this.

Does it look like I've done everything as intended? I haven't screwed up anything?

Do those extra_server_args look ok? I'm hoping they haven't impacted it negatively.

Do these core components count as an element of the kube-reserved or are they considered regular pods? I tried increasing the kube-reserved in case that allowed it to save more memory but it seemed to make no charge.

I'm super curious to know if anyone can replicate this because I'm surprised it's never come up before this far into use.

@brandond Should I pick this up? Does this include only modifying yaml files for core components?

This would be a great contribution. You should only need to modify the things in https://github.com/rancher/k3s/tree/master/manifests although  traefik may be a bit more difficult to modify since it comes from a helm chart, and you'll need to dig through the chart values stuff to figure out how to set it assuming it is possible at all on the version of the chart we're bundling.

@brandond great.

@brandond I have added pull request for same https://github.com/rancher/k3s/pull/2555

@brandond messed up commits in previous pull request, have closed that and created new one with your suggested changes. https://github.com/rancher/k3s/pull/2558
Let me know if i need to make further changes.

Could this one be in 1.20? People using priority classes for their pods could have the core services like coredns being preempted.

@brandond can we get this in RKE2 as well?

@davidnuzik yeah I can work on a PR for rancher/rke2-charts

Validated using commit k3s version v1.20.0+k3s-c5aad1b5
Reproduced the issue setting testpods with highPriority class
kube-system   76s         Normal    Preempted                 pod/coredns-7944c66d8d-j5bhr                  Preempted by default/nginx-deployment-bf7dcdf5b-tk2mh on node ip-172-31-18-80

Validated the fix, system pods were not evicted and testpods FailedScheduling as expected.
kubectl get pods -A
NAMESPACE     NAME                                      READY   STATUS    RESTARTS   AGE
kube-system   metrics-server-86cbb8457f-75jxs           1/1     Running   0          12m
kube-system   local-path-provisioner-7c458769fb-pkc7x   1/1     Running   0          12m
kube-system   coredns-7dc8bdd58c-8znlv                  1/1     Running   0          12m

default       3m28s       Warning   FailedScheduling          pod/nginx-deployment-758b5c67b5-blsz4          0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/disk-pressure: }, that the pod didn't tolerate.

Closing this issue as validated and open a new one  for validating fix on rke2.


Guidance for resolving ambiguous DateTimes does not account for BaseUtcOffsetDelta

In several places in the guidance for resolving ambiguous DateTime values (both in this doc and this doc), the example code uses the BaseUtcOffset property of the time zone to determine the offset for standard time.  This unfortunately is a bug, because it does not take into account any BaseUtcOffsetDelta that may apply.
More about BaseUtcOffsetDelta in the blog post here:
https://devblogs.microsoft.com/dotnet/date-time-and-time-zone-enhancements-in-net-6/#timezoneinfo-adjustmentrule-improvements
Both GetUtcOffset and GetAmbiguousTimeOffsets will take BaseUtcOffset and BaseUtcOffsetDelta into account - the problem is only when using BaseUtcOffset by itself, because that assumes the BaseUtcOffsetDelta is zero.
Also - A much better way to resolve ambiguous and invalid DateTime values is to account for both with respect to a given time zone and resolve to a DateTimeOffset.  I've used this approach for some time now with the following extension method on several StackOverflow answers (such as this one) and in real apps.  Feel free to use it in revised guidance:
public static DateTimeOffset ToDateTimeOffset(this DateTime dt, TimeZoneInfo tz)
{
    if (dt.Kind != DateTimeKind.Unspecified)
    {
        // Handle UTC or Local kinds (regular and hidden 4th kind)
        DateTimeOffset dto = new DateTimeOffset(dt.ToUniversalTime(), TimeSpan.Zero);
        return TimeZoneInfo.ConvertTime(dto, tz);
    }

    if (tz.IsAmbiguousTime(dt))
    {
        // Prefer the daylight offset, because it comes first sequentially (1:30 ET becomes 1:30 EDT)
        TimeSpan[] offsets = tz.GetAmbiguousTimeOffsets(dt);
        TimeSpan offset = offsets[0] > offsets[1] ? offsets[0] : offsets[1];
        return new DateTimeOffset(dt, offset);
    }

    if (tz.IsInvalidTime(dt))
    {
        // Advance by the gap, and return with the daylight offset  (2:30 ET becomes 3:30 EDT)
        TimeSpan[] offsets = { tz.GetUtcOffset(dt.AddDays(-1)), tz.GetUtcOffset(dt.AddDays(1)) };
        TimeSpan gap = offsets[1] - offsets[0];
        return new DateTimeOffset(dt.Add(gap), offsets[1]);
    }

    // Simple case
    return new DateTimeOffset(dt, tz.GetUtcOffset(dt));
}

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

ID: 0b8b01b8-3227-55ec-1ec4-5c6a6a9b5603
Version Independent ID: 1547c1eb-3c9f-fc0a-7e00-3163bfdb1438
Content: How to: Let users resolve ambiguous times
Content Source: docs/standard/datetime/let-users-resolve-ambiguous-times.md
Product: dotnet-fundamentals
GitHub Login: @adegeo
Microsoft Alias: adegeo

Thank you for pointing this out.
@tarekgh do you have any thoughts on this?

I'm also going to open an API proposal for this extension method, as I believe it should be built-in.

I'm also going to open an API proposal for this extension method, as I believe it should be built-in.

I think that's the https://github.com/dotnet/runtime repo

Yes, but the docs should be updated in the meantime so users don't introduce bugs.  I can send a PR if you agree.

We love PRs :) but @tarekgh should review, they're the subject matter expert.

@mattjohnsonpint what exactly the issue you are trying to help with here? Is it to give the choice for users to decide which time to get when having ambiguous time? and ensure getting some results when having invalid time?

For these doc pages, the main issue is that the example code incorrectly uses BaseUtcOffset without accounting for BaseUtcOffsetDelta.
DateTime utcTime = DateTime.SpecifyKind(ambiguousTime - TimeZoneInfo.Local.BaseUtcOffset, DateTimeKind.Utc);

That is the bug in the example.  The standard offset is the one that is the lesser of the two ambiguous offsets - but it is not always going to match BaseUtcOffset.
I'll open a separate issue in the runtime repo for the API proposal.

It also shows TimeZoneInfo.Local there, which may or may not be applicable.

The other page shows a similar bug, but only in the VB sample.
If offsets(ctr).Equals(TimeZoneInfo.Local.BaseUtcOffset) Then
    zoneDescription = TimeZoneInfo.Local.StandardName
Else
    zoneDescription = TimeZoneInfo.Local.DaylightName
End If

Again, there's no guarantee the BaseUtcOffset is the standard offset, because BaseUtcOffsetDelta may modify it.

Ok, thanks @mattjohnsonpint. submit the pr and I'll be happy to look at it.


Add defaultValueBinding option to ColorInputView

Allow passing a function to dynamically determine default value based
on a binding attribute.

Coverage remained the same at 99.364% when pulling c1fa23727f8005d0215d69a69481ad15772bfe70 on tf:color-input-default-value-binding into c8a72ace12bd34cdb0829d869d0ce6746cc809ca on codevise:master.


Transpiling in the Reverse Direction

I am curious how much effort it would be to also allow JS to be converted to the Python equivalent code so that we can derive codebases from already existing JS projects.
Do you see that as a possible goal of the project ?

I don't expect functionality like that to be added to the project.
The reason is that JavaScript prototype based objects allow a number of tricks (dirty tricks from a Python point of view) that are out of limits in class based object orientation.
The situation is comparable to trying to translate a language featuring the infamous GOTO statement (like MSBasic) to a structured language (like Modula2). This is almost impossible, since every application would become a Finitite State Machine in a big while loop.
To be a bit more exact:  Translating JavaScript to Python is technically possible, and there are some tools attempting this for a limited subset, but it's bound to result in Python code that would make the original JavaScript seem well structured in comparison. In addition going back from Python to JavaScript again would result in a regular mess (though functionally equivalent).
The best way for JS libs to be, in my view, is in JS. JS isn't principally evil, something like JQuery is a testimony to highly intelligent (albeit somewhat deviant) thinking. In my opinion we should embrace the beauty and sometimes genius of good JavaScript libs, even if they're based on a programming paradigm that I personally don't like. Transcrypt was born because, like you, I perceive programming in Python as "fun" wereas programming in JavaScript for me is "a chore", no fun at all. And I think Python fosters good programming habits and makes large code bases more stable, flexible and comprehensible.
One thing that can be done with good JS libs, is to encapsulate them in a Python/Transcrypt wrapper. This isn't always worthwhile, but can be a remedy to avoid constantly using JS'esque idiom like __new__. (see e.g. http://www.transcrypt.org/docs/html/special_facilities.html#creating-javascript-objects-with-new-constructor-call).


cleanup: fix and run all-types cleanup

at this point, we might as well just save this until we're "done"


Other way to unlock joints than from desk

Is it possible to unlock joints programmatically?

Same question

Hi, I got this ,but I haven't try it yet
https://github.com/ib101/DVK/blob/master/Code/DVK.py

Hi, I got this ,but I haven't try it yet
https://github.com/ib101/DVK/blob/master/Code/DVK.py

Hey, I have tried this code (unmodified) and it worked! Using Python 3.6, Ubuntu 18.04.

My solution to this
https://github.com/jk-ethz/franka-lock-unlock

Hi all,
while not providing an official way of locking/unlocking joints, there seems to be workarounds... :)
Cheers,
Andreas
P.S. If you have further input, please open another issue.


Add hasDuplicates method

closes #57

@Atul9 Hey Atul, I like your short and concise implementation! Sweet!

thank you @marcuspoehls


Add optionally automatic HTTP component parsing

Parse cookies into a request environment variable (similar to PHP's $_COOKIE but without the magic).

Parse multipart/form-data request entity bodies into user-friendly arrays similar to the PHP web SAPI's $_POST and $_FILES superglobals.

We have cookie parsing, multipart form data is asked for in #43.


relativeCSSInjection: true will not inject css code

check here: https://github.com/tjx666/vite-plugin-css-injected-by-js-issue/tree/947eff9f8707b606a8873d571c0dc914cb600183

Versions:
System:
    OS: macOS 13.2
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 1.15 GB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.14.0 - ~/Library/Caches/fnm_multishells/6278_1675997414513/bin/node
    Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/6278_1675997414513/bin/yarn
    npm: 9.4.2 - ~/Library/Caches/fnm_multishells/6278_1675997414513/bin/npm
  npmPackages:
    @vitejs/plugin-vue: ^4.0.0 => 4.0.0
    @vitejs/plugin-vue2: ^2.2.0 => 2.2.0
    @vitejs/plugin-vue2-jsx: ^1.1.0 => 1.1.0
    vite: ^4.0.4 => 4.0.4
    vite-plugin-css-injected-by-js: ^3.0.0 => 3.0.0
    vite-plugin-vue-type-imports: ^0.2.4 => 0.2.4

Thank you for the issue, but why import CSS that isn't actually used?
In the event that it is used, Vite will already take care of it, as in the following case:
import styles from './a.less';

console.log(123, styles.app);

The output of the build will be:
"use strict";
const styles = ".app {\n  color: red;\n}\n";
console.log(123, styles.app);

I can't understand the need, can you explain the reason and what is the purpose?
Since the building process doesn't give information about the imported CSS by the JS file, we can't inject the CSS into its importer. Maybe I can help you better if you explain to me what you expect

When css file is imported, it had been used.
css file born with effect.

When css file is imported, it had been used.
css file born with effect.

Yes you are right, but the usage was not clear to me since I always use classes directly. But I figured out this need, so I'm fixing it, thanks!

import css directly is a very normal use case, for example, import the css variables, like my company project:

Of course, I was referring to the act of having split entry points. anyway don't worry, tomorrow release with the fix 😜

@tjx666 fixed in 3.0.1
Unfortunately, it's a period where I'm busy, so if you want to help fix possible problems it's welcome ;)

Seems latest version 3.0.1 relativeCSSInjection: true option doesn't work.


C# optimized: remove string split and lowercase

Instead of using String.Split(), we manually loop and substring the correct part of the line.
Also we use StringComparer.OrdinalIgnoreCase as the Dictionary comparer, so we don't have to .ToLower() for each word.
We still call ToLower() at the end so the results are output correctly.
I also used the top-level-function syntax (wihout class Program and public static void Main), since it's a very small program.
Optimized version is usually ~20% faster.
BEFORE:

Language
Simple
Optimized
Notes

Go
1.05
0.37

C#
1.36
1.08
by John Taylor and Yuriy Ostapenko

Python
1.83
1.13

JavaScript
2.18
1.27
by Dani Biro

AFTER:

Language
Simple
Optimized
Notes

Go
1.05
0.37

C#
1.44
0.87
by John Taylor and Yuriy Ostapenko

Python
1.99
1.19

JavaScript
2.21
1.40
by Dani Biro

Not sure if it will make a big difference, but reading ASCII and changing ToLower() to ToLowerInvariant() may save a few extra ticks here and there.

Not sure if it will make a big difference, but reading ASCII and changing ToLower() to ToLowerInvariant() may save a few extra ticks here and there.

Tried ASCII and ToLowerInvariant() with no observable difference.
Decided to stick with UTF8 (maybe more correct, not sure).
And I used ToLower(), because of the usage of StringComparer.OrdinalIgnoreCase in the dictionary - so they both match.
StringComparer.InvariantCultureIgnoreCase tanks performance pretty bad for some reason.
But if you come to some other conslusions I'd be glad to change stuff. :)

Thanks for the contribution. It is faster for me too, and looks like a reasonable change. I'll update the results in the article later today.


Dirty option for clickable

Is your feature request related to a problem? Please describe.
There are times you don't want or need to recompile C++ parts and the dirty option in clickable can be helpful in this cases.

Describe alternatives you've considered
Just build C++ parts all the time 😄

I agree with @kugiigi request, but not only in regard to the dirty option, I would extend his request to all the extensions clickable gives the chance to exploit: for instance I'd also need a ssh specifcation with my custom IP address and also a  build-libs command to compile libraries prior to compile the app itself. What do you think to provide a text file in the Seabass2 app folder, where we might write down the custom command that the Seabass2 embedded build button would read from? That would give a great flexibility. I just started to use this app since a week now but the more I use it, the more I like it. For sure I'll provide soon a bounty to @milikhin ;)


Unsure if the sample code would work if the Cosmos DB account has a "Read-only" management lock

To get the access keys, the sample code makes a listKeys API request:
            // AzureServiceTokenProvider will help us to get the Service Managed token.
            var azureServiceTokenProvider = new AzureServiceTokenProvider();

            // Authenticate to the Azure Resource Manager to get the Service Managed token.
            string accessToken = await azureServiceTokenProvider.GetAccessTokenAsync("https://management.azure.com/");

            // Setup the List Keys API to get the Azure Cosmos DB keys.
            string endpoint = $"https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys?api-version=2019-12-12";

            // Setup an HTTP Client and add the access token.
            HttpClient httpClient = new HttpClient();
            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);

            // Post to the endpoint to get the keys result.
            var result = await httpClient.PostAsync(endpoint, new StringContent(""));

Assuming everything is set up properly, the above code would work well.
However I am not sure if this code would work if the Cosmos DB account has a "Read-only" management lock. Based on my understanding of management locks, a "POST" operation (like listKeys) is not allowed if a resource has a "Read-only" lock.
Is my understanding correct? If that's the case, then what's the workaround if I want to make use of managed identities (recommended approach)? Or should Key Vault be used because certificate-based solution will also not work?
Thanks

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

ID: 9dc95f42-25e6-42ba-a3d9-94ed896d7383
Version Independent ID: 00936b2f-959b-b55f-60d3-deaa7bea6e17
Content: How to use a system-assigned managed identity to access Azure Cosmos DB data
Content Source: articles/cosmos-db/managed-identity-based-authentication.md
Service: cosmos-db
Sub-service: cosmosdb-sql
GitHub Login: @j-patrick
Microsoft Alias: justipat

@gmantri Thank you for the feedback. We are actively investigating and will get back to you soon.

@gmantri As rightly pointed out by you, if we have read-only locks on Azure Cosmos DB account, listKeys would not work because its POST or write operation. I tried same by using the Azure CLI and below is the error message I received:

For other part of your query, you can refer to below article for more details:
https://azure.microsoft.com/en-in/blog/azure-cosmos-db-and-multi-tenant-systems/

Thanks @AnuragSharma-MSFT for looking into this. It is very much appreciated.
Considering Microsoft is recommending this approach over other approaches, may I request you to include this particular scenario as a caveat in the documentation as this approach would fail if the account has a "read-only" management lock (a practice followed by many organizations to safeguard their account).
I think we should update the documentation and clearly point out this restriction.
Thanks

@gmantri Thanks for replying back.
Actually locks are something not just specific to Azure Cosmos DB but at the Azure services , hence it is not precisely added to the Azure Cosmos documentation.
If we go through the article, it mentions "Applying locks can lead to unexpected results because some operations that don't seem to modify the resource actually require actions that are blocked by the lock. Locks will prevent any operations that require a POST request to the Azure Resource Manager API."
Same document also mentions an example of keys. Please let us know if this information helps.

Actually locks are something not just specific to Azure Cosmos DB but at the Azure services , hence it is not precisely added to the Azure Cosmos documentation.

While I agree with the comment above, it does impact me as a Cosmos DB user. IMHO it should be laid out clearly before I decide to go down managed identity approach.
Only issue I see with this is that the documentation you referenced is part of management locks documentation and not referenced in the page. As a Cosmos DB user, I may not even visit this page.

@gmantri I understand your concerns and really value your inputs. Let me add the author of this documentation.
@j-patrick Could you please look into the request and provide your inputs on the same?

Please assign to @ThomasWeiss

Please #reassign @ThomasWeiss

Addressed in this PR

See Thomas's comment
#please-close

@AnuragSharma-MSFT auto close bot isn’t working, can you manually close this issue.


remove HierarchyNotRespected validation error

Description of changes
As suggested in #638, removes the HierarchyNotRespected validation error (well, except from the public error enum, where we leave it to avoid a breaking change, but adjust documentation to indicate it is never returned).  This simplifies the typechecker code considerably.
I'm a little unclear from the discussion on #638 whether the Lean model needs any corresponding changes or not.
Issue #, if available
Fixes #638
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):

[x] A bug fix or other functionality change requiring a patch to cedar-policy.

I confirm that this PR (choose one, and delete the other options):

[x] Updates the "Unreleased" section of the CHANGELOG with a description of my change (required for major/minor version bumps).

I confirm that cedar-spec (choose one, and delete the other options):

Not sure about changes to the Lean model, see above

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):

[x] Does not require updates because my change does not impact the Cedar language specification.

It might be returning Bool when the lean impl gives a more precise False type.

I looked at this Rust code some, and I think/hope that the logic I removed was already performed in type_of_var_in_entity_literals() and friends.  The logic I removed only ever results in HierarchyNotRespected or success(type_of_in); it never returns False when type_of_in wasn't already False.  So removing this logic shouldn't stop us from returning False in any situation where we were already returning False before this PR.

It might be returning Bool when the lean impl gives a more precise False type.

I looked at this Rust code some, and I think/hope that the logic I removed was already performed in type_of_var_in_entity_literals() and friends. The logic I removed only ever results in HierarchyNotRespected or success(type_of_in); it never returns False when type_of_in wasn't already False. So removing this logic shouldn't stop us from returning False in any situation where we were already returning False before this PR.

IIUC, the DRT currently passes if Rust returns an errors when lean doesn't. So, if rust has stopped returning errors here, there could be a precision difference in the non-error response.

Corpus tests are failing in CI, probably because there are edge cases where this PR changes the validation behavior from fail -> pass (as noted in the changelog entry).  Adjusting the corpus test expectation will have to be a different PR against cedar-integration-tests


Improve Readme documentation

Context
The readme documentation could be more generic for reusability.

Hey I wanna contribute to your project. Can you assign this to me?


feat(Market UI): Add marketplace UI pending implementation

What this PR does 📖

The images used in this PR are just placeholders and the final images and available content will probably change.

wow very cool!


added nearest neighbor algorithm - machine-learning

Two functions nearest_neighbor(x, tSet) and a (eulidean) distance function distance(x,y).
I used the numpy library.
Two trainings sets for the logical AND-function and for color-analysing (dark/light color).

[X] If creating a new file :

[X] added links to it in the README files ?
[ ] included tests with it ?
[X] In the file are test cases for writing tests.
[ ] added description (overview of algorithm, time and space compleixty, and possible edge case) in docstrings ?

[ ] if done some changes :

[ ] wrote short description in the PR explaining what the changes do ?
[ ] Fixes #[issue number] if related to any issue

[] other

Pull Request Test Coverage Report for Build 688

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 71.339%

Totals

Change from base Build 685:
0.0%

Covered Lines:
3853

Relevant Lines:
5401

💛  - Coveralls

@keon Done.

@keon @goswami-rahul @danghai  @SaadBenn
Usage of the module numpy?
This module it wide use in machine learning in python.
I can implement the the parts (above) by myself, too.

@christianbender
It is nice to implement both :). The one is how to use the API from library, and another one is how to write them.

@christianbender @keon @danghai
IMHO, a user who wants to install algorithms for some specific algorithms, say arrays or dp or strings, etc. He might not want to install numpy or pandas or any other high level libraries for his requirements.
Moreover, I think this repo's objective is to provide minimal implementations of the algorithms. These algorithms are not very difficult to implement using built-in Python libraries, even if it would be less efficient. I guess we should be going with Simplicity over Efficiency, but it is just a matter of opinion :) The collections of super efficient and optimized algorithms are already available and are constantly being updated, but ours could be the simplest, understandable and minimal collection in Python from scratch!
Just my two cents. Cheers :)
Please share your thoughts on this.

@goswami-rahul

IMHO, a user who wants to install algorithms for some specific algorithms, say arrays or dp or strings, etc. He might not want to install numpy or pandas or any other high level libraries for his requirements.

Good point! :+1:
@goswami-rahul @danghai @keon
I will change my code again.

@danghai @goswami-rahul @keon
Done. I removed numpy

@christianbender Could you recheck the travis? It is fail in python3.4 and 3.6

@christianbender click Details at Travis test below. It directly goes : https://travis-ci.org/keon/algorithms/builds/409541731?utm_source=github_status&utm_medium=notification

@christianbender I fix this issue for you. Look my above commit.

@danghai Thanks a lot.

@danghai I merge it.


[gestures] Tap gesture not properly recognized on Raspberry Pi

Issue description
Using 'core_input_gestures' I see an issue where only HOLD, DRAG, PINCH IN and PINCH OUT are recognised.
I have had a look at the code, starting with why TAP is not recognised as I'm guessing if this started working the rest would!
So with the help of some debug logging:
[0xf78cf040] is the main thread, [0xf0155440] is the event handling thread :
'UpdateGestures()' is called via 'EndDrawing()' -> 'PollInputEvents()' every frame.
I am logging the current gesture at the start of the main loop.
DEBUG: [0xf78cf040] Start Main Loop Gesture = 0
DEBUG: [0xf78cf040] UpdateGestures()

DEBUG: [0xf78cf040] Start Main Loop Gesture = 0
DEBUG: [0xf78cf040] UpdateGestures()

DEBUG: [0xf78cf040] Start Main Loop Gesture = 0
DEBUG: [0xf78cf040] UpdateGestures()

DEBUG: [0xf78cf040] Start Main Loop Gesture = 0
DEBUG: [0xf0155440] processGestureEvent() current = 1
DEBUG: [0xf0155440] processGestureEvent() current = 1
DEBUG: [0xf0155440] processGestureEvent() current = 1
DEBUG: [0xf0155440] processGestureEvent() current = 1
DEBUG: [0xf78cf040] UpdateGestures()

DEBUG: [0xf78cf040] Start Main Loop Gesture = 4
DEBUG: [0xf78cf040] UpdateGestures()

If we look at the code for 'UpdateGestures()' we can see the first thing it does is change the TAP (1) to HOLD (4)
void UpdateGestures(void)
{
    // NOTE: Gestures are processed through system callbacks on touch events
    TraceLog(LOG_DEBUG, "[%p] UpdateGestures()", pthread_self());
    // Detect GESTURE_HOLD
    if (((GESTURES.current == GESTURE_TAP) || (GESTURES.current == GESTURE_DOUBLETAP)) && (GESTURES.Touch.pointCount < 2))
    {
        GESTURES.current = GESTURE_HOLD;
        GESTURES.Hold.timeDuration = rgGetCurrentTime();
    }

    // Detect GESTURE_NONE
    if ((GESTURES.current == GESTURE_SWIPE_RIGHT) || (GESTURES.current == GESTURE_SWIPE_UP) || (GESTURES.current == GESTURE_SWIPE_LEFT) || (GESTURES.current == GESTURE_SWIPE_DOWN))
    {
        GESTURES.current = GESTURE_NONE;
    }
}

So I'm guessing this probably once worked and something may have changed?
There is no synchronisation between the threads so I guess its fairly random what might happen but this seems to be the issue I am seeing all the time.
Anyone any ideas?
Cheers
Andy

@ubkp were you working on gestures lately? or was somebody else?

@raysan5 I was back in july, but was mostly fixing gestures for PLATFORM_WEB and PLATFORM_DESKTOP:

#3151
#3153
#3155
#3163
#3183
#3190

I don't think I reviewed it for PLATFORM_RPI or PLATFORM_DRM. I did fix mouse wheel for PLATFORM_RPI and PLATFORM_DRM (#3193) tho, but that's unrelated.
If you don't mind keeping this open for a few days, I can review it after the split.

This will also be a lot easier/faster to fix after the split. And less prone to break web and desktop too.

@ubkp Agree. OK, no problem, no hurries.

Thanks Guys.
Has there been any thought put into multi-gestures, not sure that's the right word?
Basically multiple at the same time, so multiple taps for instance.

@AndrewCapon https://github.com/raysan5/raylib/blob/master/src/rgestures.h#L405-L408

Hi @ubkp
Thanks for the info, I was thinking of the second case but really the idea of multiple controls (say sliders or lists for example) on the screen each being able to have their own gesture handling.
I have had a look at RayGui but that seems to be based on the Mouse code so is not multi touch either.
I'll have a look what I can knock up...
Cheers
Andy

@AndrewCapon The following are my personal opinions:

Raylib as a library should endeavor to provide the primitive tools through which the user can build his solutions; as opposed to an engine that manages solutions the user can use.

Functionality (like the one described), IMHO, should be handled inside the program/game.

I'm always concerned of feature creep and the effects it has. For example: the camera module has a set of cameras hardcoded in it (L432-L511), IMHO, that shouldn't be there at all. Not only any program/game (aside from a quick example/demo) will have to edit rcamera.h to do basic stuff like changing the keybinds, but also, if it ever changes, if could break what you've been using. IMHO, the only things the camera module should provide is L127-L143 (and maybe L514), and examples should teach/suggest to the user how a camera could be implemented with them.

I'm also always concerned about performance. The more the library tries to manage itself, the more the program/game has to carry. That's really not a problem on desktop, but try running the examples on web over mobile. You need to be really mindful of what you really need and what you can trim off. And stuff the library triest to manage become really hard to trim off.

I'm no way trying to dissuade you, that functionality looks really cool, but I just wouldn't like the library having to manage it. If primitive tools (L1165-L1172) necessary to implement such functionality are missing, we should totally look into that tho.

@ubkp 100% agree with all the mentioned points, specially with feature creep converns that it's something I'll fight against for years for raylib (and still it kept growing). In that regards, I agree with rcamera.h concerns, considered removing it many times and even raylib-extras repo contains better alternatives. It was just kept for convenience for small examples and demos.
One of the biggest concerns with raylib at the moment is maintenance, it's already very difficult to maintain the library, not only the source code with its issues/PRs but also all the ecosystem around it (social networks, community, webpage, examples, sample games...), so, adding more features could just make it more difficult.

@raysan5 Yeah, that's way too much. Some things that could help:

Merge windows. For example, PRs could be evaluated just during the first week of the month. That gives lots of room for the submitter to think over it, revise it, discuss it. And if it's not ready on that week, just continue/try again on the next window. The Linux Kernel uses something akin to that.

Demos instead of examples. Currently there are a lot of examples and they are usually focused on a single thing. Demos could instead focus on all related functions. For example, a single demo for all these (L1028-L1039) would be a lot easier to maintain and reference.

Schedule social media posts. Social media could be updated once a month with a digest. The Linux Mint Blog is an excellent example of that. It gets updated just once a month with the gist of what's going on or when there's a new release.

Focus on main/core. Raylib grew a lot and I'm not sure if it's feasible to maintain in its full extension. At some point I think it will be necessary to choose what is really essential (main/core) and what is not. Linux distros use a similar logic with core vs community/contrib/universe. The parts considered essential should be actively maintained. Everything else could lag behind and/or get updated when there's interest (or even moved out to it's own file/etc).

@AndrewCapon @raysan5 Temporarily working from the current master branch (c8a6093) while the split is in progress. Did a similar test:
INFO: Initializing raylib 4.6-dev
[...]
UPDATE       0 NONE
[...]
UPDATE       0 NONE
PROCESS MOVE 0 NONE
PROCESS MOVE 0 NONE
PROCESS MOVE 0 NONE
UPDATE       0 NONE
[...]

UPDATE       0 NONE
[...]
INFO: Window closed successfully

It appears that the gestures are correctly detected and processed.
When a tap (GESTURE_TAP) begins (TOUCH_ACTION_DOWN), it gets processed (ProcessGestureEvent) correctly. It's also correctly being turned to hold (GESTURE_HOLD) during the update (UpdateGestures). And when the tap ends (TOUCH_ACTION_UP) it also gets processed correctly and cleared (GESTURE_NONE).
Problem
The problem with PLATFORM_DRM appears to be that by the time the program/game does a GetGestureDetected() or IsGestureDetected() it won't catch the expected "PROCESS DOWN 1 TAP", likely because (unlike the other platforms) PLATFORM_DRM uses evdev which runs on its own thread and lacks a proper callback system (unlike GLFW, emscripten, NDK).
Nevertheless, I've reviewed all commits I did to the gesture module and none of them should have had any effect into that. So I rolled back to master branch before all those (fdc28fce80d6e9ae04e900079beba7d79673b25d) and it wasn't working for PLATFORM_DRM even back then. If it ever worked, it probably was way before.
Solution
Regarding how to solve this, the ideal would be PLATFORM_DRM having access to some callback system. But that's probably not an option.
Give me a few days to think some workaround for it. I just don't want to break (or have to heavily patch) the gesture module to handle just this at the cost of all other platforms.

@ubkp Thank you very much for investigating this issue. It expectable that PLATFORM_DRM works different than other platforms considering the raw low-level input access. It would probably be easier to track this kind of platform-specific nuances after the platform-split.

@raysan5 Agreed. :+1:
Leaving this note here for when it's time to pick up this issue again:
We'll probably need to store the last "meaningful" gesture on some var (similar to #3193) for PLATFORM_DRM.

Thanks guys, there is no hurry at all from my point.

@ubkp @michaelfiber do you think this issue could be somewhat addressed now that the platform-split has been completed?

@raysan5 I'm working on it right now. Trying to get it solved today, but it's a tricky issue. I'll do my best.

@ubkp No hurries and no pressure, take it easy! I'm just reviewing the last open issues in case something can be easely addressed but I think raylib 5.0 can be already published without them.

@raysan5 I just noticed I missed adding the gesture handling to PLATFORM_DESKTOP_SDL. I'm so sorry, I really don't know how I missed that.
I'll try to fix both together since, without callbacks, both SDL and DRM will need a similar handling. I'm giving this total priority.

@ubkp Oh, I just checked the gestures system yesterday, do you think the gestures system could be moved to rcore.c after platform PollInputEvents() is called? I think it just processes the already registered touch events (or mouse) to translate them into gestures, not sure how platform-dependant it is...

@raysan5 As of right now, I think just part of it could.
The UpdateGestures(), that is called every frame, could probably be moved.
But the ProcessGestureEvent(), that has to be called where the event is detected (e.g.: callbacks, EventThread, etc), couldn't, since that differs for each platform.
But I'd advise against moving it right now. Since DRM (and now SDL) are not using callbacks systems, the position/timing/location of the UpdateGestures() call may have to change on those plataforms. I'm still working on a solution for it that doesn't require having to change rgestures.h to accommodate it.

@raysan5 Fixed the gesture system for PLATFORM_DESKTOP_SDL. I'll send a PR for it shortly.

@ubkp thanks for the review! Agree that gestures system could be quite callback-dependant, better review it after new release.

@raysan5 I think I found why the GESTURE_DRAG and GESTURE_SWIPE_* were not wroking reliably on PLATFORM_DRM. For some reason the GESTURE.Drag.distance and GESTURE.Drag.intensity are sometimes zero on this platform. When they are not zero, it works perfectly. I'm still investigating why/where that happens.

@ubkp thanks for investigating this issue! Considering the touch positions are updated on a secondary thread, maybe it could be related to some race-condition...

@raysan5 Yeah, I spent the afternoon trying to confirm it, but there are so many events overlapping (EV_REL, EV_ABS, ABS_PRESSURE, EV_KEY) it's hard to isolate. I've started commenting it all and trying to debug it part by part. It's a slow process tho, but I'll get there. :+1:

@raysan5 After trying basically everything I gave up fighting the threads and just moved everything related to mouse/touch/gesture's evdev to inside PollInputEvents(), like it's done on SDL. It works great and reduces complexity considerably. @michaelfiber is absolutely correct, moving the input to the main thread is the way to go.
I'll append it all to the very end of PollInputEvents(), so i t doesn't interefere with the DRM input rework and can be easily removed when necessary. I'll clean this up and send a PR in a few hours.

@ubkp thanks for the review! No worries about the threads, I know they can be problematic, moving to single-thread is fine for me, actually, afaik, only mouse should be in a second thread. Take your time!

@raysan5 Found a solution. I'm crafting the PR, will send it shortly.


Add output message on server start

This PR adds information that development server has been started with clickable links for each instance.

Thanks for contributing!


add section on black precommit, update conf.py. We dont need sphinx.args

and regenerate requirements.txt. Removed unused api files.

@vsoch  This should be fairly simple fix to some issues related to docs I wanted to address.


Peripherals now broadcast their service UUID.

With this change the Peripheral App broadcasts the Service UUID of the Peripheral chosen.

@scheib: please review

LGTM

Reviewed files:

app/src/main/java/io/github/webbluetoothcg/bletestperipheral/BatteryServiceFragment.java @ r1
app/src/main/java/io/github/webbluetoothcg/bletestperipheral/HeartRateServiceFragment.java @ r1
app/src/main/java/io/github/webbluetoothcg/bletestperipheral/Peripheral.java @ r1
app/src/main/java/io/github/webbluetoothcg/bletestperipheral/ServiceFragment.java @ r1

Comments from the review on Reviewable.io


Memory not releasing issue

Hi,
I noticed while using GlueStick that the memory usage is always increasing if I do recursive inferences, for example after running 100 times the memory is getting completely full and the program is being killed.
Any ideas about this issue?
Thanks

Me too, Have you solved this problem？

Hi, I noticed while using GlueStick that the memory usage is always increasing if I do recursive inferences, for example after running 100 times the memory is getting completely full and the program is being killed. Any ideas about this issue? Thanks

Hi， I think I have find a possible solution. I use memory_profiler to analysis memory usage, and find that the problem is in pytlsd package. In pip, the pytlsd version still remain in v0.0.2, but the offical repo has update to v0.0.5. I tried install it with the latest version 0.0.5, and fixed it. You can try. Here is the repo url: https://github.com/iago-suarez/pytlsd/tree/v0.0.5


Allow AutoMLSearch to ingest data from ComposeML

Create functionality to allow AutoMLSearch to take in compose data and run search on them. Linked with this issue.

We should do this! We may want to wait until after #1229 though (datatables update)


@2.11.0 -<EMAIL_ADDRESS>

coverage: 99.245%. remained the same when pulling 02b97dcbc30a3bfd596b19d4f13271a033a68899 on rc-2.11.0 into ea19f06236e1ac8fa79acf8b06953d0b40659b76 on master.


Remove [command [command options]] from help text if there are no sub commands

Hi there,
I think it would help readability a lot if cli/v3 can check for subcommands first before printing the help of a command.
For example, right now this is the help that I get:
NAME:
   app cmd1 cmd2 - does something cool

USAGE:
   app cmd1 cmd2 [command [command options]] <myArgUsage>

OPTIONS:
   --flag value  (default: 1)
   --help, -h     show help (default: false)

Note that cmd2 has no sub-commands which makes it distracting from reading and understanding the USAGE.  So what I'd love to instead see is:
NAME:
   app cmd1 cmd2 - does something cool

USAGE:
   app cmd1 cmd2 <myArgUsage>

OPTIONS:
   --flag value  (default: 1)
   --help, -h     show help (default: false)

@marwan-at-work want to make a PR for me to review for this ?

Noticed this as well, thanks for raising @marwan-at-work. In app cmd1 cmd2 <myArgUsage> what do you expect if your cmd1/cmd2 accepts options? Does it then need to be something along the lines of app cmd1 cmd2 [command options] <myArgUsage>? I'm not sure.

FYI for whoever, the work-around for the time being: override with UsageText.

@dearchap I'm interested in working on this. Do you have any ideas on how we can address this? The help command gets added as a subcommand so we can't simply check for Commands != nil.

You could probably add a helper function in Command to list number of non help commands. That function needs to be exported for use in the template

From my understanding, when I check the help template, the text [command [command options]] is added when there is a command.
When I print a command, I get always the help command
COMMANDS:
   help, h  Shows a list of commands or help for one command

If we could just disable it, the problem would be solved, no?

Note that as quick fix for a leaf command, the HideHelp:  true (v3) just get rid of it.

Similarly, if you incorrectly type a command, the generated help for the invalid command has the extra "command" suggestion, whereas the base help does not (correctly).  Examples:
$ uc kcat help
NAME:
   uc kcat - Wraps the kcat kafka tool

USAGE:
   uc kcat [command options] -- [Arguments passed directly to kcat (-L, -P, etc.)]

OPTIONS:
   --cluster value, -c value  Specify a cluster (Prod, DR, Local, Dev)
   --help, -h                 show help

However, this shows the extra (wrong) "command" text.
$ uc kcat --dsds
Incorrect Usage: flag provided but not defined: -dsds

NAME:
   uc kcat - Wraps the kcat kafka tool

USAGE:
   uc kcat command [command options] -- [Arguments passed directly to kcat (-L, -P, etc.)]

COMMANDS:
   help, h  Shows a list of commands or help for one command

OPTIONS:
   --cluster value, -c value  Specify a cluster (Dev, Prod, DR, Local)
   --help, -h                 show help

@deregtd Would you like to test the PR and report back ?

Ah unfortunately I haven't moved to v3 yet, so I can't. :(


Get all directInbox messages - isMoreAvailable doesn't work

Can't get more then 10 directInbox messages
Trying to get all messages from inbox. I know there are lots of issues about this but still doesn't work
Tried this but isMoreAvailable() always false
I can get all messages only after setting 'thread_message_limit' to 1000 in DirectInboxFeed class from npm package directly
Pls check how can we get all directInbox messages
Code

const ig = new instagramPrivateApi.IgApiClient();
// You must generate device id's before login.
// Id's generated based on seed
// So if you pass the same value as first argument - the same id's are generated every time
ig.state.generateDevice(process.env.IG_USERNAME);
// Optionally you can setup proxy url
//ig.state.proxyUrl = process.env.IG_PROXY;
(async () => {

  // Execute all requests prior to authorization in the real Android application
  // Not required but recommended
  await ig.simulate.preLoginFlow();
  const loggedInUser = await ig.account.login(process.env.IG_USERNAME, process.env.IG_PASSWORD);
  // The same as preLoginFlow()
  // Optionally wrap it to process.nextTick so we dont need to wait ending of this bunch of requests
  process.nextTick(async () => await ig.simulate.postLoginFlow());
  // Create UserFeed instance to get loggedInUser's posts

let isMoreAvailable = false;

const dmFeed = ig.feed.directInbox();
const dmFeedItems = await dmFeed.items();
    isMoreAvailable = await dmFeed.isMoreAvailable();

    const dmFeed2 = ig.feed.directInbox();
const dmFeedItems2 = await dmFeed2.items();
    isMoreAvailable = await dmFeed2.isMoreAvailable();

})();

why is this closed? still a bug.

why is this closed? still a bug.

why is this closed? still a bug.

It's not a bug. A Feed is stateful, so creating another feed (ig.feed.directInbox(), dmFeed2) will create another instance that's not connected to the old one. It's just a class with state to put it simply.

why is this closed? still a bug.

It's not a bug. A Feed is stateful, so creating another feed (ig.feed.directInbox(), dmFeed2) will create another instance that's not connected to the old one. It's just a class with state to put it simply.

why is this closed? still a bug.

It's not a bug. A Feed is stateful, so creating another feed (ig.feed.directInbox(), dmFeed2) will create another instance that's not connected to the old one. It's just a class with state to put it simply.

no as you can see from the explanation, he says that he already tried the given code snippet for exhaustively retrieving feed contents but still receiving false. this is addressed by @mishell-trickster in #819

why is this closed? still a bug.

It's not a bug. A Feed is stateful, so creating another feed (ig.feed.directInbox(), dmFeed2) will create another instance that's not connected to the old one. It's just a class with state to put it simply.

no as you can see from the explanation, he says that he already tried the given code snippet for exhaustively retrieving feed contents but still receiving false. this is addressed by @mishell-trickster in #819

no as you can see from the explanation, he says that he already tried the given code snippet for exhaustively retrieving feed contents but still receiving false.

The code doesn't match the linked issue. I assume the code in the Code-section was tried.

this is addressed by @mishell-trickster in #819

This is a different issue that's unrelated.

no as you can see from the explanation, he says that he already tried the given code snippet for exhaustively retrieving feed contents but still receiving false.

The code doesn't match the linked issue. I assume the code in the Code-section was tried.

this is addressed by @mishell-trickster in #819

This is a different issue that's unrelated.


Error: invalid literal for int()

Hi,
I have a mkv file with 2 PGS tracks (eng & fre). When trying to convert the subtitles I have the following error (for both tracks)
Error while tyring to rip <mkv / or sup file>:  [invalid literal for int() with base 10: '95.936287']

I get the same error invalid literal for int() with base 10.
I didn't have that error before, maybe it's because I updated to python 3.10 (?). what python version do you have?

Yes I'm running Python 3.10.2

me python 3.10.3.
here is the full debug log for the dev, in case he needs it:
WARNING:pgsrip.core:Error while trying to rip a.sup: <ValueError> [invalid literal for int() with base 10: '82.661789']

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pgsrip/core.py", line 65, in rip_pgs
    srt = PgsToSrtRipper(pgs, options).rip(lambda t: rules.apply(t, '')[0])
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pgsrip/ripper.py", line 191, in rip
    items = self.process(subs, items, post_process, confidence, max_width)
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pgsrip/ripper.py", line 138, in process
    data = TsvData(tess.image_to_data(full_image.data, **config))
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pgsrip/tsv.py", line 47, in __init__
    items = [TsvDataItem(**{k: values[i] for (i, k) in enumerate(keys)}) for values in (
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pgsrip/tsv.py", line 47, in <listcomp>
    items = [TsvDataItem(**{k: values[i] for (i, k) in enumerate(keys)}) for values in (
  File "/data/data/com.termux/files/usr/lib/python3.10/site-packages/pgsrip/tsv.py", line 19, in __init__
    self.conf = int(conf)
ValueError: invalid literal for int() with base 10: '82.661789'```

@Nyx0uf if yout git clone the project ,than edit line 19 of tsv.py self.conf = int(conf) with self.conf = int(float(conf)) , then you install it with pip install . inside the first pgsrip folder, it will rip the pgs subs with no ValueError appearing, though Idk if it is a proper fix. I'm not a dev.

Seems it's fixed in pytesseract 0.3.10 but they haven't published to PyPI yet per https://github.com/madmaze/pytesseract/issues/417
Either converting to float instead of forcing to int or @Victorbry99 seem like good options. pytesseract is resolving by converting to int anyway.


doc(Request): Edit access_route, remote_addr docstrings

Move the docstrings for access_route and remote_addr to the class
docstring. Edit the text for clarity.

LGTM

:+1:


[5677] Handle nil DQT records for dead job export with DQT status

Context
https://trello.com/c/XUDEDyuR/5677-nomethoderror-systemadmindeadjobscontrollershow
Fixes this sentry issue. Could be a gap between latest DQT records fetched and new ones created for trainees sent since then. If so, this shouldn't break the export but export it with empty values for the DQT column so we have an understanding of how many still need to be fetched.

 NoMethodError SystemAdmin::DeadJobsController#show


Bug in scheduler

Scheduler is not executing the scheduled commands. They still show up in [p]scheduleradmin viewall and the logs show nothing out of the ordinary.
How to reproduce? No clue.

I can't reproduce this with even just a minimal test. I'll need more information to look into this.

Through magic it started working again. No clue. It's a Christmas miracle.


Deno Deploy Support

Currently hash and compare are not supported when deploying code on Deno Deploy. This is due to Worker not being defined refer to upstream issue.
However, until Worker is implemented with Deno Deploy you can use the hashSync and compareSync methods.
I have included a helper below which allows for easily switching between these two methods for anyone working on a codebase designed to run efficiently locally and inside Deno Deploy.
import {
  hash as hashPromise,
  hashSync,
  compare as comparePromise,
  compareSync,
} from "https://deno.land/x/bcrypt/mod.ts";

export const isRunningInDenoDeploy = Deno.permissions?.query === undefined; // This is crude check for if the code in running in Deno Deploy. It works for now but may not work in the future.

export const hash: typeof hashPromise = isRunningInDenoDeploy
  ? (plaintext: string, salt: string | undefined = undefined) =>
      new Promise((res) => res(hashSync(plaintext, salt)))
  : hashPromise;
export const compare: typeof comparePromise = isRunningInDenoDeploy
  ? (plaintext: string, hash: string) =>
      new Promise((res) => res(compareSync(plaintext, hash)))
  : comparePromise;

I primarily created this issue to help anyone who runs into the same issue. It would be cool to see the helpers I included added to this library but I think this would be unlikely given how hacky it is.

Wow, nice! I was here to create a ticket that it isn't running on Deno Deploy. Thank you very much for your help and work ;)

Thanks for raising the issue, I'm sure it'll help a lot of people out. However, this operation is blocking so running it non-async isn't the intended use case and can cause issues (e.g. if many requests hit a server at once) so while it may work for you, I don't think adding it to the library would be wise.
I'll close the issue if/when deno-deploy supports workers (please let me know since I don't follow deno-deploy closely) and leave it open for now so others can find it. Thanks again for sharing your workaround!

This issues hits also deno compile. Anyone has a way to detect this case?

I’m finding a weird issue that just started this week. compare function returns false for older accounts and true for new accounts created this week.
If I restart systemd which I use to start deno it sometimes works for older accounts but then newer ones can’t login.
I’m completely baffled. Deployed to Ubuntu 20.04 using latest stable deno.

I don't maintain this repository but it looks like someone reported this as issue #27. I don't understand how it is related to this issue about Deno Deploy so it's discussion should be done in a separate issue unless it has a direct link.

Love you dawg, i was just searching for this

Thank you so much man, this really helped !

Currently hash and compare are not supported when deploying code on Deno Deploy. This is due to Worker not being defined refer to upstream issue.
However, until Worker is implemented with Deno Deploy you can use the hashSync and compareSync methods.
I have included a helper below which allows for easily switching between these two methods for anyone working on a codebase designed to run efficiently locally and inside Deno Deploy.
import {
  hash as hashPromise,
  hashSync,
  compare as comparePromise,
  compareSync,
} from "https://deno.land/x/bcrypt/mod.ts";

export const isRunningInDenoDeploy = Deno.permissions?.query === undefined; // This is crude check for if the code in running in Deno Deploy. It works for now but may not work in the future.

export const hash: typeof hashPromise = isRunningInDenoDeploy
  ? (plaintext: string, salt: string | undefined = undefined) =>
      new Promise((res) => res(hashSync(plaintext, salt)))
  : hashPromise;
export const compare: typeof comparePromise = isRunningInDenoDeploy
  ? (plaintext: string, hash: string) =>
      new Promise((res) => res(compareSync(plaintext, hash)))
  : comparePromise;

I primarily created this issue to help anyone who runs into the same issue. It would be cool to see the helpers I included added to this library but I think this would be unlikely given how hacky it is.

isRunningInDenoDeploy should be checked through the environment variables in the project.

Is there any status update concerning this?
SInce deno deploy has the web crypto API, it might be the Worker never will be implemented.
Is there a way we could use the web crypto API instead of the sync ways with bcrypt?

@AshwinDeTaeye This is a problem with Deno Deploy not supporting Workers. If you need to run your app on Deno Deploy, it seems that the only option right now is to have these calls blocking and use the sync methods.
I'm not quite sure what you mean by using the Web Crypto API instead of Workers.
Upstream issue previously mentioned here: https://github.com/denoland/deploy_feedback/issues/171

Deno deploy does support the Web Crypto API. https://deno.com/deploy/docs/runtime-api
I suppose there should be async ways of achieving hash and compare through this API.
What i found: https://bradyjoslin.com/blog/encryption-webcrypto/
Do you think this could be done with this API?
https://doc.deno.land/deno/stable/~/SubtleCrypto

To be honest, I've not really kept up with Deno anymore and I'm not prepared to overhaul this code just to support Deno Deploy because it doesn't support Workers. If you do manage to find a way, please do keep us posted so others interested in the thread know. Thanks 😄

We can use the standard lib from Deno: Web Crypto
Following worked for me in Deno deploy:
const buff_to_base64 = (buff: number[] | Uint8Array) =>
  btoa(String.fromCharCode.apply(null, buff));

const base64_to_buf = (b64: string) =>
  Uint8Array.from(atob(b64), (c) => c.charCodeAt(null));

const enc = new TextEncoder();
const dec = new TextDecoder();

const getPasswordKey = async (password: any) =>
  await window.crypto.subtle.importKey(
    "raw",
    enc.encode(password),
    "PBKDF2",
    false,
    ['deriveBits', "deriveKey"]
  );

const deriveKey = async (passwordKey: any, salt: any, keyUsage: any[]) =>
  await window.crypto.subtle.deriveKey(
    {
      name: "PBKDF2",
      salt: salt,
      iterations: 250000,
      hash: "SHA-256",
    },
    passwordKey,
    { name: "AES-GCM", length: 256 },
    false,
    keyUsage
  );

export async function encryptData(secretData: string | undefined, password: any) {
  try {
    const salt = window.crypto.getRandomValues(new Uint8Array(16));
    const iv = window.crypto.getRandomValues(new Uint8Array(12));
    const passwordKey = await getPasswordKey(password);
    const aesKey = await deriveKey(passwordKey, salt, ["encrypt"]);
    const encryptedContent = await window.crypto.subtle.encrypt(
      {
        name: "AES-GCM",
        iv: iv,
      },
      aesKey,
      enc.encode(secretData)
    );

    const encryptedContentArr = new Uint8Array(encryptedContent);
    let buff = new Uint8Array(
      salt.byteLength + iv.byteLength + encryptedContentArr.byteLength
    );
    buff.set(salt, 0);
    buff.set(iv, salt.byteLength);
    buff.set(encryptedContentArr, salt.byteLength + iv.byteLength);
    const base64Buff = buff_to_base64(buff);
    return base64Buff;
  } catch (e) {
    console.log(`Error - ${e}`);
    return "";
  }
}

export async function decryptData(
  encryptedData: string,
  password: string | undefined
) {
  try {
    const encryptedDataBuff = base64_to_buf(encryptedData);
    const salt = encryptedDataBuff.slice(0, 16);
    const iv = encryptedDataBuff.slice(16, 16 + 12);
    const data = encryptedDataBuff.slice(16 + 12);
    const passwordKey = await getPasswordKey(password);
    const aesKey = await deriveKey(passwordKey, salt, ["decrypt"]);
    const decryptedContent = await window.crypto.subtle.decrypt(
      {
        name: "AES-GCM",
        iv: iv,
      },
      aesKey,
      data
    );
    return dec.decode(decryptedContent);
  } catch (e) {
    console.log(`Error - ${e}`);
    return "";
  }
}

For the proposed solution in the OP, I think a more sensible way to detect if it'll work is by using
// deno-lint-ignore no-explicit-any
export const isRunningInDenoDeploy = (globalThis as any).Worker === undefined;

For the proposed solution in the OP, I think a more sensible way to detect if it'll work is by using
// deno-lint-ignore no-explicit-any
export const isRunningInDenoDeploy = (globalThis as any).Worker === undefined;

^ This suggestion worked for me, but also could set an environment variable such as Deno.env.Get('DENO_ENV') === 'production'

For the proposed solution in the OP, I think a more sensible way to detect if it'll work is by using
// deno-lint-ignore no-explicit-any
export const isRunningInDenoDeploy = (globalThis as any).Worker === undefined;

^ This suggestion worked for me, however an alternative solution could be to set an environment variable such as Deno.env.Get('DENO_ENV') === 'production'

That's actually what I ended up going with, because of another library that I needed to know which environment I was in. Just didn't post it here lol


You need to talk about "slab consolidation" error & "space efficiency" in Optimizer.

Win10 Home. I have two spinning drivers mirrored in Storage Spaces. (Which report as "thin provisioned space.")
I was noodling around in Storage Spaces the other day and noticed a Warning about needing to optimize the mirror.
When I run Optimize (a.k.a. defrag") I get an error in Event Viewer that "The storage optimizer couldn't complete slab consolidation on foo because: The slab consolidation operation was aborted because an insufficient number of slabs could be reclaimed (based on the limits specified in the registry). (0x89000028)"
I cannot find anything on the Internet about "insufficient number of slabs."
I can kinda "see" when the error is generated. Optimizer will chunk along at 2 to 3 percent intervals until it gets to about 95%. At which point Optimizer suddenly "completes" (more like fails and stops), jumping to 100% complete.
FWIW, I deleted a bunch of files on the mirror (like, 50% capacity) and I still get this error. (Since I know that conventional degrag needs a certain amount of free space in which to work.)
So now, after Optimizer finishes, it shows me "94% space efficiency." Whereas it used to show 100%
I presume that 94% is not as good as 100%.
I've seen documentation here saying that "efficiency" for two mirrored drives is 50%. But I don't think this is the same efficiency that Optimize is referring to. Is it?
Also FWIW, I built this mirror in Win 10 Home 1903. Then I did a Refresh update to 1909 and am now at 2004. I offer this because I read that there is a known bug with Storage Spaces and 2004. (Although, fortunately for me, I am still about to use the mirror.)
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 375ef18d-2d7f-fd6a-12ea-7a4d8d0a8c80
Version Independent ID: fcaaf1af-4829-ac36-1617-e71dfd758208
Content: Storage Spaces Direct - Frequently asked questions
Content Source: WindowsServerDocs/storage/storage-spaces/storage-spaces-direct-faq.md
Product: windows-server
Technology: storage-spaces
GitHub Login: @kaushika-msft
Microsoft Alias: kaushik

@Ergonomicmike GitHub issues for this repo are for reporting problems with documentation.  For your questions please see https://support.microsoft.com/en-us/windows/storage-spaces-in-windows-b6c8b540-b8d8-fb8a-e7ab-4a75ba11f9f2#WindowsVersion=Windows_10
and for any further questions try https://answers.microsoft.com/en-us/windows/forum?sort=LastReplyDate&dir=Desc&tab=All&status=all&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&isFilterExpanded=false&page=1

#please-close

@IngridAtMicrosoft
Technically speaking @Ergonomicmike DID report a documentation issue and requested remediation of it, he 'just' reported it against the wrong documentation, and phrased it in a way where it easily can get misunderstood as a support request. I suspect the correct page against which this should have gotten reported may consist of https://learn.microsoft.com/en-us/windows/compatibility/new-api-allows-apps-to-send-trim-and-unmap-hints, and/or of https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh831391(v=ws.11) (and/or the equivalent for client  windows, since Storage Spaces was originally a server-only feature and later added to client OS)


dc_get_display_name does not work for User Profile display name

I'm not sure when this started to become an issue, but players in my server noticed it today.
Some users' discord names in the minecraft chat were showing their username instead of their display name.
We did a lot of testing and concluded the following:
The display name in your Server Profile for the server is picked up by dc_get_display_name , but the display name in your User Profile is not in which case the username is returned by dc_get_display_name . Which means only people with nitro profiles can use their display name in our chat bridge.
As always thank you for your continued support and development of this fantastic mod!

Apparently this is not yet supported by Javacord (See https://github.com/Javacord/Javacord/pull/1260)
Until then maybe you could resort to manually getting the global_name with http requests


Upgrade backup/attic to 0.15

A new version of attic was released, so I updated the nix copy.

Pushed to master and release-14.12 (it's a bugfix release).