srvCfg.StmtCfg.Rset.SetNumberBigFloat(ora.F64) does not work

go version: go1.6.2 windows/amd64
ora commit: 157b7bb2f6ff142e3885412eaaf5eb4a7993b9e7
We have AVAILABLE_BALANCE column of ACCOUNT table. Its type is NUMBER(10, 2)
CREATE TABLE ACCOUNT(
...
  AVAILABLE_BALANCE NUMBER(10, 2) NOT NULL,
...
)

Now I need that ora provider returns values of AVAILABLE_BALANCE as float64.
I used following code:
package main

import (
	"fmt"

	ora "gopkg.in/rana/ora.v3"
)

func main() {
	var err error
	var env *ora.Env

	env, err = ora.OpenEnv(nil)
    if err != nil { panic(err) }
	defer env.Close()

	var srvCfg = ora.NewSrvCfg()
	srvCfg.Dblink = "host.com/ORCL"

	// srvCfg.StmtCfg.Rset.SetNumberBigFloat(ora.F64) // does not work.

	var srv *ora.Srv
	srv, err = env.OpenSrv(srvCfg)
	if err != nil { panic(err) }
	defer srv.Close()

	var sesCfg *ora.SesCfg = ora.NewSesCfg()
       sesCfg.Username = "branch"
       sesCfg.Password = "*****"

	var ses *ora.Ses
	ses, err = srv.OpenSes(sesCfg)
	if err != nil { panic(err) }
	defer ses.Close()

	var stmt *ora.Stmt
	stmt, err = ses.Prep("CALL pkg_account.get_account(:1, :2)")
	if err != nil { panic(err) }

	stmt.Cfg().Rset.SetNumberBigFloat(ora.F64)

	rset := &ora.Rset{}
	accountId := int64(100005222)

	_, err = stmt.Exe(rset, accountId)
	if err != nil { panic(err) }

	columnNames := rset.ColumnNames

	row := rset.NextRow()

	for i, name := range columnNames  {
		fmt.Printf("%d, %q, %T, %v\n", i, name, row[i], row[i])
	}

	fmt.Println("successful")
}

I wanted to set this option for all request but following does not it
srvCfg.StmtCfg.Rset.SetNumberBigFloat(ora.F64)

Output:
...
10, "AVAILABLE_BALANCE", ora.OCINum, -326300
...
successful

If we set the option for the specified statement then we receive value as float64:
stmt.Cfg().Rset.SetNumberBigFloat(ora.F64)

Output:
...
10, "AVAILABLE_BALANCE", float64, -326300
...
successful

TL;DR; OpenEnv does not use ora.Cfg().
As Far As I See,

rset uses rset.stmt.cfg,
which is from ses.cfg.StmtCfg,
which is from srv.OpenSes(sesCfg),
but if sesCfg.StmtCfg == nil, then (srv.go L252) ses.srv.cfg.StmtCfg is
used;
srv.cfg is from env.OpenSrv(srvCfg),
but if srvCfg.StmtCfg == nil, then (env.go L167) srv.env.cfg.StmtCfg is
used;
env.cfg is from ora.OpenEnv(envCfg).

Possible solutions:
a) put the same logic (if envCfg.StmtCfg == nil, then use
_srv.sqlPkgEnv.cfg.StmtCfg) with envCfg,
b) export _drv.sqlPkgEnv as ora.GetDrvEnv()
c) both.
What's your opinion?
Leonid Maliutin<EMAIL_ADDRESS>ezt írta (időpont: 2016. jún.
23., Cs, 15:12):

go version: go1.6.2 windows/amd64
ora commit: 157b7bb
https://github.com/rana/ora/commit/157b7bb2f6ff142e3885412eaaf5eb4a7993b9e7
We have AVAILABLE_BALANCE column of ACCOUNT table. Its type is NUMBER(10,
2)
CREATE TABLE ACCOUNT(
...
AVAILABLE_BALANCE NUMBER(10, 2) NOT NULL,
...
)
Now I need that ora provider returns values of AVAILABLE_BALANCE as
float64.
I used following code:
package main
import (
"fmt"
ora "gopkg.in/rana/ora.v3"

)
func main() {
var err error
var env *ora.Env
env, err = ora.OpenEnv(nil)
if err != nil { panic(err) }
defer env.Close()

var srvCfg = ora.NewSrvCfg()
srvCfg.Dblink = "host.com/ORCL"

// srvCfg.StmtCfg.Rset.SetNumberBigFloat(ora.F64) // does not work.

var srv *ora.Srv
srv, err = env.OpenSrv(srvCfg)
if err != nil { panic(err) }
defer srv.Close()

var sesCfg *ora.SesCfg = ora.NewSesCfg()
   sesCfg.Username = "branch"
   sesCfg.Password = "*****"

var ses *ora.Ses
ses, err = srv.OpenSes(sesCfg)
if err != nil { panic(err) }
defer ses.Close()

var stmt *ora.Stmt
stmt, err = ses.Prep("CALL pkg_account.get_account(:1, :2)")
if err != nil { panic(err) }

stmt.Cfg().Rset.SetNumberBigFloat(ora.F64)

rset := &ora.Rset{}
accountId := int64(100005222)

_, err = stmt.Exe(rset, accountId)
if err != nil { panic(err) }

columnNames := rset.ColumnNames

row := rset.NextRow()

for i, name := range columnNames  {
    fmt.Printf("%d, %q, %T, %v\n", i, name, row[i], row[i])
}

fmt.Println("successful")

}
I wanted to set this option for all request but following does not it
srvCfg.StmtCfg.Rset.SetNumberBigFloat(ora.F64)
Output:
...
10, "AVAILABLE_BALANCE", ora.OCINum, -326300
...
successful
If we set the option for the specified statement then we receive value as
float64:
stmt.Cfg().Rset.SetNumberBigFloat(ora.F64)
Output:
...
10, "AVAILABLE_BALANCE", float64, -326300
...
successful
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/rana/ora/issues/99, or mute the thread
https://github.com/notifications/unsubscribe/AAPoShbM3UAyw0m63lUMtN1tGS3ZVK_Eks5qOoYigaJpZM4I8yyG
.

Hi, Tamás
if ses.cfg.StmtCfg == nil && ses.srv.cfg.StmtCfg != nil {
	ses.cfg.StmtCfg = &(*ses.srv.cfg.StmtCfg) // copy by value so that user may change independently
}

ses.cfg.StmtCfg == nil is always false because NewSesCfg function always create default StmtCfg for new SesCfg.
// NewSrvCfg creates a SrvCfg with default values.
func NewSesCfg() *SesCfg {
	c := &SesCfg{}
	c.StmtCfg = NewStmtCfg()
	return c
}

I can fix my code in two ways:

Directly create SesCfg structure

var sesCfg *ora.SesCfg = &ora.SesCfg{}
sesCfg.Username = "branch"
sesCfg.Password = "*****"

In this case sesCfg.StmtCfg is nil and our condition is true.
2. Manually set that sesCfg.StmtCfg = nil after NewSesCfg function:
var sesCfg *ora.SesCfg = ora.NewSesCfg()
sesCfg.Username = "branch"
sesCfg.Password = "*****"
sesCfg.StmtCfg = nil

I think that the creating default SesCfg in NewSesCfg function is not clear practice.
I offer to remove NewSrvCfg and NewSesCfg functions. In this case, the programmer will have possibility to think about StmtCfg field.

@rana please help, what's your opinion?
a) don't initialize StmtCfg 'co, leave it to the programmer, and document this;
b) initialize StmtCfg 'co from _drv.sqlPkgEnv..., both in NewSesCfg and NewStmtCfg.
a) is a backwards-incompatible change,
b) could be, but it is done today, too, but not everywhere, so this could be more a clarification than a change. Also, this'd help to be consistent: if sy changes the cfg with ora.Cfg(), maybe she assumes that it is used everywhere in ora from there, but this is not the case ATM.
I'd favor b), what do you think @maliutin ?

I think StmtCfg is needed only in Ses and in Stmt because only these objects associated with data types which are obtained in the queries.
As I see in my project, to understand what type merging is used I should have StmtCfg in separated value and set it when new session is opening.
The current cascade behaviors is not clear for me and programmers that are reviewing my code.

PTAL "issue99" branch!
I've eliminated NewSesCfg(), and if you provide a *SesCfg with nil StmtCfg, it will inherit from it srv.
See TestEnv_SrvCfg and TestEnv_SesCfg in z_environment_test.go.

I've also removed NewSrvCfg.

Hi. I tested with my project. All work fine.

Thanks, merged it to master.


cross-category sorting

Hi everyone,
I am trying to sort the vulnerabilities only by the CVSS Score (cross-category).
For example:
I have two categories for vulnerabilities, 'General' and 'Web Application'.
Sometimes I need both categories in a report, as some vulns can be applied to both, web apps and network.
My problem is, if I have for example two vulns of 'Web Application' (high and medium) and one of 'General' (medium), but the medium vuln of the last one is higher rated regarding the CVSS Score as the medium vuln of the 'Web Application', it won't be sorted right in the final report.
In PwnDoc:

Thats how it looks like in the report:

It seems like PwnDoc sorts the vulns based on the audit type and afterward by the CVSS Score.
Is there a way to sort all the vulns only by the CVSS Score?

