Bugfix rollup

Pull Request (PR) description
This PR fixes several issues
This Pull Request (PR) fixes the following issues

Fixes #971
Fixes #972
Fixes #973
Fixes #975

Task list

[X] Added an entry under the Unreleased section of the change log in the CHANGELOG.md.
Entry should say what was changed, and how that affects users (if applicable).
[X] Resource documentation added/updated in README.md in the resource folder.
[X] Resource parameter descriptions added/updated in schema.mof
and comment-based help.
[X] Comment-based help added/updated.
[X] Localization strings added/updated in all localization files as appropriate.
[X] Examples appropriately added/updated.
[X] Unit tests added/updated. See DSC Resource Testing Guidelines.
[X] Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
[X] New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

This change is

Codecov Report

Merging #976 into dev will decrease coverage by <1%.
The diff coverage is 93%.

@@          Coverage Diff          @@
##             dev    #976   +/-   ##
=====================================
- Coverage     92%     92%   -1%
=====================================
  Files        115     115
  Lines      11789   11807   +18
  Branches       1       1
=====================================
+ Hits       10950   10966   +16
- Misses       838     840    +2
  Partials       1       1

@ykuijs I'm on it


Problem with making Ghostbsd_cinnamon_i386_iso

Hello, I have problem with making GhostBSD_cinnamon_i386_iso. My work station:
root@ubilling:/usr/home/userside # uname -a
FreeBSD ubilling 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0 r306420: Thu Sep 29 01:43:23 UTC 2016     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

I did everything according to the instructions.
root@ubilling:/usr/home/userside/ghostbsd-build/mkscripts # ./make_cinnamon_i386_iso
#### Fetching world for i386 architecture ####
base.txz                                      100% of   80 MB 4778 kBps 00m18s
#### Fetching kernel for i386 architecture ####
kernel.txz                                    100% of   30 MB 1829 kBps 00m18s
1+0 records in
1+0 records out
1024 bytes transferred in 0.000033 secs (31328397 bytes/sec)
/dev/md0: 12288.0MB (25165824 sectors) block size 32768, fragment size 4096
        using 20 cylinder groups of 626.09MB, 20035 blks, 80256 inodes.
super-block backups (for fsck_ffs -b #) at:
 192, 1282432, 2564672, 3846912, 5129152, 6411392, 7693632, 8975872, 10258112, 11540352, 12822592, 14104832,
 15387072, 16669312, 17951552, 19233792, 20516032, 21798272, 23080512, 24362752
#### Installing world for i386 architecture ####
Starting jails: ghostbsd-fscinnamoni386.
#### Installing kernel for i386 architecture ####
bash
fusefs-ntfs
cups
Installing packages listed in /tmp/cinnamon-packages
Bootstrapping pkg from http://pkg.GhostBSD.org/GhostBSD-11/i386/test, please wait...
Installing pkg-1.10.1...

Those files, cinnamon related and others, are a leftover of some experiment made long ago, and are totally unmaintained/unsupported.

i386 support has been deprecated. Cinnamon support is currently not planned for inclusion.


[Bug][fn] Go functions do not reset idleTimer correctly.

Search before asking

[X] I searched in the issues and found nothing similar.

Version
The code in instance.go which handles incoming messages and idle timeout basically boils down to this:
	idleDuration := getIdleTimeout(time.Millisecond * time.Duration(gi.context.instanceConf.killAfterIdleMs))
	idleTimer := time.NewTimer(idleDuration)
	defer idleTimer.Stop()

CLOSE:
	for {
		idleTimer.Reset(idleDuration)
		select {
		case cm := <-channel:
			// handle message
		case <-idleTimer.C:
			close(channel) // this is not great either, but that's a separate bug ;)
			break CLOSE
		}
	}

However, this does not account for the idle timer firing during work. If it does, then the reset will not have the desired effect, and the idle clause will fire erroneously on a subsequent loop, since there's now a timestamp on the channel.
Minimal reproduce step
Here's a simple repro:
package main

import "fmt"
import "time"

func main() {
	const idleDuration = 250*time.Millisecond
	work := make(chan int,2)
	work <- 1
	work <- 2
	t := time.NewTimer(idleDuration)
	EVENTLOOP:
	for {
		t.Reset(idleDuration)
		fmt.Println("waiting for new work")
		select {
		case w := <- work:
			fmt.Printf("doing work on %d\n", w)
			time.Sleep(500*time.Millisecond)
			fmt.Println("done with work")
		case <- t.C:
			fmt.Println("timed out")
			break EVENTLOOP
		}
	}
}

Run that a few times, and you'll see:
waiting for new work
doing work on 1
done with work
waiting for new work
timed out

This is exactly what would happen in a Go function, only it would then call log.Fatal
What did you expect to see?
n/a
What did you see instead?
n/a
Anything else?
The correct fix is to call Stop() on the timer and, if it returns false, drain the channel before resetting:
CLOSE:
	for {
		select {
		case cm := <-channel:
			// handle message
		case <-idleTimer.C:
			close(channel)
			break CLOSE
		}
		if !idleTimer.Stop() {
			<-idleTimer.C
		}
	}

Are you willing to submit a PR?

[X] I'm willing to submit a PR!

@flowchartsman Thanks for reporting and contributing the fix for this issue.
I recently happened to review some code in the Pulsar Go client and it contains similar code for handling the send timeout on the producer. This is the code: https://github.com/apache/pulsar-client-go/blob/2eb340511dbf0602f7c561a1d86e179098f4662b/pulsar/producer_partition.go#L910-L924
Does this have a similar issue?

@flowchartsman Thanks for reporting and contributing the fix for this issue.
I recently happened to review some code in the Pulsar Go client and it contains similar code for handling the send timeout on the producer. This is the code: https://github.com/apache/pulsar-client-go/blob/2eb340511dbf0602f7c561a1d86e179098f4662b/pulsar/producer_partition.go#L910-L924 Does this have a similar issue?

From a quick glance, I'd say this looks fine. The loop is a range over the channel, which guarantees that it will be read before Reset is called, and each use of Reset is immediately followed by a control flow statement that begins the next loop iteration, so none of the timeout is expended before waiting on it again. Finally, on the off chance that the timer fires after the loop is exited, the deferred Stop should ensure that the buffered C channel is GCed.
This avoids the main problem we had here where the timer wasn't guaranteed to be read in each loop, meaning it could fire during work and be left until the next iteration.


ServicePointManager.ClientCipherSuitesCallback is obsolete in Mono

ServicePointManager.ClientCipherSuitesCallback has been marked as Obsolete in Mono, and Android builds of ModernHttpClient no longer compile.
https://github.com/mono/mono/blob/86b5cde6c07809d81b592973f002ecf16cc22bf6/mcs/class/System/System.Net/ServicePointManager.extra.cs#L22-L23
This change is already in the current stable release of Xamarin.Android (<IP_ADDRESS>)

+1

+1

+1

If you don't have anything constructive to say, then don't do it. +1 isn't constructive and you should add a reaction to the opening post instead.

Thanks for the advice - an error of inexperience. +1 removed now and reaction added.

@dwhathaway were you able to get it to compile?

@tharanagaraj No, I haven't.  I haven't had a need to recompile from source since I initially ran into this.  The current available compiled versions do continue to work (at least they don't crash), despite the deprecation of this API.

How do we compile the update to support TLS 1.1+ on older version of Android if ServicePointManager is obsolete? Does anyone have an updated fork or branch supporting those changes in Issue #173

Any news on it ?


New version: CausalInference v0.11.6

Registering package: CausalInference
Repository: https://github.com/mschauer/CausalInference.jl
Created by: @mschauer
Version: v0.11.6
Commit: 049be6fa925c24a6839a857bd65f62bcc60d47b4
Reviewed by: @mschauer
Reference: https://github.com/mschauer/CausalInference.jl/commit/049be6fa925c24a6839a857bd65f62bcc60d47b4#commitcomment-125264372
Description: Causal inference, graphical models and structure learning with the PC algorithm.

Closed by #90140


duplicate outpoint when transfer multi RGB20 from 1 UTXO

alice tranfer 100 RGB20 to bob
alice tranfer 50 RGB20 to bob

after above steps, bob's one UTXO have 150 RGB20 with two witnesses

bob transfer 100+ (120 eg) to anyone else, it should combined payment

Result: the psbt will have duplicate outpoint ( sparrow will report error)

What do you specifically mean by "PSBT have duplicate outpoint"? Can you provide a Sparrow error text?

alice.psbt.zip
the attachment is the psbt

@dr-orlovsky I have try to verify the error, it just demo, if want fix, should modify core codes

@Matrix-Zhang it ended up that not the outputs are duplicated but inputs (which contain outpoints of the previous transactions, hence the Sparrow message). Please check https://github.com/RGB-WG/rgb/pull/136


Run agent scanner components in separate docker containers

Is your feature request related to a problem?
Issues with the existing solution of running everything in a single container:

Zombie processes don't get cleaned up (e.g. #302)
The natlas/agent Docker image is large with all of the scanners built in. Thus we're forcing consumers to download large images
Everything gets run in a single container and the same security context/namespace

Describe the feature you'd like
We could run the agent scanning components in separate Docker containers with separate images. The Natlas agent would bind mount the docker.sock into the container, then use the Docker API to orchestrate the worker containers and cleanup after it's done.
Have you considered alternative ways to get this feature
Additional context
Add any other context or screenshots about the feature request here.

The primary concern with this idea is that the agent container (which handles communication with the server and orchestration of the sub-components) now can control the entire docker api, which is not really ideal for security. But it also means that the agent is in a higher trust zone because that container isn't actually communicating with anything directly. For example, a chrome 0day right now could result in the entire agent container being compromised. By putting subcomponents in different containers that are launched on demand, this would definitely increase the boundaries.
How do we (safely) move files between containers? We don't just read stdout from nmap, we read the .nmap .xml and .gnmap files. We read the images and json produced by aquatone (and even when we bypass aquatone we'll still need to be able to read the images produced by chrome). Most tools that we might want to include are likely to produce file outputs that we'll want to consume. So do we need to have a shared volume between the orchestrating container and all it's children containers?

Agreed on the security aspects. I won't downplay those.
Options for moving files between containers:

A shared volume. We can then mount a scan-tool specific folder into the scanner container
Serialized across stdout/stderr. Everything can technically be serialized across stdout. I don't necessarily like serializing an image across stdout as base64, but it technically would work.

Heh, we do already base64 the images as part of the blob across the wire so that everything needed for a scan to be processed is included in a single POST request (this has caused issues with nginx's client_max_body_size before and isn't entirely idea). Shared volumes is probably the preferred approach if we do go this way.


DeserializeOperation taking 5s to compile

When I compiled using the following line, I discovered that a Spine function is at the top of the list of things taking the longest.
xcodebuild -workspace myApp.xcworkspace -scheme myApp clean build OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" | grep [1-9].[0-9]ms | sort -nr > culprits.txt

Not sure why it's duplicated, though, but the times are different...
3025.6ms	/Users/MyUser/myApp/Pods/Spine/Spine/DeserializeOperation.swift:338:15	private func resolveRelations()
2933.1ms	/Users/MyUser/myApp/Pods/Spine/Spine/DeserializeOperation.swift:338:15	private func resolveRelations()

Not sure how to fix it, just thought I'd share the finding.

It seems that type inference is the culprit here (as it usually is). Adding a explicit ResourceIdentifier  type for the link parameter fixes this:
let targetResources = linkage.flatMap { (link: ResourceIdentifier) in
    return self.resourcePool.filter { $0.resourceType == link.type && $0.id == link.id }
}

I've pushed an update. Can you check whether this is solved?

Yes. I'll check.


uptake Scala 3.3.0

follow up to #150 and https://github.com/apache/incubator-pekko/pull/270

@pjfanning Lets use 0.0.0+4411-6fe04045-SNAPSHOT as the pekko-http version from https://github.com/apache/incubator-pekko-http/actions/runs/5092919848/jobs/9154894284

this is done


$Keys types values missing in autocomplete

Using Atom's Nuclide and vim's vim-flow, autocompletion does not show values for a type created from $Keys.
Below shows the Explicit type popup working as expected in Nuclide:

Below shows From$Keys not working as expected. There aren't any autocompletion values for From$Keys:

After finding a similar issue (https://github.com/facebook/flow/issues/2588) and PR (https://github.com/facebook/flow/pull/2965) with $Exact,  I believe $Keys is not yet implemented for autocompletion. This line and the comment above it look relevant: https://github.com/facebook/flow/blob/master/src/typing/type_printer.ml#L249
Here is the code in flow.org/try

Does autocomplete ever give you completion for literal values? I'd love it to, but I haven't seen that happen in any context yet.
type Foo = 'Bar' | 'Baz';
const f: Foo = <{Insertion Point}>

In Atom, Flow doesn't appear to provide any completion for the above.

any workarounds? I REALLY need this :(


User can unpublish guides that have been published previously

A guide can be unpublished, which means redirecting that guide to either a
topic or a guide.

New Edition state "unpublished"
Edition action buttons disabled when a guide is unpublished
Edition inputs are disabled when a guide is unpublished
Store redirect in the publishing api
Store new author as the person who unpublished
Rename SlugMigrationPublisher to RedirectPublisher

Unpublish button is now floated right:

Unpublished state is gray:

Edition actions are now reordered from:
Preview
Save
Discard new guide
Discard draft
Unpublish
Send for review
Approve for publication
Publish
Send for review
Back to all guides

to:
Preview
Save
Unpublish
Send for review
Approve for publication
Publish
Send for review
Discard new guide
Discard draft
Back to all guides

Go for it :+1:


Importing a CSV into an existing table without a header fails

E.g. importing tinysnb (vPerson2.csv), starting by creating the schema using the shell.
It just complains that each column is missing the column name (e.g. Column 0 in table person is missing column name).
And for files with a header (e.g. vPerson.csv) the header appears to need to match the case of the properties, unlike copying from the command line.

I think in both cases, if you set the column names manually from the dropdown, it will still works, but the default settings does not setup all the fields automatically (as shown below).

For case 2, I think it is reasonable to make the UI case insensitive similar to the shell, I implmented this change in #200. However, for case 1, I do not think it is safe to assume that the column order in the file is the same as the table. I would prefer that the user always review and select manually in this case to avoid unexpected behavior.

Also, it seems that the dropdown for column configurations is not obvious. I am not sure if we should just expand everything by default? @semihsalihoglu-uw or @prrao87 can comment.


Updated requirements.txt

These 3 pips were not found in requirements.txt which threw error 3 times when I tried to run python manage.py runserver.
ModuleNotFoundError: No module named 'crispy_forms'
ModuleNotFoundError: No module named 'crispy_forms_materialize'
ModuleNotFoundError: No module named 'materializecssform'

So I updated requirements.txt with following modules added.
crispy-forms-materialize==0.2
django-crispy-forms==1.12.0
django-materializecss-form==1.1.17

Closing this PR as the requirements are already present in the repo


[$125] Improve developer experience around react-compiler

Version Number:
Reproducible in staging?: -
Reproducible in production?: -
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:
This is purely a developer experience issue.
I have recently spent 1+ hours trying to fix an issue with react-compiler on one of my PRs. I think this may happen in future for more people and I wanted to add some tweaks to our code to improve this experience.
Here's what I would like to do:

I will update our readme (https://github.com/Expensify/App/blob/main/contributingGuides/REACT_COMPILER.md) with one more case of handling react-compiler related error
I will add a package.json script to run specifically this command on dev: npm run react-compiler-healthcheck &> output.txt (npm run react-compiler-healthcheck &> output.txt)
instead of output.txt we would call this file something specific, for example react-compiler-output.txt
finally add react-compiler-output.txt to gitignore, so that a developer can easily keep running the same script and not worry about accidentally pushing it to upstream repo (which I have - of course - did by mistake 😅)

I can have a PR ready very soon with these
CC @kirillzyusko
Action Performed:
N/A
Expected Result:
N/A
Actual Result:
N/A
Workaround:
N/A
Platforms:

Which of our officially supported platforms is this issue occurring on?

[x] Android: Native
[x] Android: mWeb Chrome
[x] iOS: Native
[x] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[x] MacOS: Desktop

Screenshots/Videos
Add any screenshot/video evidence

View all open jobs on GitHub
Upwork Automation - Do Not Edit

Upwork Job URL: https://www.upwork.com/jobs/~014befe13a62da3c50
Upwork Job ID:<PHONE_NUMBER>211382500
Last Price Increase: 2024-08-28

Issue OwnerCurrent Issue Owner: @

Don't think we need ya here @shawnborton , sorry. I added NewFeature to create an Upwork job for @rayane-djouah .

@rayane-djouah can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~014befe13a62da3c50

Contributor+: @rayane-djouah paid $125 via Upwork
Don't think a regression test is needed here, plz comment if anyone disagrees and I'll reopen. And/or, @Kicu , if documentation needs to be updated anywhere.  Thx


Unable to add parameters in url when using websocket client (websockets.connect)

Can't add parameters in a URL, even if I add them the server doesn't receive them:
Example:
async def listen():
    url = 'ws://example.com/?param1=12&param2=13&param3=14'
    headers = {'Cookie': 'token=12345678'}

    async with websockets.connect(url, extra_headers=headers) as ws:
        ...

How to get through it? I've already tried every way, and I assure you that the server really doesn't receive these parameters!
The server receives only the URL but without the parameters!

Please enable debug logs: https://websockets.readthedocs.io/en/stable/topics/logging.html
You will see that parameters are sent and that it's a problem with the server, not with websockets.

I just checked the logs, and I also created a socket server myself to keep track of incoming parameters, and it really is a websockets problem, the parameters are not arriving on the server as expected, I tried another library and the parameters arrive normally!

With this client:
#!/usr/bin/env python

import asyncio
import websockets

async def hello():
    async with websockets.connect("ws://localhost:8765/?foo=bar") as websocket:
        pass

asyncio.run(hello())

and this server:
#!/usr/bin/env python

import asyncio
import websockets

async def echo(websocket):
    print(websocket.path)

async def main():
    async with websockets.serve(echo, "localhost", 8765):
        await asyncio.Future()  # run forever

asyncio.run(main())

the server prints:
/?foo=bar

With the information you have provided, I cannot reproduce the issue.
If you can modify the example above in a way that reproduces your problem, I will investigate.


[mgmt] update nginx samples

fix https://github.com/Azure/azure-sdk-for-js/issues/28126

API change check
API changes are not detected in this pull request.

swagger pr: https://github.com/Azure/azure-rest-api-specs/pull/27220


Error: "FirebaseAnalytics.initializeFirebase()" is not implemented on android

I followed as per the document.
And also confirmed this issue by creating the new Ionic Capacitor Project and installed the Plugin and configs.
While running in Android alone this error is throw. In web everything fine.
Android Studio Logcat:

MainActivity.java

FirebaseAnalytics initialisation
App.component.ts

Ionic Info

Package.json

Please help me to resolve this issue.

Sorry, i didn't aware of we should use FirebaseAnalytics.initializeFirebase() only in Web.
After checking the issue #33 i understood clearly.
After removing everything works fine now.


Open snackbar on category click when network is down

Now we are just disabling categories, so let's show Snackbar with info that the network is not available

#240


no-unused-variable with JSX dot syntax

This example will flag the FormControls import with no-unused-variable:
import React from 'react';
import {FormControls} from 'react-bootstrap';

export default class Example extends React.Component<{}, {}> {
  render() {
    return <FormControls.Static label="Hello" value="World" />;
  }
}

This is a pattern used in a few UI libraries, like React Bootstrap as shown in the example.

There is most likely a bug in the TypeScript language services that causes this bug in TSLint. I'll see if I can make a good minimal repro and submit a bug with TypeScript if there's not one already

@dallonf - what version of TypeScript are you using here?

It's 1.8.7 in the project... but now that you mention it, the warning only seems to appear in Atom, using the linter-tslint and atom-typescript packages.
(Running tslint from a npm script, which uses versions specified in package.json, does not show the warning)
I don't know what version those use, but they seem to track latest. So your hypothesis about this being a TypeScript bug is probably correct.

I just tested with the latest nightly<EMAIL_ADDRESS>and unfortunately I'm still seeing this bug. I'll file an issue with them if there's not one around already

+1 using<EMAIL_ADDRESS>import * as shared from "./shared/index";
const Footer = props => <shared.ItemFooter {...props} />;
=> unused variable: 'shared'

@mpseidel that is a pretty old nightly. This comment suggests it was fixed in the compiler in late March. Can you give that a try to verify the fix?

@adidahiya sorry - updated to the latest build and now it works like a charm. thanks for the heads-up! :)

sweet, closing this issue out


my work disappears

the things disappears and ive done so many things and it just disappears now i have to do it againnn

Did the button also dissapears after you clicked upload?


vim.tbl_islist is deprecated, use vim.islist instead

🐛 Describe the bug
This bug is due to a recent upgrade of Neovim to v0.11.
When this plugin is loaded, nvim will report an error like this:

It seems it is caused by a call of a vim function.
Config
Not related. But provided below:
require("obsidian").setup({

	workspaces = {
		{
			name = "xVimObsidian",
			path = getWorkspacePath(),
		},
	},

	-- Optional, if you keep notes in a specific subdirectory of your vault.
	notes_subdir = "_quick.notes",

	-- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp.
	completion = {
		-- Set to false to disable completion.
		nvim_cmp = true,
		-- Trigger completion at 2 chars.
		min_chars = 2,
	},
	-- Optional, configure key mappings. These are the defaults. If you don't want to set any keymappings this
	-- way then set 'mappings = {}'.
	mappings = {
		-- Overrides the 'gf' mapping to work on markdown/wiki links within your vault.
		["gf"] = {
			action = function()
				return require("obsidian").util.gf_passthrough()
			end,
			opts = { noremap = false, expr = true, buffer = true },
		},
		-- Toggle check-boxes.
		["<leader>ch"] = {
			action = function()
				return require("obsidian").util.toggle_checkbox()
			end,
			opts = { buffer = true },
		},
		-- -- Smart action depending on context, either follow link or toggle checkbox.
		["<cr>"] = {
			action = function()
				return require("obsidian").util.smart_action()
			end,
			opts = { buffer = true },
		},
	},

	-- Where to put new notes. Valid options are
	--  * "current_dir" - put new notes in same directory as the current buffer.
	--  * "notes_subdir" - put new notes in the default notes subdirectory.
	new_notes_location = "notes_subdir",

	-- Optional, customize how note IDs are generated given an optional title.
	---@param title string|?
	---@return string
	note_id_func = function(title)
		-- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
		-- In this case a note with the title 'My new note' will be given an ID that looks
		-- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
		local suffix = ""
		if title ~= nil then
			-- If title is given, transform it into valid file name.
			suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
		else
			-- If title is nil, just add 4 random uppercase letters to the suffix.
			for _ = 1, 4 do
				suffix = suffix .. string.char(math.random(65, 90))
			end
		end
		return tostring(os.date("%Y-%m-%d-%H%M")) .. "_" .. suffix
	end,

	-- Optional, customize how note file names are generated given the ID, target directory, and title.
	---@param spec { id: string, dir: obsidian.Path, title: string|? }
	---@return string|obsidian.Path The full path to the new note.
	note_path_func = function(spec)
		-- This is equivalent to the default behavior.
		local path = spec.dir / tostring(spec.id)
		return path:with_suffix(".md")
	end,

	-- Optional, customize how wiki links are formatted. You can set this to one of:
	--  * "use_alias_only", e.g. '[[Foo Bar]]'
	--  * "prepend_note_id", e.g. '[[foo-bar|Foo Bar]]'
	--  * "prepend_note_path", e.g. '[[foo-bar.md|Foo Bar]]'
	--  * "use_path_only", e.g. '[[foo-bar.md]]'
	-- Or you can set it to a function that takes a table of options and returns a string, like this:
	wiki_link_func = function(opts)
		return require("obsidian.util").wiki_link_id_prefix(opts)
	end,

	-- Optional, customize how markdown links are formatted.
	markdown_link_func = function(opts)
		return require("obsidian.util").markdown_link(opts)
	end,

	-- Either 'wiki' or 'markdown'.
	preferred_link_style = "wiki",

	-- Optional, customize the default name or prefix when pasting images via `:ObsidianPasteImg`.
	---@return string
	image_name_func = function()
		-- Prefix image names with timestamp.
		return string.format("%s-", os.time())
	end,

	-- Specify how to handle attachments.
	attachments = {
		-- The default folder to place images in via `:ObsidianPasteImg`.
		-- If this is a relative path it will be interpreted as relative to the vault root.
		-- You can always override this per image by passing a full path to the command instead of just a filename.
		img_folder = "assets/imgs", -- This is the default
		-- A function that determines the text to insert in the note when pasting an image.
		-- It takes two arguments, the `obsidian.Client` and an `obsidian.Path` to the image file.
		-- This is the default implementation.
		---@param client obsidian.Client
		---@param path obsidian.Path the absolute path to the image file
		---@return string
		img_text_func = function(client, path)
			path = client:vault_relative_path(path) or path
			return string.format("![%s](%s)", path.name, path)
		end,
	},
})

Environment
NVIM v0.11.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Run "nvim -V1 -v" for more info

I have a PR to fix this in #593

Closed via #593

hi @epwalsh, thanks for the great plugin. The issue still persist for me (nvim 0.11.0-dev). Not sure if this PR has been included in the 3.7.12 release yet.

@azinsharaf looks like it did not make it in. After I get through the few PRs that have been on my backlog I'll cut a new release.


hi

I'm also doing some experiments on voice assistant, and I hope I can work with you

Hi! It's awesome, let's connect. Do you have twitter/facebook/instagram where we can connect?

Please reach out to me on twitter @lzd_smile, thanks


Scaling back the neural network's data gathering phase?

It would appear that we pull the User.XML.GZ files for each whitelisted BOINC project at the moment, right?
We don't need to be pulling the entire project's GZ file, we could pull user XML for just team gridcoin - potentially reducing the total NN download file size to a few MB rather than almost 2 GB.
Thoughts?
Links to team Gridcoin XML:
https://asteroidsathome.net/boinc/team_email_list.php?teamid=2218&xml=1
https://atlasathome.cern.ch/team_email_list.php?teamid=1869&xml=1
https://burp.renderfarming.net/team_email_list.php?teamid=1285&xml=1
https://csgrid.org/csg/team_email_list.php?teamid=154&xml=1
https://boinc.thesonntags.com/collatz/team_email_list.php?teamid=3029&xml=1
https://www.cosmologyathome.org/team_email_list.php?teamid=3637&xml=1
https://climateapps2.oerc.ox.ac.uk/cpdnboinc/team_email_list.php?teamid=10427&xml=1
https://www.distributeddatamining.org/DistributedDataMining/team_email_list.php?teamid=2176&xml=1
https://denis.usj.es/denisathome/team_email_list.php?teamid=1825&xml=1
https://einstein.phys.uwm.edu/team_email_list.php?teamid=13630&xml=1
https://www.enigmaathome.net/team_email_list.php?teamid=2937&xml=1
https://findah.ucd.ie/team_email_list.php?teamid=2198&xml=1
https://www.gpugrid.net/team_email_list.php?teamid=3493&xml=1
https://finance.gridcoin.us/finance/team_email_list.php?teamid=5&xml=1
https://lhcathomeclassic.cern.ch/sixtrack/team_email_list.php?teamid=8128&xml=1
https://boinc.gorlaeus.net/team_email_list.php?teamid=1629&xml=1
https://www.malariacontrol.net/team_email_list.php?teamid=4059&xml=1
https://milkyway.cs.rpi.edu/milkyway/team_email_list.php?teamid=6566&xml=1
https://mindmodeling.org/team_email_list.php?teamid=2415&xml=1
https://moowrap.net/team_email_list.php?teamid=2190&xml=1
https://escatter11.fullerton.edu/nfs/team_email_list.php?teamid=2353&xml=1
https://numberfields.asu.edu/NumberFields/team_email_list.php?teamid=2069&xml=1
https://boinc.fzk.de/poem/team_email_list.php?teamid=3147&xml=1
https://www.primegrid.com/team_email_list.php?teamid=4469&xml=1
https://boinc.bakerlab.org/rosetta/team_email_list.php?teamid=12575&xml=1
https://sat.isa.ru/pdsat/team_email_list.php?teamid=2059&xml=1
https://setiathome.berkeley.edu/team_email_list.php?teamid=145340&xml=1
https://pogs.theskynet.org/pogs/team_email_list.php?teamid=2020&xml=1
https://www.worldcommunitygrid.org/boinc/team_email_list.php?teamid=30513&xml=1
https://yafu.myfirewall.org/yafu/team_email_list.php?teamid=260&xml=1
https://www.rechenkraft.net/yoyo/team_email_list.php?teamid=1475&xml=1
https://lhcathome2.cern.ch/vLHCathome/team_email_list.php?teamid=2429&xml=1
https://szdg.lpds.sztaki.hu/szdg/team_email_list.php?teamid=3502&xml=1
https://wuprop.boinc-af.org/team_email_list.php?teamid=2243&xml=1
https://grcnode.co.uk/Stats/Reports/DailyNeuralMagnitudeReport.csv

Cool, is it that easy? It sounds like a massive performance improvement fix.

Half a year no-one noticed. This is nice.
Even user gridcoin address or other authenticator can be put into the url field.
But this contradicts our plan of dropping the team membership requirement #212.
Cross issue links: #289 #121 and the wiki.

If there was a way to link the user ID with the CPID we could potentially use the show_user.php function. This would allow us to drop the team membership requirement in the future.
Here is in example:
http://gene.disi.unitn.it/test/show_user.php?userid=1025&format=xml
It would require multiple calls to the URL with each users ID so I'm not sure if it would put more or less strain on the web server than downloading a single file. However, it would reduce the  bandwidth because not every BOINC user's RAC is being downloaded (only users with a CPID in the NN).

Sorry, I accidentally posted the scripts for team statistics, we'll need to gather the user.xml.gz files:
wget -N --tries=2 http://setiweb.ssl.berkeley.edu/stats/user.gz
wget -N --tries=2 http://einstein.phys.uwm.edu/stats/user_id.gz
wget -N --tries=2 http://climateapps2.oucs.ox.ac.uk/cpdnboinc/stats/user.xml.gz
wget -N --tries=2 http://boinc.bakerlab.org/rosetta/stats/user.gz
wget -N --tries=2 http://burp.boinc.dk/stats/user_id.gz
wget -N --tries=2 http://www.primegrid.com/stats/user_id.gz
wget -N --tries=2 http://szdg.lpds.sztaki.hu/szdg/stats/user.xml.gz
wget -N --tries=2 http://www.worldcommunitygrid.org/boinc/stats/user.gz
wget -N --tries=2 http://www.malariacontrol.net/stats/user.gz
wget -N --tries=2 http://boinc.umiacs.umd.edu/stats/user.gz
wget -N --tries=2 http://bbc.cpdn.org/stats/user.xml.gz
wget -N --tries=2 http://boinc.gorlaeus.net/stats/user.xml.gz
wget -N --tries=2 http://moowrap.net/stats/user.gz
wget -N --tries=2 http://finance.gridcoin.us/stats/user.gz
wget -N --tries=2 https://www.gpugrid.net/stats/user.gz
wget -N --tries=2 http://asteroidsathome.net/boinc/stats/user.gz
wget -N --tries=2 http://milkyway.cs.rpi.edu/milkyway/stats/user.gz
wget -N --tries=2 http://boinc.fzk.de/poem/stats/user.gz
wget -N --tries=2 http://boinc.thesonntags.com/collatz/stats/user.gz
wget -N --tries=2 http://csgrid.org/csg/stats/user.gz
wget -N --tries=2 http://csgrid.org/csg/stats/user_work.gz
wget -N --tries=2 http://yafu.myfirewall.org/yafu/stats/user.gz
wget -N --tries=2 http://findah.ucd.ie/stats/user.gz
wget -N --tries=2 http://www.cosmologyathome.org/stats/user.gz
wget -N --tries=2 http://lhcathome2.cern.ch/vLHCathome/stats/user.gz
wget -N --tries=2 https://mindmodeling.org/stats/user.gz
wget -N --tries=2 https://escatter11.fullerton.edu/nfs/stats/user.gz
wget -N --tries=2 https://escatter11.fullerton.edu/nfs/stats/user_work.gz
wget -N --tries=2 http://numberfields.asu.edu/NumberFields/stats/user.gz
wget -N --tries=2 https://pogs.theskynet.org/pogs/stats/user.gz
wget -N --tries=2 http://www.rechenkraft.net/yoyo/stats/user.gz
wget -N --tries=2 http://sat.isa.ru/pdsat/stats/user.gz
wget -N --tries=2 http://atlasathome.cern.ch/stats/user.gz

Projects do not share the same naming convention for the statistics files, such as user.gz needs extracted then renamed as user.xml, user.xml.gz can be extracted as user.xml file, burp has 'user_id', etc. Full user script (probably missing some newer projects & includes old projects)
We should try to avoid scraping individual user details, many users downloading the one user.xml.gz file is friendlier to the project website than many users sending thousands of individual xml queries.
If we implement additional proof of cpid ownership through the addition of a new field within the user's profile (as opposed to injecting a key into the user's CPID) we'll need to either include this field within extracts (or produce a new extract file) or we'll need to scrape user fields on an individual basis.

https://github.com/gridcoin-community/BOINC_Scripts/blob/master/BOINC stats/Overall/Scripts/HostUserTeamGZ.sh

I wish we had fixed this when you posted it. Should we consider it redundant now that we are removing he team req or should we still do it just in case the removal drags on?


Component content model continued

Last sprint the focus was on Cards & related.
Moving forward, let's continue to pick components from the Top priority list, and clean up the content model for them
Top priority component list based on page visits: https://cognitive-app.slack.com/archives/G01CFF8ETPU/p1624048170003600

Masthead
Dotcom shell
Lead space
Footer
CTA section
Card group
Card
Card section
Carousel
Content item / group / block / section

Other related components to consider:

Feature card
Feature section

Acceptance criteria
Aim to finish 2-4 component content models. Recommend more complex components so we can prepare for any additional complexity that the tables need to accommodate.

Content Model Master.xlsx
Models drafted this sprint:Dotcom Shell
L0 Masthead
L1 Masthead
Footer
Carousel
CTA
CTA section
Content Item
Lightbox media viewer
Video
Expressive modal
Image
Image w/ caption


Add json format output to project get

What type of PR is this?

Uncomment only one  /kind line, and delete the rest.
For example, > /kind bug would simply become: /kind bug

/kind feature
What does does this PR do / why we need it:
Which issue(s) this PR fixes:
Fixes #?
PR acceptance criteria:

[ ] Unit test

[ ] Integration test

[ ] Documentation

How to test changes / Special notes to the reviewer:
odo project get -o json

/retest

Please add a integration test for it.

@jichenjc Why did we close this?

The PR got automatically closed because a force push removed all the code and made code diff 0

Use git reflog to get the removed commits @jichenjc

ok, weird .. will get it back , thanks for the reminder

https://github.com/openshift/odo/pull/3712 is submitted on behalf of wrong close here


Add two more cases for cancelling terms

https://cl.ly/1g310g3Q2M1P

lemme know when it's ready for review :)

can you make the description and comment name more descriptive? "stepper issue" is literally any issue in this codebase heh
I updated your other PR with an example of the level of detail I'm thinkin

Add some tests, at least one for each new case? :)

I think this one's ready for your review @evykassirer !

Fix the comments.

3 things left to do then I can accept this for you!

also

woops sorry haha
also I updated the name of the PR to explain what's being fixed a bit more specifically

ONE more thing then squash and merge

Sorry @evykassirer I keep forgetting to squash! Not in the habit yet 😬

no worries! I actually updated the settings so it's the only option, which I should have just done before :)


bind-required doesn't work on s

Originally opened as dart-lang/sdk#21460
This issue was originally filed by<EMAIL_ADDRESS>
Use case:
I would like to dynamically set whether a <paper-input> is required by using "bind-required." This is using a polymer js <paper-input> with a angulardart backing model.
e.g.
<paper-input type="text" bind-required="myRequiredBool"></paper-input>
Expected result:
The paper input is set to required if the variable is true, and not otherwise.
Actual result:
The paper input is always has required set to false.
If I change the attribute to "bind-disabled," the disabled attribute toggles as expected, so it looks like bind-required isn't being hooked up correctly.
Please include the following information:

Dart SDK version: 1.6.0-dev.9.0
polymer package version: v0.2
Operating system: Goobuntu Trusty
Browser (if any): Chrome Version 38.0.2125.111 (64-bit)

 Comment by sigmundch

So far, we have not been able to reproduce the issue.
We are not sure if you are using polymer.js alone or also the Dart wrappers with polymer.dart. Jake was able to bind the required field when he used the latest versions of the Dart packages (polymer.dart 0.15.1+3 and the Dart wrappers in paper_elements 0.5.0).
When you say version v0.2 of polymer, do you mean polymer.js? That version sounds a bit outdated too (they are currently on version 0.4.2 I believe). So it's possible that updating to the latest version will fix the issue for you, if not, the problem could be in the angular hooks to interact with polymer elements (If so, you can let them know in their issue tracker: https://github.com/angular/angular.dart/ so they can investigate).

Added NeedsInfo label.

 Comment by sigmundch

No worries - glad to hear we are narrowing down where the issue could be :)
I just saw the issue you created over there, so I'll close this bug for now and mark it as a duplicate of https://github.com/angular/angular.dart/issues/1588, but feel free to reply here if there is something else we can help with on our end.

Added MovedToGithub label.

This comment was originally written by<EMAIL_ADDRESS>

We are not sure if you are using polymer.js alone or also the Dart wrappers with polymer.dart.
polymer.js only

When you say version v0.2 of polymer, do you mean polymer.js?
Yes. However, I think I was actually mistaken when I put v0.2 as the version number, and I think I'm actually already on v0.4.2.

I guess this might be a problem on the angular.dart side, since we had a different problem with <paper-radio-button>s and "bind-selected" that ended up being angular issue: https://github.com/angular/angular.dart/issues/1449
I will file a new bug for angular.dart (sorry, wasn't sure where to file this, and someone suggested filing to here). :)


[Bug] Didn't open dialog in unity 2023.2

It seem VistaOpenFileDialog are not working in unity 2023, are there any fix?

I'm having the same issue. Any solutions?

Have the same error here, urgent issue, needs to be fixed ASAP

When I downloaded Ookii.Dialog.dll from below and replaced it, the following error message was output.
https://www.ookii.org/software/dialogs/
InvalidProgramException: Invalid IL code in (wrapper managed-to-native) Ookii.Dialogs.Interop.IFileDialog:Advise (intptr,Ookii.Dialogs.Interop.IFileDialogEvents,uint&): IL_0025: ldloc     65535

(wrapper cominterop) Ookii.Dialogs.Interop.IFileDialog.Advise(Ookii.Dialogs.Interop.IFileDialogEvents,uint&)
(wrapper cominterop-invoke) Ookii.Dialogs.Interop.IFileDialog.Advise(Ookii.Dialogs.Interop.IFileDialogEvents,uint&)
Ookii.Dialogs.VistaFileDialog.SetDialogProperties (Ookii.Dialogs.Interop.IFileDialog dialog) (at <31af777adad04cb788cee0ae18e55ae1>:0)
Ookii.Dialogs.VistaOpenFileDialog.SetDialogProperties (Ookii.Dialogs.Interop.IFileDialog dialog) (at <31af777adad04cb788cee0ae18e55ae1>:0)
Ookii.Dialogs.VistaFileDialog.RunFileDialog (System.IntPtr hwndOwner) (at <31af777adad04cb788cee0ae18e55ae1>:0)
Ookii.Dialogs.VistaFileDialog.RunDialog (System.IntPtr hwndOwner) (at <31af777adad04cb788cee0ae18e55ae1>:0)
System.Windows.Forms.CommonDialog.ShowDialog (System.Windows.Forms.IWin32Window owner) (at <6d56e0f579f14156bf364f450d98bf76>:0)
(wrapper remoting-invoke-with-check) System.Windows.Forms.CommonDialog.ShowDialog(System.Windows.Forms.IWin32Window)
SFB.StandaloneFileBrowserWindows.OpenFilePanel (System.String title, System.String directory, SFB.ExtensionFilter[] extensions, System.Boolean multiselect) (at Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs:38)
SFB.StandaloneFileBrowser.OpenFilePanel (System.String title, System.String directory, SFB.ExtensionFilter[] extensions, System.Boolean multiselect) (at Assets/StandaloneFileBrowser/StandaloneFileBrowser.cs:51)
SFB.StandaloneFileBrowser.OpenFilePanel (System.String title, System.String directory, System.String extension, System.Boolean multiselect) (at Assets/StandaloneFileBrowser/StandaloneFileBrowser.cs:39)

Currently, Ookii.Dialogs has been deprecated and has been migrated to Ookii.Dialogs-Wpf, so it does not work as is.

Since the dialog can be opened in unity2023.1, it may be a bug in unity2023.2.

I have suspect that it's about unity upgrade dotnet standard from 2.0 to 2.1, which ooki dialog may not been built for?

@Thaina
I deleted the Ookii.Dialogs.dll and replaced it with the source, but the same error occurs, so I don't think it is caused by the dotnet standard update.

I have submitted a bug report to Unity regarding this error.
Currently under review, there was no problem up to Unity2023.2.0a14, and it was found that an error occurred from Unity2023.2.0a15.

A bug has been registered on the issue tracker.
https://issuetracker.unity3d.com/issues/windows-com-throws-the-invalidprogramexception-when-using-ookii-dot-dialogs-library

"In progress" on issue tracker🙏

Hi, is there any workaround? @shiena Did update to Ookii.Dialogs.WinForms help? Or we just need wait for unity fix?

@zadinvit You can use OpenFileDialog with System.Windows.Forms.dll. However, the old style dialog is displayed.

@shiena Were you able to use OpenFileDialog with System.Windows.Forms.dll?
Even with only this simple code, I have the following exception (Unity 2023.2.7f1):
using System.Windows.Forms;

public class WindowsFileBrowser
{
    public static string BrowseFolderPanel(string initialSelectedPath = "")
    {
        string filePath = string.Empty;
        using (OpenFileDialog openFileDialog = new OpenFileDialog())
        {
            openFileDialog.InitialDirectory = initialSelectedPath;
            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                filePath = openFileDialog.FileName;
            }
        }
        return filePath;
    }
}

InvalidProgramException: Invalid IL code in (wrapper managed-to-native) System.Windows.Forms.FileDialogNative/IFileDialog:SetDefaultExtension (intptr,string): IL_000e: ldloc     65535
(wrapper cominterop) System.Windows.Forms.FileDialogNative+IFileDialog.SetDefaultExtension(string)
(wrapper cominterop-invoke) System.Windows.Forms.FileDialogNative+IFileDialog.SetDefaultExtension(string)
System.Windows.Forms.FileDialog.OnBeforeVistaDialog (System.Windows.Forms.FileDialogNative+IFileDialog dialog) (at <187ea5586d6f4ba8a9a85a7c10b078e1>:0)
System.Windows.Forms.FileDialog.RunDialogVista (System.IntPtr hWndOwner) (at <187ea5586d6f4ba8a9a85a7c10b078e1>:0)
System.Windows.Forms.FileDialog.RunDialog (System.IntPtr hWndOwner) (at <187ea5586d6f4ba8a9a85a7c10b078e1>:0)
System.Windows.Forms.CommonDialog.ShowDialog (System.Windows.Forms.IWin32Window owner) (at <187ea5586d6f4ba8a9a85a7c10b078e1>:0)
System.Windows.Forms.CommonDialog.ShowDialog () (at <187ea5586d6f4ba8a9a85a7c10b078e1>:0)
(wrapper remoting-invoke-with-check) System.Windows.Forms.CommonDialog.ShowDialog()
WindowsFileBrowser.BrowseFolderPanel (System.String initialSelectedPath) (at Assets/WindowsFileBrowser.cs:79)

