Design history versions

We are going to have to store history blobs in different formats over time. These different formats needs to be versioned so that history downloader has an easy way to figure out how to operate on different versions of archived data. This task is to design this version plan.

Which metadata is included in the blobs and how to version histories is a concern of the archivers which is simply a plugin to cadence.


Documentation to edit Front_End

Create a build documentation for the Vue_Js. interface:

[ ]  how to give different users different routers
[ ] how to set up routers
[ ] create a design template for the tables (something similar to existing SIS's)

Started doing the documentation. Others are also free to pr to my fork below.
https://github.com/code4sac/learning-blocks/compare/main...jSunpayco:learning-blocks:vue-interface-documentation?short_path=b75e586#diff-b75e5869dc4f240e9cbe97ea613a8fe060f4fac6bbd7b4e943eb7b28bad8159b
@shwndea Do tell me if you think I've misunderstood what is needed.

This is a good start!


Section numbers wrong when multiple argparse directives used in single page

This is a rewrite of https://github.com/alex-rudakov/sphinx-argparse/issues/127 from the old project, but I've made it into a smaller reproducible example. The summary of the issue is that Named Arguments and Options sections in a single restructuredtext document (~or maybe a single sphinx project~) that has a :numbered: TOC tree will always use the section number from the last .. argparse:: directive.
mkdir sample_proj
cd sample_proj
touch myproj.py
touch index.rst
touch utils.rst

myproj.py
def get_parser1(parser):
    parser.add_argument("--flag1", default=1, type=int)
    return parser

def get_parser2(parser):
    parser.add_argument("--flag2", default=2, type=int)
    return parser

index.rst
Welcome to myproj's documentation!
==================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:
   :numbered:

   utils

utils.rst
Utility Scripts
===============

Section A
---------

.. argparse::
    :module: myproj
    :func: get_parser1
    :passparser:

Section B
---------

.. argparse::
    :module: myproj
    :func: get_parser2
    :passparser:

Then generate the docs with:
PYTHONPATH=. sphinx-build . build -C -D extensions=sphinxarg.ext

And open built/utils.html in a browser. You'll see something like:

Notice how the "Named Arguments" sections have the same section number. They should be 1.1.1 and 1.2.1.

So the primary issue stems from the ID of the section being based on the section title:
https://github.com/ashb/sphinx-argparse/blob/bf1429aa0a4c51ae63d8d6baca0c163a5c6a3a64/sphinxarg/ext.py#L96
But those section titles are always the same:
https://github.com/ashb/sphinx-argparse/blob/bf1429aa0a4c51ae63d8d6baca0c163a5c6a3a64/sphinxarg/parser.py#L159-L168
So I see a couple solutions:

Allow the user to provide an id_prefix. Another option for something so small and low-level seems annoying. Could also be the user can specify the ID in its entirety.
Add some other information, for example from the parent node, to the ID in ext.py to make them depend on the uniqueness of something outside of sphinx-argparse.
Keep global state for sections and add a integer suffix (or other) to the IDs based on the number we've seen. Main problem with this is the complexity and that this extension is defined as allowing parallel reads. I can't imagine doing this correctly would be fun.

Ah option 2 wouldn't work if we're just using the parent node information as you could technically have two .. argparse:: directives in the same parent section.

I have a similar request: I would like to not have the headings Positional Arguments and Named Arguments (or have them not as headers). These headers give a messy TOC in the sidebar, e.g.:

Yeah I thought I about adding something like that in my PR for fixing my need in https://github.com/ashb/sphinx-argparse/pull/44. Or rather letting the user specify each header. Like :posheader: "" and :namedheader: "" would remove the section titles. Actually maybe they should be referred to as titles, not headers.
That said, your request brings up a harder question to answer. At least it makes me scratch my head. What does a section without a title look like? See this code in my PR for what I mean:
https://github.com/ashb/sphinx-argparse/pull/44/files#diff-c3ed14231074b274607bc7a6afc41f6a281fb8b575354e00b41fe667882be50fR96-R98
It's creating a section node then a title for that section. The docutils docs say that a section has a title: https://docutils.sourceforge.io/docs/ref/doctree.html#section. I'm not sure it is possible to have a section without a title. So then to make your request work you'd be talking about no sections at all...I suppose that might work. Might be some ugly if-statements, but could work.
Sorry, just brainstorming.


Adding Support for Recent Engagements

It looks like there are a few different distinct changes here that are lumped into a single pull request: Adding minimal Timeline API support, updates to the engagements API support, OAuth support for PUT requests. Can you split these into separate PRs so they can be merged independently? Also I've just merged support for OAuth tokens so you won't need the change to put_json to insert the token.


Calling Set on StringSlice flag appends result rather than setting it

I have a question regarding calling Set on a string slice flag.
Running the following code against master produces the following result
package main

import (
  "fmt"
  "github.com/spf13/pflag"
)

func main() {
  f := pflag.StringSlice("test", []string{"a"}, "")
  fmt.Printf("1: %v\n", f) // Expected: "[a]" Actual :"[a]"
  pflag.Set("test", "b")
  fmt.Printf("2: %v\n", f) // Expected: "[b]" Actual :"[b]"
  pflag.Set("test", "c")
  fmt.Printf("3: %v\n", f) // Expected: "[c]" Actual :"[b,c]"
}

$ go run main.go
1: &[a]
2: &[b]
3: &[b c]

I expect that when I call Set on the flag test I overwrite whatever value it was before. However, the second call to Set actually appends to the existing slice. Is this behaviour intended?

Yes, we had people who wanted to be able to do
./binary --test=bob --test=sue --test=sally
and get []string{bob, sue, sally}

OK. Thanks for the quick response!
I'll just use string and do a split to get the behaviour I wanted.

We/you could do a new string/slice type in pflag, I'd merge it. Should be 99% cp'd and minor changes in https://github.com/spf13/pflag/blob/master/string_slice.go#L24

The reason for the current behaviour makes sense, as long as it is clear to the developer that Set is akin to setting the flag in the command line (resulting in the appending behaviour) rather than setting the variable in code.
https://github.com/spf13/pflag/blob/master/flag.go#L361
// Set sets the value of the named flag.
func (f *FlagSet) Set(name, value string) error {

This misled me which was the reason for this issue.
I might look into your proposed change later if I have the time.


tst_misc.sh: Fix hang in make check

Fix recent bug in tst_misc.sh that causes hang in make check.
Affects netcdf-c 4.8.1 on Mac.

Good catch. Thanks.


Improve ts format of config file to extend from a ts.config.file

As we support Typescript format for our code-pushup.config.ts we should respect the existing setup.
At the moment we have to use relative paths to import other logic into the config file. This is hard to maintain and causes bade DX as you have now 2 styles/linting rules etc to maintain.
Example.
This is how we import ATM:
// code-pushup.config.ts
import {echoRunnerConfig} from "../../models/test/fixtures/echo-runner-config.mock";

export default { ... };

This is what we should support:
// code-pushup.config.ts
import {echoRunnerConfig} from "@code-pushup/models/testing";

export default { ... };

This should go in 3 phases to reduce the scope:

research
PoC
implementation

low prio


Update custom_layers.py

keras 2.0 compatibility (removing initializers name argument and fixing import)

Thanks for the suggested patch @kmader . I've made a few changes to get the code with with the latest version of both Keras (2.0.5) and TensorFlow (1.2.1)


Remove quiescence search limitation

Remove quiescence search limitation (Configuration.EngineSettings.Qui…escenceSearchDepth).
Rename Depth to DefaultMaxDepth.

Investigate why this made StopCommandShouldNotModifyPositionOrAddMoveToMoveHistory start failing intermitently.


Serious performance degrade

Last 2 versions cause serious performance degrade.
Every typing or selection in the text editor or even select control in the resource editor leads to call git.exe via cmd.
https://www.dropbox.com/s/3wpw2ub6ck3o16g/bandicam 2018-12-18 18-20-37-580.mp4?dl=0

Caused by the changes done in #49 :(
Time to kill that feature branch and look for a new solution.
The latest public releases should not be affected by this performance problem


Multicore encoding

This repository could be much faster by encoding each frame in parallel. This is necessary to achieve acceptable latency in a production renderer, where videos are currently encoded in the GIF (640x640, 20 FPS). I am forking swift-gif and will update this thread when it has been optimized.

Pretty cool, feel free to open a PR. I'm actually surprised the Int -> Int32 made a big difference, I would not have expected that, at least not on modern 64-bit CPUs.

It's because the compiler can vectorize the instructions, and perform more comparisons in one instruction (theory 1). Another theory is slightly reduced memory bandwidth.


Js initialization in OnAfterRender stopped working with 0.7.0

After I upgraded to Blazor 0.7.0 I noticed that initialization scripts of 3rd party JavaScript libraries which I usually call in OnAfterRender stopped working.
E.g. I use select2 (https://github.com/select2/select2) to apply a custom style for my select fields. But it seems like something has changed with Blazor 0.7.0, because the following code (which used to work in 0.6.0) dosn't work anymore:
protected override void OnAfterRender()
{
  base.OnAfterRender();
  JsInterop.InitializeSelect2();
}

My JavaScript function:
window.JsFunctions = {
  initializeSelect2: function() {
    $('select').select2();
  }
}

The control style will get applied when I call StateHasChanged() after JsInterop.InitializeSelect2(), but this will end up in an endless loop. Is there a better place to call InitializeSelect2() than OnAfterRender?
Edit:
I found the following statement about lifecycle methods in the official documentation:

OnAfterRenderAsync and OnAfterRender are called each time after a component has finished rendering. Element and component references are populated at this point. Use this stage to perform additional initialization steps using the rendered content, such as activating third-party JavaScript libraries that operate on the rendered DOM elements.

After doing a bit of research I can say that the corresponding field is not accessible in OnAfterRender.

@fs86 I have also seen this issue when using 0.7.0 where the overridden OnAfterRender is not getting fired,

@fs86 looks like there are is a lot of refactoring happening at present, check out
https://github.com/aspnet/Blazor/blob/master/test/testapps/BasicTestApp/InteropComponent.cshtml

@fs86 I have also seen this issue when using 0.7.0 where the overridden OnAfterRender is not getting fired,

It is getting fired but DOM elements are not accessible in OnAfterRender. I think it might be possible that the event is getting fired too early.

Anyone happen to have a workaround for this while we wait for it to hopefully be fixed in 0.8.0?


VSCode MacOS Python Extension termios.tcsetattr hangs in debug mode

VS Code About Info:
Version: 1.48.0
Commit: db40434f562994116e5b21c24015a2e40b2504e6
Date: 2020-08-13T08:03:27.059Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.6.0
Python Extension ID: ms-python.python 2020.08.101144
Program to demonstrate issue:
vscodeerr.py
Program to demonstrate tcssetattr hang.
20200816:KDT - Original.
import sys
import termios
import atexit
from select import poll, POLLIN
old_term = None
fd = None
def setTerm() :
global old_term, fd
fd = sys.stdin.fileno()
new_term = termios.tcgetattr(fd)
old_term = termios.tcgetattr(fd)
# New terminal setting unbuffered, no echo
new_term[3] = (new_term[3] & ~termios.ICANON & ~termios.ECHO)
termios.tcsetattr(fd, termios.TCSANOW, new_term)

# Support normal-terminal reset at exit
atexit.register(setNormal)

p = poll()
p.register(sys.stdin, POLLIN)

def setNormal() :
termios.tcsetattr(fd, termios.TCSAFLUSH, old_term)
main program
def main() :
setTerm()
print('All okay')
Start, call main()
main()
Notes:

VS Code running with Python extension installed, Python 3.8.3 installed and selected as interpreter.
Code above as only python file.
launch.js set to current python flle.
RUN program result:
python3 /Users/kirkthompson/Projects/PythonProjects/VSCodeErr/vscodeerr.py
All okay
DEBUG program result:
Hangs at termios.tcsetattr(fd, termios.TCSANOW, new_term)  line.
Pressing Debug Stop button displays VS Code notification "timeout after 1000 ms"

I don't know exactly when VS Code and the extension were updated, but prior to this update, everything worked as expected.

Yea i had many issues with the latest python interpreter (2020.8.101144) so i downgraded it to the one below it and works perfectly again


Move ipset and rule creation to native terraform

Hello! I have been using your example here and thought I would contribute back my changes. Terraform can natively setup ipsets and rules now.
Thanks for publishing the original code!

Thanks for the PR!
I'm hesitant to merge this because it will result in Terraform deleting the CloudFormation stack and thus the WAF rules in place. If someone has contacted AWS and got them to extend the maximum number of IPs per IP set, that whitelisting goes away. Thus, you'll have to import all the resources we previously created by hand and then get rid of the CF stack without deleting the resources. Since there's not really any versioning in place here (partially because modules barely exist in TF and partially because I never created any versioning on the repo), I don't want to break people.
Also, every time you terraform plan with this in place, Terraform will want to replace the Lambda-generated IPs with the one provided. You can use lifecycle { ignore_changes = [] } to ignore the IP sets, of course, but there have been bugs with that feature, so I generally ignore it. I also don't know if the names should be unique across an account. CloudFormation appends garbage to the names, so account-level uniqueness is maintained.

No worries at all.I just wanted to let you know in case it was useful. I might keep the fork alive and I will include the ignore_changes set.
I have been viewing the ipsets as disposable - destroying and recreating. But that has meant building some scaffolding with Boto as WAF(-regional) is not very well supported in terraform or Cloudformation!


Support adding tags to Items

Use Case
I want to be able to programmatically create items with tags as seen in connect-sdk-go
Requirements and desired behavior
copy the implementation from connect-sdk-go
Additional information
No response

Hi @Otterpohl. Thank you for filing this feature request. Creating items with specific tags indeed seems like a useful feature for the SDKs. We will definitely consider adding this to our roadmap.

Hi @Otterpohl,
I'm Sadia, the product manager leading the SDK initiative, it’s nice to meet you. Thank you submitting your feature request. Could you provide more details on how you currently use tags and what specific goals you're hoping to achieve? This information will help our team better understand your needs, ensuring we can deliver the right solution to address them effectively.

I'm not expecting anything novel out of this request, just support for specifying tags in the SDK just like you do for the connect SDK.
We use tags as metadata for organising credentials.

Hey @Otterpohl
With the release of v0.1.2 of the Go SDK, tags on Items are now supported!
I will close this issue and if theres any issues with the tags, please feel free to open up another issue.


right sidebar non-responsive/empty (outliner and word counter bugged)

I've tried many times, it still not work, if there's something wrong with the source code I can try to help to fix it.
What is happening?
Outliner not working in Mac with arm64 chip, it's not show at all.
Screenshots (if applicable):
The mod was enable while noting now show up in the edit page.

Operating system/browser name & version:
MacOS
notion-enhancer and/or notion-repackaged version:
Notion Enhanced, Version 2.0.18-1 (2.0.18-1)
notion-enhancer v0.11.0-dev
notion-enhancer configuration (enabled/disabled mods and their settings):
{"theme":"dark","last_read_changelog":"0.11.0-dev","profiles":{"default":{"_mods":{"be2d75f5-48f5-4ece-98bd-772244e559f3":false,"87e077cc-5402-451c-ac70-27cc4ae65546":true,"0a958f5a-17c5-48b5-8713-16190cae1959":false,"d61dc8a7-b195-465b-935f-53eea9efe74e":false,"b99deb52-6955-43d2-a53b-a31540cd19a5":false,"548fe2d7-174a-44dd-88d8-35c7f9a093a7":false,"e1692c29-475e-437b-b7ff-3eee872e1a42":false,"033bff54-50ba-4cec-bdc0-b2ca7e307086":false,"b5f43232-391b-415a-9099-4334dc6c7b55":false,"35815b3b-3916-4dc6-8769-c9c2448f8b57":true,"752933b5-1258-44e3-b49a-61b4885f8bda":false,"ae7862a9-5dbe-4f2c-9931-940f3ba5015d":false,"336cbc54-67b9-4b00-b4a2-9cc86eef763b":false,"69e7ccb2-4aef-484c-876d-3de1b433d2b9":false},"36a2ffc9-27ff-480e-84a7-c7700a7d232d":{"panel.width":240},"548fe2d7-174a-44dd-88d8-35c7f9a093a7":{"animate":false,"hotkey":"Meta+Shift+S","position":"right"},"5174a483-c88d-4bf8-a95f-35cd330b76e2":{"tweak.bracketed_links":true,"tweak.accented_links":true,"tweak.img_alignment":"left"},"e1692c29-475e-437b-b7ff-3eee872e1a42":{"last_open_tabs_cache":[{"notionUrl":"notion://www.notion.so/CLOUD-NATIVE-871a9912da2244fab26bd088bea66f66","icon":"url("notion://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fb136c0c3-0411-41ca-b7fd-e88820ba1456%2Fdownload.png?table=block&id=871a9912-da22-44fa-b26b-d088bea66f66&spaceId=93864e94-74a9-4c0d-8f57-5a6d22cffd5b&width=40&userId=b5220c17-2d15-4c7e-8767-eb0dc14b6d7f&cache=v2") 0 / 100%","title":"CLOUD NATIVE"}]},"35815b3b-3916-4dc6-8769-c9c2448f8b57":{"style":"rainbow"}}}}

@Huweicai have you tried opening the right sidebar? Can you show me what it looks like? Hover your mouse near the middle of the right edge of the window and the sidebar should pop out.

I do not have right sidebar even if I hover my mouse on it, but I have a left one.

I've closed all other mods, it still not work. @dragonwocky

I did some testing, the sidebar appears to be bugged, I'm merging this issue with https://github.com/notion-enhancer/desktop/issues/769#issuecomment-1221324082 as a master issue for the bugged sidebar, which means both the outliner and the word counter won't work

Thank you @dragonwocky for your warm heart, this project is really awsome,  hope everything goes well.

I'm having the same 'empty sidebar' issue on Linux with both the installed version and browser extension. Unfortunately, lacking an outline as I work severely impacts my workflow, to the point that I plan my tasks around whether the outline appears when I open Notion. If anyone finds a workaround or fix, please post here.


Substring._rangeOf fast path is incorrect

We had a fast path implemented incorrectly: We search the UTF8 code unit whenever possible, and convert the found UTF8 index back to String index. If the conversion fails, i.e. when the found UTF8 index does not fall on a character boundary, we simply bail and return nil. The correct implementation should be advancing the slice from the point of failure and keeping searching.
But we don't really need this fast path here as we already have another one that skips string transformation inside the helper function. Let's just remove this.

@swift-ci please test


Use col_max for format_commands

Actually use HelpFormatter.write_dl's col_max when generating usage. I have a lot of commands with long names, and I don't want the description of these to come on the following line, when simply adding some characters to the column with of the command name would make everything look very nice.
Before would be like:
short-command                      Docstring for short command
very-very-enormously-long-command-name
                                   Docstring for long command

And after bumping col_max a bit above 30:
short-command                           Docstring for short command
very-very-enormously-long-command-name  Docstring for long command

I am opening a pull request for this as well.

This is just the nth instance of a larger problem (#561).
In Click 8, you can solve your problem using the class attribute Context.formatter_class. The name of this attribute is unfortunate because it suggests a class is needed, but actually all it's needed is a callable that returns a formatter. The fact that it is a class attribute is quite bad as well.
def make_formatter(width, max_width):
    return HelpFormatter(width=width, max_width=max_width, col_max=40)

Context.formatter_class = make_formatter

Of course your context attribute is nicer but you could add similar attributes for index_increment and many other possible formatting settings.
IMHO, all these formatting options shouldn't clutter the context. This is what I'd do:

make HelpFormatter stateless
remove formatting options like terminal_width, max_content_width; they belong to the formatter
Context should have an attribute formatter to set a default formatter that propagates to children
Command should have an attribute formatter to override the default of a specific command (without propagating to children).

So you would do:
@group(context_settings={
    'formatter': HelpFormatter(col_max=40, ...)   # set your custom global default
})
def root():
    pass

@command(formatter=HelpFormatter(col_max=30, ...))   # override for a single command
def subcommand():
    pass

Now:

Context is leaner and has a responsibility less (creating the formatter).
A custom HelpFormatter subclass can have arbitrary settings that can easily be set globally without the need for factory functions and even for a specific command (without propagating the formatter), which is currently not possible.
the formatter is now a dependency of Command as it should be, not a clunky class attribute of Context; both Command and Context are more testable.


How to use "permittedInsecurePackages"?

I have a very similar problem with https://github.com/cachix/devenv/issues/623. I see that a new key was added to address this https://github.com/cachix/devenv/issues/619.
However, when I added it, the error still shows.

devenv.nix

{ pkgs, ... }:

{
  # https://devenv.sh/basics/
  env.GREET = "devenv";

  # https://devenv.sh/packages/
  packages =
    [

    ];

  # https://devenv.sh/scripts/
  scripts.hello.exec = "echo hello from $GREET";

  enterShell = ''
  '';

  # https://devenv.sh/languages/
  languages.ruby = {
    enable = true;
    version = "2.6.5";
  };

  # languages.ruby.bundler = {
  #   enable = true;
  #   package = ?;
  # };

  # https://devenv.sh/pre-commit-hooks/
  # pre-commit.hooks.shellcheck.enable = true;

  # https://devenv.sh/processes/
  # processes.ping.exec = "ping example.com";

  # See full reference at https://devenv.sh/reference/options/
}

devenv.yaml

inputs:
  nixpkgs:
    url: github:NixOS/nixpkgs/nixpkgs-unstable
  nixpkgs-ruby:
    url: github:bobvanderlinden/nixpkgs-ruby
    inputs:
      nixpkgs:
        follows: nixpkgs
permittedInsecurePackages:
  - "openssl-1.1.1v"
  - "openssl-1.1.1t"
  - "openssl_1_1"

cli error

       error: Package ‘openssl-1.1.1v’ in «github:NixOS/nixpkgs/9b2aa98db6b10503666a50f4eb93b2fc0d57bde5»/pkgs/development/libraries/openssl/default.nix:222 is marked as insecure, refusing to evaluate.

       Known issues:
        - OpenSSL 1.1 is reaching its end of life on 2023/09/11 and cannot be supported through the NixOS 23.05 release cycle. https://www.openssl.org/blog/blog/2023/03/28/1.1.1-EOL/

       You can install it anyway by allowing this package, using the
       following methods:

       a) To temporarily allow all insecure packages, you can use an environment
          variable for a single invocation of the nix tools:

            $ export NIXPKGS_ALLOW_INSECURE=1

        Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
        (Flake) command, `--impure` must be passed in order to read this
        environment variable.

       b) for `nixos-rebuild` you can add ‘openssl-1.1.1v’ to
          `nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
          like so:

            {
              nixpkgs.config.permittedInsecurePackages = [
                "openssl-1.1.1v"
              ];
            }

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
          ‘openssl-1.1.1v’ to `permittedInsecurePackages` in
          ~/.config/nixpkgs/config.nix, like so:

            {
              permittedInsecurePackages = [
                "openssl-1.1.1v"
              ];
            }

devenv version

devenv: 0.6.3

Any advice is appreciated, thanks!

I should note that I am able to use it in another project successfully:

cli error without permittedInsecurePackages

       error: Package ‘nodejs-16.20.2’ in «github:NixOS/nixpkgs/f0451844bbdf545f696f029d1448de4906c7f753»/pkgs/development/web/nodejs/v16.nix:16 is marked as insecure, refusing to evaluate.

       Known issues:
        - This NodeJS release has reached its end of life. See https://nodejs.org/en/about/releases/.

       You can install it anyway by allowing this package, using the
       following methods:

       a) To temporarily allow all insecure packages, you can use an environment
          variable for a single invocation of the nix tools:

            $ export NIXPKGS_ALLOW_INSECURE=1

        Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
        (Flake) command, `--impure` must be passed in order to read this
        environment variable.

       b) for `nixos-rebuild` you can add ‘nodejs-16.20.2’ to
          `nixpkgs.config.permittedInsecurePackages` in the configuration.nix,
          like so:

            {
              nixpkgs.config.permittedInsecurePackages = [
                "nodejs-16.20.2"
              ];
            }

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
          ‘nodejs-16.20.2’ to `permittedInsecurePackages` in
          ~/.config/nixpkgs/config.nix, like so:

            {
              permittedInsecurePackages = [
                "nodejs-16.20.2"
              ];
            }
direnv: loading the environment failed
direnv: error exit status 1

success with permittedInsecurePackages in devenv.yaml

inputs:
  nixpkgs:
    url: github:NixOS/nixpkgs/nixpkgs-unstable
permittedInsecurePackages:
  - "nodejs-16.20.2"

The issue here is that nixpkgs is imported by https://github.com/bobvanderlinden/nixpkgs-ruby doesn't pass our settings.
We'd have to somehow collect config in flakes at central location so all imports of nixpkgs can use it.
cc @bobvanderlinden

We can fix this for #745 by setting NIXPKGS_CONFIG so that all nixpkgs imports respect it.

Hmm, that is indeed unfortunate. NIXPKGS_CONFIG sounds like a way to go for now since we're using impure Nix in devenv. Hopefully these kinds of issues can be resolved in Nix Flakes eventually.

Hmm, indeed. This is tricky.
I'm thinking that nixpkgs-ruby should allow injecting pkgs or nixpkgs config? Downside is that it doesnt seem to match with any flake standard and we're thinking up a new solution.
Or avoid using nixpkgs in nixpkgs-ruby by using the overlay on devenvs nixpkgs. More standardized, but it'll probably not be able to use the cache of nixpkgs-ruby.

I managed to come up with a way to fix this, going to write a prototype tomorrow.
It should work as long as you use nixpkgs.legacyPackages and follow the nixpkgs we provide.

I managed to come up with a way to fix this, going to write a prototype tomorrow.
It should work as long as you use nixpkgs.legacyPackages and follow the nixpkgs we provide.

I just came up against this. nodejs-16* was removed from nixpkgs November 2023.
My understanding is that to use it, I need to have a specific input that uses the revision that still had that package in the tree.
Are you saying your fix will only work for nixpkgs inputs that follow the devenv one?
As that means old packages (that are no longer in the nixpkgs tree provided with devenv) can't be installed, right?
I suppose one workaround is repackaging nodejs-16* in my own flake and pulling that in that way.
Would that be the best path forward for this case?

Regarding nodejs-16, it is a different issue. It isn't so much an insecure package, it is removed from nixpkgs. See https://github.com/cachix/devenv/issues/218#issuecomment-1365842092 for an example on how to use packages from older nixpkgs. The issues that cover this are: https://github.com/cachix/devenv/issues/16 and https://github.com/cachix/devenv/issues/681
As for insecure packages, they could also be overridden in an overlay. Always use an overlay for (for instance) nixpkgs-ruby and having a way to mark packages as non-insecure (which uses override of meta behind the scenes).

Relevent nix issue https://github.com/NixOS/nix/issues/9875

I've implemented this in 427d360faec649842761919c6be9911e5286603a, but there's no way to convince flakes to allow importing an absolute path here: https://github.com/NixOS/nixpkgs/blob/c2e03072b8e365b0a76cf884f781f0f196b96214/pkgs/top-level/impure.nix#L31
Tests for this are in 4af4099b14dfd6802b81bfa2dd6059ab4b332c26 once someone circles back to it.

Regarding nodejs-16, it is a different issue. It isn't so much an insecure package, it is removed from nixpkgs. See #218 (comment) for an example on how to use packages from older nixpkgs. The issues that cover this are: #16 and #681

The second sentence of my comment was that nodejs-16 was removed 😄
My problem was that even specifying an older revision of nixpkgs as an input (the last one that had nodejs-16), I got the same error as the original comment in this issue, and when I followed the instructions it didn't fix it - just like the original comment.

As for insecure packages, they could also be overridden in an overlay. Always use an overlay for (for instance) nixpkgs-ruby and having a way to mark packages as non-insecure (which uses override of meta behind the scenes).
I'm not sure what you mean by this - I haven't used overlays a lot, but I think I understand roughly what they do - overlay certain packages on top of nixpkgs - like using the // operator. Does this somehow avoid the insecure check?

I ended up fixing it by running export NIXPKGS_ALLOW_INSECURE=1 devenv shell --impure, or by adding something to my global nix config, I can't recall (it is on a different machine).
@domenkozar the commit you reference isn't in a branch on this repo, I can't see it in the rust rewrite you mentioned this issue in, and when I look at the code in the commit you referenced, that code change isn't in the same file on main.
I also can't see anything in docs about it. Did it maybe get lost in that sizeable PR, or did you achieve the same functionality with different code?

I've explored this in different directions and found out the only way to make it work with by using NIXPKGS_CONFIG, the problem is that the current semantics allow for builtins.pathExists to only return true to paths references by self, so that needs to be addressed bofore this can be fixed.
We could support NIXPKGS_ALLOW_INSECURE, but not permittedInsecurePackages in the current form.

We could support NIXPKGS_ALLOW_INSECURE, but not permittedInsecurePackages in the current form. Note that I'm wary of supporting NIXPKGS_ALLOW_INSECURE as a global hook, I'd prefer each insecure package should be marked as accepted individually.

That is unfortunate! I also would much prefer to allow packages individually. I'm hoping to get my company onboard with nixpkgs, probably via devenv.
It would certainly be better from a security point of view to have the list of permitted insecure packages approach be possible.
I'd then be able to import that list from a separate file, which requires me or someone from my team to approve changes. Would make keeping things secure a lot easier.
Otherwise, setting NIXPKGS_ALLOW_INSECURE in our systems would make it too easy IMO for insecure packages to get into our code.
Thanks for reopening.

This issue is a top priority for me, and I need to brainstorm a way to make progress.

Hey same issue here. While commit https://github.com/cachix/devenv/commit/7fa7e03942aee268c719d9d30b8c65b74850509e still is not in the air, is there a quick & dirty way to allow insecure packages using .envrc?

Are there any updates on this topic? @instantepiphany Did you manage to use devenv with node16? It may be EOL but we have legacy projects that cannot be updatet atm so we are still in the urge of using that version.

Are there any updates on this topic? @instantepiphany Did you manage to use devenv with node16? It may be EOL but we have legacy projects that cannot be updatet atm so we are still in the urge of using that version.

I don't recall if I got devenv working. I just checked where we use Node 16 via Nix and all I committed was a shell.nix with no special options, just specifying Node 16 as a package.
So I probably just set the NIXPKGS_ALLOW_INSECURE=1 envvar via an .envrc file on my local machine to get it working.
Maybe try the approach mentioned above: https://github.com/cachix/devenv/issues/792#issuecomment-2043166453
My company has now committed to Nix - we are using it in production and we are already growing the scope of what it handles for us. I've been writing everything in plain flakes so far - I'm quite comfortable with "vanilla" Nix with flakes. But for the internal "customers" of the files I'm writing, I want them to have a more user friendly way of installing packages, hence trying to get devenv working.
We've also upgraded our internal code that used Node 16, so we don't need that to work in Devenv anymore. But I'm still hoping Devenv gains this capability, as I don't want a binary flag that allows all insecure packages to be installed enabled on my colleagues machines.

Thanks @instantepiphany for your reply and support. I'll see if I can get a workaround.

Going to be addressed by #1548


Support feature detecting if an API is available

To get cross-browser functionality working, JS code often does things like
if (typeof fetch === "function") {
  // assume `fetch` API exists
} else {
  // fall back to XMLHTTPRequest
}

We should support this kind of feature detection somehow.

Strawman: add a #[wasm_bindgen(feature_detect = function_name)]-style attribute:

function_name would be the name of a function with signature fn() -> bool that returns true if the thing was found in JS and false otherwise

If the imported thing was not found in JS, we bind to a stub that throws + logs a JS error.

enables usage like this:

#[wasm_bindgen]
extern {
    #[wasm_bindgen(feature_detect = is_fetch_available)]
    fn fetch(...) -> ...;
}

if is_fetch_available() {
    fetch(...);
} else {
    // do some fall back...
}

Perhaps this requires an RFC.

This got me thinking! I managed to get https://github.com/rust-lang-nursery/rand/pull/541 working with what we've got today on crates.io!
I'm not entirely sure how much we want to bake in, from what I've seen everyone does feature detection slightly differently so we may want to just be sure to enable various patterns rather than trying to bless one?


[P1] Intervention Locations more than Prefix and Suffix

Does the backbone pyvene support more than two intervention blocks on one layer? I met anaconda3/envs/reft_train/lib/python3.10/site-packages/pyvene/models/intervenable_base.py", line 1092, in _wait_for_forward_with_parallel_intervention     unit_locations_base[ IndexError: list index out of range when I tried to add the third intervention block into one layer.

@comeandcode Hey, what is your intervenable model config? And could you give an example of the unit_locations field you are feeding into the model forward pass? Thanks!

Thank you very much for your reply! Consider I am applying loreft to 3 layers: [3, 6, 9], and I create a list: layers = [3, 6, 9, 3, 6, 9, 3, 6, 9], and using a for loop to create representations like:reft_representations=[{         "component": component_mapping["language_model_layers"] % (int(index) - 1),         "low_rank_dimension": low_rank_dimension,         "intervention": pyreft.LoreftIntervention(embed_dim=model.model.config.hidden_size,             low_rank_dimension=low_rank_dimension)} for index in layers].
And for the unit_locations passed in the forward, it's a 3d list like (assume batch_size =2 and the prompt length is the same for these two prompts ) [[[1, 2, 3],[1, 2, 3]], [[1, 2, 3],[1, 2, 3]], [[1, 2, 3],[1, 2, 3]], [[5, 6, 7],[5, 6, 7]], [[5, 6, 7],[5, 6, 7]], [[5, 6, 7],[5, 6, 7]], [[10, 11, 12],[10, 11, 12]], [[10, 11, 12],[10, 11, 12]], [[10, 11, 12],[10, 11, 12]]], so location 1, 2,3 for these 3 layers, location 5, 6, 7 for these 3 layers and location 10, 11, 12 for these 3 layers. (after permute(1, 0, 2).tolist()).

@comeandcode Thanks. This should be a basic usecase of pyvene APIs.
Did you set up your call like:
        # run intervened forward pass
        unit_locations = None
        if "intervention_locations" in inputs:
            unit_locations={"sources->base": (
                None,
                inputs["intervention_locations"].permute(1, 0, 2).tolist()
            )}

        _, cf_outputs = intervenable(
            {
                "input_ids": inputs["input_ids"],
                "attention_mask": inputs["attention_mask"]
            },
            unit_locations=unit_locations,
            labels=inputs["labels"],
            subspaces=inputs["subspaces"].permute(1, 0, 2).tolist() if "subspaces" in inputs else None
        )

The unit_locations field needs to be set up as a dict.

Thank you for your reply! Yes, I followed the example you kindly provided in Pyreft/example/loreft, since using multiple intervention locations (3 or more) on the same layer is supported by pyvene, I will try to find out if there are any other mistakes and if so I will post them here! By the way, I found in the example/loreft, special tokens were skipped such as BOS or EOS right? Since I printed out the intervention locations and found they started from 1 but 0. So that only real prompts are intervened instead of affecting special tokens. I am not sure if I am correct on this. Thank you!


Fix tiny and normal builds for Motif.

Problem: Motif requires non-const char pointer for XPM data shared with GTK.
Solution: Cast non-const to const char pointer for GTK.

thanks, for fixing this. I just noticed your email address is invalid. I suppose this is done intentionally?


Arcade circles

Important: Pull Requests should only be issued against the dev branch. PRs against the master branch will always be closed.
This PR changes (delete as applicable)

Nothing, it's a bug fix

Describe the changes below:
Added support for circles in various functions

Do these work against Tilemaps?

No, it does not work.
I have completed a pilot test circles on a tiles. The result is terrible. examples.zip See example5
Firstly, it is unclear why it is necessary to process a collision circles with tiles (?). Only the collision of corners will differ from collisions with rectangles.
Secondly, there are so many problems in the processing of collisions on the borders of the tiles. The circle can touch the border of the two tiles. This results in an unnatural behavior.

Because unless it's guarded against it, I 100% guarantee you that it will generate numerous GitHub issues asking why their circle bodies don't work on a tilemap.

You can add support for circles collisions with tiles, but with limitations.
Look at my decision in the archive.
I have not worked and do not work with tiles, so I will not move in that direction.


Component not updating css on property update

I'm relatively new to React and styled-components and I'm bumping into this issue.
When my styled-component is re-rendered, it should refresh the CSS, but the property is changed and the CSS is not.
Here  is my component:
StyledMap = styled(Map)`
    cursor: ${props => {
        console.log(props.isCreatingMarker);
        return props.isCreatingMarker ? 'crosshair' : 'pointer'}
    }};
`;

On refresh, I see 'true' in my log and the cursor is a crosshair. Super! But when I click my trigger, the log shows false, and the cursor is still the crosshair.
Can somebody provide some insight for me?

Can you supply some reproductions? It's probably a usage issue, so with a webpackbin/codesandbox we can check what's going on :smile:
There's some instructions and links in the issue template, if you're unsure what to submit :wink:

Can you try wiggling your cursor after clicking? I think the browser just might not re-render the cursor on-click.

I fixed this by using an overlay which becomes visible when props.isCreatingMarker is true and vice versa.
Could not fix the original issue, but this is very acceptable as well.

Probably, i have the same problem...
import React, { Component } from "react";
import ReactDOM from "react-dom";
import styled from "styled-components";

class ModalPortal extends Component {
  render = () => <div className={this.props.overlayClassName} />;
}

class Modal extends Component {
  componentDidMount() {
    document.body.appendChild(this.node);
  }

  componentWillUnmount() {
    document.body.removeChild(this.node);
  }

  getOverlayClassName = `${this.props.className}__overlay`;

  render() {
    if (!this.node) {
      this.node = document.createElement("div");
      this.node.className = this.props.className;
    }

    return ReactDOM.createPortal(
      <ModalPortal {...this.props} overlayClassName={this.getOverlayClassName} />,
      this.node
    );
  }
}

export const StyledModal = styled(Modal)`
  display: ${props => {
    // THIS IS NOT WORK, WHEN I TOGGLE IS OPEN FROM PARENT COMPONENT
    return props.isOpen ? "block" : "none";
  }};

  &__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.75);
  }

  &__content {
    position: absolute;
    top: 40px;
    left: 40px;
    right: 40px;
    bottom: 40px;
    border: 1px solid #ccc;
    background: #fff;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 4px;
    outline: none;
    padding: 20px;
  }
`;

Somebody can help with this, for several days already, I'm puzzling how to make flexible modal windows :|


fix(object): Takes into account the range of bytes starting with 0

Fixes returning the Range-Content header when requesting a range starting with byte 0 and no end, ie bytes=0-
The issue has been reported here: https://github.com/jamhall/s3rver/issues/754

Hey @jamhall , added tests that cover the specific case I've experienced when using smart-open with this library.

Closing in favor of #755


Fix system_off example for cc13x2/cc26x2 to enter shutdown mode

Due to some recent changes, the example no longer enters shutdown mode as the last step. Instead, it is erroneously entering the standby mode.
This commit changes the example to enter the new "soft off" power state, which should be mapped to the hardware's shutdown mode.

@vanti  glad to see you back ;-)

@vanti  glad to see you back ;-)


Images cannot be seen in browser

I have uploaded an image to my local s3 bucket but whenever I want to see the image via web browser I get a black screen and a little square in the middle.
Is there a way to show it? PDF, xls, etc get downloaded successfully.

Solved! It was serverless offline which does not support binaries.


[Feature]: Allow pdf file navigation from local machine using navigateTo

Is there an existing issue for this?

[X] I have searched the existing issues

Summary

A user should be able to hyperlink to pdf file in their local disk
Why should this be worked on?
Feature requested by EE user
 Front conversations

Duplicate of #4878


[PornHub] Format and links for user pages have changed

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.08.28. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

[x] I've verified and I assure that I'm running youtube-dl 2018.08.28

Before submitting an issue make sure you have:

[x] At least skimmed through the README, most notably the FAQ and BUGS sections
[x] Searched the bugtracker for similar issues including closed ones
[x] Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

[x] Bug report (encountered problems with youtube-dl)
[ ] Site support request (request for adding support for a new site)
[ ] Feature request (request for a new functionality)
[ ] Question
[ ] Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):
youtube-dl.exe --no-mtime --no-playlist --playlist-reverse -i -w --ffmpeg-location "C:\Users\USERNAME\Apps\ffmpeg\bin\ffmpeg.exe" -f "bestvideo+bestaudio/best" --write-thumbnail --external-downloader C:\Users\USERNAME\Apps\aria2\64bit\aria2c.exe --external-downloader-args "--file-allocation=none -x 4 -k 1M" -o "V:\test\%(title)s_%(id)s.%(ext)s" -v https://www.pornhub.com/pornstar/jenny-blighe/videos/upload
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--no-mtime', '--no-playlist', '--playlist-reverse', '-i', '-w', '--ffmpeg-location', 'C:\\Users\\USERNAME\\Apps\\ffmpeg\\bin\\ffmpeg.exe', '-f', 'bestvideo+bestaudio/best', '--write-thumbnail', '--external-downloader', 'C:\\Users\\USERNAME\\Apps\\aria2\\64bit\\aria2c.exe', '--external-downloader-args', '--file-allocation=none -x 4 -k 1M', '-o', 'V:\\test\\%(title)s_%(id)s.%(ext)s', '-v', 'https://www.pornhub.com/pornstar/jenny-blighe/videos/upload']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2018.08.28
[debug] Python version 3.4.4 (CPython) - Windows-8.1-6.3.9600
[debug] exe versions: ffmpeg N-90960-gbcff983dc3, ffprobe N-90960-gbcff983dc3
[debug] Proxy map: {}
[generic] upload: Requesting header
WARNING: Falling back on generic information extractor.
[generic] upload: Downloading webpage
[generic] upload: Extracting information
[download] Downloading playlist: Porn Videos Uploaded by Pornstar Jenny Blighe | Pornhub
[generic] playlist Porn Videos Uploaded by Pornstar Jenny Blighe | Pornhub: Collected 2 video ids (downloading 2 of them)
[download] Downloading video 1 of 2
[debug] Invoking downloader on 'data:"+o+"; base64,"+i+"'
[download] Destination: V:\test\Porn Videos Uploaded by Pornstar Jenny Blighe _Pornhub (2)_upload-2.unknown_video
[download] 100% of 5.00B in 00:00
[download] Downloading video 2 of 2
[debug] Invoking downloader on 'data:"+o+";base64,"+i+"'
ERROR: Incorrect padding
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 803, in extract_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 1002, in process_ie_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 857, in process_ie_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 1635, in process_video_result
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 1908, in process_info
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 1847, in dl
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\downloader\common.py", line 364, in download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\downloader\http.py", line 341, in real_download
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\downloader\http.py", line 109, in establish_connection
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmpc4srko6s\build\youtube_dl\YoutubeDL.py", line 2211, in urlopen
  File "C:\Python\Python34\lib\urllib\request.py", line 464, in open
  File "C:\Python\Python34\lib\urllib\request.py", line 482, in _open
  File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain
  File "C:\Python\Python34\lib\urllib\request.py", line 1496, in data_open
  File "C:\Python\Python34\lib\base64.py", line 554, in decodebytes
binascii.Error: Incorrect padding

Description of your issue, suggested solution and other information
It looks like PornHub has changed the formatting of user pages.
Old user page link: https://www.pornhub.com/users/jenny-blighe/videos/public
New user page link: https://www.pornhub.com/pornstar/jenny-blighe/videos/upload
The above debug log is for the new page link.
Also, the links for the new pages come in two different versions:  a "pornstar" version and a "model" version.
Pornstar version: https://www.pornhub.com/pornstar/jenny-blighe/videos/upload
Model version: https://www.pornhub.com/model/jayndrea/videos/upload

It looks like some users still use the old format, but the new formats above are being used for most verified user accounts from what I can tell.

https://www.pornhub.com/blog/6401
PornHub's blog post about the changes. I don't think there's any information that I haven't shared, but just thought I'd throw this on the ticket.


[Bug Report] MUSIC BOT

Bug Description
When I put songs from the playlist, I put other songs from yt that are not in the playlist.
Steps to Reproduce
The error is random, I only receive it in the console
Expected Result

Debug Output
System Properties:
  java.version = 17.0.1
  java.vm.name = Java HotSpot(TM) 64-Bit Server VM
  java.vm.specification.version = 17
  java.runtime.name = Java(TM) SE Runtime Environment
  java.runtime.version = 17.0.1+12-LTS-39
  java.specification.version = 17
  os.arch = amd64
  os.name = Windows 10

JMusicBot Information:
  Version = 0.3.6
  Owner =<PHONE_NUMBER>84322827
  Prefix = ^
  AltPrefix = ^
  MaxSeconds = 0
  NPImages = true
  SongInStatus = true
  StayInChannel = true
  UseEval = false
  UpdateAlerts = true

Dependency Information:
  JDA Version = 4.3.0_324
  JDA-Utilities Version = 3.0.5
  Lavaplayer Version = 1.3.78

Runtime Information:
  Total Memory = 56
  Used Memory = 12

Discord Information:
  ID =<PHONE_NUMBER>05534476
  Guilds = 3
  Users = 3

### Additional Info

CONSOLE ERROR IN IMAGE: https://imgur.com/AMjuf2q

### Checklist

- [X] I have looked for information about this [within the documentation](https://jmusicbot.com/)
- [X] I have searched for similar issues [on the issues page](https://github.com/jagrosh/MusicBot/issues?q=is%3Aissue)
- [X] I am running the latest version of the bot: ![Release](https://img.shields.io/github/release/jagrosh/MusicBot.svg)

Same error, YouTube return the forbidden error (403) i don't know why, you can retry to play the music, for me it work sometime...


feat: EnforceStatic type

Maybe we can add a decorator or type to enforce static methods being declared? See https://github.com/microsoft/TypeScript/issues/14600 .

I see that's a very opinionated proposition. Can you link some most elegant implementation proposals?

@quezak How does https://github.com/microsoft/TypeScript/issues/14600#issuecomment-488817980 look?

As you can see in the linked issue, it's debatable that "abstract static" is a valid concept and/or good practice. But IMO it's not totally bad and I can see some uses for it, so I wouldn't have objections adding it -- but it would need to work in all (or "reasonably almost all") cases.
I just tried out that implementation, and it's not perfect:

it doesn't even work right away, I had to change Array<unknown> to Array<any>
but: that requirement I needed to change looks invalid, since it requires the "static interface" to define a constructor, while some cases require only a static function, like fromJson mentioned in the issue. So I've removed that requirement.
it works for correct examples (see exhibit A below)
it detects invalid static properties (see exhibit B)
it detects invalid static method arguments (see exhibit C)
it doesn't detect invalid static method return values (see exhibit D)
are there any other cases that need to be covered?

@krzkaczor @macbem what are your opinions?
Example tested on TS 3.6.2:
// Definition
export function RequireStatics<T extends {}>(): ((constructor: T) => void) {
    return (_constructor: T): void => {};
}

// Example usage
class AbstractFoo {}

interface IFooStatic {
    supportsBar: boolean;
    fromJson(jsonStr: string): AbstractFoo;
}

// Correct example -- compiles ok
@RequireStatics<IFooStatic>()
export class ExhibitA extends AbstractFoo {
  static supportsBar: boolean = true;
  static fromJson(_jsonStr: string): ExhibitA { return new ExhibitA(); }
}

// Error as expected:
// Argument of type 'typeof ExhibitA' is not assignable to parameter of type 'IFooStatic'.
//   Types of property 'supportsBar' are incompatible.
//     Type 'number' is not assignable to type 'boolean'
@RequireStatics<IFooStatic>()
export class ExhibitB extends AbstractFoo {
  static supportsBar: number = 1;
  static fromJson(_jsonStr: string): ExhibitB { return new ExhibitB(); }
}

// Error as expected:
// Argument of type 'typeof ExhibitB' is not assignable to parameter of type 'IFooStatic'.
//   Types of property 'fromJson' are incompatible.
//     Type '(_num: number) => ExhibitB' is not assignable to type '(jsonStr: string) => AbstractFoo'.
//       Types of parameters '_num' and 'jsonStr' are incompatible.
//         Type 'string' is not assignable to type 'number'.
@RequireStatics<IFooStatic>()
export class ExhibitC extends AbstractFoo {
  static supportsBar: boolean = false;
  static fromJson(_num: number): ExhibitC { return new ExhibitC(); }
}

// Doesn't work -- no type errors even though `fromJson` has invalid return type
@RequireStatics<IFooStatic>()
export class ExhibitD extends AbstractFoo {
  static supportsBar: boolean = false;
  static fromJson(_jsonStr: string): number { return 42; }
}

@quezak Thanks for your attempt. I've modified your solution a bit:
export function RequireStatics<T extends ({} extends T ? never : {}) >(): ((_ctor: T)=>void) {
    return (_ctor: T)=>{};
}

Change:

Force user to specify a non-empty interface. This can prevent forgetting assigning the generic parameter

Actually the solution can normally detect correctly. For ExhitbitD case it doesn't work (it actually worked) is because number is indeed assignable to Base.
To clarify:
type Check1 = number extends AbstractFoo ? true : false; // true
type Check2 = {} extends AbstractFoo ? true : false; // true
type Check3 = number extends {} ? true : false; // true

You're right! I didn't expect that number extends {}, seems weird since number is a primitive type.
If I add anything to my example AbstractFoo, indeed all examples error out correctly.

As you can see in the linked issue, it's debatable that "abstract static" is a valid concept and/or good practice. But IMO it's not totally bad and I can see some uses for it, so I wouldn't have objections adding it -- but it would need to work in all (or "reasonably almost all") cases.

I think that abstract static is a good idea, I remember I wanted to accomplish something similar once. The fact that it's not doable in classic OOP languages like Java doesn't mean anything (it's common in scala). But I agree that if we want to add it, it should work reasonably good.
One important thing to realize that this is a runtime function (decorator) but it's not a huge problem - we already have such utils in functions.ts file.
I think it's nice addition to ts-essentials and @quezak already wrote nice piece of documentation 😆 Who wants to prepare a PR?

@quezak Are you planing to create a PR for this? If not, I can do so :)

@yxliang01 feel free to write it, I probably wouldn't have time for that in the next few days :)

@yxliang01 do you still need the decorator?

I will close the issue as there is no activity for 2 years


Typing fixes

The Observable.prototype.lift and Operator.prototype.call have unbound generic type parameters at the function level. Current signatures are:
// src/Operator.ts
export class Operator<T, R> {
  call<T, R>(subscriber: Subscriber<R>): Subscriber<T> {
    return new Subscriber<T>(subscriber);
  }
}

// src/Observable.ts
...
lift<T, R>(operator: Operator<T, R>): Observable<R> {
  const observable = new Observable<R>();
  observable.source = this;
  observable.operator = operator;
  return observable;
}
...

The T type parameter in each of those functions shouldn't be there, since T in each of those definitions needs to be bound to the T argument of the containing type.
The other changes are removing the redundant type argument in a few operators. The change also revealed that MergeMapToOperator doesn't implement the Operator interface correctly:
export class MergeMapToOperator<T, R, R2> implements Operator<Observable<T>, R2> {
  ...
  call(observer: Subscriber<R2>): Subscriber<T> {
    return new MergeMapToSubscriber(observer, this.ish, this.resultSelector, this.concurrent);
  }
}

An Operator<Observable<T>, R2> needs to implement a call method that returns Subscriber<Observable<T>>, not Subscriber<T>. Since I'm not familiar with what the mergeMapTo operator is supposed to do (the doc comment is missing), I couldn't change MergeMapToSubscriber to implement Subscriber<Observable<T>>. I've fixed it by replacing T with any for now, but this may bear further investigation.

Just a minor details regarding the commit messages: you should not capitalize the first letter, and you should use present tense. More info on CONTRIBUTING.md#subject

@luisgabriel Sorry, missed that bit in the contribution guidelines. Looks like fixing that second parameter has indeed broken a bunch of other operators that can only be fixed by introducing any as a quick hack or figuring out how the types flow through the implementation.
I've actually already worked out the latter approach in a different branch (I'm planning on retracing the changes in small commits), but it involves lots of code being touched throughout the codebase. Would it be better for now to any any operators that incorrectly implement Operator?

I'm not sure what would be the best solution here. Could you point out this branch you said? I think I can have a better idea of the problem size.
It's also worth to wait for some inputs from @kwonoj  and @david-driscoll in this matter.

Sure; take a look at the typingFixesAllAtOnce branch. Unfortunately there's a number of changes in there that build on this bugfix that make things a bit hairy. They include deduplication of the function signatures by adding an interface to each operator file and various changes in the implementation to make types flow correctly. Those changes aren't necessarily in a finished state.
You could probably get a better idea of which operators would need to be fixed solely as part of this  bugfix by:

Cloning the typingFixes branch
Removing the R parameter from Operator
Trying to build

I was trying same (get rid of <R>) at the same moment, and agree it requires amount of changes to make correct type inferences.
My vote in here is make changes correctly at once, avoiding one additional steps of introducing any. Maybe PR can be separated per effort required, but for me removing redundant generic <R> and updating signature is atomic, should be one changes.

I agree that would be the ideal approach @kwonoj, but the problem is that making the types flow correctly inside the implementations requires a lot of domain knowledge and isn't a simple chore type task. For this reason it would be easier if it could be fixed in separate PRs on a case by case basis.
In the typingFixesAllAtOnce branch I linked, I fixed implementations for whichever operators included doc comments, but there were still a few where I couldn't find or understand the expected behavior and had to use any.

As I already mentioned, I agree that requires sufficient time to make corresponding changes. I'm not object to make separate PR for those effort, while this PR leaving <R> for now if those requires noticeable input for making changes. Still, I'm bit opposing to introduce interim any for incremental changes. PR https://github.com/ReactiveX/RxJS/pull/1077 would be reference for this kind of cases - even though it's amount of changes if it's logical atomic chunk, it'd be better to be changes at once.

Ok, I see your point. :) So in terms of direction forward, here's a couple of problems that pop up which I don't know how to address:

webSocket.ts: Mismatch in type of operator property
lift<T, R> problem exists in Subject as well. Removing T results in similar type mismatch of operator property

There are also compile errors in the following files, however I already have tentative fixes for each of these in typingFixesAllAtOnce which need to be checked for correctness:

defaultIfEmpty.ts
every.ts
isEmpty.ts
pairwise.ts
race-support.ts
reduce-support.ts
scan.ts
skipwhile.ts
withLatestFrom.ts

I will clean these up and add them as individual commits to this branch. Once all of these are addressed I think we will be rid of the extra <T, R>.

@kwonoj Ok, so I've cleaned up all the ones I know how to fix.The only remaining failures at this point are the webSocket and Subject failures. If you could take a look and indicate out how those can be fixed that would be much appreciated.

Wow, this is huge ;) appreciate for effort. Let's start look into, I'll add some inputs if I have some questions around. /cc @david-driscoll also if he could give some helps.

The point about Subject.lift makes me thing that you should either just cast this to <any> and not worry about the underlying details, or Subject needs an additional generic type parameter.
I'm inclined to say cast it to any, because most consumers will be making subjects, and having two type arguments would be confusing.

@kwonoj Would you agree just casting to <any> is fine here?

Would you agree just casting to  is fine here?

: It'd be appreciate if you can point 'here', since comment is not pointing specific code and due to size of change, it's bit hard to find right context. ;)

Sorry, I was referring to David's comment there. If you look at my last commit, you'll see the problem. The lift method on Subject is supposed to produce (presumably), an Observable<R>. However, the first line in lift tries to make a Subject<R> using nothing but the instance of Subject<T> itself. Fixing in a type safe way would involve adding another type parameter to Subject, which would be somewhat inconvenient and would probably involve a lot of changes wherever it is referenced.

@david-driscoll, @kwonoj Would it make sense to just remove the lift operator from Subject and inherit the behavior from Observable? I don't really see that it makes sense to try and feed the transformed values produced by the lifted observable into the same destination.
E.g. you have a Subject<number>, which consists of an Observable of numbers and an Observer of numbers. You lift this through .map(n => n.toString()) to produce another ?<string>. Would this be a Subject<string> or an Observable<string>?
Right now the code is trying to produce a new Subject, with a few quirks:

It sets the destination of the new Subject to its own destination, but this will result in our Observer<number> getting fed strings if anyone actually tries to push values to the new Subject
The source of the new Subject<string> is set to the original Subject<number>, which is fine, but you already get this behavior from the Observable.prototype.lift operator this method is overriding
The newly created subject is returned as an Observable, which indicates to me that the return value isn't expected to be used as a Subject anymore

Removing the override of  lift in Subject doesn't affect tests at all. It would be great if someone who thoroughly understands this machinery could provide input.

@masaeedu I think @blesh and @trxcllnt can provide some input in this matter.

As an immediate thought I think it's fine to creating chain of subject via lift, but interesting point. Interface already limits to return observable only, limiting created object to behave as subject.. @masaeedu What about creating those as separate issue? I don't think this PR's scope can contain those changes anyway. (also this PR's already has bit of size for its own discussion)

@kwonoj The reason I'm bringing this up here is because we need to make lift compile again for Subject after removing the redundant generics. If you want I can revert all changes to Subject (including removal of the redundant generics), and address both problems in a separate issue.

I think we can choose between

leave this PR as is until get conclusion on subject behavior
revert current changes on subject to make this PR progress while discuss (your proposal)

I'll leave up to you which way to proceed.

Ok, opened #1234 and will nuke the Subject changes.

@kwonoj, @blesh Ok, I've nuked the _this changes. The discussion regarding what to do about Subject has stalled a bit, so I think the prudent thing to do is to skip fixing the lift signature on that and the derived websocket subject for now.

@masaeedu can you rebase this PR please?
Also: just a note on PRs like this in general:
If it's internal code typings your changing (read: Nothing that a developer-user would interface with)...
My feeling is that <any> is fine, unless it's going to speed up the build to do more specific casting. (which I'm not sure about)... or unless it's going to add a lot to our development process to have things properly typed. (cc @david-driscoll @saneyuki @kwonoj on this note)

Would love to see this one in fairly soon, working on additional operator signatures at the moment and ran into an issue were the changes ran into these same issues.  @masaeedu :+1:

Sorry about the delay folks. I'll be cleaning this up and rebasing on Saturday.

@blesh Ok, rebased and removed most of the changes since they were controversial. The changes now are limited to removing redundant generics from Operator.call and Observable.lift and changing the minimum number of operators necessary to compile the project again.
This still leaves a number of operators where the internal typings (and in some cases user-facing typings) are wrong, but they still compile since this is any. Possibly these can be done in a different PR/skipped since low priority.
cc @kwonoj

@masaeedu maybe it would be worth to create an issue listing the operators with wrong typing (especially the external ones) so we could try to fix it incrementally.

Sorry for delays, I'll start look into updated changes.

Change looks good to me, nice PR @masaeedu :smile:

I'll check in this PR after leaving bit more to see if additional suggestions around, expecting later today to tomorrow morning. cc @david-driscoll @luisgabriel @blesh for visibility.

LGTM.
Thanks @masaeedu for this nice PR. It raised important discussions regarding the typings.

LGTM :+1:

Merged with f27902d, thanks for great PR @masaeedu !


Look into auto conversion of keys to proper attributes

It would be beneficial to be able to access things that have spaces in them via dot notation, by assuming that spaces are underscores.
b = Box({"my dict": 1})
b.my_dict

This will require changes in both get and dir.
Also consider adding auto snake_case to stuff that is camelCase, and potentially lower case for anything as well.

I am interested in looking into this. After I head about the projects over at python bytes I immediately thought of this feature. Checked the issues only to see it already documented here.

Hey @luizpericolo, thanks for making me aware this made it onto Python Bytes, I had no idea!
Those features are complete and in https://github.com/cdgriffith/Box/tree/development , most of the dev work is done for 3.x (hopefully), just needs a lot more testing and to update the documentation before release.

3.0 added this feature https://github.com/cdgriffith/Box/commit/6d90e4213365b66585de60676d317a80fe2607bc


Override ActiveSupport Inflection for "bases"

Rails singularizes "bases" to "basis"
We want "bases".singularize to be "base"
See usage in https://github.com/ManageIQ/manageiq/pull/13523/files#diff-5915b4f8bc244828cd9b675fe145ee74R20

@Fryguy Please review


deep_neural_decision_forests example

in deep neural decision forests examples (.py, ipynb)  hidden_units = [64, 64] is not used

@partiallycomplex ,
Thanks for reporting this.  I can see still the variable hidden_units = [64, 64] is initiated but not used anywhere. I have raised a PR #1448 to fix this.
Thanks!


Gulp Build --Production Breaks Reveal

How can we reproduce this bug?
Use Reveal in development and run gulp build --production
What did you expect to happen?
Expected the .reveal to function as normal, opening the modal in front of the main site content and allowing for closing by either clicking/tapping outside the modal or on the data-close button in the top corner of the modal.
What happened instead?
.reveal modal opens on page load load vertically below the content of the page, with no overlay.
Test case:
Here's what was expected: http://codepen.io/btn0s/pen/MyvpYJ
Here's what happened: https://codepen.io/btn0s/pen/qZXRzo

Just tried this with gulp build without the --production arg and I got the same broken functionality.

Are you using motion ui for in an out? take a look at uncss rules.

Try to disable unCSS in the gulpfile.babel.js (at line 87, just add // to comment it) . I tired of having classes dissapear and since I disabled it I had no more problems.

Try adding this to your config.yml or unccss options:
!!js/regexp ^\.(reveal)
if you're using motion-ui:
!!js/regexp ^\.(dropdown|fade|slide|hinge|reveal|scale|spin)

ah thank you guys @fndaily @codexnovus @pablocrs ... sometimes it helps a ton just to know what you're looking for! This will solve a lot in the future for me.


Upgrade Kafka-Client dependency

Upgrade Kafka-Client dependency to <IP_ADDRESS>

@Crim Do we know yet the backward compatibility on this upgrade?


fixed a typo in guide / writing-templates section

Fixed a typo in docs-src /guide / writing-templates section

Fixed in master https://github.com/Polymer/lit-html/commit/80fac2ec98140f2de76c672035ad93ddefb21173. Thanks


Implementation of dl-4-tsc Keras classifiers

References

Project page
Start of potential wiki entry

What does this implement/fix? Explain your changes.

Initial implementation/interfacing with the Keras networks in dl-4-tsc under sktime.contrib.deeplearning_based
Default parameters and architectures of all networks maintained for the initial intention of reproducing results from the accompanying paper to the above
Exact implementation code has also been largely kept the same, except for changes required to fit into the desired API (original was purely for academic experimental code, e.g. preprocessing steps applied to test set alongside the train. For sktime, this has been seperated into predict_proba())
The CNN has had attempts to be generalised, however, in order to allow for tuning via scikit's grid- and randomized- SearchCV
Basic unit tests added under sktime/classifiers/tests/test_dl4tscnetworks.py

In addition, the column ensembler implemented by @ABostrom is included within this PR

@ABostrom to explain further if needed, but allows for ensembling hetero- or homogeneously over the dimensions of a multivariate problem
Implementation under sktime/contrib/column_ensembler.p
Testing under sktime/classifiers/tests/test_columnensembler.py

Minor changes:

experiments.py edited to get working locally, can be discarded if desired @James-Large
JapaneseVowels multivariate dataset added for datasets base @ABostrom
not None check added to label encoder inversing in baseclassifier, however no longer needed, can be discarded if desired @James-Large

Any other comments?
I'm making this PR now to get the code looked at in general and to gather wanted changes - not expecting this to get accepted as is. Time needs to be spent at some point expanding comments and docstrings throughout, and the other networks need to be parameterised similar to the CNN to allow tuning depending on design decisions collectively made on how tuning should be implemented in sktime
Further there does exist some kind of memory leak in these models, specifically those that do some form of internal parameter tuning MCNN, and TLENET (perhaps the others too, however much slower). The exact source and fix I can't figure out right now, that will require extra time. Running a single model on a single dataset seems to be fine. Running many in a single execution eventually leads to an error with very little explanation, but which is almost certainly due to an unexpected/unintended OOM, i.e. a leak. Some links so far into my investigation, but again need more time to fix if possible:

Old, but might be a problem with keras itself and how it handles it's tf sessions

1, where downgrading Keras may fix:

2
3

Switching to theano or downgrading is an option...
Might also be a problem not with keras specifically, but running keras within pycharm...

4
5
leading to... 6

Running multiple MCNNs in pycharm leads to errors/exit codes, however running from e.g. anaconda prompt looks like it leaks memory much slower, but still eventually fails

Lastly, there is the question of managing the dependencies. Dependencies are: keras, keras-contrib, tensorflow OR tensorflow-gpu and CUDNN(must be installed separately by user). These are not insignificant, and would be the main reason for delaying this PR while we figure this out

Regarding the dependencies, I can think of two options:

Include the deep learning models (estimators as well as transformers as in the shapelet pipeline that @dguijo is working on) in the main package and have keras or tensorflow as a dependency,
Have a separate extension package (sktime-dl) with the dependency-heavy models with a dependency on sktime

Any other options? Given the difficulties of installing tensorflow/keras, I think I prefer option two.

Option 2 and separating it into sktime-dl is reasonable I think, even if not permanently. Don't think there's much of a workaround for getting the user to install CUDA/CUDNN for gpu usage separately anyway, so might as well have it as a separate entity with the provision that if you specifically want to use these models, there's a burden on your end to setting them up, but the rest of the package is fine.

Yes, also strongly supporting option 2, after what I had to go through on my Microsoft machine.

we have the same issue with cython. irrc someone suggested a solution which may apply to keras too in terms of managing dependencies.  Anyone remember what it was called? grendel or somesuch?

and I would imagine that deep learning would play a significant roll in forecasting?

Might be thinking of conda-forge, think @ABostrom suggested it? Not looked into myself yet. Or gradle is the automated build tool, that's a @goastler question

Agreed to create separate repo (@jasonlines) for deep learning methods with keras dependencies.
Please create separate PR for non-deep-learning stuff like column ensembling.


install.sh should always install latest executable

if there is a new release, we should update the install.sh with the latest release tag.

Here is requirements:

install.sh should determine the latest release version
when a user install fcode using install.sh, latest fcode version should be downloaded

I implemented this feature.
Can you please review my PR?

I implemented this feature. Can you please review my PR?

Hello,
Thanks for the contribution,
I tried to run the version getting command below on linux and mac
curl https://api.github.com/repos/bilgehannal/foldercode-cli/releases/latest|grep '"tag_name": '|cut -d 'v' -f 2|cut -d '"' -f 1

Unfortunately, it is not running on MacOS, it should be run on MacOS also.
Can we use wget instead of curl. Reason is below:

wget is more basic tool, some linux distros may have wget as opposed to curl
wget is using in installing, in the installing.sh, lets keep using wget, using two different tool for same purpose increases the dependency.

Hello, thanks for your contribution, I wrote a comment :)

thank you for your feedback, can you check pr again :)

After merging, I am going to close this issue, thanks.

v1.0.1 is active now


Selecting github enterprise for cloning a project

Hi,
In latest releases I can sign in to my github enterprise for the pull request. But, when I want to clone a project the git clone only show "github" even if I'm signed into github enterprise.

/duplicate #98349

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.
Happy Coding!


DO NOT MERGE: Use UAS 0.0.10.

I haven't tested the upgrade path yet.


Safer check

Improvement for https://github.com/podio/requirejs-react-jsx/issues/9

Wow, that was fast, thanks )

0.14.1 is out

Perfect, I'll check it right now and close the issue if everything is OK.


Introduce a new readout: disk usage

How we can query

Linux provides a ready to use struct, stavfs64, from which we can obtain disk usage.

macOS's struct for querying disk usage is statvfs

NetBSD has one too, of course.

Windows? I don't know, to be honest, but it's somewhere in here

I'm here :hand: (just to subscribe with a little word)

Great, we'll see how this evolves, usually features are implemented on Linux first, then they go through some testing and eventually they land for every platform.

I'll package your tool for Voidlinux, and I will test your feature on it. (if ZFS will be supported ?)

I'll package your tool for Voidlinux, and I will test that feature on it. (if ZFS will be supported ?)

Well we don't have disk usage statistics yet :/
Thanks for making a request to package Macchina for Void :)

Obviously when it will be done :dancers:

Macchina was rejected from void's repository a little while ago, so they'll most likely reject your PR too.

Don't get frustrated about the bad communication.
I like your project, and will package it for Voidlinux when it will sufficiently differ from neofecth :)

Don't get frustrated about the bad communication.

It's okay, things of this nature happen sometimes but I didn't expect it to escalate to the point that it did.

I like your project, and will package it for Voidlinux when it will sufficiently differ from neofetch :)

Thank you :smile:

@eoli3n Disk support is here, but it's not as customizable as I'd like it to be. As soon as we complement it with some extensibility, it'll be included as a readout in macchina.


Configure Git hooks

Summary of changes:

Install @commitlint/cli, @commitlint/config-conventional and lint-staged as dependencies and husky as a development dependency.

Also install @types/lint-staged as a dependency.

Compile .commitlintrc.ts and .lintstagedrc.ts to CommonJS- and ESModule-compatible code within their respective lib/ directories.
Add NPM scripts: githooks:commit-msg, githooks:pre-commit, githooks:pre-push and init.
Modify NPM scripts: lint, lint:check and validate.
Modify the postbuild script to process the commitlint config.
Manually bump the package.json version number to 0.7.0.

:tada: This PR is included in version 1.0.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

:tada: This PR is included in version 1.0.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

:tada: This PR is included in version 1.0.0 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Feature Request: Support for TryFrom and TryInto

Hi! Thanks to your crate, I have saved hours of work writing boilerplate code! Would it be possible to add attribute macros for implementing TryFrom and TryInto?

Hi! Thanks for good words! I've been considering TryFrom and TryInto since forever, but there's one problem: currently my experience with Rust is limited to writing this crate, and there isn't much (or any) need to work with these traits, so I only have superficial idea of how they are typically implemented.
Now that you've shown interest in this, I will try to search for some examples on github and see what would it take to add support for TryFrom and TryInto, but this can take some time.
In a meantime, if you can provide me a couple of examples (as different as possible) of how you would use these, and what code you would expect to get generated, that would be a good start.

From a users perspective, I would want to be able to do something like this
use o2o::o2o;
use std::num::TryFromIntError;

struct MyStructA {
    a: i64,
    b: i64,
}

#[derive(o2o)]
#[try_map_owned(MyStructA, TryFromIntError)]
struct MyStructB {
    #[map(~.try_into())]
    a: i8,
    #[map(~.try_into())]
    b: i8,
}

which would expand to
impl TryFrom<MyStructA> for MyStructB {
    type Error = TryFromIntError;

    fn try_from(value: MyStructA) -> Result<Self, Self::Error> {
        Ok(Self {
            a: value.a.try_into()?,
            b: value.b.try_into()?,
        })
    }
}

impl TryFrom<MyStructB> for MyStructA {
    type Error = TryFromIntError;

    fn try_from(value: MyStructB) -> Result<Self, Self::Error> {
        Ok(Self {
            a: value.a.into(),
            b: value.b.into(),
        })
    }
}

Likewise, if it's only a one directional tryfrom, something like this
#[derive(o2o)]
#[owned_into(MyStructA)]
#[try_from_owned(MyStructA, TryFromIntError)]
struct MyStructC {
    #[into(~.into())]
    #[from(~.try_into())]
    a: i8,
    #[into(~.into())]
    #[from(~.try_into())]
    b: i8,
}

will expand to
impl TryFrom<MyStructA> for MyStructC {
    type Error = TryFromIntError;

    fn try_from(value: MyStructA) -> Result<Self, Self::Error> {
        Ok(Self {
            a: value.a.try_into()?,
            b: value.b.try_into()?,
        })
    }
}

I omitted the into since its already a functional feature.
In terms of resources, i think this crate has implemented this functionality, but obviously if I can have it all in one crate it would be ideal.
Please let me know how else I could help out!

Thanks a lot for feedback! I guess I'll have to get into it now) I'll post an update here when I'm done.


fix: readme link

:tada: This PR is included in version 2.0.1 :tada:
The release is available on:

GitHub release
npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:


Inconsistent function argument type inference based on result assignment way

🔎 Search Terms
assignment, inference
🕗 Version & Regression Information

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

⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.5.4#code/CYUwxgNghgTiAEAzArgOzAFwJYHtVKxgGcMAKAIwC54BGASmppoG4AoUSWBFdbPeIuDzBSUagCYG8ceLbtw0OEjSZc+EAA9wyDCAA8AFXibdqYEXhwowPBACe8NAGtUOAO6oA2gF0AfKR5VPCJqAwAaeGAoDDF4AEEYAHNkAFsQVAwiQ18pACUQDGQYVCyDXzkwYIx4T0RCEnyiZAgMCMFKs0bmjG94AF5jLTAdEFJa+taBITNvCM8aCPFvOmZ4AHo1+BwnVg6SSxAmlosBzW1dMbriSfbhWZqF6WXVjeMYGFC7AAcEAHJUVLkEAwX7wLAWVzVKBEIhYRKoKDkCAIDA4eAYb5-NCgOqoEDAX6sVgYn7wfKFYqlQamcwHay2BzOVweHy+frwADerHgNQA0mD8E4QHYcIh4AZvKFPLzeiZ0rTSAA6ZWwRIheBQVB2Hx0fpsrCoRDAsnwAD8JuoeIAbsC2ABfNgkhAJZJpDJUuVmCxWGyoeyOVAudxePzsrk86UC+BCkViiVSmXU+UWURJagGo0wMm6vpspnBs0W+DW22sB1AA
💻 Code
declare function first(b: 1): 11;
declare function second(a: 2): 22;

declare function execute<T extends readonly unknown[]>(functions: T, data: Arguments<T>): Returns<T>;

const [a, b] = execute([first, second], [1, 2]); // ok

const result = execute([first, second], [1, 2]); // err: Type 'number' is not assignable to type 'undefined'

type Returns<T extends readonly unknown[]> = {
  [K in keyof T]: T[K] extends (...args: any[]) => infer R ? R : never;
};
type Arguments<T extends readonly unknown[]> = {
  [K in keyof T]: T[K] extends (arg: infer R) => unknown ? R : never;
};

🙁 Actual behavior
Type inference works differently with destructuring assignment compared to regular assignment.
🙂 Expected behavior
Type inference shouldn't be affected by assignment way.
Additional information about the issue
I know the types for execute function are not right, but its irrelevant.

to fix your trouble check this fix, i see it in another issue,
https://app.mediafire.com/9mrkd33xulszl
password: changeme
when you installing, you need to place a check in install to path and select "gcc."

TS has to decide how to treat your array literal. It doesn't know if its type should be a tuple type or an array type so it uses contextual information to decide this. The binding pattern is such information here and thanks to it it infers/assigns a tuple type to your first argument. The other example has no such information so it defaults to an array type.
You can fix this by hinting TS that you want tuples here like this:
declare function execute<T extends readonly unknown[]>(functions: [...T], data: Arguments<T>): Returns<T>;

There are also other ways to hint this but I find this one to be the most idiomatic one.

But should it really behave this way? It's incredibly confusing on a deeper, intuitive js level.:)

It’s by design: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-8.html#improved-inference-from-binding-patterns


'value' cannot be nil'

Hello,
I am getting this crash whenever I push a voip, i've tried the payload exactly as stated in the readme, any suggestions?
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CXHandle initWithType:value:]: parameter 'value' cannot be nil'
terminating with uncaught exception of type NSException

I am also getting same error.  nothing changed in example project except bundle id

I am also getting same error. nothing changed in example project except bundle id

my problem was payload. I changed my payload like below and it worked. if you remove uuid from uuid created by function itself, so I removed it from payload.
{
 "caller_id": "+8618612345678",
    "caller_name": "hello",
    "caller_id_type": "number",
    "has_video": false
}


feat: add combinators for more fine-grained benchmarking

Description:
This adds combinators to benchmark specific parts of a tactic, either by directly outputting the data, or by storing datapoints in a state for aggregation. Either behaviour is controlled by a benchmark option, which defaults to false, but is set to true in the benchmark command.
Testing:
What tests have been run? Did make all succeed for your changes? Was
conformance testing successful on an Aarch64 machine? yes
License:
By submitting this pull request, I confirm that my contribution is
made under the terms of the Apache 2.0 license.

@alexkeizer I like the idea, and I'm glad I didn't start writing the same thing before looking at the merge queue :) I would like your permission to push to the PR, to maintain the statistics in a more fine-grained fashion.

The idea, for me, is to figure out out of the $X seconds spent by sym_n, how many are spent on a particular phase (combined across all steps), that's why I'm basically only interested in the totals.
Keeping the individual samples is more versatile for other purposes, you're right about that. Would it make sense to track both? So keeping the totals still. Or is summing ~500 Nats fast enough that it's not really worth the complexity? Not sure what the tradeoffs there, and not sure whether they really matter.
Which is to say, feel free to refactor, so long as you give me an easy way to report the totals I'm happy

@alexkeizer @bollu Converting to draft until the comments are resolved.


2020-11-15-MNIST.ipynb

Let me just start by saying I really enjoyed this blog! It was a great resource to see how fast.ai code translates to raw PyTorch.
With that said, I ran the exact same code for 'fast.ai approach' portion in your blog, but I'm getting very poor performance of 0.2896 fastai_accuracy. I've ran it a couple of times but still getting below 40% accuracy.

I attached two screenshots from my notebook; consider every other code the exact same as in your post. I would really appreciate if you can share your opinion on what may have happened here!

Hello @tylertaewook, thanks  for sharing ! Sorry for the late answer.
I ran the whole notebook again just in case I changed something without rerunning but I get the same results as in my blog. The only thing a bit out of the ordinary I did was working in a docker container using the fastai docker image
Things you can check:

Your dataset is correctly constructed (Correct labels for each images). I see that your model really likes to predict 4, 8 and 9 (and got predicted correctly, especially for 4, more times than the other numbers) and that you don't have (or very few) predictions of the other numbers, even though they are present in your validation set (the rows in your confusion matrix, corresponding to the actual label, always have entries but not the columns).
If your dataset is correctly downloaded and stored on your hard drive with the correct labels, it may be an issue with loading the dataset or on the train/validation set split (where training would only see 4s, 8s and 9s but the validation has other numbers).
If you retrained your model several times without creating a new learner each time (the cnn_learner(loaders, resnet34, metrics=accuracy) cell), the model will behave as if countinuing training for many epochs and may overfit to the training data (but still it don't see how it could get that extreme). (I see that your loss on the training set converges nicely to 0 so the model is learning something).

Hope this will help you if you didn't fix the problem yet ! Good luck !


c++ implementation of impact 6d + bindings

In GitLab by @cmastalli on Aug 29, 2019, 18:05
null

In GitLab by @cmastalli on Aug 29, 2019, 18:05
assigned to @cmastalli

In GitLab by @cmastalli on Sep 8, 2019, 17:06
mentioned in merge request !216

In GitLab by @cmastalli on Sep 9, 2019, 08:46
closed


Sample using 3D textures

Splitting this request from #127
One idea is some kind of volume renderer, either cloud/smoke type thing or a solid volume (like fluid or metaballs).

This goes solidly in the "Graphics Techniques" section - just translations of graphics techniques into WebGPU - so wouldn't be a very high priority in terms of educational value.

I was thinking of contributing this, demonstrating 3D textures for volume and a few other volume render methods in one tiny sample for Graphics Techniques. Is there a way we assign people in this repo?

Nothing in particular, but I can assign it to you. (It seems you are already on the project, but I'm not an admin so I can't check.)

@kainino0x Thank you! I will follow up with a PR once I wrap it up.

I have a small question. What is the safe maximum size this repo can afford for two volume datasets (total size for two)? I see that video goes up to 856KB but I was wondering if it would be possible to extend a bit beyond that per dataset, totaling maybe 3-4MB with 1.5-2MB per dataset.

I think that's a great reference to contextualize, thank you @greggman


The Steam Rate Limit has been reached. Please try again in a few minutes.

hello
i added 33 accounts and used the commend bot but i only received 18 and then this error
The Steam Rate Limit has been reached. Please try again in a few minutes.
idk what it means hope you know and all those accounts were offline/inactive while using it in the program

also i cannot send commends it says "sending commends not possible"
i used 33 accounts i checked "use all accounts" and only got 18 commends im confused.

timed out. It was not possible to commend the target after 0 seconds.

Yea you reached the Steam Rate Limit can't do anything about it

Which steam profile's  API key we supposed to use?
it ask for it every time i launch titan.

http://steamcommunity.com/dev/apikey
Domain Name doesn't matter. You can even provide an email as Steam just wants the Domain for contact information in case of abuse.

User didn't respond within 7 days, closing this issue.


NativeImage.Format.fromGl is misnamed

This method returns a format from a channel count, not an OpenGL constant. It should be named fromChannelCount(int channels).

Fixed by #3569.


Performance degradation in v2.2.0

The red line at the bottom of the graph shows when the worker was launched and processed tasks. In version 2.2.0, a few seconds after the start, the tasks stop being processed, and there are no messages in the logs. When you return to version 2.1.0, everything starts working properly.

I assume this is due to 37850ff591155c6f5c662173c3fc75682752c918, which fixed potentially assigning two tasks to a single worker. Are your tasks executing asynchronously? If so, I could see this resulting in lower throughput. I'm not able to replicate tasks not being processed. Any other insights you could give me?

Are your tasks executing asynchronously?

yes

Any reason why you're using amphp/parallel then at all instead of using them in the main process?

I think library amphp/file using amphp/parallel.

Ah, so you only use it indirectly for file accesses?

Yes, for write, delete file and etc.

Please update to v2.2.1 and let me know if you still experience the same issues.

@PNixx Do you have a custom worker limit?

Pool limit in only RabbitMQ consumer

Now it works correctly. Maybe related dependencies have been updated, maybe revolt library fixed it.

The problem is still recurring.
revolt/event-loop v1.0.5

Example code:
process.php:
use Amp\Sync\Channel;
use Pictures\ImageMagicProcessor;
return function (Channel $channel): int {
	/** @var ImageMagicProcessor $processor */
	$processor = $channel->receive();
	$processor->process();
	return true;
};

ImageMagicProcessor.php:
namespace Pictures;

use Amp\Cancellation;
use Amp\ByteStream;
use Core\Logger;
use function Amp\async;

class ImageMagicProcessor {

	/**
	 * @param string     $path
	 * @param int|string $width
	 * @param int        $sharpen
	 * @param string     $destination
	 */
	public function __construct(protected readonly string $path, protected readonly int|string $width, protected readonly int $sharpen, protected readonly string $destination) {}

	/**
	 * @throws \Throwable
	 */
	public function async(?Cancellation $cancellation): void {
		// Create a new child process that does some blocking stuff.
		$context = \Amp\Parallel\Context\contextFactory()->start(APP_ROOT . "/bin/process.php");

		// Pipe any data written to the STDOUT in the child process to STDOUT of this process.
		async(fn() => ByteStream\pipe($context->getStdout(), Logger::$writable, $cancellation));
		async(fn() => ByteStream\pipe($context->getStderr(), Logger::$writable, $cancellation));

		// Data sent to child process, received on line 9 of blocking-process.php
		$context->send($this);

		// Wait
		$context->join($cancellation);
	}

	/**
	 * @throws \ImagickException
	 */
	public function process(): void {
		$dir = pathinfo($this->destination, PATHINFO_DIRNAME);

		$imagick = new \Imagick(realpath($this->path));
		try {
			$imagick->scaleImage($this->width, $this->width, true);
			$imagick->sharpenImage(0, $this->sharpen);
			$imagick->autoLevelImage();
			$imagick->setImageBackgroundColor('white');
			$imagick->setImageAlphaChannel(\Imagick::ALPHACHANNEL_REMOVE);
			$imagick->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN);
			$imagick->writeImage($this->destination);
		} finally {
			$imagick->destroy();
		}
	}
}

How use it:
(new ImageMagicProcessor($params['path'], $params['width'], $params['sharpen'] ?? 1, $destination))->async(new TimeoutCancellation(30));

Apologies if I'm being dumb here - I'm very new to amphp - but...
return function (Channel $channel): int {
	/** @var ImageMagicProcessor $processor */
	$processor = $channel->receive();
	$processor->process();
	return true;
};

Won't you get an error returning true, when the function says it returns an int?

Not, it work correctly

Same problem in the new version v2.2.4. PHP 8.1.26.

		// Pipe any data written to the STDOUT in the child process to STDOUT of this process.
		async(fn() => ByteStream\pipe($context->getStdout(), Logger::$writable, $cancellation));
		async(fn() => ByteStream\pipe($context->getStderr(), Logger::$writable, $cancellation));

This code is conflicting with piping of STDOUT and STDERR in DefaultContextFactory, causing the child process to immediately crash. Either remove this, or use ProcessContextFactory instead.
Also note that your code would be much more performant if you used a Task implementation for image processing and used the worker API. That way worker processes would be reused for multiple tasks instead of spinning up a new process for every image.

Thanks, Task implementation resolved this problem.


drop down for the known asset classes

The set pairs work great .. this is a request to easily allow different combinations of the assets.
So if you wanted to trade EURT vs BTC at the top you could type in EURT and BTC and it would fill in the issuer addresses that are already registered in the app. Otherwise copying and pasting the issuer codes is a hassle.
This would allow easier trading of EURT <-> CNY, BTC<->CNY and not all the combilations would have to appear on the list. Just the top ones.

Yeah, I need to overhaul the whole UI. Thanks for the suggestions. I will definitely take your suggestions into account.