Support non-tunnelled https proxying

CONNECT is nice and all, but terrible for caching -- the world has happily become much more secure! Turns out Squid supports proxying "METHOD https://... HTTP/1.1" requests out-of-the-box, if only a user agent can send them. Yes, you obviously need to do all the SSL verification at the proxy layer, but for a trusted proxy this isn't hard or unreasonable. The alternative this is pseudo-MITM by the proxy which can be done (see squid ssl_bump) but is quite terrible.
PR applies cleanly to 1.7.1 as that's Ubuntu LTS's pinned version -- I don't know if it's still compatible with master.

This looks plausible. However, it definitely doesn't merge cleanly: can you rebase onto the current tip?
I have some mixed feelings about this, but for urllib3 I think it's ok. In requests enabling this would be absurdly footgunny, so I'll have to think really hard about whether we use it. urllib3 is sufficiently explicit about it that I think it's fine.
We'll also need to write up some docs for this feature.

Well, the problem is that the proxy connection is HTTP so you cannot trust the proxy! A rogue proxy could intercept all your data and you won't notice.
If you want caching at proxy level you need to configure your proxy as MITM with a custom cert. In this case you are able to detect a rogue proxy because your custom cert doesn't validate.


adding functionality for OnDraggingMarker

Hi all,
I just add to my app the OnMarkerDragListener for android, it could be nice to add to your plugin
this is what I did for android
gMap.setOnMarkerDragListener(new com.google.android.gms.maps.GoogleMap.OnMarkerDragListener({
    onMarkerDrag: function(gmsMarker) {
      return this;
    },
    onMarkerDragEnd: function(gmsMarker) {
      callback(gmsMarker);
      return this;
    },
    onMarkerDragStart: function(gmsMarker) {
      return this;
    }
  }));

Now the thing is that I also want to implement this listener to IOS but I could figure out how to do that, I have been read and found how to make the instance of GMSMapViewDelegate:
  var MyMapViewDelegate = NSObject.extend({
    didEndDraggingMarker: function(map, marker, event) {
      console.log("did drag marker with event");
    }
  }, {
    protocols: [GMSMapViewDelegate]
  });

  var mapViewDelegate = MyMapViewDelegate.alloc().init();
  gMap.delegate = mapViewDelegate;

The listener is not working with this code, could you give a hand with this. Also once listener for IOS is working we could add to the list of support events such as markerSelect  or cameraChanged

Hey @jaimeglez - drag events should be good to go


Totals idea ?

What do you think about creating some totals/average emotions page ?
For an instance - month:

It is about the average calculation, not design )))

heh heh nice idea. [I was thinking of graphs #5] but this is interesting.

oh ) sorry )


Remove Chris Patuzzo who is no longer at GDS

Superseded by https://github.com/alphagov/govuk-puppet/pull/7519. Sad to see you go @tuzz!


Question about Jinja2 in Surveys

Hey,
i´m trying to use jinja2 templating inside the survey.
Could someone please explain me, how to use this correctly?
I have added {{ instance.name }} as the default variable. In this case for my requested hostname.
But this jinja2 won´t be evaluated and hostname is empty in Review View as an Admin.
Thanks for this awesome tool!

Sorry for the delay. It may be a bug. We are going to take a look.
It's a day 2 operation?
Because of course on creation the instance name is not there yet.

Just tested on my side it's ok.


Add an example to show map vs flatMap

This might help people like me who wants to see a code example :)

Coverage remained the same at 96.111% when pulling 06821b6966c6353cd57650abb5843c00689eadda on element6:master into b196e2d47754fa3f5e7efaeb7f47399e9e76ce88 on rtfeldman:master.

@element6 looks like a good addition! Maybe you could tweak it a bit to look like to other examples so it blends in? Like showing the results in comments and renaming the array a to array and the value a to value? It could be confusing that two different things are named a.

Good idea! I guess it also makes it easier for people to copy and paste into their console to test.

@element6 thanks!


Document object detector augmentations

What does this PR do?

Fixes #488
Before submitting

[x] Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
[x] Did you read the contributor guideline, Pull Request section?
[x] Did you make sure your PR does only one thing, instead of bundling different changes together?
[x] Did you make sure to update the documentation with your changes?
[ ] Did you write any new necessary tests? [not needed for typos/docs]
[ ] Did you verify new and existing tests pass locally with your changes?
[ ] If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

[x] Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃

Awesome! LGTM smiley

Hi @ethanwharris ! I also added a couple of lines of documentation in object_detector. Think automatic documentation could improved simply by documenting the code more! :)


Add flag to skip adding an import statement in auto-generated Swift files (#168)

This is a PR for issue #168

Since Apollo on iOS is generally installed with Cocoapods, apollo-codegen defaults to having an import Apollo on top of the auto-generated API.swift file. This is an enhancement request to allow the option to not have this import statement for projects that use other ways of including Apollo (e.g. with submodules).
For example, having such a flag like:
generate $(find . -name '*.graphql') --schema schema.json --output API.swift --skip-swift-import-statement true
would output
//  This file was automatically generated and should not be edited.

public final class MyClassQuery: GraphQLQuery {
  public static let operationString = ...

instead of
//  This file was automatically generated and should not be edited.

import Apollo

public final class MyClassQuery: GraphQLQuery {
  public static let operationString = ...

Hmmm, the use of import Apollo isn't specific to CocoaPods, but is also required if you install the Apollo framework through Carthage or manually copy the framework into your project (both of which could also use submodules).
The only situation where you wouldn't use import Apollo is if you copied the files directly into your project and compiled them into the main module. If that is what you're doing, I would really recommend against that. Is there any particular reason you feel you need to avoid a separate Apollo module?

Thank you for your reply! Currently the way Apollo is integrated in our project is that it is added as a submodule, and then the files in the Sources folder is added manually to the project. This is because if I add the project or the workspace, the code-signing doesn't play well with the current project structure (it says "Team: Unknown Name (5TL2....)) and it no longer builds for device.

It seems to me that we should fix the codesigning issue then, instead of modifying the codegen output. You really don't want third party dependencies compiled in, and there are also more parts of the code that rely on it being in an Apollo module.
What do you mean by 'the code-signing doesn't play well with the current project structure'? How are you adding the Apollo framework to the project? Does it work with other third party frameworks?

I see - I've updated my project to add Apollo as a subproject - I'll make the pull request for code-signing on the apollo-ios repository and close this one. By 'code-signing not playing well', we would often run into problems where subproject don't seem to be code signed correctly by Xcode (i.e. it archives into a generic archive rather than an iOS one). Thanks!


druid:fy040rv4004 missing metadata needed for DOI update

The author name (Polyakova, Maria) was inadvertently deleted from this submission before the collection manager approved it for deposit. Now the work is stuck in H2 with this error message showing in Argo:
"Error: update-doi : Conflict (Item requested a DOI be updated, but it doesn't meet all the preconditions. Datacite requires that this object have creators and a datacite extension with resourceTypeGeneral)"
https://argo.stanford.edu/view/druid:fy040rv4004

The H2 work number is 7094

Step errored out:

I just set that step to complete manually in argo and re-indexed the item, and it now has a deposited state in H2.
Separately we need to sort out why that failed, what we can possibly do about it, and then trigger that step's action again manually.  If the investigation reveals there is a metadata/mapping mismatch issue (i.e. datacite's requirements are stricter than ours) we may just need to skip in some cases without erroring.

Code path:

Common-accessioning robot update-doi makes a dor-services-client gem call.
Dor-services-client calls dor-services-app update_doi_metadata endpoint
This endpoint checks if the object can be mapped and discovers it cannot, throwing the error, which makes it's way back up to the robot and puts it in an error state.

We need two things to map the metadata for datacite:

resource type general listed
at least one "creator" contributor

This object satisfies 1 but not 2.
On DSA rails console:
@cocina_object = CocinaObjectStore.find('druid:fy040rv4004')
attributes = Cocina::ToDatacite::Attributes.new(@cocina_object)
 attributes.exportable?
==> false

attributes.send(:types_attributes)&.fetch(:resourceTypeGeneral).present?
=> true # GOOD!

attributes.send(:creators).present?
 => false # BAD!

# Look at the all the contributors
attributes.send(:creator_contributor_funder_attributes)
 =>
{:creators=>[],
 :contributors=>
  [{:name=>"Polyakova, Maria", :givenName=>"Maria", :familyName=>"Polyakova", :nameType=>"Personal", :contributorType=>"Other"},
   {:name=>"Rosston, Greg", :givenName=>"Greg", :familyName=>"Rosston", :nameType=>"Personal", :contributorType=>"Other"},
   {:name=>"Stanford University", :nameType=>"Organizational", :contributorType=>"Other"},
   {:name=>"Public Policy", :nameType=>"Organizational", :contributorType=>"Other"}],
 :fundingReferences=>[]}

If you dig in to the class that fetches the creators above: [app/services/cocina/to_datacite/creator_contributor_funder.rb
](https://github.com/sul-dlss/dor-services-app/blob/main/app/services/cocina/to_datacite/creator_contributor_funder.rb
it looks like maybe the logic there is either not correctly dealing with the contributor types we have for this H2 record or we need at least one "author" or "creator" role type?  The two person contributors both have a role of "advisor" in the Cocina for this object (and also as seen in H2): https://sdr.stanford.edu/works/7094

Something in this class is deciding we have no creators in the metadata.  Trying to understand the Escher like logic:
contrib =<EMAIL_ADDRESS>contrib.send(:cocina_creators)
 => []
contrib.send(:datacite_creators)
 => []

Ahh, I think it is because the only "person" type contributors we have in this object are "advisor", which appears to set a note of "citation status" to "false" in cocina.  And anything with citation status set to "false" is not counted as a creator for the purposes of mapping to data-cite.  So this object is not considered to have any creators, and is thus not mapped to data-cite.

So we have a few options:

Change how we map to data-cite to add some more logic to the already tangled web to deal with a situation like this (if it really needs to be dealt with).
Force the user to go back and change their contributor types in H2.  This adds some wrinkles (the object is now stuck and requires some remediation to allow editing again in H2).
Do nothing with the logic but change how we handle this case so that instead of throwing an error in DSA, it simply alerts HB (as an FYI) and then returns a 200, allowing accessioning to proceed with mapping to datacite.  Result: object is not mapped to datacite but does not error.

Unless Arcadia thinks we should change the mapping, to me 3 seems like a better solution than 2.

Do we validate that the DataCite metadata is complete on the H2 form itself when an object is to be assigned a DOI? It seems like this shouldn't have been submit-able without the required metadata.

I am fairly confident we do not validate the contributors entered in H2 to ensure there is at least one mappable contributor that has a citation-status of true (e.g. ensure that all entered contributors are not something like "advisor").  But yes, that would be another approach (presuming there isn't a valid reason for a depositor to do this).

It looks to me like this item failed because the advisors are listed in the section of contributors not to be included in the citation. And it seems completely right to me that we should not be mapping those to DataCite.
However, I don't think we can require an entry in the "authors included in the citation" section all the time, largely to do staff workflows. But considering the staff use cases without an author will never (or almost never) overlap with the need for a DOI, I do think it's appropriate that we require an "author included in the citation" every time we issue a DOI.
Because Hannah added the author back to this particular deposit, it now has a functional DOI, so there is nothing further that needs to be done for this item.
I am going to close this ticket and open another one to request that we 1) require an author when creating a DOI, 2) notify an admin that this has happened so we can check with the depositor about whether they want to make a change so they can get a DOI, and 3) make sure that not creating a DOI when a DOI has been requested doesn't break the UI somehow (e.g. will not being able to display a DOI in that field on the item view page when it thinks there should be one keep the page from loading? we might want to sub in another message like "DOI could not be generated" or something in that case).

Note: i did verify this object has a DOI.  Was it created in the v1 before this error originally occurred.

This object was deposited initially on Sep 7 and updated to add the missing author on Sep. 12:
2 (2.0.0) adding author which was missing
| Opened | 2023-09-12 00:37:51 UTC
  | Submitted | 2023-09-12 00:37:51 UTC
  | Described | 2023-09-12 00:37:51 UTC
  | Published | 2023-09-12 00:37:53 UTC
  | Deposited | 2023-09-12 00:37:58 UTC
  | Accessioned | 2023-09-12 00:37:59 UTC
The DOI was created at the same time the author was added: September 12, 2023 at 24:37:54 UTC.


Shooting is inaccurate

Shooting is not very accurate with all weapons (including bow)
This is probably because the projectile is shooting from the weapon object position, with no relation to the camera view center/crosshair.
Slight movement of the avatar (like the avatar panning left and right when standing) also worsens the accuracy.

duplicate of https://github.com/webaverse/app/issues/2423


Some code cannot be found in Next.js

I was searching for import { Metadata in the Next.js codebase (canary branch) but FindItFaster shows 0 results.
Here is a capture of the code in case if someone wants to debug.
https://github.com/alfawal/next.js/tree/capture-for-finditfaster
Screenshot:

well i face the issue too

not only next js, find "import { ..." statment is also not work in js/ts project (me use express ts)


Zimop/Zcmop - temporary non-official documentation

This is not the official specification for these extensions.
Zimop:
The Zimop extension introduces the concept of instructions that may be operations (MOPs).  MOPs are initially defined to perform no useful operation and raise no exceptions, but might be redefined by later extensions to perform some other action.  The Zimop extension defines an encoding space for 40 MOPs.
NOTE: It is sometimes desirable to define instruction-set extensions whose instructions do not raise illegal-instruction exceptions when the extension is not implemented.  For example, programs with control-flow integrity checks can execute correctly on implementations without the corresponding extension, provided the checks are simply ignored.  Implementing these checks as MOPs allows the same programs to run on implementations with or without the corresponding extension.
NOTE: Although similar in some respects to HINTs, most MOPs cannot be encoded as HINTs, because MOPs might sometimes alter architectural state, which HINTs are forbidden from doing.
The Zimop extension defines 32 MOP instructions named mop.r.0 -- mop.r.31.  Unless redefined by another extension, these instructions simply write 0 to x[rd].  Their encoding allows future extensions to define them to read x[rs1], as well as write x[rd].  They are encoded as 1-00--0111--sssss100ddddd1110011, where - denotes an available opcode bit, s denotes the rs1 field, and d denotes the rd field.
The Zimop extension additionally defines 8 MOP instructions named mop.rr.0 -- mop.rr.7.  Unless redefined by another extension, these instructions simply write 0 to x[rd].  Their encoding allows future extensions to define them to read x[rs1] and x[rs2], as well as write x[rd].  They are encoded as 1-00--1tttttsssss100ddddd1110011, where t denotes the rs2 field.
NOTE: These MOPs are encoded in the SYSTEM major opcode in part because it is expected their behavior will be modulated by privileged CSR state.
NOTE: These MOPs are defined to write x[rd], rather than performing no operation, to simplify instruction decoding and to allow testing the presence of features by branching on the zeroness of the result.
The MOPs defined in the Zimop extension are not guaranteed to carry a syntactic dependency from source to destination.
NOTE: Not carrying a syntactic dependence relieves straightforward implementations of reading x[rs1] and x[rs2].
Zcmop
Eight code points in the 16-bit encoding space are provided for MOPs:
c.mop.0, encoded in the reserved encoding space where c.lui x1, 0 would be encoded
c.mop.1 (c.lui x3, 0)
c.mop.2 (c.lui x5, 0)
...
c.mop.7 (c.lui x15, 0)
These instructions are defined to not write rd.  As with other MOPs, which registers they read is left up to the future definition of the op, but this encoding makes it convenient for these instructions to read x1, x3, ..., x15. Although we generally expect these MOPs to be equivalent to some 32-bit MOP, the expansion (if any) is left to the future definition of the op.

Official documentation posted here:
https://github.com/riscv/riscv-isa-manual/commit/2463e2a99137533ad59d179e32ed4c937d1b01ec#r127510317

Looking for help from someone in the TG conversant with binutils to provide an update to binutils for Zimop/Zcmop; including how we would have binutils comprehend a subset of codepoints being used later for Zicfiss and thus have a different mnemonic.

Looking for help from someone in the TG conversant with binutils to provide an update to binutils for Zimop/Zcmop; including how we would have binutils comprehend a subset of codepoints being used later for Zicfiss and thus have a different mnemonic.

Yeah, I think that's can be implemented as alias in binutils, there is  an example in F extension:

csrr a0, fcsr dissemble to frcsr a0 if F ext. is present.
csrr a0, fcsr dissemble to csrr a0, fcsr if F ext. is not present.
Assembler accept frcsr a0 only if F ext. is present.
Assembler accept csrr a0, fcsr if Zicsr or F ext. is present.

So, applying this kind of pattern to Zimop (the instruction mapping may not correct, but it should doesn't matter to demo this concept):

mop.r.0 dissemble to sspush x1 if Zicfiss ext. is present.
mop.r.0 dissemble to mop.r.0 if Zicfiss ext. is not present.
Assembler accept sspush x1 only if Zicfiss ext. is present.
Assembler accept mop.r.0 if Zicfiss or Zimop ext. is present.

Thanks. That makes sense. So for now the binutil update can be just to add mop.r, mop.rr, and c.mop and when we introduce the Zicfiss, some of these can be updated to have aliases.

FYI, here's a very rough binutils patch. It's my first ever binutils patch, so may have obvious errors, and I suspect it's not looking at ISA dependencies correctly (ie, making sure Zcmop requires C). That said, I can assemble and objdump with it.

Thank you @adlr ! Much appreciate!
Closing this issue since official documentation is now available and will provide a reference from the specification to the official documentation.


EVEREST-358 Disable list commands for now

CHANGE DESCRIPTION
Problem:
EVEREST-358
Short explanation of the problem.
Related pull requests

[link]

Cause:
Short explanation of the root cause of the issue if applicable.
Solution:
Short explanation of the solution we are providing with this PR.
CHECKLIST
Jira

[ ] Is the Jira ticket created and referenced properly?

Tests

[ ] Is an Integration test/test case added for the new feature/change?
[ ] Are unit tests added where appropriate?

Codecov Report

Merging #165 (ac3bfb8) into main (419a56d) will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##            main    #165   +/-   ##
=====================================
  Coverage   5.10%   5.10%
=====================================
  Files         12      12
  Lines       2802    2802
=====================================
  Hits         143     143
  Misses      2635    2635
  Partials      24      24

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

@oksana-grishchenko The main goal from the product standpoint for the CLI is the provisioning/unprovisioning of Everest.
Currently, there's no way of getting kubernetes-id using CLI because the end user needs to call http://everest-backend:8080/v1/kubernetes to get it. Also, @recharte wanted to discuss the UX of the CLI at the nearest triad weekly and I assume we will revisit the list command.
Right now, the list command returns only versions and database engines which IMO does not provide any value for the user in comparison to the UI.
Another point that to fix it completely we need to add filtration by cluster name for list kubernetes endpoint to provide the end user an ability to use cluster name as an identifier to list different resources


Tenant col add

Added column for tenant (customer id) in stack table.
BUILD SUCCESSFUL in 42s 348 actionable tasks: 15 executed, 333 up-to-date
@keyki @lacikaaa @handavid

Hi @abhishekaypurohit
I've reverted the commits. We agreed on calling it accountid rather than tenant.


[Bug] Uploading Terms of Use on Edit Application Page Generates Error

Hi, currently when I try to upload terms of use on edit application page (https://demo.casdoor.com/applications/casbin/app-example), it generates the following error.

I suspect it is because of trying to find application based on parent parameter https://github.com/casdoor/casdoor/blob/master/controllers/resource.go#L238, when the parent parameter value is ApplicationEditPage in the page.
Thank you

hi, @xanxiver could you pls upload your terms of use file or you can contact me with email, i need it to handle this issue, thx.

@xanxiver fixed by: https://github.com/casdoor/casdoor/commit/e360b06d12bc8ae2d451d7b956e480947350a627


Support for overriding base branch names

Support overriding base branch name (Follow up to https://github.com/gruntwork-io/git-xargs/issues/22)

Description
Since our git workflow uses multiple branches of the same repository in some places, I thought it would make sense to support an optional argument for overriding the base branch name globally (might be an addition to #22).
Documentation

README
--base-branch-name=<xxx>

TODOs
Please ensure all of these TODOs are completed before asking for a review.

[x] Ensure the branch is named correctly with the issue number. e.g: feature/new-vpc-endpoints-955 or bug/missing-count-param-434.
[x] Update the docs.
[x] Keep the changes backward compatible where possible.
[ ] Run the pre-commit checks successfully.
[ ] Run the relevant tests successfully.

Related Issues
#22

Thanks so much for your contribution, @nirnanaaa! I'll take a look at this shortly.

The implementation mostly looks good to me! I added some code necessary for allowing the parsing of the new --base-branch-name flag.
In local testing, I found one issue that I'll need to fix prior to us merging this in: namely the behavior where we key off an HTTP 422 status code from Github whenever a pull request fails to be opened.
Currently, we're using this return code to determine when someone has requested a draft pull request via the --draft flag on a repo that does not support drafts. However, Github's API also returns a 429 when the base branch target is invalid - meaning the user specifies a base branch that does not exist.
Before we can merge this, I'll need to add logic to determine which type of HTTP 429 error we received: a) the error relating to draft pull requests or b) the error relating to the base branch name provided by the user being invalid.

The implementation mostly looks good to me! I added some code necessary for allowing the parsing of the new --base-branch-name flag.
In local testing, I found one issue that I'll need to fix prior to us merging this in: namely the behavior where we key off an HTTP 422 status code from Github whenever a pull request fails to be opened.
Currently, we're using this return code to determine when someone has requested a draft pull request via the --draft flag on a repo that does not support drafts. However, Github's API also returns a 429 when the base branch target is invalid - meaning the user specifies a base branch that does not exist.
Before we can merge this, I'll need to add logic to determine which type of HTTP 429 error we received: a) the error relating to draft pull requests or b) the error relating to the base branch name provided by the user being invalid.

Alright - did this in 1adbd58. Kicking off tests now and then will look for someone who's not me to review!


Instruction function name mapping for Python Customized deviceShifu

What this PR does / why we need it:
Will this PR make the community happier?
Solved Unable to use customize deviceshifu #338
Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #
How is this PR tested

[ ] unit test
[ ] e2e test
[ ] other (please specify)

Special notes for your reviewer:
Release note:

@Twpeak this PR has too much commits and the change seems not correct, can we close this and init another one that have the clean changes?


[SPARK-24829][STS]In Spark Thrift Server, CAST AS FLOAT inconsistent with spark-shell or spark-sql

What changes were proposed in this pull request?
SELECT CAST('4.56' AS FLOAT)
the result is 4.559999942779541

it should be 4.56 as same as in spark-shell or spark-sql.

How was this patch tested?
add unit tests

Can one of the admins verify this patch?

Can one of the admins verify this patch?

yes, only in STS, i will update the title

@cloud-fan @gatorsmile this change seems reasonable to me. Do you think we can trigger a build? Thanks.

@zuotingbing I think what @dongjoon-hyun was suggesting you was to put [STS] instead of [SQL] in the title of the PR. May you please update accordingly? Thanks.

@mgaido91 yes , update it. Thanks.

ok to test

Test build #93383 has started for PR 21789 at commit ffcff14.

@HyukjinKwon i am not sure what is the reason about the tests failed.  i checked the unit-tests.log and it seems the  test "SPARK-24829 Checks cast as float" , which i added, have finished with no error. Could you give a help to check it please or tell me how to fix the  failure? Thanks。

retest this please

Test build #93438 has started for PR 21789 at commit ffcff14.

Test build #93438 has finished for PR 21789 at commit ffcff14.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

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

Merged build finished. Test FAILed.

retest this please

retest this please

retest this please

ok to test

Test build #93442 has started for PR 21789 at commit 05cbdc8.

Test build #93440 has started for PR 21789 at commit 05cbdc8.

Test build #93442 has finished for PR 21789 at commit 05cbdc8.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

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

Test build #93440 has finished for PR 21789 at commit 05cbdc8.

This patch fails Spark unit tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

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

@gatorsmile org.apache.spark.sql.hive.thriftserver.UISeleniumSuite.(It is not a test it is a sbt.testing.SuiteSelector) , Could you give a help to check it please? i find you are the latest person who update the UISeleniumSuite class , Thanks.

I think you better take a look for it because that looks related with the current change.

Test build #93482 has started for PR 21789 at commit 88dff75.

Test build #93482 has finished for PR 21789 at commit 88dff75.

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

Merged build finished. Test PASSed.

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

LGTM, I checked and the same hack is done also in Hive.

@HyukjinKwon could you help to merge this to master branch? Thanks.

Let me leave this open for few days in case some reviewers have more comments on this.


Render simple components

Render a presentational component, like the <Alert />. Check if sub components are correctly setup by the PropsContext.

Works as expected.


WMTS Time demo has lots of 400 Bad Request errors

Run https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html?src=Web Map Tile Service with Time.html&label=Showcases and open the debugger and you'll see a lot of 400 Bad Request errors.  Going to one of the bad urls directly results in:
<ExceptionReport xmlns="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd" version="1.1.0" xml:lang="en">
<Exception exceptionCode="TileOutOfRange" locator="TILEROW">
<ExceptionText>TILEROW is out of range, maximum value is 2</ExceptionText>
</Exception>
</ExceptionReport>

@tfili any ideas?  This happens without the new Resource stuff.

Came up on the forum: https://groups.google.com/forum/#!topic/cesium-dev/CXGf6M0FzMo

This is still a problem as of CesiumJS 1.66, no tiles get loaded in the WMTS demo.

I think the URL has since changed, which is why it currently isn't working: https://github.com/AnalyticalGraphicsInc/cesium/issues/8310
And this is fixed in this PR: https://github.com/AnalyticalGraphicsInc/cesium/pull/8352


Old version of heketi-cli causing issues.

https://github.com/heketi/heketi/releases has a new release of 5.0.0 about 45 days ago, lines up with about when I started putting in work-arounds.
Found out with kind help from the heketi folks @ https://github.com/heketi/heketi/issues/880#issuecomment-341753028
Likely offending lines: https://github.com/redhat-nfvpe/kube-centos-ansible/blob/master/roles/glusterfs-kube-config/tasks/main.yml#L59-L62
...worth a test and update.

As explained in the heketi issue, the fact that the old client leads to these bad results is actually a but in the master branch of heketi, in the server code. We will fix this. But generally, it may be a good idea to align the cli versions downloaded with the heketi docker images. I.e. if you use heketi:dev, it would be best to use a master-build... Only that best I know we don't have nightly master builds.... So either build heketi-cli yourself or wait for the fix in heketi master. Sorry :-(

Thanks for helping flesh out this issue / adding these details, I did later read in your comments that it might take bringing the heketi-cli up to master -- might consider building it myself, too.
Note to future self: maybe add option to either build from latest, or bring down a version pinned tar ball.


Subject Info YAML proposals

@emosb Here are some proposals for YAML structure from our meeting today
I think we reached agreement that you should send one initial file with all subject info for the functionality connectivity project, then for current projects have multiple files, one for each day of experiments (exactly like your current logbook but more specifically structured)
a)
1:  # This is the global 'subject_id', or perhaps a 'relative' one per day; as in, first subject of the day = 1
  age_in_days: 5
  ...
  date_of_birth: 5/31/2024

This has the advantage that the subject ID is mapped in a dictionary for easy look-up; e.g., if I load in the YAML content in Python to a variable named subject_info I can do subject_info[1] and it will give me all the information related to subject with ID equal to 1
b)
1:  # This is the global 'subject_id', or perhaps a 'relative' one per day; as in, first subject of the day = 1
  subject_id: 1
  age_in_days: 5
  ...
  date_of_birth: 5/31/2024

This is the same as (a) except the subject_id is also included in the 'info' of that subject
This has the advantage that the value of 1 is explicitly seen to be the subject_id (in case there was any question about that)
But it has the disadvantage that both fields could get 'out of sync' with each other, such as a non-sensical entry
123:  # This is the global 'subject_id', or perhaps a 'relative' one per day; as in, first subject of the day = 1
  subject_id: 456
  age_in_days: 5
  ...
  date_of_birth: 5/31/2024

c)
- subject_id: 1
  age_in_days: 5
  ...
  date_of_birth: 5/31/2024

This is the one proposed from our meeting; it is the 'simplest' since it is just a container (specifically a list), but has slight disadvantage in that if anyone wants to do a lookup of a specific subject, they would have to iterate over each entry of the list and have a logical condition for the subject_id field being the particular value they are looking for
But all information would be kept bundled together as a single dictionary and a single entry in the list
I maybe have a slight personal preference for (b), but which one to choose comes down to what you personally would prefer since you are the one working with it the most
And let me know if you have any other ideas for alternate structures

I agree that (b) is preferable, and I like the idea of having at least one redundant field as a check for this project, especially since this is being done by hand.
As it applies to current projects, I like the idea of iterating starting from 0 (or 1 depending on indexing preference) per each day/session (e.g. first recording of the day is 1, second of the day is 2, etc.). Once the list of recordings to include is finalized, an overall yaml file like this one could be generated, where the global subject # indicates the project-specific ids, and the subject_id info field is the internal tag. Then this info field would act as a double-check that we are pointing to the right pumpprobe folder (the ith folder from the given date). Again in this case the subject_id info field is not useful to anyone outside the lab, but it might allow a lab member to locate and verify a subject's data more quickly.

It is decided - (b) it is then!
Once the file is done on your end, just send it off my way and I'll start incorporating it into the conversion


misc useMobile

What does this PR do and why?
Provide a description of what this PR does. Link to any relevant GitHub issues, Notion tasks or Discord discussions.
Screenshots or screen recordings
If applicable, provide screenshots or screen recordings to demonstrate the changes.
Acceptance checklist

[ ] I have evaluated the Approval Guidelines for this PR.
[ ] I have tested this PR in all supported browsers.
[ ] I have tested this PR in dark mode and light mode (if applicable).

Current dependencies on/for this PR:

main

PR #3184

PR #3185

PR #3186

PR #3187   👈

This comment was auto-generated by Graphite.


Create a regrid_like method for every package.

In GitLab by @luitjansl on May 15, 2023, 15:15
General Description
Create a regrid_like method which does the following:
Regrid the package to a target grid.
Migrate useful regridding functionality in the `imod/formats/prj/disv_converter.pyto Package object, under method nameregrid_like``. See: https://gitlab.com/deltares/imod/imod-python/-/blob/master/imod/formats/prj/disv_conversion.py#L45
This is now under a cached regridder (which saves weights and checks if no weights should be recomputed). This however is quite complex, and probably suffering from apriori-optimization. So first simplify that.
Scope
We focus on providing functionality required for existing regional models, these contain:

No lake package
No solute transport
Do contain: RIV, DRN, WEL, HFB, NPF, DIS(V), STO, GHB, CHD, IC, RCH

Acceptance Criteria

Call something like pkg.regrid_like(target_grid) which regrids a package to a new grid
Xugrid's regridder is being used.
Each variable requires a different regridding option, these are all supplied in xugrid, but the right one should be selected based on variable name.
Provide good default regridding methods for each variable in each package
Allow user to specify different methods.
Throw error if method doesn't exist in xugrid.
Throw warnings for dodgy regridding actions: For example, upscaling a CHD or WEL package. (Have to be further defined)

In GitLab by @JoerivanEngelen on May 15, 2023, 17:25
marked this issue as blocking #362

In GitLab by @JoerivanEngelen on May 15, 2023, 15:42
General Description
Create a regrid_like method which does the following:
Regrid the package to a target grid.
Migrate useful regridding functionality in the `imod/formats/prj/disv_converter.pyto Package object, under method nameregrid_like``. See: https://gitlab.com/deltares/imod/imod-python/-/blob/master/imod/formats/prj/disv_conversion.py#L45
This is now under a cached regridder (which saves weights and checks if no weights should be recomputed). This however is quite complex, and probably suffering from apriori-optimization. So first simplify that.
Scope
We focus on providing functionality required for existing regional models, these contain:

No lake package
No solute transport
Do contain: RIV, DRN, WEL, HFB, NPF, DIS(V), STO, GHB, CHD

Acceptance Criteria

Call something like pkg.regrid_like(target_grid) which regrids a package to a new grid
Xugrid's regridder is being used.
Each variable requires a different regridding option, these are all supplied in xugrid, but the right one should be selected based on variable name.
Provide good default regridding methods for each variable in each package
Allow user to specify different methods.
Throw error if method doesn't exist in xugrid.
Throw warnings for dodgy regridding actions: For example, upscaling a CHD or WEL package. (Have to be further defined)

In GitLab by @luitjansl on May 16, 2023, 11:58
added #370 as child task


fix: :bug: Changed method name from fields_get_keys() to fields_get()

It was outdated, at least not working on current v17 of odoo. Hence the change based on Odoo docs.

Thank you for your contribution. I'm no longer working with Odoo, so I'll merge this to benefit others. If you're interested in becoming a maintainer for this project, please let me know. Currently, my focus is elsewhere, so your assistance would be greatly appreciated.

Thank you for your contribution. I'm no longer working with Odoo, so I'll merge this to benefit others. If you're interested in becoming a maintainer for this project, please let me know. Currently, my focus is elsewhere, so your assistance would be greatly appreciated.

Hey there, why not. We're using it and modifying it at the company I'm working at. We'd be glad to share the upgrades with the community I'm sure.


onRequest hook should allow to write custom status and response

The context
I'm happy to see onRequest hook feature in Hocuspocus, it allows me to extend collaboration server with a tiny REST server that can perform some utility operations without starting http + ws server manually.
The problem
Currently, onRequest hook does not allow to return anything except 200 OK without payload. Sometimes I would want to return some payload, or another HTTP code. In other words, the hook should decide what to return to the client. It would also allowed to avoid potential problem when the server tries to write response that has already been ended. As I figured out, this leads to the sever crash 😞
How to solve it
Probably the easiest way would be to check whether the response is ended before trying to write it in the Server. This change would allow to use something like express.js for routing within onRequest hook and it would help to avoid request/response handling boilerplate.

@aonnikov you can just reject the promise, that will cause the server to do nothing, so I think what you want to achieve is already possible (see https://tiptap.dev/hocuspocus/server/hooks#on-request) :)


Enable babel-plugin-transform-react-jsx-source on development

https://babeljs.io/docs/plugins/transform-react-jsx-source/

I think we've an issue for this already: https://github.com/zeit/next.js/issues/764

BTW: It was assigned to me. It'll be great, if someone could work on this.

I'll do it @arunoda


Add files via upload

Added CZR+ and FOS Nierstein

@ncls420 I am sorry for a delay with processing your request.
Pull request merged. Thank you!

@ncls420 I am sorry for a delay with processing your request.
Pull request merged. Thank you!


add type to interface LogOutput and client logger

@maxtaco this is to make it so I can pass Gregor's logger into client code. Let me know!

👍


Updates to ASP.NET Core 2.1

This updates the project to ASP.NET Core 2.1. It works, but I don't know why :-D
Should be tested carefully. No warranties :-)

Thank you @pekspro a lot for contributing! 😊
Will test this in the coming days and if everything works, I'll merge it.

Thank you again @pekspro! 😊
Sorry for the delay, I had to add some extra changes before merging.


YARN-9711 Missing spaces in NMClientImpl

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
110
Docker mode activated.

_ Prechecks _

+1
dupname
0
No case conflicting files found.

+1
@author
0
The patch does not contain any @author tags.

-1
test4tests
0
The patch doesn't appear to include any new or modified tests.  Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.

_ trunk Compile Tests _

+1
mvninstall
1288
trunk passed

+1
compile
33
trunk passed

+1
checkstyle
20
trunk passed

+1
mvnsite
42
trunk passed

+1
shadedclient
760
branch has no errors when building and testing our client artifacts.

+1
javadoc
24
trunk passed

0
spotbugs
58
Used deprecated FindBugs config; considering switching to SpotBugs.

+1
findbugs
53
trunk passed

_ Patch Compile Tests _

+1
mvninstall
33
the patch passed

+1
compile
27
the patch passed

+1
javac
27
the patch passed

+1
checkstyle
18
the patch passed

+1
mvnsite
31
the patch passed

+1
whitespace
0
The patch has no whitespace issues.

+1
shadedclient
853
patch has no errors when building and testing our client artifacts.

+1
javadoc
21
the patch passed

+1
findbugs
62
the patch passed

_ Other Tests _

-1
unit
1230
hadoop-yarn-client in the patch failed.

+1
asflicense
31
The patch does not generate ASF License warnings.

4710

Reason
Tests

Failed junit tests
hadoop.yarn.client.api.impl.TestAMRMClient

Subsystem
Report/Notes

Docker
Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/1/artifact/out/Dockerfile

GITHUB PR
https://github.com/apache/hadoop/pull/1177

Optional Tests
dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle

uname
Linux d41a3bbb3cc8 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Build tool
maven

Personality
personality/hadoop.sh

git revision
trunk / f86de6f

Default Java
1.8.0_212

unit
https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/1/artifact/out/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-client.txt

Test Results
https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/1/testReport/

Max. process+thread count
613 (vs. ulimit of 5500)

modules
C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/1/console

versions
git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
41
Docker mode activated.

_ Prechecks _

+1
dupname
0
No case conflicting files found.

+1
@author
0
The patch does not contain any @author tags.

-1
test4tests
0
The patch doesn't appear to include any new or modified tests.  Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.

_ trunk Compile Tests _

+1
mvninstall
1066
trunk passed

+1
compile
26
trunk passed

+1
checkstyle
17
trunk passed

+1
mvnsite
25
trunk passed

+1
shadedclient
649
branch has no errors when building and testing our client artifacts.

+1
javadoc
18
trunk passed

0
spotbugs
45
Used deprecated FindBugs config; considering switching to SpotBugs.

+1
findbugs
44
trunk passed

_ Patch Compile Tests _

+1
mvninstall
28
the patch passed

+1
compile
21
the patch passed

+1
javac
21
the patch passed

+1
checkstyle
13
the patch passed

+1
mvnsite
24
the patch passed

+1
whitespace
0
The patch has no whitespace issues.

+1
shadedclient
705
patch has no errors when building and testing our client artifacts.

+1
javadoc
18
the patch passed

+1
findbugs
49
the patch passed

_ Other Tests _

-1
unit
1532
hadoop-yarn-client in the patch failed.

+1
asflicense
26
The patch does not generate ASF License warnings.

4383

Reason
Tests

Failed junit tests
hadoop.yarn.client.api.impl.TestAMRMClient

Subsystem
Report/Notes

Docker
Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/2/artifact/out/Dockerfile

GITHUB PR
https://github.com/apache/hadoop/pull/1177

Optional Tests
dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle

uname
Linux eecc6c46163a 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Build tool
maven

Personality
personality/hadoop.sh

git revision
trunk / 70b4617

Default Java
1.8.0_222

unit
https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/2/artifact/out/patch-unit-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-client.txt

Test Results
https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/2/testReport/

Max. process+thread count
615 (vs. ulimit of 5500)

modules
C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/2/console

versions
git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

:broken_heart: -1 overall

Vote
Subsystem
Runtime
Comment

0
reexec
33
Docker mode activated.

_ Prechecks _

+1
dupname
0
No case conflicting files found.

+1
@author
0
The patch does not contain any @author tags.

-1
test4tests
0
The patch doesn't appear to include any new or modified tests.  Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.

_ trunk Compile Tests _

+1
mvninstall
1197
trunk passed

+1
compile
28
trunk passed

+1
checkstyle
22
trunk passed

+1
mvnsite
33
trunk passed

+1
shadedclient
784
branch has no errors when building and testing our client artifacts.

+1
javadoc
24
trunk passed

0
spotbugs
51
Used deprecated FindBugs config; considering switching to SpotBugs.

+1
findbugs
49
trunk passed

_ Patch Compile Tests _

+1
mvninstall
32
the patch passed

+1
compile
22
the patch passed

+1
javac
22
the patch passed

+1
checkstyle
16
the patch passed

+1
mvnsite
29
the patch passed

+1
whitespace
0
The patch has no whitespace issues.

+1
shadedclient
851
patch has no errors when building and testing our client artifacts.

+1
javadoc
21
the patch passed

+1
findbugs
60
the patch passed

_ Other Tests _

+1
unit
1588
hadoop-yarn-client in the patch passed.

+1
asflicense
31
The patch does not generate ASF License warnings.

4903

Subsystem
Report/Notes

Docker
Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/3/artifact/out/Dockerfile

GITHUB PR
https://github.com/apache/hadoop/pull/1177

Optional Tests
dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle

uname
Linux fea47e56ce50 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Build tool
maven

Personality
personality/hadoop.sh

git revision
trunk / 397a563

Default Java
1.8.0_222

Test Results
https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/3/testReport/

Max. process+thread count
604 (vs. ulimit of 5500)

modules
C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client

Console output
https://builds.apache.org/job/hadoop-multibranch/job/PR-1177/3/console

versions
git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1

Powered by
Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

+1


Response time logging and filtering

Description
This pull request implements response time logging and filtering. Timing is performed using Golang's HTTP Tracing, so the logged time is the duration between the request being fully written (so we avoid logging overhead from DNS and TLS connection setup) and the first byte of the response being received.
Matchers and filters have been implemented with -mt and -ft. This is particularly useful when fuzzing things and looking for time discrepancies. The idea is to let the user tweak these parameters and see responses that fall outside of the expected response time.
 Latest commit rounds stdout output to nearest millisecond. This is not granular enough for some local-host based services but I figure that's kind of an edge case that user's can fall back to file output on.
 I've moved the stdout output to use Milliseconds() to match the filter.
I'm not sure what you mean by adding the template to the ffufrc.example file. I've added in the Time fields under filter and matcher. Do you want to include an example value like '>100' included in ffufrc.example?

Ahh that's right, I used Round() so we get pretty output with %v. At this point, I'll take a rounding error on the time output in exchange for prettier stdout output. I'd rather have 20.21s than 20210ms. Have changed it back to Round()

Thanks for the update. I'd prefer using a well defined, static output format for the duration, and in this case the best fit would be milliseconds.
Currently, durations under a second get printed in ms, and durations over a second in seconds:
slow                    [Status: 200, Size: 185, Words: 6, Lines: 8, Duration: 2.494s]
still_slo               [Status: 200, Size: 185, Words: 6, Lines: 8, Duration: 1.211s]
under_second            [Status: 200, Size: 185, Words: 6, Lines: 8, Duration: 713ms]

Fair enough, have switched it to always print milliseconds.
||/usr/bin/id|          [Status: 200, Size: 4176, Words: 1187, Lines: 95, Duration: 2ms]
}                       [Status: 200, Size: 4176, Words: 1187, Lines: 95, Duration: 2ms]
https://www.google.com  [Status: 200, Size: 4162, Words: 1183, Lines: 95, Duration: 1614ms]


Investigate the use cases for Spring Tx and update spring scala

Related library: https://index.scala-lang.org/lingcreative/play-dbx


Expose default fields for entities

This stems from a client who has been receiving a "Too many checklists" error from Trello.  As it turns out they have a limit on the number of checklists that can be downloaded in a single call.
From Trello:

I believe this user has also been in touch with us. Since their initial request's response did contain more than 5000 checklists, the solution was to specify the fields they wanted returned to not include checklists. Then, they can iterate through each of the returned cards and query for each individual cards checklist.

To support this through Manatee.Trello, the default fields for each entity need to be exposed somehow.

As it turns out, I'm not using the idChecklists property data (or a lot of other data for that matter) that's being returned by Trello by default.
A possible solution for this is to just update the RestParameterRepository to specify the fields that I need.
I do like the idea of the client being able to customize the response, though.  I think that will be a later feature, continually in progress.  For now, I'll create a new issue for the problem my client was experiencing.

See branch feature/custom-fetch for progress.

Please see v1.17.1 for the short-term fix.

This has been coded.  Waiting on a client for verification before posting.

I have confirmed that this works well.

Please see Manatee.Trello v1.18.0


SAK-49796 Messages: Avoid creating an empty second line of the original message

I converted to a draft while you do your testing.


Improved printing to PDF

Tracking improvements in generating PDFs from our Articles here on the Research page. Some of these things will be specific to Articles, whereas others will likely generalize to other use cases (like the Blog). Some specific things listed below, possibly worth creating separate issues for depending on their complexity. I think most of this can be done by tweaking our print-specific styles and then relying on Print -> Save as PDF, rather than engineering some brand new PDF solution.

[x] Removing the back button (while the link works the word "Back" makes no sense on a printed version)
[x] Remove header dimmer icon and menu (not useful in a printed version)
[ ] Consider either inlining expanded references or putting a list of references at the end
[ ] Prevent lines from being split / clipped on page breaks (should be easier!)
[ ] Prevent figures from being split / clipped on page breaks (important and might be hard!)
[x] Consider removing / simplifying the end matter and footer (though it might be fine and useful to keep)
[ ] Using more file-system friendly naming conventions (I prefer capitalization with hyphens)

A current PDF is enclosed here for reference.
CarbonPlan-2021-Forest-Risks-Explainer.pdf
cc @katamartin

I started making some of these improvements while working on the new layouts package. Samples below.
In general, for any element we want to hide on print, it's as simple as adding this to the sx prop:
'@media print': {
  display: 'none',
}

That made it easy to hide the back button and some of the end bits. Because we wanted to hide items defined in the base layout, I also had to make a hopefully peaceful change in components, which was to add a printable boolean (default false). When true, it just hides the header and the footer.
I also learned that, for tables and figures, we can add this style to them:
'@media print': {
  pageBreakBefore: 'always'
}

This generally prevents figures from getting split, but, it can create some obnoxiously large white space. Probably worth doing, as any more complex solution would (probably?) involve a more sophisticated layout engine.
If we want to do this, we should probably do it on the Table element, and similarly define a Figure component, so we don't need to go define it on every figure in every article.
print-sample-page-breaks.pdf
print-sample.pdf

Prevent figures from being split / clipped on page breaks (important and might be hard!)

I think we can mark this one off after https://github.com/carbonplan/research/pull/227. There are still cases where some long figures may get broken up. Like we discussed, we can always put a max-height on those using a media query, but that will remain a manual process.

It looks like we also may need to make some changes to specifically target Firefox, where the header and charts each have issues.
Firefox.pdf

New issue that popped up... for charts specifically, with current settings, the top-most tick label can potentially get cut off and appear on the previous page. A simple solution that worked in at least one example was to simply add some padding above the figure. We could build a print-specific padding into the Figure component, though we should be careful to balance making it enough to avoid this issue without creating a visible gap for all figures. Or, make it optional?


Create package.json

Hi @thomaspark :smiley:
The package.json could provide confirmed information for users.
Thanks for your great work!
Piicksarn

@Piicksarn, thanks for this PR and for your work getting it up on cdnjs!


resource helper refactor

Thanks, looks great. Make sure to test extensively with any syberia projects you have on hand.

@robertzk @kirillseva Is it possible to add more automated tests as well?

@peterhurford no idea for now. We probably need a mock syberia project in testthat folder and do some stuff with it

Which is happening in another branch, the one with engines

Works on a local project @robertzk

@kirillseva Maybe merge this into that branch?  But since no one would really use this version yet, I guess that works for me.

@peterhurford I'm going to merge this into master of our common top secret project today

Oh, my bad. Yeah, the engines branch is not being used by anyone as far as I know


Using existing VPC and subnets for new cluster

Description
Allows installing EKS cluster on existing VPC, if VPC ID and subnets are provided.
Apart from that externalized VPC creation, so it's now in the root folder, and not under EKS. Also renamed variables connected only to the creation of VPC to start with "vpc_".
Also provided example to create EKS cluster for Clickhouse using existing VPC.
Type of change

[x] New feature (non-breaking change which adds functionality)

How Has This Been Tested?
Tested on existing AWS environment with VPC. I also tested that existing functionality with VPC creation is working as expected.
What is the current behavior?
There is no way to select existing VPC during the creation of the EKS cluster for Clickhouse using this module.
What is the expected behavior?
If create_vpc is set to false use vpc_id and subnets variables to create EKS cluster.
What is the motivation / use case for changing the behavior?
Allowing users to re-use existing VPCs.

@Zeppier code and approach looks great. I will be testing this further tomorrow and will came up with a final feedback (probably some changes in variable name convention)
Thanks!

@Zeppier I am not able to complete the setup for the "create new VPC" use case. I get this error:
╷
│ Error: waiting for EKS Add-On (clickhouse-cluster-vpc-test:aws-ebs-csi-driver) create: timeout while waiting for state to become 'ACTIVE' (last state: 'DEGRADED', timeout: 20m0s)
│
│   with module.eks_aws.module.eks_blueprints_addons.aws_eks_addon.this["aws-ebs-csi-driver"],
│   on .terraform/modules/eks_aws.eks_blueprints_addons/main.tf line 2179, in resource "aws_eks_addon" "this":
│ 2179: resource "aws_eks_addon" "this" {
│
╵

Can you check if that works for you?

@ianaya89 just tried the default example:

It worked for me. The only change I made is replaced a source to make it work:
  source = "../../"

Plan work well for me as well but apply fails while trying to setup aws-ebs-csi-driver. I will keep debugging and post here whatever I find

@Zeppier I will close this for now. We can re-take it later.
Thanks!


Non-Virtual properties are initialized

Summary of the issue
The Non-Virtual properties are initialized when I use Cacheable() extension
Environment
EF 6
MVC 5
NET 4.5
The in-use version: <IP_ADDRESS>
Operating system:  Windows 10
IDE: Visual Studio 2015

Example code/Steps to reproduce:
I have this class
   public class User
    {
               public int Id { get; set; }
               public int IdCity { get; set; }
                [ForeignKey("IdCity ")]
                public City City { get; set; }
    }
    And in the BL I have something like this:

 var user = Context.Set<User>().Cacheable().FirstOrDefault(x => x.Id = 1);
and I should have user.City = null, but I have that property populated.
When I remove the Cacheable() method, I have user.City = null as expected

Output:
Exception message:
Full Stack trace:

lazy loading with second level caching is meaningless. because the 2nd time that you call the same query, it's not bound to that context anymore. it will be populated from the cache only and cache doesn't know anything about the AOP proxies of lazy loading process. second level caching is always an eager loading process (if it's called with .Include() method for the 1st time).


feat: Use jupyter-book for documentation

Hi, I have made the following changes in this PR -

Remove sphinx documentation builder
Use jupyter-book for generating documentation
Add codespell pre-commit hook to fix minor spelling mistakes

Closes #10
Closes #31

Codecov Report
All modified lines are covered by tests :white_check_mark:

Comparison is base (d32df02) 96.45% compared to head (7571631) 96.45%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #51   +/-   ##
=======================================
  Coverage   96.45%   96.45%
=======================================
  Files           3        3
  Lines         141      141
=======================================
  Hits          136      136
  Misses          5        5

Files
Coverage Δ

src/genetic_testing/routers/ncbi.py
98.07% <100.00%> (ø)

..._testing/sequence_analysis/sequence_variability.py
95.18% <ø> (ø)

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

Could you please set up the read the docs pull request preview? https://docs.readthedocs.io/en/stable/guides/pull-requests.html
I'd like to see this in action ensuring the the configuration is correct and that the page is rendering. I see on the readthedocs end that you've set up the project, let me know if you wanna meet 1:1 to get this sorted. Thanks!

Okay that's a great suggestion. I have enabled by following the steps in the above link. Thank you!

I will go ahead and merge this PR to see the jupyter-book in action. Thank you @lsetiawan for your suggestions! 😄

I will go ahead and merge this PR to see the jupyter-book in action

FYI, You should have been able to activate and reopen PR to see it in action before merging it to ensure that the readthedocs jupyterbook workflow works before merging.

I don't seem to see the updates on https://neglected-diagnostics.readthedocs.io/en/latest/ the build might have failed.

Could you give me owner permission to this readthedocs project?


Learning rate in pretraining on CIFAR10

Hi, thanks for sharing your implementation. It's very helpful.
If I've understood the your implementation right, it seems like you're training with the learning rate initially set to 4.0 on CIFAR10 .
May I ask why you set it to 4.0?
It seems like the authors of simCLR use one out of {0.5, 1.0, 1.5} (not sure which one though), so I'm quite confused.
I would be very thankful if you could explain the reasons behind choosing 4.0 as your learning rate.
Thanks in advance :)

Ah, understood. Thank you :)


Some guidelines to improve code quality

Hello!
I've checked out your project and I want to suggest you some refactoring tips

Make a MainWindow class and simply avoid using global variables

class MainWindow(Tk):
  styler = ttk.Style()
  storage = ...
  current_left = ...

  ....

and you can configure styles and other gui things in init method, for ex.:
  ...
  def __init__(self):
    super().__init__()
    self.title("PyCalc")
    ...
    styler.theme_use("calm")
    ...

and next you can use storage or temporary operand variables in any method here or directly pass it in other objects, for ex.:
  def put_in_storage(): # cout
    storage[-1] = ...
    ...

This step needs to separate the gui functionality and the core program logic so you can independently change them.

Define a class with all control elements

class Controls:
  operators = [....]
  special = [...]
  ...

and make an instance of this class a field of your MainWindow class. Using this approach you can easily bind control elements like:
  def control_binding():
    for control_element in [str(x) for x in range(10)]: # or your controls list
      some_button= ttk.Button(keypad, text=control_element, command=lambda: cout(control_element))
      # or append this buttons to button list and like button_list.append(some_button)

instead of:
nine = ttk.Button(keypad, text='9', command=lambda: cout('9'))
eight = ttk.Button(keypad, text='8', command=lambda: cout('8'))
seven = ttk.Button(keypad, text='7', command=lambda: cout('7'))
six = ttk.Button(keypad, text='6', command=lambda: cout('6'))
five = ttk.Button(keypad, text='5', command=lambda: cout('5'))
four = ttk.Button(keypad, text='4', command=lambda: cout('4'))
three = ttk.Button(keypad, text='3', command=lambda: cout('3'))
two = ttk.Button(keypad, text='2', command=lambda: cout('2'))
one = ttk.Button(keypad, text='1', command=lambda: cout('1'))
zero = ttk.Button(keypad, text='0', command=lambda: cout('0'))

I think you would got a point.

Make a class with calc methods
This is another step to separate your program components. Also you can make an instanse of this class as a field of MainWindow to have a direct access.

Elimenate nested "if" instructions
For ex.:

if cond1:
  if cond2:
    if cond3:
     ...
    else:
  ..elses..

can be written as:
if not cond1:
   ...
   return
if not cond2:
  ...
  return

I think you would got a point.
I recommend you to read "Clean code" by Robert Martin. There are a lot of guidelines to improve your code quality with perfect argumentation.
Good luck!

This is a lot of very useful tips you have provided. The code badly needed a clean-up, but I did not know where to start. I was thinking about making it modular a.k.a separating the code into many sub-files and importing them when necessary. Your approach seems promising :+1: .
Defining a function to replace the repetition of code should be the first priority. It greatly help readability. Sparse is better than dense should be taken into account.
Thanks a bunch for this detailed Issue. I will get back to you, if I land up in any trouble while re-writing the code. I also would like to know about your views on breaking the code to many sub-files instead of one long source.py. Will it be a better approach?

Definetely, it will be.
You can make a folder (package) for graphical things like windows (for ex. SimpleMainInterface and AdvancedMainInterface) and for styling purposes (for ex. make your own buttons by inheriting from tk buttons with future customizations). Also make a core package with a class for calculation. The idea is to separate gui and core functionality for independent testing and development.
It is a part of weak connection concept.
I see the file hierachy as
__init__.py
main.py
gui
  windows
    abstractwindow.py
    simpleinterfacewindow.py
    advancedinterfacewindow.py
  buttons
    custombuttons.py
core
  calculation
    expressionparser.py
    calculator.py
  controls
    operations.py
    functions.py
    ...
tests
  ....

You need to make your windows implementing singleton pattern for some reasons. You can read about it here: singleton. It would help you to store the state of your window.
Ask me if you have any questions and keep developing!

In the process of binding control elements,
  def control_binding():
    for control_element in [str(x) for x in range(10)]: # or your controls list
      some_button= ttk.Button(keypad, text=control_element, command=lambda: cout(control_element))
      # or append this buttons to button list and like button_list.append(some_button)

To grid all the buttons in columns of three, some_button is appended to button_list and then in def gridding the buttons are accessed using indices, am I right?
# earlier code (code to be refactored)
nine.grid(row=2, column=0)
eight.grid(row=2, column=1)
seven.grid(row=2, column=2)
six.grid(row=3, column=0)
five.grid(row=3, column=1)
four.grid(row=3, column=2)
three.grid(row=4, column=0)
two.grid(row=4, column=1)
one.grid(row=4, column=2)

# refactored code
...
    def control_binding(self):
        for control_element in [str(number) for number in range(10)]:
                    some_button = ttk.Button(keypad, text=control_element, command=lambda: self.cout(control_element))
                    self.NUM_BUTTONS.append(some_button)

    def gridding(self):
        ROW = 1
        for button_place in range(len(NUM_BUTTONS):
            MOD =   button_place%3
            if MOD == 0:
                ROW += 1
            NUM_BUTTONS[button_place].grid(row=ROW, column = mod)
...

Is this the correct approach to do it?

Exactly!
In the case of number buttons your can shorten gridding code as
def gridding(self):
    for button_index in range(len(num_buttons)):
         num_buttons[button_index].grid(row=button_index//3, column=button_index%3) # or row=button_index//3 + 2 if you need to start from 2

Most programming languages have own code style guides/naming conventions. In python the most considered style guide is PEP-8. According to this all uppercase variable names should refer to constant objects, for ex.: DAYS_PER_WEEK = 7 or GPU_CORES = 4 etc. Try to avoid using uppercase names when its not a constant object (like num_button or row/mod).

Nested if-else is a real mess to clear. Unfortunately, there is a bunch of those in core logic part of code. To make the* nested* statements flat, usage of and and or operators the correct approach?
Following is one of many nested blocks:
...
    if char in OPERATORS:
        if STORAGE[-1] == None:
            if char in OPERATORS[:2]:
                ''' Case when first input is '/' or '*' '''
                STORAGE += ['1']+list(char)
            else:
                ''' Case when first input is '+' or '-' '''
                STORAGE += ['0']+list(char)
        elif STORAGE[-1] in OPERATORS:
            ''' Switching to latest operator, example: '3+-' evalutes to '3-' '''
            STORAGE[-1] = char
        else:
            STORAGE += list(char)
    else:
        ...
...

The next following code is an attempt to make the nested block flat:
...
# if block
if char in OPERATORS and STORAGE[-1] is None and char in OPERATORS[:2]:
	''' Case when first input is '/' or '*' '''
	STORAGE += ['1']+list(char)

if char in OPERATORS and STORAGE[-1] is None and char not in OPERATORS[:2]:
	''' Case when first input is '+' or '-' '''
	STORAGE += ['0']+list(char)

if char in OPERATORS and STORAGE[-1] in OPERATORS:
	''' Switching to latest operator, example: '3+-' evalutes to '3-' '''
	STORAGE[-1] = char

if char in OPERATORS and STORAGE[-1] not in OPERATORS:
	STORAGE += list(char)

# else block
if char not in OPERATORS and ...
...

Logic operators are good to use in conditions, but the idea of flattening is to make represented conditionals more readable.
Your eyes should flow by your code (? english is not my native, idk how to shape it). All conditional logic should be easy to understand.
Some ideas are below. It is not a perfect solution, but compare it to your version. Is it easier to understand?
class Storage:
    __operators: list = ["*", "/", "-", "+"]
    __special: list = ["C", "AC", "P/M"]
    __storage: list

    def __init__(self):
        self.__storage = []

    def get_storage(self) -> list:
        """ get storage as a list """
        return self.__storage

    def get_storage_as_string(self) -> str:
        """ get string representation """
        return "".join(
            map(
                lambda element: " " + element + " " if element in self.__operators else element,
                self.__storage
            )
        )

    def __repr__(self) -> str:
        return self.get_storage_as_string()

    def put_in_storage(self, character: str) -> None:
        """ puts a character to storage """
        if character in self.__operators:
            return self.__put_operator(character)
        if character in self.__special:
            return self.__apply_special(character)
        if not character.isnumeric() and character != ".":
            raise Exception("Given symbol is invalid")  # todo: check if there is only one dot in number
        return self.__put_digit(character)

    def __put_operator(self, character: str) -> None:
        if len(self.__storage) > 0:  # is not empty
            if self.__storage[-1] in self.__operators:
                self.__storage[-1] = character
            else:
                self.__storage.append(character)
        else:
            """ put "1" + ("/" or "*") or "0" + ("+" or "-") """
            self.__storage.extend([["1", "0"][self.__operators.index(character)//2], character])

    def __apply_special(self, character: str) -> None:
        if character == "AC":
            self.__storage.clear()
        if character == "C":
            pass
        if character == "P/M":
            pass

    def __put_digit(self, character: str) -> None:
        if len(self.__storage) == 0 or self.__storage[-1] in self.__operators:
            """ is empty or previous chunk is an operator """
            self.__storage.append(character)
        else:
            self.__storage[-1] += character

def test1(storage_instance: Storage) -> tuple:
    storage_instance.put_in_storage("1")
    storage_instance.put_in_storage("+")
    storage_instance.put_in_storage("2")
    storage_instance.put_in_storage("4")
    storage_instance.put_in_storage("/")
    storage_instance.put_in_storage("5")
    result_str = storage_instance.get_storage_as_string()
    return result_str, 1 if result_str == "1 + 24 / 5" else 0

def test2(storage_instance: Storage) -> tuple:
    storage_instance.put_in_storage("/")
    storage_instance.put_in_storage("5")
    result_str = storage_instance.get_storage_as_string()
    return result_str, 1 if result_str == "1 / 5" else 0

def test3(storage_instance: Storage) -> tuple:
    storage_instance.put_in_storage("+")
    storage_instance.put_in_storage("1")
    result_str = storage_instance.get_storage_as_string()
    return result_str, 1 if result_str == "0 + 1" else 0

if __name__ == "__main__":
    # make unit tests using unittest?
    for test in [test1, test2, test3]:
        storage_instance = Storage()
        test_result = test(storage_instance)
        print("{}: got {}, valid? {}"
              .format(test.__name__, test_result[0], ["not", "yes"][test_result[1]]))

I know that it might be a bit complicated code for beginner, so if you have any questions feel free to ask me here.

@nechepurenkoN, to be honest, the concepts of tests and using of class is something I have never implemented myself. They remain solely in tutorial examples. All of your suggestions are forcing me to learn concepts which I either ignored or which I have never encountered myself. I do foresee a lot more queries to be posted by me here.
Thanks a lot for lending a helping hand. Your help and suggestions means a lot to me. You will be bothered many more times before the completion of this refactoring project :smile: .

Why these classes, refactoring, decomposition etc. are important?
If you want to build a good house you need a solid foundation. Even if you want to build a hut of branches.
A good code architecture and styling make new features or changes easier to implement. It provides you an opportunity to update some functionality without affecting stable code what is a very important thing if your program grows.
It might be like a steep trampoline, but any difficulties your overcome make you more experienced and professional.
As you develop this habit to map out what kind of architecture should have been implemented, what components of your program should be packaged as classes etc., you elaborate your professional vision of problem. And this pet-project can become like a training camp where you can practice and apply new knowledge, why not?
I'm not bothered to help you because I answer in my spare time and I don't need something in return. Don't be ashemed to ask questions that seems "fool" or something like that, because it's normal when you learn something new. Programming concepts like object-oriented paradigm are not easy to understand on your own, but I can help you with examples related to your project.
Like in the code above, I haven't changed the main logic itself, but I've reorganized code to make it like an indepent component, so it could be reused and modified without affecting other "components".
I don't insist to do this refactoring things, but if you want to, mention me at this thread with any question you have.

I don't insist to do this refactoring things, but if you want to, mention me at this thread with any question you have.

I have been refactoring this code, right from the day this thread was opened. I made little progress due to lack of experience and clarity. Your previous snippet of refactored code is just what I needed. I will update my progress regularly is a separate gist.

Some ideas are below. It is not a perfect solution, but compare it to your version. Is it easier to understand?

It is way easier to understand the code now. It is very clear to me now that architecture of the code is very important for readability.

I'm not bothered to help you because I answer in my spare time and I don't need something in return.

This is so nice of you. :smile:

I know that it might be a bit complicated code for beginner, so if you have any questions feel free to ask me here.

TBH, it looked complicated at first sight. I sat down yesterday and started exploring all the unknowns concepts in your example code. End result, I was able to see the beauty of your refactored chunk of code after learning function annotation, variable annotation, difference between class variable and instance variable.
I believe continuing to keep this thread as descriptive as possible will help other new-devs in future in some or the other way. :nerd_face:

Update from WIP refactor source gist.
I made a class for calculation, calculate. To link both the classes Storage and Calculate,  I first made an instance obj in go_for_calc. In class Calculate expression holds string representation of __storage:
class Storage:
    ...

    def go_for_calc(self):
        obj = Calculate(self.__storage)
        self.__answer = obj.__calculate
    ...

class Calculate:
    ans: str

    def __init__(self, expr_as_list):
        self.expression = ''.join(i for i in expr_as_list)

    def __calculate(self) -> str:
        self.ans = str(eval(self.expression)
        return self.ans

Unfortunately, this throws AttributeError: 'Calculate' object has no attribute '_Storage__calculate'. I don't understand why this does not work. I did a workaround like this:
class Storage:
    ...

    def go_for_calc(self):
        obj = Calculate(self.__storage)
        self.__answer = obj.ans
    ...

class Calculate:
    ans: str

    def __init__(self, expr_as_list):
        self.expression = ''.join(i for i in expr_as_list)
        self.__calculate()

    def __calculate(self) -> str:
        self.ans = str(eval(self.expression)

This does give the desired answer but I am pretty sure there is a better way to do this.
Note: I have used eval() to parse the equation as a temporary use. Calculation logic is to be added later in class Calculate.

In the line 56 there is a typo:
self.__storage.extend(['0', '1'][self.__operator.index(operator)//2, operator])

instead of
self.__storage.extend([['1', '0'][self.__operator.index(operator)//2], operator])

It needs ']' after '//2', "1" before "0" and "[" in the beginning. How does it works?
Extend method make something like a concatenation but operating with lists, so in this line we are trying to concatenate our storage and a list of 2 values. The second value is the operator, but what is the first? Here is some magic:
# we define a temporary list ["1", "0"]; for simplicity, let it be:
a = ["1", "0"]
# how can we get 1 if operators are "*" or "/" and 0 if operators are "+", "-" ?
# we know, that this character IS in our operators list, so lets find its position:
index = self.__operators.index(character)
# we will get index in [0..3] range, and 0-1 should be mapped to 0th index in a, 2-3 to 1th index in a
# so we divide index by 2
index_in_a = index // 2
# and get the number
result = a[index_in_a]
# hence, we can shorten this expression, by defining list "a" in place and not assigning it to a variable
# [create a][get index_in_a]
  ["1", "0"][self.__operators.index(character)//2] == ("1" if character in ["/", "*"]) or ("0" if character in ["+","-"])

This is not a good practice make things like that, but I wanted to show you some language sugar :)

Two underscores mark a class field or method as private. It means that you can access it only in class definition, for ex.:
class A:
  __a = 10

class B:
  def __init__(self):
    a_instance = A()
    print(a_instance.__a) # is incorrect, because the field __a is private
                   # it cannot be accessed outside class A.

Private functions also are not accessible outside class definition. There is a way to access it, but it is some kinda hacking.
If you want to function or field being visible outside then don't use two underscores in the name prefix. For ex.:
class A:
  def calculate(self):
    pass
  def __calculate1(self):
    pass

class B:
  def foo(self):
    a = A()
    a.calculate() # all good
    a.__calculate1() # error

Why should you use private functions then? Let's look up in put_in_storage. It is public function, we can call it outside a class definition. We can create an object (instance) and call this method to put character in storage. But why __put_operand is private? What will happen if we make it public? You could call storage_instance.put_operand("1") or storage_instance.put_operand("&") and it is a bad news. It will break a core logic, because we secure this function and call it if only character is a valid operand, in other words "+", "-", "*" or "/".
If it is not clear ask me for another examples.

Two underscores mark a class field or method as private. It means that you can access it only in class definition

Ok,
I tried out and found that inherited class does not come under the base class definition.  I need the __operators defined in class Storage to be included in class Calculate. To do this I found two ways to do it:
class Calculate(Storage):
    operators = Storage.__operators

    def __init__(self, expr_as_list):
        self.expression = ''.join(i for i in expr_as_list)
    ...

In this second approach I made the following changes in Storage and Calculate:
class Storage:
    ...
    def go_for_calc(self):
        obj = Calculate(self.__storage, self.__operators)
        ...
    ...

class Calculate:
    ...
    def __init__(self, expr_as_list, operators):
        self.expression = ''.join(i for i in expr_as_list)
        self.operators = operators
    ...

@nechepurenkoN, can you please point out which is safer way, or if there is a better way to do it?

IMHO, the second way is better. Inheritance is used when you want to extend existing class with new fields/methods or redefine methods. For example, there is Hero class and its objects have attack() method. You can make knight and archer class and redefine attack method.
class Hero:
  def __init__(self, base_damage):
    self.base_damage = base_damage
  def attack(self):
    pass

class Knight(Hero):
  def __init__(self, base_damage):
    super().__init__(base_damage)
  def attack(self):
    print(f"Melee attack with {self.base_damage} damage")

class Archer(Hero):
  def __init__(self, base_damage):
    super().__init__(base_damage)
  def attack(self):
    print(f"Range attack with {self.base_damage} damage")

Knight and archer are heroes, so it is logical to use inheritance. But Storage and Calculator are not so connected.
Usually, all the class fields are made private. As I said, if we make self.__storage of Storage as self.storage, then you (or other developers) could make some bad things:
storage_instance = Storage()
storage_instance.put_in_storage("&") # will not have a bad consequences
storage_instance.storage.append("&") # some problems here

So we have to protect storage list -> make it private (__storage). And the question itself: how to access this field?
Let's introduce getters and setters methods:
class A:
  def __init__(self):
    self.__a = 10
    self.__b = 5
  def get_a(self):
    return self.__a
  def get_b(self):
    return self.__b
  def set_a(self, new_a):
    self.__a = new_a
  def set_b(self, new_b):
    self.__b = new_b

obj = A()
print(obj.get_a)
obj.set_a(42)
print(obj.get_a)

But in our case, we cannot just make def get_storage(self): return self.__storage, because it is a list object and we could break it again:
storage_list = storage_instance.get_storage()
storage_list.append("&") # would affect __storage (see how does python store lists)

Solution:
...
def get_storage(self):
  return self.__storage.copy()
...

We return a copy of storage list which we can read and manipulate with. Make a method in Calculator
...
def calculate(self, storage: Storage) -> float:
  storage_list = storage.get_storage()
  # or use storage.get_storage_as_string
  ...

Usage:
storage_instance = Storage()
calculator_instance = Calculator()
result = calculator_instance.calculate(storage_instance)

There is a way to shorten calculation code. I adapt it to your method.
operators = ["*", "/", "+", "-"]
expression_list = ["1", "+", "2"]

functional_mapping = {
    "+": lambda x,y: x+y,
    "-": lambda x,y: x-y,
    "*": lambda x,y: x*y,
    "/": lambda x,y: x/y
}

left_operand = float(expression_list[0])
right_operand = float(expression_list[2])
operator = expression_list[1]

result = functional_mapping[operator](left_operand, right_operand)
print(result)

When we call funtional_mapper[operator], for example: functional_mapper["+"], we get an assigned lambda function (function without name and with only omitted return statement) and we can pass our operands in this function. Try to test this code. And to add new operation just add in functional_mapper new line like: "@": lambda x,y: (return) ...

When we call funtional_mapper[operator], for example: functional_mapper["+"], we get an assigned lambda function (function without name and with only omitted return statement) and we can pass our operands in this function. Try to test this code. And to add new operation just add in functional_mapper new line like: "@": lambda x,y: (retur

This is absolute beauty. I really like this logic to shorten the code :+1:.

        if not character.isnumeric() and character != ".":
            raise Exception("Given symbol is invalid")  # todo: check if there is only one dot in number

Update from gist, when multiple decimal(dot) entry, logic updated to consider only first entry (ln: 79).
    def __put_dot(self, dot):
        if self.__storage[-1] not in self.__operators:
            index_of_dot = self.__storage[-1].find(dot)
            if index_of_dot != -1:
                ''' Multiple decimal inputs ex! (3.2.).
                Replacing '''
                self.__storage[-1].replace(dot, '')
            else:
                self.__storage[-1] += dot

It is still disturbing to see the need of using nested if-else here. I don't see a workaround to solve this without a nested block.

If there was a dot before, why don't just ignore next number dots? This is how Windows calculator works. Test out, what happens if you are trying to add another dot to a number (in Linux for ex.)?
To ignore other dots simply add a condition
def __put_dot(self):
  if len(self.__storage) == 0:
    self.__storage.append("0.")
    return
  if self.__storage[-1] not in self.__operators and not "." in self.__storage[-1]:
    self.__storage[-1] += "."

Test out, what happens if you are trying to add another dot to a number (in Linux for ex.)?

Linux points out where the malformed expression is:

I think that ignoring is not a bad decision at all

Today's update:

Function __put_dot updated.
New class for GUI added.
Fatal errors in GUI:

Every button entry (excluding '=') results in display of character '0'

I came to a conclusion that ttk.Button with same name rebinds the command to latest definition. Hence this code chunk rebinds every button command to '0' (last entry):
...
    __layout = ['*', '/', 'C', 'AC',
                '9', '8', '7', '-',
                '6', '5', '4', '+',
                '3', '2', '1', '+/-',
                '.', '0', '=']
    ...
# ln: 170
        ''' Control Binding '''
        buttons = []
        for bt_text in self.__layout[:-1]:
            bt = ttk.Button(master=keypad)
            bt['text'] = bt_text
            bt['command'] = lambda: (self.bt_cmd.into_storage(bt_text),
                                     self.bt_cmd.show_storage(self.DISPLAY))
            buttons.append(bt)
...

Is this conclusion relevant or am I getting it wrong?

Why do we refactor a code? To make the code shorted or to make it more readable?
If the answer is to achieve best of both worlds; if a case arises where a certain code chunk can either be made made readable-compromising the code length- or can be made shorter -compromising the readability- which option should one choose?

I really have no idea why doesn't buttons binding work :(. I haven't used python gui libraries so I can't help you with previous question.
If you can make your code more readable, then make it, but keep in mind that some programmers are more experienced than we are. They don't use, for example, range loops, generally speaking - common approaches. The way they shorten the code is using some language technics, sugar etc. without making it more difficult to read for people who knows the language as intermediate user. For example:
a = [1,2,3,4]
for i in range(len(a)):
  print(f"index: {i}, element: {a[i]}")

for index, element in enumerate(a):
  print(f"index: {index}, element: {element}")

a = []
for i in range(5):
  if i % 2 == 0
   a.append(i*i)

a = [i*i for i in range(5) if i % 2 == 0]

# consider a, b are int variables
temp = a
a = b
b = temp

a, b = b, a

We make our code more readable by using built-in function enumerate. The first approach is more general, it might be user in any programming language with arrays and for-loops. The second one is using a generator - some useful pythonic feature. Readability is the most important thing, but if if you can shorten the code without losing readability then make it.

Presently there seems no better workaround for button binding problem. Anyhow, source.py is refactored and broken down to separate files.
@nechepurenkoN many thanks for bringing up this issue :tada: . The code now looks way cleaner and readable than before, I believe. To sum up all the changes done:

All usage of global scrapped,
seperate classes for calculation, gui, storage,
deeply nested if-else flattened.

I have thinking about this for a while: using a Entry widget in place of Label -(display_label)- widget to display the input/result seems more appropriate. By switching to a Entry field:

there is no need for key-bindings,
no need to explicitly trim the display to specified characters.

Moreover it morally doesn't seem right. Here are some words from tkdocs:

A label is a widget that displays text or images, typically that the user will just view but not otherwise interact with. Labels are used for such things as identifying controls or other parts of the user interface, providing textual feedback or results, etc.

Entry widget:

An entry presents the user with a single line text field that they can use to type in a string value.

Allowing users to directly enter input (ex: copy/paste) can be achieved by using ttk.Entry widget too. Is this switch-over worthy, maybe a good time to start a separate issue to address this subject?


Enable git lfs from ods-start

We have detected that git LFS is not supported in ods-pipeline. Since it is a feature of current ODS we could try to add it here too.
Proposal would be to just replicate the installation from the jenkins-agent-base image to the ods-start image.

We have tested adding git LFS in a custom task with success.
The addition of this feature would be pretty simple like in ods-start just have a script check like (and of course first having git lfs installed in the ods-start image):
  # then check if there are lfs tracked files
  if [ `git lfs ls-files --all | wc -l` -gt 0 ]; then
    # if yes init and pull lfs
    echo "Git LFS detected, pulling files..."
    git lfs install # this enables the missing hooks to later be able to git lfs pull
    git lfs pull
  fi

I was now thinking that we might want to be added in the ods-start package so we can also provide tests, but, do we need to test this?

In general, everything should be in the ods-start package, see https://github.com/opendevstack/ods-pipeline/blob/master/docs/adr/20210511-executing-step-scripts.md.


[1.6.4] Frame drop to 1~5 when open inventory.

Well , when I open my inventory my fps drops SO MUCH! . And the cause of it is NEI , because when I disable NEI I dont lag anymore. For this reason I'm using Craft Guide , but this mod is bad because dont show all the recipes . Waiting for your guys help !

@SrPandaBr Can you send a screeshot when the inventory is open and the fps dropped?

I'm getting the same issue but with 1.7.10. And it happens when I open the GUI of anything, a furnace, crafting table, machines etc. Rapidly opening and closing the inventory with NEI enabled causes the FPS to dip lower and lower until it hits 1-4 FPS. Disabling it (within' the NEI options screen) and the lag spikes stop.

@aking4125 Sometimes this happens because of items being rendered on the screen.
This tends to happen when render a lots of animated items or fluid containers with dynamics textures (eg. Extra utilities drums).
This is the case? A screenshot would be nice to.

Even when the search box (The UI that shows all the blocks and items) is disabled, meaning it doesn't show any items or I press "O" to hide it. The lag still happens, so I don't know what type of screen shot you want to show the lag happening but I can try a .GIF but I don't think that would help as the .gif itself would be very laggy anyways.


[Certificate] https://*.visualstudio.com/  NET::ERR_CERT_COMMON_NAME_INVALID

Does this issue occur when all extensions are disabled?: Yes/No

VS Code Version: latest
OS Version: macos 14.2 (23C64)

Steps to Reproduce:

Searching the web for djfidicjmwos.com suggests that this is an issue on your ISP's side and not with any of the visualstudio.com websites.


[Metadata] Document end-to-end for emitters

There's enough in the REST layer for a different emitter to handle metadata as the openapi emitter does, but it would be nice to have a small walktrhough on that.

pri: 1
est: 3

Also document getEffectiveType here.

I have written a sample that calls all of the API. I am still working on cleaning it up and writing doc text to go with it. Work in progress is here: https://gist.github.com/nguerrera/36df0c007be7d37e5e67fd769958030e
Also putting down some rough notes I have on things to cover in the doc text.
Key point: Put properties in models only if they logically belong there. The feature is about allowing a single logical model + visibility/metadata annotations.
API cheat sheet:

getRequestVisibility(HttpVerb): Visibility - use this to determine the visibility implied for data in the request parameters or body.  (And note also that Visibility.Read is always applied for response data and therefore there is no corresponding response API.)

createMetadataInfo(Program) - create this once for each projected program/service version, use it to reason about metadata and visibility implications

metadataInfo.getEffectivePayloadType(Type, Visibility): Type - use this on every type that is referenced. if it is an anonymous model sourced entirely from named properties after metadata is moved elsewhere or invisible properties are removed, it will recover the named model that should be used. This handles op foo(...Thing) but also many other cases.

metaddataInfo.isTransformed(Type, Visibility) - use this to check if a type undergoes any changes in shape. Can allow for simplifications in emit.

metadataInfo.isPayloadProperty(Type, Visibility) - use this to check if a property is transmitted as an object property (in the payload) and not invisible or metadata sent elsewhere

Visibility.Item - Add this when recursing into an array. It puts all metadata into payload. Useful in scenarios like batching API calls.


Request to update anchor-lang and anchor-spl to 0.29.0

Would it be possible to update Solana Playground  version of anchor-lang and anchor-spl to 0.29.0 in order to use the new syntax for bumps, transferring lamports, and accessing mpl_token_metadata through anchor-spl?

Thanks, yes it's possible but there are some issues with this update currently so it will take some time.

Update anchor

Updated in https://github.com/solana-playground/solana-playground/commit/22d0028294b2e7ac68e126113d334369912616a4
Sorry for the delay!