Issue on running the README quickstart script with python 3.8 interpreter

I tried the quickstart snippet on the readme:
import asyncio
from proxybroker import Broker

async def show(proxies):
    while True:
        proxy = await proxies.get()
        if proxy is None: break
        print('Found proxy: %s' % proxy)

proxies = asyncio.Queue()
broker = Broker(proxies)
tasks = asyncio.gather(
    broker.find(types=['HTTP', 'HTTPS'], limit=10),
    show(proxies))

loop = asyncio.get_event_loop()
loop.run_until_complete(tasks)

Which gave me this Traceback:
Traceback (most recent call last):
File "C:\Users\boxxo\PycharmProjects\pythonProject12\main.py", line 13, in
broker = Broker(proxies)
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\proxybroker\api.py", line 67, in init
self._loop = loop or asyncio.get_running_loop()
RuntimeError: no running event loop

To Reproduce
Steps to reproduce the behavior:

New environment with conda which automatically adds to the env these packages:

ca-certificates | 2022.07.19 |
certifi | 2022.9.24 |
openssl | 1.1.1q |
pip | 22.2.2 |
python | 3.8.13 |
setuptools | 63.4.1 |
sqlite | 3.39.3 |
vc | 14.2 |
vs2015_runtime | 14.27.29016 |
wheel | 0.37.1 |
wincertstore | 0.2 |

pip install -U git+https://github.com/bluet/proxybroker2.git .

run the snippet as described in the readme and stated above .

Expected behavior
Showing proxies in the console.
Desktop (please complete the following information):

OS: Windows
Browser Not required
Version 11

Additional context
I also tried the below by creating a new loop and assigning it to the Broker constructor.
import asyncio
from proxybroker import Broker

async def show(proxies):
    while True:
        proxy = await proxies.get()
        if proxy is None: break
        print('Found proxy: %s' % proxy)

proxies = asyncio.Queue()
loop=asyncio.new_event_loop()

broker = Broker(proxies, loop=loop)
tasks = asyncio.gather(
    broker.find(types=['HTTP', 'HTTPS'], limit=10),
    show(proxies))

loop = asyncio.get_event_loop()
loop.run_until_complete(tasks)

Which gave me this traceback:

C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\proxybroker\resolver.py:105: DeprecationWarning: The object should be created within an async function
async with aiohttp.ClientSession(
C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\connector.py:767: DeprecationWarning: The object should be created within an async function
super().init(
C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\cookiejar.py:67: DeprecationWarning: The object should be created within an async function
super().init(loop=loop)
Traceback (most recent call last):
File "C:\Users\boxxo\PycharmProjects\pythonProject12\main.py", line 19, in
loop.run_until_complete(tasks)
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\proxybroker\api.py", line 176, in find
ip = await self._resolver.get_real_ext_ip()
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\proxybroker\resolver.py", line 105, in get_real_ext_ip
async with aiohttp.ClientSession(
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\client.py", line 1141, in aenter
self._resp = await self._coro
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\client.py", line 467, in _request
with timer:
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\helpers.py", line 700, in enter
raise RuntimeError(
RuntimeError: Timeout context manager should be used inside a task

I've read that it doesn't support python version 3.10 here : here but I think it should be supporting 3.9/3.8 ? Read it from this commit .
Also I've tried running the same script on a FastAPI instance and it works just fine on 3.8 (not tested yet in 3.9, if needed I can update you on this).

@afunTW @vincentinttsh @hms5232 @ziloka able to help on this? :sweat_smile:

@afunTW @vincentinttsh @hms5232 @ziloka able to help on this? 😅

This happened in Python 3.9 too.
Traceback (most recent call last):
  File "E:\code\pb109\main.py", line 11, in <module>
    broker = Broker(proxies)
  File "C:\Users\hms5232\AppData\Local\pypoetry\Cache\virtualenvs\pb109-DO4mlOl7-py3.9\lib\site-packages\proxybroker\api.py", line 67, in __init__
    self._loop = loop or asyncio.get_running_loop()
RuntimeError: no running event loop

I use poetry run a virtual env and here is pyproject.toml:
[tool.poetry]
name = "pb109"
version = "0.1.0"
description = ""
authors = ["Your Name<EMAIL_ADDRESS>readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8.3"
wincertstore = "0.2"
certifi = "2022.9.24"
proxybroker = {git = "https://github.com/bluet/proxybroker2.git"}

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

run pip list in virtual env:
Package            Version
------------------ ---------
aiodns             3.0.0
aiohttp            3.8.3
aiosignal          1.2.0
async-timeout      4.0.2
attrs              22.1.0
cachetools         5.2.0
certifi            2022.9.24
cffi               1.15.1
charset-normalizer 2.1.1
click              8.1.3
colorama           0.4.6
frozenlist         1.3.1
idna               3.4
maxminddb          2.2.0
multidict          6.0.2
pip                22.2.2
proxybroker        2.0.0a4
pycares            4.2.2
pycparser          2.21
setuptools         65.3.0
wheel              0.37.1
wincertstore       0.2
yarl               1.8.1

I'm not sure that is a bug or something I miss. Somebody can help?

This seems to work
"""Find and show 10 working HTTP(S) proxies."""

import asyncio

from proxybroker import Broker

async def show(proxies):
    while True:
        proxy = await proxies.get()
        if proxy is None:
            break
        print('Found proxy: %s' % proxy)

proxies = asyncio.Queue()
loop = asyncio.get_event_loop_policy().get_event_loop()
broker = Broker(proxies, loop=loop)
tasks = asyncio.gather(broker.find(types=['HTTP', 'HTTPS'], limit=10), show(proxies))

loop.run_until_complete(tasks)

the reason is because you need to pass the loop into the Broker constructor.
On python 3.10 it seems like theres a deprecation warning that I did not think of previously

https://github.com/bluet/proxybroker2/commit/a2715be8e516e67babd7139d965477fc12a764df
now that i think about it, i unintentionally broke the examples

so the example actually works, i just need a change to be made to fix the thing I didn't know i broke

Related #110
Merge this and the basic example should work without any changes

Merged 👍

"""Find and show 10 working HTTP(S) proxies."""

import asyncio

from proxybroker import Broker

async def show(proxies):
    while True:
        proxy = await proxies.get()
        if proxy is None:
            break
        print('Found proxy: %s' % proxy)

proxies = asyncio.Queue()
loop = asyncio.get_event_loop_policy().get_event_loop()
broker = Broker(proxies, loop=loop)
tasks = asyncio.gather(broker.find(types=['HTTP', 'HTTPS'], limit=10), show(proxies))

loop.run_until_complete(tasks)

AttributeError: 'TransportSocket' object has no attribute 'close'
Exception ignored in: <function _SelectorTransport.del at 0x0000022F4DA47060>
Traceback (most recent call last):
File "C:\Users\Javascript\AppData\Local\Programs\Python\Python311\Lib\asyncio\selector_events.py", line 836, in del
self._sock.close()


Test SEA upgrade to 1.5.4 for AWS ECF Live

Describe the issue
Execute the test plan in CPFScrumTeam/QA/Test Plan/
Acceptance Criteria

A report (or collection of reports) with found problems or simply the test results. The folder location will be CPFScrumTeam/QA/Test Plan/AWS ECF Live - Test Results
A report indicating, if any, the differences between the current SEA version and the previous version (Note: some of the changes may be expected or by design, not due to bugs)
Test plan includes the creation of a new project set, setting app the serverless and containers app using the new account and recreating serverless and containers app for an existing account.

Test successfully completed. Result in Teams folder Quality Assurance > AWS ECF Live >Test Results


E2E test failed randomly caused by FAIL: TestE2E/consumer

Description
It is probably a flaky test. Need to investigate it one day.
Environment

HTNN version:

I ran the TestE2E/consumer more than 60 times but it never failed on my machine.
Handling connection for 10000
    suite.go:207: send HTTP request GET /echo at 2024-07-30 12:01:38.988995 +0800 CST m=+6.721126043
Handling connection for 10000
    suite.go:207: send HTTP request GET /echo at 2024-07-30 12:01:40.012405 +0800 CST m=+7.744528210
Handling connection for 10000
=== NAME  TestE2E
    suite.go:167: port-forward stopped
--- PASS: TestE2E (7.75s)
    --- PASS: TestE2E/consumer (3.31s)
PASS
ok  	mosn.io/htnn/e2e	8.899s
+ sleep 1
+ ((  i++  ))
+ true
+ echo 'Run 60 times'
Run 60 times
+ go test -count 1 -v -run 'TestE2E/consumer$'
=== RUN   TestE2E
    k8s.go:73: Updating name e2e, kind Namespace
    k8s.go:73: Updating name default, kind Gateway
    k8s.go:73: Updating name backend, kind Service
    k8s.go:73: Updating name backend, kind Deployment

I ran the TestE2E/consumer with tests before it more than 60 times but it never failed on my machine.
--- PASS: TestE2E (10.47s)
    --- PASS: TestE2E/bandwidth_limit (2.03s)
    --- PASS: TestE2E/buffer (0.90s)
    --- PASS: TestE2E/consumer (2.94s)
PASS
ok  	mosn.io/htnn/e2e	11.397s
+ sleep 1
+ ((  i++  ))
+ true
+ echo 'Run 65 times'
Run 65 times
+ go test -count 1 -v -run 'TestE2E/(consumer|bandwidth_limit|buffer)$'
=== RUN   TestE2E
    k8s.go:73: Updating name e2e, kind Namespace
    k8s.go:73: Updating name default, kind Gateway
    k8s.go:73: Updating name backend, kind Service

It keeps happening in the CI:
https://github.com/mosn/htnn/actions/runs/10317134024/job/28560751242


conda install fails with UnsatisfiableError

When I follow install instructions:
conda env create -f environment.yml -n ocsmesh
conda activate ocsmesh
conda install -y -c conda-forge jigsawpy

I get the following error on the last command (install jigsaw)
❯ conda install -y -c conda-forge jigsawpy
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

@platipodium, this is interesting. I tried creating the environment using both conda and mamba to see if it makes any difference (it does not!), but in any case I got the environment without any errors. Is it possible that since probably conda is using a different mirror, it has different packages available on your side?
One thing you can try that might work is to modify python to be version 3.9 and see if it works. Also to avoid time consuming environment builds, you can install mamba and then try creating the environment using mamba

I created a new python3.9 env with mamba create -n ocsmesh -f environment.yml; conda activate ocsmesh (after changing the python dependency to 3.9), still get an error (but different message)
 mamba install -y -c conda-forge jigsawpy
...
Encountered problems while solving:
  - nothing provides jigsaw >=0.9.12 needed by jigsawpy-0.2.1-py_0

Oh, I see ... you can then just install jigsawpy either from Jigsaw's own repo or by calling python setup.py install_jigsaw in OCSMesh repo which downloads, compiles and installs Jigsaw in your env.

Manual installation of jigsawpy from https://github.com/dengwirda/jigsaw-python works for me.


Bug in Shadow Force and incorrect description

According to Shadow Force's Bulbapedia it no longer deals double damage without an accuracy check on Minimize users. It says that it does in the description and on testing it does that in game. I doubt this was intentional and only that it wasn't updated for gen 7

This is entirely the wrong place to report bugs in Bulbapedia. You should tell them, not us.

To confirm, Penpexgit is correct and I mispoke

@Marty-D ?

We tend not to trust wikis like Bulbapedia and Serebii for mechanics information due to how easily they can be edited, by the way. It never hurts to bring up concerns though if you’re able to test and believe PS has something incorrectly implemented (even if you can’t test, too).

VioletPumpkin is a great researcher, would trust her on this. I tested Shadow Force anyway and it's the same deal. Thanks for bringing this to our attention, @Deathmage777!


Playground/v2.1

Improvements in the playground 2.0
Covered all open issues

Very nice, great job. A couple of points as feedback:

PR size: Can you make smaller PRs (one per issue) instead of pushing those big PRs? Smaller PRs are easier to review
Font size: Can you make the font size of the Inputs the same as the Outputs and Program Info?
Instructions: Nice work with the instructions
Proving / Webworker: Whenever I choose a new example, proving clearly takes longer than 1 second but the toast shows me something in milliseconds. See video attached:

https://github.com/0xPolygonMiden/examples/assets/35031754/799ec2a8-2147-4644-97d5-68210544d028

Game of Life / Catalan / Dft / Shamir (and others): something is broken in the Game of Life, Catalan, Dft, and Shamir example, I get Error: unreachable. In those cases I can click Debug but nothing happens when I click the arrow buttons.
Display stack in Debug Mode: In some cases, e.g. provable compliance, when the stack is displayed in debug, the values overlap and one cannot read them anymore. I think we should display the stack in two rows vertically.

Colors: Can you maybe change the green to the blue / lila that you use in the buttons. I think the playground has too many colors now

PR size: Can you make smaller PRs (one per issue) instead of pushing those big PRs? Smaller PRs are easier to review- Can't segregate the changes now will be difficult
Font size: Can you make the font size of the Inputs the same as the Outputs and Program Info? - Fixed
Proving / Webworker: Whenever I choose a new example, proving clearly takes longer than 1 second but the toast shows me something in milliseconds. - Changed the logic and fixed it
Colors: Can you maybe change the green to the blue / lila that you use in the buttons. I think the playground has too many colors now- Replaced input green with accent color for consistency

Very nice, thanks!

Colors: Can you also make the color in the output box accent for consistency?
Error: unreachable: I get this error on a50d58f7 a lot of times. Can you re-check?
https://github.com/0xPolygonMiden/examples/assets/35031754/63a069cf-26f4-4d74-a827-01322984b888

thanks a lot!
I get some linting issues
[eslint]
src/components/CodingEnvironment/MidenCode.tsx
  Line 75:40:  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
  Line 75:45:  'viewUpdate' is defined but never used    @typescript-eslint/no-unused-vars
  Line 75:57:  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

src/pages/CodingEnvironment.tsx
  Line 831:36:  'backProps' is defined but never used  @typescript-eslint/no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

WARNING in [eslint]
src/components/CodingEnvironment/MidenCode.tsx
  Line 75:40:  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
  Line 75:45:  'viewUpdate' is defined but never used    @typescript-eslint/no-unused-vars
  Line 75:57:  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

And still the Error: unreachable persists (at least on my machine).

when I try to load the instructions table, many instructions are empty. Do I need to run the script somehow?


⚠ Fortnite has degraded performance

In a3f7512, Fortnite (https://fortnite.com) experienced degraded performance:

HTTP code: 200
Response time: 1479 ms

Resolved: Fortnite performance has improved in ed07358.


Clarification added to question 4 in Chapter 4

I had some difficulty with this question because it wasn't clear to me what parameter values to use in the run_simulation function before I looked at the answers. I added a short clarification in case figuring out these values is not part of the question.
Thanks for a great book, @AllenDowney!
-Maciej

I will clarify this.  Thanks -- this kind of comment is very helpful!


Modifying final.yml to support bosh cli v2

Task: HCPCFS-829

Changes are done in final.yml to support creation of bosh relase
Using bosh cli version2

Appended folder name with bucket name
Added signature version key

Tested in both bosh cli (v1 and v2) with these changes
bosh cli v1.

creation of dev release is success (bosh create release --force)
creation of final release is success (bosh create release --final)
NOTE: We need to use https://github.infra.hana.ondemand.com/servicefabrik/credentials/blob/master/blobstore-s3/private.yml  for bosh cli v1

bosh cli v2:

creation of dev release is success (bosh2 create-release --force)
creation of final release is success (bosh2 create-release --final)
NOTE: We need to use https://github.infra.hana.ondemand.com/servicefabrik/credentials/blob/master/blobstore-s3/private-bosh2.yml for bosh cli v2


clarify the pods scheduling during graceful termination:

We never documented the Pod admission failures and Not Ready status. See https://github.com/kubernetes/enhancements/blob/80e76860ab0c9faa53fe833150091c15c5855ded/keps/sig-node/2000-graceful-node-shutdown/README.md?plain=1#L368-L371
/sig node
/assign @bobbypage
/kind cleanup

@bobbypage can you please review when you have a chance to keep me honest here.

/approve
/label tide/merge-method-squash

/retitle Clarify pod scheduling during node graceful termination

/lgtm


Is it possible to replicate the results on XNLI dataset which are present on https://github.com/google-research/bert/blob/master/multilingual.md ?

I am not able to replicate the results for  "BERT - Translate Train Cased" system on English. Can anybody know the set hyperparameters which were used for fine-tuning of  BERT-Base, Multilingual Cased (New, recommended) on English ?

Multilingual Readme

Same issue here. I'm using the parameters provided for fine tuning the Chinese model. I'm able to reproduce the results on the Chinese model, but for multilingual model, my numbers are ~2 pts lower than those in the table.


Add ptd.edu.vn

@anht3889 This domain does not belong to a university, nor to a college. I have to close the request without merging. Please ensure that you are familiar with this repository rules located at the bottom of this page before submitting a new request.


Support for :credentials on Rails v5.2.x.

This fixes #4710.
Rails introduced :secrets in v5.1. They somehow changed it to :credentials. This fix represents this change.
Devise will now look :credentials first, then fallback to :secrets for 5.1.x compatibility then it will check for standard secret key. If three not found then exception will arise.

merge?

any updates?

@tegon, am I seeing wrong or did I missed something? I see v4.4.1 tag includes this commit, however, it is not.


Derpibooru.org - Problem with the downloaded images and quantity.

What steps will reproduce the problem?

Go to do my search
Put the tag of the artist
Finally with my previous problem now fixed, the results are complete (1100 images)
Go to "Get this page" then "Downloads" and i download the files.

What is the expected behavior? What do you get instead?
I expect the download of the 50 images without any problem. Instead i get this:

Only i get 15 elements and incomplete with the size 185 bytes in all.
How often does this problem occur? On which sources?
Always on Derpibooru.org
What version of the program are you using? On what operating system?
5.5.2 / Windows 10
Please provide any additional information below
Here i'm trying to download the 1100 images but i get the same result only that the window doesn't close after clicking on OK. And on that try only downloaded 330/330 images and not the 1100 images.

HERE'S THE LOG: main.log

Check those image files in a text editor.  They're probably HTML server error pages that were downloaded by Grabber.
I tried downloading a batch from Derpibooru and got the same result.
This is what was in the "corrupt image" files I downloaded:
<title>301 Moved Permanently</title>

301 Moved Permanently

nginx/1.10.3

What I've found is that any attempt at a batch download using Grabber on Derpibooru yields the above result.  This happens with all batch creation methods. I.e. "Get Page", "Get All" or "Get Selected."
Images saved individually were saved correctly most of the time during my test sessions, but I did get some 301 errors during individual image saves as well.

Here i'm trying to download the 1100 images...

I'd recommend exercising some restraint.  It's this sort of thing that will get Grabber banned.

They are not server errors. and yes, we have the same problem.

They are not server errors.

When those server error pages are saved, they're exactly 185 bytes; the same file size as you mentioned.
If you open those failed downloaded images in a text editor, what's shown?

This...

301 Moved Permanently

301 Moved Permanently
nginx/1.10.3

This:

This
1.txt

They are not server errors.

You are wrong. That's a server errors indeed, with axactly the same text as @Gaffnet said:

301 Moved Permanently

301 Moved Permanently
nginx/1.10.3

@Bionus old problem with saving redirects/error server ansvers as images, huh.  Just like in https://github.com/Bionus/imgbrd-grabber/issues/1038

So... There's no fix?


Add section about LSM programs

Documentation describing LSM and development of LSM eBPF programs. It
contains an example of LSM program which denies setting a nice value for
the userspace process loading it.
Signed-off-by: Michal Rostecki<EMAIL_ADDRESS>

@alessandrod Addressed your nits. Last Discord discussion convinced you against submodules, so I didn't change anything in the example crate.


Feature request: Un-restrict Discord's text selection context menu

By default the Android Discord app restricts the text selection context menu options within the message input box. On my device, the only options shown are Cut, Copy, Paste, Share, Select All, and Read Aloud. Other Android apps might add useful features as Android context menu options. For example, TextTools could be used to surround selected text with markdown formatting, or a translation app (there are several with a context option for this) being able to automatically translate the selected text, enabling foreign language speakers the ability to type in their native language and translate it without having to swap between apps or copy and paste. But Discord doesn't allow users the freedom to use those options. I doubt a Bunny/Vendetta plugin would be able to change/expand/unrestrict the available text selection context menu options to all which are available on a user's Android device, because this is most likely set by the app itself, but it might be possible for Bunny to do so. If is possible, I think this feature would enable users to use their phone and apps in the way users want to, instead of having their available features limited by Discord Inc.

Although this is theoretically possible to be implemented by Bunny (through Xposed module), this is still isn't within Bunny scope and ideally should be a plugin, hence just another "not possible" plugin idea. We might allow it at some point in the future, but not in the mean time


Previous day peak and off-peak consumption and costs showing as zero

Describe the bug
The electric consumption and cost for the previous day is only showing totals, not the peak and off-peak values.
For a long time, my current consumption and rates seemed to have stopped updating but this seems to have fixed itself in some update recently so that's nice.
As it was working again, I decided to reintroduce my gauges for yesterday's usage too.  I'm particularly keen to show where we have used too much energy during peak times to try and encourage better usage today but it seems this data is being set to zero.
I'm guessing this is a limitation Octopus has introduced but figured I'd log an issue just in case.

Reproduction steps
With a tariff such as Intelligent Octopus Go, featuring a binary peak and off-peak rate, observe the sensors for yesterday's usage appear as zero.  The total consumption and cost is working as expected.
Expected behaviour
Peak and off-peak usage sensors for yesterday should show the breakdown of the previous period's usage and cost.
Tariff Code
E-1R-INTELLI-VAR-22-10-14-N
Integration Version
10.1.4
Home Assistant Version
2024.3.1
Fresh Install?
Not specified
Home Assistant Logs
Happy to provide if pointed in direction of anything particular that may help :)
Confirmation

[X] I confirm that I cannot find my solution within the documentation
[X] I confirm that I cannot find my solution within the FAQ

Noticed the same, as of 02/04/24.

Same issues as reported above - all consumption showing peak since 1st April. Thanks

Hello and sorry you're seeing this.
Just to confirm this is with the previous consumption/cost based sensors?

Hi Dave,
Yes, the following sensors are reporting 0.0.
previous_accumulative_cost_peak
previous_accumulative_cost_off_peak
previous_accumulative_consumption_peak
previous_accumulative_consumption_off_peak
The 'total' consumption and cost sensors are still working okay.
Regards,
Luke

I am also experiencing this issue, with the Peak and Off-peak sensors showing 0, while the Daily Total is still working.

Hi Dave,
Sorry, but just to compound this problem, the same issue also applies to the previous export entities:
export_previous_accumulative_consumption_peak
export_previous_accumulative_cost_peak
export_previous_accumulative_consumption_off_peak
export_previous_accumulative_cost_off_peak
As with the 'import' entities, I can confirm that the Totals are still working fine.

No problem, they're all the same sensor. I believe I've tracked down the issue, so the fix should be available in the next release.

Thanks for the update @BottlecapDave :)

Really appreciate your efforts and support.  You do an amazing job. Thank you.

Thanks for the update @BottlecapDave. Great job!
We'll look forward to the next update.

This should now be fixed as part of v10.3.0

Brilliant job Dave - thanks very much :-)


core: restart relays connection when relaysUrl is updated

Actually, we can't connect with different relays when we update directly relaysUrl props of Provider.
With this modification, connectToRelays() is only triggered if relaysUrl change, this means that we can dynamically update the relay list from the provider.
For example :
const CustomProvider = observer(({ children }) => {
  const { userStore } = useStores();

    return (
      <NostrProvider relayUrls={userStore.relays} debug={true}>
        {children}
      </NostrProvider>
    );

  return <>{children}</>;
});

If the value of userStore.relays is updated, the provider will automatically reconnect to the new relays.

 Was this not needed? If you go from N relays to N+1, will this cause problems trying to reconnect to the original N?

The isFirstRender check make it impossible to trigger connectToRelays() when props are updated, since it will trigger only on first mount.
With this modification, when you update from N to N+1 relays, it will detect the changes, disconnect from all N relays then reconnect to all N+1 new relays.
Maybe this is not the best optimized solution since it's not needed to disconnect a relay present in N and N+1 list, but it allow to dynamically update the props and reconnect accordingly.
This list isn't going to change all the time so I dont think this is a big deal right now.
Maybe there is an other method for this but in my side I needed to apply this patch for doing it !

I tend to agree that disconnecting and then reconnecting is not a big deal, at least for now. If dynamic management of relays were ever to result in frequent changes, then perhaps it would become a bigger issue.
I will test it as soon as I get the chance! 😄  (today or this weekend, I hope)

I've tested it out. As you can see here, I am using my redux store to define relayUrls.
I find that when I add a relay to my store, the new relay gets connected very quickly, which is nice. However, if I remove a relay from the store, that relay stays connected, which I do not want. I also find that if one or more connections get dropped spontaneously, they don't auto reconnect; however, if I then add a new relay, then all of the dropped connections get reconnected at the same time as the new relay.
So it seems to me that the current behavior of this fork is that whenever a change in the store produces a change in relayUrls, it cycles once through all relays and tries to connect each one, regardless whether a connection already exists. However, it does not disconnect from any of them, except for the ones that are spontaneously dropped. Presumably, trying to connect to a relay that is already connected isn't causing any problems (although if it happens repeatedly, I suppose the relay could interpret that as an attack and could put you on an ignore list, which I suppose is the point of the isFirstRender check in the first place.)
I have a component relaysStatus which is working well for me which uses connectedRelays to monitor which relays are active:
import { useNostr } from 'nostr-react';
...
const { connectedRelays } = useNostr();

Perhaps in place of the isFirstRender check, we need to check with connectedRelays first and avoid reconnecting to an already-active url. In addition, we should cycle through all relays in connectedRelays and make sure to disconnect from any undesired relay.

The bug was reproducible in my side, in fact we need to handle the relays that we don't want anymore.
I have updated my branches with the following modifications:

Fix dependency array for connectToRelays : we need to use a correct dependency array to limit undesired bugs
Add disconnectToRelays function to disconnect relays that are not needed anymore.
Add reference for relayUrls : since connectToRelays is updated correctly, we don't want to retrigger it when one of the dependency has changed. The useEffect will watch changes between old and new relayUrls to connect/disconnect only if changes are detected.

Now, I can correctly add or remove a relay url and only the changes that are needed are applied.
If you have time to test it out, don't hesitate to tell me the result @wds4

I've done a quick test with your updated branch and it appears to be working for me: I can add and remove relays to my store and they are added and removed as expected from connectedRelays. I've tested adding and removing the same relay repeatedly and that also functions as expected. Junk relays (wss://foo.bar) or other relays that do not connect successfully are (effectively) ignored without creating any problems that I have identified. Good job and thank you!
I still have the problem that if a connection gets dropped spontaneously, it does not reconnect unless I make some other (potentially unrelated) change to relayUrls. I'd say that issue could be addressed separately from this pull request, unless you have an idea of how you would like to add it to this PR.

From a quick implementation, I got onDisconnectCallback to execute as expected with the above code. It's exactly what I've been needing to do to solve this problem- thank you!
For others with the same problem I'll post code once I have time to get it a little more fleshed out and tested in my client. Probably not until later this week. For now my plan is to use this branch with onDisconnectCallback as above.

@t4t5 it is possible to integrate this PR ?

Apologies for the delay here. This looks great, thanks for fixing this @aussedatlo! 🙏 Will merge and create a new release!


[Question] Functions with other models, setting the model in run.create, more

Does function calling work with other models such as gemini?
Is it possible to change the model of the assistant at the run?
run = await self.beta.threads.runs.create(
            thread_id=thread.id,
            assistant_id=assistant_id
            model="gemini/gemini-pro"
        )

I already have assistants in the playground, do I need to create them since you are possibly storing it in your database?
Do you use my data?
What is stored on AstraDB? (edited)

Hi, thanks for asking:

Does function calling work with other models such as gemini?

Yes, here's the example https://github.com/datastax/astra-assistants-api/blob/main/examples/python/function_calling/basic.py#L11-L18. You can uncomment the model you want to test with.
Just make sure you have the right env var for the model you're trying to run.

Is it possible to change the model of the assistant at the run?

Since model is a property of the assistant, you have to either modify the assistant itself and change the model, or run a different assistant against your thread. You can run different assistants against the same thread.

run = await self.beta.threads.runs.create(
thread_id=thread.id,
assistant_id=assistant_id
model="gemini/gemini-pro"
)
I already have assistants in the playground, do I need to create them since you are possibly storing it in your database?

Yes, you need to re-create any assistants you may have created using OpenAI in Astra Assistants.

Do you use my data?

No, we will never use or train on your data. It is stored in your private database and is treated like any other AstraDB database. We take security very seriously, see our compliance documentation at https://trust.datastax.com/

What is stored on AstraDB?

The Astra Assistant API stores all the durable objects in the API including files, threads, messages, assistants, etc. in AstraDB. You can see this data by logging into astra.datastax.com and you can interact with it like any other AstraDB data.


Add context to job/agent creation errors

Marked as draft since this is changing same file as #168 and wanted to check for feedback on this, if more changes were intended.
Changes Made

added context to kube errors during agent  creation in mirrord-layer
updated CHANGELOG.md

Finally submitting changes to handle errors for #112. Please let me know if more was intended when handling the possible kube::Error cases.
I considered creating a separate error enum for these cases in mirrord-layer/src/error.rs. Would this be more useful/idiomatic? I think this was already discussed and in #144, or might be overkill for these create agent errors.
Thanks!

@camerondurham Linting fails, please run cargo fmt --all to fix it

Awesome! Thank you so much 🤩


Added support for file share reliable download

/azp run java - storage - tests

/azp run java - storage - tests

/azp run java - storage - tests


testing calc_rmax

I found some inconsistencies in the way calc_rmax works. I've developed a quick python code for:

read AMM7 bathymetry;
create an envelope bathymetry and smooth it: it implements exactly NEMO Fortran90 code (very inefficient but at least we know what it does)
compute the maximum rmax with three different codes: original numpy version of James; xarray version of James code; my old code (actually adapted from pyROMS, it very inefficient but I think it is clear what it does).

If we smooth the envelope with an rn_rmax threshold of 0.24, the following is the pring of the iterative smoothing:
python test_rmax_calc.py
Iter: 1 rmax:  1.0
Iter: 2 rmax:  0.9353992591835926
Iter: 3 rmax:  0.9187177073344386
Iter: 4 rmax:  0.8765126597150313
Iter: 5 rmax:  0.8185786808404448
Iter: 6 rmax:  0.7347370279088926
Iter: 7 rmax:  0.7347370279088925
Iter: 8 rmax:  0.6074021541852422
Iter: 9 rmax:  0.5717732932642535
Iter: 10 rmax:  0.4755012414806615
Iter: 11 rmax:  0.37086087298353765
Iter: 12 rmax:  0.24000000000000007
The  rmax computed by the three codes are the following:

calc_rmax_xr: 0.34985075453036585 (xarray code)
calc_rmax_np: 0.34985075453036585 (numpy code)
SlopeParam: 0.24000000000000005 (ROMS code)

Probably should drop this note here too:
To reproduce your SlopeParam code @oceandie [which looks very much like my old Matlab ;) ] I did the following (see below). The large values seem to appear in the outer halo as they where included in the np.diff (your code only goes from the second index to the last but one) ... I also think I'd got the indices out of sync by 1 - but I'm not too sure ... I'll look again on Monday (and do an XR version of this).
If I diff the the results from the following code with SlopeParam they match.
def calc_rmax_np(depth):
    """
    Calculate rmax: measure of steepness

    This function returns the slope steepness criteria rmax, which is simply
    (H[0] - H[1]) / (H[0] + H[1])
    Parameters
    ----------
    depth: float
            Bottom depth (units: m).
    Returns
    -------
    rmax: float
            Slope steepness value (units: None)
    """

    rmax_x, rmax_y = np.zeros_like(depth), np.zeros_like(depth)

    rmax_x[1:-1, 1:-1] = np.maximum (
        np.abs( np.diff(depth[1:-1, :-1], axis=1) / (depth[1:-1,  :-2] + depth[1:-1, 1:-1]) ),
        np.abs( np.diff(depth[1:-1,1:  ], axis=1) / (depth[1:-1, 1:-1] + depth[1:-1, 2:  ]) )
    )
    rmax_y[1:-1, 1:-1] = np.maximum (
        np.abs( np.diff(depth[ :-1, 1:-1], axis=0) / (depth[ :-2, 1:-1] + depth[1:-1, 1:-1]) ) ,
        np.abs( np.diff(depth[1:  , 1:-1], axis=0) / (depth[1:-1, 1:-1] + depth[2:,   1:-1]) )
    )

    return np.maximum(np.abs(rmax_x), np.abs(rmax_y))

OK - I had to return quickly to look at the xr - just to clear my head! This does the same as the np, but I'm not too sure why the outer halo -> rmax[0,:], rmax[-1,:], rmax[:,0], rmax[:,-1] - still has values in. Diffing rmax[1:-1,1:-1] with the np and SlopeParam gives the same results
def calc_rmax_xr(depth):
    """
    Calculate rmax: measure of steepness
    This function returns the maximum slope paramater

    rmax = abs(Hb - Ha) / (Ha + Hb)

    where Ha and Hb are the depths of adjacent grid cells (Mellor et al 1998).

    Reference:
    *) Mellor, Oey & Ezer, J Atm. Oce. Tech. 15(5):1122-1131, 1998.

    Parameters
    ----------
    depth: DataArray
        Bottom depth (units: m).

    Returns
    -------
    DataArray
        2D maximum slope parameter (units: None)

    """
    both_rmax = []

    for dim in depth.dims:

        # |Ha - Hb| / (Ha + Hb)
        rolled = depth.rolling({dim: 2}).construct("window_dim")
        # Ha - Hb: diff is computed at U/V points
        diff = rolled.diff("window_dim").squeeze("window_dim")
        # rmax is computed at U/V points
        rmax = np.abs(diff) / rolled.sum("window_dim")
        # find max either side of t-point
        rolled = rmax.rolling({dim: 2}).construct("window_dim")
        rmax = rolled.max("window_dim", skipna=True)

        # 1. Place on the correct index (shift -1)
        # 2. Force first/last values = 0
        # 3. Replace land values with 0
        rmax = rmax.shift({dim: -1})
        rmax[{dim: [0, -1]}] = 0
        rmax = rmax.fillna(0)

        both_rmax.append(rmax)

    return np.maximum(*both_rmax)

@oceandie if you're happy with these solutions, I'll push back to the branch

Looks like pyroms is also using the "conservative approach" we discussed yesterday. That's already implemented so you just have to use the latest version of #40.
There are two other minor sources of error at the boundaries and near coast, although I'm not convinced pyroms method is better (see notebook below)... Anyways, as @jdha mentioned we just have to mask land and boundaries.
Here is the code to compare and reproduce pyroms implementation: https://nbviewer.jupyter.org/gist/malmans2/f6f1ee945fd0c5125b87cef275e86e2b

Hi @jdha , thanks for looking at it!
Glad the SlopeParam is similar to your matlab code, but as I specified in the doc of the function and in the description of the issue that is NOT my original function, I adapted it (very little) from pyROMS (if you are curious, see here ).
So if I undersatnd correctly, there are two changes that are needed to replicate SlopeParam with calc_rmax_np:

substitute the average with the maximum (conservative approach)
exclude the outer halo in the computation.

Looks like pyroms is also using the "conservative approach" we discussed yesterday. That's already implemented so you just have to use the latest version of #40.
There are two other minor sources of error at the boundaries and near coast, although I'm not convinced pyroms method is better (see notebook below)... Anyways, as @jdha mentioned we just have to mask land and boundaries.
Here is the code to compare and reproduce pyroms implementation: https://nbviewer.jupyter.org/gist/malmans2/f6f1ee945fd0c5125b87cef275e86e2b

I think that more importantly, pyROMS code and the our "conservative approach" are consistent with the way NEMO implement the smoothing algorithm ...

Hi @jdha , thanks for looking at it!
Glad the SlopeParam is similar to your matlab code, but as I specified in the doc of the function and in the description of the issue that is NOT my original function, I adapted it (very little) from pyROMS (if you are curious, see here ).
So if I undersatnd correctly, there are two changes that are needed to replicate SlopeParam with calc_rmax_np:

substitute the average with the maximum (conservative approach)
exclude the outer halo in the computation.

for calc_rmax_np, I re-wrote it above

Hi @jdha , thanks for looking at it!
Glad the SlopeParam is similar to your matlab code, but as I specified in the doc of the function and in the description of the issue that is NOT my original function, I adapted it (very little) from pyROMS (if you are curious, see here ).
So if I undersatnd correctly, there are two changes that are needed to replicate SlopeParam with calc_rmax_np:

substitute the average with the maximum (conservative approach)
exclude the outer halo in the computation.

for calc_rmax_np, I re-wrote it above - and satisfies 1 & 2

Yes, yes I saw it ... was just a recap of the diffs ;)

Looks like pyroms is also using the "conservative approach" we discussed yesterday. That's already implemented so you just have to use the latest version of #40.
There are two other minor sources of error at the boundaries and near coast, although I'm not convinced pyroms method is better (see notebook below)... Anyways, as @jdha mentioned we just have to mask land and boundaries.
Here is the code to compare and reproduce pyroms implementation: https://nbviewer.jupyter.org/gist/malmans2/f6f1ee945fd0c5125b87cef275e86e2b

Regarding NaNs on the land:
I think pyROMS and NEMO approaches are more correct - we don't want to include land points in the computation since

as @jdha pointed out they are never used in computing hpg
the smoothing algorithm is an iterative process, if we include also land points they will sligthly change also the points close to the coast. For the same reason, NEMO code, before smoothing, change from land to wet all the land points adjacent to coastal wet cells, see this very slow loop ...


Fix memory leak

Resolve memory leak with av_interleaved_write_frame
Add failing test
Implement packet interleave logic in pure Elixir
Fix demands and reformat code
Reorder functions
Use ceil because buffer pts contain something that is not an integer
Use av_packet_from_data in order to have a reference counted buffer

Why exactly did you write your own interleaving?
From my understanding the changes is the native code fixed the memory leak, so why are there any changes in elixir code?
I find it highly unlikely that the av_interleaved_write_frame is the issue here.

Hi @shuntrho! What you're talking about is the fix/memory-leak-with-native-interleaving. If you send that stream through a "slow" channel (i.e. non a local network), the receiver won't get the payload contents. In our case was AWS Medialive reporting no audio/video detected. So our change does not play well with that function. Further, this plugin was already doing some interleaving with the demand. As soon as avformat tells to prefer av_write_frame when interleaving is already performed AND it is easier to manage the memory with that function (and understand what is going on), we went for it!

If you send that stream through a "slow" channel (i.e. non a local network), the receiver won't get the payload contents

This behaviour is kind of difficult to catch: if you send everything to a local ffmpeg RTMP server everything is fine. If it takes "some time" to send the packets out in the network instead, the payloads get freed before going out apparently!


tour: Code in "Exercise: Loops and Functions" is uncompleted

Context: https://tour.golang.org/flowcontrol/8
When I follow the tour into "Exercise: Loops and Functions", the body of function Sqrt() have no content and the code just can't run. The github code in content/flowcontrol/exercise-loops-and-functions.go is also missing function body. Is it a bug?

No, it's an exercise. The text says:

Implement this in the func Sqrt provided.

Closing here.


Tech debt 1265: Enable strictNullChecks TS compiler option

This PR:

closes #1265
enables strictNullChecks ts compiler option
fixes all corresponding errors (not in a best way sometimes), but this already showed that we were typing things wrong and there were many inconsistencies

Travis automatic deployment:
https://pr1301--safereact.review.gnosisdev.com/app

Travis automatic deployment:
https://pr1301--safereact.review.gnosisdev.com/app

Travis automatic deployment:
https://pr1301--safereact.review.gnosisdev.com/app

Travis automatic deployment:
https://pr1301--safereact.review.gnosisdev.com/app

Travis automatic deployment:
https://pr1301--safereact.review.gnosisdev.com/app

Big work adding types here!


Introducing some parameters or checks to get your project listed

I think anyone being able to list their projects is little lenient.....Cause I saw some projects that have nothing but readme......
Wht are your thoughts about this or did I made a mistake while reviewing your project

I think anyone being able to list their projects is little lenient.....Cause I saw some projects that have nothing but readme......
Wht are your thoughts about this or did I made a mistake while reviewing your project

Yes. I also saw two same projects. If you want to change you can work.

Give me this week to figure out what can we do, before I ask you to assign it to me....

Give me this week to figure out what can we do, before I ask you to assign it to me...

Yeah sure, you can work.


[graphiql]

Is there an existing issue for this?

[X] I have searched the existing issues

Current Behavior

You can see the official web. Everytime there are prompt occurs it's never erase, and block the view.
same thing happend when I use with nestjs.

Expected Behavior
No response
Steps To Reproduce
No response
Environment

GraphiQL Version:
OS:
Browser:
Bundler:
react Version:
graphql Version:

Anything else?
No response

this is a duplicate of an issue already reported in codemirror-graphql

@acao — I strongly advise always linking to them when citing such existing issues.


Should this have more maintainers?

Seems that we have many good PRs waiting and nothing happens.
I have custom build mine for now far too long, Id would like to get this more open and have more maintainers.
@lvermeulen - If you are too busy, maybe fork this to community driven one with more maintainers?

I have a fork setup with a nuget you are welcome to send your pr's there and i will merge them.
https://github.com/AnderssonPeter/Keycloak.Net


[Autocomplete] Margin dense dont work

IMPORTANT: for all the tests I use the sandbox, but it have a problem with the position of the components, I change the input size to width: 1px just to see the Autocomplete in its normal visualization and make the tests. I also test on my local to ensure that is a bug and on my local and on the sandbox the behavior is the same
Margin dense seems to not work with autocomplete

[ x ] The issue is present in the latest release.
[ x ] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯
Margin dense dont show any effects.
Dense:

Normal:

Expected Behavior 🤔
I shoud change the TextField size just like the TextField component does when change margin prop.
Steps to Reproduce 🕹
On the current live example, if you add dense you dont get any difference. The only think that changes is the margin on the top of the component, but not its size. https://codesandbox.io/s/kyp0d
Context 🔦
I believe it dont be a "bug" on its literal meaning, but it's a unexpected behavior when we try to get the smaller input using its prop and it dont change.
Your Environment 🌎
I use the environment of the example on the docs. https://codesandbox.io/s/kyp0d

Tech
Version

Material-UI
v4.5.2

React
16.9.0

Browser
Chrome: Versão 78.0.3904.70 (Versão oficial) 64 bits

TypeScript
3.6.4

OS
Ubuntu

@Alecell I believe we should apply the "dense" mode of the chip at the same time https://material-ui.com/components/chips/#default-variant.

In this context, I would propose the addition of a new prop to the Autocomplete component. Maybe something as simple as dense?: boolean;?

@oliviertassinari I'm really sorry, but even with Chip size='small', either local and sandbox the behavior is the same (just remove the space on the top, dont change the size). The version I just reinstall is 4.0.0-alpha.30 on local and latest on sandbox.
Wich version you use to reach that?
Also add the dense prop is a way to solve the issue, but I dont believe add it on Autocomplete is the way that would work. I dont know inside the Autocomplete component but I think it shoud follow the default behavior of the renderInput, in that case, the TextField. I dont know too how that prop dense would work on other custom input components, maybe will generate some bugs.
As MUI have so many users I belive the Autocomplete component shoud always follow the default behavior of the input component being used.

@oliviertassinari To create the dense style the inputRoot class has to change to fix the paddings. I should create a new class named inputRootDense or change the selectors like below?
inputRoot: {
  flexWrap: 'wrap',
  '&[class*="MuiOutlinedInput-root"]:not(.MuiOutlinedInput-marginDense)': {
    padding: 8,
    '& $input': {
      padding: '10.5px 6px',
    },
  },
  ...
}

I'm not sure how we should approach the problem. 1. The chip requires the usage of a prop to be dense. 2. The style if the text field needs to be changed.

Kind of solved it here:
SandBoxUrl

@oliviertassinari  please add MuiAutocomplete-inputRootDense className to docs if its the actual solution to this issue.

@karaggeorge your solution works pretty well, but how do you reach this? I believe your solution is almost the ideal word for my and vary other cases, but I cant find anything like this on the docs for that kind of behavior.


Config template fix proxy

The template had a few issues :

authMethod was not correctly indented

proxy, used for Proxy Chaining, was under scan, but config.py was looking at the root, resulting in proxy silently ignored.
I think it makes more sense at the root of the yaml rather than under scan, but if it somehow makes more sense to put it under scan, we can modify config.py instead

Excluding URLs from being chained-proxied was not done correctly : it's really a ;-separated string, not a list.

whoops, this contained more commits than was supposed to have


Investigate automatic FVT framework

Create an end-2-end automatic framework for functional testing.

Jenkins pipeline
End-2-end user scenarios
General Linux server & Raspberry Pi env

Use JMeter as test script, and Github actions for CI env. A Raspberry Pi env will also be created.


Request - Support for Ars Elemental

Please add support for the Flashing Archwood from Ars Elemental.

support has been added in dev


New port Kaima

New Port for {Kaima }
Game Information

Title: { Kaima}
URL: { https://nomnomnami.itch.io/kaima }

Submission Requirements
CFW Tests
Ensure your game has been tested on all major CFWs:

[X] AmberELEC
[X] ArkOS
[X] ROCKNIX
[X] muOS

Resolution Tests
Test all major resolutions:

[] 480x320
[X] 640x480
[X] 720x720 (RGB30)
[X] Higher resolutions (e.g., 1280x720)

File Structure

Your port should have the following structure:

portname/

port.json
README.md
screenshot.jpg
cover.jpg
gameinfo.xml
Port Name.sh
portname/

Additional Resources
For an in-depth guide on creating a pull request, refer to: PortMaster Game Packaging Guide

fixed


HHH-16396 HQL with SubQuery having same alias of root Query generates wrong SQL

https://hibernate.atlassian.net/browse/HHH-16396

@beikov  added the test you suggested and pairing with @mbladel for a different solution

I'm taking a look at the failures..

These are real... StackOverflowException .  I have a solution I am testing atm

Applied.  Thanks guys!


Repeat crashes on iOS v11.03

First, Thank you this is cool but I have question why on repeating the audio and seek bar crashes on iOS and all browsers in iOS.
Here's my code
wavesurfer.on('finish', function(){
     wavesurfer.play(0)
     wavesurfer.drawer.progress(0)
 })

On other phones and os works smoothly.

no feedback.


impl Display for InterfaceFlags

And add a full example for getifaddrs.
What does this PR do
implements fmt::Display for InterfaceFlags, and adds an example for getifaddrs
Checklist:

[x] I have read CONTRIBUTING.md
[x] I have written necessary tests and rustdoc comments
[x] A change log has been added if this PR modifies nix's API

Rebased and applied cfg aliases.


F# 4.0 not released on NuGet

https://www.nuget.org/packages/FSharp.Core/ is still the same old, same old.

The nuget packages is not released by MS.
See https://github.com/fsharp/fsharp/issues/444 and ask over there.


Observer being able to distinguish between new and "cached" data

First off, the concept of having LiveData (and MutableLiveData) with observers that handle Lifecycle is a great addition on top of the bare metal Android components.
Having played around with LiveData and Observer there arrived one case where it would really be desirable to know if LiveData is passing on a cached version (mVersion) due to the change of LifecycleBoundObserver (initiator), this references the filed/param names in LiveData.java.
Following here is a case where it would be good to know if LiveData is cached or not:
It seems to be a good pattern to create LiveData that is private final and associate a getter with it, looks usually something like below:
private final MutableLiveData<ApiResponse<DownloadResponse>> mDownloadLiveData = new MutableLiveData<>();
A Fragment would then register an Observer on that LiveData
mViewModel.getDownloadLiveData().observe(this, mDownloadObserver);
mDownloadObserver in this case would also be private final inside Fragment
private final mDownloadObserver = new Observer ...
So far so good, the Code will notify the Observer when new data arrives and consider the applications Lifecycle.
However, as soon as the Fragment undergoes a configuration change, LiveData realizes that LifecycleBoundObserver has changed and mVersion does not match observer.lastVersion (in fact it has been initialized to -1) and thus publishes it's underlying data mData with onChanged.
I am certain this is how it is intended, and indeed it seems that most applications expect this behavior. However in certain cases it would be desirable to know that the onChange has been fired with LifecycleBoundObserver.lastVersion =  -1.
Of course placing a state variable in the Fragment would allow for checking if the Data has been manually requested, yet it seems to negate the purpose of the stateless design around the Architecture components.
A suggestion would be to have a second option that allows to register a stateful Observer knowing if the callback is issued due to a new LifeCycleBoundObserver.
public void observe(LifecycleOwner owner, StatefulObserver<T> observer)

and
public interface StatefulObserver<T> {
    /**
     * Called when the data is changed.
     * @param t  The new data
     * @param fromCache whether or not the value is submited due to a new LifeCycleBoundObserver
     */
    void onChanged(@Nullable T t, boolean fromCache);
}

Again thanks a lot and keep up the good work!
Manuel

You can check the SingleEvent class in this example:
https://github.com/googlesamples/android-architecture/tree/dev-todo-mvvm-live
We are thinking about moving it to the library.

@yigit Thanks for pointing this out! This is exactly what I was looking for!

@yigit  The scenario I use is in "push message". The message receiver is a singleton class. It holds the livedata class internally and allows multiple activities to be registered. That is, it is processed only when there is a message coming, SingleEvent  will only notify one observer, thus can not resolve my problem..

Use a wrapper and add your own rules to it:
https://medium.com/google-developers/livedata-with-snackbar-navigation-and-other-events-the-singleliveevent-case-ac2622673150

@yigit SingleEvent works fine but will it create any problems if I also add
@Override
    public void observeForever(@NonNull final Observer<T> observer) {

        if (hasActiveObservers()) {
            Log.w(TAG, "Multiple observers registered but only one will be notified of changes.");
        }

        super.observeForever(new Observer<T>() {
            @Override
            public void onChanged(@Nullable T t) {
                if (mPending.compareAndSet(true, false)) {
                    observer.onChanged(t);
                }
            }
        });
    }

So if it is being used as a source to another MediatorLiveData it does not send events to onChanged() of the observer when orientation is changed.


HSEARCH-4926 Improve casts in HashTable

https://hibernate.atlassian.net/browse/HSEARCH-4926
This doesn't change the behavior in practice, but is slightly more
correct, and will avoid Sonar reporting a bug.

It's just sonar failing, which should be addressed in #3678. Merging.


feat: achieve SLSA3 compliance

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


MSID: 99757 Version: 1 DOI: 10.31234/osf.io/kt7dm

MSID: 99757
Version: 1
Preprint DOI: https://doi.org/10.31234/osf.io/kt7dm
Step 1. Awaiting reviews
Editorial to post reviews via hypothesis
Useful links:

DocMap: https://data-hub-api.elifesciences.org/enhanced-preprints/docmaps/v2/by-publisher/elife/get-by-manuscript-id?manuscript_id=99757
New model tracking: https://docs.google.com/spreadsheets/d/1_fHaoOy7hjyocptKtVJRijeNpUY4hBS7Ck_aVmx6ZJk/
Reviews on sciety: https://sciety.org/articles/activity/10.31234/osf.io/kt7dm

For trouble shooting (e.g. no Docmaps available):

DocMap issue addressing: https://miro.com/app/board/uXjVNCwK6EI=/
Explore DataHub DocMaps API: https://lookerstudio.google.com/reporting/4c2f0368-babb-4beb-b5b3-497e7e7b0f08/page/ejphD
Unmatched submissions and preprints: https://lookerstudio.google.com/u/0/reporting/9f86204f-3bf7-477c-9b18-5c5ef141bf69/page/p_gxi57ha93c
Unmatched manuscripts spreadsheet: https://docs.google.com/spreadsheets/d/15QcK8w-ssB7109RQEDtFpJPZ0J5HTGxoHa_2TtpMBbg/edit#gid=1336081641

Step 2. Preview reviewed preprint
Production QC content ahead of publication
Instructions:

QC preview: https://prod--epp.elifesciences.org/previews/99757v1
Update ticket with any problems (add blocked label)
When QC OK, add QC OK label to ticket and add publication date and time to https://docs.google.com/spreadsheets/d/1amAlKvdLcaDp5W8Z8g77NmkwbMF5n_u89ArSqPMO8jg
Move card to next column
(At end of the day post link in #enhanced-preprint and ask for PDF to be generated)

Useful links:

Preprint DOI :  https://doi.org/10.31234/osf.io/kt7dm
Confirm reviews returned by EPP: https://prod--epp.elifesciences.org/api/reviewed-preprints/99757/v1/reviews
To update the MECA path in the docmap: https://docs.google.com/spreadsheets/d/1mctCQuNFBjSn97Lihy7_vBO6z7-N-oqyLv4clyi6zHg

Step 3: Awaiting search reindex
This step adds the reviewed preprint to the homepage: https://elifesciences.org
The search reindex is triggered once an hour. We need the reviewed preprint to be indexed as the search application serves the journal homepage.
Useful links:

Jenkins pipeline to reindex search can be triggered sooner or monitored here: https://alfred.elifesciences.org/job/process/job/process-reindex-reviewed-preprints/

Step 4: Published! PDF requested
Waiting for PDF to be generated
Useful links:

PDF tracking: https://docs.google.com/spreadsheets/d/106_XeDjmuBae7gexOTNzg60lapeqjl2aRn9DzupGyS8/

Step 5: Introduce PDF to data folder and git repo
Upload PDF to relevent folder in git repo https://github.com/elifesciences/enhanced-preprints-data/
Step 6: Done!

[ ] Kettle is on!

no reviews in the DocMap. Added details to the unmatched manuscripts spreadsheet.


[SPARK-14926] [ML] OneVsRest labelMetadata uses incorrect name

This contribution is my original work and I license the work to the project under the project's open source license.
What changes were proposed in this pull request?
OneVsRestModel applies labelMetadata to the output column, but the metadata could contain the wrong name. The attribute name was modified to match predictionCol.
How was this patch tested?
Manual Tests

Can one of the admins verify this patch?

@josh-howes Did you try compiling the code? predictionCol is not a Metadata instance.

Ping

Test build #3251 has started for PR 13762 at commit 22a3a04.

Test build #3251 has finished for PR 13762 at commit 22a3a04.

This patch fails to build.
This patch does not merge cleanly.
This patch adds no public classes.

@SparkQA build

I think we should close this PR.

I recently pushed a change to this but @SparkQA didn't kick off an automated build.  Is that because I squashed my commits?

Jenkins test this please

Test build #65256 has started for PR 13762 at commit b4badae.

Test build #65256 has finished for PR 13762 at commit b4badae.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/65256/
Test PASSed.

Test build #3299 has started for PR 13762 at commit b4badae.

Test build #3299 has finished for PR 13762 at commit b4badae.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Hi @josh-howes is it still active? If so, please address the comments above. Otherwise, I would rather like to propose to close this.


Fixed Typos in README.md

Thanks for this; could you add a signoff, please?

Signed-off-by: badbart<EMAIL_ADDRESS>


Turn on Silenced checkboxes...

Maybe turn on Silenced checkboxes until we have preference saving?

Authentication should be coming in v0.2, and along with that (because we will have a concept of users) will be preference saving.  That said, I have assigned this issue to the v0.2 milestone.

Auth being pushed back to v0.3, changing milestones on this.


Upgrade psdb version

Updates to latest version for psdb!

We can't upgrade psdb because it's pinned to a specific branch. Closing!


Release 3.6.0 template changes

deploy: change image versions to v3.6.0 instead of canary

This commit change the required image tag to release 3.6 instead
of canary for v3.6 release

helm: update image tag for release 3.6 instead of canary

This commit change the image tag for release v3.6 instead of
canary.

Signed-off-by: Humble Chirammal<EMAIL_ADDRESS>

@humblec this should go for release-3.6 branch, not for devel branch

True.. thats why I added that in PR title for now as the release branch is not cut yet.. thanks for the review @Madhu-1 :+1:

Thanks @Madhu-1 , a couple more PRs in , we will cut the release branch.

Thanks @Madhu-1 :+1:

/retest  ci/centos/mini-e2e-helm/k8s-1.21

/retest ci/centos/mini-e2e-helm/k8s-1.23

/retest ci/centos/upgrade-tests-cephfs

/retest ci/centos/mini-e2e-helm/k8s-1.21


PSD2 - Onestepcheckout and redirect issue

Magento version: <IP_ADDRESS>
Plugin version: 2.15.1
Description
When Enabling 3DS2 on onestepcheckout the adyen/payment/threeds2-js-utils.js is missing from the layout file, so no extra info are loaded for credit cards and 3ds2 auth fails
Fixed by adding in adyen.xml layout file
<onestepcheckout_index_index>
    <reference name="head">
        <action method="addJs">
            <script>adyen/payment/threeds2-js-utils.js</script>
        </action>
    </reference>
</onestepcheckout_index_index>

Beside that in app/design/frontend/base/default/template/adyen/threeds2.phtml in the final part of the script the redirect urls are hardcoded in the script (example window.location = '/checkout/cart'). If you have store views in url, this breaks redirect logic. A more correct approach is:
promise.then(function res(result) {
    if (result) {
        var response = JSON.parse(result);
        if (response.authentication) {
            renderThreeDS2Component(response["resultCode"], response["authentication"]["threeds2.challengeToken"]);
        } else if (response === "Authorised") {
                window.location = "<?php echo $this->getUrl('checkout/onepage/success'); ?>";
        } else if (response === "Refused" || response === "Error") {
                window.location = "<?php echo $this->getUrl('checkout/cart'); ?>";
        }
    } else {
        window.location = "<?php echo $this->getUrl('checkout/cart'); ?>";
    }
});

Hi @MarcoPierozziTriboo ,
Indeed we need to add the store views to the url,
could you please open a PR to our repo with your suggestion?
Thanks,
Alessio
Adyen

Fixed in #1047 ,
closing the issue.
Regards,
Alessio
Adyen


net/http: use iotest.ErrReader on tests

Use the new iotest.ErrReader in the net/http tests.
updates #38781

I couldn't run the tests locally, and couldn't find instructions to do so either.
~/Code/forks/go/src errreader 7s
❯ go test -v ./net/http/...
package std/net/http
	net/http/transfer.go:15:2: use of internal package net/http/internal not allowed
package std/net/http/httptest
	net/http/httptest/server.go:17:2: use of internal package net/http/internal not allowed
package std/net/http/httptrace
	net/http/httptrace/trace.go:12:2: use of internal package internal/nettrace not allowed
package std/net/http/httputil
	net/http/httputil/httputil.go:11:2: use of internal package net/http/internal not allowed
package std/net/http/pprof
	net/http/pprof/pprof.go:65:2: use of internal package internal/profile not allowed

Any pointers?

I couldn't run the tests locally, and couldn't find instructions to do so either.
~/Code/forks/go/src errreader 7s
❯ go test -v ./net/http/...
package std/net/http
	net/http/transfer.go:15:2: use of internal package net/http/internal not allowed
package std/net/http/httptest
	net/http/httptest/server.go:17:2: use of internal package net/http/internal not allowed
package std/net/http/httptrace
	net/http/httptrace/trace.go:12:2: use of internal package internal/nettrace not allowed
package std/net/http/httputil
	net/http/httputil/httputil.go:11:2: use of internal package net/http/internal not allowed
package std/net/http/pprof
	net/http/pprof/pprof.go:65:2: use of internal package internal/profile not allowed

Any pointers?

cd go/src
./all.bash


MVC Functional Tests: Remove BuildFallbackServiceProvider code in TestServices/RazorPrecompilation

Once there's a better story for how functional tests should work, this code should be removed, it was added to preserve functionality after fallback was removed from DI

fix in commit cc7b319


Fix flaky tests

https://github.com/uki00a/carol/runs/704032173
https://github.com/uki00a/carol/runs/703998960

test Application#onExit ... FAILED (96ms)
    at Object.receive (file:///home/runner/work/carol/carol/transport.ts:44:13)
    at async ChromeImpl.readLoop (file:///home/runner/work/carol/carol/chrome.ts:241:13)
error: Uncaught ConnectionReset: Connection reset by peer (os error 104)
    at unwrapResponse ($deno$/ops/dispatch_minimal.ts:63:11)
test custom executablePath ... Makefile:7: recipe for target 'test' failed
    at Object.sendAsyncMinimal ($deno$/ops/dispatch_minimal.ts:106:10)
    at async Object.write ($deno$/ops/io.ts:65:18)
    at async BufWriter.flush (https://deno.land/std@0.53.0/io/bufio.ts:479:25)
    at async writeFrame (https://deno.land/std@0.53.0/ws/mod.ts:144:3)
make: *** [test] Error 1
##[error]Process completed with exit code 2.

:thinking: :cry:

Hi @uki00a, it looks like you made some commits to fix this issue, is any further work required for this bug?

Hi @Regan-Koopmans, thanks for your comments!

is any further work required for this bug?

I'd like to remove error checks in test_util.ts.
https://github.com/uki00a/carol/blob/f89cee23722bf34032896f01f936d39c800c1417/test_util.ts#L35-L36
In order to do that, we'll probably need to add error handling to the following line:
https://github.com/uki00a/carol/blob/f89cee23722bf34032896f01f936d39c800c1417/chrome.ts#L669

After rewring code base using puppeteer (#55), another error sometimes appears...
https://github.com/uki00a/carol/runs/1610745787
running 11 tests
test Application#evaluate (part 1) ... ok (6762ms)
test Application#evaluate (part 2) ... ok (5154ms)
test Application#exposeFunction (part 1) ... ok (5175ms)
test Application#exposeFunction (part 2) ... ok (5174ms)
thread 'main' panicked at 'Error 'Trying to work with closed connection' contains boxed error of unknown type', cli/errors.rs:35:7
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
   1: std::panicking::begin_panic_fmt
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:437
   2: deno::errors::get_error_class_name::{{closure}}
   3: deno::errors::get_error_class_name
   4: deno_core::ops::json_serialize_op_result
   5: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
   6: <futures_util::future::future::Inspect<Fut,F> as core::future::future::Future>::poll
   7: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
   8: <futures_util::stream::futures_unordered::FuturesUnordered<Fut> as futures_core::stream::Stream>::poll_next
   9: deno_core::runtime::JsRuntime::poll_event_loop
  10: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  11: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  12: deno::test_command::{{closure}}
  13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
  14: tokio::runtime::Runtime::block_on
  15: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
make: *** [test] Error 101
test Application#onExit ... Makefile:8: recipe for target 'test' failed
Error: Process completed with exit code 2.


Update maintainer info

Just providing new email addresses

This PR is cool too, :sunglasses:

NB: anyone who wants me to merge PRs would do well to post animal pictures in the comments

Also I maybe be support contacting you for support requests sometime soon; working on a little Haskell API and oddly you and Jon's blog series is one of the best references I could find

Awesome, yeah hit me up for Haskell info anytime.


Video asset: autoplay + loop

Video asset: autoplay + loop
Description

Need control over autoplay and loop for video assets (as we have over audio assets)
I have a project with a video file, with audio, and the audio keeps playing ad nauseam

Version

<IP_ADDRESS>

Platform

Windows

Autoplay and loop options already exist, you're running an outdated version, check documentation before opening issues please.
http://nunustudio.org/docs/classes/VideoTexture.html
Closed!


Cant compile, tried multiple different ways

I'm unsure what Im doing incorrectly here. I've tried all the available installation methods that are known and I'm getting this same error, through every single method. Any ideas?

Ive got further than this now, but its not generating the sln

Nevermind, I got this to compile eventually, what a mission. Ended up just using Cmake GUI.


Service conformance test failed: "should be rejected when no endpoints exist"

Expected Behavior
Service Conformance tests passed.
Current Behavior
The following test failed on calico:
https://github.com/kubernetes/kubernetes/blob/v1.18.3/test/e2e/network/service.go#L2582
The root cause is cali-FORWARD got all the packets then the rules in KUBE-SERVICES don't have a chance to be executed.
An example of iptables rules are like the following:
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
  156 97519 cali-FORWARD  all  --  any    any     anywhere             anywhere             /* cali:wUHhoiAYhphO9Mso */
    0     0 KUBE-FORWARD  all  --  any    any     anywhere             anywhere             /* kubernetes forwarding rules */
    0     0 KUBE-SERVICES  all  --  any    any     anywhere             anywhere             ctstate NEW /* kubernetes service portals */

Chain KUBE-SERVICES (3 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 REJECT     tcp  --  any    any     anywhere             <IP_ADDRESS>        /* default/noep:80-8080 has no endpoints */ tcp dpt:http reject-with icmp-port-unreachable

Steps to Reproduce (for bugs)

Run conformance test

 _output/bin/e2e.test --provider=<your_provider>  --ginkgo.focus="Services should be rejected" --kubeconfig $KUBECONFIG

Your Environment

Calico version: 3.8.8
Orchestrator version (e.g. kubernetes, mesos, rkt): kubernetes 1.16
Operating System and version:Linux cluster-1-6c98ff9d7b-8h98z 5.3.0-53-generic #47~18.04.1-Ubuntu SMP Thu May 7 13:10:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Thanks for the issue - I'm going to close it as a duplicate of https://github.com/projectcalico/calico/issues/3548


Add LED type to CLASS enum

This change is

The FSP needs to uniquely identify LED targets (similar to how we use CLASS attribute for identifying cards, chips, etc.). Need a "LED" type added to the CLASS attribute.

  Can you just submit this to the Gerrit server directly instead of making a pull request?

@dcrowell77 said he would get this change into IBM gerrit. Closing this.


Access metrics in custom callbacks

❓ Questions and Help
I have found it useful/helpful to sometimes access metrics in custom callbacks. In v0.9.0 this works using something like this:
def training_step(self, batch, batch_idx):
    return {"loss": self._step(batch)}

def validation_step(self, batch, batch_idx):
    return {"val_loss": self._step(batch)}

def training_epoch_end(self, outputs):
    # ...
    return {"interesting_key_train": interesting_value}

def validation_epoch_end(self, outputs):
    # ...
    return {"interesting_key_val": interesting_value}

The setup allows for the values returned in the _epoch_end methods to be accessed via trainer.callback_metrics. As such, a callback could use these values, e.g.
class CustomCallback(Callback):

    def on_validation_end(self, trainer, pl_module):
        metrics = trainer.callback_metrics
        interesting_value = metrics["interesting_key_train"]

When using the current master branch, the above approach is possible for values returned in validation_epoch_end but no longer possible for training_epoch_end as setting a return value in training_epoch_end raises the exception,
MisconfigurationException: training_epoch_end expects a return of None. HINT: remove the return statement in training_epoch_end

Additionally the values stored in trainer.callback_metrics have changed. Using the example above, in v0.9.0, it is {"loss": ..., "interesting_key_train": ..., "interesting_key_val": ...} and on master it is simply {"interesting_key_val": ...}.
What is the intended way to access metrics (in particular from the training loop) in callbacks?

When using the current master branch, the above approach is possible for values returned in validation_epoch_end but no longer possible for training_epoch_end as setting a return value in training_epoch_end raises the exception,

Can you use self.log("interesting_key_train", interesting_value)?
Though there does seem to be an issue with accessing metrics on epoch end on master @williamFalcon

self.log works on master, I had tried it earlier today and run into issues but these seem to be resolved now.


[Discussion] AI: Path following

Discussion for http://godotrecipes.com/ai/path_follow/

This seems incomplete. It says to use PathFollow2D, but then doesn't actually mention how you create it or what you attach it to or how it interacts with the path2d or the body using it.

This tutorial needs updating.

@brobruno51 I just ran the project under 3.3.1 and it works exactly the same. What makes you think it needs updating?

This tutorial is exactly what I was looking for! It doesn't use a PathFollow2D because it's for a KinematicBody2D.

@brobruno51 I just ran the project under 3.3.1 and it works exactly the same. What makes you think it needs updating?

Sorry, my bad! It works fine.

Not sure what I've messed up. It works fine until the character gets to the first Point on the Path2D, and then it gets stuck. I've got a simple path consisting of only 2 points, but the same thing happened when I tried a 4-point rectangular path.
I've got a CharacterMover node that controls the movement, but otherwise my code is basically identical.
Here's what it looks like in action:

Here's the code:
class_name Guard
extends KinematicBody2D

onready var character_mover = $CharacterMover

export (NodePath) var patrol_path
var patrol_points
var patrol_index = 0
export var is_patrolling: bool = true

func _ready():
	if patrol_path:
		patrol_points = get_node(patrol_path).curve.get_baked_points()

func _physics_process(delta):
	patrol()

func patrol():
	if !patrol_path or !is_patrolling:
		return

	var target = patrol_points[patrol_index]

	if position.distance_to(target) < 1:
		patrol_index = wrapi(patrol_index + 1, 0, patrol_points.size())
		target = patrol_points[patrol_index]

	go_to(target)

func go_to(target_pos: Vector2):
	var move_vec = Vector2()
	move_vec = position.direction_to(target_pos)
	character_mover.set_move_vec(move_vec)

class_name CharacterMover
extends Node2D

var body_to_move : KinematicBody2D = null

export var speed = 200

var move_vec : Vector2
var velocity : Vector2

func _ready():
	assert(owner is KinematicBody2D)
	body_to_move = owner

func set_move_vec(_move_vec: Vector2):
	move_vec = _move_vec.normalized()

func _physics_process(delta):
	velocity = move_vec * speed
	velocity = body_to_move.move_and_slide(velocity)

I suggest you to create a Line2D and set its point so that you can see the
actual path in screen.
Your bug could be the chech "< 1", in my game i have a "stuck timer" of 1
second which automatically goes to the next point if stuck for more than 1
second.
Il dom 30 mag 2021, 23:44 craigostrin @.***> ha scritto:

Not sure what I've messed up. It works fine until the character gets to
the first Point on the Path2D, and then it gets stuck. I've got a simple
path consisting of only 2 points, but the same thing happened when I tried
a 4-point rectangular path.
I've got a CharacterMover node that controls the movement, but otherwise
my code is basically identical.
Here's what it looks like in action:
[image: patrol_bug]
https://user-images.githubusercontent.com/40326682/120120801-b8259980-c16d-11eb-9d54-b653ff30f050.gif
Here's the code:
class_name Guard
extends KinematicBody2D
onready var character_mover = $CharacterMover
export (NodePath) var patrol_path
var patrol_points
var patrol_index = 0
export var is_patrolling: bool = true
func _ready():
if patrol_path:
patrol_points = get_node(patrol_path).curve.get_baked_points()
func _physics_process(delta):
patrol()
func patrol():
if !patrol_path or !is_patrolling:
return
var target = patrol_points[patrol_index]
if position.distance_to(target) < 1:
patrol_index = wrapi(patrol_index + 1, 0, patrol_points.size())
target = patrol_points[patrol_index]
go_to(target)
func go_to(target_pos: Vector2):
var move_vec = Vector2()
move_vec = position.direction_to(target_pos)
character_mover.set_move_vec(move_vec)
class_name CharacterMover
extends Node2D
var body_to_move : KinematicBody2D = null
export var speed = 200
var move_vec : Vector2
var velocity : Vector2
func _ready():
assert(owner is KinematicBody2D)
body_to_move = owner
func set_move_vec(_move_vec: Vector2):
move_vec = _move_vec.normalized()
func _physics_process(delta):
velocity = move_vec * speed
velocity = body_to_move.move_and_slide(velocity)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kidscancode/godot_recipes/issues/72#issuecomment-851065814,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABRB2CM2TRPQ7SGB2ZR3VNLTQKWURANCNFSM4XADILHA
.

https://github.com/kidscancode/godot_recipes/issues/72#issuecomment-851065814

It works fine until the character gets to the first Point on the Path2D, and then it gets stuck.

I came across the same issue.
It happens because the recipe has a bug that causes it to only work for very low speeds because it will overshoot the target at higher speeds. E.g. if the follower is 2px from the target, the delta (physics time step) is a constant 1/60s and the speed is 240px/s, the follower will move 240*1/60 = 4pxtowards the target which overshoots by2px! The follower ends up still being  2px from the target at the end of the move_and_slide, so it will never satisfy if position.distance_to(target) < 1 and thus enter an infinite loop where it never goes to the next waypoint along the path. Only speeds less than `60px/s will work!
One easy solution comes to mind: check if the follower will overshoot, and in that case set the velocity so that it exactly reaches the next waypoint after the move_and_slide.
This has the advantage that it never overshoots, but the disadvantage that if there are a lot of tightly spaced waypoints then it might not actually move at the desired speed, since it can at most pass one waypoint per physics frame.
This can be worked around by setting the "Bake Interval" of the Curve2D of the Path2D to a higher value, with the tradeoff that the path will be less smooth:

Another workaround is to replace the curve.get_baked_points call with curve.tessellate, which might generate fewer waypoints than get_baked_points depending on the exact "Bake Interval" setting.

One easy solution comes to mind: check if the follower will overshoot, and in that case set the velocity so that it exactly reaches the next waypoint after the move_and_slide.

I tried making it work like that, and here's a GIF of the result:

As can be seen it handles very fast speeds (no real upper limit in fact), and slows down when there's tightly spaced way points because it can at most traverse 1 way point per physics frame.
Here's the C# code:
`
private void IntegrateVelocity()
{
_velocity = MoveAndSlide(_velocity);
}
    private void ProcessPathFollowing(float delta)
    {
        var target = _patrolPoints[_patrolIndex];

        if (Position.DistanceTo(target) < _nextWaypointDistanceThreshold)
        {
            _patrolIndex++;
            _patrolIndex = (_patrolIndex > _patrolPoints.Length - 1) ? 0 : _patrolIndex;
            target = _patrolPoints[_patrolIndex];
        }

        var vecToTarget = (target - Position);
        var dirToTarget = vecToTarget.Normalized();
        var distToTarget = vecToTarget.Length();

        var willOvershoot = _speed * delta > distToTarget;

        if (willOvershoot)
        {
            // The velocity needed to reach next patrol point in the next frame
            var tempSpeed = distToTarget / delta;
            _velocity = dirToTarget * tempSpeed;
        }
        else
        {
            _velocity = dirToTarget * _speed;
        }
    }

    public override void _PhysicsProcess(float delta)
    {
        if (_patrolPoints?.Length != 0)
            ProcessPathFollowing(delta);

        IntegrateVelocity();
    }

`

The above solution works, but it's not ideal. Not only doesn't it do an especially good job of following a Path2D at a given speed, even if it did so perfectly it'd just be replicating the behavior of PathFollow2D. A solution that is simpler and gives better results is to have the unit inherit from PathFollow2D instead of KinematicBody2D, but the guide specifically mentions avoiding that as a goal, so here's another approach that manages that but still utilizes the build-in behavior of PathFollow2D. It references an actual PathFollow2D object. It uses that to figure out what the next "target position along the path" should be for this frame, which is used to calculate a "target position" to move towards. Here's the code:
    public class Unit : KinematicBody2D
    {
        [Export] private NodePath _pathPath;
        [Export] private float _speed = 100f;
        [Export] private float _pathOffset = 0f;

        private Vector2 _velocity;
        private PathFollow2D _pathFollow;

        public override void _Ready()
        {
            if (GetNode<Path2D>(_pathPath) == null)
                throw new ArgumentNullException();

            if (GetNode<Path2D>(_pathPath).GetNode<PathFollow2D>("PathFollow2D") == null)
                throw new ArgumentNullException();

            _pathFollow = GetNode<Path2D>(_pathPath).GetNode<PathFollow2D>("PathFollow2D");
        }

        private void IntegrateVelocity()
        {
            _velocity = MoveAndSlide(_velocity);
        }

        private void ProcessPathFollowing(float delta)
        {
            _pathOffset += _speed * delta;
            _pathFollow.Offset = _pathOffset;

            var targetTranslation = _pathFollow.GlobalPosition - GlobalPosition;
            _velocity = targetTranslation / delta;
            Debug.Print(_velocity.Length().ToString());
        }

        public override void _PhysicsProcess(float delta)
        {
            ProcessPathFollowing(delta);
            IntegrateVelocity();
        }
    }


assignment_2.ipynb: added answers to questions 1-4

Update the assignment_2 file by adding the python codes and explanation.

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)
I am completing an assignment with four tasks: inspecting and visualizing data, fitting a multivariable linear regression model, and calculating RMSPE for model evaluation.
What did you learn from the changes you have made?
I learned how to correctly split data for training and testing, and compute RMSPE for model performance assessment.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
Initially, I considered removing both 'name' and 'origin', but I decided to keep 'origin' using One-Hot Encoding for better model accuracy, as the variable contains useful information.
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
The main challenge was handling the categorical variables 'name' and 'origin'. I initially wasn't sure how to use them in the model. I decided to drop 'name' as it wasn't useful, and I applied One-Hot Encoding to 'origin' to include it in the model. This allowed the model to use origin as a predictor.
How were these changes tested?
I tested the changes by running predictions on the test set and verifying that the outputs matched the expectations from the course materials.
A reference to a related issue in your repository (if applicable)
Not applicable for this assignment.
Checklist

[x] I can confirm that my changes are working as intended

A2: Incomplete
Q3: You may need to update your numeric_predictors in order to capture the numeric parameters you need and to drop the others that you do not.

A2: Complete
Please make the minor change as discussed in slack chat.
Otherwise great work


Upcoming Dates - add title and slight layout change

Jason forgot about the project title. The new layout is:
[Comment deadline date] - The comment deadline is [days until deadline]
     Project #ProjectID - title_action
     Abstract: project_abstract
     Sponsor: sponsor

looks good, thank you


Get links same domain from a web page

Implement the function for get links same domain from a web page.

This issue resolved by pull request #8 .


Discuss about how text needs to be aligned in Stage component

When we don't have a subtitle in the example the text goes down, the same problem we have when the image height is big. That is happening because we have justify-content: flex-end; on bal-stage-body.
We should define how text needs to be aligned here.

@GinaBiondo-aperto lets check the stage together what we need and what not

@GinaBiondo-aperto will add the needed sizes with values and we gone fix the stage with alignment and sizes

Hey @hirsch88 :)
So on our side, there are only two sizes currently used. Medium with 400px and large with 840px. Small seems to be defined by the content and the other ones are not in use.


Update isGooglePhotosUri(Uri uri)

Update isGooglePhotosUri(Uri uri) to accommodate the recent change in Authority of Google Photos App.

I've actually tested this code and this breaks the current implementation.
When using this logic, it does not provide the file path, instead it provides numeric data, not sure what that integer value is from.


Fix shoryuken handler undefined method call

process_async_item(item) tries to call configuration.async_handler.call(item.payload) for Rollbar::Delay::Shoryuken class even though there's no self.call defined which results in
#<NoMethodError: undefined method `call' for Rollbar::Delay::Shoryuken:Class>

Yes, let's close this one.


Skrollr intermittently breaking...

I am experiencing an issue with skrollr where sometimes it doesn't work on the initial load of a page, but once you scroll down to the element in question, and refresh the page, it works fine...
Is this something you've seen before?
For reference...
swankmedia.ca/coleman-smith
Each section has a black box with a description, there's a vertical grey line on each box that should be animating...

@manueltomasir Where you able to figure this out?

No, still no solution...

After the skrollr.init(), try running .refresh() on your skrollr object. I had a similar issue where the last slide would break, so I had to call .refresh() once the user got 50% down the page.

Thanks i'll give that a try

If you're using jQuery, this seems to work for me.
var s = skrollr.init();

$(window).on("load", function(){
   s.refresh();
});


Crash report

Hello, not sure if this helps, but I noticed a crash in an app today that might be related to SwiftkubeClient.
This is the backtrace:
Received signal 11. Backtrace:
0x56295651b302, Backtrace.(printBacktrace in _B82A8C0ED7C904841114FDF244F9E58E)(signal: Swift.Int32) -> () at /src/.build/checkouts/swift-backtrace/Sources/Backtrace/Backtrace.swift:66
0x56295651b597, closure #1 (Swift.Int32) -> () in static Backtrace.Backtrace.install(signals: Swift.Array<Swift.Int32>) -> () at /src/.build/checkouts/swift-backtrace/Sources/Backtrace/Backtrace.swift:80
0x56295651b597, @objc closure #1 (Swift.Int32) -> () in static Backtrace.Backtrace.install(signals: Swift.Array<Swift.Int32>) -> () at /src/<compiler-generated>:79
0x7f11683f413f
0x56295799cb21
0x5629568fd5de, generic specialization <Swift.CodingUserInfoKey, Any> of Swift.Dictionary._Variant.setValue(_: __owned B, forKey: A) -> () at /src/<compiler-generated>:0
0x5629568fd5de, generic specialization <Swift.CodingUserInfoKey, Any> of Swift.Dictionary.subscript.setter : (A) -> Swift.Optional<B> at /src/<compiler-generated>:0
0x5629568fd534, SwiftkubeClient.GenericKubernetesClient.prepareDecoder(Foundation.JSONDecoder) -> () at /src/.build/checkouts/client/Sources/SwiftkubeClient/Client/GenericKubernetesClient.swift:76
0x5629568fd84a, protocol witness for SwiftkubeClient.RequestHandlerType.prepareDecoder(Foundation.JSONDecoder) -> () in conformance SwiftkubeClient.GenericKubernetesClient<A> : SwiftkubeClient.RequestHandlerType in SwiftkubeClient at /src/<compiler-generated>:0
0x56295690b287, (5) suspend resume partial function for (extension in SwiftkubeClient):SwiftkubeClient.RequestHandlerType.dispatch<A where A1: Swift.Decodable>(request: SwiftkubeClient.KubernetesRequest, expect: A1.Type) async throws -> A1 at /src/.build/checkouts/client/Sources/SwiftkubeClient/Client/RequestHandlerType.swift:78
0x56295768befd
0x56295768c5eb
0x562957652694
0x562957652442
0x56295765dd31
0x7f11683e8ea6
0x7f11680f8a2e
0xffffffffffffffff

At this time the app was most likely doing only one thing: watching a list of Pods.
let watchTask = try self.client.pods.watch(in: ns, options: options) { [logger] event, pod in
  logger.debug("event: \(event): pod: \(pod.name ?? "")")
  if event == .error {
    // we need to restart the watcher
    Task {
      try? self.observePods()
    }
  } else {
    Task {
      try await self.refreshTargets()
    }
  }
}

And refreshTargets only does this with client:
let listOfPods = try await self.client.pods.list(in: ns, options: options)

Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.13", GitCommit:"592eca05be27f7d927d0b25cbb4241d75a9574bf", GitTreeState:"clean", BuildDate:"2022-10-12T10:57:16Z", GoVersion:"go1.17.13", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"23+", GitVersion:"v1.23.14-eks-ffeb93d", GitCommit:"96e7d52c98a32f2b296ca7f19dc9346cf79915ba", GitTreeState:"clean", BuildDate:"2022-11-29T18:43:31Z", GoVersion:"go1.17.13", Compiler:"gc", Platform:"linux/amd64"}

    {
      "identity" : "client",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/swiftkube/client.git",
      "state" : {
        "revision" : "6809c6aeff28be17afe82e6e0287e1b8c9d38ee1",
        "version" : "0.12.0"
      }
    },
    {
      "identity" : "model",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/swiftkube/model.git",
      "state" : {
        "revision" : "3f40e3e7e4f8202c88ad3605e85ad98eba198786",
        "version" : "0.6.0"
      }
    }

I wonder if the userInfo dictionary of JSONDecoder is thread-safe. What happens when the prepareDecoder method is called concurrently for a shared client?

Hm this looks suspicious: The JSONDecoder seems to be shared with all requests handled by the client, which is fine, but the problem might be that the userInfo dict is being mutated in RequestHandlerType.dispatch<T: Decodable>(request: KubernetesRequest, expect responseType: T.Type) async throws -> T when it calls perpareDecoder(jsonDecoder).

@t089 Thanks for the bug report 👍
It seem, like you're onto something. The thread-safety of the userInfo is very likely to be the culprit here. I guess, it won't be easy to reproduce 🤔
I'll try to find a solution for propagating the userInfo in an async context.

One fix for this would be the no-code approach 😉. The userInfo dictionary is only required for decoding an unknown type to a type-erased AnyKubernetesAPIResource.
I was planning on dropping the AnyKubernetesAPIResource because it was superseded by the UnstructuredResource in SwiftkubeModel v0.5.0. Its usage is demonstrated in the swiftkube-c-t-l example here
However, there are some missing bits and pieces, in order to completely make the transition.

other quick fixes:

do not share the JSONDecoder but create a new one for each request.
continue to share, but protect the access to the unserInfo with a global lock (should be mostly fine unless there are a TON of concurrent requests within the same process).

Yes, however, there are some drawbacks with keeping that code, since it was more-or-less a workaround for decoding unknown types. With the introduction of GroupVersionResouce, UnstructuredResource and derivatives in v0.5.0, there is no need anymore for this workaround.
Besides, I think it is better to avoid creating a decoder for each request, in order to be more memory friendly. And a global lock would be another workaround.

Yes, sounds reasonable!


[Question]Does msbuild reuse process node?

Simple question to be sure...does msbuild reuse process host during build right(for instance on a solution with a lot of projects)?
I mean if I've got a task with static data it's possible that different builds reuse same process(app domain) and my statics are previous value?
related issue https://github.com/Microsoft/msbuild/issues/2916
I need only an "I confirm"

I need only an "I confirm"

If only it were that simple! :)
MSBuild always reuses processes within a build, so your example of "a solution with a lot of projects" will always have a finite set of processes. The processes will last at least until the end of the build in all cases.
If node reuse is enabled (it is enabled by default), worker nodes will outlive the build that created them, and may be reused for subsequent builds. There is no guarantee that the subsequent build is of the same or similar projects, and there is no guarantee that a subsequent build of the same projects will assign a particular project to the same node it used before.
It is also possible to define a task that gets its own AppDomain, which complicates the statics situation.

There is no guarantee that the subsequent build is of the same or similar projects

But same solution?

Nodes are reusable by the same user for their lifetime.
No guarantee that it's the same solution; a user could have two repos open in different command lines and build one, then the other.

Ok thanks a lot for the clarification!


Make File.listdir a method

This documented as a method in 4.1 changelog and it seems more intuitive
this way as it clearly indicates that a computation is performed.

Merged, thanks!


Machine page mobile different images

There are still some other images displayed at the machine page on mobile. Now the images don't match anymore.

Haha. Another example of when you've made changes to the design after I've already coded the page. Fixed it! :blush: