Java

Description 📜
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes # <2217>

Type of change 📝

[X] Doc#umentation (Content Creation in the form of codes or tutorials)

Domain of Contribution 📊

[X] Java_#Domain

Checklist ✅

[X] I follow Contributing Guidelines & Code of conduct of this project.
[X] I have performed a self-review of my own code or work.
[X] I have commented my code, particularly in hard-to-understand areas.
[X] My changes generates no new warnings.
[X] I'm GWOC'21 contributor

Screenshots / Gif (Optional) 📸

@shreya40 make a new pr with necessary changes


[BUG] Reconciled transactions color selection is not retained

Reconcile Text Color (Accounts options)
Under Accounts Options, there is a drop box for selecting the text color for reconciled transactions.  I have selected "dark gray with green background."  This color selection does not persist between sessions of YNAB.
Steps to reproduce the behavior:

Go to Toolkit options.
Click on 'Accounts Screen'
Scroll down to 'Reconcile Text Colour' drop box.  Select desired color.  Save selections.
Open YNAB.  Make sure that reconciled transaction are selected for viewing.
If you have selected "dark gray with green text", that is not what you see.
Pressing F5 restores the color selection for this session only.

Expected behavior
Color selection to be retained between sessions of YNAB.
Desktop (please complete the following information):

OS: [Windows 10.0.17763 Build 17763 ]
Browser [ Chrome ]
Version [Version 80.0.3987.116 (Official Build) (64-bit)]

Setting Export
Please replace the text below with your exported Toolkit settings. You can export these by going to the Toolkit Options page, click the Import/Export Settings button at the bottom left and copying the text in the modal which appears.
[{"key":"AccountsDisplayDensity","value":"1"},{"key":"AccountsEmphasizedOutflows","value":false},{"key":"AccountsStripedRows","value":true},{"key":"AutoDistributeSplits","value":true},{"key":"AutoEnableRunningBalance","value":true},{"key":"AutomaticallyMarkAsCleared","value":false},{"key":"BetterScrollbars","value":"0"},{"key":"BudgetCategoryFeatures","value":true},{"key":"BudgetProgressBars","value":"both"},{"key":"BudgetQuickSwitch","value":true},{"key":"BudgetSpendingGoal","value":false},{"key":"BulkManagePayees","value":true},{"key":"CalendarFirstDay","value":"0"},{"key":"CategoryActivityCopy","value":true},{"key":"CategoryActivityPopupWidth","value":"1"},{"key":"CategorySoloMode","value":"cat-solo-mode-toggle-all"},{"key":"ChangeEnterBehavior","value":true},{"key":"ChangeMemoEnterBehavior","value":true},{"key":"CheckCreditBalances","value":false},{"key":"CheckNumbers","value":true},{"key":"ClearSelection","value":true},{"key":"CollapseSideMenu","value":true},{"key":"ColourBlindMode","value":false},{"key":"CompactIncomeVsExpense","value":true},{"key":"CreditCardEmoji","value":true},{"key":"CurrentMonthIndicator","value":true},{"key":"CustomFlagNames","value":true},{"key":"DateOfMoney","value":true},{"key":"DaysOfBuffering","value":true},{"key":"DaysOfBufferingDate","value":true},{"key":"DaysOfBufferingHistoryLookup","value":"6"},{"key":"DeselectTransactionsOnSave","value":true},{"key":"DisableToolkit","value":false},{"key":"DisplayTargetGoalAmount","value":"3"},{"key":"DisplayTotalMonthlyGoals","value":true},{"key":"DisplayUpcomingAmount","value":true},{"key":"EasyTransactionApproval","value":true},{"key":"EditAccountButton","value":"0"},{"key":"EnlargeCategoriesDropdown","value":true},{"key":"EnterToMove","value":false},{"key":"FilterCategories","value":true},{"key":"GoalIndicator","value":true},{"key":"GoalWarningColor","value":true},{"key":"GoogleFontsSelector","value":"0"},{"key":"HideAccountBalancesType","value":"0"},{"key":"HideAgeOfMoney","value":false},{"key":"HideClosedAccounts","value":true},{"key":"HideHelp","value":false},{"key":"HideReferralBanner","value":true},{"key":"HideTotalAvailable","value":false},{"key":"HighlightNegatives","value":true},{"key":"ImportNotification","value":"1"},{"key":"IncomeFromLastMonth","value":"0"},{"key":"IncomeVsExpenseHoverHighlight","value":true},{"key":"LargerClickableIcons","value":false},{"key":"LinkToInflows","value":true},{"key":"MonthlyNotesPopupWidth","value":"2"},{"key":"NavDisplayDensity","value":"1"},{"key":"NotesAsMarkdown","value":true},{"key":"POSStyleCurrencyEntryMode","value":false},{"key":"Pacing","value":"2"},{"key":"PrintingImprovements","value":true},{"key":"PrivacyMode","value":"0"},{"key":"QuickBudgetWarning","value":true},{"key":"ReconciledTextColor","value":"4"},{"key":"RemovePositiveHighlight","value":true},{"key":"RemoveZeroCategories","value":true},{"key":"ResizeInspector","value":true},{"key":"ResizeSidebar","value":true},{"key":"RightClickToEdit","value":true},{"key":"RowHeight","value":"1"},{"key":"RowsHeight","value":"0"},{"key":"RunningBalance","value":"1"},{"key":"SeamlessBudgetHeader","value":true},{"key":"SetMultipleFlags","value":true},{"key":"ShowCategoryBalance","value":true},{"key":"SpareChange","value":false},{"key":"SplitKeyboardShortcut","value":true},{"key":"SplitTransactionAutoAdjust","value":false},{"key":"SquareNegativeMode","value":false},{"key":"StealingFromFuture","value":true},{"key":"SwapClearedFlagged","value":true},{"key":"TargetBalanceWarning","value":true},{"key":"ToBeBudgetedWarning","value":true},{"key":"ToggleMasterCategories","value":true},{"key":"ToggleSplits","value":true},{"key":"ToggleTransactionFilters","value":"1"},{"key":"ToolkitReports","value":true},{"key":"TransactionGridFeatures","value":true},{"key":"ViewZeroAsEmpty","value":true},{"key":"l10n","value":"0"},{"key":"options.dark-mode","value":true}]

@TLBauer Just to double check, which version of the extension are you on right now? I'm not noticing this myself and I'm on version 2.21.0

I am currently on 2.20.0.Terry Bauer | Director of Development
Phone:<PHONE_NUMBER> ext<EMAIL_ADDRESS>BCS ProSoft | Technology
Consulting & Cloud Strategy | Deltek, NetSuite, Sage
-------- Original message --------From: Josh Madewell<EMAIL_ADDRESS>Date: 2/22/20  6:33 PM  (GMT-06:00) To: toolkit-for-ynab/toolkit-for-ynab<EMAIL_ADDRESS>Cc: Terry Bauer<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: Re: [toolkit-for-ynab/toolkit-for-ynab] [BUG] Reconciled transactions
  color selection is not retained (#1804) @TLBauer Just to double check, which version of the extension are you on right now? I'm not noticing this myself and I'm on version 2.21.0
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/toolkit-for-ynab/toolkit-for-ynab/issues/1804?email_source=notifications\u0026email_token=AGFAEUOWYL5TYQTRSE3CVADREG745A5CNFSM4KZVDIT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMVOFCI#issuecomment-590013065",
"url": "https://github.com/toolkit-for-ynab/toolkit-for-ynab/issues/1804?email_source=notifications\u0026email_token=AGFAEUOWYL5TYQTRSE3CVADREG745A5CNFSM4KZVDIT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMVOFCI#issuecomment-590013065",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]

The 2.21.0 version of the toolkit was made available to me this morning. So far, this issue appears to be resolved.Thanks,Terry Bauer | Director of Development
Phone:<PHONE_NUMBER> ext<EMAIL_ADDRESS>BCS ProSoft | Technology
Consulting & Cloud Strategy | Deltek, NetSuite, Sage
-------- Original message --------From: Josh Madewell<EMAIL_ADDRESS>Date: 2/22/20  6:33 PM  (GMT-06:00) To: toolkit-for-ynab/toolkit-for-ynab<EMAIL_ADDRESS>Cc: Terry Bauer<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>Subject: Re: [toolkit-for-ynab/toolkit-for-ynab] [BUG] Reconciled transactions
  color selection is not retained (#1804) @TLBauer Just to double check, which version of the extension are you on right now? I'm not noticing this myself and I'm on version 2.21.0
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/toolkit-for-ynab/toolkit-for-ynab/issues/1804?email_source=notifications\u0026email_token=AGFAEUOWYL5TYQTRSE3CVADREG745A5CNFSM4KZVDIT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMVOFCI#issuecomment-590013065",
"url": "https://github.com/toolkit-for-ynab/toolkit-for-ynab/issues/1804?email_source=notifications\u0026email_token=AGFAEUOWYL5TYQTRSE3CVADREG745A5CNFSM4KZVDIT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMVOFCI#issuecomment-590013065",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]

Hey @TLBauer the fix for this should be in our current release! If you notice the issue still exists and you're definitely running the newest version of the toolkit, please reopen! Thanks!
Please note, all browser can take up to an hour to provide updates to all users. You can force an update if it's available for you by going to chrome://extensions and clicking the "Update" button. Firefox users can go to about:addons, click the setting cog, and click "Check for updates...".


Intermittent Pauses in inputs

Version: Version 86.0.4240.186 (Official Build) (32-bit)
Device: Rasp Pi 4 4GB Ram 32GB SD(expanded to fill all of the card)
Browser Extensions: Grammarly, Offline Good Docs
Problem:
Every few minutes the system stops responding to inputs. I've seen this on both USB mouse/keyboard and Bluetooth mouse/keyboard. In both cases, devices are separate devices, not combined.
The system as a whole does not appear to freeze as if I do it when I see a cursor, it still blinks.

Update:
At least part of the GUI may not update. I just had my mouse hoving over the close X and moved it a second before a freeze started and the Close tooltip stayed up till the freeze ended.

Update:
At least part of the GUI may not update. I just had my mouse hoving over the close X and moved it a second before a freeze started and the Close tooltip stayed up till the freeze ended.

it sounds like a graphics mode induced glitch. With the r86r2 release we are using fkms mode which kernel selects the screen mode for the screen but the graphics firmware manages the video output path.
In full kms mode the kernel manages everything but it introduces incompatibilities with the Pi3 models.
In full kms mode glitches like this could be improved to some degree, we may consider to produce an image just for Raspberry Pi 4 models with graphics in kms mode.

it sounds like a graphics mode induced glitch. With the r86r2 release we are using fkms mode which kernel selects the screen mode for the screen but the graphics firmware manages the video output path.
In full kms mode the kernel manages everything but it introduces incompatibilities with the Pi3 models.
In full kms mode glitches like this could be improved to some degree, we may consider to produce an image just for Raspberry Pi 4 models with graphics in kms mode.

I do have it hooked up to a TV. Does that present any problems? Should I move to a monitor that will allow it to support different resolutions?

I do have it hooked up to a TV. Does that present any problems? Should I move to a monitor that will allow it to support different resolutions?

I've seen the same issue:

RPi4 4GB
chromiumos_image_r86r2-rpi4b.img
separately wired USB mouse and keyboard
HDMI to VGA cable to generic PC monitor

Pauses for maybe 10sec every few minutes then recovers.

I've seen the same issue:

RPi4 4GB
chromiumos_image_r86r2-rpi4b.img
separately wired USB mouse and keyboard
HDMI to VGA cable to generic PC monitor

Pauses for maybe 10sec every few minutes then recovers.

It looks to be corrected with the latest release. I am continuing to test now. It seemed to be OK on my TV setup. I did get some screen artifacts, but that is not being replicated on a computer moniter. If I keep seeing them I'll get a screenshot and open a separate ticket as I'm not convinced they are related.


Update rdf4j-model, rdf4j-query, ... to 3.7.6

Updates

org.eclipse.rdf4j:rdf4j-model
org.eclipse.rdf4j:rdf4j-query
org.eclipse.rdf4j:rdf4j-queryalgebra-evaluation
org.eclipse.rdf4j:rdf4j-queryalgebra-model
org.eclipse.rdf4j:rdf4j-queryparser-sparql
org.eclipse.rdf4j:rdf4j-rio-rdfxml
org.eclipse.rdf4j:rdf4j-storage

from 3.7.5 to 3.7.6.
GitHub Release Notes - Version Diff
I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.
If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.
Configure Scala Steward for your repository with a .scala-steward.conf file.
Have a fantastic day writing Scala!

Ignore future updates
Add this to your .scala-steward.conf file to ignore future updates of this dependency:
updates.ignore = [ { groupId = "org.eclipse.rdf4j" } ]

labels: library-update, early-semver-patch, semver-spec-patch, commit-count:1

Superseded by #41.


Node Pool instance upgrading: Status Ready should not be true

What happened?

After upgrading the spec of an already existing NodePool instance, the Ready condition still equals to true even though the external resource is upgrading, and the reconciliation is failing:
    conditions:
    - lastTransitionTime: "2020-02-21T16:17:47Z"
      reason: Successfully resolved resource references to other resources
      status: "True"
      type: ReferencesResolved
    - lastTransitionTime: "2020-02-21T16:19:51Z"
      reason: Resource is available for use
      status: "True"
      type: Ready
    - lastTransitionTime: "2020-02-21T16:53:54Z"
      message: 'update failed: cannot update GKE node pool: googleapi: Error 400:
        Operation operation-1582303999451-a7a3286d is currently upgrading cluster
        default-app-kubernetes-8tkrh. Please wait and try again once it is done.,
        failedPrecondition'
      reason: Encountered an error during resource reconciliation
      status: "False"
      type: Synced

How can we reproduce it?

Create a NodePool
Update NodeConfig in the api object
Observe the CR status

What environment did it happen in?
Crossplane version: v0.8.0
stack-gcp version: v0.6.0

@soorena776 this is an interesting case because the node pool is in the state that GCP refers to as Reconciling. We currently do not mark this as Unavailable in either the GKECluster or NodePool types. It is not abundantly clear to me that these resources should be marked as Unavailable since I think they are still usable when in this state. If I am correct in that, I think the Synced: False status is sufficient here. Are you aware of if the NodePool can still be used in your current status?

I recently verified that NodePools working as expected while working on https://github.com/crossplane/provider-gcp/issues/361


Docker container won't start on Windows Server 2019

Docker container (Version 0.4.5, with latest Docker Version) won't start on Windows Server 2019.
It's stuck on "Waiting for postgres to be available..."
Original Ticket was opened more than A YEAR ago without any kind of reaction:
https://github.com/stellar/quickstart/issues/229

What command are you running to run the quickstart image?


create_engine() missing 1 required positional argument: 'engine_opts

I'm trying to use db.create_engine to connect to a second database in a view. My app was working yesterday, but after I tried it on a new machine with a fresh virtualenv, it's no longer working. I think this is due to the changes in #684.
x = 'postgres://*****'
engine = db.create_engine(x)

create_engine() missing 1 required positional argument: 'engine_opts'

db.create_engine(sa_url, {})

db.create_engine(sa_url, {})
# or, more thoroughly
db.create_engine(sa_url, db.get_options(sa_url, echo=False))

I suppose it's not obvious from the docs, but I don't think this method was ever meant to be used the way you're using it. It's there to override how the engine is created, but it's called from within another method, get_engine, which is part of the extension's standard behavior.

@davidism   thank you that actually worked db.create_engine(sa_url, {})
what is the method for my situation then ? should i go back to SQLALchemy instead?

The method is to make the change that you just tried. Then your code works.

@davidism  yes david it does but i've been chating with lots of ppl on stackoverflow , i think 2 of them with very respected rep. have advised me not to use the library ( flask_sqlALchemy ) and use SQLALchemy instead , that would be the best for my situation but they didnt explain why .
now u said it as well , is there is something i should know about ?? will i be stuck in the future because of this decision ?

If you really want to create an engine on your own, you should use SQLAlchemy directly and don't use db.create_engine().
If you want to have connections to multiple databases, FSA supports that with "binds": https://flask-sqlalchemy.palletsprojects.com/en/2.x/binds/


v2 Pie chart legend HTML

If I use the data structure from the example (https://github.com/nnnick/Chart.js/blob/v2.0-dev/samples/pie.html), and then call generateLegend() the returned response is a bit squiffy because backgroundColor is an array and it is using the label property of each dataset object.
I don't know if I'm making too many assumptions about the data but I think it makes more sense to use the labels property of the data object?
Easy to fix using a different default legendCallback for pie charts
You can see an example here: http://jsbin.com/roqacurote/edit?html,js,output

@danclaydonpm I believe that this was fixed in v2.0.0-beta1

Closing as this has been fixed.


build fails with use_frameworks.  BaseTextProps.h file not found

I'm trying to build the app using static linking with the following line in my Podfile.
use_frameworks! :linkage => :static

The build fails with the following issue:
/project/node_modules/react-native-animateable-text/cpp/react/renderer/components/JBAnimatedText/ParagraphProps.h:14:10 'react/renderer/components/text/BaseTextProps.h' file not found

Steps to reproduce:

npx @react-native-community/cli@latest init AwesomeProject (version 0.76.1)
yarn add react-native-animateable-text (version 0.14.1)
edit the Podfile, add the above-mentioned code before target 'AwesomeProject' do
bundle install and bundle exec pod install
build the app from Xcode (Version 16.0 (16A242d)) on macOS 14.7 (23H124)

Thank you @vargajacint we will look into this

Should be fixed in new release 0.14.2, thank you @jonahgervasi @vargajacint

@WadhahEssam Thank you! It solved the issue


Option to hide internal tables in Hasura

Configure Hasura to exclude internal tables from generating a GraphQL API based on a specific naming pattern.
Indexer config should have an option to skip dipdup_* tables. And maybe arbitrary ones. Like this:
hasura:
  url: ...
  ignore_internal: true
  ignore:
    - some_user_table

I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
I am a backend  developer with years of experience skilled in python, solidity and cairo.
How I plan on tackling this issue
I'd find the hasura configuration file and include an sql function to exclude specific functions. ETA 2 days

I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
I'm a fullstack and smart contract developer. I've contributed to Projects here on onlydust
and with that experience, I would handle this task as expected. This would also be my first time
contributing to this project.
How I plan on tackling this issue

Set Up Hasura Metadata Config: In the Hasura configuration, I will specify which tables to expose in the GraphQL schema. Use the ignore option to exclude specific tables and ignore_internal to skip internal tables like dipdup_*.

Update Metadata API: Hasura offers a metadata API that allowsto update the visibility of tables based on their names or patterns (like dipdup_*).

Ignore Tables Based on a Pattern: Since I want to exclude tables that follow a certain pattern (e.g., dipdup_*), I'll need to add a script that fetches the metadata for all tables and updates it to ignore any tables that match the naming pattern.

YAML Configuration Example: I will manually list specific tables to ignore or set an internal flag.

Script to Automate Exclusion: Write a script that calls Hasura’s metadata API and excludes tables based on the defined patterns (e.g., tables that start with dipdup_). This script will be integrated into the  build or deployment process to automate the exclusion.

Call Hasura Metadata API.

Custom Logic for Pattern-Based Skipping: To skip tables with specific patterns like dipdup_,  I will have to filter tables in  the script to, Fetch all tables via Hasura metadata, Filter out tables matching the dipdup_ pattern, send an update request to Hasura to exclude those tables.

ETA: 48hrs

I am applying to this issue via OnlyDust platform.
My background and how it can be leveraged
I am a python dev. A new-comer here, willing and ready to contribute to solve this issue.


Building arm compatible containers

Has anyone used this plugin to build arm compatible containers and upload to ECR ? I have the buildx plugin installed but it looks like the necessary docker build commands now need to be docker buildx build commands.
Is this easy to do with this plugin?

Nevermind. I thought this plugin also built the containers.


feat: allow livestream to be disabled by filtering on roles

Add functionality to hide or enable livestream based on specified roles.
In admin, theres a new field to add "livestream roles".

nice if we can merge this tomorrow so that i can get it into the next mobile app release


Provide an easier way to get uproxy log into the clipboard or a file

Currently, to get bits of logged messages, we go into the console and copy/paste sections. This is slow, means we only get the console stuff, and makes debugging more difficult. We should make a better, more user-friendly way for a user to get the log messages out of uProxy.

This is being done as part of #832 (submit feedback in UI)


generation with provided beginning?

for example, if someone wants a keyboard sinfonia,  just write down the first few bars and the model can continue the music.

That's possible. The generation algorithm can be modified to take "inspiration".

yay


Remove condition that prevents smoke test from running in minikube setup

I set up a Minikube cluster and discovered that kuberang was not installed on the machine. This prompted me to look into it, and realized that the smoke test is not being run for minikube-style deployments.

I've noticed this, Im curious to see if all the tests pass I dont know if @dasmb did this after seeing some failures in minikube

Failure is due to known kube-dns issue. Merging.


Fix rating and tags for groups with multiple series for Kodi

Fixes #250

@bigretromike I'm gonna leave this open, as there is a part not included in yours (the Title of the PR)

There's one more part I'm going to fix first, though. I noticed it on confluence. The year is not populated either, so I'll add it tonight (today, tomorrow, whatever time it is there...)

it is populating

ok by reverting it it is safe now ;-)

I was referring to a group with multiple series in it.

I just realized I had the op to ajin playing and it's in the screenie

Oh right, I turn that off when import collection once again.

For things like .hack, macross, gundam, anything with 3 or more seasons, etc, it is really useful, which is why I've gone through such effort to make it work.

I'm sure you've noticed I am very keen on aesthetics as well, so ever string needs to be formatted and presented neatly and concisely. Although, I realize some people don't like things exactly the way I do, so a settings list almost as long as the values they control is also a thing I do....

This is officially ready for merge, I will not push anymore to it. Same with the last aired PRs

Off-topic but have you joined our Discord server? It makes communicating much easier.

What is discord

Mk I now know what discord is.

It would have been kind of github to notify me that this no longer builds against master...

All better


Enable the new model serialization for databox edge

Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.

API change check
APIView has identified API level changes in this PR and created following API reviews.
Azure.ResourceManager.DataBoxEdge


Release 3.2.1

this release is the first without Puppet 4/5 in the CI matrix. While those are EOL and no code was dropped specific for those versions, it's still debatable if it's a patch release or a major change.

this release is the first without Puppet 4/5 in the CI matrix. While those are EOL and no code was dropped specific for those versions, it's still debatable if it's a patch release or a major change.


Revert prefill optimization and fix accuracy issue in shift operation

What does this PR do?
Reverts commits that introduces accuracy regression.

@regisss please check, need to revert few commits due to regression


Include all data in type conversion when type() is called on an nn.gModule.

Solving the following problem: currently, when type() is called for nngraph modules, the call is forwarded to the internal nodes of the module. However, the function should also convert the tensors stored in the module itself.

Can't we just do
nn.Module.type(self,type_str)
as far as I can see, that will loop over all the elements of the table self and recursively type them, or am I missing anything?

No, I don't think we can: the function recursiveType() only recurses into the array part of tables (i.e., keys 1, ..., #table). I did not want to change that behavior in nn.Module. Also, I wanted to preserve the fact that type conversion is deferred to the individual modules stored in gModule.


Add link to the official JavaFX bug tracker

