[CT-1874] [Bug] Erroneous Makefile variable causing make integration to fail

Is this a new bug in dbt-core?

[X] I believe this is a new bug in dbt-core
[X] I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior
My friend and coworker @seub has followed the Contributing guide for setting up the development environment for DBT-core, but repeatedly failed the make integration pytest suite. Many of the error messages referenced the fact that some environment variables weren't defined (the environment variables provided in the $CI_FLAGS variable). Looking into lines 66-69 of the makefile, there's this conditional statement contributed by @VersusFacit one or two commits ago:
.PHONY: integration
integration: .env ## Runs postgres integration tests with py-integration
	@\
	$(if $(USE_CI_FLAGS), $(CI_FLAGS)) $(DOCKER_CMD) tox -e py-integration -- -nauto

Because the variable $USE_CI_FLAGS is not defined anywhere, the conditional fails and the CI_FLAGS are not provided to the DOCKER_CMD. After removing the if statement and simply providing the $CI_FLAGS unconditionally, make integration succeeded.
Expected Behavior
I expected the make integration test to succeed after following the Contributing guide.
Steps To Reproduce
Create a fresh dev environment for dbt-core and try running make integration off the main branch.
Relevant log output
No response
Environment
- OS: macOS 12.2 (M1)
- Python: 3.9.10

Which database adapter are you using with dbt?
No response
Additional Context
Suggested solutions:

Remove the conditional from the Makefile (unconditionally providing the CI_FLAGS), line 69 becomes:

$(CI_FLAGS) $(DOCKER_CMD) tox -e py-integration -- -nauto

Update the contributing guide to use a different make tag than integration, at least until this issue is resolved.

UPDATE: Through communications in the dbt-developer slack, it's been revealed that the Makefile works as expected if the environment variable USE_CI_FLAGS is set, but this variable is not mentioned anywhere in the Contributing guide. If it's expected that users set this environment variable when testing dbt-core, they should be expressly instructed to do so in the Contributing guide.
So, consider potential solution number 3 to be "update the contributing guide to tell the user to set the USE_CI_FLAGS environment variable to true before running make integration.

Yeah we should probably go with solution three to explain what this is doing. I can only barely remember the context of this right now. That said, let me do some digging and recall so we can make a better experience here.
Also, I do vaguely remember there being a PR out there for this solution as opposed to another. I have to go digging.
Thanks for the flag! Tooling is only as good as it can be understood.

Had some time to dig through the commit log/PR history.
I like the spirit of this solution because ultimately it's trying to preserve flexibility of the tooling: users may have environments with different environment variable values.
That said, with wiser eyes today, I'd like a revise. How would we feel about making this default_ci_flags or somesuch; then, make this variable included by default and comment what is happening in the Makefile or contributing page that a user should override this as they see fit for their environment?

@VersusFacit
I like the direction you're suggesting:

make all the relevant environment variables included by default (possibly through a variable named default_ci_flags)
include comments in the contributing page (or Makefile) of what a user should override if needed

PR with some adjustments is up. Happy to iterate the comments, so get your opinions on there.


Weird looking docs

Problem description
What is this strange new "feature" in the docs - that I have to -hover- over a section to see normally the look of the component? Everything else is opaque-ed
Proposed solution
Could you please revert to the old scheme? When everything was visible instantly - so I could scan for the needed component layout w\o having to hover over each and every variant availble?

Agreed.  See #2866.


MudDataGrid: Remove unused UnitTests.Viewer

Description
This PR https://github.com/MudBlazor/MudBlazor/pull/5851, introduced a file named DataGridColumnResizerTest.razor. However, it seems that this file was never utilized for unit testing purposes. As a result, since it utilizes an outdated version of the DataGrid, it generates a warning during the build process.
According to the PR author's statement in Discord:

I added this file as a means to test my fix for the PR. However, it serves no real purpose, so feel free to remove it from the code base.

Checklist:

[x] The PR is submitted to the correct branch (dev).
[x] My code follows the code style of this project.

This is an unusual situation where a code snippet was utilized to test the effectiveness of a fix, however, it was not fully integrated into our unit tests. In the future, we should block such pull requests.

Thanks


Allow multiple threads to attempt to access the state of a build in the tree

Fixes #?
Context
Previously, it was an error for a thread to attempt to access the state of a build while some other thread was action on it. However, when parallel model building is enabled, multiple threads may attempt to load the settings or configure the projects of a build concurrently. Allow one thread to do this while blocking others.
This PR also moves a bunch of synchronization logic down to the WorkerLeaseService so that it is visible in one place, and can be coordinated and validated in once place.
As part of these changes, a worker thread will not give up its worker lease when completing a task, work node or worker API operation if there is further work available. It will release its lease if it needs to wait for more work. The build operation workers already had this behaviour.
Contributor Checklist

[ ] Review Contribution Guidelines
[ ] Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
[ ] Make sure all contributed code can be distributed under the terms of the Apache License 2.0, e.g. the code was written by yourself or the original code is licensed under a license compatible to Apache License 2.0.
[ ] Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team
[ ] Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective
[ ] Provide unit tests (under <subproject>/src/test) to verify logic
[ ] Update User Guide, DSL Reference, and Javadoc for public-facing changes
[ ] Ensure that tests pass sanity check: ./gradlew sanityCheck
[ ] Ensure that tests pass locally: ./gradlew <changed-subproject>:quickTest

Gradle Core Team Checklist

[ ] Verify design and implementation
[ ] Verify test coverage and CI build status
[ ] Verify documentation
[ ] Recognize contributor in release notes

@bot-gradle test and merge


"shadowOffset" is not supported by native animated module

When using Button I get an error on iOs: Style property "shadowOffset" is not supported by native animated module

Im using FAB component in my ios app ..
import React, { useState } from "react";
import { Stack, FAB, Switch } from "@react-native-material/core";
const App = () => {
const [loading, setLoading] = useState(true);
  return (
    <Stack fill center spacing={4}>
      <Switch value={loading} onValueChange={setLoading} />
      <FAB color="primary" loading={loading} />
    </Stack>
  );
};
export default App;
i got error like

I am getting the same error although this was working fine in another project..

same error using Button :/ @yamankatby  any news on fix ?

IS there a fix for this or possible work around.  Seems to be introduced when upgrading react-native.  Possibly introduced in 0.73.

Any update on this? I am getting the same issue with import { Button } from '@react-native-material/core'.

Any update on this? I am getting the same issue with import { Button } from '@react-native-material/core'.

i am also getting error from this same library can anyone tell abiut how to fix this issue ..issue comes from after upgrading expo 49 to 51

facing the same issue. Is there any update on this?

Error occurred after Expo SDK 51 update, got Hermes as the unsupported module:
"ERROR  Error: Style property 'shadowOffset' is not supported by native animated module, js engine: hermes".
No current ideas on how to diagnose this issue as https://github.com/callstack/react-native-paper/issues/4224 does not seem to be applicable.

Error occurred after Expo SDK 51 update: "ERROR Error: Style property 'shadowOffset' is not supported by native animated module, js engine: hermes".
There are no direct explanations on how to diagnose this issue as callstack/react-native-paper#4224 does not seem applicable.
However, I assume that this issue is caused by the react-native-paper dependency not being supported by another dependency(in my case Hermes), which causes the issue of the onclick of the button due to React/expo updates.
Only way as of yet for me to solve this issue is to remove the "mode" parameter in Button components that include 'elevated' as a value. I assume this is because 'elevated' makes a specific shadow effect from react-native-paper that isn't supported by another module. As shown:
```<Button mode='elevated' />  ```
    to
```<Button/> ```

If anyone finds a more permanent solution, that would be great.

Did you fix it?


refactor consumer backends (the only per backend primitive is now spawn)

this branch needs some more review, since it also changes the way fetch/wait_once call the callback in order to fit with wait
i created this pull request mainly for discussion of the changes
there is still need for some extra work to ensure backward-compatibility wrt the backend param
and auto-selecting a backend based on the socketpool manager of the client

Thanks for the patch,
I think the thread spawn emulation doesn't fully work. What happen when you don't wait until all threads ending.
Aboutthe backend support, it should be put in different modules to make sure imports will work and doesn't interfere with others.

closing this issue.
A new change API has been introduced in 28e6d7eb1065e6d8cca49375a0c5dc3720272718 which allows you to stream any results and eventually spawn the result. The consumer API has been deprecated.
Thanks for the patch anyway, it helped to figure what to do :)


Export/Import Instrument Buttons

This will kinda tie with the changes I'll need to make to the import prompt in the future.
Other mods (namingly Ultrabox, Abyssbox, and primarily Dogebox2) have these buttons under the copy/paste instrument buttons for exporting instrument settings into a .json (I think) and importing those .jsons, which I'm pretty sure is a feature for porting instruments across mods (I haven't used it much due to how many mods have it and how odd it can be if settings are different across mods).
Once these are ported into Midbox and I get the song importing patched up, I'll add a box where you can select which mod (that has import/export instrument buttons) you intend to port/export the instrument to so Midbox can pack up the instrument with more accurate settings, as well as for the import button.

Hmmm. I've heard that these buttons don't even actually work across mods to begin with. I don't know if this is true or not, but if so, then I don't really know these button's actual purpose as everything they do can be achieved with the copy/paste buttons.
Either way, I'll port them and try to see if I can make them work across mods. It would be nice to be able to port instruments across anywhere at anytime.


Fixing case when the value of environment variables should be cast to boolean

Issue:
I'm trying to use this exporter inside a Kubernetes Pod based on the example but the metrics were not exposed to Prometheus.
Investigating this, I've seen that the vmware_exporter doesn't cast the value from environment variables, that return string values, what causes the problem because they are used as boolean values (i.e here).
What this PR does:
This PR cast the value from environment variables that should be boolean values.
Approach:
I've decided to create a function in helpers file because I believe that is the better place for it (if no, please comment).
Notes:
If someone has any concerns or suggestions about this, please comment.

The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #93      +/-   ##
==========================================
+ Coverage   89.91%   89.97%   +0.06%
==========================================
  Files           4        4
  Lines         446      449       +3
==========================================
+ Hits          401      404       +3
  Misses         45       45

Impacted Files
Coverage Δ

vmware_exporter/vmware_exporter.py
89.62% <100%> (ø)
:arrow_up:

vmware_exporter/helpers.py
100% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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

This looks good. Thanks for adding the tests and I'll merge shortly.

@j2ck can I get an additional review?


Conf be able to read/write anon reviewer groups

Add conference group as reader and writer for each new Anon-Reviewer group.

We should do the same the builder is doing to assign reviewers to avoid inconsistencies.
Here is an example:

We should do the same the builder is doing to assign reviewers to avoid inconsistencies.
Here is an example:

It seems the builder is setting up the AC as writers of Anon groups:
https://github.com/iesl/openreview-py/blob/master/openreview/conference/builder.py#L568
so, it should work, right?

I made some changes to the set_assignment function in the builder. @melisabok please take a look, I think the groups (created by the builder and by the Ac/Pc consoles) are consistent now.


EverParse3d: Prelude: update for FStarLang/FStar#2892

The range type and labeled function were moved.

Green here https://github.com/project-everest/everest/actions/runs/4813801171

Thanks a lot Guido! I let you merge in the order you see fit.


pixel_format: add format table

Closes #2748
/cc @emersion

Would be nice to have additional commits that make use of this table in the DRM backend and the renderer.

I crammed everything in the same commit to have something that builds, gonna split it.

I'd like to see two more commits to make use of the new data:

One for the DRM backend, to replace strip_alpha_channel with this table: https://github.com/swaywm/wlroots/blob/6230f7be4f92b83df7ea8e6487410b3b81dd4b1d/backend/drm/renderer.c#L191
One for the GLES2 renderer, to remove the fields we now have in the common table from the GLES-specific table: https://github.com/swaywm/wlroots/blob/6230f7be4f92b83df7ea8e6487410b3b81dd4b1d/render/gles2/pixel_format.c#L10
The depth is not used and can be removed from the GLES2 table. We should only need the GLES2 table for GLES2-specific fields: gl_type and gl_format.

Does this sound reasonable?


AddDataProtection configuration

Missing parts on custom crypto
From @joeaudette: Need to document alternatives for certificates and custom crypto. Some of the crypto stuff is available as methods but maybe need different params
@blowdart

the parts  where you see services.ConfigureDataProtection(...) are the things that are not correct

So in the new RC2 and RTM version most can be done under services.AddDataProtection().
But I miss the ProtectKeysWithCertificate option.
Is there a solution to use X509Certificate2 with AddDataProtection?

Note: Have to admit that I am using NETCoreApp, Version=v1.0
The docs mention that this is not yet available
https://docs.asp.net/en/latest/security/data-protection/implementation/key-encryption-at-rest.html
But if there is a workaround, I would love to use it for the time being

@joeaudette  Is there a doc this bug should be attached to?

the parts where you see services.ConfigureDataProtection(...) are the things that are not correct

Which doc is that in?
What's the ask here? Can this be closed?

@joeaudette 	Thanks!


Cannot be installed with Nix [includes PR]

Awesome plugin!  Appreciate the work to make key binds more accessible.
I am unable to install with Nix as it makes the plugin directory read-only.  To remedy this I added some basic support for XDG directories to enable this plugin to be installed and used on immutable or declarative operating systems.
By default this would put he config in ~/.config/tmux/plugins/tmux-which-key and the generated init file in ~/.local/share/tmux/plugins/tmux-which-key.
I also added an example config for installing with Nix via Home Manager.  The config can be fully managed via Nix in a declarative manor.  The init file can then be written to a directory which is cleared every boot (immutable via temporary file system).
https://github.com/alexwforsythe/tmux-which-key/pull/1

Merged. Sorry for the delay, and thanks for your contribution!

@higherorderfunctor
Now the PR has been merged how do I install this plugin for Tmux on NixOS with home manager?
I have this at the moment but when reloading my tmux i get the error plugin/path returned 1
  tmux-which-key = pkgs.tmuxPlugins.mkTmuxPlugin {
    pluginName = "plugin.sh";
    version = "1.0";
    src = pkgs.fetchFromGitHub {
      owner = "alexwforsythe";
      repo = "tmux-which-key";
      rev = "b4cd9d28da4d0a418d2af5f426a0d4b4e544ae10";
      hash = "sha256-ADUgh0sSs1N2AsLC7+LzZ8UPGnmMqvythy97lK4fYgw=";
    };
  };

The path is valid and is being found but something else is going wrong, what is the solution?

@jasper-at-windswept I can take a look this weekend if my setup is still working.  Was working last time I used it, but its been a few weeks.

@jasper-at-windswept there is a basic config in the README.  I only used the default config so did not go through the hassle of setting up python to convert the yaml to tmux.
https://github.com/alexwforsythe/tmux-which-key/blob/main/README.md?plain=1#L301-L336
I decided to work on a full module.  I can probably make a flake for this repo to make it easier to install, but it may take me a week or two as I have some other things I am working on.  I'll share what I am using now.
{
  config,
  lib,
  pkgs,
  ...
}: let
  cfg = config.programs.tmux.tmux-which-key;
  rtpPath = "tmux-plugins/tmux-which-key";
in {
  options.programs.tmux.tmux-which-key = {
    enable = lib.mkEnableOption "tmux-which-key";
    package = lib.mkPackageOption pkgs ["tmuxPlugins" "tmux-which-key"] {};
    settings = lib.mkOption {
      type = with lib.types; let
        valueType =
          nullOr (oneOf [
            bool
            int
            float
            str
            path
            (attrsOf valueType)
            (listOf valueType)
          ])
          // {
            description = "tmux-which-key configuration value";
          };
      in
        valueType;
      default = let
        fromYaml = file: let
          convertedJson =
            pkgs.runCommandNoCC "config.json" {
              nativeBuildInputs = [pkgs.yj];
            } ''
              ${lib.getExe pkgs.yj} < ${file} > $out
            '';
        in
          builtins.fromJSON (builtins.readFile "${convertedJson}");
      in
        fromYaml "${cfg.package}/share/tmux-plugins/tmux-which-key/config.example.yaml";
    };
  };

  config = let
    configYaml = lib.generators.toYAML {} cfg.settings;
    configTmux =
      pkgs.runCommandNoCC "init.tmux" {
        nativeBuildInputs = cfg.package.propagatedBuildInputs;
      } ''
        set -x
        echo '${configYaml}' > config.yaml
        python3 "${cfg.package}/share/tmux-plugins/tmux-which-key/plugin/build.py" \
          config.yaml $out
      '';
  in
    lib.mkIf cfg.enable {
      xdg = {
        configFile."${rtpPath}/config.yaml".text = configYaml;
        dataFile."${rtpPath}/init.tmux".source = configTmux;
      };
      programs.tmux.plugins = [
        {
          plugin = cfg.package;
          extraConfig = ''
            set -g @tmux-which-key-xdg-enable 1;
            set -g @tmux-which-key-disable-autobuild 1
            set -g @tmux-which-key-xdg-plugin-path "${rtpPath}"
          '';
        }
      ];
    };
}

@jasper-at-windswept, I decided to just bang out the flake support and put in a PR: https://github.com/alexwforsythe/tmux-which-key/pull/9.
If you want to test it out early, you should just be able to replace all instances of github:alexwforsythe/tmux-which-key with github:higherorderfunctor/tmux-which-key?ref=feat/adds-nix-flake in the short term.  So something like below as your input and nix run "github:higherorderfunctor/tmux-which-key?ref=feat/adds-nix-flake#generate-config" to generate a config if going that configuration method.
    tmux-which-key = {
      url = "github:higherorderfunctor/tmux-which-key?ref=feat/adds-nix-flake";
      inputs.nixpkgs.follows = "nixpkgs";
    };

I've updated my persona nixos-config to use this method for now.

Hey @higherorderfunctor
Thanks so much for that.
What is the generate config method just wondering?
I'm not quite sure how configuring this plugin works yet since I haven't been able to install it.

@jasper-at-windswept it just converts the example config in the repo from YAML to Nix.  Essentially it goes YAML -> JSON -> Nix.
You can use straight YAML also.  I put an example in the README.
Can also just not supply a config at all to use the defaults.


params like skip not working or list with strange rules

The project looks cool! Thanks for sharing 👍
I tried to use it a bit, and I manage to give a list of columns.
But it was working only if it was written only the column name, like --list=email and not --list=public.user.email like in the docs.
And also, --skip is not skipping the table I want it to skip. This time no matter how I type it:
--skip=public.videoLink, --skip=videoLink, --skip=public."videoLink"
I still see (kept relevant infos..):
npx pg-anonymizer postgresql://user:password@localhost:5432/mydb -o dump.sql --skip=public."videoLink" --list=email

List: email
Skipping: public.videolink
Output file: dump.sql

Launching pg_dump...
Command pg_dump started, running anonymization.

public."User": idclient, [email]
Anonymizing 1 column...

public."VideoLink": id, link, serviceid
Skipping... no matching columns

And it's not skipped.

Hi @jeremieflrnt,

But it was working only if it was written only the column name, like --list=email and not --list=public.user.email like in the docs.

For the current version, to specify columns on specific tables you'll need to include the quotes " for the tables that need them. In your instance your table is called public."User", meaning you'd have to write your column as --list public.\"user\".email. However, this is something that can change I think.

--skip is not skipping the table I want it to skip

Judging by the question and output, you're expecting --skip to not output the table into dump.sql at all, is that right?
I'll answer assuming that is what you meant. The --skip flag is used for pg-anonymizer to determine whether to skip the anonymization of a table, not to skip the output of a table entirely. As pg-anonymizer parses the output supplied by pg-dump you'll need to parse args to pg-dump. The arg to skip a table is -T [tablename]. To pass args, you simply add -- [pg-dump args] to the end of your command
An example would be:
npx pg-anonymizer postgresql://user:password@localhost:5432/mydb -o dump.sql --list=email -- -T videoLink


Try to optimize e2e tests by re-using images from Docker hub

This is an updated version of #125 which pulls the latest images from Docker hub and tries to reuse them as cache.
NOTE: as in my PR for bdcs-api-rs here we see the npm install happening again inside the image although there's no need for that. I'm not quite certain what causes this but I think it will be resolved once the changes get merged to master and we start pushing to Hub from CI.

 Optimize welder-web e2e build and execution times

Coverage remained the same at 7.881% when pulling 088c9ad49c130a55b027af1bbe3c851fab71edfe on atodorov:e2e_docker_store into 9413268ef1ae731989a87d68199c1f4c675b6383 on weldr:master.


feat: add default repo config for argo

Signed-off-by: homily707<EMAIL_ADDRESS>Pre-Checklist
Note: please complete ALL items in the following checklist.