@anonymous2585  I tried it with Unity2023.2.12f1 and the dialog worked.
This is that Unity project.
https://www.dropbox.com/t/52h90sq5zGbxrvvf

Thanks a lot!
With your project, I understood why I had the issue.
My System.Windows.Forms.dll file comes from the .NET Framwork (version 4.8.4494.0, 5,64Mo) while yours is from Mono (version <IP_ADDRESS>, 2,74Mo).
With your version of the dll, it works! But the dialog is too ugly for me to give that to our clients 😐

@anonymous2585
Yes, unfortunately in the mono version of FileDialog, the AutoUpgradeEnabled property does not work, so the old style dialog is displayed.
https://github.com/Unity-Technologies/mono/blob/unity-main/mcs/class/System.Windows.Forms/System.Windows.Forms/FileDialog.cs#L387-L392
Therefore, you have two options: use Unity 2023.1 or earlier, or wait until the bug is fixed.

Nice to know there is a workaround, even if the UI is a bit outdated.
Could you please create a branch (or Pull Request) for the workaround?
This way one could easily use the workaround by changing the version of StandaloneFileBrowser to be used via Unity's manifest.json
Note that the workaround does not need to be merged into the master branch. Just having it available as a branch should suffice.

@achimmihca
diff --git a/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs b/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs
index 2bdb8c218..b1e379220 100644
--- a/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs
+++ b/Assets/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs
@@ -4,7 +4,13 @@ using System;
 using System.IO;
 using System.Windows.Forms;
 using System.Runtime.InteropServices;
+#if UNITY_2023_2
+using VistaOpenFileDialog = System.Windows.Forms.OpenFileDialog;
+using VistaFolderBrowserDialog = System.Windows.Forms.FolderBrowserDialog;
+using VistaSaveFileDialog = System.Windows.Forms.SaveFileDialog;
+#else
 using Ookii.Dialogs;