In the top entry about "OpenJFX" on the entry page to jfx-central.com add sentence like this:
If you should detect some issue with OpenJFX, you can report it through the official Oracle Java bug database which can be found here: https://bugs.java.com/bugdatabase/

:-)

I did not mean this as a joke. In https://www.jfx-central.com/openjfx you talk about bylaws and licenses and how to become a contributor but the most basic form of contribution, writing bug reports, is not mentioned with a single word. I have always wondered why so many in the JavaFX community write so few bug reports. Maybe the reason is that how to do that is one of the best kept secrets of JavaFX.

Neither did I see it as a joke. I will add it!
Michael Paus @.***> schrieb am Mo. 15. Nov. 2021 um
11:33:

I did not mean this as a joke. In https://www.jfx-central.com/openjfx you
talk about bylaws and licenses and how to become a contributor but the most
basic form of contribution, writing bug reports, is not mentioned with a
single word. I have always wondered why so many in the JavaFX community
write so few bug reports. Maybe the reason is that how to do that is one of
the best kept secrets of JavaFX.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/dlemmermann/jfxcentral-data/issues/101#issuecomment-968753095,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACIXWXKCTUATR5J6HYI4RY3UMDOXDANCNFSM5H2XAZZA
.

--
Dirk Lemmermann
Software & Consulting
Zurich, Switzerland
+41-(0)79-800-23-20
http://www.dlsc.com
@.***

Done


updates versions of integrated tools

Several tools have been updated since our last image.

I'm having difficulty discerning the results. I'm not sure what it's actually failing on, but it is related to something with the tools.

Old fashioned debugging -revert and change one and a time until you find the one that fails. Fortunately that happened pretty quickly. WP-CLI was the failure. So, everything else has an update.


Strassen' Algorithm

Would it be okay to make a PR with this algorithm? Since it doesn't come under any existing algorithms.

Make a miscellaneous folder under pygorithms/pygorithms and then add the required algorithm


Provide Permify Testcontainers

Is your feature request related to a problem? Please describe.
Having a Permify Testcontainers module would allow to easily test systems using Permify.
Describe the solution you'd like
Provide official Permify Testcontainers module.
Describe alternatives you've considered
None
Additional context
https://testcontainers.com/

Hi from the Testcontainers for Go community! 👋
Please let me know if you need any assistance with the creation of the module. We have a module guide, and community examples (aerospike, keycloak, flyway and spicedb).
Please use them as reference or ask us anything you need, we'll be more than happy to assist 🙇

@michelkaeser if you're using Go, I created a community module that you can use in your tests:
https://github.com/theoriginalstove/testcontainers-permify


Stacked bar chart and table inconsistency

Fixes a minor inconsistency between stacked bar charts and tables.

 Adjust stack bar chart


Callbacks unregister properly in nested contexts

Previously unregistering callbacks would replace the existing set of
callbacks. Now we mutate that set in place to reset it (matching the
behavior of set_options). Fixes a leaking ResourceProfiler in the
distributed test suite.
Fixes https://github.com/dask/distributed/issues/1597.

Good to merge @pitrou?

I think it would be nice to have a test for the leak issue, to ensure it doesn't come back.

The test already added tests exactly that.

Ok, thanks. It was not obvious to me that this test checked precisely the condition that led to the issue. LGTM, then :-)

Thanks for the pytest checks that made this easier to find and diagnose :).


Set shell to bash in reusable_build_and_upload_rerun_c.yml

What
Fixes build error: https://github.com/rerun-io/rerun/actions/runs/5904663365/job/16017747131
Checklist

[x] I have read and agree to Contributor Guide and the Code of Conduct
[x] I've included a screenshot or gif (if applicable)
[x] I have tested demo.rerun.io (if applicable)

PR Build Summary
Docs preview
Examples preview
Recent benchmark results
Wasm size tracking

thanks!


Two suggestions: - Context menu alternative to top bar icon / - Keyboard shortcuts

Hi,
Thanks for this extension, it's very nice!
It would be cool to have the possibility to get it in the context menu rather than in the top bar, I think it looks cleaner without any colored icons always there :)
Also, keyboard shortcuts for toggling PiHole and Adding to blacklist / whitelist would be amazing. For instance, this could even be used by a macOS touchbar custom button (with help of the amazing BetterTouchTool app)
Cheers

Hey,
the feature with the hotkeys is definitely something to look at.
What I don't understand is what you mean with "context menu" instead of the top bar.

Nice, looking forward to that 👍
Context menu = right click menu :)

Do you mean the context menu if you right-click into a page or which one?

Available with v2.3.

Available with v2.3.


Allow the client to pass options to the image maker when downloading an image

So we can specify things like the amount of cores for a ts4900 app, etc. The image maker accepts these options in requests, but the SDK doesn't expose this functionality.
This is required by the resinOS Tests project.
cc @telphan

Closing stale issues

Thanks @jviotti :pray:


Discrepancy between Glossary and Output results

Can you be more specific please? What is the discrepancy?

Yeah yeah, wait, it was a mistake that it got posted... I didn't put the description yet :)

While organizing the output values for the Total_Demand.csv, I realized there is a bit of discrepancy between what is in the .CSV file and the Documentation Glossary. Here is what I found so far:

Trww0_C exists in the documentation (under Scenario Outputs>Data>Peak Values), but it's not in the output of the Total_Demand.csv .

In the same section of the documentation (under Others) the value Vw0_m3 exists as the total fresh water consumption (cold + hot), while in the output I have Vw_m3yr,Vww0_m3,Vww_m3yr, so should the output value Vw_m3yr become Vw0_m3yr?

The values Vww0_m3,Vww_m3yr are not described anywhere in the glossary Data outputs.

The following values are in the documentation but not in the Total_Demand.csv file Eauxf0_kWh,Edataf0_kWh,Epro0_kW,Ef0_kW,Qcdataf0_kW,Qcref0_kW,Qcs0_kW,QCf0_kW,Qhs0_kW,Qww0_kW,QHf0_kW

Qhprof_MWhyr is one of the outputs, but it is not in the documentation.

Aroof_m2,GFA_m2,occ_pax are not mentioned in the Yearly Values, only occ_pax is mentioned in the Hourly Values.

That's all I found for now, I believe some of these comments might apply on the demand-per-building outputs as well... So I'll check that and report here.

In terms of the Demand Outputs per building, here are my notes:

Why aren’t the floor area part of the outputs?

Final electricity in industrial processes is abbreviated in the Hourly Values as Epro_kWh, while the same definition in the Yearly Values is written as Eprof_MWhyr, so shouldn’t we fix it to either Epro or Eprof?

Qhprof_kWh,Qww_tankloss_kWh,Ecaf_kWh,Tww_tank_C,Tsref_C,Trref_C,Tsdata_C,Trdata_C,mcpref_kWC,mcpdata_kWC are outputs in the .csv file but not in the documentation under (Hourly Values).

For the Embodied Energy and Operational Energy, I strongly suggest the following:

To change in the documentation the title Primary energy demand and emissions to Operational energy demand and emissions.

Differentiate between the names of the output results to the following:

For Embodied Energy E_ghg_ton,E_ghg_kgm2,E_pen_GJ,E_pen_MJm2

For Operational Energy O_ghg_ton,O_ghg_kgm2,O_pen_GJ,O_pen_MJm2

@daren-thomas @JIMENOFONSECA Who can be assigned this task?

@amraladdin i think you have identified different issues here and they are worth spliting in three:

discrepancies documentation and total_demand.csv
eprof and epro related comment
embodied energy and emissions folder.

would you mind creating a separate issue for each?
As for the first. I believe we maintain the documentation according to the tool outputs. So you can update this.
As for the second i can help.
As for the thrid, would you mind @martin-mosteiro making the changes?. It is an easy fix but you might want to cross check that these changes does not brake the benchmark graphs...

Sure, that's an easy fix. @amraladdin please assign the issue to me once you've created it.

Done :) Thanks!

Oh, sorry, I didn't read Jimeno's comment... Ok, I'll set the issues and assign @martin-mosteiro

@JIMENOFONSECA: Good call. Maybe we can add this to the contributors manual? An issue should be focused on one thing only?

Ok, I'm on it.

i agree


Rename item fragment name to title

What this PR does / why we need it:
Change name to title within the item fragment
Which issue this PR fixes (optional - uncomment and add issue):
fixes #163

This also needs a change in the layout for the items fragment.

oh yeah i missed that.

Alright. I'd change that. No one questions Hugo ways.


chore(main): release 0.12.3

:robot: I have created a release beep boop
0.12.3 (2024-11-15)
Bug Fixes

Dependencies of release workflow (#54) (863b43d)

This PR was generated with Release Please. See documentation.

:robot: Created releases:

v0.12.3
:sunflower:


Add parameters to URLs

From a sysadmin point of view, a sysadmin would like to search for schools, departments, courses, sections, etc. with a certain criteria. Criteria could be:

By parent (e.g. departments in a school, sections in a course, periods in a section)
By a search parameter (e.g. search by id, name, YACS search should have this built in)

The parent criteria would allow us to see sections of a course, etc.
Search parameter would be useful for a search bar

By parent completed


Come up with functionality ideas.

We all have a cursory idea of what our app should do, but we can individually come up with some things we'd like to have in there. We can use the beginning of the next class to go through all our ideas and decide what we'll actually implement.

I would like to see data synchronization and updates. You would be able to update your contact profile and publish that change to a central source, and would also have the ability to pull updates to your contacts.
Of course this would require a database & API, but it would be a relatively simple CRUD backend.


luci-app-pagekitec: add Japanese translation

Added Japanese translations.
Signed-off-by: INAGAKI Hiroshi<EMAIL_ADDRESS>
Question: Which of the tags
 and
 should I use as a newline?

 is not valid html, please use
 instead. For newline I would use
.

I see.

 tag used in original text merged in dcfc4569c483f4218cf41b26ef0f4dfed0441c55 , so I noticed it when I tried to translate and I was wondering if it was not right.
Should I also fix original text?

Sorry, I didn't check that correctly. The paragraph tag used in this manner (
) serves as a double line break. It does not contain text. Unlike the
 tag it cannot be used multiple times to generate more white space. Bottom line just leave it, it's OK.

Well then, is it okay to keep
?

Yep, ready to merge?

Yes, OK!

Thanks!

Thanks :)


macOS os_version fact reports the version of the Darwin kernel (instead of the macOS version)

Describe the bug
This technically isn't a bug, but basically, the os_version fact grabs the kernel version instead of the OS version, which is different on macOS. I think it is probably more likely that a user would want to get the macOS version, since that information might be used to construct a url for a file download, for example.
To Reproduce
pyinfra <host> fact os_version
Expected behavior
I think it would be more helpful to get the macOS version, maybe via system_profiler SPSoftwareDataType | awk '/System Version/ {print $4}' although not sure if using awk is the best option.

Using sw_vers could also work.
❯ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.6
BuildVersion:   17G14033

I think this is a bug - os_version should definitely return the MacOS, not Darwin kernel, version. I'm also going to add an explicit kernel_version fact which will return the Darwin version.

Update - don't want to break anything here - better safe than sorry so I'm going to:

deprecate os and os_version facts and rename to kernel / kernel_version
add a new macos_version fact

I have added the new fact in https://github.com/Fizzadar/pyinfra/commit/f15c30e89a066baf5f9755b62de66d891ea56cf8 & renamed/deprecated the others in https://github.com/Fizzadar/pyinfra/commit/57da13fcb986b245e6755e1ead7226b324c3d366, pending 1.3.7 release shortly!


Deploy to Azure using Azure Extension - Throwing error

Deploying the solution throws error. Somehow after successful deployment site is not able to browse to Tab html pages. Need to update Virtual Directory location to dist\web folder. It works after point virtual directory to dist\web folder.
But at this point Bot endpoint api\messages comes as Not Found 404.
Is your feature request related to a problem? Please describe.
The problem is, after generator creates the solution. Using Azure Extension, deploying to Azure App Service throws error.
Describe the solution you'd like
Documentation for exact steps to deploy to Azure Web App
Describe alternatives you've considered
I have tried following these links
microsoft docs for nodejs deploy on azure
bot deploy to azure