Can you show me the template code you're using according to your report screenshot ?
I think you are using the default findings order with {#findings} loop which iterate over categories then CVSS (by default). You can modify your template with the loop {#findings | sortArrayByField: 'cvssScore':-1} that will reorder findings by CVSS first as expected.

Amasing!
You were right, works like a charme.
Thanks again!


Add fix to ConcurrentLongHashSet

@wy96f i took your branch used for the upstream PR, have rebased it, and applied same fix for the hashset (as it has same logic)
Any chance you're able to answer @franz1981 queries on your PR to upstream? Also any way you've been able to reproduce the issue in a unit test? Just so then we can be sure it fixes it.


Gate bug

Steps to recreate
kill a gate
then rebuild it
then wait 1 min
it will increment from 500
instead of 2500
500 is the health of a destroyed gate

Hey. I’ll pick this one up


Issue with coc-rust-analyzer after RA 2020-05-25

See https://github.com/fannheyward/coc-rust-analyzer/issues/283 for details.
What changed between RA 2020-05-25 works but RA 2020-06-01 that might affect method completion.

Hard to tell, we did start using preselect more actively some time ago. As this issue stands, it's not too actionable. What would help is just gathering JSON with completions that rust-analyzer sends to the client, it probably would contain an answer.

Closing, I don’t see a way to move forward here.


No extra newline following header comment in CSS

Add a cli flag to control whether CSS  block comments in the header
are followed by a blank line.
This is intended to fix #531 . I would be happier not having it controlled by a switch or defaulting to no newline, but am open to advice

@joelwilliamson
Sorry for slow response.  Please resolve the conflicts since you submitted.
Also, since this is intended to fix #531, please include the same input from #531 in your tests.
I don't think you need to make this a new option.  Does making it the standard break any existing tests?  If not, then certainly make this the default behavior.  If it does break tests, take a look at the way they break and consider whether the test is wrong.
Thanks!

@joelwilliamson - any chance to work on this?

Does this solve #1219 ?

@Boycce - don't know if this fixes #1185.
@joelwilliamson - If you have time to work on this, it would be useful.
Anyone else wanting to take up Joel's work is also welcome.

@joelwilliamson - If you have time to work on this, it would be useful.
Anyone else wanting to take up Joel's work is also welcome.


Virtual Threads compatibility

Describe the issue
Please explain your compatibility with virtual threads explicitly.
Original postgresql jdbc driver did a great job by replacing all "synchronized" by ReentrantLock(see v42.6.0 release notes), but in this wrapper there are a lot of "synchronized" places in the code.
Using "synchronized" causes thread pinning and can cause a dead-lock on Virtual Threads.
Links
https://github.com/pgjdbc/pgjdbc/releases/tag/REL42.6.0

Hi @lazystone
Thanks for reaching out and raising this issue with us.
We've updated our documentation to reflect this.
We'll also be reviewing our usage of synchronized and concurrent classes that use synchronized, but cannot comment on any timelines.
Thank you!

I've found 11 instances of synchronized in the code that interfere with virtual threads. Can these be replaced soon?
https://github.com/search?q=repo%3Aaws%2Faws-advanced-jdbc-wrapper+synchronized+language%3AJava&type=code&l=Java

Hi @rmichela
Thanks for reaching out. We are currently working on replacing uses of synchronized in our codebase.
We'll keep you updated when the change is available.
Thank you!

Hi, @lazystone @rmichela
The issue has been fixed and we see no thread pinning. A fix is available in a snapshot build.
Could you kindly checkout our snapshot build and let us know if the issue still persists?
https://github.com/aws/aws-advanced-jdbc-wrapper/blob/main/docs/using-the-jdbc-driver/UsingTheJdbcDriver.md#using-a-snapshot-of-the-driver
Thank you!

Hi @lazystone and @rmichela,
If you have not had a chance to try the snapshot mentioned above, the fix was officially released in version 2.4.0 of the driver (the current version is 2.5.0). Since this is now available, I will close this ticket, but please feel free to reopen it, or open a new ticket, if you encounter any problems.
Thank you!


protobuf ignores arguments passed via override

Describe the bug
protobuf.override ignores any arguments given to it, because all versions of it (e.g.: 3.21) accept arguments that they don't pass to callPackage.
See my PR #209396 which fixes this.
Steps To Reproduce
Steps to reproduce the behavior:

Attempt to override protobuf: e.g. protobuf.override { abseil-cpp = pkgs.abseil-cpp_202206; }
Using nix-store -q --tree, observe that the given versions of overridden inputs are not used

Expected behavior
Overridden arguments should be used.
Additional context
I have an open PR #209396 to address this.
Notify maintainers

@jonringer
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.86, NixOS, 22.11 (Raccoon), 22.11.20230104.e9ade2c`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(kdahm): `""`
 - channels(root): `"nixos-22.05"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Closing as the linked PR was merged


Make Node.js version

Could you clarify what you mean? Although this is written in Typescript, it does transpile to Javascript and at the end of the day it runs in the node.js engine.


Moving block to another day loses intended blocks

If I move an event block to another day through Agenda interface, it loses children blocks. Moving to another hour in the same day works fine.
Example:
Apr 22nd, 2022

TODO 09:00-10:00 An event

Some important notes about event

Then I open the Agenda plugin. Move it to Apr 23rd, 2022. The result is:

TODO 09:00-10:00 An event

Notes are missing.

This problem is fixed in version 1.15.2. You can try again.

Now moving between days is not working at all. It doesn't save changes.

What version of your logseq?

I use 0.6.6. I'll downgrade the plugin in the next days or patiently wait for the next beta of Logseq. Thanks for the advice and for a great plugin!

It works with Logseq 0.6.7. Thanks a lot!


Removed temporary migration banner.

Removed temporary banner that directed to CPP instructions.

@anbene : Thanks for your contribution! The author(s) have been notified to review your proposed change.


Documentation: Pool does not compute query.sql immediately

I just wanted to record this for posterity in case someone else runs into it.  It's not a big deal, but this gave me grief for a while, until I went through the code and realized Pool is actually working as it is supposed to.  It might be worth documenting this.  Otherwise, feel free to close this issue.

When you run Pool#query(sqlString, values, callback) or Pool#query(options, callback), the pool does not immediately format the sql statement due to the connection being acquired asynchronously (after Pool#query returns).  The following does work but not as you'd expect:
var query = pool.query('INSERT INTO items SET ?', item, cb);
console.log(query.sql); // INSERT INTO items SET ?

The sql statement will be properly formatted/escaped once the underlying connection is acquired and Connection#query is called.

There is a PR #991 going on, but so far it's not backwards-compatible and we are not ready to release a 3.0 major version bump. If someone can put together a PR that's backwards-compatible, that would help a lot, otherwise you would have to work-around not using  pool.query  if you need the formatted SQL (or simply format before making the query using  pool.format() .

If you're asking to add documentation to the readme or something, please feel free to make a PR, but as far as I know, we never documented that pool.query is supposed to return anything, so I don't think there is anything to change in the documentation.
Is there documentation that lead to you believe that pool.query has a return value? I would like to address that if I can figure out why people keep thinking this :)

@dougwilson, first thank you for the responses and sorry for reposting.  I checked closed issues, but I guess I missed that this had come up before.
Regarding #991 and the possibility of a backwards-compatible pool.query.sql implementation:
Regarding the documentation:  First, I have to say that I am thankful for node-mysql and get great use out of it.  If it didn't exist, I probably would have moved off of Node for several projects.  As for why this was confusing of me (and likely others), I think it has to do with this logic:

(I accidentally posted this before I was finished writing it.)  @dougwilson, first thank you for the responses and sorry for reposting.  I checked closed issues, but I guess I missed that this had come up before.

As for why the documentation was confusing for me (and likely others), I think it has to do with this logic:

The first sentence in the documentation of .query seems to indicate that .query is identical for Connection and Pool.  The specific phrase "call the .query() method on an object" makes it sound like it's the same method, not just named similarly, which appears to be the case.
The documentation for .query then goes on to describe the three forms of .query without specific reference to Connection or Pool, except in the examples, reinforcing my belief that the methods are identical.
Near as I can tell, there is no documentation for query().sql.  It is referenced twice in examples, once in Escaping query values and once in Escaping query identifiers; in fact, I don't know if the return object of .query is documented anywhere.
Once I see the examples using Connection#query().sql, I see if the return object from Pool#query has an sql string.  It does.

If I believe that two instances of .query are identical, then it's a small leap from there to believe that the sql property of the return object of a call to one .query should be the same as the sql property of the return object of a call to another .query.  See the problem?  The documentation for .query doesn't differentiate its behavior based on the callee.  Looking at the source code before creating this issue corrected my assumption.
I suppose the easiest thing would be to document the object that is returned by .query at some point and, in that documentation, note that the SQL string will not have been formatted synchronously for calls to Pool#query.  If you'd like, I can open a PR with that change to the README.

Thanks for the feedback! Almost all the documentation was written my users in PRs, and I'm sure mistakes end up slipping by on accident, and we're very sorry! I definitely encourage you to make a PR with fixes and also if you think that slight changes will help people understand better.

No need to apologize.  node-myql has been fantastic for me.  When I get a little time this week, I'll work on a PR.


Is it possible to output image batch or image list?

According to the reference code, this node can output one processed image. If I have more than one to output, how do I accomplish this?
I tried to create a function that returns a list of pillow objects and got an error in the pil2tensor function.

pil_images = []
for img in a:
    pil_images.append(tensor2pil(img))

#and

tensor_images = []
for img in pil_images:
    tensor_images.append(pil2tensor(img))

tensor_batch = torch.cat(tensor_images, dim=0)

pil_images = []
for img in a:
    pil_images.append(tensor2pil(img))

#and

tensor_images = []
for img in pil_images:
    tensor_images.append(pil2tensor(img))