[x] I have read through the CONTRIBUTING.md documentation.
[x] My code has the necessary comments and documentation (if needed).
[ ] I have added relevant tests

Description

add default repo name and url config for argo
Related Issues

https://github.com/devstream-io/devstream/issues/514
New Behavior (screenshots if needed)

Good job, all checks passed including commit message and DCO check! @homily707

Functions in this file internal/pkg/plugin/argocd/argocd.go can be moved to a better place because they aren't specific to argocd only. Merging for now, will improve later soon @steinliber


S0-233 igor one.more .try

WELCOME TO DEVOPS-EASY-LEARNING PULL REQUEST SYSTEM
Description of the change
Dockerfile test
Checks and balances

[x] Tests added and run
[ ] (External) Interfaces documented
[ ] Has security implications (describe below)

Type of change

[ ] Bug fix (non-breaking change that fixes an issue)
[ ] New feature (non-breaking change that adds functionality)
[ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)

Related stories, issues and pulls
S0-233 Dockerfile test
Security considerations

Describe any security impact this change may have

Good


修改在侧边工具栏的官方图标和其他插件的图标

How exactly do we change the side toolbar icons ?? I couldn't find any docs about it.
can we change the color ??

Here is my misrepresentation, it should not be the side toolbar, it should be the side workspace icon such as folders, outlines, etc., the tool icon on the far left can see the commarder plugin
Regarding color changes, I haven't found a good universal solution yet.

How exactly do we change the side toolbar icons ?? I couldn't find any docs about it.
can we change the color ??

How exactly do we change the side toolbar icons ?? I couldn't find any docs about it.
can we change the color ??

Here is my misrepresentation, it should not be the side toolbar, it should be the side workspace icon such as folders, outlines, etc., the tool icon on the far left can see the commarder plugin
Regarding color changes, I haven't found a good universal solution yet.

ok thank you for clearing the doubt


Ammonite 2.1.0 (latest) fails to load ammonite-shell 2.1.0

xxx@yyy /opt $ sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/lihaoyi/Ammonite/releases/download/2.1.0/2.13-2.1.0) > /usr/local/bin/amm && chmod +x /usr/local/bin/amm' && amm
[sudo] Passwort für xxx:
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100   621  100   621    0     0   2029      0 --:--:-- --:--:-- --:--:--  2022
100 43.3M  100 43.3M    0     0  6563k      0  0:00:06  0:00:06 --:--:-- 8852k
Loading...
Compiling (synthetic)/ammonite/predef/DefaultPredef.sc
Compiling /home/xxx/.ammonite/predef.sc
java.lang.Exception: Failed to resolve ivy dependencies:Error downloading com.lihaoyi:ammonite-shell_2.13.2:2.1.0
not found: /home/xxx/.ivy2/local/com.lihaoyi/ammonite-shell_2.13.2/2.1.0/ivys/ivy.xml
not found: https://repo1.maven.org/maven2/com/lihaoyi/ammonite-shell_2.13.2/2.1.0/ammonite-shell_2.13.2-2.1.0.pom
ammonite.interp.Interpreter$DefaultLoadJar.ivy(Interpreter.scala:629)
ammonite.predef.predef$.(predef.sc:4)

seems like ammonite shell in the latest version has not been published yet. see https://repo1.maven.org/maven2/com/lihaoyi/
is this due to a delay with maven central? or has there been an error on release?

it works now. was probably a publishing delay.
sorry for opening, i will close with this comment


Describe the use of the new DIAObject association code

This now exists! So we need to use it.

This issue was moved to LSSTDESC/ImageProcessingPipelines#10


TIFF Images not displaying with 100% width

We use an iFrame in our webpage to show TIFFs and noticed that the plugin does not have render TIFF with width = 100%. This results in extra scrollbars being added.
Do you have any suggestion how to tackle this? Is there a reason why the plugin renders the  tag without 100% width?

Did you find a solution?

The plug-in just replaced the image, from a Tiff to a PNG, it doesn't do any other replace or change to the page. Styling the image is up to you 🙂


Optimize the "tabnav-tab" button

1. Optimize the style of highlighted "tabnav-tab" button when accessed by the "tab" key
There are two highlighting methods in the existing themes:

outline
box-shadow

The following example uses the two themes github-dark and github-dark-orange as examples.

github-dark => outline
github-dark-orange => box-shadow

github-dark before modification
“Write” button, when accessed by the "tab" key

“Preview” button, when accessed by the "tab" key

github-dark after modification
“Write” button, when accessed by the "tab" key

“Preview” button, when accessed by the "tab" key

github-dark-orange before modification
“Write” button, when accessed by the "tab" key

“Preview” button, when accessed by the "tab" key

github-dark-orange after modification
“Write” button, when accessed by the "tab" key

“Preview” button, when accessed by the "tab" key

2. Optimize the style when clicking the "tabnav-tab" button
This problem is because the "github-dark-orange" theme uses :focus for highlighting, it should use :focus-visible
This is the comparison between the "github-dark" theme and the "github-dark-orange" theme before modification:
"github-dark":

"github-dark-orange":

This is the "github-dark-orange" theme after modification:

fix: #519


Update magic link template instructions

Thank you so much for all your work!
This PR is just a minor fix on the README.
The Supabase variable ConfirmationURL replaces that whole concatenation with the SiteURL variable.
Hope this help new people trying to use this template :)

Oh, nevermind. It seems someone has already opened a PR here.
Closing this one.


[FR]: About share_limits_min_seeding_time_tag

Is your feature request related to a problem? Please elaborate.
Right now, a share limited torrent needs two criteria to be tagged with share_limits_min_seeding_time_tag :

torrent seed time < min_seeding_time
torrent ratio > max_ratio

Why the latter ?
Describe the solution you'd like
Be allowed to set max_ratio to zero or, better, just not make it a criteria for share_limits_min_seeding_time_tag
Does your solution involve any of the following?

[ ] New config option
[ ] New command option

Describe alternatives you've considered
Setting max_ratio to zero is not allowed, so I set it to 0.0001 or something but there always are some torrent that stay to 0 byte uploaded so ratio will never be positive.
Who will this benefit?
Anyone who wants to manage torrents with seeding time and not ratio.
Additional Information
No response

Please read the docs that explain max seed time, max ratio, and min seed time.
Min seed time has no relevance to a seed time goal.
Seed time goals are already supported

Maybe I wasn't clear enough, my english is limited, or I just don't understand your doc...
We agree "Minimum seeding time" is min_seeding_time ?

share_limits_min_seeding_time_tag : Will add this tag when applying share limits to torrents that have not yet reached the minimum seeding time (Used in --share-limits)

yet this is not the case when a torrent ratio is below max_ratio

Why is max seeding time unable to do exactly what you want?

Oh but I was actually using max_seeding_time at first, but the aforementioned tag isn't applied either while this seeding time isn't reached.

Correct. The min seeding time tag will never ever be applied for max seeding time.  There is no tag to set nor does it make sense to set a tag if a torrent has not met max ratio or max seedtime....


Tensorflow 2.0.0-rc0 - incorrect data shape for SparseCategoricalCrossentropy

Hi,
I'm trying to train a classifier using tensorflow.keras that predicts categorical labels (0/1/2). Input data is an ndarray of tf.float32. I used tensorflow=2.0.0-beta0 and then tensorflow=2.0.0-rc0 to produce the error messages below.
The output seems to be in the correct form as per SparseCategoricalCrossentropy :
Input : [7 1]
Output: [7 3]
Where batch size is 7.
tensorflow=2.0.0-rc0:
---------------------------------------------------------------------------
InvalidArgumentError                      Traceback (most recent call last)
<ipython-input-5-fe1cc3e1dca1> in <module>
     47 print(model.summary())
     48
---> 49 model.fit(train.batch(BATCH_SIZE), epochs=EPOCHS, verbose=2)
     50 model.evaluate(train, steps=None, verbose=1)

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_freq, max_queue_size, workers, use_multiprocessing, **kwargs)
    732         max_queue_size=max_queue_size,
    733         workers=workers,
--> 734         use_multiprocessing=use_multiprocessing)
    735
    736   def evaluate(self,

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2.py in fit(self, model, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_freq, **kwargs)
    322                 mode=ModeKeys.TRAIN,
    323                 training_context=training_context,
--> 324                 total_epochs=epochs)
    325             cbks.make_logs(model, epoch_logs, training_result, ModeKeys.TRAIN)
    326

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2.py in run_one_epoch(model, iterator, execution_function, dataset_size, batch_size, strategy, steps_per_epoch, num_samples, mode, training_context, total_epochs)
    121         step=step, mode=mode, size=current_batch_size) as batch_logs:
    122       try:
--> 123         batch_outs = execution_function(iterator)
    124       except (StopIteration, errors.OutOfRangeError):
    125         # TODO(kaftan): File bug about tf function and errors.OutOfRangeError?

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_v2_utils.py in execution_function(input_fn)
     84     # `numpy` translates Tensors to values in Eager mode.
     85     return nest.map_structure(_non_none_constant_value,
---> 86                               distributed_function(input_fn))
     87
     88   return execution_function

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/def_function.py in __call__(self, *args, **kwds)
    437         # Lifting succeeded, so variables are initialized and we can run the
    438         # stateless function.
--> 439         return self._stateless_fn(*args, **kwds)
    440     else:
    441       canon_args, canon_kwds = \

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py in __call__(self, *args, **kwargs)
   1820     """Calls a graph function specialized to the inputs."""
   1821     graph_function, args, kwargs = self._maybe_define_function(args, kwargs)
-> 1822     return graph_function._filtered_call(args, kwargs)  # pylint: disable=protected-access
   1823
   1824   @property

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py in _filtered_call(self, args, kwargs)
   1139          if isinstance(t, (ops.Tensor,
   1140                            resource_variable_ops.BaseResourceVariable))),
-> 1141         self.captured_inputs)
   1142
   1143   def _call_flat(self, args, captured_inputs, cancellation_manager=None):

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py in _call_flat(self, args, captured_inputs, cancellation_manager)
   1222     if executing_eagerly:
   1223       flat_outputs = forward_function.call(
-> 1224           ctx, args, cancellation_manager=cancellation_manager)
   1225     else:
   1226       gradient_name = self._delayed_rewrite_functions.register()

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py in call(self, ctx, args, cancellation_manager)
    509               inputs=args,
    510               attrs=("executor_type", executor_type, "config_proto", config),
--> 511               ctx=ctx)
    512         else:
    513           outputs = execute.execute_with_cancellation(

/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     65     else:
     66       message = e.message
---> 67     six.raise_from(core._status_to_exception(e.code, message), None)
     68   except TypeError as e:
     69     keras_symbolic_tensors = [

~/Library/Python/3.7/lib/python/site-packages/six.py in raise_from(value, from_value)

InvalidArgumentError:  assertion failed: [] [Condition x == y did not hold element-wise:] [x (loss/dense_3_loss/SparseSoftmaxCrossEntropyWithLogits/Shape_1:0) = ] [7 1] [y (loss/dense_3_loss/SparseSoftmaxCrossEntropyWithLogits/strided_slice:0) = ] [7 3]
	 [[node loss/dense_3_loss/SparseSoftmaxCrossEntropyWithLogits/assert_equal/Assert/Assert (defined at /usr/local/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py:1751) ]] [Op:__inference_distributed_function_2031]

Function call stack:
distributed_function

With tensorflow=2.0.0-beta0:
InvalidArgumentError:  logits and labels must have the same first dimension, got logits shape [7,3] and labels shape [7]
	 [[node loss/dense_2_loss/SparseSoftmaxCrossEntropyWithLogits/SparseSoftmaxCrossEntropyWithLogits (defined at <ipython-input-3-4fa88a5fad5e>:70) ]] [Op:__inference_keras_scratch_graph_5038]

code to reproduce:
import numpy as np
import pandas as pd
import random
import tensorflow as tf
import time as tm

INPUT_SHAPE=[3, 5]
NUM_POINTS=20
BATCH_SIZE=7
EPOCHS=4

def data_gen(num, in_shape):
    for i in range(num):
        x = np.random.rand(in_shape[0], in_shape[1])
        y = random.randint(0,2)
        yield x, y

def data_gen_all(num, in_shape, num_labels):
    x = np.zeros([num]+in_shape)
    y = np.zeros([num]+[num_labels])
    for i in range(num):
        x[i,:,:]= np.random.rand(in_shape[0], in_shape[1])
        y[i]= tf.one_hot(random.randint(0, num_labels), num_labels).numpy()
    return x, y

train = tf.data.Dataset.from_generator(
    generator=data_gen,
    output_types=(tf.float32, tf.int32),
#     output_shapes=(tf.TensorShape([None, INPUT_SHAPE[1]]), tf.TensorShape(None)),
#     output_shapes=(tf.TensorShape(INPUT_SHAPE), tf.TensorShape(())),
    output_shapes=([None, INPUT_SHAPE[1]],()),
    args=([NUM_POINTS, INPUT_SHAPE])
)

def create_model(input_shape):
    model = tf.keras.models.Sequential([
        tf.keras.layers.Dense(100, activation="tanh",input_shape=input_shape),
        tf.keras.layers.Dense(3, activation="softmax", kernel_regularizer= tf.keras.regularizers.l2(0.001))
    ])
    return model

model = create_model(input_shape=INPUT_SHAPE)

model.compile(
    optimizer=tf.keras.optimizers.Adam(learning_rate=1e-4, clipvalue=1.0),
    loss= tf.keras.losses.SparseCategoricalCrossentropy(),
#     loss= tf.keras.losses.CategoricalCrossentropy()
    )
print(model.summary())
model.fit(train.batch(BATCH_SIZE), epochs=EPOCHS, verbose=2)
model.evaluate(train, steps=None, verbose=1)

### CategoricalCrossentropy
x,y = data_gen_all(num=20, in_shape=INPUT_SHAPE, num_labels=3)
print(x.shape)
model.fit(x=x, y=y, epochs=EPOCHS, verbose=2)

https://stackoverflow.com/questions/57842734/tensorflow-2-0-incrrect-data-shape-for-sparsecategoricalcrossentropy
Platform: MacOS 10.14.6
tensorflow=2.0.0-rc0
tf_env_collect.sh produced:
== check python ===================================================
python version: 3.7.4
python branch:
python build version: ('default', 'Jul  9 2019 18:13:23')
python compiler version: Clang 10.0.1 (clang-1<IP_ADDRESS>)
python implementation: CPython

== check os platform ===============================================
os: Darwin
os kernel version: Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64
os release version: 18.7.0
os platform: Darwin-18.7.0-x86_64-i386-64bit
linux distribution: ('', '', '')
linux os distribution: ('', '', '')
mac version: ('10.14.6', ('', '', ''), 'x86_64')
uname: uname_result(system='Darwin', node='chnb.local', release='18.7.0', version='Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64', machine='x86_64', processor='i386')
architecture: ('64bit', '')
machine: x86_64

== are we in docker =============================================
No

== compiler =====================================================
Apple LLVM version 10.0.1 (clang-1<IP_ADDRESS>)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

== check pips ===================================================
numpy                1.17.2
protobuf             3.9.1
tensorflow           2.0.0b0

== check for virtualenv =========================================
False

== tensorflow import ============================================
tf.version.VERSION = 2.0.0-beta0
tf.version.GIT_VERSION = v1.12.1-3259-gf59745a381
tf.version.COMPILER_VERSION = 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1<IP_ADDRESS>)
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])

== env ==========================================================
LD_LIBRARY_PATH is unset
DYLD_LIBRARY_PATH is unset

== nvidia-smi ===================================================
./collect.sh: line 147: nvidia-smi: command not found

== cuda libs  ===================================================

== tensorflow installed from info ==================
Name: tensorflow
Version: 2.0.0b0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author-email<EMAIL_ADDRESS>License: Apache 2.0
Location: /usr/local/lib/python3.7/site-packages
Required-by:

== python version  ==============================================
(major, minor, micro, releaselevel, serial)
(2, 7, 16, 'final', 0)

== bazel version  ===============================================
Build label: 0.29.0-homebrew
Build time: Wed Aug 28 18:07:41 2019<PHONE_NUMBER>)
Build timestamp:<PHONE_NUMBER>
Build timestamp as int:<PHONE_NUMBER>

I have tried on colab with TF version 2.0.0-rc0,2.0.0-beta0,2.0.0-dev20190908 and was able to reproduce the issue.Please, find the gist here.Thanks!

I also managed to make it run with a small tweak in the model. Before the dense softmax layer I added an LSTM with 1 cell. Please find bellow the version that actually trains. I find it weird that removing the LSTM in the middle of the layer stack changes the final output.
import numpy as np
import pandas as pd
import random
import tensorflow as tf
import time as tm

INPUT_SHAPE=[3, 5]
NUM_POINTS=20
BATCH_SIZE=7
EPOCHS=4

def data_gen(num, in_shape):
    for i in range(num):
        x = np.random.rand(in_shape[0], in_shape[1])
        y = random.randint(0,2)
        yield x, y

def data_gen_all(num, in_shape, num_labels):
    x = np.zeros([num]+in_shape)
    y = np.zeros([num]+[num_labels])
    for i in range(num):
        x[i,:,:]= np.random.rand(in_shape[0], in_shape[1])
        y[i]= tf.one_hot(random.randint(0, num_labels), num_labels).numpy()
    return x, y

train = tf.data.Dataset.from_generator(
    generator=data_gen,
    output_types=(tf.float32, tf.int32),
    output_shapes=([None, INPUT_SHAPE[1]],()),
    args=([NUM_POINTS, INPUT_SHAPE])
)

def create_model(input_shape):
    model = tf.keras.models.Sequential([
        tf.keras.layers.Dense(100, activation="tanh", input_shape=input_shape),
        tf.keras.layers.LSTM(1, activation="tanh"),
        tf.keras.layers.Dense(3, activation="softmax")
    ])
    return model

model = create_model(input_shape=INPUT_SHAPE)

model.compile(
    optimizer=tf.keras.optimizers.Adam(learning_rate=1e-4, clipvalue=1.0),
    loss= tf.keras.losses.SparseCategoricalCrossentropy()
    )
print(model.summary())
model.fit(train.batch(BATCH_SIZE), epochs=EPOCHS, verbose=2)
model.evaluate(train, steps=None, verbose=1)

Any update on this? Is the problem in the SparseCategoricalCrossentropy method or the stacked layers output?

@vicpara Can you try to change last line as model.evaluate(train.batch(BATCH_SIZE), steps=None, verbose=1). It worked without any error. Please check the gist Here for your reference. Thanks!

@jvishnuvardhan To reproduce you need to comment out the line where you add the LSTM to the model tf.keras.layers.LSTM(1, activation="tanh"), .

@vicpara Here is the summary for the model provided in the code snippet above

Layer (type)                 Output Shape              Param #

dense (Dense)                (None, 3, 100)            600

dense_1 (Dense)              (None, 3, 3)              303

Total params: 903
Trainable params: 903
Non-trainable params: 0

The output shape is (7, 3, 3) and not (7, 3). Hence you are seeing the error that there is a shape mismatch. The following cases would work:
For sparse categorical crossentropy:
output shape = (7, 3) and label shape = (7, 1)
output shape = (7, 3, 3) and label shape = (7, 3, 1)
For categorical crossentropy:
output shape = (7, 3) and label shape = (7, 3)
output shape = (7, 3, 3) and label shape = (7, 3, 3)
Hope this helps :)

I had a similar issue and prevented it by setting return_sequences to False for the LSTM layer which feeds into the Dense layer

I'm facing the same error message but only when I add callbacks.
Adding anyone of them separately or together would trigger the issue but without them the code runs smoothly.
model = Sequential()
model.add(Convolution2D(4, (1,3), input_shape=X.shape[1:]))
##model.add(Convolution2D(8, (3,3)))
model.add(Convolution2D(2, (3,3), dilation_rate=(1,1)))
model.add(Convolution2D(1, (3,3), dilation_rate=(4,4)))
model.add(Flatten())
model.add(Dense(3, activation="sigmoid"))
opt = SGD(learning_rate=0.013)
model.compile(optimizer=opt,
              loss="MSE",
              metrics=["accuracy"])

# *** These Callbacks
early_stop = EarlyStopping(monitor='val_loss',
                           patience=10,
                           verbose=True,
                           mode='min')
chckpnt_save = ModelCheckpoint('\\MODELS',
                              save_best_only=True,
                              monitor='val_loss',
                              mode='min')
