No data in req.stream.read()

I've modified the introduction example (things.py) to handle a POST request, and called it with curl.
I've started my gunicorn server with:
gunicorn things:app
And make a POST with curl:
curl localhost -d "Test data" or
curl localhost --data-urlencoded "Test data"
But req.stream.read() is always empty.
It's very strange because it was working properly and this (no data received) happened after i formatted my pc and reinstalled ubuntu 14.04.02.
Am I forgetting somenthing?
import falcon
class ThingsResource:
def on_get(self, req, resp):
"""Handles POST requests"""
req_body = req.stream.read()
print req_body
resp.status = falcon.HTTP_200  # This is the default status
resp.body = ('\nTwo things awe me most, the starry sky '
'above me and the moral law within me.\n'
'\n'
'    ~ Immanuel Kant\n\n')
app = falcon.API()
things = ThingsResource()
app.add_route('/things', things)

You can check these things:

In you code, you're acting on the "on_get" instead of "on_post". The "on_get" won't read anything that is not a GET request.

Can you try curl with -X POST 'datastring" instead of -d? -d is sending binary data

If nothing of this works tell me if there's any error message

I've used on_post, and the method is being executed because I've put other prints and them are being printed.
I've tried curl with -X POST --data-urlencoded and a lot of variations.
My big problem is that no error are fired, simply the data are empty. There's nothing on req.stream.read()

Is ther a way to debug and see what's inside req object or see the bytes curl are sending?

Have you taken a look to params(), get_param() and  query_string() ?
According to the falcon documentation:

If an HTML form is POSTed to the API using the application/x-www-form-urlencoded media
type, Falcon will consume stream in order to parse the parameters and merge them into the
query string parameters. In this case, the stream will be left at EOF.

That menas if the form is sent as HTML form, the stream will be empty and the query strings will be populated with the values, according to the standard.

This feature had better be switchable, off by default.  I ran into this and it's fairly confusing.

Thanks ocarcp,
I was able to acces the data throught get_param().
I think was using a older version of falcon, in the last version (which I thinks was released  on february, 6) this behavior changed and caused this confusion.

Yeah I know, the documentation is ahead of the current version available in pip. I had troubles too. Maybe @kgriffs can sync it up :)

@lichray tons of things are confusing on the request because falcon follows the standard completely and sometimes it doesn't make sense if you come from other fully fledged frameworks. But that's part of falcon's beauty, its fully standard :)

If by satisfying form submission standard you violated WSGI standard then you should give user a switch.

I didn't mean it was in direct violation but according to the WSGI spec:

Currently environ['wsgi.input'] points to a stream that represents the
body of the HTTP request. Once this stream has been read, it cannot
necessarily be read again.

So it's up to the implementation of the framework to choose how to process the data. In the django framework for example the HttpRequest object does the same, the only difference is that it makes it transparent for the user so you have everything available through HttpRequest.request
I don't disagree in the switch though, I never had a use case where I needed it, so I can't tell :)

See:
https://github.com/falconry/falcon/issues/417
https://github.com/falconry/falcon/issues/418
https://github.com/falconry/falcon/issues/180

Flagging this for documentation to provide clarity on how Falcon handles the incoming stream, how to parse it directly, and a few different approaches to buffering the data if that is required by the app.

Note: As of 1.0.0 form data is no longer automatically parsed by default.
http://falcon.readthedocs.io/en/stable/api/api.html#RequestOptions.auto_parse_form_urlencoded
Also note that we are working on a new interface for forms. Happy to get your feedback on these issues:
#418
#953

Closing this issue as

As of recent Falcon 2.0+, I don't think we are reading anything behind user's back by default
The documentation issue still remains to better clarify how Falcon is dealing with input streams, but let's handle that as part of https://github.com/falconry/falcon/issues/417


Added Contributing.md

Issue #46
Changes

Added Contributing.md with all the Instructions for new contributors
Hyperlinked the links in CODE_OF_CONDUCT for better view.

We should also include the details in readme and other prerequisites for code specific contributions

I looked around but did not find those parts so I did not wanted to write something wrong

What more is required in the file?

I will add later some more details. Is this PR for hacktoberfest?

Actually Yes 😅

Ok i guess there should be contact section to discord server then I will merge this


Memory Leak Detected

Hi,
Thanks for coming up with this useful library. I would like to report a memory leak that LeakCanary library found with AboutLibraries. Here are the details:

@ankitbatra11 any additional details about your setup? Do you use the LibsConfiguration?

I launch the LibsActivity using following code:
ThemeSetting themeSetting = DaggerUtils
.getSettingsComponent(getActivity().getApplication())
.themeSetting();
LibsBuilder builder = new LibsBuilder()
.withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR)
.withLicenseShown(true)
.withVersionShown(true)
.withAboutIconShown(true)
.withActivityTheme(themeSetting.getThemeRes())
.withAboutDescription(getString(R.string.app_name));
builder.activityTitle = getString(R.string.about);
builder.start(getContext());
Code is trigged on press of a menu item in settings fragment.

Seems to be related to: https://github.com/mikepenz/AboutLibraries/issues/238


For loop fixes

This PR

Adds support for for loops with invariants, recently added to Verus
Improve parsing of range expressions (e.g., 0..(1 + 2)) that start "float-like"

@Chris-Hawblitzel, once this PR is merged, examples/vectors.rs formats correctly


cleanup dvcyaml

Fixes #611

Codecov Report
Patch coverage: 100.00% and project coverage change: +0.01 :tada:

Comparison is base (cae5129) 89.70% compared to head (ab189a1) 89.72%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #615      +/-   ##
==========================================
+ Coverage   89.70%   89.72%   +0.01%
==========================================
  Files          43       43
  Lines        2983     2987       +4
  Branches      247      248       +1
==========================================
+ Hits         2676     2680       +4
  Misses        268      268
  Partials       39       39

Impacted Files
Coverage Δ

src/dvclive/live.py
94.81% <100.00%> (+0.03%)
:arrow_up:

tests/test_main.py
100.00% <100.00%> (ø)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

@daavoo Where are we overwriting in the code? Is this PR doing anything then? 😅

@daavoo Where are we overwriting in the code?

https://github.com/iterative/dvclive/blob/d261760a2fc32c36faa3b074a6a14a69e65cee5d/src/dvclive/dvc.py#L86-L116
This only happens when make_dvcyaml is called.

Is this PR doing anything then? 😅

Yes, it makes the behavior consistent with the rest of the DVCLive-generated files, where we clean up at  Live instantiation

I wonder if we need to be so particular anymore about which files to drop inside the dvclive dir or if we should just drop the whole dir. Seems just as likely that someone will end up with stale files than deleting something someone wanted to keep. AFAIR we used to drop more aggressively before https://github.com/iterative/dvclive/issues/102, but maybe we are more clear now that the dvclive dir should be a separate dir managed only by dvclive.


Async Generator Wrapper

Overview

Add automatic wrapper for async generators.
Add full test suite for async generator wrapper.

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop-google-firestore-instrumentation@dcc92a9). Click here to learn what that means.
The diff coverage is n/a.

@@                             Coverage Diff                             @@
##             develop-google-firestore-instrumentation     #884   +/-   ##
===========================================================================
  Coverage                                            ?   81.17%
===========================================================================
  Files                                               ?      186
  Lines                                               ?    18626
  Branches                                            ?     3252
===========================================================================
  Hits                                                ?    15120
  Misses                                              ?     2598
  Partials                                            ?      908

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


Spike: Evaluate cost of MPT verification in plutus

What & Why
We want to know as early as possible whether we would be running into execution budget limits for using Merkle (Patricia) Tree in our validators. More specifically, the (asymptotic) complexity of memory and cpu utilization of checking whether a UTXO is part of a tree given it's proof using the Plutus implementation and cost models is to be estimated.

We implemented a plutus-merkle-tree package and measured execution costs of membership checks and construction in Plutus:
https://github.com/input-output-hk/hydra-poc/wiki/Logbook#2021-01-11

Copying the results here. Reproducible on 73c209048479190f86e64857f101ec086365dbe4 with cabal run contract-cost.
Percent of full budget (current parameters) for both membership and MT building:

# UTXO
Mem (member)
CPU (member)
Mem (build)
CPU (build)

1
3.79926
1.66382747
3.92862
1.69953237

2
4.00523
1.78074127
6.41958
2.61146129

3
4.14665
1.86060451
11.8103
4.55927679

4
4.2112
1.89765508
17.63118
6.64887027

5
4.29852
1.94672544
28.82442
10.66935212

6
4.35262
1.97751831
40.44782
14.83161195

7
4.39126
1.99951322
52.50138
19.13564976