tensor_batch = torch.cat(tensor_images, dim=0)

Dose the node have to allow TORCH to work like this?

pil_images = []
for img in a:
    pil_images.append(tensor2pil(img))

#and

tensor_images = []
for img in pil_images:
    tensor_images.append(pil2tensor(img))

tensor_batch = torch.cat(tensor_images, dim=0)

Yes


overpass management:control using thread

this fix #78
management overpass

if cache is not exist, get overpass
if cache is exist but still not expired (15mins), show current data
if cache is exist but already expired, show current data and fetch overpass by threading

@meomancer could you change the Data updated... text color to #898989? Thanks.

Updated

@meomancer opening existed campaign is working fine, but when I created new campaign this will happen :

LGTM


Suspicious.low.ml.score on VirusTotal

While scanning the UVR_v5.4_Update_Package.exe package VirusTotal showed this result.
https://www.virustotal.com/gui/file/50468e9a9e55f66b1f8f39eb019f352d17ebf68c9d6fff0c96c04fcbf6a772ca
Could you kindly clarify on this?

I can assure you UVR is 100% safe. I need to work on getting the application signed so it isn't falsely flagged as a virus.


Remove comments once they are no longer needed for implementation.

https://github.com/fec-kidsnextdoor/frontend-capstone/blob/59d408b6f685be22833368bc28794437df1a5c48/src/components/CountClick.jsx#L3

Product Overview Component - Done 4/12/22


Sorting of need/connection lists within post-content/info -- As this shows post creation time instead of matching time, it's more visible that there is no useful sorting of suggested matches, as seen below.

As this shows post creation time instead of matching time, it's more visible that there is no useful sorting of suggested matches, as seen below. New posts are mixed with week- or month-old posts, even on What's New. This might be a general issue, not an issue with this PR though.

Originally posted by @sigpie in https://github.com/researchstudio-sat/webofneeds/pull/2757#issuecomment-465113432
requires #2757

info: this is also because we actually show the post-header as part of a suggestion item instead of the connection-header, it is to be determined if we want to continue to do so or if we would want to change it and use the connection-header instead

This is still an issue with the new What's New view:

sorting behaviour in chats view has changed (newest/most recently updated one first)


KAFKA-14569: Migrate Kafka Streams tests from Zookeeper to KRaft

Migrates stream tests from zookeeper to KRaft

Thanks for the comments! I just realized that the PR can use additional improvements, i.e. I can get rid of KafkaEmbedded since with KRaft you can set up the entire Kafka cluster (i.e. brokers + controllers) using the KafkaClusterTestKit.Builder

Thanks for the comments! I just realized that the PR can use additional improvements, i.e. I can get rid of KafkaEmbedded since with KRaft you can set up the entire Kafka cluster (i.e. brokers + controllers) using the KafkaClusterTestKit.Builder.

Thanks for taking the comments into consideration. One other suggestion is that we can have a look into #13375 to see what is the common between both EmbeddedKafkaCluster in stream and connect and see if we can have one common EmbeddedKafkaCluster between both of them. And later move connect to use it. Which also can be follow up JIRA if we want to keep this one simple. Either way I'm happy to lend a hand in the connect part if needed!

Thanks for taking the comments into consideration. One other suggestion is that we can have a look into #13375 to see what is the common between both EmbeddedKafkaCluster in stream and connect and see if we can have one common EmbeddedKafkaCluster between both of them. And later move connect to use it. Which also can be follow up JIRA if we want to keep this one simple. Either way I'm happy to lend a hand in the connect part if needed!

Cool I will look into it.

Hey @mdedetrich - are you still working on this PR? We are getting closer to 4.0, so it would be good to finish this.

We have migrated connect testes to KRAFT, can we reuse the new connect's EmbeddedCluster to move stream tests as well? I can help with this PR if no one has time to move it forward.

Hi, no I don't have the capacity to work on this PR anymore. Please take it over

I have some capacity to pickup this one.

I have some capacity to pickup this one.

Nice! This is highly appeciated.

I have some capacity to pickup this one.

Nice! This is highly appreciated. Are you planning to re-use this one, or open a new one (for this case, we should just close this one).

I'll open a new PR so we can close this once I open the new one


Format TRSS files using prettier

Signed-off-by: lanxia<EMAIL_ADDRESS>

This PR only formats the code. If any GitHub Code Scanning / CodeQL errors need to be fixed, they should be handled in a separate PR.


feat: add clang

this resolves https://github.com/near/cargo-near/issues/255
tested on https://github.com/dj8yfo/compile_error/blob/3dd4741a53572a79497807b5d8806a3997f85c75/Cargo.toml#L15-L16
built from this image https://github.com/dj8yfo/cargo-near-image/blob/677b43f0778f43c939499429e3d566589ce98045/Dockerfile#L13

Do we also need clang for the cargo-near-commit Dockerfile?

@dj8yfo Thank you for your contribution! Your pull request is now a part of the Race of Sloths!
Great job! Usain Bolt jealous of your results!

Current status: waiting for scoring
We're waiting for maintainer to score this pull request with @race-of-sloths score [0,1,2,3,5,8,13] command. Alternatively, autoscoring [1,2] will be applied for this pull request
What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow
For contributors:

Tag @race-of-sloths inside your pull requests
Wait for the maintainer to review and score your pull request
Check out your position in the Leaderboard
Keep weekly and monthly streaks to reach higher positions
Boast your contributions with a dynamic picture of your Profile

For maintainers:

Score pull requests that participate in the Race of Sloths and receive a reward
Engage contributors with fair scoring and fast responses so they keep their streaks
Promote the Race to the point where the Race starts promoting you
Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands

For contributors

Include a PR: @race-of-sloths include to enter the Race with your PR

For maintainers:

Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called


mdmonitor failing with no option to configure it

Describe the bug
After deploying a recent version of nixpkgs master to a machine I  was alerted by my monitoring that the service mdmonitor.service is now failing.
The  journal of the failing service:
Mar 11 01:00:48 bertha systemd[1]: Starting MD array monitor...
Mar 11 01:00:48 bertha systemd[486]: mdmonitor.service: Executable /usr/lib/mdadm/mdadm_env.sh missing, skipping: No such file or directory
Mar 11 01:00:48 bertha systemd[1]: Started MD array monitor.
Mar 11 01:00:48 bertha mdadm[488]: mdadm: No mail address or alert command - not monitoring.
Mar 11 01:00:48 bertha systemd[1]: mdmonitor.service: Main process exited, code=exited, status=1/FAILURE
Mar 11 01:00:48 bertha systemd[1]: mdmonitor.service: Failed with result 'exit-code'.

This seems to have been introduced by b9b27912ce1 (cc @abbradar).
It seems like all systems that have an mdraid device will see this error
To Reproduce
Steps to reproduce the behavior:

deploy a recent version of NixOS based on nixpkgs master to a machine with a linux raid (mdadm, …)
reboot
systemctl status mdmonitor.service

Expected behavior
The service should not be started when it wasn't properly configured.
Notify maintainers
@Ekleog  (mdraid maintainer)

Just FYI there's some prior discussion in https://github.com/NixOS/nixpkgs/issues/72394 which might be relevant.

Ah, so this is probably just a duplicate. I'll  close this one.


instantiateImageCodecWithSize leaks buffer on web

Steps to reproduce
The documentation for this method states:
The buffer will be disposed by this method once the codec has been created, so the caller must relinquish ownership of the buffer when they call this method.
While this is true on non-web platforms as shown below:
dart:ui
On web, you can see that only the codec is disposed but not the buffer, and the buffer isn't cleared in any of the called functions since it passes the underlying .list and not the buffer itself:
web:ui
This is different from my previously filed issue since that describes a leaking image, not a leaking buffer.
Expected results
All platforms should dispose the provided buffer.
Actual results
The web platform doesn't dispose the buffer, so to prevent a double disposal, one must special case the disposal for web so it is properly cleaned up on web/non-web platforms.
Code sample
Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration
[Upload media here]

Logs
Logs
[Paste your logs here]

Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [Version 10.0.19044.4291], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.3.5)
[!] Android Studio (version 2021.3)
    X Unable to determine bundled Java version.
[√] Android Studio (version 2023.3)
[√] VS Code (version 1.89.1)
[√] Connected device (3 available)
[√] Network resources

Although there is no sample code to illustrate a leak case, it can be seen from the source code that buffer is not disposed. Seeing this on main branch of engine repository as well.

flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.22.2 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (31 hours ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode15.3.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.90.0

[✓] Connected device (3 available)
    • iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.8 19H370
    • macOS (desktop) • macos                                    • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)    • chrome                                   • web-javascript • Google Chrome 125.0.6422.142

[✓] Network resources
    • All expected network resources are available.

• No issues found!

[!] Flutter (Channel master, 3.23.0-13.0.pre.187, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.23.0-13.0.pre.187 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f05095e0b7 (3 hours ago), 2024-06-10 17:31:08 -0700
    • Engine revision 1cdbebee19
    • Dart version 3.5.0 (build 3.5.0-236.0.dev)
    • DevTools version 2.36.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode15.3.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.90.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.90.0

[✓] Connected device (3 available)
    • iPhone (mobile) • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.8 19H370
    • macOS (desktop) • macos                                    • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)    • chrome                                   • web-javascript • Google Chrome 125.0.6422.142

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.


Add shuffle_trials functionality

We need to add the shuffle_trials functionality to the class/module we will develop.

In the original annubes repo, we predefined the number of trials in a sequence, allowing us to directly create it (shuffled or not). However, in the current setup, we define a general environment where sequences are generated dynamically, with stimuli types shuffled by default based on probabilities at each trial.
While this isn't an issue for plotting (we can simply modify the plotting function if we want an unshuffled sequence), it presents a challenge for the learning process. To control the sequence during training, we would need to modify the step() method to track the number of steps, along with a counter that keeps track of the total steps required. I’m unsure how to implement this total step count effectively.
My main question is whether training an agent on non-shuffled trials (e.g., first 1000 visual stimuli trials, followed by 1000 auditory trials) is even necessary. Wouldn't it make more sense to train separate agents for each modality (visual and auditory)? If training a single agent on both modalities is desired, sequential training (first visual, then auditory) could be implemented, which aligns with the approach in #21.
Please let me know if replicating the original annubes behavior is essential @jfmejias, and we can explore it further.

Kamino closed and cloned this issue to neurogym/neurogym


x/pkgsite: Frequently asked questions: is first and only header on home page

The first header on a page should be marked as <h1>. It would also be preferable if FAQ was not the first header on the page. Screen reader users jump to headers to skip repeated content in the page header/nav sections and, in this case, moving to the first header navigates users past the content of the page, straight into the footer.

Fixed.


feat: local-environment

Describe the feature you'd like to request
in my opinion, this setup makes it crazy hard to convince someone to go and provision all these services just to start exploring this project in local development
[next] ❌ Invalid environment variables: {
[next]   STRIPE_SECRET_TOKEN: [ 'Required' ],
[next]   STRIPE_WEBHOOK_SECRET: [ 'Required' ],
[next]   DATABASE_URL: [ 'Required' ],
[next]   OPENAI_API_KEY: [ 'Required' ],
[next]   INNGEST_EVENT_KEY: [ 'Required' ],
[next]   INNGEST_SIGNING_KEY: [ 'Required' ],
[next]   MUX_SECRET_KEY: [ 'Required' ],
[next]   MUX_ACCESS_TOKEN_ID: [ 'Required' ],
[next]   OPENAI_MODEL_ID: [ 'Required' ],
[next]   UPSTASH_REDIS_REST_URL: [ 'Required' ],
[next]   UPSTASH_REDIS_REST_TOKEN: [ 'Required' ],
[next]   DEEPGRAM_API_KEY: [ 'Required' ],
[next]   UPLOADTHING_URL: [ 'Required' ],
[next]   POSTMARK_API_KEY: [ 'Required' ],
[next]   POSTMARK_WEBHOOK_SECRET: [ 'Required' ],
[next]   NEXT_PUBLIC_APP_NAME: [ 'Required' ],
[next]   NEXT_PUBLIC_PARTYKIT_ROOM_NAME: [ 'Required' ],
[next]   NEXT_PUBLIC_PARTY_KIT_URL: [ 'Required' ],
[next]   NEXT_PUBLIC_URL: [ 'Required' ],
[next]   NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME: [ 'Required' ],
[next]   NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET: [ 'Required' ],
[next]   NEXT_PUBLIC_SUPPORT_EMAIL: [ 'Required' ],
[next]   NEXT_PUBLIC_SITE_TITLE: [ 'Required' ]
[next] }

Describe the solution you'd like to see
setting up mocks/container replacments for services in dev mode
Additional information
No response
👨👧👦 Contributing

[ ] 🙋♂ Yes, I'd be down to file a PR implementing this feature!

ya, it's wild lol
this project is what we use internally for the business so it's not really intended for "messing around"

i'd say there is a development environment is present, just not available to you
--- original message ---
On August 1, 2024 at 5:11 PM PDT @.*** wrote:

this project is what we use internally for the business so it's not really intended for "messing around"

interesting stuff, a business that develops in production.
No mocks, No dev env, all stuff depends on vendors.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you modified the open/close state.Message ID: @.***>
--- end of original message ---


How can I include caffe in my Windows based c++ project?

I plan to code a Windows C++ project based on Trained caffe model predictions. How should I include caffe to use my trained model for prediction ?

Hi, I have the same project, did you manage to do it that way? I had some troubles to install caffe on my linux partition so I hope I can avoid installing it on the windows one. My plan is to train the networks on linux and then find a way to use the trained networks in my existing windows based C++ project. Is that possible? Thank you for your time.

a simple way for you: try to build static and dynamic library for caffe, and include caffe.hpp and its dependency in your projects. If success, let me know.Thanks.


Why does env.render() create multiple render screens? | LSTM policy predict with one env [question]

When I run the code example from the docs for cartpole multiprocessing, it renders one window with all env's playing the game. It also renders individual windows with the same env's playing the same games.
import gym
import numpy as np

from stable_baselines.common.policies import MlpPolicy
from stable_baselines.common.vec_env import SubprocVecEnv
from stable_baselines.common import set_global_seeds
from stable_baselines import ACKTR

def make_env(env_id, rank, seed=0):
    """
    Utility function for multiprocessed env.

    :param env_id: (str) the environment ID
    :param num_env: (int) the number of environments you wish to have in subprocesses
    :param seed: (int) the inital seed for RNG
    :param rank: (int) index of the subprocess
    """
    def _init():
        env = gym.make(env_id)
        env.seed(seed + rank)
        return env
    set_global_seeds(seed)
    return _init

env_id = "CartPole-v1"
num_cpu = 4  # Number of processes to use
# Create the vectorized environment
env = SubprocVecEnv([make_env(env_id, i) for i in range(num_cpu)])

model = ACKTR(MlpPolicy, env, verbose=1)
model.learn(total_timesteps=25000)

obs = env.reset()
for _ in range(1000):
    action, _states = model.predict(obs)
    obs, rewards, dones, info = env.step(action)
    env.render()

System Info
Describe the characteristic of your environment:

Vanilla install, followed the docs using pip
gpus: 2-gtx-1080ti's
Python version 3.6.5
Tensorflow version 1.12.0
ffmpeg 4.0

Additional context

Hi @araffin , I followed your comments above but am really struggling to get it to work. I am using an LSTM policy with Subprocvecenv. My code is below:
        env = DummyVecEnv([self.make_env(test_gym, 0)])

        # for LSTMPolicies, the predict method expect a shape of (n_envs, obs_space.shape),
        # so if you want to test with only one env,
        # construct an ndarray of shape (1, obs_space.shape) and then
        # concatenate it with zeros to create the final ndarray.
        obs = env.reset()

        zeroes = np.zeros(shape=(n_envs - 1, env.observation_space.shape[1]))
        obs = np.concatenate((obs, zeroes), axis=0)
        print(obs.shape)
        for _ in range(1000):
            action, _states = model.predict(obs)
            obs, rewards, dones, info = env.step(action)
            env.render()```
With the above code, although print obs.shape gives me: `(8, 1, 77)`, I get the following error when attempting to predict: `ValueError: Cannot feed value of shape (1, 1, 77) for Tensor 'input/Ob:0', which has shape '(8, 1, 77)`

Any ideas? Did I understand your comments correctly?

Hello,
You can find below a working example:
import gym
import numpy as np

from stable_baselines import PPO2
from stable_baselines.common.vec_env import DummyVecEnv

 def make_env():
    def maker():
        env = gym.make("CartPole-v1")
        return env
    return maker

# Train with 2 envs
envs = DummyVecEnv([make_env() for _ in range(2)])
model = PPO2("MlpLstmPolicy", envs, nminibatches=2)

# Create one env for testing
test_env = DummyVecEnv([make_env() for _ in range(1)])
test_obs = test_env.reset()

# model.predict(test_obs) would through an error
# because the number of test env is different from the number of training env
# so we need to complete the observation with zeroes
zero_completed_obs = np.zeros((2,) + envs.observation_space.shape)
zero_completed_obs[0, :] = test_obs

# IMPORTANT: with recurrent policies, don't forget the state
state = None
action, state = model.predict(zero_completed_obs, state=state)

Please look at the documentation on how to use recurrent policies during testing, here you were forgetting the state.

This is the code that I am using to predict:
n_cpu = 1
env = PortfolioEnv(history=history, abbreviation=instruments, steps=settings['steps'], window_length=settings['window_length'], include_ta=settings['include_ta'],allow_short=settings['allow_short'], reward=settings['reward'])
env = SubprocVecEnv([lambda: env for _ in range(n_cpu)])
mdl = 'futures_20100101_20180101_10000000_2000_7_return_False'
model = PPO2.load(mdl)

# intialized here
obs = env.reset()
zero_completed_obs = np.zeros((n_cpu,) + env.observation_space.shape)
zero_completed_obs[0, :] = obs
#   state = None
state = model.initial_state   #   get the initial state vector for the reccurent network
done = np.zeros(state.shape[0])   #   set all environment to not done

weights, state = model.predict(zero_completed_obs, state, done)

I get this error:
ValueError: Error: Unexpected observation shape (1, 3080) for Box environment, please use (3115,) or (n_env, 3115) for the observation shape.

This is the code used for prediction:
n_cpu = 1
env = PortfolioEnv(history=history, abbreviation=instruments, steps=settings['steps'], window_length=settings['window_length'], include_ta=settings['include_ta'],allow_short=settings['allow_short'], reward=settings['reward'])
env = SubprocVecEnv([lambda: env for _ in range(n_cpu)])
mdl = 'futures_20100101_20180101_5000000_2000_3_return_False'
model = PPO2.load(mdl)

# intialized here
obs = env.reset()
zero_completed_obs = np.zeros((n_cpu,) + env.observation_space.shape)
zero_completed_obs[0, :] = obs

state = None
#   state = model.initial_state   #   get the initial state vector for the reccurent network
#   done = np.zeros(state.shape[0])   #   set all environment to not done

weights, state = model.predict(zero_completed_obs, state)

#   print(weights)

return weights, settings

I get this error in model.predict:
<class 'ValueError'>
Traceback (most recent call last):
File "C:\Users\hanna\Anaconda3\lib\site-packages\quantiacsToolbox\quantiacsToolbox.py", line 871, in runts
position, settings = TSobject.myTradingSystem(*argList)
File "ppo2_quantiacs_test.py", line 47, in myTradingSystem
weights, state = model.predict(zero_completed_obs, state)
File "C:\Users\hanna\Anaconda3\lib\site-packages\stable_baselines\common\base_class.py", line 472, in predict
actions, _, states, _ = self.step(observation, state, mask, deterministic=deterministic)
File "C:\Users\hanna\Anaconda3\lib\site-packages\stable_baselines\common\policies.py", line 508, in step
{self.obs_ph: obs, self.states_ph: state, self.dones_ph: mask})
File "C:\Users\hanna\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 929, in run
run_metadata_ptr)
File "C:\Users\hanna\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1128, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (1, 675) for Tensor 'input/Ob:0', which has shape '(12, 675)'

Please read carefully my example, you have to use n_training_envs not n_cpu.

Whats the difference between n_training_envs and n_cpu?
Just a name of a variable.

You trained your agent with 12 envs (according to the error) and want to test it with only one.
But here, n_cpu != n_training_envs, so you get an error.

I changed it according to your example:
n_env = 12
env = PortfolioEnv(history=history, abbreviation=instruments, steps=settings['steps'], window_length=settings['window_length'], include_ta=settings['include_ta'],allow_short=settings['allow_short'], reward=settings['reward'])
env = DummyVecEnv([lambda: env for _ in range(1)])
mdl = 'futures_20100101_20180101_5000000_2000_3_return_False'
#   mdl = 'futures_20100101_20180101_5000000_2000_3_return_False_c7616a5f58b141aa989379427458bbe8'
model = PPO2.load(mdl)

# intialized here
obs = env.reset()
zero_completed_obs = np.zeros((n_env,) + env.observation_space.shape)
zero_completed_obs[0, :] = obs

state = None
#   state = model.initial_state   #   get the initial state vector for the reccurent network
#   done = np.zeros(state.shape[0])   #   set all environment to not done

pos, state = model.predict(zero_completed_obs, state)

Still get:
ValueError: could not broadcast input array from shape (12,45) into shape (45)

I guess that I have to take the first row of the pos matrix? pos[0] ?

I guess that I have to take the first row of the pos matrix? pos[0] ?

ok, you did not show all the code. Sure, your test env is expecting only one action, and please try by yourself before asking question for each step.

Still have a problem in
pos, state = model.predict(zero_completed_obs, state, done)
ValueError: Error: Unexpected observation shape (12, 5) for Box environment, please use (10,) or (n_env, 10) for the observation shape.
Model was trained with n_env = 12
Where this 10 comes from?

Still have a problem in
pos, state = model.predict(zero_completed_obs, state, done)
ValueError: Error: Unexpected observation shape (12, 5) for Box environment, please use (10,) or (n_env, 10) for the observation shape.
Model was trained with n_env = 12
Where this 10 comes from?

A few things:

This is not related to the issue.
You did not give the required code to replicate the issue.
You did not give the full stack trace (which could be used to help find the origin of the issue)
please use the Markdown highlighting code format (https://help.github.com/en/articles/creating-and-highlighting-code-blocks)

Your issue will not be addressed if you do not follow the format described in the issue template (https://github.com/hill-a/stable-baselines/blob/master/.github/ISSUE_TEMPLATE/issue-template.md)

n_env = 12
env = PortfolioEnv(history=history, abbreviation=instruments, steps=settings['steps'], window_length=settings['window_length'], include_ta=settings['include_ta'],allow_short=settings['allow_short'], reward=settings['reward'], debug=settings['debug'])
env = SubprocVecEnv([lambda: env for _ in range(1)])
mdl = 'ES_19900102_20180101_5000000_7000_1_return_False_7a686c53e4a34338942a8b4bbe65fa47'
model = PPO2.load(mdl)

# intialized here
obs = env.reset()
zero_completed_obs = np.zeros((n_env,) + env.observation_space.shape)
zero_completed_obs[0, :] = obs

state = None
state = model.initial_state
done = np.zeros(state.shape[0])

pos, state = model.predict(zero_completed_obs, state, done)

Traceback (most recent call last):
File "C:\Users\hanna\Anaconda3\lib\site-packages\quantiacsToolbox\quantiacsToolbox.py", line 871, in runts
position, settings = TSobject.myTradingSystem(*argList)
File "ppo2_quantiacs_test.py", line 68, in myTradingSystem
pos, state = model.predict(zero_completed_obs, state, done)
File "C:\Users\hanna\Anaconda3\lib\site-packages\stable_baselines\common\base_class.py", line 469, in predict
vectorized_env = self._is_vectorized_observation(observation, self.observation_space)
File "C:\Users\hanna\Anaconda3\lib\site-packages\stable_baselines\common\base_class.py", line 399, in _is_vectorized_observation
.format(", ".join(map(str, observation_space.shape))))
ValueError: Error: Unexpected observation shape (12, 5) for Box environment, please use (10,) or (n_env, 10) for the observation shape.

Please use the Markdown highlighting code format (https://help.github.com/en/articles/creating-and-highlighting-code-blocks)
Reading code in pure text is not pleasent, and only take a few seconds for you to do.
Also, you are not using the latest version of stable-baselines, you must
follow the format described in the issue template (https://github.com/hill-a/stable-baselines/blob/master/.github/ISSUE_TEMPLATE/issue-template.md)
as you will see that it says to describe with version of stable-baselines you have.
You are loading a model expecting a  (n_env, 10) for the observation shape. It is an explicite message.

Ok it was my mistake I relieve it now.
I getting in prediction Nan.
Anyway I emailed you and Antonin privately.
Even if I do not get Nan, It is not working on new unseen data and in fact it does not even work when testing on same trained data. I hope that you can help and finish this once and for all.

I getting in prediction Nan.

You might want to have a look a this : https://stable-baselines.readthedocs.io/en/master/guide/checking_nan.html
It will help to find the NaNs in your code, specifically the VecCheckNan wrapper: https://stable-baselines.readthedocs.io/en/master/guide/checking_nan.html#vecchecknan-wrapper

Even if I do not get Nan, It is not working on new unseen data and in fact it does not even work when testing on same trained data.

Reinforcement learning is not a magic bullet, it is in no way garanted to work all the time on every problem. For mathematical reference see the no free lunch theorem, which states:
Any two optimization algorithms are equivalent when their performance is
averaged across all possible problems

including random optimization algorithms.
You might want to try some tricks like VecFrameStacking, VecNormalize, or hyperparam search to help the algorithm optimize the way you would like.

I hope that you can help and finish this once and for all.

If you believe you have found a bug in the code of stable-baselines, and can show it reliably:
We will adresse it.
If you need techsupport or consulting:
We will not help
We do not have the time, nor the obligation for consulting on stable-baselines. The library is "as is", as described in the MIT licence: https://github.com/hill-a/stable-baselines/blob/master/LICENSE.

I understand that you do not have any obligation to counsel.
I am trying to implement this:
http://www-scf.usc.edu/~zhan527/post/cs599/
with stable baseline.
In the original article it does work, even on unseen data.
He created his own ddpg agent, and I understand that PPO suppsoe to be better.

In the original article it does work, even on unseen data.

Correction, on the given unseen data. it is possible to generate data that will not give a positive result for the algorithm. That is the hole point of adversarial learning.

He created his own ddpg agent, and I understand that PPO suppsoe to be better.

How did you get that impression? both have advantages and disadvantages.

I know that they have github repository with their code. There are other similar works on github, for example https://github.com/yuriak/RLQuant
I was hoping that stable baseline will let me test various agents and not be confined to ddpg only.
In addition, stable baseline has tensorboard integration.
In any case, at this point I still believe that the problem is with my code and not the agent or hyper parameters.
The original work is actually this:
https://arxiv.org/abs/1808.09940

Locking issue, diverging too much from the original message.


RPC: Add log when handler fail yamlcpp validation on registration.

[approve ci autest]

Cherry-picked to v10.0.x


Removing 'optional' attributes from a type's properties disallow adding undefined as it's type

Bug Report

🔎 Search Terms

type generic remove optional attribute
🕗 Version & Regression Information

I did test this on 4.4.4 and 4.5.0-beta using playground
⏯ Playground Link

Playground link with relevant code
💻 Code

type NullableType<T> = {
    [K in keyof T]-?: undefined extends T[K]
    ? T[K] | null | undefined
    : T[K]
}

🙁 Actual behavior
Removing optional attribute from type also remove undefined from final type
(when not removing optional attribute, final type is x?: typeof x | null | undefined)
🙂 Expected behavior
Removing optional attribute just removes the optional attribute and doesn't modify final type

Sounds like a duplicate of #31025.

I don't see any repro here that demonstrates what you're talking about. Please provide an actionable sample that clearly demonstrates what you consider to be the bug

Hi @RyanCavanaugh,
Hover over BadNullableTest in the playground, you'll see that previously optional attributes are defined as string | null instead of string | null | undefined
Regards,
Nicolas

Please provide an minimal/actionable sample that clearly demonstrates what you consider to be the bug, not a textual description of where to look in a long sample

@KuSh does the relatively new compiler option exactOptionalPropertyTypes make it behave the way you are expecting? playground
type NullableType<T> = {
    [K in keyof T]-?: undefined extends T[K]
    ? T[K] | null | undefined
    : T[K]
}

type Test = {
    req: string
    opt?: string
    canBeNull: string | undefined
}

type EQ = NullableType<Test>
//   ^?
const shouldPass: EQ = {req: "", opt: undefined, canBeNull: undefined}

@KuSh does the relatively new compiler option exactOptionalPropertyTypes make it behave the way you are expecting? It seems so. But is effectively too recent for my current project (which use TS 4.3) and also has other consequencies as we're used to set optional props as undefined. Thanks for tip I'll keep that in mind 👍


Add MVD

Migrate MVD from agera-edc organization to eclipse-dataspaceconnector.

@jimmarino @paullatzelsperger Can we use "Rebase and merge" strategy when we merge this PR? To keep the history and finding the right author when doing git blame.

Can we use "Rebase and merge" strategy when we merge this PR? To keep the history and finding the right author when doing git blame.

We should use "Squash-and-merge" as we do in the DataSpaceConnector repo

Can we use "Rebase and merge" strategy when we merge this PR? To keep the history and finding the right author when doing git blame.

We should use "Squash-and-merge" as we do in the DataSpaceConnector repo

Can't we make an exception for this PR as we are migrating the repo? Otherwise we will loose the history, and we will all end up co-author of one big commit and git blame will not provide the right author.
This is a specific case as we are migrating.


Update linux-image-build and linux-image-build-dev cit invocations

Define the default linux image build CIT filter in a central location. Allow passing extra args. Skip licensevalidation in rocky accelerator pipelines (temporarily, while it's publishing to the preview project). Run accelerator tests and use the alpha API for accelerator images.
/cc
/hold

/unhold
/cc @jjerger @zmarano

/lgtm


Added infinite array

Removed code duplication, added infinite array.

I'm closing this, as it's superceded by my work in a seperate branch.  Thanks for your work @ibarrick !


Bullet list question on public README.

What would you like to share?
The list on the public README seems confusing as it is both an ordered list and an unordered list:

There is bullet points and numbers next to eachother and I was wondering if we could keep one type.
Thank you.

@CodingSpecies Please assign this issue to me so that I can fix.

@jasham I am not able to assign you to this, as I am not a maintainer, but feel free to work on it and open a pull request!

Thanks @schmelto & @CodingSpecies


Exceptions aren't logged by EventLogger (dev branch)

It seems that in commit 4528bdbc2816a8b5f933d9c6cf2da806ce4a72ea, the MessageFormatter helper function in LoggerExtensions.cs was changed to not include the exception. The ConsoleLogger logs the exception by itself, but the EventLogger doesn't.

@BrennanConroy could you take a look?

This was an intentional change
@lodejard

It was an intentional change that the exception is not included in the event log?

Sure, the Exception.ToString should be added to the body. Might want to have two newlines between the message and the exception for readability.

That would cause the ConsoleLogger to output the exception twice - which is not really useful/wanted.

@lodejard did you mean EventLogger should be changed to include Exception.ToString()?

Yes

Then I misunderstood you. I'm sorry.

No problem, what I wrote could have meant either thing. :)

So we were both right :D

6b07c6ae4aadf3b605d161bc8f6cc36de1619efc


Add a license

This code repo doesn't set a license. Decide what license should apply, and add a LICENSE file (or LICENSE.md) to make that clear.

closed in #23


Remove use of old tariff code

The main purpose of this PR is to remove the use of the feature flag controlling whether to use the old or new tariff manager code. This will allow us to remove some additional unused code and support for development.
However, because our specs are based on actual school data, which is present in the project as meter collections, after removing this flag I've also had to update the meter collections for those schools.
This means that every test that relies on those meter collections also needed to be updated. Since we added the meter collections, the schools have had new or updated data loaded, as well as configuration and tariff updates. So a lot of tests have had to be changed.
The decision to use real-world data was due to there being little/no automated tests in the project. So adding specs using real data, then refactoring around those, was a sensible decision for building the new interfaces. But longer term it has added overheads like this whenever we need to update the data.
The intention is to steadily replace these specs with:

low level specs that use data from FactoryBot or other synthetic data to confirm that calculations work as expected
change the service specs to use check that calculations are called and data is returned in the correct structures

This will take some time, so for now I've just taken the hit.
Beyond removing use of the old MeterTariff manager there are no functional changes in this spec the other changes are:

adding the updated meter collections
revising the specs to confirm the new values that are being returned due to new/changed data and tariffs
start removing the round_to_two_digits custom matcher in favour of the rspec built in.

Looks good @ldodds - just one question - see inline 👍


page to show/edit policy fails if policy name includes space

For instance: http://<IP_ADDRESS>:8000/operations/show/Policy with Spaces gives an error page, but http://<IP_ADDRESS>:8000/operations/show/Digibeta_Tests is ok.

I just fixed it and pushed on server.. Please let me know if it persists..


Py3 compatibility changes for tests

Thanks for this, I will see if I can get configure Travis to run the tests with Py3 as well.


Reference documentation enhancements (discussion)

pull request for discussing various reference documentation enhancements

understanding issues
formatting issues
typo and wording fixes

Hi @celkins
We are currently having a look at the JMS client library. As soon as we have a clear position regarding this library we will document it.

@cstettler I know it's been a while but perhaps you would be interested to fill the gaps in the current documentation?

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

Closing due to lack of feedback.


add resources to owned collection In CSV

Add pipeline ant task resources to the owned collection in the kabanero CSV

fixes #31


Unexpected token: operator (>)

It seems that Uglify isn't compatible with  ES6 syntax and is throwing the following error when trying to run on universalImport.js
ERROR in main.3b107cd023ec5c3b29b1.js from UglifyJs
Unexpected token: operator (>) [./node_modules/babel-plugin-universal-import/universalImport.js:7,0][main.3b107cd023ec5c3b29b1.js:24366,20]

I'm getting this when trying to run npm run build on a fresh checkout of your other repo that uses this, https://github.com/faceyspacey/redux-first-router, causing it to fail.

it's fixed, pushed, published, and the redux-first-router-demo has been updated.
Thanks for finding this. Let me know if you need anything else.

ps. the issue is that in the babel plugin I add 2 additional small files, and I guess since they're added during babel compilation, babel-loader doesn't know to transpile them. During dev you don't notice this issue because you're not using uglify and in the browser it runs in chrome which supports things like arrow functions. But in prod by the time it gets to uglify it expects it transpiled. Something like that.
Bigger babel plugins that append files I assume have a build phase for those files so they dont have to code them in es5. In the case of this plugin, the files are so small i dont bother, but i let the arrow functions slip.
...one other thing, i upgraded the demo ur using to not have to use the resolve option in Universal Component. That's part of what this plugin does. Very soon you won't have to manually create the hash of dynamically imported components, as Im about to finish the PR to webpack that allows for dynamic calls to require.resolveWeak, and the webpack team seems to be enthusiastic about merging my fix:
https://github.com/webpack/webpack/pull/5235
...just in case u were wondering what all this universal-import stuff was all about. It will allow for the single import you see here:
https://codesandbox.io/s/github/faceyspacey/redux-first-router-codesandbox/tree/master/?module=BJiziDAMUb
but not just in an SPA.

Awesome that all sounds great, thanks as always for the quick turnaround!


Return apierrors from repositories

Is there a related GitHub Issue?
https://github.com/cloudfoundry/cf-k8s-controllers/issues/288
What is this change about?
Return apierrors from repositories. This frees api handlers from interpreting repositories and k8s errors into "UI"-friendly ones. Instead, they can simply return them.
The only exception of not returning the repositories errors as they come is in the cases when handlers explicitly want to mask repo errors, for example, mask forbidden as not found.
There are a couple of general rules:

apierrors are generally a metadata layer over real errors. Therefore whenever an apierror is created, it should be provided with a non-nil cause.
Both handlers and controllers should return apierrors. If they return non-apierrors, the errors would be presented as unknown errors in the response.
Repositories should/must convert raw kubernetes errors to apierrors. In order to do that they use the apierrors.FromK8sError utility function.
Handlers should return errors from repos without being interested in them. The only exception is in cases they want to mask errors, e.g. forbidden as not found. They could use NotFoundAsUnprocessableEntry, ForbiddenAsNotFound etc. utilities from the apierrors package.
As apierrors are a metadata layer over actual errors, tests should be asserting on the error type via either BeAssignableToTypeOf, or via the newly introduced matchers.WrapErrorAssignableToTypeOf

There are several decisions within this PR that might sound a bit controversial:

Repositories would handle errors from webhooks (e.g. when we try to create a duplicate object) and return UnprocessableEntityError (for example, the route repository). So far this handling has been performed by the handlers themselves (for example, the route handler @ main). We believe that this translation belongs to the repository, furthermore handlers should not be really interested in the errors coming from repos as along as they make sure to propagate them.
The domain repository used to return a generic error which used to be presented as an unknown error. With the current change, the repo returns an apierrors.NotFoundError, which is presented as a domain not found error. I guess this has been simply overlooked in the past, we should not really get unknown errors.
There are a few handleXXXError utility functions deleted from handlers. They used to implement complex mapping from repository errors, but as we implemented this PR they shrunk down to simply logging an error and returning it. We therefore deleted them and inlined the logging at the places the errors occur. Although this is idiomatic, there is now a bit of duplication in logging in handlers. Maybe we should invent a better logging strategy...
The apierrors constructors should have non-nil cause provided. This cause is used to present the error in the HTTP response and logs. However, for the sake of not panicking, the base apiError handles nil causes

Does this PR introduce a breaking change?
No
Acceptance Steps
Green tests
Tag your pair, your PM, and/or team
@georgethebeatle

could we further simplify the code by just having the repo layer return "not found" instead of "forbidden" on any fetch operation?

There is a problem where the same repo method's errors are transformed differently by different handler functions. For example, in the app handler, appSetCurrentDropletHandler() transforms a forbidden error from dropletRepo.GetDroplet() to an unprocessable entity error, whereas the next method appGetCurrentDropletHandler() transforms the same error from dropletRepo.GetDroplet() to a not found error


[Network] Rename interface-endpoint command group to private-endpoint

Closes #7536. Deprecates interface-endpoint so that the commands continue to appear for now.

This checklist is used to make sure that common guidelines for a pull request are followed.

[X] The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

[X] I adhere to the Command Guidelines.

@yugangw-msft ping


Removing +1 from GitHub Issues

The number of +1 comments on issues make it difficult to read through issues and get to the information that's important. I'd be up for adding functionality to hide +1 comments from issues.
Let me know if this is a good suggestion and I'll get started.

See #1231 and #1276

I would also like a bot that

Watch my repositories for +1.
Delete those comments.
Send an email to those users and explain about this.

@franklinyu I don't really think Refined GitHub can do that, you should write your own bot or use webhooks.


doc: require in Gemfile

Closes:
Goal
The gem won't work following the "Installation" steps for Bundler. Correct them.
Approach

Add a require to match the irb instructions.

Signed-off-by: Roderick Monje<EMAIL_ADDRESS>

@olleolleolle FYI bypassing review because changes are confined to documentation.


Remove the need for manual Manhattan alignmentm, use COLMAP instead

from COLMAP documentation:
COLMAP has functionality to align the coordinate axes of a reconstruction using a Manhattan world assumption, i.e. COLMAP can automatically determine the gravity axis and the major horizontal axis of the Manhattan world through vanishing point detection in the images. Please, refer to the model_orientation_aligner for more details.
https://github.com/talshilo/colmap/blob/master/doc/faq.rst

Thank you. I tried Manhattan alignment using colmap before, but it was z-vertical instead of y-vertical as in the paper. I am not very familiar with the use of colmap, and I do not know whether the use of colmap can achieve the alignment effect in the paper.


Made a plugin and im listed twice in members?

https://hangar.minidigger.me/Peaches_MLG/IridiumSkyblock
https://imgur.com/HjMgKTJ.png

That's your avatar not loading and just displaying its title (being your name).

Which then makes this a duplicate of #290


release 1.38.0

I have pushed the image to quay.io/jaeger-mongodb/jaeger-query-mongodb:1.38.0-1c9de3b.

cc @dmichel1 Can you help me with merging this?


Why not method kids ?

I am teaching my brother 7 years playing and learning to program, but realize a translation a little hard for his age, could have codecombat kids, it would be really cool !

Can you describe a bit more what changes you would want to see for your brother to play?

Lowering language level on latin spanish translation :+1:


#109 Removing all the references from the old project location

This is just a "find and replace" on the repo removing all the references.

LGTM! However, there will be a conflict with #106. I would recommend that we first merge #106 and then rebase this PR because it's easier this way. @matpimenta what are your thoughts on this?

agreed, @philippschulte. I can rebase/reapply after #106 is merged


docs(framer-motion): Update "Chakra UI + Framer Motion" integration guide's examples to use the "chakra" factory + "as" prop

Subject
Code example
Description
Why don't use like this?
<Box as={motion.div} />

Cons: chakra props will be prioritized over framer-motion props if existing prop that have the same name. e.g:
<Box
    as={motion.div}
    transition="all 0.5s linear"
   /* not:
   transition={
        duration: 0.5,
        ease: "linear"
   }
   */
/>

Hi @tannguyencse19, could you elaborate on this? To continue further here we need more details on what you are missing and what/where things have to change in the docs.

@noobinthisgame I think @tannguyencse19 has a point. The docs utilize the motion factory function, which has changed over the time and it's throwing an error now. We could utilize the chakra factory function, just like we do when wrapping the Next.js Image component. Here's a codesandbox that implements the two ways: https://codesandbox.io/s/eager-estrela-wwg3k4?file=/src/index.tsx. The behaviour is the same, but there's an error in the motion way. I guess we should update the docs to use the chakra factory function instead.

I'd like to work on this!

@noobinthisgame I think @tannguyencse19 has a point. The docs utilize the motion factory function, which has changed over the time and it's throwing an error now. We could utilize the chakra factory function, just like we do when wrapping the Next.js Image component. Here's a codesandbox that implements Framer Motion in three different ways: https://codesandbox.io/s/eager-estrela-wwg3k4?file=/src/index.tsx. The behaviour is the same, but there's an error in the motion factory function way. I guess we should update the docs to use the chakra factory function and the as prop instead:
// `chakra` factory function
const ChakraBox = chakra(motion.div, {
  shouldForwardProp: isValidMotionProp
});

or
// `as` prop
<Box
   as={motion.div}
   height="40px"
   width="40px"
   bg="orange.400"
   drag="x"
   dragConstraints={{ left: -100, right: 100 }}
   whileHover={{ scale: 1.1 }}
   whileTap={{ scale: 0.9 }}
/>

This is the first time I saw other people give argument that support my idea. It means a lot to me.
Thanks for expressing my idea in detail.


test: Make Cypress tests resilient to changes in app texts

We are now resorting to fetching the texts from constants.ts instead of hardcoding the messages expected from the app.
Fixes #8389
Checklist:

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes

@rafaeelaudibert This is an awesome change! Thank you so much 🙏🏽
This will make our test suite a lot more resilient to text changes that happen often & improve the quality of our code as well.

/ok-to-test sha=6181d13

Test result: https://github.com/appsmithorg/appsmith/runs/4058552736

@mohanarpit Hmm, so that's the intention behind createMessage, thanks for clarifying it! How would we go about using it on Cypress, though? Should we just call the same createMessage function too?

Test result: https://github.com/appsmithorg/appsmith/runs/4058552736

Also, just pushed a commit to fix this :).

/ok-to-test sha=5e7be04

@mohanarpit Hmm, so that's the intention behind createMessage, thanks for clarifying it! How would we go about using it on Cypress, though? Should we just call the same createMessage function too?

Yes please. We can invoke the same function createMessage from the Cypress tests as well. That should work well.

Test result: https://github.com/appsmithorg/appsmith/actions/runs/1405572962

Reopening as this is important.
@rafaeelaudibert Could you please make the requested changes above?


use r.RemoteAddr as remote ip when the Query Variable 'addr' is unset

For improved compatibility with DD-WRT and the underlying itsadyn framework, I've made the following change: When the 'addr' query variable is no provided, the remote address (where the query originates from) is used as the address.

Hey thank you very much :-) Looks good! I'll test this in the next days and then merge it 👍

@vdweegen Could you please merge my develop branch into yours/rebase from it? Just to have basic CI integration. Thanks.

@dprandzioch Done! I hope this is a useful addition. I have been running in without problems for a couple of days now using DD-WRT v3.0.

Thanks for your contribution and the fast adoption of my changes! I will merge this now but as this has some code duplication from above, I added a remark to refactor this later on. Your change will be released with 1.3.0 as this is currently only on the develop branch. Still, you can use the :develop tag on DockerHub to get those changes already now. Build will be done in approx. 1h :)


Multinomial logistic regression

Implementation of multinomial logistic regression. Also added some tests. Still need to add docs and possibly refactor.

Codecov Report

Merging #159 (0cf4b44) into master (603f821) will increase coverage by 0.54%.
The diff coverage is 75.17%.

@@            Coverage Diff             @@
##           master     #159      +/-   ##
==========================================
+ Coverage   59.89%   60.43%   +0.54%
==========================================
  Files          84       84
  Lines        7749     7914     +165
==========================================
+ Hits         4641     4783     +142
- Misses       3108     3131      +23

Impacted Files
Coverage Δ

algorithms/linfa-logistic/src/float.rs
0.00% <0.00%> (ø)

algorithms/linfa-logistic/src/argmin_param.rs
47.05% <36.36%> (+25.63%)
:arrow_up:

algorithms/linfa-logistic/src/lib.rs
77.45% <77.32%> (+4.82%)
:arrow_up:

...rithms/linfa-trees/src/decision_trees/algorithm.rs
51.94% <0.00%> (-1.42%)
:arrow_down:

src/dataset/mod.rs
88.09% <0.00%> (ø)

algorithms/linfa-kernel/src/lib.rs
71.00% <0.00%> (ø)

algorithms/linfa-hierarchical/src/lib.rs
53.03% <0.00%> (ø)

algorithms/linfa-nn/src/balltree.rs
55.17% <0.00%> (+0.47%)
:arrow_up:

algorithms/linfa-trees/src/decision_trees/iter.rs
37.50% <0.00%> (+12.50%)
:arrow_up:

Continue to review full report at Codecov.

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

is this PR in draft mode intentionally or ready for review?

One observation I have of the multinomial implementation is that it tends to diverge when the input is not normalized well. Not sure if this is a natural property of the algorithm itself.

The unnormalized wine quality also diverges on scikit-learn. However, the algorithm actually terminates since it hits the max iteration limit. With this implementation the algorithm just gets stuck on the first iteration of the solver forever. This likely has something to do with the linear search library we're using.


Is it possible to have the default text as a available language?

Is it possible for the default text to be a language option?
Example span I have

Here is some content

If I want that to equal ENG is it possible to mark that as English so that if that is the users preferred language it doesn't do anything, or do I have to keep a seperate English translation file?
If it isn't could this become a feature request?

Note that I have done this by setting the preferred language to a language whos resource doesn't exist but this results in an error in the browser.
eg
       $translateProvider.preferredLanguage('XX-NO-LANG')
Is there another way to do it?

I don't get it right. Can you please explain more or prepare a demo?

If I understand @cdloh right, the question is the following. Consider this paragraph:

Here is some content

The text within the
 tag is in some language, English in this case. It is furthermore assumed that all texts that appear this way (i.e. that should be translatable) are in the same language throughout the entire application. By placing the translate directive onto the
 tag, angular-translate should essentially leave the text as it is as long as its current language is set to English. Otherwise, it should take the key some_translation_table_key, lookup the translation in the corresponding language table, and replace the text by its translation. The point is, that one has to tell angular-translate that the default language used by translatable texts appearing directly in HTML is xy (English in this case). The advantage of this approach is that one doesn't need a translation table for the default language since it is implicit in HTML.

Apologies that I wasn't clear but twwt is spot on in this case.
I got around this currently by having a English translation table that had no content / translations in it and disabling fallback so it essentially doesn't translate anything.

We don't have such a feature. Although it does make sense using the directive maybe, it opens new questions when using the filter or even the service.
You can implement a custom error handler which is configured for a specific languageId to return the actual requested translationId: https://angular-translate.github.io/docs/#/guide/17_custom-error-handler


Bug: Using a string containing . as a JSON key will cause an error in the JSON View Page

Envirorment:
online : https://jsonhero.io/j/cC6nC3Vgh4s4
Description
When I use a string containing ’.‘ as a JSON key, I get an error when I switch to the JSON view page.
{
  "a.b": "1"
}

And here is the error log.
TypeError: Cannot read properties of undefined (reading 'start')
    at https://jsonhero.io/build/routes/j/$id/editor-BQP7CIXM.js:1:1127
    at Gf (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:9:6560)
    at L.unstable_runWithPriority (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:1:4026)
    at rn (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:5:38448)
    at Xe (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:9:6029)
    at yi (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:7:10750)
    at https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:5:38670
    at L.unstable_runWithPriority (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:1:4026)
    at rn (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:5:38448)
    at Cs (https://jsonhero.io/build/_shared/chunk-PZ2Z7HGX.js:5:38616)

Hi, is it okay for me to work on this issue?

@Kit-p definitely, go for it!


Playing well with other libraries like Jackson for serialization

For modern web frameworks, JSON can be made automatically for return values from method invocation that are bound to HTTP-GET operations.  For example List<Person> can be turned into a list a people in JSON.
Strategies are needed for excluding the fields from the JSimpleDB generated subclass of Person though.  If the serialization tech is Jackson, there are a number of strategies but each is quite a bit of obscure code. Especially if the web-framework in question instantiates its own ObjectMapper.
Jackson allows @JsonIgnore to prefix any field that should not be serialized. Java is quite generous for annotations that are missing from the classpath at runtime so adding that to every @JsimpleDB generated field would work.
Alternatively (and best of all) making each @JsimpleDB generated field transient would work too. This one would work for Gson too.
Thoughts?

Of course for Person being a concrete (non-final) POJO to start with, a mechanism to turn the subclassed Person instances that JSimpleDB uses into vanilla Person objects would be great. Same for lists, etc.

A toVanilla() operation (for POJOs) may allow the getters to be used after the transaction is closed.  That toJSON() transformation of the web framework, and needs to call the getters.  I could also move the transaction start/stop to a before/after place for the web framework itself and leverage the threadlocal way of specifying that, but it might be nice to have the option.
'org.jsimpledb.core.StaleTransactionException: transaction cannot be accessed because it is no longer usable'

^ Using the getters after the close of the transaction would be nice. For that class of opertation - i.e. - yes I know the object is detached from storage and might already be out of date, and accept the risk of misuse later by a team mate that missed that subtlety.

I have a demo project for you: https://github.com/paul-hammant-fork/angular-jooby-starter
Jooby is like SpringBoot and SparkJava. It exceptionally well coded by @jknack - not static at all (unlike SparkJava - which I had previously forked and comprehensively reworked to be non-static) and none of the legacy feel of SpringBoot.
This demo app by @protubero needed a couple of improvements to the noob/setup experience see here, but at some point, it is just mvn clean install operation as usual.  It loads just fine into Intellj. I presume it does into eclipse too. Test run there too - both unit and integration. Note: not all operations have tests.
In App there is a (currently hard-coded) choice between the PersonStore that was made originally for the demo, and a second implementation. Specifically an attempt to have one using JSimpleDB (and Sqlite - me having given up on BerkelyDB for now).  One line commented out, and one commented in.  Here - https://github.com/paul-hammant-fork/angular-jooby-starter/blob/master/server/src/main/java/de/protubero/ajs/App.java#L82

So, JSimpleDB's internal fields setting transient on them (adding ASM's Opcodes.ACC_TRANSIENT to the visitField usagas for the JSimpleDB's own $ prefixed fields) isn't enough. Jackson still calls getters by default in order to get field values. And they're not allowed to be called if the transaction has been closed. Thus, there's an incantation for Jackson like so:
objectMapper.disable(MapperFeature.AUTO_DETECT_GETTERS);
objectMapper.disable(MapperFeature.AUTO_DETECT_IS_GETTERS);
objectMapper.enable(MapperFeature.AUTO_DETECT_FIELDS);

But that doesn't work either because it's picking out null for the field values, even if it is no longer throwing exceptions.  Possibly it's looking at the fields on the concrete Person rather than the fields on the JSimpleDB generated subclass of Person.

The fields that JSimpleDB generates are for caching those values which happen to have already been read. They are not appropriate for general purpose POJO type storage or data access.
I think the only sensible way to use JSimpleDB objects with Jackson (or any other serialization framework) is to:

Let Jackson access values using getters and setters (not fields)
Set things up so when Jackson runs, either:

There is an open/live transaction; or
The objects are snapshot objects, and you copy them in/out of a real transaction at the appropriate time

I've done something similar before with JSimpleDB and JAXB. It was fairly straightforward to parse XML and have it create a "tree" of JSimpleDB database objects as a result of the parse.
The model classes tend to look like this:
@JSimpleClass
@XmlRootElement(name = "foobar")
@XmlType(factoryMethod = "create")
public abstract class Foobar implements JObject {

    @XmlJavaTypeAdapter(CDATAAdapter.class)
    public abstract String getHtmlBlob();
    public abstract void setHtmlBlob(String x);

    @JListField(element = @JField(cascadeDelete = true))
    @XmlElementWrapper(name = "Flurbers")
    @XmlElement(name = "flurber")
    public abstract List<Flurber> getFlurbers();

    public static Foobar create() {
        return JTransaction.getCurrent().create(Foobar.class);
    }
}

POJOs supported now :)


Upgrade all Kubernetes dependencies

What would you like to be added:
Upgrade all Kubernetes dependencies to version 1.24 including controller-runtime to version 0.12.
I had a look at this, but it seems like a complex task that require more experience with the code-base than I currently have. There has been a lot of changes in envtest that require the bootstrapping of the envtest clusters to be rewritten.
CC: @kensipe @iblancasa
Why is this needed:
Scanning kuttl with a vulnerability scanner like Trivy, shows that we have quite a few vulnerabilities in our dependency tree. I had a look at this, and to me it seems like most of them are rooted in the fact that we depend on old Kubernetes dependencies versions that are not maintained anymore (EOL).
We currently depend on K8s 1.20, and I also think it is about time to upgrade this. K8s 1.20 is long passed EOL, and with the upcoming K8s 1.25 some APIs are removed - which are still used in kuttl.

Is there anything pending about this issue?

@iblancasa Thanks a million for your great work in bumping dependencies! This looks great now! I just scanned current main branch with trivy:
D:~/projects/github/kuttl $ trivy filesystem .
2022-09-08T21:22:44.530+0200    INFO    Need to update DB
2022-09-08T21:22:44.530+0200    INFO    DB Repository: artifactory.statnett.no/ghcr-docker-remote/aquasecurity/trivy-db
2022-09-08T21:22:44.530+0200    INFO    Downloading DB...
33.83 MiB / 33.83 MiB [------------------------------------------------------------------------------------------------------------------------------------] 100.00% 968.38 KiB p/s 36s
2022-09-08T21:23:20.681+0200    INFO    Vulnerability scanning is enabled
2022-09-08T21:23:20.681+0200    INFO    Secret scanning is enabled
2022-09-08T21:23:20.681+0200    INFO    If your scanning is slow, please try '--security-checks vuln' to disable secret scanning
2022-09-08T21:23:20.681+0200    INFO    Please see also https://aquasecurity.github.io/trivy/v0.31.3/docs/secret/scanning/#recommendation for faster secret detection
2022-09-08T21:23:20.735+0200    INFO    Number of language-specific files: 1
2022-09-08T21:23:20.735+0200    INFO    Detecting gomod vulnerabilities...
D:~/projects/github/kuttl $

Closing issue as resolved by https://github.com/kudobuilder/kuttl/pull/375.

thanks @erikgb and @iblancasa  great to see


Add build for gssapi 1.7.0

Ugh wtf what takes it so long to install kerberos :roll_eyes:

Wtf it's still not done after TWO hours?

Thanks, I'll drop build for many:penguin: then