Hi, please avoid using the direct Git deployment and use a solution like zip deployment from Azure DevOps (https://www.wictorwilen.se/blog/deploying-yo-teams-and-node-apps/) or through Azure CLI (https://docs.microsoft.com/en-us/cli/azure/webapp/deployment/source?view=azure-cli-latest).
We've even removed the default git deployment files and instructions from the latest release, due to quite a few issues with it.


manual_control.py uses hard-coded port 8000 for TM

I'm running several Carla instances through Docker and map the Traffic Manager port, but manual_control.py includes the manual_control.py in the examples folder that uses default port. This causes a runtime error in KeyboardControl constructor, world.player.set_autopilot(self._autopilot_enabled).
Steps to reproduce:

Run Carla in Docker and don't expose port 8000.
Run scenario runner with appropriate --host, --port and --trafficManagerPort arguments.
Run scenario runner's manual_control.py.

Expected behavior
pygame window appearing with a vehicle to control.
Actual behavior
Crash with message:
Traceback (most recent call last):
  File "manual_control.py", line 220, in main
    game_loop(args)
  File "manual_control.py", line 148, in game_loop
    controller = KeyboardControl(world, args.autopilot)
  File "/home/adam/carla_apis/PythonAPI_v0.9.10/examples/manual_control.py", line 292, in __init__
    world.player.set_autopilot(self._autopilot_enabled)
RuntimeError: trying to create rpc server for traffic manager; but the system failed to create because of bind error.

Hey @Kipt. That is indeed the case. However, this isn't an SR problem but a CARLA one, as we are only inheriting from that class. I'm moving to the CARLA repository


Trying to fix CodeQL missing ref

Current dependencies on/for this PR:

main

PR #722   👈

This comment was auto-generated by Graphite.


feat(authForm): created user get logged in

new created user gets logged in automatically

fixes #25


Benefit of pass-by-reference of strings in CHECK_EQUAL_STR

Our implementation of CHECK_EQUAL_STR (and all other string assertions) require to use pass-by-reference parameters for string comparison like
	string expected = "abc"
	string value = DoSomething()
	CHECK_EQUAL_STR(expected, value)

as pass-by-value parameters would be more appealing.
	CHECK_EQUAL_STR("abc", DoSomething())

The implementation for variable and wave comparisons are all pass-by-value. There is no obvious benefit for me to use pass-by-reference for strings as we aren't expected to change the value inside the assertion. There is a small speed difference but this is negligible because we aren't doing a performance test.
Constant MAX_LOOP = 10000000
Constant MAX_STR  =  1000000

Function run()
	string text = ""
	variable i, timer, timeMs

	for(i = 0; i < MAX_STR; i++)
		text += "0123456789"
	endfor

	timer = StartMSTimer
	for(i = 0; i < MAX_LOOP; i++)
		PassByReference(text)
	endfor
	timeMs = StopMSTimer(timer) / 1000
	printf "pass-by-reference: %f s\n", timeMs / 1000

	timer = StartMSTimer
	for(i = 0; i < MAX_LOOP; i++)
		PassByValue(text)
	endfor
	timeMs = StopMSTimer(timer) / 1000
	printf "pass-by-value:     %f s\n", timeMs / 1000
End

Function PassByReference(string& value)

End

Function PassByValue(string value)

End

•run()
  pass-by-reference: 0.692850 s
  pass-by-value:     0.813021 s

What could we gain if we are using pass-by-value for all assertions? Simplicity. The user has to write less code lines, doesn't need to reserve string variables for expected and returned states and don't have to think about when to use pass-by-reference and pass-by-value.

The main reason to use pass-by-reference back in 2012 was that this allows to check for null strings.
#include "unit-testing"

Function Test()
	string null, empty = ""
	CHECK_NEQ_STR(null, empty)
End

But as it turned out this has little practical value. Especially since we nowadays have the special assertions CHECK_NULL_STR/CHECK_EMPTY_STR/CHECK_PROPER_STR.
If we change it to pass-by-value we should also error out probably if a null string is passed.

I have played with the following code:
#include "unit-testing"

Function run()

	string null, empty = ""

	printf "IsNull(&null):  %d, RTE: %d\n", CheckReference(null), GetRTError(1)
	printf "IsNull( null):  %d, RTE: %d\n", CheckValue(null), GetRTError(1)
	printf "IsNull(&empty): %d, RTE: %d\n", CheckReference(empty), GetRTError(1)
	printf "IsNull( empty): %d, RTE: %d\n", CheckValue(empty), GetRTError(1)

End

Function CheckReference(string& value)
	return UTF_Utils#IsNull(value)
End

Function CheckValue(string value)
	return UTF_Utils#IsNull(value)
End

•run()
  IsNull(&null):  1, RTE: 0
  IsNull( null):  1, RTE: 185
  IsNull(&empty): 0, RTE: 0
  IsNull( empty): 0, RTE: 0

It is correctly detecting the null in both cases but for one case we have a pending RTE. If the debugger is enabled it will always be opened without a chance to catch this error at a later point.
The null string handling in Igor is a bit weird as its only throwing an exception if null is used in a pass-by-value context but keeping the original value and continue working fine (1). We can catch this exception and treat this as an assertion error. But the thing is: we never know if this error was thrown because of providing the null value or if this was a user error in a previous statement. Another thing is that CHECK_EQUAL_STR(null, null) will always be an assertion error (I except this to be equal).
I can only think of this solution: Make *_STR(...) as pass-by-value to simplify the usage in most use cases and if a null was provided treat this as an assertion error. Also add *_STRREF(...) variants which use pass-by-reference and can handle null values well without an error. The *_STRREF variants are only used when a null value is expected.

Side Note (1): I am used from other programming languages that pass-by-reference and pass-by-value doesn't change something if a null is allowed or not. There are only runtime errors if I access the content of a null value or compiler errors if I provide a possible null value to an argument that doesn't support null.

WM could also add string/Z (like Wave/Z) to explicitly allow null values.

Conclusion:

Change *_EQUAL_STR()/*_NE_STR() to use pass by-value, keep the wrapper function signatures
Treat RTE 185 due to passed null string as assertion error and clear RTE (WARN/CHECK_REQUIRE)


Namespace Table Names

With Ghost being used more and more as a dependency it is increasingly likely that collisions in table names may arise. names like user and permission are rather common.
Table Name should be changed to include a general namespace, preferably one that indicates that the table is used by ghost, or relates to the general functional component the table is used for.
For example:

ghost_core_setting
ghost_core_app
ghost_core_app_setting
ghost_core_post
ghost_core_tag
ghost_auth_user
ghost_auth_role
ghost_auth_permission

This is also a good set up for standard naming conventions when pluggable apps are a thing.
table names can follow ghost_[APP]_[MODEL]

Also, and this might be more of a problem with bookshelf, but the generated many-to-many tables are created with foriegn keys, they are just integer fields set to NOT NULL. The columns should be FKs ( indexed w/ constraint ).

even better it should be configured via a config.js param..

I don't think table names should be exposed to via configuration. Somethings just need to be known, and things in the database tend to be one of them. Especially when the ORM is not a part of the project. Making migration tools, and the ability to deploy direct SQL with applications become exceptionally brittle.
I'm a fan of making most things driven by configuration. Aside from connection settings, the database has to be one of the things you can count on.

I'm sorry I havent been clear enough: I tought talbe name prefix should be configurable.
Thus avoiding collisions of multiple ghost blogs in the same db etc.

Hi @esatterwhite,
Third party development shouldn't really be taking place inside the Ghost database.  If someone really decides to throw caution to the wind and hijack it for their own development the burden should be on them to prevent collisions.


archlinux packaging & required fixes

You can read about initializer list problem here:
http://stackoverflow.com/questions/26947704/implicit-conversion-failure-from-initializer-list
I'm not expect you to merge this pull request. You can just take a look at tests' fixes and apply them if necessary.

Thanks for this PR, but I can merge it only after Travis accepts it. Please see what's going wrong there.


Refactor unit tests to use standard unittest assertion methods

What does this PR do?
This PR updates the unit tests in the repository by replacing direct assertions with unittest assertion methods.
The purpose is to standardize the testing practices and make the tests easier to read and maintain. Additionally, this PR merges the latest changes from the main branch to ensure consistency.
Fixes #2137
Before submitting

[ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
[x] Did you read the contributor guideline,
Pull Request section?
[x] Was this discussed/approved via a GitHub issue? Please add a link
to it if that's the case.
[x] Did you make sure to update the documentation with your changes? Here are the
documentation guidelines.
[ ] Did you write any new necessary tests?

Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Wonderfull! Thanks @ccs96307
Can you also replace pytest.raises(...) by self.assertRaises(ValueError)?

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

and make sure to run make precommit

Hi @qgallouedec, thank you so much for taking the time to review my PR. I really appreciate your suggestions.
I'll replace pytest.raises(...) with self.assertRaises(...) as you recommended, and will also make sure to run make precommit to get everything aligned with the project's guidelines. Thanks again for your helpful feedback—I’ll get these changes pushed soon!

Hi @qgallouedec, I've noticed that the tests (3.11, windows-latest) failed due to the following error:
FAILED tests/test_nash_md_trainer.py::TestNashMDTrainer::test_nash_md_trainer_judge_training_0_standard_prompt_only - ValueError: Cannot find pytorch_model.bin or model.safetensors in C:\Users\runneradmin\.cache\huggingface\hub\llm-blender\PairRM
FAILED tests/test_nash_md_trainer.py::TestNashMDTrainer::test_nash_md_trainer_judge_training_1_conversational_prompt_only - ValueError: Cannot find pytorch_model.bin or model.safetensors in C:\Users\runneradmin\.cache\huggingface\hub\llm-blender\PairRM

These errors seem to be unrelated to my changes, as the tests passed locally and the files I edited do not directly involve this functionality. I suspect this might be a network issue or a cached problem on Windows?
Could this be a common issue you've seen before? If there's anything I need to change or investigate further, please let me know.

Could this be a common issue you've seen before? If there's anything I need to change or investigate further, please let me know.

Yes, don't worry, not related with your PR, it will be solved in #2276


FB bots

GUYS HELP.... ..
Can anyone tell me how to make bots connect only with generated tokens

come on skype i help you  my skype didi15101994

@dada211 i dont use skype can you please send me the script in gmail

@dada211 hey can u add me skype ?


CI: K8sDatapathServicesTest Checks N/S loadbalancing Tests with direct routing and DSR

Stacktrace

/home/jenkins/workspace/Cilium-PR-K8s-1.26-kernel-net-next/src/github.com/cilium/cilium/test/ginkgo-ext/scopes.go:515
Can not connect to service "tftp://[fd04::11]:31852/hello" from outside cluster (6/10)
Expected command: kubectl exec -n kube-system log-gatherer-wbhjl -- curl --path-as-is -s -D /dev/stderr --fail --connect-timeout 5 --max-time 20 tftp://[fd04::11]:31852/hello -w "time-> DNS: '%{time_namelookup}(%{remote_ip})', Connect: '%{time_connect}',Transfer '%{time_starttransfer}', total '%{time_total}'" | grep client_address=
To succeed, but it failed:
Exitcode: 1
Err: exit status 1
Stdout:

Stderr:
 	 command terminated with exit code 71

Jenkins: https://jenkins.cilium.io/job/Cilium-PR-K8s-1.26-kernel-net-next/514/testReport/Suite-k8s-1/26/K8sDatapathServicesTest_Checks_N_S_loadbalancing_Tests_with_direct_routing_and_DSR/
Sysdump:
cilium-sysdump.7z.zip

Seen on #28972 (against v1.13 branch): https://jenkins.cilium.io/job/Cilium-PR-K8s-1.26-kernel-net-next/1032/
cilium-sysdump.zip


Sidebar with internet explorer

the sidebar with internet explorer (all versions) it is broke and impossibile to use. can you help me please?
I must to open compatibility and disable the flag.
Why the  meta http-equiv="X-UA-Compatible" content="IE=EDGE"  don't force the browser?

Hi,
Could you send a screenshot and more info for see the error?
(Note: This theme compatible with IE10 and up versions & IE Edge. I tested for these versions.)


Spread operator should not have worse ergonomics than apply - unexpected error spreading a union-of-tuples

Bug Report
Attempting to spread a union-of-tuples that is otherwise compatible with the function being called results in an unexpected compiler error:
4.3.5+ "A spread argument must either have a tuple type or be passed to a rest parameter."
3.33-4.2.3 "Expected 2 arguments, but got 0 or more."
However, calling apply on the function with the same union-of-tuples does not produce an error, and neither does calling the function "memberwise" using indexes into the union-of-tuples. In both the apply case and the memberwise case, the user is getting the benefit of some level of typechecking, whereas when using the spread operator, the user is met with a hard error.
The error message is confusing, but more confusing is why there would even be an error. I am opening this issue primarily to address the error, not the message.
Since there is a very clear relationship between apply, a memberwise call, and the spread operator, it is perplexing why spread does not work in this case. I imagine that hitting this kind of error might make JS switchers to TS quite confused and possibly cause them to abandon ship. That same relationship between spread (which does not work as expected) and apply (which works adequately) also points to at least one possible path to implementing the desired behavior of successfully typechecking a spread involving a union-of-tuples.

🔎 Search Terms
spread, apply, union of tuples, A spread argument must either have a tuple type or be passed to a rest parameter

🕗 Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about spread

⏯ Playground Link
Playground link with relevant code

💻 Code

// A function that takes two arguments:
function fn(a: string | number, b: string | number) {
    console.log(a, b);
}

// A union-of-2-tuples type
type T = [string, string] | [number, number];

// A union-of-tuples variable
let t : T = Math.random() > 0.5 ? ["A", "B"] : [1, 1];

// Can we call the fn member-wise with a union-of-tuples? Yes.
fn(t[0], t[1]);

// Can we call the function through apply with a union-of-tuples? Yes.
fn.apply(null, t);

// Note that in both cases above type checking is happening!

// Can we spread the variable? No.
fn(...t); // ERROR: A spread argument must either have a tuple type or be passed to a rest parameter.

🙁 Actual behavior

In the code above, you can see that we have a variable t that is a union-of-tuples.
Each tuple in the union is type-compatible with the function fn.
You can see that we are able to call the function using the members of t without any casts nor compiler errors: fn(t[0], t[1]).
You can also see that we are able to pass t to the function in one go using apply: fn.apply(null, t). Again, this is successful and has no casts or other code artifacts.
Finally, we attempt to call the function by spreading t: fn(...t). This alone causes the compiler to produce an error.
🙂 Expected behavior

I would expect the code using the spread operator, fn(...t), to succeed, just as the apply and memberwise versions succeeded.

Is this a same issue or should I create new one?
function foo(first: string, ...rest: string[]) {

}

foo(...["a", "b"]) // <- A spread argument must either have a tuple type or be passed to a rest parameter.

https://www.typescriptlang.org/play?ts=4.7.4#code/GYVwdgxgLglg9mABMOcAUwYCcDOUBcieWMYA5gDSIB0tWApnocaWQNoC6AlIgN4CwAKCEBfIUJTpa1NgCIAhrKqyARrO5A

I've implemented a version of a function call type-checking algorithm that involves spread and there weren't any particular challenges. It's a demo/POC  - not a changelist - using a mini-parser with no generics or type inference, but it might be useful if anyone is going to take a look at improving TS support for spread.

These are interesting test cases, but I don't have a PR, it's a demo and it doesn't involve generics or inference. TS' spread support is currently a bit limited in non-generic, explicitly-typed code which is why I opened this issue with code that doesn't involve generics or inference.
It's not obvious to me that inference is the blocker on improvements to spread support, but I assume by your test cases that's a concern for you. In the first code you provide, I see that x is inferred as string | number | boolean and the function produces a corresponding failure on the assignment. That seems reasonable to me. Similarly, despite the size of the tuple with ~820 members on your second test case, TS seems to infer the types OK. Maybe I shouldn't trust the current inference results because of the failure on the spread itself? I had imagined that inference happened before the stage that produced the spread error, and maybe that's not true, but first results are hopeful.
Ignoring inference for a moment, the 2nd test case is clearly intended to test large unions. In that test case, WindowKeys is a union of single member tuples with ~820 members and if inference has already happened T is also a union with the same number of members. The basic algorithm for spreading would deunionize the argument union and test its single member for compatibility with the parameter union and it would do it 5 times for the whole function: so 820 x 5 typechecks of a literal against an 820 member union. It's not obvious that this is too expensive, but there are opportunities for both optimization and parallelization. For both of these, we recognize that the union consists only of tuples of the same length. Instead of deunionizing the argument, we can unionize each element of the argument tuples and typecheck that against the type of the relevant parameter. In this case, it's the same type, so I expect it'd be a pretty quick type check. So element unionization once and then 5 quick comparisons.
It's hard to describe optimizations without knowing exactly the current implementation and without measuring particular operations. Given how WindowKeys has been defined, it might be crazy cheap to get back to key typeof window which is what we're really going to end up comparing. Parallelisation is similarly possible once you recognize that if you have fixed lengths, you can do the arg to param mapping first and then parallelize the type checking.
The way I think about it is this: there's a dead simple algorithm that might be slow in the presence of large unions. Knowing if you have a large union is surely super cheap, so if you don't have the payroll budget for optimization, during compilation you can check the conditions that might blow your runtime budget and produce a compile error. In other words, error only when you see the big unions, and otherwise use the simple algorithm for most cases where there aren't large unions. That's step 1. But, yes, there are optimization possibilities for large unions.
Does TS have a defined runtime budget for particular type-checking operations?
If you want to point me at the relevant code in your codebase, I'd be interested to take a look, but it's unlikely I'll be producing a PR.

Non-generic test case that fails in Typescript 4.7.4:
declare function fn(p0: number, p1: string, ...rest: string[]) : void;
declare const a0 : number;
declare const a1 : string[];
fn(a0, ...a1);

Playground 001
Expected: no error
Actual: "A spread argument must either have a tuple type or be passed to a rest parameter."
Presumably TS is failing because a1 could be an empty array, leaving parameter p1 unfilled.
However, this is too strict, because the following also fails yet the code ensures parameter p1 will be filled:
declare function fn(p0: number, p1: string, ...rest: string[]) : void;
declare const a0 : number;
declare const a1 : string[];
if (a1.length >= 1) {
    fn(a0, ...a1);
}

Playground 002
If TS was able to handle to the length check, it would be acceptable to fail the case that doesn't check the length. But TS doesn't use the information that the length has been checked, so I believe it would be better to allow both cases instead of preventing both cases.

Another unexpected compile error:
declare function fn(p0: number, p1: string, p2?: number) : void;
declare const a0 : number;
declare const a1 : ([string] | [string, number]);
fn(a0, ...a1);

Playground 003
Expected: no error
Actual: "A spread argument must either have a tuple type or be passed to a rest parameter."
It should compile because the required parameters are guaranteed to be filled.
This one is interesting because we can compare it to this case which does compile, so tuple unions occasionally work:
declare function fn(p0: number, p1?: string, p2?: number) : void;
declare const a0 : number;
declare const a1 : ([string] | []);
fn(a0, ...a1);

This is a fun one because we get a new error message:
declare function fn(p0: number, p1?: string, p2?: number) : void;
declare const a0 : number;
declare const a1 : ([string] | [string, number]);
fn(a0, ...a1);

Playground 004
Expected: no error
Actual:
Argument of type 'string | number' is not assignable to parameter of type 'string | undefined'.
  Type 'number' is not assignable to type 'string'.

Where does Argument of type 'string | number' come from?
...a1 is either a single argument of type string or 2 arguments of types string and number. If we combine them we could get an argument of type string and an argument of type number | undefined. I'm not seeing how string | number could be relevant here.

You can see the spread checking demo at https://callionica.github.io/typescript/type-demo.htm

Taking a glance through the TS code in checker.ts. I see that tuples (but not arrays or iterables) are expanded in getEffectiveCallArguments and later hasCorrectArity forces the spread argument returned by getSpreadArgumentIndex to start at optional/rest parameter position. (I think that code in hasCorrectArity does not apply to tuples as a result of the earlier expansion).
Looks like the spread checking code in hasCorrectArity is the cause of the errors produced in Playground 001 and Playground 002 above.

It would be nice for very simple cases to not have this issue, for example:
declare function doStuff(name: string, age: number): void
declare function doStuff(employeeId: number): void

declare const args: [string, number] | [number]

// Error described in this issue:
doStuff(...args)

// No error:
if (args.length === 1) {
    doStuff(...args)
} else {
    doStuff(...args)
}

Essentially, if the tuple union can be trivially turned into a single type via a simple condition (such as length) – would it not be possible to iterate over the conditions in the first doStuff(...args) call and allow it if all pass?

A quick update for v5.0.4
Original repro fails as originally described
Playground 1 fails as originally described
Playground 2 fails as originally described
Playground 3 fails as originally described
Playground 4 fails as originally described
Playground 5 fails as originally described
So no change in behavior with these repros.
I'm not sure how I should understand the "Suggestion" label on this bug, but I just want to repeat that I believe that users see this behavior as a defect in TS.

Not sure what's confusing about my update. I opened this issue to describe buggy behavior in July 2022 and my update is to say that the buggy behavior is still present in TypeScript as of 5.0.4 in April 2023. Hope that helps.

It'd be great to have better behavior here. One time this comes up is eslint giving prefer-spread errors and then ts saying you can't spread a union of tuples.

This is still an issue in 5.4.2.
I didn't check all the playgrounds this time, but I did check the first one and that still reproduces.

Related on Stack Overflow: spread argument union of tuples


Fix pvalue validation to accept very low numbers.

Also - pvalues should never be 0.

@ljwh2 @eks-ebi - this is now deployed in sandbox and ready for testing.
Here are the changes I've introduced:

p-value must follow the scientific notation and it cannot be 0 (zero). If it's 0 or a standard double value notation is used, the validation will fail
a maximal value for the exponent of -5 (which is the same as it was before) with no lower bound - e.g., it can be -1000 if it has to. I can, however, introduce this lower bound if you want.

Please let me know if this conforms with your expectations.

Agree with this and exponent should have no lower bound

Other relevant tickets: GOCI#271 - need to ensure rounding is working properly, GOCI#210, consider whether upper threshold could be 9.5E-6 rather than 1E-5

Tested submission here: http://<IP_ADDRESS>/gwas/deposition/submission/5fa15b73f59a3b00016d5f23
P-values tested:

1e-6 passed
0.000001 (same as above but as float) failed Associations: Column 'p-value' in row(s) [6, 8] contains incorrect value. Expected p-value exponent should be in the range: '-'
9e-5
0 failed Associations: Column 'p-value' in row(s) [6, 8] contains incorrect value. Expected p-value exponent should be in the range: '-'
1e-1000 passed
9.95e-6 passed

Besides the strange missing values in the error message - which I need to look into ... are any of the examples above inappropriately validated?

Updated my comment above with a second test. @tudorgroza, above you said that the criteria are

a maximal value for the exponent of -5 (which is the same as it was before)

That's wrong, I think it should be a maximal value for the exponent of -6 (i.e. it should fail if it is -5)

I see ... ok ... I need to think :) Thank you.

Fix deployed in Sandbox.

Tested with the following p-values:

row number in template
p-value
expectation

5
1.1e-5
expected to fail

6
1e-5
expected to fail

7
9.9e-6
expected to pass and round up

8
9.5e-6
expected to pass and round up

9
9.4e-6
expected to pass and round down

10
9e-5
expected to fail

11
9e-1000
expected to pass and round up

Result:
see http://<IP_ADDRESS>/gwas/deposition/submission/5fa41716ce8e310001e61d79
Error message:
Associations: Column 'p-value' in row(s) [5-6, 10] contains incorrect value. Expected p-value exponent should be in the range: '1.0e-5 -'
Conclusion:
The validation performed as expected - p-values ≥ 1e-5 failed validation, while those < 1e-5 passed. This is correct.
Associations with very small p-values (e.g. 9e-1000) passed validation, as they should.


Wondering the proper way of normalization on my own data

My operating system: ubuntu16.04
My tensorflow version: 1.3.0
My python version: 3.5

I'm noticing that you've done a normalization process before feeding the 2d pose data into the network, I've been working on the normalization stuffs days, but still get poor performance,
The ways that I have tried:

using the data_mean_2d & data_std_2d

train_set_2d, test_set_2d, data_mean_2d, data_std_2d, dim_to_ignore_2d, dim_to_use_2d = data_utils.read_2d_predictions(actions, FLAGS.data_dir)

calculating the mean & stddev of my own data.

I'm wondering if it's caused by the improper normalization. Could you give me some hints about what is wrong or the right way to do the normalization?

Hi @junjin8433,
I don't think this is enough information for me to say what's going wrong with your experiment. What do you mean by "my data" are these some different 2d detections? or different 2d-3d pairs? If it's only 2d, then yes, subtracting the mean and dividing by stdev should be all you need. All the transformations starting from raw SH detections are in the code.
Maybe if you want to share your data + a script to reproduce the error I could have a closer look.

The 'data' that i mentioned is just 2d points. My normalization code:
def normalize_data(data):
	mu = np.mean(data, axis=0)
	stddev = np.std(data, axis=0)

	print('mu: ', mu, ' stddev: ', stddev)

	return np.divide( (data - mu), stddev), mu, stddev

I do both the subtracting & dividing along the 'batch' axis, the data.shape is (296, 17, 2). 296 is the batch size, (17, 2) represents the keypoints that I extracted. I followed the description in data_utils.py and reordered my keypoints to match yours. The print information and the 3d result are as followed.

Oh, that does look pretty bad. Are these stacked-hourglass detections? I'm guessing they aren't.
If you have another detector, you might want to consider running it on h36m and re-training the 2d->3d network. (The rationale being that the nework migh thave learned the particular errors of SH, so it may not work out-of-the-box on the output of another detector).

Oh something else just occurred to me. Are you using our pre-trained model with SH detections? If so, to normalize your 2d data you should use the mean and stdev of SH detections, not the mean and stdev of your data.

Closing for lack of activity. Please reopen if necessary.


Handle both lumped and split biomass function

Some models (e.g. community models, older models) employ split biomass functions that will fail most of the biomass function tests. Make the testing procedure robust against them.

Is there some way to manage that? (pick one of the biomasses?) Or does that need to completely modify the test suite?

It requires us to identify when this happens and then dramatically change the test function unfortunately. Basically the biomass function for the older models looks something like this:
arginine + proline + ... + cysteine -> amino_acids
lipid_1 + lipid_2 -> all_lipids
...
amino_acids + all_lipids + ... -> biomass

I think they handle this in memote.py, but I forgot where...


Notifications - Show the icon of the service

Is your feature request related to a problem? Please describe.
Its not really a problem... its a feature request..
Currently the notifications shows the franz logo for me.
Describe the solution you'd like
Show the icon of the service which had the notification, e.g. if i get a message on whatsapp the icon should be the whatsapp logo (currently its the franz logo).

I think it's a great feature. Plan this, please