8
4.41717
2.01456888
64.9851
23.58146555

9
4.46705
2.04247043
87.78338
31.7472801

10
4.50449
2.06363924
111.01182
40.05487263

20
4.71046
2.18055305
0
0

30
4.81784
2.24175466
0
0

40
4.91643
2.29746685
0
0

50
4.98234
2.33487927
0
0

60
5.02381
2.35866846
0
0

70
5.07426
2.38716361
0
0

80
5.1224
2.41438066
0
0

90
5.15983
2.43554948
0
0

100
5.18831
2.45179308
0
0

120
5.22978
2.47558227
0
0

140
5.28023
2.50407741
0
0

160
5.32837
2.53129446
0
0

180
5.3658
2.55246328
0
0

200
5.39428
2.56870688
0
0

220
5.41757
2.5819971
0
0

240
5.43575
2.59249607
0
0

260
5.45449
2.60326714
0
0

280
5.4862
2.62099122
0
0

300
5.51269
2.63589112
0
0

320
5.53434
2.64820827
0
0

340
5.55488
2.65975424
0
0

360
5.57177
2.66937709
0
0

380
5.58611
2.67762308
0
0

400
5.60025
2.68562069
0
0

420
5.6128
2.69274686
0
0

440
5.62354
2.69891091
0
0

460
5.63335
2.70453895
0
0

480
5.64172
2.70940988
0
0

500
5.64942
2.71389113
0
0

Graphs of our above measurements in checking Merkle-Tree membership:

And building a Merkle-Tree:

In addition to Merkle-Tree construction and membership checks, we also measured performance of

hashing bytes using builtin Plutus hash functions -> O(n) see PR #155
encoding a TxOut into bytes using a simple CBOR encoder -> O(n) see PR #154 and these graphs:

List of ada-only TxOut:

Single TxOUT with varying number of assets:

This also shows that we can continue measurements and cost estimation with Ada-Only TxOuts and trade them roughly against number of assets in a single TxOut.


Improve documentation of how config is loaded in MikroORM.init()

I have a mikro-orm.config.ts file and the CLI tool works. The documentation says:

Once you have the CLI config properly set up, you can omit the MikroORM.init() options parameter and the CLI config will be automatically used.

So I removed the options parameter, but it fails to load the config file. Somehew I figured out that I can fix it by calling require('ts-node').register(); before MikroORM.init() but still not 100% sure why this is needed, whether this is the right solution and why ts-node isn't loaded automatically.

It should actually work that way. You also need to enable useTsNode in your package.json, and you need to compile your app so you also have JS version of the CLI config if you are running via node. Registering ts-node manually is wrong way to fix this - you don't want that in production. It is registered automatically if ts-node is detected and only then the TS version of the config will be used.
Looking at the docs it seems documented this way - the docs are talking about JS config, adding a note about how to use TS configs, mentioning the useTsNode flag too.
If you give me a repro, will be happy to look into why it fails to load it/detect the ts-node correctly. But after reading thru the docs, it feels like everything is there and right... Sounds more like it's just a bug/edge case/misconfiguration.

I'm using Sapper. During development I start the server with the "sapper dev" script in package.json, if I replace it with "ts-node node_modules/.bin/sapper dev", it works. The production build also needs to be run with ts-node.
Sapper compilation doesn't work by mapping every .ts file to a corresponding .js file. It ignores the mikro-orm.config.ts file because I never import it (and if I imported it, it would get compiled into the output bundle).
Honestly, I find all of this somewhat confusing...

You can always do this which will be fine in terms of tree shaking:
import config from './mikro-orm.config';
const orm = await MikroORM.init(config);

Good idea, that seems like the right solution. I just had to add as Options in mikro-orm.config.ts because I'm using strict mode. Thanks 👍


[FEAT]: A better way to automatically setup redis database/ Sotopia-install

Description
I have been using the latest Sotopia cli and spotted some issues.

The test cli would fail if there are local redis database there

Additional Information
No response

Could you specify the platform, installation options, previous database
installation method etc?
On Wed, Jul 17, 2024 at 6:27 PM Xuhui Zhou @.***> wrote:

Assigned #140 https://github.com/sotopia-lab/sotopia/issues/140 to
@ProKil https://github.com/ProKil.
—
Reply to this email directly, view it on GitHub
https://github.com/sotopia-lab/sotopia/issues/140#event-13544258861, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AD436FQMULX6I2XZP55YIVTZM3VWXAVCNFSM6AAAAABLBPZY2GVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJTGU2DIMRVHA4DMMI
.

        The returned instance will have attributes args, returncode, stdout and
        stderr. By default, stdout and stderr are not captured, and those attributes
        will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them,
        or pass capture_output=True to capture both.

        If check is True and the exit code was non-zero, it raises a
        CalledProcessError. The CalledProcessError object will have the return code
        in the returncode attribute, and output & stderr attributes if those streams
        were captured.

        If timeout is given, and the process takes too long, a TimeoutExpired
        exception will be raised.

        There is an optional argument "input", allowing you to
        pass bytes or a string to the subprocess's stdin.  If you use this argument
        you may not also use the Popen constructor's "stdin" argument, as
        it will be used internally.

        By default, all communication is in bytes, and therefore any "input" should
        be bytes, and the stdout and stderr will be bytes. If in text mode, any
        "input" should be a string, and stdout and stderr will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode is
        triggered by setting any of text, encoding, errors or universal_newlines.

        The other arguments are the same as for the Popen constructor.
        """
        if input is not None:
            if kwargs.get('stdin') is not None:
                raise ValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE

        if capture_output:
            if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
                raise ValueError('stdout and stderr arguments may not be used '
                                 'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE

        with Popen(*popenargs, **kwargs) as process:
            try:
                stdout, stderr = process.communicate(input, timeout=timeout)
            except TimeoutExpired as exc:
                process.kill()
                if _mswindows:
                    # Windows accumulates the output in a single blocking
                    # read() call run on child threads, with the timeout
                    # being done in a join() on those threads.  communicate()
                    # _after_ kill() is required to collect that and add it
                    # to the exception.
                    exc.stdout, exc.stderr = process.communicate()
                else:
                    # POSIX _communicate already populated the output so
                    # far into the TimeoutExpired exception.
                    process.wait()
                raise
            except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
                # We don't call process.wait() as .__exit__ does that for us.
                raise
            retcode = process.poll()
            if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command 'redis-cli shutdown' returned non-zero exit status 1.

../../miniconda3/envs/sotopia/lib/python3.11/subprocess.py:571: CalledProcessError
----------------------------- Captured stdout call -----------------------------
==> Fetching /opt/homebrew...

==> Resetting /opt/homebrew...

==> Fetching /opt/homebrew/Library/Taps/homebrew/homebrew-cask-fonts...

==> Resetting /opt/homebrew/Library/Taps/homebrew/homebrew-cask-fonts...
branch 'master' set up to track 'origin/master'.
Your branch is up to date with 'origin/master'.

==> Fetching /opt/homebrew/Library/Taps/redis-stack/homebrew-redis-stack...

==> Resetting /opt/homebrew/Library/Taps/redis-stack/homebrew-redis-stack...
branch 'master' set up to track 'origin/master'.
Your branch is up to date with 'origin/master'.

==> Downloading https://redismodules.s3.amazonaws.com/redis-stack/.donotremove
Already downloaded: /Users/xuhuizhou/Library/Caches/Homebrew/downloads/ef2730594e69664c1443b12b81b48a552062d289c8d16cf38e3ec96d0f8223be--.donotremove
==> Installing dependencies: redis-stack-redisinsight
==> Downloading https://s3.amazonaws.com/redisinsight.download/public/releases/2.50.0/redisstack/Redis-Insight-app-darwin.arm64.tar.gz
Already downloaded: /Users/xuhuizhou/Library/Caches/Homebrew/downloads/904434f7875a3ba3486d6ec3c5f04d1132d16b639e579a8d34e3a147cd8e2bff--Redis-Insight-app-darwin.arm64.tar.gz
==> Installing Cask redis-stack-redisinsight
==> Purging files for version 2.50.0 of Cask redis-stack-redisinsight
----------------------------- Captured stderr call -----------------------------
From https://github.com/Homebrew/brew
   9538f424b5..321498c327  master             -> origin/master
 * [new branch]            more-sorbet-strict -> origin/more-sorbet-strict
Reset branch 'stable'
Reset branch 'master'
Reset branch 'master'
Warning: Cannot verify integrity of '904434f7875a3ba3486d6ec3c5f04d1132d16b639e579a8d34e3a147cd8e2bff--Redis-Insight-app-darwin.arm64.tar.gz'.
No checksum was provided.
For your reference, the checksum is:
  sha256 "9cc8d05e3ef7af96c8801d46509a2da577f61b490b3761ab5af92ec896c53030"
Error: It seems there is already an App at '/Applications/Redis Insight.app'.
Could not connect to Redis at <IP_ADDRESS>:6379: Connection refused
=============================== warnings summary ===============================
../../miniconda3/envs/sotopia/lib/python3.11/site-packages/beartype/_util/hint/pep/utilpeptest.py:339
  /Users/xuhuizhou/miniconda3/envs/sotopia/lib/python3.11/site-packages/beartype/_util/hint/pep/utilpeptest.py:339: BeartypeDecorHintPep585DeprecationWarning: PEP 484 type hint typing.Sequence[sotopia.agents.base_agent.BaseAgent[sotopia.messages.message_classes.Observation, sotopia.messages.message_classes.AgentAction]] deprecated by PEP 585. This hint is scheduled for removal in the first Python version released after October 5th, 2025. To resolve this, import this hint from "beartype.typing" rather than "typing". For further commentary and alternatives, see also:
      https://beartype.readthedocs.io/en/latest/api_roar/#pep-585-deprecations
    warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/cli/test_install.py::test_install - subprocess.CalledProcessErro...
======================== 1 failed, 1 warning in 10.89s =========================
<<<PYTHON-EXEC-OUTPUT
Finished running tests!

It seems that the Homebrew detects another redis already installed in the system. In this case, what do you think is the desired behavior?

in this case, maybe ask the user if they want to overwrite their current database. If not they need to do things manually, and we output some pointers?

There are two things:

They have rdb file at the location that we want to copy to.
They have installed redis with homebrew before.

For 1, we already have that. For 2, I don't know:

how to know if this happens
what are the options for users?

It seems that this is expected? What is the requested API change here?


Use http client created in Swarm

The changes made in https://github.com/docker/swarm/pull/2206 to address #1879 were lost recently. This PR re-introduces those changes. There was a similar effort in https://github.com/docker/swarm/pull/2555 but that has stalled.
This also prevents creating unnecessary extra http connections.
Signed-off-by: Nishant Totla<EMAIL_ADDRESS>

Ping @allencloud

I think it seems that we vendored a new version of package samalba/dockerclient. Do we ignore that kind of information now? @nishanttotla

@allencloud see #1879. samalba/dockerclient should be removed soon, and this is a step in that direction. The reason we're changing the vendored directory temporarily is because it makes no sense to submit a PR to samalba/dockerclient at this stage, and so we should just consider this a temporary measure.

@nishanttotla A small issue related: In func HTTPClientAndScheme (cluster/engine.go), there is no need for type check since httpClient and url.Scheme are both valid in engine. If do need a check would it be SwarmClient instead of DockerClient I guess?

@xihan88 the check is needed to make sure it isn't a NopClient (which is the case when connection has been lost)

@allencloud updated request default timeout to 30 seconds.

cc @wsong. This PR is the last step before we can get rid of samalba/dockerclient. While I'm confident no old API requests due to that are being sent anymore, it would be great to entirely get rid of this dependency.


Unacceptable type of value for to-one relationship

When I try to edit and TimeEntry i get this error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for to-one relationship: property = "project"; desired type = TimeTarget.Project; given type = TimeTarget.Project; value = (entity: Project; id: 0x174426160 x-coredata://6B81EA38-15B7-4C85-ADB5-6640EE31DF5D-9088-000002BEECC9720D/Project/p254230CF-A9CD-4CAD-B47F-19DFBA054081 ; data: {
billable = 0;
"cks_LocalStore_Attribute_ChangeType" = nil;
"cks_LocalStore_Attribute_EncodedValues" = nil;
"cks_LocalStore_Attribute_RecordID" = nil;
client = "0x174239480 x-coredata://6B81EA38-15B7-4C85-ADB5-6640EE31DF5D-9088-000002BEECC9720D/Client/p686DBB54-ACC5-4313-8369-2DF9B8003E4B";
color = 0;
defaultHourRate = 0;
name = Kk;
timeEntries = "";
}).'
And same when I try an edit an Project:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unacceptable type of value for to-one relationship: property = "client"; desired type = TimeTarget.Client; given type = TimeTarget.Client; value = (entity: Client; id: 0x174621ac0 x-coredata://17D56827-FF19-4DDD-8161-E4C930BC4398-9102-000002BF85C10C71/Client/p686DBB54-ACC5-4313-8369-2DF9B8003E4B ; data: {
billable = 0;
color = 0;
defaultHourRate = 0;
name = Klkj;
projects = (
"0x170432e00 x-coredata://17D56827-FF19-4DDD-8161-E4C930BC4398-9102-000002BF85C10C71/Project/p9E6EA418-FF51-492C-84ED-575A76659490",
"0x170432e20 x-coredata://17D56827-FF19-4DDD-8161-E4C930BC4398-9102-000002BF85C10C71/Project/p254230CF-A9CD-4CAD-B47F-19DFBA054081"
);
}).'
The client I can edit / save without problem. It first happens when I have closed the app and reopened the app again.
Model:

This might help.

Can't get it to work.
It works without CKSIncrementalStore. With CKSIncrementalStore it only works until I restart the app.

I have checked. I think this is not a bug. I checked by changing the model with to one and a to many inverse relationship. I also tried re starting the demo app several times and changing values for to many and to one relationships. All worked fine. I have updated the demo btw. You can also try out it over there.
Please double check your CoreData model. This helped me too. Please also check that if you are using the same instance of NSManagedObjectContext to modify the objects.

I downloaded the updated code & its crashing. Not working with following error
CKSIncrementalStoreDemo.sqlite options:(null) ... returned error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)"

@apoorvmote I cannot guide you through ios development. This error is not related to this project. Google it and please avoid posting these things here.

Wow that's bit harsh. I was just about to delete my post because I found out that I didn't delete the app from the simulator before running new version. And your new code is working just fine.

Sorry for being harsh man ! I just wanted to guide you that the problems are on your own side. Please always google and check out stackoverflow before posting something here. If you find a real bug in this project I'l be there always. Sorry again :)

Sorry you were right this was a CKSIncrementalStore bug. Check the latest build now and post feedback here :)


chore: scaffold monorepo

Towards replacing the template rendering engine used for the web interface by a JS/TS application.
In the internal PSE #dogfood, it seems we were all in favor on using a monorepo to manage the freedit rs backend and the to be developed JS client.
I picked a few tools that I am setting up in this PR:

bun as JS runtime and node package manager

just as tasks runner

vite: JS/TS front end build tool

tanstack router: client side router
Right now I am just "dangerously setting" the inner html in one route of client app from what the server gives. But of course we should not keep doing that way, this is just for demo/test purposes atm. Indeed atm the server only serves html documents (the rinja template rendering engine). Eventually we want to have a server that gives us JSON and fetch that client side, and let react build the html docs (see #5 and #6).

Test plan

Spin up the server and client: eg with just dev
you should not see any errors or warnings
go to localhost:5173 . Click on the inn link. You should see the same content  as on localhost:3001 (but displayed very ugly)

We'll need to port this to https://github.com/privacy-scaling-explorations/pse-forums , can likely just push main  there. Will also include db snapshot logic from https://github.com/pseXperiments/freedit/pull/1 & https://github.com/pseXperiments/freedit/pull/2

@jacque006 yes i wanted to merge it here first as you had started to review it here.
I ll push to main on pse-forums


Allowed usernames

Hey again.
Wanna all about allowed usernames. So i editing file config.yml, to be exact: "allowed_telegram_usernames: [name1, name2]"
But my name isn't there and i still can chat with bot (I'm owner of bot). Is this feature working as it should?

Hi!
Only users presented in allowed_telegram_usernames are able to chat with bot. Did you rerun the bot after changing the config?

Yup

Yes, for example: allowed_telegram_usernames: ["@karfly", "@cookins"]

Yes, for example: allowed_telegram_usernames: ["@karfly", "@cookins"]

I still can pm bot and chat with it. After changes - i rebooted vps. For some reason - it not works. Maybe, cuz I'm owner of bot?

Да, например: allowed_telegram_usernames: ["@karfly", "@cookins"]

Good evening. So now ID or nicknames should be specified in this field?

@cookins
🤔 Can't understand, why it doesn't work. Code (file bot.py, line 675) is pretty straightforward

@AyvazovAleksandr
If you pass strings – they be treated as usernames
If ints – they will be treated as group_id/group_ids

Yes, for example: allowed_telegram_usernames: ["@karfly", "@cookins"]

Hello @karfly , I have a question, if I wanna add a specific username and a group id, what is the correct format to write on the following line? allowed_telegram_usernames: ["@username", "-123456"] Is this right?

Solved, no double quotation marks "".
ask https://t.me/username_to_id_bot to get your user id and chat id.
allowed_telegram_usernames: [123456, -123456]

example;
allowed_telegram_usernames: ["@yazgulu","@aldogan",18526095,1354409621,"@saksak"]
Im not sure group id is not allowed.

@cookins
🤔 Can't understand, why it doesn't work. Code (file bot.py, line 675) is pretty straightforward

Sorry

@cookins
🤔 Can't understand, why it doesn't work. Code (file bot.py, line 675) is pretty straightforward

Sorry to ask. I figured what was that issue. I'm not restarted bot... of course. But can you tell me, what i doing wrong (kinda still learning with docker) - i restarted server, i restarted containers (with new config).... but it still on old config.. maybe data from config.yml written to mongo db and i need to clean db? Or should i fully recompose with docker (but its not overwrite too and config still old)?

after you changed your config files, do the following steps.
list containers: docker ps
stop container: docker stop name
remove container: docker rm name
list images: docker images -a
remove image: docker image rm name
change directory to the config file folder: cd /path/path
recreate image: docker compose --env-file config/config.env up --build

after you changed your config files, do the following steps.
list containers: docker ps
stop container: docker stop name
remove container: docker rm name
list images: docker images -a
remove image: docker image rm name
change directory to the config file folder: cd /path/path
recreate image: docker compose --env-file config/config.env up --build

Yeah, "rerun" bot is not correct answer, but "recompose" - is.
I made it even simpler -
docker-compose ps docker-compose stop chatgpt_telegram_bot docker-compose rm chatgpt_telegram_bot docker-compose build chatgpt_telegram_bot docker-compose up -d

Nice!

It's more convenient to bind mount config volume into the continer:
version: "3"

services:
  mongo:
    container_name: mongo
    image: mongo:latest
    restart: always
    ports:
      - <IP_ADDRESS>:${MONGODB_PORT:-27017}:${MONGODB_PORT:-27017}
    volumes:
      - ${MONGODB_PATH:-./mongodb}:/data/db
    # TODO: add auth

  chatgpt_telegram_bot:
    container_name: chatgpt_telegram_bot
    command: python3 bot/bot.py
    restart: always
    build:
      context: "."
      dockerfile: Dockerfile
    depends_on:
      - mongo
    volumes:
      - ./config:/code/config

  mongo_express:
    container_name: mongo-express
    image: mongo-express:latest
    restart: always
    ports:
      - <IP_ADDRESS>:${MONGO_EXPRESS_PORT:-8081}:${MONGO_EXPRESS_PORT:-8081}
    environment:
      - ME_CONFIG_MONGODB_SERVER=mongo
      - ME_CONFIG_MONGODB_PORT=${MONGODB_PORT:-27017}
      - ME_CONFIG_MONGODB_ENABLE_ADMIN=false
      - ME_CONFIG_MONGODB_AUTH_DATABASE=chatgpt_telegram_bot
      - ME_CONFIG_BASICAUTH_USERNAME=${MONGO_EXPRESS_USERNAME:-username}
      - ME_CONFIG_BASICAUTH_PASSWORD=${MONGO_EXPRESS_PASSWORD:-password}
    depends_on:
      - mongo


how to setup Service Worker?

Hey,
Can you please help me with installing and using the service worker?
I need push.js to send notifications to mobile, and enable clicking on the notifications, and by the internet I need a service worker for that.
I googled it but nothing seems to be helpful.
thanks! 😄

Hey, thanks for using Push! To use mobile notifications with Push, first make sure serviceWorker.js and Push are in the same directory. Also make sure the site you're running it on uses SSL. If you don't have SSL on your server you can always grab a cert over at https://letsencrypt.org. Then to create mobile notifications, just call Push as you normally would. If you want to have the notification open a certain page on your site when clicked, check out the link option in the README. If you want a custom click event, check out the onClick option. Let me know if this helps or if you have any other questions.

What code does the serviceWorker.js file should have in order to send Push notifications when the website is not open or on mobile?

Push notifications without the website being open are still in the works. Currently Push's code must be called from an open window. The serviceWorker.js file packaged with the repo contains code that handles the link option, as well as click and close events for mobile notifications.

where can I find this code/explanation of what should this file include?
thanks :)

serviceWorker.js already contains all the code required for it to run correctly, it just needs to be in the same directory as the push.min.js file. You can read more about how to pass data to the service worker in the "Available Options" section of the README

Hey, any progress update on closed window push notifications for this library? We love this package as it has a simple API to use, but the biggest complaint we are getting from our users is they don't get push notifications like other websites when they are expected.
I'd love to help, but I don't even know where to begin to get this functionality working.

Oh hey @ellisio! Guess you haven't heard... version 1.0 of Push has dropped, and the biggest new feature is support for third party plugins. I wrote the first plugin, which adds support for Firebase Cloud Messaging, which DOES allow for closed window notifications! You can check out the docs and install info here. It seems like word about this isn't getting out that well... so if you know anyone else who uses the library, be sure to let them know too! I might post to Hacker News or something about it. Also, net magazine is publishing a tutorial in their September issue about how to hook FCM up with Push, so keep your eye open for it if that's your sort of thing. I'll probably write a blog post about it eventually. Anyway, yeah! Check out the plugin and let me know if you have any questions :) Thanks for using Push.

I'm searching for a lib with closed window push without third party plugin.
So push.js won't work die me?

Examples would be useful, as I currently feel that push.js is no replacement for web-push. Perhaps incorrectly?

serviceWorker.js already contains all the code required for it to run correctly, it just needs to be in the same directory as the push.min.js file. You can read more about how to pass data to the service worker in the "Available Options" section of the README

What about when installed with npm? Where should the SW file be then?


Remove superfluous comment in x-select.js

The issue mentioned in the comment was fixed/merged in https://github.com/tildeio/htmlbars/pull/374/files (and the "form" attribute binding is indeed present in this component).

Looks like ember beta is broken. We'll have to fix that.
Thanks for the PR! :D

I went ahead and lumped this in with some other code clean up and fixed the build for ember beta. https://github.com/thefrontside/emberx-select/commit/a1c8425f1e2f2e794f24a4dd87cb3eeb2e0292f1


cache controller-gen and other binaries in bin folder

It might be better if GHA could cache the files in the bin folder. If not, this will have to be downloaded on each CI run. Not sure how easy that is to set up?
Originally posted by @erikgb in https://github.com/aquasecurity/trivy-operator/pull/209#discussion_r910919299

@padlar please elaborate on process. what is the problem we are trying to solve and more details on the solution

@chen-keinan I can clarify a bit:
This issue was created from a comment from me when reviewing https://github.com/aquasecurity/trivy-operator/pull/209. In this PR we install controller-gen to a local bin-folder. There should be no need to redo that every time, as the binary will remain the same until we change the version. So the suggestion was to cache the bin-folder contents in CI (GHA), as we do here: https://github.com/aquasecurity/trivy-operator/blob/main/.github/workflows/build.yaml#L52-L58

Not require anymore.


(998) Simplify integration tests

Context

We have a lot of unDRY code in our integration tests, which is making navigation within specs and comparison across contexts and specs a little painful. When adding new specs and contexts there's a not insignificant careful copy/paste overhead, which also rears its head in review
Changes in this PR

Simplify assignment and stubbing
DRY up sign in

Release checklist
Release process documentation
As part of our continuous deployment strategy we must ensure that this work is
ready to be released once merged.
Pre-merge

[ ] There are changes required to the Accredited Programmes API for this change to work...

[ ] ... and they have been released to production already

Post-merge

[ ] This adds, extends or meaningfully modifies a feature...

[ ] ... and I have written or updated an end-to-end test for the happy path in the Accredited Programmes E2E repo

[ ] This makes new expectations of the API...

[ ] ... and I have notified the API developer(s) of changes to the contract tests (Pact), or the API is already compliant

[ ] Manually approve release to preprod
[ ] Manually approve release to prod

 Simplify check your answers page integration tests to reuse setup between tests (S)


Adding active count and maximum active count into plugin metrics

Adding the active count (number of active threads in the execution pool) and max active count as metrics in the metrics collector in order to allow data retrieval for these metrics in supported plugins.
Gofmt the projects.

The error is not related to the pull request changes but the CI testing script.


v.2.1.0 Uncaught ReferenceError: ReactiveForms is not defined

Updated to version 2.1.0 and getting that exception on ReactiveForms.createElement({...});
Is there any other breaking change apart from the only one mentioned in version 2.0.0 (i.e. context => formContext)?
Please advise, thanks.

That was my mistake--in converting to JS I forgot to add the export to package.js. Please update to 2.1.1 and try again.

Yes, now the exception is gone.
I'm starting to test the new version now. While waiting for the updated docs, can you please confirm that to address the breaking change in v2.0.0, all is needed is to replace any occurrence like:
{{> UI.contentBlock data=data context=context}}
with
{{> UI.contentBlock data=data context=formContext}}
Thanks

Oh no, you don't need to change that. The formContext change is just for the block helper that wraps the helpers in the actual form block invocation. For example:
{{#defaultFormBlock schema=schema action=action data=data}}
    {{> bootstrapInput field='username'}}

    {{#with formContext}}
      Invalid count: {{invalidCount}}, username field value: {{field 'username'}}
    {{/with}}

  {{/defaultFormBlock}}

Ok, got it. Thanks


Add note in docs about excluding workflow file from dependency update tools

I use Renovate on my repositories which tends to look at the cargo-dist generated workflow, find that it's running builds on ubuntu-20.04 and "helpfully" upgrades it to ubuntu-22.04 which then breaks the plan step of the next release.
It might be of some value to document in the docs how to disable this for some of the popular dependency update solutions: Renovate can do this, but it seems Dependabot itself doesn't support such a feature yet (https://github.com/dependabot/dependabot-core/issues/4364).
I can send in a PR if this is desirable and someone lets me know what page this belongs to.

Interesting! I hadn't considered that this could be a problem; thanks for bringing this up.
As a Renovate user, would it make sense to you for cargo dist init to update your .github/renovate.json to exclude the generated GitHub CI config? If so, would you be interested in working on a change to do that?

Interesting! I hadn't considered that this could be a problem; thanks for bringing this up.
As a Renovate user, would it make sense to you for cargo dist init to update your .github/renovate.json to exclude the generated GitHub CI config? If so, would you be interested in working on a change to do that?

I wouldn't be averse to this being automatically configured, but Renovate supports both JSON5 and JSON as well as a bunch of paths where the config could exist which makes this a bit more involved. I also don't know if Rust has a format preserving JSON parser which wouldn't reformat the entire file when writing the updated config in.


Include an example of how to serialize a graph (to Turtle string)

Found something useful here: https://github.com/linkeddata/rdflib.js/blob/master/tests/serialize/data.js#L101


Bump navstar

High Level Description

Fix inconsistent state error in minuteman

Related Issues

DCOS_OSS-1472 Inconsistent state of minuteman

Checklist for all PR's

[x] Included a test which will fail if code is reverted but test is not. If there is no test please explain here:
[x] Read the DC/OS contributing guidelines
[x] Followed relevant code rules Rules for Packages and Systemd

https://github.com/dcos/navstar/pull/87
Checklist for component/package updates:
If you are changing components or packages in DC/OS (e.g. you are bumping the sha or ref of anything underneath packages), then in addition to the above please also include:

[x] Change log from the last version integrated (this should be a link to commits for easy verification and review): example
[x] Test Results: [link to CI job test results for component]
[x] Code Coverage (if available): [link to code coverage report]

PLEASE FILL IN THE TEMPLATE ABOVE / DO NOT REMOVE ANY SECTIONS ABOVE THIS LINE
Instructions and Review Process
What is the review process and when will my changes land?
All PRs require 2 approvals using github's pull request reviews.
Reviewers should be:

Developers who understand the code being modified.
Developers responsible for code that interacts with or depends on the code being modified.

It is best to proactively ask for 2 reviews by @mentioning the candidate reviewers in the PR comments area. The responsibility is on the developer submitting the PR to follow-up with reviewers and make sure a PR is reviewed in a timely manner. Once a PR has 2 ship-it's, no red reviews, and all tests are green it will be included in the next train.

@mesosphere-mergebot bump-ee

@GoelDeepak @drewkerrigan @nlsun Could you please review this PR?

@mesosphere-mergebot label [Ready For Review]


Sample of mocking IPublishedContent

Thanks @mortenbock - it's very much appreciated! #h5yr
@JimBobSquarePants - We can get started with our unit-tests now :metal:

Whooooop! Excellent work @mortenbock


Mr. X only uses taxis

Mr. X has the ability to use all modes of transportation (including the river), but in testing, it looks like he only uses taxis. That's fine if this is the optimal path for Mr. X (given the currently implemented algo), but I'm not sure that it is.

Resolved by adding figure starting positions. https://github.com/ryanlewist/scotland-yard/commit/b4ca9b022380126cf3c3de8cffdc895fa20f26f4


Clean up Regexes

Changes
Prior to this commit, the regexes in substitution.go file were hard to
understand and hard to reuse because of the complexity of the regexes.
For example, we have to consider

all the three notations (dot notation, bracket with single quote,
and bracket with double quote)
the suffix of indexing part including star operator and
int indexing that was not included before.

Also the old regex coupled each notation part with the indexing
part, which leads to extra step to be done in the extract-related functions
i.e. have to trim the [*] every time.
In this fix, we clean up the regexes and make it as much reable and
reuseble as possible.
There will be more PRs to come to clean up considering the
complexity of the all regexes in substitution.go and its usage everywhere.
Also results-related regexes in resultref.go file need cleanup too.
/kind cleanup

Submitter Checklist
As the author of this PR, please check off the items in this checklist:

[ ] Has Docs included if any changes are user facing
[ ] Has Tests included if any functionality added or changed
[ ] Follows the commit message standard
[ ] Meets the Tekton contributor standards (including
functionality, content, code)
[ ] Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
[ ] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
[ ] Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes
NONE

/approve
Nice! Getting out of obfuscated regex hell is a good thing, to say the least.

/test pull-tekton-pipeline-alpha-integration-tests

/test pull-tekton-pipeline-alpha-integration-tests

/retest

/retest

/lgtm

/test pull-tekton-pipeline-alpha-integration-tests

/test pull-tekton-pipeline-alpha-integration-tests

/retest

Ok, pull-tekton-pipeline-alpha-integration-tests keeps failing on the same example tests, which makes me think there is a legit issue.

Ok, pull-tekton-pipeline-alpha-integration-tests keeps failing on the same example tests, which makes me think there is a legit issue.

Thanks @abayer for helping retest. https://github.com/tektoncd/pipeline/pull/5222 that only updates doc files failed same 3 tests in alpha integration test. Let me retry.

/test pull-tekton-pipeline-alpha-integration-tests

/retest

/retest

@chuangw6 The fact they keep failing in exactly the same way every time really makes me think there's a problem with the regex changes. Might be worth trying to replicate param patterns in those examples as unit tests?

fwiw, I've verified locally that the Pipeline in examples/v1beta1/alpha/pipelinerun-param-array-indexing.yaml fails validation. So yeah, there's an issue. =)

Ok, I took your branch and added this as a test case to pkg/apis/pipeline/v1beta1/pipeline_validation_test.go's TestValidatePipelineParameterVariables test:
{
	name: "array index param - using the value of an array index as a string param",
	params: []ParamSpec{{
		Name: "myArray",
		Type: ParamTypeArray,
	}},
	tasks: []PipelineTask{{
		Name:    "bar",
		TaskRef: &TaskRef{Name: "bar-task"},
		Params: []Param{{
			Name: "a-param-intended-to-be-from-an-array-index", Value: ArrayOrString{Type: ParamTypeString, StringVal: $(params.myArray[0])"},
		}},
	}},
}

...and the test case fails on your branch, while passing on main. So yeah, something is definitely broken there.

/approve cancel

fwiw, I've verified locally that the Pipeline in examples/v1beta1/alpha/pipelinerun-param-array-indexing.yaml fails validation. So yeah, there's an issue. =)

Thanks @abayer for helping find out this. I'll fix it.

/retest

/test pull-tekton-pipeline-integration-tests

Hi @abayer,
I've solved the issue and also added the test. Please take a look. Thanks.

/retest

/retest

/retest

/lgtm

/retest

@lbernick Since this PR has been changed a bit, please take a look again.
Thanks!

Hey @lbernick @JeromeJu @abayer
Thank you so much for taking your time to review this PR. I saw this as non-urgent and was distracted by other tasks, so I didn't work on this after then.
Just temporally mark this as closed. Will pick this up later and get it ready for review. Thanks again!


Add API to get commits of PR

fixes #10918
Co-authored-by: Andrew Bezold<EMAIL_ADDRESS>based on the changes in PR https://github.com/go-gitea/gitea/pull/12118

Codecov Report

Merging #16300 (8e06bb5) into main (6554835) will increase coverage by 0.03%.
The diff coverage is 54.38%.

@@            Coverage Diff             @@
##             main   #16300      +/-   ##
==========================================
+ Coverage   45.42%   45.46%   +0.03%
==========================================
  Files         709      709
  Lines       83500    83556      +56
==========================================
+ Hits        37929    37986      +57
+ Misses      39490    39476      -14
- Partials     6081     6094      +13

Impacted Files
Coverage Δ

routers/api/v1/repo/pull.go
31.08% <52.72%> (+2.93%)
:arrow_up:

models/list_options.go
65.21% <100.00%> (+21.73%)
:arrow_up:

routers/api/v1/api.go
78.46% <100.00%> (+0.02%)
:arrow_up:

models/unit.go
41.09% <0.00%> (-2.74%)
:arrow_down:

modules/queue/unique_queue_disk_channel.go
47.26% <0.00%> (-1.37%)
:arrow_down:

routers/web/repo/view.go
40.88% <0.00%> (-0.58%)
:arrow_down:

services/pull/pull.go
41.99% <0.00%> (-0.44%)
:arrow_down:

modules/queue/workerpool.go
54.19% <0.00%> (-0.39%)
:arrow_down:

modules/log/event.go
61.79% <0.00%> (+1.88%)
:arrow_up:

... and 7 more

Continue to review full report at Codecov.

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

@sebastian-sauer thanks for contrib ;)


Testing steps | Adjust WIP protection policy

Hello,
Seems using Microsoft Monitoring Agent we can retrieve event log: "Microsoft-Windows-EDP-Application-Learning/Admin",
From AAD joined or ADD registered + MDM Enrolled devices, some discussion in: https://github.com/MicrosoftDocs/azure-docs/issues/31097
Maybe could be added here as alternative solution like: "Use Microsoft Monitoring Agent and Intune to adjust WIP protection policy".
During tests I see that Device Health is more complicated setup than installing "Log Workspace and Microsoft Monitoring Agent"
Is it possible that we initialize review from product team, to see if using Microsoft Monitoring Agent solution, can be really used here for adjusting WIP protection policy / WIP Learning?

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

ID: 43e35d03-23d6-e006-b083-582bd33d4ae4
Version Independent ID: 7ab70933-c45e-c601-548b-07ad0c89cd59
Content: Fine-tune Windows Information Protection (WIP) with WIP Learning
Content Source: windows/security/information-protection/windows-information-protection/wip-learning.md
Product: w10
Technology: windows
GitHub Login: @Justinha
Microsoft Alias: justinha

@officedocsbot assign @e0i

Hello, @lightupdifire
Would you be able to clarify what needs to be updated in the documentation? Is the document misleading?
We would like to follow-up with content updates accordingly.
Thank you for providing feedback.

Hello @e0i,
This document explains "how to adjust WIP protection policy using Device Health",
But there is an alternative way to do so, using Log Analytics Workspace and Microsoft Monitoring Agent..
So do you want to deploy Device Health that require Device Reliability, Upgrade Readiness, Update Compliance, Windows 10 E3/E5 license etc. to get WIP logs for adjusting WIP policy?
Or deploy only Workspace and MMA?

@lightupdifire  the link you have mentioned has still not under working. That being said is there any specific contents that you want to be added in this document. Let me know and if required I can update the content and send your suggestion to the doc owner.
Regards
Imran

@joinimran
Using Microsoft tools, I found alternative way, how to retrieve WIP data from devices, so without Device Health.
I could also set a monitoring and trigger alert, when WIP protection removed from more than 100 files.
If you think this information shouldn't be available, then yes, we shouldn't update this document.


Library throws strings instead of error objects

This is pretty bad because it makes it impossible to trace errors.
I think it would be a relatively easy fix here https://github.com/UrielCh/opencv4nodejs/blob/master/cc/native-node-utils/TryCatch.h#L32 unfortunately my CPP game is terrible and I've never worked on any CPP node modules.

Repro: new require('@u4/opencv4nodejs').Mat().getDataAsArray()

Thank you for pointing out the file that needs correction. I'm currently facing homelessness, so I'll address that once I've resolved this pressing issue.

Hey, I hope you're doing better, I'm interested in contributing, would you be able to provide some pointers on how to resolve this issue? Right now our workaround looks like this:
// Manually patch all opencv.* opencv.Mat/Contour.prototype.* methods to not throw strings

import * as cv from 'opencv4nodejs';

export class OpenCVWrappedError extends Error {
  public override name = 'OpenCVWrappedError';
  public constructor(
    message: string,
    public readonly functionName: string
  ) {
    super(`${functionName}: ${message}`);
  }
}

const patchNoThrowString = (obj: Record<string, unknown>) => {
  for (const [key, value] of Object.entries(obj)) {
    // ignore what is likely classes
    if (
      typeof value !== 'function' ||
      key[0]!.toUpperCase() === key[0] ||
      !!Object.keys(value.prototype as object).length
    ) {
      continue;
    }

    // eslint-disable-next-line unicorn/prefer-ternary
    if (key.endsWith('Async')) {
      // we specifically use a different name, `jest` in it's infinite wisdom resets js modules but NOT native modules
      // which leads to opencv loading multiple times but not it's bindings
      // further it relies on `.prototype.constructor.name` being present thus this function cannot be async...
      // eslint-disable-next-line @typescript-eslint/promise-function-async
      obj[key] = function asyncProxy(...args: unknown[]) {
        // eslint-disable-next-line @typescript-eslint/return-await
        return (value as (...args: unknown[]) => Promise<unknown>)
          .call(this, ...args)
          .catch((error: unknown) => {
            if (typeof error === 'string') {
              throw new OpenCVWrappedError(error, key);
            }
            throw error;
          });
      };
    } else {
      obj[key] = function proxy(...args: unknown[]): unknown {
        try {
          return value.call(this, ...args) as unknown;
        } catch (error) {
          if (typeof error === 'string') {
            throw new OpenCVWrappedError(error, key);
          }
          throw error;
        }
      };
    }
  }
};

// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
patchNoThrowString(require('opencv4nodejs') as Record<string, unknown>);
patchNoThrowString(cv.Mat.prototype as unknown as Record<string, unknown>);
patchNoThrowString(cv.Contour.prototype as unknown as Record<string, unknown>);


Zooming does not make the path to zoom as well

Hello ,
It is a good library to use in the app. But I noticed a thing about it that
I used it in my app and figured out that it draws a line between two points , but when I zoom the map, the line drawn stays at same location .
can this be solved ?
please let me know.

That's the default functionality of the overlay. Hopefully zooming of the line will be implemented in the future but I don't have a tentative time line for this.


Heroku application error

Is this not working or am I doing it wrong?
I tried running in my own host, didn't work as well.

Yeah that's an error, can you view the logs for details?
A possible issue is one that's been seen by others before and has workaround here:
https://github.com/HermanFassett/youtube-scrape/issues/15#issuecomment-664034473

here you go. I see that the demo you're providing works fine.

Did you resolve?

Not yet, I want to use this in my hosting, can I do that?


Add escaping on %

Hi there! This PR should help make sure suggested strings containing % don’t end up as errors.
I’ve added a minor README change to help along people that would like to contribute, as well. Let me know if you’d rather not have this or have it be split in another PR.
Cheers!

Thank you so much @sunny! I hadn't actually considered the case of escaping.
No need to split the PR, but please could you add another assertion or two to demonstrate this? Something like ["the %year is 2021", "the %%year is %Y"] could work. Or even better, the actual string you needed that prompted this PR. Much appreciated 🙏

Done! I went full-throttle with a ["the %year is %2020%", "the %%year is %%%Y%%"].
What prompted this PR was simply curiosity. I don’t have a real use-case but simply wondered how to escape the % in Ruby’s strftime, and thought https://strftimer.com/ could help me answer that. Now, it can 😁


Standardize error responses for tremor api

Pull request
Standardize error responses for tremor api.
Description
Ensure that tremor API error responses are consistently formatted for all error paths -- defaults as json and respects the accept request header when present (for values of json and yaml).
Looked into doing this more cleanly via tide's middleware (eg: based on their error handling example), but looks like it's not possible to consider request while modifying the outgoing response there (which we need to do to respect the request accept header).
Related

Related Issues: fixes #483
Related docs PR

Checklist

[x] The RFC, if required, has been submitted and approved
[ ] Any user-facing impact of the changes is reflected in docs.tremor.rs
[x] The code is tested
[x] Use of unsafe code is reasoned about in a comment

coverage changes are wonky. merging! :)


REWARDS: Placeholder indication of what should be there when there is no real data

The Chore
Find a way to be able to put the rewards page live that shows you the sort of data / shape of data you would expect to see on the page when there isn't real data (and it is clear it isn't real)
Tasks

[ ] What do we need to do first
[ ] and then what?
[ ] Etc.

Additional details / background info

Here is the placeholder state if there is no data to display: Figma link ↳
Icon + $Vega with the text "Coming soon" below it.
Attached is the icon used for the placeholder state @2x


Update Gradle to 6.8.3

https://docs.gradle.org/6.8.3/release-notes.html

This PR was released with 0.22.1


Feature request: plugin instance lifecycle hooks

Currently, I don't think there's a simple way to perform expensive initialization steps that depend on each plugin instance Config attributes.
For instance, I'm currently working on a (private) plugin that has a parameter_name config setting, which refers to AWS SSM Parameter Store. This value is relatively stable, can be cached for long periods, and is needed on my Access implementation.
Currently, I have to do something along these lines:
type Config struct {
    ParameterName `json:"parameter_name"`
    parameterValueInit sync.Once
    parameterValue string
}

func (c *Config) Access(kong *pdk.Pdk) {
  c.parameterValueInit.Do(func() {
    c.parameterValue = actuallyGetParameter(c.ParameterName)
  })

  // actually use c.parameterValue
}

Which means that the first request per plugin instance is burdened with this extra latency.
At first glance, the plugin constructor function would be the place for this kind of expensive shared initialization, but at that point I don't have ParameterName yet. Which means that I can only perform initialization that is global and doesn't depend on plugin configuration.

My suggestion here would be to introduce some kind of "init" hook, called after plugin instance construction but before any requests are served to the plugin instance. If applied to the example above, it could become something like this:
type Config struct {
    ParameterName `json:"parameter_name"`
    parameterValue string
    // Once is no longer necessary
}

// only called once per plugin instance
// assuming ParameterName is already unmarshalled here
func (c *Config) Init() {
    c.parameterValue = actuallyGetParameter(c.ParameterName)
}

func (c *Config) Access(kong *pdk.Pdk) {
  // simply use c.parameterValue
}

I also feel like some kind of shutdown hook could be useful. It could be used for things like flushing/closing files etc; for instance, the current go-log example plugin leaks file descriptors as far as I can tell.

you could do the parameter initialization in your Access method and then check if it's already set to avoid doing it twice.

That's basically what I'm doing today, but that shifts the burden of initializing this resource to the first request(s).
In my case it's not an unacceptable delay, fortunately; however, I have a plugin that executes in <2ms on average, but then for the first request executes in >100ms.
What I'm wondering here is whether it would be possible to perform this initialization before the first request arrives

we've explicitly avoided to specify instance lifecycle to allow more flexibility in execution.  for example, currently each Kong worker initiates a separate connection with the external plugin, and keeps their own list of instances; but it could change to a shared resource, so a single instance could serve several workers.  Or, in the other direction, we could find better to spawn several instances and balance the load between them.  Besides, instances are closed on the Go side after some idle time, and Kong has to respawn a new one when needed.
As you can see, if we added an initialization phase, it would basically happen on the first request (or the first request handled by each worker, or the first request in a while), with the same end result as just doing it in the current phases.

Thanks for the clarification, that makes sense! I'll close the issue then.
I guess I was implicitly assuming that the plugin was instantiated right when it is added to a route/service on Kong, not lazily.
I only have a related follow-up question: from your message I assume that (at least currently) the same plugin instance won't be handling two requests at the same time - which means that using synchronization primitives to modify instance-local properties (like caches) would be unnecessary. Is this something that can be relied upon long-term? Or would it be better to synchronize anyway, for forward compatibility?

I assume that (at least currently) the same plugin instance won't be handling two requests at the same time

no, that's not correct.  In the Lua side each worker handles several requests concurrently (can be many tens of thousands easily) by using coroutines.  In the Go side, it does the same with many Goroutines on each plugin instance, which can be handled by several threads to balance work among cores.
please, wrap any mutable shared state with synchronization primitives.

As you can see, if we added an initialization phase, it would basically happen on the first request (or the first request handled by each worker, or the first request in a while), with the same end result as just doing it in the current phases.

@javierguerragiraldez I have another scenario tho. I have a computed data structure is based on config, and this data structure is for more efficient access to the config values in the following requests.
I mean I can save it to a global variable, but the problem is that I don't know when the config has changed and I need to reload the computed data structure. I mean I can re-serialize the config and store a checksum, but that's doing unnecessary work,  having a hook method for StartInstance is a better way than a global variable IMO.

Actually scratch that, I if put the computed property in the Config struct, every time the config is reloaded, a new instance will be created with the new config string, so the computed property will be empty again. So I can simply based on whether that config field is empty to determine whether I need to initialize that computed field.

@jchenship just keep in mind that multiple Config structs might be instantiated for the exact same config struct, so if it is paramount that you only compute this expensive initialization once, you'll need other kinds of storage.
In my case, I ended up using a global map (protected by a Mutex), where values are the result of the expensive initialization, and keys are JSON-ified config structs.

@renato-zannon Thank you for the info. :+1:
I think for my situation I'm ok for the computed field to be re-initialized from time to time, e.g. when config is changed (config auto reload is important for me), or kong decided to stop the instance after idling sometime and then restart it. I'm also using a mutex for initializing the computed property.
But using a global var definitely works as well.


Community page hi

Fixes :  #39596
New feature has been added communtiy page in hindi please review it and ping me if any changes had to be made on this repository.

It seems that you opened another PR #39672 with reflecting review comments within it, so let me mark this PR as a duplicate.
/triage duplicate

Since PR #39672 is active and under review (and this is marked as duplicate PR), hence closing this PR.
/close


feat: add ArtStation social network link and icon

Adds support for the ArtStation user profile. ArtStation is a popular social platform used primarily to showcase art portfolios (high-res images, videos, 3D scenes, etc.), sell digital assets and prints, or find industry work as an artist.

Thank you!


🐞 Dagger exits with panic error & freezes my terminal

What is the issue?
Ran dagger run --focus node --loader ts-node/esm ./ci.mts which contains wrapper code over Dagger SDK in typescript
It runs sucessfully, but out of the blue i get this error. When i create a new terminal it starts working again & then again after some time i get this erro
Log output
Cannot copy logs, the terminal just freezes when dagger exits. Attaching screenshot

Steps to reproduce
java.mts
import { connect, Client, Container, Directory } from<EMAIL_ADDRESS>
// This uses TypeScript syntax for interfaces
interface Pipeline {
    installDependencies(
        applicationRootDirectory?: string
    ): void;
    build(): void;
    lint(): void;
    sca(): void;
    run(): void;
}

class AutoPipelineContainer {
    private from: string;
    private command: string;

    constructor(from?: string, command?: string) {
        this.from = from || ""
        this.command = command || ""
        console.log("=================== Seting command 2", this.command, this.from);
    }

    getFrom(): string {
        return this.from
    }

    getCommand(): string {
        console.log("=================== Seting command", this.command);
        return this.command
    }
}

class BuildDaggerContainer {
    private c: Client
    private apc: AutoPipelineContainer;
    private applicationRootDirectory: string;

    constructor(rc: AutoPipelineContainer, c: Client, applicationRootDirectory?: string) {
        this.apc = rc
        this.c = c
        this.applicationRootDirectory = applicationRootDirectory || "";

    }

    runContainer(): Container {
        const source = this.c.host().directory(".", {})

        let contd: Container = this.c.container()
        console.log("=================== Seting command 3", this.apc.getFrom(), this.apc.getCommand(), this.applicationRootDirectory);
        contd.from(this.apc.getFrom())
            .withExec(["bash", "-c", this.apc.getCommand()])
            .withDirectory("/mnt", source)
            .withWorkdir("/mnt")
            .stdout()
        return contd
    }
}

class JavaPipeline implements Pipeline {
    // @ts-ignore
    private idb: InstallDependenciesBuilder;
    private applicationRootDirectory: string;
    constructor(applicationRootDirectory?: string) {
        this.applicationRootDirectory = applicationRootDirectory || "";
    }

    installDependencies(): InstallDependenciesBuilder {
        this.idb = new InstallDependenciesBuilder(this);
        return this.idb;
    }

    build(): BuildBuilder {
        return new BuildBuilder(this);
    }

    lint() {
        // Java-specific linting logic
    }

    sca() {
        // Java-specific static code analysis logic
    }

    run() {
        connect(
            async (client: Client) => {
                // get reference to the local project

                const bc: BuildDaggerContainer = new BuildDaggerContainer(this.idb.getContainer(), client, this.applicationRootDirectory)
                bc.runContainer()

            },
            { LogOutput: process.stderr }
        )
    }
}

class InstallDependenciesBuilder {
    private javaPipeline: JavaPipeline;
    // @ts-ignore
    private container: AutoPipelineContainer;

    constructor(javaPipeline: JavaPipeline) {
        this.javaPipeline = javaPipeline;
        // this.container = new RespectContainer();
    }

    maven(): JavaPipeline {
        // Maven-specific build logic
        return this.javaPipeline;
    }

    gradle(
        version?: string,
        command?: string
    ): JavaPipeline {

        command = command || "cd /mnt/app; pwd; gradle"
        version = version || ""
        const from: string = 'openjdk' + version
        this.container = new AutoPipelineContainer(from, command)

        return this.javaPipeline;
    }

    getContainer(): AutoPipelineContainer {
        return this.container
    }
}

class BuildBuilder {
    private javaPipeline: JavaPipeline;
    // private container = Container;

    constructor(javaPipeline: JavaPipeline) {
        this.javaPipeline = javaPipeline;
        // this.container = new Container;
    }

    maven(): JavaPipeline {
        // Maven-specific build logic
        return this.javaPipeline;
    }

    gradle(): JavaPipeline {
        // Gradle-specific build logic
        return this.javaPipeline;
    }

    getContainer(): Container {
        let c: Container = new Container;

        return c
    }
}

export default JavaPipeline

ci.mts
import JavaPipeline from "./java.mjs";
const p = new JavaPipeline("app");
p.installDependencies().gradle()
p.run()

Dagger service is running on docker container v0.8.4 version
Run: 5-7 times (I used to keep change my execution command: ls, pwd, etc... for testing purpose in the code)
dagger run --focus node --loader ts-node/esm ./ci.mts
SDK version
"devDependencies": {<EMAIL_ADDRESS>"^0.8.4",     "ts-node": "^10.9.1",     "typescript": "^5.2.2"   },
OS version
Linux

@sharadregoti Sorry for the late response, could you solve your issue?
According to the logs, it looks like a buildkit issue with authentication.
You should try our new module system and see if you still hit that issue if it's still relevant.
You can start converting your pipeline to a module following this TS guide

I'm closing this issue since we didn't had any news so far, feel free to reopen it with more details if that issue is still happening :)


Display center value whenn no marking or mouse hover

When there is no marking or no mouse hovering, the center value should show a value for the full donut data.

This was closed as per #74.


Getting blank page when trying to "View Details" of event

Issue
When I try to click "View Details" on an event that I've created, I get a blank page. When I open the console, there are some error messages.
Browsers used:

Chrome (Version 60.0.3112.113 (Official Build) (64-bit))
Firefox (Version 55.0.3 (64-bit))

Operating system and version:

OS X 10.11.6

Additional Notes
I've run into this problem on both Chrome and Firefox.
I've used incognito mode to make sure there's nothing in the cache that could be affecting it.
Steps to replicate (using Chrome)

Go to the dashboard. Everything loads just fine.

Click "View Details" on the event.

Nothing is displayed. There are some error messages in the console.

Steps to replicate (using Firefox)

Go to the dashboard. Everything loads just fine.

Click "View Details" on the event.

Nothing is displayed. There are some error messages in the console. Note: The entire error message isn't shown as it doesn't fit on the screen.

Hey! @Greenheart tks for the detailed issue. Can you just copy/paste here the event url?

Hi @jrogatis , here's the event url:
https://meeting.freecodecamp.org/event/59cb1e141f9aac1956bb5d1c

it's working for me... Can you try to run the app locally and help us with more details about the bug ? @gregorywong  ?

@jrogatis Sure, but it might take me some time to do that. I also tried replicating the issue, but I was only able to do it once (even though I created identical events). So I haven't been able to figure out what's causing the issue yet.

@jrogatis I'm afraid this might be beyond my ability, as I had trouble even just getting it to work locally.
I set up the Google API credentials, and was able to connect to Google:

But after clicking "Allow", I get this:

you need to set the callback at the google api http://localhost:8080/api/auth/google/callback @gregorywong

@jrogatis Do you mean on this page? It was already set.


Change tab programmatically

In previous version it was able to change current tab programmatically by Actions.refresh({ key: 'tab_1' }), but now it doesn't work. According to the docs I guess it doesn't work because of refresh action now refreshing only current scene. So may be someone know the solution?
UPD: Fine, I found the solution and it's was easy. If someone will have the same problem - just use default syntax to navigate between scenes (Actions.tab_1() for example).

@fxhereng I don't understand how does tab switch via my solution can create a new scenes stack :) Could you show me your scenes?
In my case it was something like this:
<Scene key="root">
    <Tabs key="tabs">
        <Scene key="tabs_tab1" />
        <Scene key="tabs_tab2" />
    </Tabs>
</Scene>

So if I will use Actions.tabs_tab2() somewhere - I will navigate to this tab.
Anyway if you have the problem with stacked navbar may be you will need to try wrap or hideNavBar property.

Thanks for answering!
When doing Actions.tabs_tab2() it creates a new tab scene and add it to the tab's navigation stack. So I have, after it, two scenes tabs_tab2, and I don't want that kind of behavior.
Finally the solution I found was to do an Actions.replace('tabs_tab2'), it goes to the tab2 and doesn't add up scene to the stack navigation. It refreshes the scene as well, in my case I didn't care but it can be useful too.
Cheers,

Interesting. In my case it works good. Could you give an example with such problem? It's probably a bug because I don't understand how scene change functionality can do something like this. o_O

Pretty similar with yours:
version: 4.0.0-beta21
<Scene key="root">
    <Tabs key="tabs" showLabel={true} swipeEnabled={false} lazy={true} backBehavior={'initialRoute'}>
        <Scene key="tabs_tab1" />
        <Scene key="tabs_tab2" />
    </Tabs>
</Scene>

Doing Actions.tabs_tab2() or Actions.jump('tabs_tab2') adds scene to the navigation stack and duplicates scene.
Actions.replace('tabs_tab2')avoids duplicating the scenes


use type from capture-website

You need to fix the new type errors that now occur with stronger types.


Has an alternative for colab?

I want to debug the code so that good understanding, I originally used vscode but gave up due to my mac did not support cuda so i tried to use colab which however debugging is not good experience to me and each operation is slow.
So have an alternative to replace colab or have you a some tips ?

As per best of my knowledge you will need cuda to compile the MMdetection library because otherwise models won't load properly.
If you don't want to use colab then you will need a Cuda supported GPU  based local machine to run the code.

We have used colab in this Whole research.
As for speeding up the installation of mmdetection in colab, you can clone the mmdetection 1,2 repo in your drive and run installation from there.
However this sometimes introduce cuda runtime error, which will require you to delete the mmdetection from drive and redo the whole process.

@AyanGadpal @DevashishPrasad
Thanks a lot!


Bwn symlink pg top

Adds symlink to pg_top in /usr/bin

:+1:

I had to do this to get it into my path.
alternatives --remove pg_top /usr/bin/bin/pg_top
alternatives --install /usr/bin/pg_top94 pg_top /usr/pgsql-9.4/bin/pg_top 1


Android Studio and Gradle

I had trouble setting up your lib for use in latest AndroidStudio build (v0.3.2) and gradle 0.6.+
I though I could write it down here and maybe you can update the read-me:
First, to include the lib I had to add this to the build.gradle file
dependencies {
 ...
 compile files('libs/android-sqlite-asset-helper.jar')
}

Secondly, the assets folder location must be under src/main/assets as indicated here:
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Project-Structure
Otherwise a "database file not found" error will be thrown.

Thanks for sharing. This page ended by several hours of Search for Database not found error

Secondly, the assets folder location must be under src/main/assets as indicated here:
http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Project-Structure
Otherwise a "database file not found" error will be thrown.


SOLR-15991: analysis-extras module tests shouldn't rely on log4j dependency

https://issues.apache.org/jira/browse/SOLR-15991

Beautiful, and thanks to @hossman for adding this log testing utility!

BTW this sort of minor detail doesn't need a JIRA or CHANGES.txt entry


Automate releases to SDKMAN

@lwronski We can probably merge, we'll just see how it goes when cutting the next release…

@lwronski LGTM! I see you used --silent for curl but it would still be diligent to double-check that the credentials aren't leaked in the logs somehow. That's just me be overly cautious :smile:


Translations de en

I went over the English and German translations. I am a native German speaker and fluent in English, so these are the two languages where I can guarantee that I do better than DeepL. Didn't have a look at the other languages yet.
See the individual commits for what exactly I changed.

Filmrolle is suggested by another user. In fact, I borrow Camera Roll directly from iOS.