+#endif

 namespace SFB {
     // For fullscreen support

Yep, same issue with 2023.2+ 😔 Thanks @shiena for the workaround!
Has anyone found a way to display the more modern UI?
This repo seems to have last been updated over 6 years ago... Are we hopeful that there's even a remote chance that this gets fixed?

@MadStark
The AutoUpdateEnabled property is required to use the modern UI, but is not supported in the mono version.
https://github.com/gkngkc/UnityStandaloneFileBrowser/issues/135#issuecomment-1983387557
Therefore, we need to call the native API, but unfortunately there is no workaround because the COM call causes an error.

With the Mono System.Windows.Forms, I have the issue of Unity editor crashing whenever I close it after using the old window UI. Do you have the same thing?

@MadStark
Try copying Mono.Posix.dll and Mono.WebBrowser.dll to the Plugins folder with reference to #76 .

@shiena Thanks! Unfortunately it didn't fix my issue... I think it might be interfering with other things in my project. After I open the browser, next time I will close Unity, it will crash instead!
I'll do some digging!

Perhaps https://github.com/Unity-Technologies/mono/pull/2003 will fix it.

Backports also merged into 2023.2 and 2023.3.

https://github.com/Unity-Technologies/mono/pull/2006
https://github.com/Unity-Technologies/mono/pull/2005

I took some pull requests and repackaged them as upm.
https://github.com/shiena/UnityStandaloneFileBrowser

"Fixed in 6000.0.0b14" and "Fix In Review for 2023.2.20f1" on issue tracker

UUM-62035 is included in the Fixes section of the release notes for Unity6000.0.0b15.
And sure enough, the dialog comes up and no errors occur.

Unity2023.2.20 also contains UUM-62035 in the Fixes section.

Updated my project to 2023.2.20f1 and I confirm the issue is gone for me 😀


AssertionError: The observation returned by the reset() method is not contained with the observation space (Discrete(581))

I am seeing following ERROR when I run main_DQN.py.
I created hdf5 datasets downloading 1min data from binance and saving with pandas to hdf5 format.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:01<00:00,  2.58it/s]
/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/gym/utils/passive_env_checker.py:216: UserWarning: WARN: Future gym versions will require that `Env.reset` can be passed a `seed` instead of using `Env.seed` for resetting the environment random number generator.
  logger.warn(
/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/gym/utils/passive_env_checker.py:228: UserWarning: WARN: Future gym versions will require that `Env.reset` can be passed `return_info` to return information from the environment resetting.
  logger.warn(
/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/gym/utils/passive_env_checker.py:233: UserWarning: WARN: Future gym versions will require that `Env.reset` can be passed `options` to allow the environment initialisation to be passed additional information.
  logger.warn(
Process Process-2:
Traceback (most recent call last):
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/tianshou/env/worker/subproc.py", line 95, in _worker
    retval = env.reset(**data)
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/gym/wrappers/time_limit.py", line 66, in reset
    return self.env.reset(**kwargs)
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/gym/wrappers/order_enforcing.py", line 42, in reset
    return self.env.reset(**kwargs)
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/gym/wrappers/env_checker.py", line 47, in reset
    return passive_env_reset_check(self.env, **kwargs)
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/gym/utils/passive_env_checker.py", line 247, in passive_env_reset_check
    _check_obs(obs, env.observation_space, "reset")
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/gym/utils/passive_env_checker.py", line 113, in _check_obs
    assert observation_space.contains(
AssertionError: The observation returned by the `reset()` method is not contained with the observation space (Discrete(581))
Traceback (most recent call last):
  File "main_DQN.py", line 128, in <module>
    main()
  File "main_DQN.py", line 93, in main
    train_collector = ts.data.Collector(policy, train_envs, PVRB(**replay_buffer_hyperparameters),
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/tianshou/data/collector.py", line 77, in __init__
    self.reset(False)
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/tianshou/data/collector.py", line 120, in reset
    self.reset_env(gym_reset_kwargs)
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/tianshou/data/collector.py", line 136, in reset_env
    rval = self.env.reset(**gym_reset_kwargs)
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/tianshou/env/venvs.py", line 203, in reset
    ret_list = [self.workers[i].recv() for i in id]
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/tianshou/env/venvs.py", line 203, in <listcomp>
    ret_list = [self.workers[i].recv() for i in id]
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/site-packages/tianshou/env/worker/subproc.py", line 214, in recv
    result = self.parent_remote.recv()
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/multiprocessing/connection.py", line 250, in recv
    buf = self._recv_bytes()
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/multiprocessing/connection.py", line 414, in _recv_bytes
    buf = self._recv(4)
  File "/usr/local/anaconda3/envs/py38/lib/python3.8/multiprocessing/connection.py", line 383, in _recv
    raise EOFError
EOFError

state_shape = env.observation_space.shape or env.observation_space.n
env.observation_space = Discrete(581)
state_shape = 581
I see NN observation space is the reason of my error but how to fix it?

I cannot know what caused the error, but I suspect it has may have something to do with your data. Make sure your data has 4 columns and TradeEnv.data has num_cryptos * 7 columns.

I have resampled OHLC data to hourly as below (ADAUSDT):
                         open      high       low     close
open_time
2018-04-17 04:00:00  0.265447  0.266997  0.264304  0.265502
2018-04-17 05:00:00  0.269207  0.270196  0.268395  0.269129
2018-04-17 06:00:00  0.255592  0.256385  0.254357  0.255295
2018-04-17 07:00:00  0.259237  0.259770  0.258674  0.259179
2018-04-17 08:00:00  0.255278  0.255838  0.254777  0.255230
...                       ...       ...       ...       ...
2022-08-01 19:00:00  0.506185  0.506458  0.505883  0.506190
2022-08-01 20:00:00  0.507862  0.508158  0.507593  0.507943
2022-08-01 21:00:00  0.508765  0.508963  0.508513  0.508718
2022-08-01 22:00:00  0.508605  0.508938  0.508278  0.508640
2022-08-01 23:00:00  0.512170  0.512542  0.511897  0.512182

[37540 rows x 4 columns]

...but I still get the same error.
Do you maybe have an idea why?
You mentioned "TradeEnv.data has num_cryptos * 7 columns"
Why 7 columns?
How do you prepare TradeEnv.data ? I do not see it being created anywhere in your code.
Thanks for further help in this matter.

Yes. 7 = (open, high, low, close) + month, day, hour
The number of features is 6 because, the neural net does not see the open column.
https://github.com/NickKaparinos/Automated-Cryptocurrency-trading-using-Deep-RL/blob/07dd37e790c5f42ec8c0034772773acbcd1d9452/trading_utilities.py#L126
I will add a screenshot of how my TradeEnv.data dataframe looks:

If the problem persists, I suggest looking into TradeEnv._get_obs and TradeEnv.reset and comparing the dimension of the observation with the expected observation one.

Do your timeseries start at same moment in time?
It makes sense to me so they start at same date.
I was using data where my timeseries were NOT starting at same date.
I changed it and not I do not experience the problem.


Add night qualifier support

Could be a simple checkbox and then it'd move the icons to:

drawable-night-ldpi
drawable-night-mdpi
drawable-night-xhdpi
drawable-night-xxhdpi
drawable-night-xxxhdpi

yes ,i have some problem,need night drawable

@konifar is this something you'd like to offer?

Gentle bump.

Stopped using this plugin.


CV2 installed, but demo.py unable to import it?

When I try to run
python3 demo.py -i 'example/path/pic.jpg' -v 'example/path/videos'
I get an error message saying
Traceback (most recent call last):
  File "demo.py", line 3, in <module>
    import cv2
ImportError: No module named 'cv2'

But from the same directory, I can open up python and run
>>> import cv2
>>> cv2.__version__

And it'll spit out '3.4.0' so It's definitely installed?
Any idea what might be causing this? @MotorCityCobra
Do the directories have to be laid out in a specific way?

Fixed it with pip3 install opencv-python which I assumed was already installed. I'm now getting a different error, but from googling around a bit it looks like I might be able to fix it by upgrading to the latest macOS version, so I'll give that a go.

Good luck.
If that doesn't work be sure to try running 'demo.py' with python, python3, python3.4, python3.5, python3.6.
In my conda environment I can only get this script to run by typing python3.5 and nothing else.
If that doesn't work set everything up in a different environment. Meaning, if you're using a conda env now use a virtualenv instead, or vice versa.

I'm closing because it's a cv2 issue.
Hope you sorted it out.


libplayer.so', missing and no known rule to make it

HI 大家编译的时候是否遇到这个问题
IDE：Android Studio Giraffe | 2022.3.1 Patch 2
JAVA： JetBrians Runtime Version 17.0
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.

What went wrong:
Execution failed for task ':app:buildCMakeDebug[arm64-v8a]'.

Build command failed.
Error while executing process /Users/aiquantong/Library/Android/sdk/cmake/3.18.1/bin/ninja with arguments {-C /Users/aiquantong/Documents/AndroidOpenSource/yangwebrtc/metaplayer5_android/app/.cxx/Debug/4753253o/arm64-v8a player}
ninja: Entering directory `/Users/aiquantong/Documents/AndroidOpenSource/yangwebrtc/metaplayer5_android/app/.cxx/Debug/4753253o/arm64-v8a'

ninja: error: '/Users/aiquantong/Documents/AndroidOpenSource/yangwebrtc/bin/lib_android/arm64-v8a/libmetartc5.a', needed by '/Users/aiquantong/Documents/AndroidOpenSource/yangwebrtc/metaplayer5_android/app/build/intermediates/cxx/Debug/4753253o/obj/arm64-v8a/libplayer.so', missing and no known rule to make it

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

What went wrong:
Execution failed for task ':app:buildCMakeDebug[x86_64]'.

Build command failed.
Error while executing process /Users/aiquantong/Library/Android/sdk/cmake/3.18.1/bin/ninja with arguments {-C /Users/aiquantong/Documents/AndroidOpenSource/yangwebrtc/metaplayer5_android/app/.cxx/Debug/4753253o/x86_64 player}
ninja: Entering directory `/Users/aiquantong/Documents/AndroidOpenSource/yangwebrtc/metaplayer5_android/app/.cxx/Debug/4753253o/x86_64'

ninja: error: '/Users/aiquantong/Documents/AndroidOpenSource/yangwebrtc/bin/lib_android/x86_64/libmetartc5.a', needed by '/Users/aiquantong/Documents/AndroidOpenSource/yangwebrtc/metaplayer5_android/app/build/intermediates/cxx/Debug/4753253o/obj/x86_64/libplayer.so', missing and no known rule to make it

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

Get more help at https://help.gradle.org

BUILD FAILED in 6s

我是mac系统


PubSub: Got unbound method error when calling the class method from_service_account_json

I am using the service account for authentication. By following the example in here
, I create the following code:
from google.cloud import pubsub
logging.debug(dir(pubsub.PublisherClient))
pubsub_publisher_client = pubsub.PublisherClient.from_service_account_json(key_path)

The output:
DEBUG:root:['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'batch', 'create_topic', 'delete_topic', 'from_service_account_file', 'from_service_account_json', 'get_iam_policy', 'get_topic', 'list_topic_subscriptions', 'list_topics', 'project_path', 'publish', 'set_iam_policy', 'target', 'test_iam_permissions', 'topic_path', 'update_topic']
Traceback (most recent call last):
  File "main.py", line 81, in <module>
    pubsub_publisher_client = pubsub.PublisherClient.from_service_account_json(key_path)
TypeError: unbound method from_service_account_file() must be called with PublisherClient instance as first argument (got str instance instead)

However, when I use similar code to create datastore client with the service account JSON file, it works. E.g.
from google.cloud import datastore
datastore_client = datastore.Client.from_service_account_json(key_path)

After checking the source code, perhaps the decorator in pubsub/google/cloud pubsub_v1/_gapic.py failed to create the class method properly.

Weird, @lukesneeringer @andreamlin can you take a look?

The bug is almost certainly in google.cloud.pubsub_v1._gapic.add_methods, which is not detecting that from_service_account_file (aliased to from_service_account_json) is a classmethod.


Default readMode: single possibly gives duplicate job

On my 3 nodes rDB setup, with 8 job subscribers, using your job queue produces duplicate job sometimes (eg .process() gets the same job twice). I think this is possibly due to the default readMode and therefore "not thread safe" or "race condition".

You're right @zllovesuki. I'll fix it.

Fixed in v2.1.0
Change Log
Documentation
Thanks for the feedback @zllovesuki

Mmm, I'm still getting duplicate jobs. I'm not sure if this is caused by readMode.

A little context, I was using Bull (redis backed) and rethinkdb-job-queue was used as a drop in replacement since my stack already has RethinkDB available.

Oh, that's a shame @zllovesuki. The whole reason I make this queue was for your use case.
I placed the readMode opiton in the query.run(conn[, options]) → promise query calls. I didn't use the db.table(name[, {readMode: 'single', identifierFormat: 'name'}]) → table format.
From the RethinkDB documentation it should work the same.
Here: https://www.rethinkdb.com/api/javascript/run/
And here: https://www.rethinkdb.com/api/javascript/table/
I don't have a setup causing the issue right now. Can you do some more testing please?

Sure thing, but I have to replicate the production environment first.

Great. That would be a real help. If you can replicate the issue and try different approaches we should be able to track down a fix. I was and still am under the impression that the queries I have written in the module are atomic. With the change to readMode: majority as the default, the get queries should not return the same job on different processing nodes.
First thing I would try is putting the readMode into the .table([options]) call in the getNextJob() function call.
In this file: https://github.com/grantcarthew/node-rethinkdb-job-queue/blob/master/src/queue-get-next-job.js
Take note of line 45 with the .run(q.queryRunOptions). You could simply remove the q.queryRunOptions and leave that line as .run(), and move it to line 16. So changing line 16 from this .table(q.name) to .table(q.name, q.queryRunOptions).
Note also that the index.js file points to the dist directory so either find the same lines in the transpiled code or, if running a modern Node.js version, change the index.js to point to src/queue.js.
Hope that makes sense.

OK I backtracked the database and this is the object in which duplicate jobs occurred:
{
    "dateCreated": {
        "$reql_type$": "TIME",
        "epoch_time":<PHONE_NUMBER>.586,
        "timezone": "+00:00"
    },
    "dateEnable": {
        "$reql_type$": "TIME",
        "epoch_time":<PHONE_NUMBER>.627,
        "timezone": "+00:00"
    },
    "dateFinished": {
        "$reql_type$": "TIME",
        "epoch_time":<PHONE_NUMBER>.705,
        "timezone": "+00:00"
    },
    "dateStarted": {
        "$reql_type$": "TIME",
        "epoch_time":<PHONE_NUMBER>.627,
        "timezone": "+00:00"
    },
    "id": "025ced10-7d19-41d3-a7d4-390b37812dac",
    "log": [{
        "data": null,
        "date": {
            "$reql_type$": "TIME",
            "epoch_time":<PHONE_NUMBER>.586,
            "timezone": "+00:00"
        },
        "message": "Job added to the queue",
        "processCount": 0,
        "queueId": "dermail-api-1:dermail:jobQueue:2515:50b01ffa-a6c3-4d07-ba6a-24a99ccdf08d",
        "retryCount": 0,
        "status": "waiting",
        "type": "information"
    }, {
        "date": {
            "$reql_type$": "TIME",
            "epoch_time":<PHONE_NUMBER>.619,
            "timezone": "+00:00"
        },
        "message": "Job retrieved and active",
        "processCount": 0,
        "queueId": "dermail-api-2:dermail:jobQueue:17707:8d9a2b51-094f-4a5b-9a7c-82a15de03f14",
        "retryCount": 0,
        "status": "active",
        "type": "information"
    }, {
        "date": {
            "$reql_type$": "TIME",
            "epoch_time":<PHONE_NUMBER>.627,
            "timezone": "+00:00"
        },
        "message": "Job retrieved and active",
        "processCount": 1,
        "queueId": "dermail-api-1:dermail:jobQueue:2515:7da3ba25-e00b-4c91-9bea-31e6ec60f07e",
        "retryCount": 0,
        "status": "active",
        "type": "information"
    }, {
        "data": {},
        "date": {
            "$reql_type$": "TIME",
            "epoch_time":<PHONE_NUMBER>.408,
            "timezone": "+00:00"
        },
        "duration": 2789,
        "message": "completed",
        "processCount": 1,
        "queueId": "dermail-api-2:dermail:jobQueue:17707:8d9a2b51-094f-4a5b-9a7c-82a15de03f14",
        "retryCount": 0,
        "status": "completed",
        "type": "information"
    }, {
        "data": {},
        "date": {
            "$reql_type$": "TIME",
            "epoch_time":<PHONE_NUMBER>.705,
            "timezone": "+00:00"
        },
        "duration": 3078,
        "message": "completed",
        "processCount": 2,
        "queueId": "dermail-api-1:dermail:jobQueue:2515:7da3ba25-e00b-4c91-9bea-31e6ec60f07e",
        "retryCount": 0,
        "status": "completed",
        "type": "information"
    }],
    "payload": [redacted],
    "priority": 40,
    "processCount": 2,
    "progress": 100,
    "queueId": "dermail-api-1:dermail:jobQueue:2515:7da3ba25-e00b-4c91-9bea-31e6ec60f07e",
    "repeat": false,
    "repeatDelay": 300000,
    "retryCount": 0,
    "retryDelay": 2000,
    "retryMax": 50,
    "status": "completed",
    "timeout": 900000,
    "type": "saveRX"
}

I think you should have some sort of locks in place, "Job retrieved and active" was called in a very small time gap (race condition?)

Possibly due to locking?
If I check for process punt before doing the actual job (job.processCount - job.retryCount > 1) then I can avoid the duplicate job.

Hi @zllovesuki. Thanks for the logs. That helps a lot.
I see what you are suggesting with the process and retry count check, however this would be fixing the symptom not the cause. I was under the impression the get next RethinkDB query is atomic. The logs you have indicate this is not the case.
I will try to involve someone from the RethinkDB slack channel and see if we can get some input. I'm busy at the moment (8:32am here in Brisbane Australia). I'll try and get it done today.
Thanks for your help with this.

Hey @zllovesuki. I think we have a solution. I have to try it and I haven't done that yet. Just letting you know.
The solution is to move the filter condition in the get-next-job query into the update method. Could even add a condition to ensure the job is not active within update. Here is an example from the RethinkDB docs:
r.table("posts").get(1).update(function(post) {
    return r.branch(
        post("views").gt(100),
        {type: "hot"},
        {type: "normal"}
    )
}).run(conn, callback)

I'll work on it when I can and let you know once I have working code.

@zllovesuki Done. Update to v2.1.1 and please test it out.

@grantcarthew It does look like the new code is working (no more duplicate jobs). Thanks for the time and effort spent on this issue!

Good to hear. Thanks also for your help in finding a solution.


Implement flake8-type-checking

It's a useful tool for determining which imports aren't run-time required, reducing import time. Thanks!

Note that the project was renamed to flake8-type-checking (https://github.com/snok/flake8-type-checking).

I'd be very happy to take an initial stab at porting the library. I think most error codes can be auto-fixed, so the ported version might be significantly more useful in this form.
Are there any docs or resources I should read up on before diving into the ruff source code?

Awesome! We have some high-level docs on adding new rules in the contributing guide. Those are mostly helpful for guiding you on the mechanics of defining the rule, navigating the various files, etc. We'll also want to add a module in src/rules/flake8_type_checking to define the rules and settings (you could look at src/rules/flake8_bugbear as an example of the preferred structure).
Beyond the rule logic, I suspect we'll also need to adjust src/checkers/ast.rs to track some additional state -- that file is kind of a jumbo AST visitor that calls out to the various rule implementations at the appropriate time, and tracks a bunch of state (e.g., bindings, imports, scopes). For example, I'm guessing we need to track whether every import usage takes place within a type annotation or not? We already have state on the Checker for detecting whether we're in an annotation, and we already have used and unused import tracking, so hopefully those pieces can be leveraged in some way.
My suggestion, just to get familiar with the abstractions and conventions, would be to start with maybe the empty type-checking block rule? It seems like that wouldn't require any significant changes to the Checker apart from calling out to src/rules/flake8_type_checking/rules/non_empty_type_checking_block.rs when we process a StmtKind::If. So it'll mostly give you a chance to focus on how it all fits together, and lay the groundwork for the plugin itself.

Let me know if I can help, I'm competent in Rust but I'm not familiar with the code base. This would be an awesome feature and would reduce a lot of cognitive overhead for me personally because for Hatch I painstakingly use conditional and/or lazy imports to reduce CLI startup time.

I’m happy to do a first PR today to lay some of the groundwork here.

That would be neat since I'm going to cut a release in a few days which will generate projects that use Ruff and it would be nice to enable this.

It might be worth discussing whether the rules are worth porting 1:1 and whether any APIs should change.
For example, TC006 has not been as helpful as I'd hoped. Pycharm's built-in type checker (not sure about other IDEs) struggles to understand that stringified imports still need to be there when type checking, so will remove the imports related to casts if you run the auto-clean imports command. I don't think I would have accepted that rule had I known about this ahead of time.
The TC error code also conflicts with another plugin, called tryceratops, so it might be nice to opt for another error code here; although it would mean it's not a complete drop-in replacement.
I was thinking I'd sit down an take a stab at a first rule tomorrow. I agree, the empty type checking block is probably a good candidate. If you've already started though @charliermarsh, feel free to go ahead and I'll try to get involved after the ground work has been done :+1:

A couple things:

Would definitely like to learn from your experience regarding which rules are reliable or not. Seems like we should omit TC006 based those comments.
There's some precedent for changing the rule code prefixes. For example, we use TID for flake8-tidy-imports, so that it doesn't conflict with the isort rules (under I). We typically do it if a plugin uses a single-letter prefix which is very likely to cause conflicts, or if a plugin conflicts with something we've already implemented (e.g., we used COM for flake8-commas since C conflicts with flake8-comprehensions). In this case, I'm open to either choice. We could use TC, and then expect tryceratops to use a different code (like TRY) if it gets implemented. Or we could use something like TYP.

I may get started on this tonight (at least to setup the plugin scaffolding), but either way, I'll post here at the end of the day so that you know whether there's any overlap!

@sondrelg - I went ahead and added the scaffolding for the plugin in #2048, along with a basic implementation of TC005. Let me know if you have any questions on that PR.
I think the biggest thing to figure out is what additional state we need to track in Checker to support those other checks. We already track a Binding for every import, which tracks usages (and powers our unused-import check). We probably need to extend that in some way to detect whether the usages occurred in a type definition or not?

The way the plugin works today is by exhaustively checking every element except annotations, then matching imports to "uses". IIRC, most uses are either ast.Value, ast.Name, or ast.Constant. Since annotation slot attributes can be, e.g., ast.Name, we return early when we're in an annotation node, in the visitor.
It's also important to map the line start/end of all type checking blocks, since use of a guarded import within the scope of that guard, is fine:
from typing import TYPE_CHECKING as some_alias

if some_alias:
    import pandas as pd

    df = pd.DataFrame()  # this is fine

df = pd.DataFrame()  # this is not

Then we need a good way of normalizing aliases, if possible. Identifying whether pd.DataFrame means the pandas import was used or not really just boils down to identifying that the pandas import is aliased, then matching that string. Imports, the typing module, and the TYPE_CHECKING value can all be aliased.
Finally there's minor things like keeping track of futures imports, function scopes, and classifying imports as local or remote. The exhaustive list of plugin state can be found here: https://github.com/snok/flake8-type-checking/blob/main/flake8_type_checking/checker.py#L372:L434
I'll read over the PR now :slightly_smiling_face:

Then we need a good way of normalizing aliases, if possible. Identifying whether pd.DataFrame means the pandas import was used or not really just boils down to identifying that the pandas import is aliased, then matching that string. Imports, the typing module, and the TYPE_CHECKING value can all be aliased.

Cool -- we have support for and a pattern for this (checker.resolve_call_path(...) will detect aliases and normalize to the imported path, like ["pd", "DataFrame"]).

Finally there's minor things like keeping track of futures imports, function scopes, and classifying imports as local or remote.

👍 We do track future imports and function scopes as Checker state, and we do have logic for classifying imports via stuff in the isort directory. So hopefully we can leverage all that :)

Yeah I noticed, that's great!
What do you think about import classification? The plugin uses classify-imports to distinguish between local imports, builtin imports, and library imports. The rationale behind that mainly being that only local application imports lead to import circularity issues, so for some users it might be nice to limit the linting to that class of imports.
I was thinking I might start taking a stab at porting the import classification logic we need as rust code?

Our import classification logic is actually a port of classify-imports, for the most part! (It might deviate in some small ways at this point.) Though we also have support for isort-style known-first-party, etc. That code is in src/rules/isort/categorize.rs, if helpful.
The other question is whether we want to have separate rules for different import classes, as in your existing plugin. I don't feel strongly! If we have the ability to categorize imports, then it makes sense to me to support different rules. But I'm curious if people turns those on and off in practice, what's your sense from issues, etc.?

@sondrelg - I realize it's probably unhelpful for me to just keep saying "We have something that does X" 😅 so let me take a second to outline how this plugin might be implemented in a bit of detail. If you're still interested, definitely let me know. If not, no worries at all...

So, for the rules around whether an import should / shouldn't be a in TYPE_CHECKING block, we need a few pieces of information:

Was the import itself in a type-checking block?
Was the import used in a type annotation?
Was the import used outside of a type annotation? (If an import isn't used at all, I think the plugin avoids flagging it?)

We probably want to have this information available to use when we run check_dead_scopes, which is also where we flag unused imports.
One way to implement this would be as follows:

Add a type_checking_blocks field to Checker. This could be Vec<&'a Stmt>, or Vec<Range>, and would contain references to the if-blocks or their ranges.
In src/ast/types.rs, we have a Binding struct that represents all bindings, and tracks usages. We could split that into two fields, used_runtime and used_annotation, or even some kind of Usages struct that has runtime and annotation fields, to track the most recent usage at runtime and as an annotation. Alternatively, we could make that a vector, and store all usages. Lots of options... (Note that we have checker.in_annotation, which we can leverage when setting those fields.)
In check_dead_scopes, iterate over all import bindings (see the if self.settings.rules.enabled(&Rule::UnusedImport) { ... } block for an example). For each binding, check its runtime and annotation usages, then check if the binding was created within a type-checking block. (Every Binding has a range field that tells you where it was defined, so we can check if that range is within any of the type-checking blocks, or whatever the exact logic should be).

(All of this ignores how we should treat redefinitions, i.e., modules that are imported multiple times.)

That seems great.

If an import isn't used at all, I think the plugin avoids flagging it?

This is true, but has been a bit of a pain to get right. We essentially try to shadow pyflake's F401 and avoid flagging an error if we suspect F401 would have been reported already. This way a user, using default flake8 settings would get one error instead of two. The trade-off is that this requires us to track all annotation values, which we wouldn't otherwise have to do iirc.

Add a type_checking_blocks field to Checker

I think there might also be a need to track function scopes, but perhaps the functionality that hinges on that information can be added later, or done in another way. Essentially I think we handle this case by tracking function scopes:
if TYPE_CHECKING:
    from pandas import DataFrame

foo: DataFrame  # this is fine

def bar():
    from pandas import DataFrame

    baz = DataFrame()  # this is also fine, but only because of the function-scoped import

This is a bit of a contrived example, but there are cases where this type of behavior can happen; typically in large files with circular import problems.

Did you say there is tooling to classify imports as stdlib/application/third-party/future already as well? I know the futures import is mapped :+1:
You are probably familiar, but TC001, TC002, and TC003 are the same error, just for different classes of imports.

Lastly, I'd be very happy to write some or most of the code, but to be realistic I think I'm down to being able to contribute 3-4 hours a week. If that's fine, I'm happy to commit to giving that a go, but if you or anyone else wants to jump on this and get it done, then I'd of course be happy to help wherever I can, but let you do most of the work :slightly_smiling_face:

Did you say there is tooling to classify imports as stdlib/application/third-party/future already as well?

Yeah, it's all in src/rules/isort/categorize.rs. It's only used for import-sorting right now, but could be extracted out and generalized for this check!

Lastly, I'd be very happy to write some or most of the code, but to be realistic I think I'm down to being able to contribute 3-4 hours a week.

No prob at all. I may get to it, I may not -- if I do, I'll comment here so that we don't duplicate work.

For example, TC006 has not been as helpful as I'd hoped. Pycharm's built-in type checker (not sure about other IDEs) struggles to understand that stringified imports still need to be there when type checking, so will remove the imports related to casts if you run the auto-clean imports command. I don't think I would have accepted that rule had I known about this ahead of time.

Yeah. Sorry about that rule @sondrelg. In principle it was a nice idea, but there are certainly problems as you've mentioned that we perhaps didn't foresee.
The main thing it trying to achieve was to reduce the runtime performance hit from building complex types when they're only relevant for static type checking. An alternative approach is to use type aliases in global scope to avoid the hit for building these complex types repetitively in every function call, loop, or whatever. As such TC006 could be ignored for this port, but I wonder if there is some way we can still gain some benefit by highlighting that a cast type is "overly complex" and may benefit from being shoved in a type alias?
Ah, sweet hindsight...

It's really only the lack of IDE support that makes it hard to work with in my experience. The rationale for the rule itself was great haha :clap:

Okay, I just knocked this out in #2146 and #2147. It'll go out as soon as we can release again (we're blocked by PyPI limits right now and waiting for an exemption -- see #2136).
The current version doesn't include any autofix capabilities (it's challenging because we need to remove imports from one part of the AST and re-add them elsewhere), but I tested on Dagster and it seems relatively reliable.

My only hesitation here is that I used TYP as the prefix, but the codes conflict with flake8-typing-imports. I don't intend to implement that plugin, but it is weird to have overlapping rule codes. Any other suggestions here? We could use TC, since we used TRY for tryceratops.

On second thought: TC causes the same issue, since it conflicts with the actual tryceratops. So noqa: TC002 would be interpreted incorrectly in the wild.

I'm going to rename to TYC, which is an uglier prefix, but it avoids all of the possible conflicts. I've added a redirect from TYP to TYC for now (with a warning), since a few users are already using TYP`.

I originally used TCH. Not sure if that's taken, but could be appropriate. Ugliest candidate yet though :smile:

Oh, cool. If you used that originally, let's go with that over TYC. Neither seems to be used.

The main thing it trying to achieve was to reduce the runtime performance hit from building complex types when they're only relevant for static type checking. An alternative approach is to use type aliases in global scope to avoid the hit for building these complex types repetitively in every function call, loop, or whatever. [...]

Please don't apologize, I'm quite fond of that rule and am not worried about pycharm since I don't use it. :P
(I would be interested in using it from ruff, if it was implemented.)

FYI: autofix for these rules will be enabled in the next release.

That’s interesting. Can you share the original and auto-fixed reproducible code? I think it’s worth to create a separate issue for that here.


cmd/internal/obj: stop using as a dumping ground for shared code

cmd/internal/obj is already imported by the compiler, linker, assemblers, etc., so it is a convenient place to put shared helpers, such as Bool2int, SortSlice, and PathToPrefix, even though they don't really belong there. It might be time to do a bit of cleanup.
cc @tzneal @mdempsky

I'm going to extract the common constants and helper functions into a new objabi package.


project motiviation

would be great to if the readme would mention some motivating statements, why one would a normalized composer.json file and what the benefits are of having it.

Thank you for your feedback, @staabm!
I have written a blog post at https://localheinz.com/blog/2018/01/15/normalizing-composer.json/. What do you think, would it suffice to link to the blog post, or would it be better to repeat some of what’s in the post?

linking the blogpost for in-detail infos would be great.
IMO in the README I would list at list the most important arguments in a rather short form.


File "", line 1006, in _gcd_import

I'm new at using manim. I just finished installing and I am trying to follow the tutorial, but:
$ python extract_scene.py manim_tutorial_1.py Shapes -pl
Traceback (most recent call last):
File "extract_scene.py", line 287, in
main()
File "extract_scene.py", line 247, in main
module = get_module(config["file"])
File "extract_scene.py", line 242, in get_module
return importlib.import_module(module_name)
File "/home/rodrigo/manim37/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 724, in exec_module
File "", line 860, in get_code
File "", line 791, in source_to_code
File "", line 219, in _call_with_frames_removed
File "/home/rodrigo/manim37/manim-master/manim_tutorial_1.py", line 22
self.play(ShowCreation(line))
^
TabError: inconsistent use of tabs and spaces in indentation
How can I solve it?

This will help you.


Bumped version.

Pull Request Test Coverage Report for Build 7493

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

Totals

Change from base Build 7488:
0.0%

Covered Lines:
1687

Relevant Lines:
1687

💛  - Coveralls


In and not-in operators for JSON pattern-matching

It would be nice to have in and not-in operators amongst the ones supported by Authorino's JSON pattern-matching, so values fetched from the Authorization JSON can be checked if included/not included in a particular static list, without requiring an OPA policy for that.
This is more or less the opposite of the incl and excl operations, which check if a list fetched from the Authorization JSON includes/does not include a particular static value.

Hey @guicassolato, I'd like to work on this 😄

Hey @guicassolato, I thought about this and here's what I came up with.

Add a new field in StaticList []string in JSONPatternMatchingRule.

type JSONPatternMatchingRule struct {
	Selector string
	Operator string
	Value    string
	StaticList []string
}

Add a new switch case in to check if values fetched from the Authorization JSON contain elements in the StaticList. Opposite can be done to out.

case operatorIn:
		exists := make(map[string]bool)
		for _, value := range expectedList {
			exists[value] = true
		}
		for _, value := range obtainedValue.Array() {
			if !exists[value.String()] {
				return false, nil
			}
		}
		return true, nil

WDYT?

@Rohith-Raju,
We can add StaticList []string to JSONPatternMatchingRule but 2 things come to mind:

We still need to expose this option at the level of the API, i.e. https://github.com/Kuadrant/authorino/blob/ee10686d3f7c7553e7a4615cfa591d325d2ff8d2/api/v1beta1/auth_config_types.go#L170
At the API, instead of introducing a new field, I thought about changing the type of Value to runtime.RawExtension. Depending on the operator, the value could be unmarshalled as string into JSONPatternMatchingRule.Value or as []string into JSONPatternMatchingRule.StaticList.

Why just string and []string, I wonder. Should we change the type of JSONPatternMatchingRule.Value to any and open for other JSON types as well?

For the implementation (ignoring (2) above, thus thinking only string and []string), I think obtainedValue would be a simple string, while expectedValue would be the slice. I.e.
case operatorIn:
	for _, expectedValue := range rule.StaticList {
		if expectedValue == obtainedValue.String() {
			return true, nil
		}
	}
	return false, nil
}

👍


Can you rebrand something

Suggested new feature or improvement
Can you rebrand Settings>Accounts as Profile
Scenario
The rebrand probably sounds good.
Additional details
No response

Do you have plans to rebrand anything?

We aren't planning to rebrand Accounts to Profile. The accounts just provide authentication to other pieces of Dev Home, but there isn't a notion of a profile (which traditionally adds additional info such as name, preferences, etc.).

Okay.


feat: add shared state button example

Related: #158
This adds an example for referencing how to do a shared state between our program and a pin interrupt.
Note: This PR is a draft as I didn't got yet to run it on a device, but it compiles.

Looks good! Let me know when you've had a chance to run it on a device and I'll merge it in.

I totally forgot, sorry!
Will test tomorrow.

Works as expected!


Support for: stop_grace_period

No error / warning when using this key.

@cdrage Opened up an issue on libcompose.
https://github.com/docker/libcompose/issues/447

upstream issue was fixed and we should be able to move on

@cdrage @surajnarwade asking out of curiousity, where does this map to in k8s? And in code are we handing this info to something?

@surajssd I think stop_grace_period can be mapped to Pod.Spec.TerminationGracePeriodSeconds.
This issue hasn't been solved yet. Still no warning/error when using this key.

@surajssd , can you please reopen the issue  ?

closed by #608


adding GW metric calculation method option

This PR adds an option for the method of calculating the annual temperature metrics used in the GW loss function. The option can be changed within the config file. Options include:
'static' : the metrics do not vary across years and are calculated by partition and by reach using all available years with >= 300 temp observations
'batch': the metrics are calculated by batch for batches with >= 300 observations, for other batches on the same reaches (within the same partition) the average values for the reach are used
'high_data_batches': metrics are only calculated for batches with >= 300 observations
'low_data_years': metrics are calculated by batch but only retained for batches with < 300 observations (using the average across batches on that reach with >= 300 observations)

Thanks @SimonTopp! I agree that streamlining this would be useful (and that it should wait for now).


HTML tags are strangely highlighted in JSP

JavaEE plugin version 2320. Installed plugins:

HTML tags are strangely hightlighted (note grey color of "e" in  and ">" in ,  and ):

JSP code:
<%@ page import="
    java.lang.*,
    java.io.*
"%>
<%!
class Test
{
    public static final String HTML = "\n" +
    "<title>Hello, World!</title>" +
    "
Hello, World!
\n" +
    "";
}
%>
<%
    out.print(Test.HTML);
%>

<title>Hello, World!</title>

Hello, World!

I think is duplicate by https://github.com/consulo/consulo-javaee/issues/3. Due something broken.


Edited for grammar and clarity

I proofread the README.rst file and corrected all the grammar errors I found. I also made slight changes in a few sentences for clarity and to remove redundancy.

Thanks a lot @vickychenglau

Hi @vickychenglau, thanks again for your proofreading and clarifications. This really helps a lot! Would you mind to also take a look into the actual documentation on http://pyscaffold.org/? You'll find the .rst files that generate the website under the docs folder, e.g. https://github.com/blue-yonder/pyscaffold/blob/master/docs/index.rst

BTW, if you want to please add yourself to AUTHORS.rst as contributor.