rdc_lr_loss = ReduceLROnPlateau(monitor='val_loss',
                                factor=0.1,
                                patience=7,
                                verbose=True,
                                epsilon=1e-4,
                                mode='min')
# ***

model.fit(X,Y,epochs=5000,
          batch_size=3,
          validation_split=0.175,
          callbacks=[early_stop, chckpnt_save , rdc_lr_loss ])

Error Message:
  File "Whatsapp_Organyzer_B.py", line 52, in <module>
    callbacks=[early_stop])
  File "C:\Python37\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 819, in fit
    use_multiprocessing=use_multiprocessing)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 342, in fit
    total_epochs=epochs)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 128, in run_one_epoch
    batch_outs = execution_function(iterator)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\keras\engine\training_v2_utils.py", line 98, in execution_function
    distributed_function(input_fn))
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 568, in __call__
    result = self._call(*args, **kwds)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 632, in _call
    return self._stateless_fn(*args, **kwds)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\function.py", line 2363, in __call__
    return graph_function._filtered_call(args, kwargs)  # pylint: disable=protected-access
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\function.py", line 1611, in _filtered_call
    self.captured_inputs)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\function.py", line 1692, in _call_flat
    ctx, args, cancellation_manager=cancellation_manager))
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\function.py", line 545, in call
    ctx=ctx)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\execute.py", line 67, in quick_execute
    six.raise_from(core._status_to_exception(e.code, message), None)
  File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.UnknownError:  Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
         [[node sequential/conv2d/Conv2D (defined at Whatsapp_Organyzer_B.py:52) ]] [Op:__inference_distributed_function_705]

Function call stack:
distributed_function

@super-pirata Getting the same Error even without callbacks

I'm facing the same error message but only when I add callbacks.
Adding anyone of them separately or together would trigger the issue but without them the code runs smoothly.
model = Sequential()
model.add(Convolution2D(4, (1,3), input_shape=X.shape[1:]))
##model.add(Convolution2D(8, (3,3)))
model.add(Convolution2D(2, (3,3), dilation_rate=(1,1)))
model.add(Convolution2D(1, (3,3), dilation_rate=(4,4)))
model.add(Flatten())
model.add(Dense(3, activation="sigmoid"))
opt = SGD(learning_rate=0.013)
model.compile(optimizer=opt,
              loss="MSE",
              metrics=["accuracy"])

# *** These Callbacks
early_stop = EarlyStopping(monitor='val_loss',
                           patience=10,
                           verbose=True,
                           mode='min')
chckpnt_save = ModelCheckpoint('\\MODELS',
                              save_best_only=True,
                              monitor='val_loss',
                              mode='min')
rdc_lr_loss = ReduceLROnPlateau(monitor='val_loss',
                                factor=0.1,
                                patience=7,
                                verbose=True,
                                epsilon=1e-4,
                                mode='min')
# ***

model.fit(X,Y,epochs=5000,
          batch_size=3,
          validation_split=0.175,
          callbacks=[early_stop, chckpnt_save , rdc_lr_loss ])

Error Message:
  File "Whatsapp_Organyzer_B.py", line 52, in <module>
    callbacks=[early_stop])
  File "C:\Python37\lib\site-packages\tensorflow_core\python\keras\engine\training.py", line 819, in fit
    use_multiprocessing=use_multiprocessing)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 342, in fit
    total_epochs=epochs)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\keras\engine\training_v2.py", line 128, in run_one_epoch
    batch_outs = execution_function(iterator)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\keras\engine\training_v2_utils.py", line 98, in execution_function
    distributed_function(input_fn))
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 568, in __call__
    result = self._call(*args, **kwds)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\def_function.py", line 632, in _call
    return self._stateless_fn(*args, **kwds)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\function.py", line 2363, in __call__
    return graph_function._filtered_call(args, kwargs)  # pylint: disable=protected-access
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\function.py", line 1611, in _filtered_call
    self.captured_inputs)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\function.py", line 1692, in _call_flat
    ctx, args, cancellation_manager=cancellation_manager))
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\function.py", line 545, in call
    ctx=ctx)
  File "C:\Python37\lib\site-packages\tensorflow_core\python\eager\execute.py", line 67, in quick_execute
    six.raise_from(core._status_to_exception(e.code, message), None)
  File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.UnknownError:  Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
         [[node sequential/conv2d/Conv2D (defined at Whatsapp_Organyzer_B.py:52) ]] [Op:__inference_distributed_function_705]

Function call stack:
distributed_function

were you able to solve this?

@vicpara Here is the summary for the model provided in the code snippet above
Layer (type) Output Shape Param #
dense (Dense) (None, 3, 100) 600
dense_1 (Dense) (None, 3, 3) 303
Total params: 903
Trainable params: 903
Non-trainable params: 0
The output shape is (7, 3, 3) and not (7, 3). Hence you are seeing the error that there is a shape mismatch. The following cases would work:
For sparse categorical crossentropy:
output shape = (7, 3) and label shape = (7, 1)
output shape = (7, 3, 3) and label shape = (7, 3, 1)
For categorical crossentropy:
output shape = (7, 3) and label shape = (7, 3)
output shape = (7, 3, 3) and label shape = (7, 3, 3)
Hope this helps :)

That’s probably your problem. Change the shape of the last layer or use a different loss function.

Dataset: 6000
Descriptions: train=6000
Photos: train=6000
Vocabulary Size: 7579
Description Length: 34
Model: "model_6"

Layer (type)                    Output Shape         Param #     Connected to
input_14 (InputLayer)           [(None, 34)]         0

input_13 (InputLayer)           [(None, 4096)]       0

embedding_6 (Embedding)         (None, 34,<PHONE_NUMBER>     input_14[0][0]

dropout_12 (Dropout)            (None, 4096)         0           input_13[0][0]

dropout_13 (Dropout)            (None, 34, 256)      0           embedding_6[0][0]

dense_18 (Dense)                (None,<PHONE_NUMBER>     dropout_12[0][0]

lstm_6 (LSTM)                   (None, 256)          525312      dropout_13[0][0]

add_6 (Add)                     (None, 256)          0           dense_18[0][0]
lstm_6[0][0]

dense_19 (Dense)                (None, 256)          65792       add_6[0][0]

dense_20 (Dense)                (None, 7579)         1947803     dense_19[0][0]
Total params: 5,527,963
Trainable params: 5,527,963
Non-trainable params: 0

ValueError                                Traceback (most recent call last)
 in ()
168         generator = data_generator(train_descriptions, train_features, tokenizer, max_length, vocab_size)
169         # fit for one epoch
--> 170         model.fit(generator, epochs=1, steps_per_epoch=steps, verbose=1)
171         # save model
172         model.save('model_' + str(i) + '.h5')
9 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py in wrapper(*args, **kwargs)
975           except Exception as e:  # pylint:disable=broad-except
976             if hasattr(e, "ag_error_metadata"):
--> 977               raise e.ag_error_metadata.to_exception(e)
978             else:
979               raise
ValueError: in user code:
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:805 train_function  *
    return step_function(self, iterator)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:795 step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
/usr/local/lib/python3.7/dist-packages/tensorflow/python/distribute/distribute_lib.py:1259 run
    return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/distribute/distribute_lib.py:2730 call_for_each_replica
    return self._call_for_each_replica(fn, args, kwargs)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/distribute/distribute_lib.py:3417 _call_for_each_replica
    return fn(*args, **kwargs)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:788 run_step  **
    outputs = model.train_step(data)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:754 train_step
    y_pred = self(x, training=True)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/base_layer.py:998 __call__
    input_spec.assert_input_compatibility(self.input_spec, inputs, self.name)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/input_spec.py:207 assert_input_compatibility
    ' input tensors. Inputs received: ' + str(inputs))

ValueError: Layer model_6 expects 2 input(s), but it received 3 input tensors. Inputs received: [<tf.Tensor 'IteratorGetNext:0' shape=(None, None) dtype=float32>, <tf.Tensor 'IteratorGetNext:1' shape=(None, None) dtype=int32>, <tf.Tensor 'IteratorGetNext:2' shape=(None, None) dtype=float32>]

Could you describe more closely what you did, when the error occurred and what you try to achieve?


feat: make autoloader more efficient

The autoloader we have now will match every Google-namespaced class and check if it exists. This autoloader ensures that only the matching prefixes are checked.

If we're going to do this, should do the same for the metadata classes too?

good idea!


Lazy Schema Change

For the design overview please take a look at the DESIGN.md file. Most of our modifications are localized to sql_table.cpp and sql_table.h . We have added tests in sql_table_test.cpp and catalog_test_util.h, and we have benchmarks in sql_table_benchmark.cpp

Blocked on #392 which will solidify the correct API for default values.


chore(main): release 2.0.0

:robot: I have created a release beep boop
2.0.0 (2024-06-03)
⚠ BREAKING CHANGES

migrate primary key to xid

🚀 Features

add xid column (8b7e628)
cmd: add migrate script to xid (d85b31e)
dependabot: add docker update (7092dc2)
dependabot: add group (2b19952)
golang: bump to 1.21 (2699033)
Makefile: add init step (3eed9be)

🐞 Bug Fixes

addmemory: conditionnal logger (e37d6a6)
dotenv: wrong example (6cbc398)
utils: use contains (84e2486)

🛠 Refactor

clean old migrate cmd (01f6e97)
log: move to slog (b27716c)
migrate primary key to xid (3203ac6)
release-please: handle new version (a181611)

🧰 Other

betteralign (579911d)
bump github.com/DATA-DOG/go-sqlmock from 1.5.0 to 1.5.1 (525d84a)
bump github.com/jackc/pgx/v4 from 4.18.1 to 4.18.2 (af31a62)
bump github.com/jackc/pgx/v5 from 5.4.3 to 5.5.0 (6f6a675)
bump github.com/jackc/pgx/v5 from 5.5.0 to 5.5.1 (9502208)
bump github.com/jackc/pgx/v5 in the deps group (6fdd2c8)
bump github.com/labstack/echo/v4 from 4.11.1 to 4.11.2 (bcd0c3f)
bump github.com/labstack/echo/v4 from 4.11.2 to 4.11.3 (546c1ab)
bump github.com/rs/xid from 1.2.1 to 1.5.0 (3b274bb)
bump github.com/spf13/viper from 1.16.0 to 1.17.0 (78282ef)
bump github.com/spf13/viper from 1.17.0 to 1.18.1 (585ad2d)
bump github.com/spf13/viper in the deps group (382796e)
bump golang from 1.21 to 1.22 (23f5d12)
bump golang.org/x/crypto from 0.16.0 to 0.17.0 (4e97018)
bump golang.org/x/net from 0.15.0 to 0.17.0 (12431fb)
bump migrate/migrate from v4.15.2 to v4.17.0 (5f5818a)
bump migrate/migrate from v4.17.0 to v4.17.1 (d1dea75)
bump the deps group with 1 update (3bcac7a)
bump the deps group with 1 update (5e8cbc0)
bump the deps group with 1 update (b03e5ed)
bump the deps group with 1 update (debde3a)
bump the deps group with 1 update (929bc95)
bump the deps group with 1 update (ce8eaca)
bump the deps group with 2 updates (c7eea37)
bump the deps group with 2 updates (b9146b0)
bump the deps group with 5 updates (5da5a1c)

This PR was generated with Release Please. See documentation.

:robot: Release is at https://github.com/bdronneau/memoriesbox/releases/tag/v2.0.0 :sunflower:


Follow TensorRT8 APIs (#425)

Fixes #425
I don't have TensorRT7 environment, so I'm sorry if the compilation fails.

It takes time for me to set up TensorRT 8 environment and verify this pull request.  I hope I could do that in the next few days.


Keydown event gets fired in component which was mounted through the key press

Version
2.6.11
Reproduction link
https://codesandbox.io/s/dreamy-austin-2k8u0
Steps to reproduce
Press any letter on your keyboard.
What is expected?
I expect the Hello component to render.
I don't expect the letter I pressed to appear in the input field.
What is actually happening?
The letter I pressed appears in the input field.

Apparently keydown or keyup gets triggered in the new component. But I don't understand why.
The letter already appears before you release the key, so it actually must be the keydown event.
How can it get triggered in the new component if the button press itself happened before the component was mounted and the input field was focused? It seems like time travelling to me.
I worked around this unexpected behaviour by putting this.$refs.input.focus(); into a 1ms setTimeout() call.

This is due to changes in nextTick. More at  Important Internal Changes at https://github.com/vuejs/vue/releases/tag/v2.6.0 and https://gist.github.com/yyx990803/d1a0eaac052654f93a1ccaab072076dd.
In your specific case you can also call preventDefault and stopPropagation to stop the event. Make sure to check the target of the event to still trigger it in other places


Methods

ULTRA draft, just a request for how to go in this. Also I don't promise it will be done, I just want to see how hard would it be.
@fzyzcjy please look at frb_codegen/src/parser/mod.rs
here I parse methods. What do you think of transforming a method to a function which receives a reference of the Self type?
For example
pub struct StructWithMethod{
    something: String
}

impl StructWithMethod {
    pub fn do_something(&self, _u: u32) {
        todo!()
    }
}

would turn into
pub fn struct_with_method_do_something(self_object: &StructWithMethod, _u: u32) {
//...
}

if done like this, then I'd do something like this
if let Item::Impl(ref item_impl) = item {
            for item in &item_impl.items {
                if let ImplItem::Method(item_method) = item {
                    if let Visibility::Public(_) = &item_method.vis {
                        let item_fn = modify_method_to_function(item_method);
                        src_fns.push(item_fn);
                    }
                }
            }
        }

where modify_method_to_function would just create a function out of the method.
Close #539
Close #67

What do you think of transforming a method to a function which receives a reference of the Self type?

Sure. By doing that, we can reuse most of the existing code.

Is it okay to change
fn extract_fns_from_file(file: &File) -> Vec<&ItemFn> {
to
fn extract_fns_from_file(file: &File) -> Vec<ItemFn> {
Cause we're going to have to create some ItemFn inside this function

Please don't mind approving workflows for now. Sorry, gonna publish my sketches on another branch

The only way I found to transform a method implementation into a function in a way that we know later that it should be a method, is by marking the function name as ending with is_a_method: https://github.com/fzyzcjy/flutter_rust_bridge/blob/e7cbec7dd980ab638d337a71cdd58d6532f604bc/frb_codegen/src/parser/mod.rs#L236
What do you think of this approach? I prefer to ask first then proceed with the code. Currently it generated the rust part correctly. The other option would be to reengineer a lot of stuff, and the goal is to reuse the code, transforming a method into a function, and later transforming this to a method call.
This:
pub struct StructWithMethod{
    pub something: String
}

impl StructWithMethod {
    pub fn do_something(&self, _u: u32, _x: String) {
        todo!()
    }
}

turned into
#[no_mangle]
pub extern "C" fn wire_StructWithMethod_do_something_is_a_method(
    port_: i64,
    StructWithMethod_is_a_method: *mut wire_StructWithMethod,
    _u: u32,
    _x: *mut wire_uint_8_list,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap(
        WrapInfo {
            debug_name: "StructWithMethod_do_something_is_a_method",
            port: Some(port_),
            mode: FfiCallMode::Normal,
        },
        move || {
            let api_StructWithMethod_is_a_method = StructWithMethod_is_a_method.wire2api();
            let api__u = _u.wire2api();
            let api__x = _x.wire2api();
            move |task_callback| {
                Ok(StructWithMethod::do_something(
                    &api_StructWithMethod_is_a_method,
                    api__u,
                    api__x,
                ))
            }
        },
    )
}

of course there's the dart part as well and mutability or not, etc, and testing for different types, args, etc

Is it okay to change
fn extract_fns_from_file(file: &File) -> Vec<&ItemFn> {
to
fn extract_fns_from_file(file: &File) -> Vec {

Sure. If you care about performance, maybe Cow<ItemFn> is better. But since codegen is not very slow currently you may just use ItemFn

Please don't mind approving workflows for now. Sorry, gonna publish my sketches on another branch
#542 is merged and now I do not need to approve :)

is by marking the function name as ending with is_a_method:

Generally looks ok to me.
Nit: What about ending with __method. Because (1) it is shorter (2) use double underscore to avoid conflict with normal functions, just like how Python and c++ uses double underscore

of course there's the dart part as well and mutability or not, etc, and testing for different types, args, etc

Yes, we should test for these details - great to see you have good testing in mind

Btw, the main high-level idea is: Just transform a method into a function (and vise versa), and let the original flutter_rust_bridge to the heavy lifting.
So yes, should not have to rewrite too much code otherwise it is the wrong direction :)

The problem I had was that I transformed the &self into struct_with_method: &StructWithMethod, but then still there's no way to know that this is a method, so marking the name with struct_with_method__method solves this.
There's still the problem of not knowing if it's a mutable self or not. I could do __method_mutable versus __method for non mutable, or create a https://github.com/lattice0/flutter_rust_bridge/blob/e7cbec7dd980ab638d337a71cdd58d6532f604bc/frb_codegen/src/ir/ty.rs#L14 but StructMut. What do you think?

Wait a minute - can it really be mutable? In other words, if the data is mutated, will we really get data mutated as well on the Dart side? I guess not currently.

You're right. I was thinking about opaque types but even for them it might be unsafe to do so from various isolates, so I should support only non mutable?

I should support only non mutable?

Currently, I guess yes.

I just remembered that https://github.com/mozilla/uniffi-rs only supports &self also, so yes this is the correct way. When you want to modify something you have to use interior mutability probably with a mutex

There's no way to generate methods for a struct without a Vec<IrFunc> inside TypeDartGenerator at https://github.com/lattice0/flutter_rust_bridge/blob/89e5ac0f91664c642cf935f3feb4c4968479f2d8/frb_codegen/src/generator/dart/mod.rs#L110
can I make an option to set this vec like this
pub trait TypeDartGeneratorTrait {
    fn api2wire_body(&self) -> Option<String>;

    fn api_fill_to_wire_body(&self) -> Option<String> {
        None
    }

    fn wire2api_body(&self) -> String {
        "".to_string()
    }

    fn structs(&self) -> String {
        "".to_string()
    }

    fn set_vec_ir_func(&self, ir_func: Vec<IrFunc>)  {
       todo!()
    }
}

or maybe
pub trait TypeDartGeneratorTrait {
    fn api2wire_body(&self) -> Option<String>;

    fn api_fill_to_wire_body(&self) -> Option<String> {
        None
    }

    fn wire2api_body(&self) -> String {
        "".to_string()
    }

    fn structs(&self, ir_funcs: Vec<IrFunc>) -> String { //possibly even ir_funcs: &[IrFunc]
        "".to_string()
    }
}

The set_vec_ir_func sounds not like a good idea because it introduces mutability.
fn structs(&self, ir_funcs: Vec<IrFunc>) -> String { //possibly even ir_funcs: &[IrFunc] seems ok
But, maybe ir_funcs are already in ir_file? Thus, since https://github.com/lattice0/flutter_rust_bridge/blob/89e5ac0f91664c642cf935f3feb4c4968479f2d8/frb_codegen/src/generator/dart/mod.rs#L110 provides ir_file, we can already get ir_funcs from them

pub struct StructWithMethod {
    pub something: String,
}
pub fn return_struct() -> StructWithMethod {
    todo!()
}

turns roughly into
class StructWithMethod {
  final String something;

  StructWithMethod({
    required this.something,
  });

class SomethingImpl extends FlutterRustBridgeBase<SomethingWire>
    implements Something {
  factory SomethingImpl(ffi.DynamicLibrary dylib) =>
      SomethingImpl.raw(SomethingWire(dylib));

  SomethingImpl.raw(SomethingWire inner) : super(inner);

  Future<StructWithMethod> returnStruct({dynamic hint}) =>
      executeNormal(FlutterRustBridgeTask(
        callFfi: (port_) => inner.wire_return_struct(port_),
        parseSuccessData: _wire2api_struct_with_method,
        constMeta: kReturnStructConstMeta,
        argValues: [],
        hint: hint,
      ));

as you see, class StructWithMethod has no way of calling ffi stuff like executeNormal. What do you think of class StructWithMethod extending FlutterRustBridgeBase<StructWithMethod> when the struct has a method?

What do you think of class StructWithMethod extending FlutterRustBridgeBase when the struct has a method?

What about this:
class StructWithMethod {
  final FlutterRustBridgeBase<SomethingWire> bridge;
  final String something;

  StructWithMethod({
    required this.bridge,
    required this.something,
  });

  Future<Something> someMethod(Something b) => bridge.someMethod(a: this, b: b);
}

Ok. I guess StructWithMethod was never meant to be manually created in the dart side, right? It should be returned by return_struct

I guess StructWithMethod was never meant to be manually created in the dart side, right? It should be returned by return_struct

Maybe we should allow it to be created directly in Dart side.
An extreme example is struct without fields, which acts like "namespace".

Ok I got
pub struct StructWithMethod {
    pub something: String,
}

impl StructWithMethod {
    pub fn do_something(&self, _u: u32, _x: String) {
        todo!()
    }
}

to compile into

class StructWithMethod {
  final SomethingImpl bridge;
  final String something;

  StructWithMethod({
    required this.bridge,
    required this.something,
  });
  Future<void> doSomething({required int u, required String x, dynamic hint}) =>
      bridge.doSomethingMethod(
        structWithMethod: this,
        u: u,
        x: x,
      );
}

class SomethingImpl extends FlutterRustBridgeBase<SomethingWire>
    implements Something {
  factory SomethingImpl(ffi.DynamicLibrary dylib) =>
      SomethingImpl.raw(SomethingWire(dylib));

  SomethingImpl.raw(SomethingWire inner) : super(inner);

  Future<void> doSomethingMethod(
          {required StructWithMethod structWithMethod,
          required int u,
          required String x,
          dynamic hint}) =>
      executeNormal(FlutterRustBridgeTask(
        callFfi: (port_) => inner.wire_do_something__method(
            port_,
            _api2wire_box_autoadd_struct_with_method(structWithMethod),
            _api2wire_u32(u),
            _api2wire_String(x)),
        parseSuccessData: _wire2api_unit,
        constMeta: kDoSomethingMethodConstMeta,
        argValues: [structWithMethod, u, x],
        hint: hint,
      ));
      //...

it only fails here:
StructWithMethod _wire2api_struct_with_method(dynamic raw) {
  final arr = raw as List<dynamic>;
  if (arr.length != 1)
    throw Exception('unexpected arr length: expect 1 but see ${arr.length}');
  return StructWithMethod(
    /// because it's missing the bridge here
    something: _wire2api_String(arr[0]),
  );
}

now I don't know if I should pass the bridge. I'm confused now

now I don't know if I should pass the bridge. I'm confused now

pass this :)

but
StructWithMethod _wire2api_struct_with_method(dynamic raw) {
  final arr = raw as List<dynamic>;
  if (arr.length != 1)
    throw Exception('unexpected arr length: expect 1 but see ${arr.length}');
  return StructWithMethod(
    something: _wire2api_String(arr[0]),
  );
}

is a function, there's no this for a bridge class. It's not inside anything.

You are right. Then what about
_wire2api_struct_with_method(FlutterRustBridgeBase<SomethingWire> bridge, ...)
and
modify parseSuccessData such that pass the bridge into it

Btw I was wrong:
class StructWithMethod {
  final SomethingImpl bridge;

should be
class StructWithMethod {
  final FlutterRustBridgeBase<SomethingWire> bridge;

b/c we should not hardcode implementation class there

I tried with
class StructWithMethod {
  final FlutterRustBridgeBase<SomethingWire> bridge;

but FlutterRustBridgeBase has no methods.
The thing that actually has methods is the implementation/extension of FlutterRustBridge
class SomethingImpl extends FlutterRustBridgeBase<SomethingWire>
    implements Something {
  factory SomethingImpl(ffi.DynamicLibrary dylib) =>
      SomethingImpl.raw(SomethingWire(dylib));

  SomethingImpl.raw(SomethingWire inner) : super(inner);

  Future<void> doSomethingMethod(
          {required StructWithMethod structWithMethod,
          required int u,
          required String x,
          dynamic hint}) =>
      executeNormal(FlutterRustBridgeTask(
        callFfi: (port_) => inner.wire_do_something__method(
            port_,
            _api2wire_box_autoadd_struct_with_method(structWithMethod),
            _api2wire_u32(u),
            _api2wire_String(x)),
        parseSuccessData: _wire2api_unit,
        constMeta: kDoSomethingMethodConstMeta,
        argValues: [structWithMethod, u, x],
        hint: hint,
      ));

You are right. So we should use Something not SomethingImpl, since the former is like an abstract interface

Btw I am not sure why CI does not run (except for codacy). Maybe need to resolve conflict?
Anyway no worries about CI - only need to pass before merging

I removed all the trash I added to make it easier for you to review. Everything built on my side, both the rust and dart generated files, no errors. Now I still have to write the dart tests but they should pass

Do you think they should be static on the flutter side? If so, they have to receive bridge.

Not sure why I did not receive notification about this question...
Yes, I guess they should be static. Otherwise, suppose ConcatenateWith struct has 100 fields, then it means, in order to run the static method we have to provide a struct with 100 fields even if it is unneeded!

Oh I did not realized this is ready for review. I will review it soon.
Btw maybe need to resolve conflicts o/w ci will not run

Btw we need to add a bit of documentation later, probably be siblings of this chapter http://cjycode.com/flutter_rust_bridge/feature/zero_copy.html

Ping me when you have finished everything (e.g. code change, or comments), and I will look at all comments and reply all

@fzyzcjy done!

Again ping me when done! :)

@fzyzcjy done. On some I couldn't comment, but now MethodNamingUtil is not used directly anymore, everything goes through FunctionName, except for struct_has_method.

I am reviewing it.
Btw some comments are folded by github and need to click load more button. e.g. item_method_to_function-problem https://github.com/fzyzcjy/flutter_rust_bridge/pull/543#discussion_r919507081

Good job! Now there is almost no new review issues (only some old ones that may have been overlooked because of github's notification mechanism) and it is very close to merging.

Ping me when things are done :)

Great job!


SP Cache Issue

Category

[ ] Question
[ ] Typo
[ X] Bug
[ ] Additional article idea

Expected or Desired Behavior
When you edit file ( javascript etc .js) and publish it, SharePoint should serve the latest version of it, at least when even busting the browser cache using shift + f5.
Observed Behavior
SharePoint is randomly serving old published files for 2 - 10 minutes
Steps to Reproduce
this started to happen last friday 15.9.2017
see the video

@tavikukko - This is by design.  When you upload a new package that changes files we will continue to serve the older version for up to the next 20 minutes.  I you see this happening beyond that window please re-open the bug and include a trace of the requests so we can investigate on our side.

How could this ever be "by design"?

We have to make trade offs between cache freshness, cache speed, and resource usage.  We recently reduced the ceiling of how long it should take from 20 minutes to 10 minutes, so now on average a user should only see old values for 5 minutes.  Further to reduce the users perceived freshness anytime an item is deployed a cookie is set on your machine to not use the cache for the next 20 minutes.  So the user who uploads and deploys a solution should never see this issue, only somebody else who did not upload/deploy the app. Since other users have not uploaded or deployed the solution they won't actually know exactly when it should be available.  Due to these reasons we felt comfortable with the design.


js form afterValidate executes only if form being submitted

What steps will reproduce the problem?
Setup before and afterValidate events for form, for example for blocking submit button:
  $('form').on('beforeValidate', function (e) {
    $(e.target).find(':submit').prop('disabled', true);
    console.log('beforeValidate');
  }).on('afterValidate', function (e) {
    $(e.target).find(':submit').prop('disabled', false);
    console.log('afterValidate');
  });

What is the expected result?
Both event triggered
What do you get instead?
Only beforeValidate event happens
Additional info
In yii.activeForm.js afterValidate event described as it is triggered after validating the whole form.
But actually it happens only after validation triggered by form submission: see updateInputs method: it placed only if submitting is true

Q
A

Yii version
2.0.9

PHP version
5.6

https://github.com/yiisoft/yii2/pull/12069 ?

Yes, sorry, didn't see that.
As i understand, only way is to use previous version of framework, as new version will not be released soon?

Fixed by https://github.com/yiisoft/yii2/pull/12069

This is still the case.

Changing the updateInputs function of yii.activeForm.js to this works for me:
`        var errorAttributes = [];
var $input = findInput($form, this);
$.each(data.attributes, function () {
if (!$input.is(":disabled") && !this.cancelled && updateInput($form, this, messages)) {
errorAttributes.push(this);
}
});
    $form.trigger(events.afterValidate, [messages, errorAttributes]);
    updateSummary($form, messages);

    if (submitting) {`

@czzplnm how about making a pull request?

@czzplnm how about making a pull request?

Done.

This undid my fix for #17341 (validation broken in js strict mode) :cry: . PR to reapply the fix is here: #17398


Removing global S3Error from WriteResult

:+1: I think this is a left-over from the change last week, as discussed, these other things are global AWS errors not write errors.


(question) Add doctrine ORM good or bad decision?

I have done a lot of test adding doctrine ORM inside this project but I don't know if in this case will be good or bad. In this case we will transform dinamically into statically or strong typed.
It would require:
1rst way:
Change the base controller adding queryBuilder (more typed) instead nomal queries (http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/query-builder.html)
We would need to create the query builder in console.php
2nd way:
Change the base controller adding DQL SELECT (http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html) (select via object/typed .More similar than normal queries) instead nomal queries
We could add via replaces in console.php or only changing the base.
3rd way:
Change doctrine/dbal for native-sql doctrine/orm only the bases (http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/native-sql.html). It will allow to add via 1rst way in custom methods/pages... It could be a good decision
What do you think @jonseg ?

For a simple CRUD, do we really need to put inside something as heavy as doctrine ?
I mean, it's ok for big project and everything, but for me this project should stay light and easy to use.
Users know how SQL work if they use a database (or 90% of them know at least), but how many use ORM ?

I agree but I think too that this project in some cases can be more than simple CRUD base. You can create some specific pages or additional services. For this reason I ask to know all the opinions.


Use tabbar background from theme not black.

Hi, I'd prefer to use the tabbar background from my theme rather than the pure black Shadowfox turns it into, as that black melts into the GNOME top bar in a kinda ugly fashion. How can I do this?

screenshot:


Why the result is not statisfactory as like the result in paper?

Hello, I used the model provided by this reposity to test datasets, such as set5, set14, BSD100 and so on. However, the result is not goot as described in your paper, which is only 28.5478/0.8150 | 24.7989/0.6689 | 23.9438/0.6221. Can you tell me why? Is there any body who can help me?

Hello, I used the model provided by this reposity to test datasets, such as set5, set14, BSD100 and so on. However, the result is not goot as described in your paper, which is only 28.5478/0.8150 | 24.7989/0.6689 | 23.9438/0.6221. Can you tell me why? Is there any body who can help me?

May I ask how you calculated PSNR？


protoc-gen-tonic: compression feature always on

First of all, thank you so much for making these -- this is the right way to do protobuf generation across a bigger/multi-language world, as opposed to via Rust's build.rs!
I filed https://github.com/tokio-rs/console/issues/349 over on tokio's console-api because I'm in sort of a catch-22. Because I generated my protos with protoc-gen-tonic, they have the "compression" feature enabled which emits, in the generation, fields that require my library consuming them to have "compression" enabled as well.
That's fine if it's just me, but because console-api has their own generated protos with compression disabled, I get trouble when I try to  compile console-subscriber into my application because I've already got tonic and it enables "compression" which breaks their generated protos' expectations.
IMO, they should just have a more general proto committed. But I figured I'd send an issue along in case other folks see it, or to see if there's a convenient way to enable or disable the compression features from the generated tonic files.

This is one that I'll need to bring to tonic too. We may want to make compression disabled here by default, but with compression being a compilation feature, I have a hard time making it into an option.
I have a thought about how I might make that work, so let me see if I can do some dependency magic to make compression optional.

That'd be fabulous! But yeah, it does seem like it goes to the tonic level too. compression looks like a sort of non-standard feature flag in tonic that explicitly expects you to be generating these things dynamically. Which is bad when you want to pre-generate with other tools 😢

Sadly my dependency hacking wasn’t successful right off, but I may have an angle to get compression out of tonic-build so that the generated code doesn’t care about it, but you can get it or not through the tonic compression flag. May require a SemVer bump in tonic, but should make it so that intermediates can check in generated code without causing this type of breakage (and leave the decision to include the compression machinery to the end application).

I suppose these compilation errors I get are related? Is there a workaround?
error[E0412]: cannot find type `EnabledCompressionEncodings` in this scope
   --> __generated/proto/rs/schema/src/foobar.services.v1.tonic.rs:556:37
    |
556 |         send_compression_encodings: EnabledCompressionEncodings,
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0283]: type annotations needed
   --> __generated/proto/rs/schema/src/foobar.services.v1.tonic.rs:207:47
    |
207 |                 accept_compression_encodings: Default::default(),
    |                                               ^^^^^^^^^^^^^^^^ cannot infer type

Answering my own question. Turns out this is needed in the app Cargo.toml:
[dependencies.tonic]
version = "0.7.2"
features = ["compression"]


fix(chocolatey): Add a catchall pattern for tags trigger in  workflow

Context
The GitHub documentation is very unclear on this point but without the
pattern, the workflow is not triggered at all when creating tags.
Tested on the Quarkus project: https://github.com/quarkusio/chocolatey-bucket/commit/ea8df1e7400499b9f2881f9091ecd7b5b230c92a
Checklist

[X] Review Contribution Guidelines.
[X] Make sure all contributed code can be distributed under the terms of the
Apache License 2.0, e.g. the code was written by
you or the original code is licensed under a license compatible to Apache License 2.0.
[ ] Update documentation when applicable.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


[API]Implementing an authentication system using Twitter API in PHP

Topic Suggestion
Implementing an authentication system using Twitter API in PHP
Proposed article introduction
In modern days, social media login is the preferred method of authenticating users into the system. The reason is millions of users have registered with the platforms and it is much easier to login into the system where security is guaranteed.
Twitter is an internet giant which has provided the support of OAuth authentication through the use of their detailed and well-documented API.
There are many client libraries available that implements Twitter OAuth login but in this tutorial, we will use plain core PHP since it is lightweight and sufficient.
Key takeaways
At the end of the tutorial, the learner will be able to:

get and configure the Twitter API keys
perform the 3-step authentication flow
create and handle responses during the authentication flow
store authenticated user data into the database

Article quality

I will use an object-oriented PHP coding style that unlike the existing articles that are using older PHP versions
The article will not use libraries but plain core PHP to implement Twiter OAuth authentication

References
N/A

Good afternoon and thank you for submitting your topic suggestion.
Your topic form has been entered into our queue and should be reviewed (for approval) as soon as a content moderator is finished reviewing the ones in the queue before it.

Could you please expand upon how your content will differ from what is already available through other websites and documentation? We lean towards content that offers an original viewpoint/approach around programming-centric topics. @ephraa

@hectorkambow Kindly do not close this topic as am working on it and will upload the article very soon. Thank you.
Copy @ahmadmardeni1

I'm going to close this topic due to inactivity.
It can be reopened.


[HUDI-1083] Optimization in determining insert bucket location for a given key

What is the purpose of the pull request

Do binary search and find the right bucket in UpsertPartitioner.java would cut cost from O(N) to log N.

Brief change log
(for example:)

Modify AnnotationLocation checkstyle rule in checkstyle.xml

Verify this pull request
(Please pick either of the following options)
This pull request is a trivial rework / code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)

Added integration tests for end-to-end.
Added HoodieClientWriteTest to verify the change.
Manually verified the change by running a job locally.

Committer checklist

[ ] Has a corresponding JIRA in PR title & commit

[ ] Commit message is descriptive of the change

[ ] CI is green

[ ] Necessary doc changes done or have another open PR

[ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

Add a performance test, which insert 100000 records, 1000 fileGroups, each fileGroup's weight is 0.001.
  public void partitionWeightPerformance() throws Exception {
    final String testPartitionPath = "2016/09/26";
    int totalInsertNum = 100000;

    HoodieWriteConfig config = makeHoodieClientConfigBuilder()
        .withCompactionConfig(HoodieCompactionConfig.newBuilder().compactionSmallFileSize(0)
            .insertSplitSize(100).autoTuneInsertSplits(false).build()).build();

    HoodieClientTestUtils.fakeCommit(basePath, "001");
    metaClient = HoodieTableMetaClient.reload(metaClient);
    HoodieCopyOnWriteTable table = (HoodieCopyOnWriteTable) HoodieTable.create(metaClient, config, hadoopConf);
    HoodieTestDataGenerator dataGenerator = new HoodieTestDataGenerator(new String[]{testPartitionPath});
    List<HoodieRecord> insertRecords = dataGenerator.generateInserts("001", totalInsertNum);
    WorkloadProfile profile = new WorkloadProfile(jsc.parallelize(insertRecords));
    UpsertPartitioner partitioner = new UpsertPartitioner(profile, jsc, table, config);

    for (int i = 0; i < 10; i++) {
      long start = System.currentTimeMillis();
      Map<Integer, Integer> partition2numRecords = new HashMap<Integer, Integer>();
      for (HoodieRecord hoodieRecord : insertRecords) {
        int partition = partitioner.getPartition(new Tuple2<>(
            hoodieRecord.getKey(), Option.ofNullable(hoodieRecord.getCurrentLocation())));
        if (!partition2numRecords.containsKey(partition)) {
          partition2numRecords.put(partition, 0);
        }
        partition2numRecords.put(partition, partition2numRecords.get(partition) + 1);
      }

      System.out.println("cost: " + (System.currentTimeMillis() - start));
    }
  }

Test it ten times, the result before the optimization:
  cost: 190
  cost: 122
  cost: 150
  cost: 100
  cost: 104
  cost: 114
  cost: 104
  cost: 110
  cost: 104
  cost: 117

The result after the optimization:
  cost: 154
  cost: 83
  cost: 77
  cost: 84
  cost: 85
  cost: 84
  cost: 87
  cost: 99
  cost: 102
  cost: 85

@nsivabalan @vinothchandar Can you take a look at this pull request.

Codecov Report

Merging #1868 into master will increase coverage by 10.19%.
The diff coverage is 91.30%.

@@              Coverage Diff              @@
##             master    #1868       +/-   ##
=============================================
+ Coverage     46.39%   56.59%   +10.19%
- Complexity     2859     3573      +714
=============================================
  Files           453      459        +6
  Lines         19440    19583      +143
  Branches       1953     1959        +6
=============================================
+ Hits           9020    11083     +2063
+ Misses         9636     7754     -1882
+ Partials        784      746       -38

Flag
Coverage Δ
Complexity Δ

#hudicli
69.53% <91.30%> (+39.40%)
1552.00 <6.00> (+943.00)

#hudiclient
79.25% <91.30%> (+52.88%)
1362.00 <6.00> (+943.00)

#hudicommon
55.07% <ø> (ø)
1518.00 <ø> (ø)

#hudihadoopmr
38.99% <ø> (ø)
163.00 <ø> (ø)

#hudihivesync
72.01% <ø> (-0.25%)
121.00 <ø> (ø)

#hudispark
49.24% <ø> (+<0.01%)
124.00 <ø> (+2.00)

#huditimelineservice
63.47% <ø> (ø)
47.00 <ø> (ø)

#hudiutilities
11.91% <ø> (-62.74%)
48.00 <ø> (-231.00)

Flags with carried forward coverage won't be shown. Click here to find out more.


Dataset cannot be downloaded

The preprocessed datasets cannot be downloaded successfuly. Could you please upload datasets in BaiduYun?

I also met this problem, I can not download the dataset either. Can u upload this dataset to baidu netdisk? Many thanks.

Thanks for alerting that. I will try to use BaiduYun. Also, can you describe the problem when you try to download from OneDrive?

The download logic of onedrive is different from that of BaiduYun or Google Cloud. Google and Baidu will package the files to ensure that users can download the file completely. In my using experiences, it seems that onedrive does not have this step. After a small file is downloaded and if the network condition is not extremely ideal, OneDrive will think the whole file is completed. I tried hundread times in the past 4 days, the sizes of downloaded datasets are 5GB, 2GB, 900MB, 6GB, 8GB, etc, because the downloading is wrongly ended even the download is not completed.

I see your problem. From my experience, using OneDrive desktop version can solve this issue. Did you download directly from browser?

Yes, I directly download these from browser. I tried to download them using OneDrive desktop just now, but I have no idea how to do that I cannot see any buttom about downloading using the desktop version. I cannot transfer deposit them into my OneDrive, because I cannot log in my microsoft account in the browser, like the attached image, it is always Loading. It is so disappointing, I've tried many wireless networks and many broswers, they cannot work.

Sorry to hear that. I'm uploading to BaiduYun, but it takes time.

Come on, it is so happy to hear that, it is so sad to stop a promising research for the dataset cannot be downloaded. You are so kind, and wish you have a nice day.

I uploaded to BaiduYun. Does it work for you?

Thanks a lot!!!! It is still downloading. So far, everything is going well, wish everything will be ok.