after_destroy callback not called when record created by FactoryGirl

I have the following code in my factories.rb file:
Factory.define :group do |group|
  group.name            { |n| "Group \##{n}}" }
end

Factory.define :brand, :parent => :group do |brand|
  brand.type              'Brand'
end

If I use the following code in my RSpec test:
brand = Factory(:brand, :name => "Test")
brand.destroy

then the after_destroy callback I defined in the "brand" model is not called.  If, instead, I use:
brand = Brand.create!(:name => "Test")
brand.destroy

then the after_destroy callback is called.  I've verified that the record is created and deleted (brand.persisted?, Brand.count, etc. before and after the destroy), and I am verifying  whether the after_destroy method is called by checking the side effect of the after_destroy and by setting a breakpoint in the after_destroy method.
Does anyone have an idea why this behavior exists?

Here's how it interacts with ActiveRecord: https://github.com/thoughtbot/factory_girl/wiki/How-factory_girl-interacts-with-ActiveRecord
Based on the example you pasted above, it would actually be similar to calling:
brand = Group.new
brand.type = 'Brand'
brand.name = 'Group #1'
brand.save!

You'll want to override the class for the brand factory to make it use the brand class. Overriding the type in ActiveRecord doesn't change the Ruby class, so it will be running Group callbacks instead of Brand.

You can use inheritance like in your original example; you just need to override the build class:
Factory.define :group do |group|
  group.name            { |n| "Group \##{n}}" }
end

Factory.define :brand, :parent => :group, :class => "Brand" do |brand|
end

Or, using the new syntax:
FactoryGirl.define do
  sequence :name do |n|
    "Name \##{n}"
  end

  factory :group do
    name

    factory :brand, :class => "Brand" do
      # ...
    end
  end
end

You could also mix in a group trait for each type of group:
FactoryGirl.define do
  sequence :name do |n|
    "Name \##{n}"
  end

  trait :group do
    name
  end

  factory :brand do
    group
  end
end

I had no idea that the "new" syntax existed, could you perhaps supply a link to a page describing the new syntax?  I have had trouble finding good documentation on the syntax for Factory Girl (not to mention RSpec)!  Thanks for your help on this -- I appreciate the extra information.

The getting started guide is largely written using the new syntax, so it has some decent examples: http://rubydoc.info/gems/factory_girl/2.3.2/file/GETTING_STARTED.md
Here's a blog post that summarizes the changes: http://robots.thoughtbot.com/post/7176629856/factory-girls-new-look


Support for Redis Cache?

I was wondering if there is a use for supporting Reis as a Cache?
I've seen some samples from the node-version of Microsoft Authentication Library MSAL.
It appears to me, that it might be straight forward, implementing a similar adapter based on the class BasePersistence of the python extensions for MSAL from this library. Something like that:
import redis
import json
from msal import ConfidentialClientApplication
from msal_extensions.token_cache import PersistedTokenCache
from msal_extensions.persistence import BasePersistence
from datetime import datetime, timedelta

# Redis connection:
redis_client = redis.Redis(
    host=<redis-host>,
    port=<redis-port>,
    password=<redis-password>
)

class RedisPersistence(BasePersistence):
    """Redis persistence class for the token cache"""

    def __init__(self, user_account):
        self.user_account = user_account

    def save(self, content):
        """Saves the token to the cache"""
        result = redis_client.json().set(self.get_location(), ".", content)
        return json.dumps(result)

    def load(self):
        """Loads the token from the cache"""
        result = redis_client.json().get(self.get_location())
        return json.dumps(result)

    def get_location(self):
        """Returns the location in the cache"""
        location = f"msal:{self.user_account['homeAccountId']}"
        return location

    def time_last_modified(self):
        """Returns the time the cache was last accessed"""
        try:
            idle_time = redis_client.object("idletime", self.get_location())
            if idle_time:
                last_accessed_time = datetime.now() - timedelta(seconds=idle_time)
                return last_accessed_time.timestamp()
        except Exception:
            raise Exception("no modification time available")

# Instantiate the cache:
def get_persistent_cache(user_account):
    """Returns the persistent cache for the user account"""
    persistence = RedisPersistence(user_account)
    persistedTokenCache = PersistedTokenCache(persistence)
    return persistedTokenCache

# use microsoft Authentication Library with Redis for a specific user_account,
# coming from the authentication stage:
    cache = get_persistent_cache(user_account)
    msal_client = ConfidentialClientApplication(
        client_id=<client-id>,
        client_credential=<client-secret>,
        authority=<authority>,
        token_cache=cache,
    )

    accounts = msal_client.get_accounts(user_account["username"])
    for account in accounts:
        result = msal_conf_client.acquire_token_silent([<scopes>], account=account)
        if "access_token" in result:
            return result["access_token"]

Hi @arnoldknott , thanks for sharing your code snippet, so that the world can benefit from it!
To answer your questions:

I was wondering if there is a use for supporting Reis as a Cache? I've seen some samples from the node-version of Microsoft Authentication Library MSAL.
It appears to me, that it might be straight forward, implementing a similar adapter based on the class * BasePersistence** of the python extensions for MSAL from this library. Something like that:

I suppose there might always be a need for something different than the default implementation. And yes, by accepting an app developer provided token_cache instance, MSAL Python always allow different cache backends as long as the same TokenCache API remains available.
One more thing. Depends on your use case, if you are building a website, nowadays we have web app samples (such as this web app sample for Flask) that stores the token cache in the user's session, so that you don't need to explicitly alter MSAL's token cache (but then you may want to customize the session backend of that web app).

Before I answer your latest questions, @arnoldknott , it would be helpful to first understand the "layer" that MSAL library operates in. MSAL can be said as a "general purpose" auth library so it does not necessarily optimize for any specific scenario. MSAL's default token cache stays in memory, partially because that is the most common factor in any scenario. That default setup happens to work well for Desktop apps, but not so much for some backend apps that would maintain tokens for many users. So, accepting a TokenCache-like object is MSAL Python's answer to token cache polymorphism.
I believe the Azure Identity library also works in this layer, but with better integration with Azure SDK library to access all kinds of Azure services.
The web apps, on the other hand, are in a higher layer. More specific design choices can be made in that layer, but not in MSAL's layer. The sample that I referenced to, is powered by yet another library - which was built on top of MSAL - and happens to be also named "identity" (sorry, we are running out of names in this domain :-) ). In that web-focused "identity" library, you won't have to worry about partitioning token cache into Redis, because the user-owned tokens are stored in the session of the web framework.

@rayluo : I fully understand. Implementing Redis itself seems also out-of-scope for MSAL to me. I believe it would be worth an example sample to me. 😉
And yeah - the naming and multiple use of identity and principles can get confusing. The more we develop the more of those we get. 😬

Implementing Redis itself seems also out-of-scope for MSAL to me. I believe it would be worth an example sample to me. 😉

Thanks for your suggestion. I'll give it some thoughts. Meanwhile, your code snippet above serves as a good hint for others. Thanks again for your contribution!


Rust docs can not switch version

https://opendal.apache.org/docs/rust/opendal/ can only show the latest version of docs.
crate docs in https://docs.rs/, for example https://docs.rs/tokio/1.26.0/tokio/, have a menubar to switch among versions
/kind docs

https://opendal.apache.org/docs/rust/opendal/ can only show the latest version of docs.

o.a.o always points to the main branch doc. For versioned documentation of OpenDAL, see https://docs.rs/opendal


Language Server: Is there any status of its progress?

Windows 10
Jan 2019 update.
I have a new PC
Installed latest vscode + Python 3.7.2 (python.org) + Python extension.
Disabled Jedi.
I have a workspace (large) on a slow network disk.
WHen i open my workspace and then open a .py file , i see on the status bar some message that "initalizing python/language server" its present for a few seconds at max so i dont have the exact message.
In the Output window for Python i can see this
Starting Microsoft Python language server.
Microsoft Python Language Server version <IP_ADDRESS>
Initializing for C:\Users\derekw\AppData\Local\Programs\Python\Python37-32\python.exe
My issue is that there are no symbols  for my current file in Outline.
"Loading document symbols ...."
They will probably appear in 30 mins after the langague server has analyzed all my files.
(and yes i have ignored lots of files in my workspace to try and minimize)
During this time intellisense is not working
Snippets dont work...
It largely makes all this great capability useless when you open the editor ...
Yes if i leave it open eventually i get some features ...
Is there anywhere that VSCOde will show some status of what the language server is doing?
Its frustrating not knowing what it is doing. I dont know if its working, its crashed, its X % complete .....
In process explorer i can see the langauge server running.

Why would snippets be "blocked" if the langauge server is busy?
Why would  python language intellisense i.e. typing python syntax , be blocked if the language server is busy?
I can understnad that functionality wrt symbols in the file might not be available.

Performance of LS issue

Issue moved to Microsoft/python-language-server #588 via ZenHub


Add Google Search Appliance to list of crawlers

Ensure Google Search Appliance gets the crawler treatment for if-modified-since behaviour. Otherwise it will re-request the same file over and over again.
See https://groups.google.com/d/topic/dspace-tech/ox9MML6uiVE/discussion

+1 by review

+1 by review, and thank you!

Looks good, thanks!


Remove pypy* from allowed failures

The pypy jobs have not failed in a long time. Keeping them in
allowed_failures means that if they start failing, no one will notice
them.
We also start using "sudo: false" since we are not installing anything
with apt and this will speed up build times.

Great, thanks!


nushellPlugins.hcl: init at 0.100.0

Added package for nu_plugin_hcl.
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[ ] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

Why am I being put as the maintainer?

Why am I being put as the maintainer?

Too much copy&paste

@Kamillaova adding you as a reviewer

@Yethal github has a built-in way to request a review


Add documentation for MD_DIALOG_DATA

Nothing in the overview references this.

Until the documentation can be added, I think it would be helpful to have an example on the usage of MD_DIALOG_DATA.  Here is one I put together:
import { Component, Inject } from '@angular/core';
import { MdDialogRef, MD_DIALOG_DATA } from '@angular/material';

@Component({
  selector: 'dialog-example',
  template: `
    <h1 md-dialog-title>Dialog Title</h1>
    <div md-dialog-content>
      Lorem ipsum dolor sit amet, consectetur adipscing elit, sed do eiusmod tempor incididunt ut labore et dolore
      magna wiri aliqua. Ut enim ad minim ikad veniam, quis nostrud exceritatn ullamco laboris nisi ut aliquip.
    </div>
    <div md-dialog-actions>
      <button md-button class="dialog-button" (click)="dialogRef.close('Option 1')">OPTION 1</button>
      <button md-button class="dialog-button" (click)="dialogRef.close('Option 2')">OPTION 2</button>
    </div>`,
})
export class DialogExampleComponent {

  constructor(private dialogRef: MdDialogRef<DialogExampleComponent>,
              @Inject(MD_DIALOG_DATA) private data: any) {
    console.log(data);
  }
}

If you have any suggestions for improvement, please let me know.

What would also be great is an example to test is)
Currently having:
 No provider for Token MdDialogData!
when trying to run a test spec through angular cli + karma on similarly executed component with @Inject(MD_DIALOG_DATA)

figured:
...
providers: [
        { provide: MD_DIALOG_DATA, useValue: "someAnyTypeObjectHereThatYouWillGetTheDataFrom"}
]

I'll close this one as a dupe of #1947. There's a merge-ready PR that will address it at #3907.

Has anyone found an alternative for unit testing to @ronanamsterdam's mocked provider?  Seems like it makes it very difficult to write unit tests that alter behavior based on data passed in to the MD_DIALOG_DATA service.

@ronanamsterdam You can mark dependencies as optional using @Optional() from the Angular core library. It just means that your constructor and component would need to handle the possibility of not having the dialog data (for example, in a unit test).
class MyComponent {
    private _injectedValue: any = null;

    constructor( @Optional() @Inject(MD_DIALOG_DATA) private _dialogData: any ) {
        if(this._dialogData && this._dialogData.someValue) {
            this._injectedValue = this._dialogData.someValue;
        }
    }
}

Handling the dialog data like this means that in your unit tests you do not need to provide the MD_DIALOG_DATA for it to be able to run correctly. @sdushay This does mean that if you want to provide different values to your dialog component for testing purposes, you would could do something similar to the following:
describe('Component: MyComponent', () => {
    let component:MyComponent;
    let fixture:ComponentFixture<MyComponent>;
    let debugEl:DebugElement;
    let elem:HTMLElement;

    beforeEach(async(() => {
        TestBed.configureTestingModule({
            declarations: [
                MyComponent
            ],
            imports: [ ],
            providers: [ ],
        }).compileComponents();
    }));

    beforeEach(() => {
        fixture = TestBed.createComponent(MyComponent);
        component = fixture.componentInstance;
        fixture.detectChanges();
    });

    afterEach(() => {
        fixture.destroy();
        component = null;
        debugEl = null;
        elem = null;
    });

    it(`is works when someValue is true`, () => {
        fixture.destroy()
        TestBed.resetTestingModule();
        TestBed.configureTestingModule({
            declarations: [
                MyComponent,
            ],
            imports: [ ],
            providers: [
                {
                    provide: MD_DIALOG_DATA,
                    useValue: {
                        someValue: true
                    }
                }
            ],
        }).compileComponents();
        fixture = TestBed.createComponent(MyComponent);
        component = fixture.componentInstance;
        expect(component).toBeTruthy();
        expect(fixture).toBeTruthy();
    });
 });

The basic idea behind this is to tear down the instance of the component that was created in the beforeEach part of the tests and then rebuild a new component, injecting in the value for the optional dialog data that you want for the specific test. You could even use this same concept without the use of @Optional() where the base case is established in the default TestBed construction and the tests that need to modify the initial data passed in can implement something similar to this.


Left sidebar not accessible in Android

The top left hamburger menu is completely missing in Android.
The only way I could open the left sidebar was indirectly, via the command palette.
Device: Nokia 5.3 (Android One) running Android 11.

This is intentional to give more space to the title bar. You can swipe from the left side to access the sidebar.

On Sep 20, 2021, at 00:08, Chriswaterguy @.***> wrote:

The to left hamburger menu is completely missing in Android.
The only way I could open the left sidebar was indirectly, via the command palette.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Yes, thanks – I just worked this out then saw your reply. Makes good sense.
If there's a way of giving this suggestion when someone first tries it in Android, it might be helpful.

This is intentional to give more space to the title bar. You can swipe from the left side to access the sidebar.
…
On Sep 20, 2021, at 00:08, Chriswaterguy @.***> wrote:  The to left hamburger menu is completely missing in Android. The only way I could open the left sidebar was indirectly, via the command palette. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Is it possible to add an option for this? Swiping from the side of a screen might be troublesome with some bulkier phone cases.

This is intentional to give more space to the title bar. You can swipe from the left side to access the sidebar.

Is it possible to add an option for this? Swiping from the side of a screen might be troublesome with some bulkier phone cases.

You can swipe anywhere on screen as long as you drag from left to right. The current set up is much more accessible for right handed users than reaching in the top left corner.

You can swipe anywhere on screen as long as you drag from left to right. Unless I'm missing something, it seems like the current set up is much more accessible for right handed users than reaching in the top left corner?

 I didn't even notice this. 😀


How to transfer a pre-encrypted key through submitting the transcation?

@jgiszczak @taokayan
How to transfer a pre-encrypted key through submitting the transcation?Does it have limitation of memory?

2018-10-22T13:00:19.495 thread-0   http_plugin.cpp:581           handle_exception     ] Exception Details: 3050003 eosio_assert_message_exception: eosio_assert_message assertion failure
assertion failure with message: memo has more than 256 bytes
{"s":"memo has more than 256 bytes"}
thread-0  wasm_interface.cpp:930 eosio_assert
pending console output:
{"console":""}
thread-0  apply_context.cpp:61 exec_one

As you have already discovered, the memo field of the transfer transaction is limited to 256 bytes.  You must carefully select both your cipher and your encoding algorithm.
The best encoding algorithm that's likely to survive in all circumstances is the ZeroMQ implementation of ASCII85, known as Z85.  It is 80% efficient.  This means your effective encrypted key size can be no more than 204 binary bytes.
Obviously RSA keys of useful length are not an option.  The raw key material only just fits, but an encrypted encoded version does not.  If you want keys which are compatible with the chain, you will be transmitting ECC keys of 32 bytes.
RSA encryption is also not suitable, since recommended keys sizes have been 2048 bits or higher for some time, and the off the shelf RSA implementations always output a minimum size of the key size to maintain their security.
If you wish you use a symmetric cipher, you can encrypt with AES-GCM and the result is 32+16 bytes, which fits easily in the 204 byte limit.
If you wish to use the Elliptic Curve Integrated Encryption Scheme (ECIES), the result will be 32+32+20 bytes (assuming HMAC-SHA-1-160), which also fits in the 204 byte limit.

If you wish to avoid the limitations of the memo field, create a contract which accepts an action with data of whatever length you are willing to stake network bandwidth for and use that to place data on the chain.


Fails to report error during publib-maven

See: https://github.com/cdklabs/awscdk-asset-node-proxy-agent/actions/runs/4624066296/jobs/8230436553
Looks like publib-maven is failing with:
Error:
Error:  Nexus Staging Rules Failure Report
Error:  ==================================
Error:
Error:  Repository "softwareamazon-5342" failures
Error:    Rule "RepositoryWritePolicy" failures
Error:      * Artifact updating: Repository ='releases:Releases' does not allow updating artifact='/software/amazon/awscdk/cdk-asset-node-proxy-agent-v5/2.0.120/cdk-asset-node-proxy-agent-v5-2.0.120.jar'
Error:      * Artifact updating: Repository ='releases:Releases' does not allow updating artifact='/software/amazon/awscdk/cdk-asset-node-proxy-agent-v5/2.0.120/cdk-asset-node-proxy-agent-v5-2.0.120-sources.jar'
Error:      * Artifact updating: Repository ='releases:Releases' does not allow updating artifact='/software/amazon/awscdk/cdk-asset-node-proxy-agent-v5/2.0.120/cdk-asset-node-proxy-agent-v5-2.0.120-javadoc.jar'
Error:      * Artifact updating: Repository ='releases:Releases' does not allow updating artifact='/software/amazon/awscdk/cdk-asset-node-proxy-agent-v5/2.0.120/cdk-asset-node-proxy-agent-v5-2.0.120.pom'
Error:
Error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.651 s
[INFO] Finished at: 2023-04-19T01:04:06Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.5:release (default-cli) on project dummy: Could not perform action: there are failing staging rules!: Staging rules failure! -> [Help 1]
Error:
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

But the github action eventually reports success.
The reason is here: https://github.com/cdklabs/publib/blob/3a4a1141c4cf2f55f961765fb2a9c60a5660ebce/bin/publib-maven#L262-L268
We may be overindexing on the magic string "does not allow updating artifacts" because it is not true in this case that we are trying to publish the same artifact.

Confirm that this error was a result of old maven credentials and not that the artifact was already published


The user password for the demo no longer works

This is  a bug.
Description
Sure someone changed the user password and that is why it is not possible to enter with the credentials of the demo.
<EMAIL_ADDRESS>& password

I was wondering when this will happen :). Fixed

Yes, I also found it strange that they did not do it :)
I already managed to login with the demo credentials but it seems that updates are being applied and they present some bugs.

By the way, was the inspiring message removed after login true?.Thank you again for being attentive to all the issues that I report

It was a problem with the admin's avatar


How to suppress logging

how do i suppress logging

Hey @brucewlee , thanks for reaching out. Apologies for the delay.
We have a function which you can use to change the configuration of the logger: https://github.com/protectai/llm-guard/blob/main/llm_guard/util.py#L31
Here is example of how it's being used in the API: https://github.com/protectai/llm-guard/blob/main/llm_guard_api/app/util.py#L71
You can either send the output to some noop stream or change the log to only do it for errors


Fix double scroll bars in advanced filtering modal

We updated the px-modal to handle overflowing content in the "body" slot by scrolling the entire modal. This is different from the spec where the header/footer of the modal are fixed and only the body scrolls. The GE designers have accepted and said this approach is OK for now.
This PR fixes a collision of the two approaches. Before to make the modal work correctly the px-data-grid-filter component created its own scrolling region if its contents were too tall. This leads to a double scroll bar:

I took the overflow scroll behavior out of px-data-grid-filter, so the modal can decide how its contents should scroll. This is the result:

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

Not sure if I have rights to sign this CLA, as this is GE code with a GE license any way to waive?


Issue with Adjoint Waveform Calculation in the Latest Devel Branch.

Hello,
I have been using the latest devel branch of seisflows to set up an example. The real and initial models are smaller, closer to exploration-sized models. I generated these models using specfem, incorporating a tomo layer as done in the specfem marmousi example (OUTPUT_FILES_INIT and OUTPUT_FILES_TRUE).
The issue I'm encountering is that the observed data (obs data) and synthetic data (syn data) appear identical, resulting in zero adjoint data (adj data), which prevents the correct calculation of the adjoint waveform. However, the output for both the initial model and the observed model seems to be correct.
I have documented my process in a Jupyter notebook named test.ipynb available at my GitHub repository: https://github.com/trinitite271/seisflows2. This notebook includes steps for reading the Matlab models, writing models, setting up models, running the program, etc. Could you please review the results in this notebook and identify any possible errors in my steps?
Thank you for your assistance.

Aha! And here is the magic line:
https://github.com/SPECFEM/specfem2d/blob/devel/src/specfem2D/setup_mesh.F90#L582-L585
if (tomo_material > 0) MODEL = 'tomo'

Corresponding to this line in the Par_file:
https://github.com/trinitite271/seisflows2/blob/master/specfem2d_workdir/DATA/Par_file#L289
1 -1   0.d0    0.d0    1.d0    0 0    0    0 0 0 0 0 0 0     # solid from tomo file

Which is forcing SPECFEM to read your tomo file rather than use the required GLL model. I am pretty confident this is what is causing these issues. A quick fix would be to change that leading '1' to '-1' and I think things should work. For a longer term fix we'll have to fix that in SPECFEM2D, or atleast throw a warning that the Par_file parameter is being ignored.
Thanks for sticking with me there, hopefully this fixes your current issue. @scott314159 I think this is probably also the issue you are facing as well but let me know if you see a similar trend.

I tried implementing your approach, and it seems to have resolved the issue. I reviewed the log file and understood your idea. The problem was that specfem failed to use the GLL mode when using the tomo files. The format in specfem for nbmodels is as follows: model_number material rho Vp 0 0 0 QKappa 9999 0 0 0 0 0 0. I suspect the actual bug occurs when material = -1, which forces the use of tomo, ignoring the model.
Based on my understanding of seisflows, during the inversion process, seisflows calls binary model files (gll) from OUTPUT_TRUE and OUTPUT_INIT. When material = -1, tomo is forcibly used; when material = 1, the nbmodel is ignored and seisflows use the gll model.

A quick fix would be to change that leading '1' to '-1' and I think things should work.
Therefore, the practical modification is to change -1 to 1 in seisflows before submitting, to avoid using tomo.

Besides, there is one small problem.
The small one is, base on the solution above, I try to change the nbmodel before 'seisflows submit',but:

seisflows sempar velocity_model '1 1 1960.d0 1600.d0 800.0d0 0 0 9999 9999 0 0 0 0 0 0'
Traceback (most recent call last):
File "/home/zhangchang/miniconda3/envs/seisflow_devel/bin/seisflows", line 8, in
sys.exit(main())
^^^^^^
File "/csim1/zhangchang/seisflow_devel/seisflows/seisflows.py", line 1456, in main
sf()
File "/csim1/zhangchang/seisflow_devel/seisflows/seisflows.py", line 456, in call
getattr(self, self._args.command)(**vars(self._args))
File "/csim1/zhangchang/seisflow_devel/seisflows/seisflows.py", line 972, in sempar
setpar_vel_model(file=par_file, model=value.split("+"))
File "/csim1/zhangchang/seisflow_devel/seisflows/tools/specfem.py", line 620, in setpar_vel_model
model_idx_start = model_lines[0]
~~~~~~~~~~~^^^
IndexError: list index out of range


Add samples for Working with Tables

This is a great collection of examples. Notably missing though is table creation and table data manipulation.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 052ba85d-cc93-5de7-4aa6-1d1df4b9eda7
Version Independent ID: 2a6edae1-13c7-ef95-bf43-6de8a0cb5197
Content: Azure PowerShell script examples for SQL Database
Content Source: articles/sql-database/sql-database-powershell-samples.md
Service: sql-database
GitHub Login: @CarlRabeler
Microsoft Alias: carlrab

@lesterw1 there are plenty of examples on the web for issuing T-SQL commands using PowerShell - see, for example, https://blogs.msdn.microsoft.com/rkramesh/2012/02/01/creating-table-using-powershell/

@lesterw1 We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.


Update to Go 1.17

Changes

Closes #34
Submitter Checklist

[ ] Includes tests if functionality changed/was added
[ ] Includes docs if changes are user-facing
[x] Set a kind label on this PR
[x] Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.
Release Notes
NONE

/assign @adambkaplan

/kind cleanup

@vancanhuit if possible, can you please rebase this pull request on top of the main branch? It looks like you did a merge instead, which will result in a commit history that may be harder to interpret.

/hold
Waiting for v0.7.0 to be released before we update the golang version.

@vancanhuit if possible, can you please rebase this pull request on top of the main branch? It looks like you did a merge instead, which will result in a commit history that may be harder to interpret.

Yes I will try.

/hold cancel

@vancanhuit two items are causing the tests to fail:

There is a format change with go 1.17 that the deep copier isn't generating automatically. If you run make fmt and commit the change, I think this will fix the issue.
The VERSION variable in the Makefile conflicts with the operator version we published on OperatorHub. I submitted
https://github.com/shipwright-io/operator/pull/52 to fix this issue. Once it merges you will need to rebase this PR to pull in the new default version.

@vancanhuit thanks for the contributions! Would you please squash those two commits. Other than that, I think we are as good as done.

@otaviof I've squashed those 2 commits.

@vancanhuit apologies, I think this PR needs to be rebased on top of the main branch. The e2e test currently breaks because we are trying to add a CSV version that is the same as what exsits on operatorhub. #52 fixes this.

/lgtm
Running into known opm index issue.


minify js files cause lag and results in crash of atom

Operating System: OS X 10.10.02
Atom Version: 1.0.0
Steps to reproduce: Open a minified js file of your choice (If your cool choose a large one)
Atom Responds after a while:  Editor is not responding Dialog

This is a duplicate of github.com/atom/atom/issues/979 - please subscribe there for updates.


Prevent a checkInProgressQueriesAtShutdownServer panic

This prevents a panic I observed while working on fixing the graceful shutdown hang.

Codecov Report

Merging #778 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master    #778      +/-   ##
=========================================
- Coverage   57.04%     57%   -0.04%
=========================================
  Files          42      42
  Lines       10793   10793
=========================================
- Hits         6157    6153       -4
- Misses       3544    3547       +3
- Partials     1092    1093       +1

Impacted Files
Coverage Δ

msg.go
77.7% <0%> (-0.65%)
:arrow_down:

Continue to review full report at Codecov.

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


npm v2.4

Hey Andy,
This is probably just an issue with me; I'm not an expert with node.  I keep running into an issue when I try to build the _min and _src libraries in to \dist.  (ex.  npm install).  I was getting this error with v2.5 and then I upgrade to 2.7.5 and still running into the same problem.  Sorry for posting the question here...I searched stackoverflow and the web but had no luck.
Any ideas.
8 error argv "node" "/usr/local/bin/npm" "install"
9 error node v0.12.2
10 error npm  v2.7.5
11 error Invalid version: “2.4”
Jay

@jaymcneil just a hunch. In the root/package.json file try renaming the version property from "2.4" to "2.4.0".

@jaymcneil any luck?

@andygup yes that worked...sorry for the delay...got swamped.


add  query timeout to bigquery connection

@suryagaddipati can you please sign the contributor license agreement?  Thanks!

/gcbrun

Your error, BTW.  We use  the ESLint plugin.
Step #1 - "run-script": /workspace/packages/malloy-db-bigquery/src/bigquery_connection.ts
Step #1 - "run-script":   707:20  error  Delete ⏎·······  prettier/prettier

/gcbrun

Going to re-submit under a different email


Data UI adapts to user rights

Fixes #98

Current coverage is 86.65% (diff: 66.66%)

Merging #102 into develop will decrease coverage by 0.10%

@@            develop       #102   diff @@
==========================================
  Files           110        110
  Lines          1805       1806     +1
  Methods          56         56
  Messages          0          0
  Branches        138        138
==========================================
- Hits           1566       1565     -1
- Misses          190        191     +1
- Partials         49         50     +1

Powered by Codecov. Last update 573341b...03d7cb6

+1


Reverse how description and type information appear in node properties

Fixes the issue seen in the below screenshot where component description and type are in the opposite position as expected.

What changes were proposed in this pull request?
Creates a description of the format [parsed description] (type: [parsed type]), as shown in below screenshot.

Also adds a clause to the description parsing regex for Airflow that accounts for the case where a parameter is given a description (:param [param_name]: ...) but not a type (:type [param_name]: ...) in the operator class docstring.
How was this pull request tested?
Tests are added that check that the descriptions and types given in the component specification appear as expected.
Developer's Certificate of Origin 1.1
   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

Would we benefit from using named type/value like in (type=type, description=param.get('description')) which would have avoided the issue in the first place even if in the wrong order?

Would we benefit from using named type/value like in (type=type, description=param.get('description')) which would have avoided the issue in the first place even if in the wrong order?

Yes, but since one argument (description) was optional, the order (to the best of my understanding) was dictated at the method's definition since optional arguments must follow required arguments.  The last commit eliminates that being the case and introduces the keywords at the call - which I agree is better.  If we wanted to make description optional again, we'd need to change the order on the method definition but continue using the keywords.
Seems like we should be getting description exactly how we are getting type (in both cases), then scrap the keywords to eliminate the redundancy - but that's well into the nit-realm.


feat: n-way ratings and comparison of transcripts

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

npm package (@next dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


i18n(zh-cn): Update imports.mdx

Description (required)
Update imports.mdx
Related issues & labels (optional)

#9240

Lunaria Status Overview
🌕 This pull request will trigger status changes.

Learn more
By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.
You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File
Note

zh-cn/guides/imports.mdx
Localization changed, will be marked as complete.

Warnings reference

Icon
Description

🔄
The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.


Added Tailanimista

Name
Link

Tailanimista
_https://tail-animista.vercel.app/_

A wonderfully crafted tool for quickly prototyping animations in Tailwind CSS by @vikrantyadav611.

[X] My item is in the right category
[X] My item is logically grouped below similar items
[X] My item's name and description respects the conventions of the list
[X] My item is awesome
[X] My item is in line with the Tailwind brand usage guidelines
[X] I have read and followed the contribution guidelines

Duplicate of https://github.com/aniftyco/awesome-tailwindcss/pull/301, thanks for reconsidering the tool though 🙏 @ryanhaticus

Ah, I missed this one in the list!
I swear sometimes I can't see through these glasses!


feat: allow borsh-serialized contract fn arguments

Let's say you have a contract object instantiated in your code, and the contract it wraps has an add_person function which receives a borsh-serialized struct. The following code now works:
import { serialize } from 'near-api-js/lib/utils/serialize'

class Person {
  constructor (proof) {
    Object.assign(this, proof)
  }
}

const personSchema = new Map([
  [Person, {
    kind: 'struct',
    fields: [
      ['age', 'u64'],
      ['name', 'String'],
    ]
  }]
])

const person = new Person({ age: 33, name: 'Jesus' })

contract.add_person(serialize(personSchema, person))

@chadoh need to fix test failures

@vgrichina merged; could you cut a release?


load_dataset("snli") is different from dataset viewer

Describe the bug
The dataset that is downloaded from the Hub via load_dataset("snli") is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2).
Is this expected?
Environment info

datasets version:
Platform: Ubuntu 20.4
Python version: 3.7

Yes, we decided to replace the encoded label with the corresponding label when possible in the dataset viewer. But

maybe it's the wrong default
we could find a way to show both (with a switch, or showing both ie. 0 (neutral)).

Hi @severo,
Thanks for clarifying.
I think this default is a bit counterintuitive for the user. However, this is a personal opinion that might not be general. I think it is nice to have the actual (non-encoded) labels in the viewer. On the other hand, it would be nice to match what the user sees with what they get when they download a dataset. I don't know - I can see the difficulty of choosing a default :)
Maybe having non-encoded labels as a default can be useful?
Anyway, I think the issue has been addressed. Thanks a lot for your super-quick answer!

Thanks for the 👍  in https://github.com/huggingface/datasets/issues/3673#issuecomment-1029008349, but as I proposed various solutions, it does not help me chose between them. Could you write your preferences as a comment?

As I am working with seq2seq, I prefer having the label in string form rather than numeric. So the viewer is fine and the underlying dataset should be "decoded" (from int to str). In this way, the user does not have to search for a mapping int -> original name (even though is trivial to find, I reckon). Also, encoding labels is rather easy.
I hope this is useful

I like the idea of "0 (neutral)". The label name can even be greyed to make it clear that it's not part of the actual item in the dataset, it's just the meaning.

I like @lhoestq's idea of having grayed-out labels.

Proposals by @gary149. Which one do you prefer? Please vote with the thumbs

👍

👎

I like Option 1 better as it shows clearly what the user is downloading

Thanks!

Love it ! thanks :)


Color bug

In extensions if author have Check icon, it's invisible on focus
Active

Inactive

Thank you for your patience! 🙏🏼
It‘s been a while since I had free time to focus more on Nord, and my open source projects in general, and invest time in this issue due to work-life balance.
I recently published the first “Northern Post — The state and roadmap of Nord“ announcement which includes all details about the plans and future of the Nord project, including the goal of catching up with the backlog. This issue is part of the backlog and therefore I want to triage and process it to get one step closer to a “clean state“. Read the announcement about reaching the “clean“ contribution triage state in Nord‘s discussions for more details about the goal.
Therefore it has been added for triage in the central and single-source-of-truth project board that is also described in more detail in the roadmap announcement.

@bmarvinb @mnlfischer Thanks again for your contributions 🚀
The issue has been added for triage to be planned in for the next iterations!


undoing updates to usingcli article

Addressing ZE Issue 1741

@zFernand0 @JillieBeanSim: After listening to the meeting recording from June 20 (when we first discussed the FAQ issue), I was able to add two new FAQs to address ZE Issue 1741:

What if Secure Credential Storage does not work in my environment?
What if I do not want Zowe Explorer to store my credentials?

For each, I provided a simple answer and a link to additional information in Using Zowe Explorer (which I'll be adding w/ this PR)
Please let me know if these questions are what we're looking for, or if we need to tweak anything.
Thank you!


CDITCK-384  Create tests for observer method invocation context

Currently, SessionBeanObserverMethodInvocationContextTest fails due to WFLY-2847.
Before merging, also check comments in org.jboss.cdi.tck.tests.event.observer.context.enterprise.FooObserver - whether SessionContext injected into observer is enough to check isCallerInRole(...)

Partially merged. 0ddf36ed9fb793aed9ac17e07b23e1dc14ff5091 still remains.

Merged completely. Thank's


Use of object crate

I was having a look at the code because I'm interested in seeing how people make use of the object crate.
You are making extensive use of the unified API for reading ELF files. Is this intentionally so that you can handle other file formats in future, or just because it was easiest? A concern I have with this approach is that, to support the unified API, the relocation parsing in object is doing a bunch of work that you don't need, and this may be an area that is performance sensitive.
Also, you have defined your own ELF types for use in writing (e.g. FileHeader, ProgramHeader). Is there a reason that the types defined in object::elf weren't suitable?

Thanks for having a look!
I'll have a look at using the lower level APIs. I have on a few occasions found the APIs that I was using a little too high level. In particular, I was wanting at one point to store slices of relocations, but because the APIs were all iterator-based, I ended up needing to do something else instead. But you're right, if it I just read the relocation section bytes, then call object::slice_from_bytes, I can just get the raw relocations directly.
I defined my own structs for ELF types mostly because I initially didn't realise that I could write via the types that the object crate provided. Once I did realise, I figured object's types were doing some things that I figured I didn't need - supporting writing to unaligned bytes and supporting big endian. But I suspect I won't pay any performance penalty for those features, so I should probably just switch over.

I've switched several structs over to those provided by the object crate. One downside is that because there are some structs that object doesn't define, such as the format of the eh_frame header, I now need to work with two different Pod interfaces - object's  and bytemuck's. But it's not too bad.

I'll have a look at using the lower level APIs.

I could work on this if you want. The lower level APIs haven't seen a lot of use, so there's probably some rough edges in object that need fixing.

I now need to work with two different Pod interfaces - object's and bytemuck's

You could use object's Pod for everything. Or we could switch object to use bytemuck. (The reason I haven't done that is because bytemuck expects you to have the exact size, but when reading it is common to have trailing bytes, so I would still have to repeat all the size calculations that bytemuck does. This is similar to why https://crates.io/crates/bytes-cast exists.)

I could work on this if you want. The lower level APIs haven't seen a lot of use, so there's probably some rough edges in object that need fixing.

By all means! Contributions are definitely welcome! If anything doesn't make sense, let me know, and I'll try to document it better. I'm also happy to do video calls if you want to discuss stuff - my calendar is linked from github.
I was thinking some more about the bytemuck vs object Pod approaches. Another big difference besides what you mentioned with trailing bytes is that object::Pod handles unaligned reads/writes when each field is read/written, whereas bytemuck doesn't, so if the value might be unaligned, you need to copy the whole struct. I know my output is always properly aligned, so for writing, bytemuck's approach is fine. However for reading, I need to be able to cope with things unaligned because archives only have 2-byte alignment - so there, object's approach is definitely better - although plausibly better still would be to make the code generic over whether we're aligned, then switch at a higher level. I suspect it probably doesn't make any difference on x86 anyway, since AFAIK the same instructions are used for aligned and unaligned access. It might make more of a difference on ARM where different instructions are used, but that's a problem for another day.


[21.11] python3Packages.tensorflow: patch for compatibility with h5py 3.0.0+

Motivation for this change
Fixes #147321
Fixes #124599
Things done

Built on platform(s)

[ ] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
22.05 Release Notes (or backporting 21.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

cc @tpwrules

I tested on x86_64-linux and it works great. Thank you!

Great!

Thank you!


Trigger once?

The old plugin used to have a trigger once option, I can't seem to find it in the new documentation.

You can see it in the documentation at this place: http://imakewebthings.com/waypoints/api/destroy/
In short: trigger-once is not available anymore, but you're able to call
this.destroy

at the end of your handler, resulting in the destruction of the handler at the first call of the handler.

Ah great, thank you very much.


Add user registration

Rest endpoint
Data model
SNS notification

:+1:  Looks good.  Do you want to attempt an ITest with AWS SNS?

Yes, in my next PR. It will be a system test.


Replace info validation with exists validation

There are a few subtle things with the change:

If people have python as pythonPath, previously this would work. Because we actually executed python, to test and verify if it is valid. Now we test if it is a valid file. Execution searches PATH, where as fileExists does not. so should we just skip fileExists check.
If people point to any valid file, this check will succeed. Should we check if the file is also executable?

We should not do full validation though. This may not be a selected interpreter, this may also be path that can be provided in the debug configuration itself. We don't validate if that path is executable right now, we just execute it and ignore any errors. I don't see why we need to fully validate the python before running the debugger.
Say a bad package is installed with a .pth file that for some reason prints to stdout. If we do full validation it will fail. and in a way that people don't see why. Rather, it should fail in a way that tells people why. letting it run the debugger means if it fails it will show why.

Note that at least the Docker extension does set it to plain python3, and expect it to be looked up on PATH.
With respect to the bad package scenario, I'm not sure this makes much difference in that case. If the interpreter does garble stdout, then VSCode will fail to talk to the adapter because DAP will get corrupted on the wire by interleaving output. But the error message in that case would come from VSCode, and it won't really explain the issue.

@int19h that was my point with the subtle issue 1. What do you recommend? should we keep the current check or just get rid of it entirely (i.e, no file validation).

We don't validate if that path is executable right now, we just execute it and ignore any errors.

And that helped for most of our cases (if python3 is not on PATH, invalid path provided etc.), it'll atleast notify users that the path they have set is not valid. Something is better than nothing, so I say keep it.

I would drop the validation for "python" and "debugLauncherPython" altogether, because that will be effectively performed by debugpy when it tries to use them, and in both cases, it has channels to communicate that error back. We might want to improve the error message - below is what it looks like at the moment - but that'd be a debugpy side change.

We might want to keep validation for "debugAdapterPython", because in that case it's VSCode spawning it, not us, and it won't report the error clearly if the path is invalid. But then again this property is not supposed to be documented, so I'm not sure if it's worth it, either. If we do it, though, I think it should do full validation, since the file being non-executable would be just as fatal, and all the same arguments apply.

We might want to keep validation for "debugAdapterPython", because in that case it's VSCode spawning it, not us, and it won't report the error clearly if the path is invalid.

I think that is on VS Code to raise an error in a way that is clear what is going on. the way I see it not only is the wrong python path a problem, wrong debug adapter path is also a problem. Essentially, if VS code is not able to start the debugger for any reason it should surface it correctly. Or give us a way to figure out what when wrong, so we can surface it. Validating it like we are doing it is never going to be enough.

@karthiknadig Until the error message from both debugpy and VSCode is clearer about invalid python path case atleast, I think we should hold off on this.

Ok. Closing this for now.

@karrtikr It looks like the error you get from extension validation is less clear than what you get from debugpy at the moment for the "python" scenario (which is the only one that's exposed to the end users) - it complains about having to select the interpreter before starting debugging, even though it's already been set.
I think this is actually a regression I've introduced with my "python" changes - looking at that code, the message is set depending on whether "pythonPath" was explicitly specified or came from workspace settings; but it's always coming from workspace settings now, and the user-exposed property is "python". So it always thinks that the value is from workspace settings. And that branch in the validator assumes that the only possible reason for an error is that interpreter was not selected at all, and the error message reflects that: "You need to select a Python interpreter before you start debugging". That logic was always kinda wrong, but now it's consistently wrong :)
So, basically, right now, removing the checks entirely would improve errors compared to the current state of affairs.

@int19h Yaa, it's a regression then. The earlier message on setting "pythonPath" was

which was much clearer.
We can remove the check for now then, but I think we should create the work item to also fix the regression.


Add support to sort by y values for charts that have a single value per series

We have a lot of bar charts that should be sorted by y values. This pull request adds a "sortY" option.

Btw, until this merged, if you uncheck the "Sort X values" option of the chart, it will preserve the order the results returned from the database, so you can already sort by y value if you change the query.
See this as an example:
http://demo.redash.io/queries/232/source#add
Just play with the "Sort X values" option.

Right, the sort by X functionality doesn't do what we need here. As mentioned above, we have a table that looks like:

Test
Development
Production

100
200
300


solarized-dark: change variables to blue

This is in line with solarized-light, which is more readable imho.

Could you include a before and after screenshot?

Before and after, in YAML, where it annoyed me to begin with:

Solarized light for reference:

I've been thinking about this for quite a while but what's been holding me down is that the official spec for the theme indicates that variables have to be the same color as text. However, a good idea would be to add a custom variable in the theme for enabling this for people that prefer it.

Honstly, I'm fine with anything, I've also noticed that the anchors have different colours between the themes, which apparently is a function-name, but I'll leave the decision on how resolve this to Henrik I guess. I just thought sending in a PR is better (and probably faster) than just complaining that the colours are different (and worse imho) in the dark version.

I get it. Though I'm the one with the responsibility to maintain this theme, so I can help you out with the PR. You could do take a similar approach to the one taken with the doom-solarized-dark-brighter-text variable! Check it out right there in the same file.

I'd prefer that variables have a different color than the foreground text. I don't mind if we deviant from the spec in this regard. This is what I'm doing in doom-one and doom-dracula and, for consistency, would like to extend it to other themes.
I don't think it necessitates another variable though. Themes are already very customizable with the likes of custom-set-faces and set-face-attributes, and work fine for this simple changes.

@hlissner understood! It's fine then.


Make probability predictions for multiclass classification

This is essentially the same thing as https://github.com/dscolby/CausalELM.jl/issues/36. We will use the clipping function because it preserves class predictions and constrains the predictions within the range of natural values.

We should also include a note in the documentation for this.

Since an ELM is minimizing an MSE loss, we can do this for binary outcomes by clipping values outside of [0, 1] but this isn't really feasible for categorical variables. For example, if there are four categories, 1, 2,3, and 4, the model predicts 1.6, and the actual class is 4, you can't interpret this as having a higher probability of being 3 than 4 because these are just arbitrary categories. Therefore, we will only support clipping functions for binary treatments and outcomes.

Closing since this isn't feasible.


Illegal type union on isActive even though that property isn't selected

I get this

This is my query. isActive is a computed property on Membership type.
I'm doing memberships because it's a multi link on User to the Membership type
Membership is an abstract type, and OrgMembership is a polymorphic type that extends it

This is the generated edheQl
std::assert_single((WITH
  __scope_0_defaultUser := DETACHED default::User
SELECT __scope_0_defaultUser {
  created_at,
  email,
  updated_at,
  id,
  memberships := (
    WITH
      __scope_1_defaultMembership := __scope_0_defaultUser.memberships
    SELECT __scope_1_defaultMembership {
      [IS default::OrgMembership].role
    }
  )
}
FILTER (__scope_0_defaultUser.id = <std::uuid>"0a010d08-3484-11ee-9380-f3c6acf82edf")))

User type

Abstract membership type

OrgMembership type

There is something peculiar with properties named isActive via QB. We get an error thrown at toEdgeQL on a simple select of an object including isActive: true.
[cause]: Error: Field "isActive" does not exist in default::User
      at shapeToEdgeQL (webpack-internal:///(api)/./dbschema/edgeql-js/toEdgeQL.mjs:709:23)
      at renderEdgeQL (webpack-internal:///(api)/./dbschema/edgeql-js/toEdgeQL.mjs:498:28)
      at Proxy.$toEdgeQL (webpack-internal:///(api)/./dbschema/edgeql-js/toEdgeQL.mjs:125:18)
      at Proxy.$queryFunc (webpack-internal:///(api)/./dbschema/edgeql-js/query.mjs:31:24)

Bizarrely, isActive does not show up on ["*"] for the object either.


Web Components - The Tabs Extended with Media web component shrinks in size when attempting to select a tab

Description
Expected Results:
The Tabs Extended with Media web component will render the same size and format throughout use.

Actual Results:
When a Safari user attempts to navigate between the tabs of the web component, the whole component shrinks in size, as if having a responsive change in screen size.
Component(s) impacted
Tabs Extended With Media
Browser
Safari
Carbon for IBM.com version
v1.39.0-rc.0
Severity
Severity 3 = The problem is visible or noticeable to users but does not impede the usability or functionality. Affects minor functionality, has a workaround.
Application/website
https://carbon-design-system.github.io/carbon-for-ibm-dotcom/next/web-components/?path=/story/components-tabs-extended-with-media--default
Package
@carbon/ibmdotcom-web-components
CodeSandbox example
https://carbon-design-system.github.io/carbon-for-ibm-dotcom/next/web-components/?path=/story/components-tabs-extended-with-media--default
Steps to reproduce the issue (if applicable)
1. Launch https://carbon-design-system.github.io/carbon-for-ibm-dotcom/next/web-components/?path=/story/components-tabs-extended-with-media--default in Safari
2. Attempt to navigate between the tabs of the component
3. Observe that the component responsively changes in size without the screen size changing

Release date (if applicable)
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct
[X] I checked the current issues for duplicate issues

Fixed in https://github.com/carbon-design-system/carbon-for-ibm-dotcom/pull/9974.


Add number localization

You wanted localization so I localized your localizations, localize that.

N

I

C

E


Confused about update_state

Dear Jesus, I'm using the update_state method in one of my systems and I realize if you do not include all the variables in the context update they are deleted. Is it correct?
For instance:
(1) update_state('asistenciaAbordo', {'horaInicio': fechaDeInicio.hour, 'horaActual': fechaActual.hour, 'masDe8horas': 'si'})
(2) update_state('asistenciaAbordo', {'horaActual': fechaActual.hour})
The second update will clean the value of horaDeInicio and masDe8horas. Correct?
Are parcial (only some variables) updates possible?
Thantks in advance,
Xabiel

Hi Xabiel, thanks for posting the question. Partial updates are not supported right now. I'm going to add this to the list of features to be implemented.

Gracias!
Enviado desde mi iPhone
El 7 jun 2020, a las 21:08, Jesus Ruiz<EMAIL_ADDRESS>escribió:

Hi Xabiel, thanks for posting the question. Partial updates are not supported right now. I'm going to add this to the list of features to be implemented.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/jruizgit/rules/issues/328#issuecomment-640264939, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGMNHLMLKODVAOWJX63XVPTRVPQUBANCNFSM4MHUG4WA.


Storage Component. Added Remarks Function

AddCommandParserTest.java has some extra spaces in the commit, you may want to discard that changes.
You should update UserGuide as well on "Features"
Maybe you may want to modify the add command to be able to add remarks as well? (Could be implemented in later changes)


[DP-147] Write GraphQL resolver to query chapter contents

Changelog

query.rs: Added query resolver for chapters
database_sql.rs: Added method fetching chapter contents from database
chapter_contents.sql: SQL query retrieving chapter contents

Changelog

edited_collection.rs: Contains collection chapter struct with a document resolver
chapter_contents.sql: Modified search for a chapter to look for a chapter_path with the matching first and last segments of a slug


Face distance end result

face distance was having wrong sign for the end result in examples/face_distance.py

Are you sure? It seems correct to me. What output do get from running the script?

I am sorry. It was my confusion.


About when nsg validate the traffic.

Hi team,
our customer has a traffic flow like below.
Client -> LB -> VM
When using nsg inbound rule to allow Client to VM,
It looks like Source Client, Destination VM should be set up.
And when  using nsg outbound rule to allow Client to VM,
It looks like Source Client, Destination LB should be set up.
This isn't very clear to our customers. (Not only one customer)
The network team support engineer said the difference is come from when nsg validates the traffic (Arrived at destination or leave the source?)
Could you please check there is any document mentioning this,
If not, could you please add this kind of statement somewhere?
Thank you.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: cd190c21-5b50-87ba-37dd-0b0c017ec6fb
Version Independent ID: d9720147-207c-4c98-ba8d-016ff4b6ad60
Content: Network security group - how it works
Content Source: articles/virtual-network/network-security-group-how-it-works.md
Service: virtual-network
GitHub Login: @mbender-ms
Microsoft Alias: mbender

@xujiongda , thank you for your feedback. We'll review this and get back to you shortly!

@xujiongda , I couldn't find this NSG configuration mentioned anywhere. All docs have source and destination as Any.
We have assigned this to the content owner/author for review.
@mbender-ms , could we add the above recommendation somewhere, if possible?

Hi @GitaraniSharma-MSFT,
yes, the problem is it didn't mention but it should be...
Otherwise, the customer could have some issues setting up a highly secure environment.

Thanks for your feedback and suggestions.
The item is being added to our backlog, and we'll update the document as appropriate after evaluating.
#Please-close


i think i have completely install it but i need help  .i am very...

How-to example
Make sure the model and scorer files are in the root directory. They are automatically loaded
After following the installation instructions, you can run autosub/main.py as given below. The --file argument is the video file for which SRT file is to be generated

$ python3 autosub/main.py --file ~/movie.mp4

1 i dont understand what is root directory  ? it is *****/autosub  ??  or somewhere else ?
2 after  i download deepspeech and i think i finally   can install this program  but i got so many error .
its hard to explain but it lookalike this program try to sub  your    tut  document.
what i am worng here.

[url=https://www.img.in.th/image/wO0mBE][img]https://www.img.in.th/images/c617aee4dc2b84bb55b9c29c55345951.jpg[/img][/url]
[url=https://www.img.in.th/image/wO0bGa][img]https://www.img.in.th/images/06d62ad48e7af4c6d170363dd8dfac98.jpg[/img][/url]

[img]https://www.img.in.th/images/c617aee4dc2b84bb55b9c29c55345951.jpg[/img]
[img]https://www.img.in.th/images/06d62ad48e7af4c6d170363dd8dfac98.jpg[/img]

Yes, the model files need to be in the folder that you cloned this repo into.
Why are you coying the attached text into the CLI? You just need to copy the commands after the $ character.
Also, apt-get is a Linux command. Please use windows appropriate commands.


UI refresh() is unusually expensive

Currently performing pane.refresh() is taking upwards of 120ms to complete and triggers various layout shifts. Is there a way to update ui input values that have been changed in a script without causing this expensive reflow? For example only updating the components whos values have changed?

Also moving the colour picker also seems to be a very expensive operation and causes the animation loop to start juddering. This harms the user experience somewhat when working with realtime graphical applications.
Again thanks for the awesome framework, it's been incredibly useful so far. I wish I could help iron out these performance issues but I am a native / graphics developer and do not have much experience with browser processes etc.
(Ps. you should add a donate button to your site)

i've noticed in sv-palette.ts the colour palette drawing and updating could be optimised. I might be able to have a look at this at some point. Also my friend mentioned that calling the update on mousemove (vs synced to the redraw/frame rate) will do lots of extra work. However that optimisation might require a callback throttle at the higher level to the animation frame.

I wasnt able to build the repo using 'npm install and npm start' (returned lots of script syntax errors with node 10.15.3 and npm 6.4.1). but if you want to dramatically speed up the sv-palette i would recommend uploading colours to a 64x64 canvas as an array of rgba bytes using ImageData instead of using ctx.fillRect for every pixel. Then scale the canvas to the size you want with css. This will avoid lots of expensive canvas rect antialiasing operations etc and may even give you a smoother gradient image due to the canvas filtering. See more here https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Pixel_manipulation_with_canvas

Build issues were a windows thing. This change to sv-palette.ts optimised the colour picker rendering. This could be even faster by rendering to a smaller canvas and scaling with css. I think this will help the refresh() performance too.
`// import * as ColorConverter from '../../converter/color';
import {ClassName} from '../../misc/class-name';
import * as DisposingUtil from '../../misc/disposing-util';
import * as DomUtil from '../../misc/dom-util';
import {NumberUtil} from '../../misc/number-util';
import {PaneError} from '../../misc/pane-error';
import {Color} from '../../model/color';
import {InputValue} from '../../model/input-value';
import {View, ViewConfig} from '../view';
const className = ClassName('svp', 'input');
/* accepts parameters

c = [h, s, v]
where h s v are 0.0 - 1.0
*/
function HSVtoRGB(c: Number[]): Number[] {
var r, g, b, i, f, p, q, t, h, s, v;
h = c[0];
s = c[1];
v = c[2];
i = Math.floor(h * 6);
f = h * 6 - i;
p = v * (1 - s);
q = v * (1 - f * s);
t = v * (1 - (1 - f) * s);
switch (i % 6) {
case 0: r = v, g = t, b = p; break;
case 1: r = q, g = v, b = p; break;
case 2: r = p, g = v, b = t; break;
case 3: r = p, g = q, b = v; break;
case 4: r = t, g = p, b = v; break;
case 5: r = v, g = p, b = q; break;
}
return [r, g, b];
}

interface Config extends ViewConfig {
value: InputValue;
}
/**

@hidden
*/
export class SvPaletteInputView extends View {
public readonly value: InputValue;
private canvasElem_: HTMLCanvasElement | null;
private markerElem_: HTMLDivElement | null;
constructor(document: Document, config: Config) {
super(document, config);
 this.onValueChange_ = this.onValueChange_.bind(this);

 this.value = config.value;
 this.value.emitter.on('change', this.onValueChange_);

 this.element.classList.add(className());
 this.element.tabIndex = 0;

 const canvasElem = document.createElement('canvas');
 canvasElem.classList.add(className('c'));
 this.element.appendChild(canvasElem);
 this.canvasElem_ = canvasElem;

 const markerElem = document.createElement('div');
 markerElem.classList.add(className('m'));
 this.element.appendChild(markerElem);
 this.markerElem_ = markerElem;

 this.update();

 config.model.emitter.on('dispose', () => {
 	this.canvasElem_ = DisposingUtil.disposeElement(this.canvasElem_);
 	this.markerElem_ = DisposingUtil.disposeElement(this.markerElem_);
 });

}
get canvasElement(): HTMLCanvasElement {
if (!this.canvasElem_) {
throw PaneError.alreadyDisposed();
}
return this.canvasElem_;
}
public update(): void {
if (!this.markerElem_) {
throw PaneError.alreadyDisposed();
}
 const ctx = DomUtil.getCanvasContext(this.canvasElement);
 if (!ctx) {
 	return;
 }

 const c = this.value.rawValue;
 const hsvComps = c.getComponents('hsv');
 const width = this.canvasElement.width;
 const height = this.canvasElement.height;

 // This can be optimised further by using a smaller canvas
 let imageData = ctx.getImageData(0, 0, width, height);
 let data = imageData.data;
 const hue = hsvComps[0] / 360.0;

 for (let x = 0; x < width; ++x)
 {
 	for (let y = 0; y < height; ++y)
 	{
 		const i = (x + width * y) * 4;
 		const s = NumberUtil.map(x, 0, width - 1, 0, 1.0);
 		const v = NumberUtil.map(y, 0, height - 1, 1.0, 0);
 		const rgb = HSVtoRGB([hue, s, v]);
 		data[i + 0] = rgb[0] * 255;
 		data[i + 1] = rgb[1] * 255;
 		data[i + 2] = rgb[2] * 255;
 		data[i + 3] = 255;
 	}
 }

 ctx.putImageData(imageData, 0, 0);

 const left = NumberUtil.map(hsvComps[1], 0, 100, 0, 100);
 this.markerElem_.style.left = `${left}%`;
 const top = NumberUtil.map(hsvComps[2], 0, 100, 100, 0);
 this.markerElem_.style.top = `${top}%`;

}
private onValueChange_(): void {
this.update();
}
}
`

Thank you for using Tweakpane and addressing the issue.

Could you share your pane settings? I'd also like to use it for benchmark.
I'll try your suggestion later.
I think that I can also improve other palettes (alpha, hue) by replacing canvas with CSS gradient.

Which settings do you mean? My tweakpane object is initialised like this:
  const ui = new Tweakpane({
    title: 'Parameters',
    expanded: true,
    container: document.getElementById('tweakpane-container'),
  });

and features:

6 folders
1 dropdown
5 colours
17 sliders
5 separators

If that helps.

Applied your optimization to the branch optimize-palettes. Could you try it before merging?
https://github.com/cocopon/tweakpane/tree/optimize-palettes

Pushed additional performance improvements.

8d4eaee92ba5452a1857ab71cee00e5be825a5f7
f86be605b1d34c7ffd89c8a6242318c25b4a8a44

Amazing. The colour selector performance is greatly improved by the latest commits. I haven't tried the manual refresh situation yet but will do so if these changes make their way onto npm (to use with my other project).

Just published the latest version 1.5.6 to npm.

The latest version on npm is much faster with the colour palettes and the pane refresh. Great work!


Fix for an error in the gradient calculation

There was a small error in the gradient calculation that kept the embeddings from converging.  This fix also produces a mammal subtree that much more closely resembles the figure from the paper.

Thanks for your good suggestion. I tried your modification and saw it worked well.


TODO for 1.4

[ ] Fix energy bug in Reader/Writers
[ ] Try to fix some more crashes?
[ ] Fix bugs remaining on the issue tracker
[ ] Test on server
[ ] Crafter tiers
[ ] Artwork

[  ] try and implement upgrade slots modularity.

Collaborate with other mod creators for interoperability? I would be grate if your mod had integration with enderIO (like AE2) and OpenComputers support (like AE2).


feat: handle ckb unlock, sign and send unlock tx

Codecov Report

Merging #286 (7e304ab) into feature-nervos-to-ethereum (85725f1) will decrease coverage by 3.70%.
The diff coverage is n/a.

@@                      Coverage Diff                       @@
##           feature-nervos-to-ethereum     #286      +/-   ##
==============================================================
- Coverage                       42.66%   38.96%   -3.71%
==============================================================
  Files                              24       16       -8
  Lines                            1957     1699     -258
  Branches                           56        0      -56
==============================================================
- Hits                              835      662     -173
+ Misses                           1122     1037      -85

Impacted Files
Coverage Δ

...in-modules/eth-contracts/contracts/ForceBridge.sol

...th-contracts/contracts/libraries/MultisigUtils.sol

...es/eth-contracts/contracts/libraries/SafeERC20.sol

...ules/eth-contracts/contracts/NervosMirrorToken.sol

...ules/eth-contracts/contracts/libraries/Address.sol

...ain-modules/eth-contracts/contracts/test/ERC20.sol

...n-modules/eth-contracts/contracts/AssetManager.sol

...les/eth-contracts/contracts/libraries/SafeMath.sol

Continue to review full report at Codecov.

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


ERROR in Error: Illegal state: symbol without members expected

Versions
Angular CLI: 1.6.0
Node: 8.4.0
OS: linux x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

@angular/cdk: 2.0.0-beta.12
@angular/cli: 1.6.0
@angular/material: 2.0.0-beta.12
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.0
@schematics/angular: 0.1.10
@schematics/schematics: 0.0.10
typescript: 2.5.3
webpack: 3.7.1

Repro steps
Running ng serve --aot in our angular-cli project and modifying files after compilation is complete
Unfortunately I cannot provide a plunkr or reproduction project since this happens in my company's production app.
Observed behavior
ERROR in Error: Illegal state: symbol without members expected, but got {"filePath":"/home/ptemel/GUICLI/node_modules/tslint/lib/index.d.ts","name":"Rules","members":["AbstractRule"]}.
    at StaticSymbol.assertNoMembers (/home/ptemel/GUICLI/node_modules/@angular/compiler/bundles/compiler.umd.js:1444:19)
    at AotSummaryResolver.resolveSummary (/home/ptemel/GUICLI/node_modules/@angular/compiler/bundles/compiler.umd.js:32640:22)
    at StaticReflector.annotations (/home/ptemel/GUICLI/node_modules/@angular/compiler/bundles/compiler.umd.js:31570:69)
    at DirectiveResolver.isDirective (/home/ptemel/GUICLI/node_modules/@angular/compiler/bundles/compiler.umd.js:3552:61)
    at CompileMetadataResolver.isDirective (/home/ptemel/GUICLI/node_modules/@angular/compiler/bundles/compiler.umd.js:15122:37)
    at /home/ptemel/GUICLI/node_modules/@angular/compiler/bundles/compiler.umd.js:31203:38
    at Array.forEach (<anonymous>)
    at analyzeFile (/home/ptemel/GUICLI/node_modules/@angular/compiler/bundles/compiler.umd.js:31195:53)
    at AotCompiler._analyzeFile (/home/ptemel/GUICLI/node_modules/@angular/compiler/bundles/compiler.umd.js:30396:17)
    at AotCompiler.findGeneratedFileNames (/home/ptemel/GUICLI/node_modules/@angular/compiler/bundles/compiler.umd.js:30412:42)
    at Object.findGeneratedFileNames (/home/ptemel/GUICLI/node_modules/@angular/compiler-cli/src/transformers/program.js:393:82)
    at TsCompilerAotCompilerTypeCheckHostAdapter.getSourceFile (/home/ptemel/GUICLI/node_modules/@angular/compiler-cli/src/transformers/compiler_host.js:337:55)
    at findSourceFile (/home/ptemel/GUICLI/node_modules/typescript/lib/typescript.js:70782:29)
    at args (/home/ptemel/GUICLI/node_modules/typescript/lib/typescript.js:70719:85)
    at getSourceFileFromReferenceWorker (/home/ptemel/GUICLI/node_modules/typescript/lib/typescript.js:70692:34)
    at processSourceFile (/home/ptemel/GUICLI/node_modules/typescript/lib/typescript.js:70719:13)
    at processRootFile (/home/ptemel/GUICLI/node_modules/typescript/lib/typescript.js:70573:13)
    at /home/ptemel/GUICLI/node_modules/typescript/lib/typescript.js:69765:60
    at Object.forEach (/home/ptemel/GUICLI/node_modules/typescript/lib/typescript.js:1500:30)
    at Object.createProgram (/home/ptemel/GUICLI/node_modules/typescript/lib/typescript.js:69765:16)
    at AngularCompilerProgram._createProgramWithBasicStubs (/home/ptemel/GUICLI/node_modules/@angular/compiler-cli/src/transformers/program.js:431:29)
    at /home/ptemel/GUICLI/node_modules/@angular/compiler-cli/src/transformers/program.js:143:28

Desired behavior
This error should not occour
Mention any other details that might be useful (optional)
This does not happen consistently, which makes this so hard to debug for me. Sometimes it recompiles fine without any errors, but usually the error is thrown. Usually the first ng serve --aot run will compile fine and then sometimes it continues with another compilation process which throws the error, even though no files were changed.

I was able to resolve this issue by deleting custom tslint rule files that were present in the project's directory. However, I would still like to know why this error only happens occasionally. This seems like a bug to me.


fuzzer jobs optimizations

prog: reduce amount of hint replacements
pkg/fuzzer: optimize smash jobs
pkg/fuzzer: remove signal rotation
pkg/fuzzer: try to triage on different VMs
pkg/fuzzer: tune corpus triage
pkg/fuzzer: issue minimize attempts in parallel
executor: restart procs more deterministically
pkg/fuzzer: deflake hints 3 times instead of 2

I've also rebased it on top latest changes.
PTAL


Additional stimulus controller "lookup" paths in importmap_helper.rb

Firstly, thanks for this library.. it feels like the future! It's also been a great intro to ESM and how that works.
We're running into an issue using this together with a Rails engine, because the importmap_helper.rbfile is hardcoded to look in the Rails.root folder only, when resolving the paths for stimulus controllers.
  def importmap_list_from(*paths)
    Array(paths).flat_map do |path|
      if (absolute_path = Rails.root.join(path)).exist?
        find_javascript_files_in_tree(absolute_path).collect do |filename|
          module_filename = filename.relative_path_from(absolute_path)
          module_name     = importmap_module_name_from(module_filename)
          module_path     = asset_path(absolute_path.basename.join(module_filename))

          %("#{module_name}": "#{module_path}")
        end
      end
    end.compact.join(",\n")
  end

https://github.com/hotwired/stimulus-rails/blob/13383ace3a9afc1ad90118110a236afe33ad67d5/lib/stimulus/importmap_helper.rb#L8
We can work around this by manually adding our engine's stimulus controllers to the importmap.json file like so:
{
  "imports": {
    "turbo": "<%= asset_path "turbo" %>",
    <%= importmap_list_with_stimulus_from "app/assets/javascripts/controllers", "app/assets/javascripts/libraries" %>,
    "slideshow_controller": "<%= asset_path "slideshow_controller" %>"
  }
}

where slideshow_controller resides under the engine.
It would be great if we could specify which root paths to use in this helper, so we can include AppKit::Engine.root in the helper path, for example and have it work automatically.
Would this be a welcome option if we gave it a go for a PR? A bit unsure how best to do it, while also keeping the interface simple like it is now: importmap_list_from(*paths) so open to ideas and suggestions.

I think we could make this work by having it accept both relative and absolute paths. Relative would work as now, going off Rails.root, but absolute (starting with /) would allow for engines 👍

I think we could make this work by having it accept both relative and absolute paths. Relative would work as now, going off Rails.root, but absolute (starting with /) would allow for engines 👍

Thanks, that's a great suggestion. I'll give it a shot 😎

Thanks, that's a great suggestion. I'll give it a shot 😎

PR #39 created to add support for this.
The change could have been just taking this line:
      if (absolute_path = Rails.root.join(path)).exist?

And making it:
     if (absolute_path = Rails.root.join(Pathname.new(path))).exist?

But it felt like too much magic and hard to understand. Hence I've added a clearer method. Happy to change if you feel example above is ok.

PR #39 created to add support for this.
The change could have been just taking this line:
      if (absolute_path = Rails.root.join(path)).exist?

And making it:
     if (absolute_path = Rails.root.join(Pathname.new(path))).exist?

But it felt like too much magic and hard to understand. Hence I've added a clearer method. Happy to change if you feel example above is ok.


Is it possible to use cache with post method?

I'm looking for a cache mechanism for http request in my frontend project these days and I found Axios Cache Interceptor fit my project, but the problem I have now is that most of the APIs in my project is using post method to fetch data instead of get.
so, when I use axios.post, the cache doesn't work:
const req1 = await axios.post('/api-1', body);
const req2 = await axios.post('/api-2', body);
console.log(req1.cached) // false
console.log(req2.cached) // false

how can I make cache work using axios.post? please help!

https://axios-cache-interceptor.js.org/config/request-specifics#cache-methods

Feel free to reopen this issue.


Add Code of Conduct, Contributing tutorial

related: #2

Adds a Code of Conduct
Adds a contributing tutorial

I think we can do without the PR guide for now. COC and tutorial look great, thanks.


🐞 [Bug]: Comment cancel deployment from multiple_vms script

Is there an existing issue for this?

[X] I have searched the existing issues

which package/s did you face the problem with?
grid_client
What happened?
Deployments are being canceled becasue of this line:
https://github.com/threefoldtech/tfgrid-sdk-ts/blob/0c16bcb97cfb3543c9846d6bc6cb491368a39848/packages/grid_client/scripts/multiple_vms.ts#L111
https://app.testlodge.com/a/26076/projects/40893/runs/757631/run?selected=33242430&user_id=170529
https://github.com/threefoldtech/tfgrid-sdk-ts/issues/3431
which network/s did you face the problem on?
Dev

Verified, Development branch.
The cancel function was commented as the rest of the scripts.
https://github.com/threefoldtech/tfgrid-sdk-ts/blob/1ef744b41010c1353d7fdd012e270118812428ee/packages/grid_client/scripts/multiple_vms.ts#L111


Base64 Encoding data

Documentation

[X] I have consulted the documentation, and my question isn't answered there.

Nuget Package
JsonSchema.Net
Package Version
3.0.15
How can I help?  Please provide as much context as possible.
I have a field in json schema that requires the string to be in base64 encoded.
I tried to put this in format:
"definitions": {
"File": {
"type": "object",
"properties": {
"subfield1": {
"type": "string",
“format”: “base64”
}
}
}
}
but when i try to validate using the playground https://json-everything.net/json-schema , it does not work correctly even if I put invalid base64 data. I have tried using "contentEncoding": "base64" also not working. Any ideas how to make it work?
Thanks
Code of Conduct

[X] I agree to follow this project's Code of Conduct

The Json Schema specification does not define "base64" as a format specifier. So trying that isn't going to work unless the chosen schema validator has a custom implementation for a custom "base64" format.
On the other hand, the Json Schema spec defines "base64" as a content encoding, the contentEncoding keyword is an annotation, not an assertion. The current Json Schema validation spec goes even so far as to stipulate that schema validators shall not do contentEncoding-based parsing/decoding/validation by default. And even if a validator is doing a contentEncoding-based validation, the particulars of the validation and the returned results is left unspecified by the spec. (https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-01#section-8.2). So, this is also not looking too great, either...

Any ideas how to make it work?

Yes. RFC4648-conforming Base64 is a rather simple data format with a very specific and limited set of characters, arranged in 4-character tuples (https://datatracker.ietf.org/doc/html/rfc4648#section-4 ). This can be relatively easily modelled by a regex:
The case-insensitive pattern for one full un-padded 4-char tuple is basically: [a-z0-9+/]{4}.
The last 4-char tuple (or the single tuple if the decoded data is <= 3 bytes in length) however can be a full or padded in the form of XX== or XXX=, the regex pattern for the last tuple in the encoded Base64 string thus being (with white-spaces for legibility): ( [a-z0-9+/]{4} | [a-z0-9+/]{2}(=|[a-z0-9+/])= )
Therefore, the full regex pattern that matches non-empty Base64-strings (that will always consist of one or more 4-character tuples):
(?i)^([a-z0-9+/]{4})*([a-z0-9+/]{4}|[a-z0-9+/]{2}(=|[a-z0-9+/])=)$

(No guarantee about me not making a silly error here when plonking down the regex pattern here. Please do verify it yourself before putting into production code...)

Thank you for the detailed response. The regex works fine :)

The Json Schema specification does not define "base64" as a format specifier. So trying that isn't going to work unless the chosen schema validator has a custom implementation for a custom "base64" format.
On the other hand, the Json Schema spec defines "base64" as a content encoding for the contentEncoding keyword. But the contentEncoding keyword is an annotation, not an assertion. The current Json Schema validation spec goes even so far as to stipulate that schema validators shall not do contentEncoding-based parsing/decoding/validation by default. And even if a validator is doing a contentEncoding-based validation, the particulars of the validation and the returned results is left unspecified by the spec. (https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-01#section-8.2). So, this is also not looking too great, either...

Any ideas how to make it work?

Yes. RFC4648-conforming Base64 is a rather simple data format with a very specific and limited set of characters, arranged in 4-character tuples (https://datatracker.ietf.org/doc/html/rfc4648#section-4 ). This can be relatively easily modeled by a regex pattern (using the pattern keyword instead of format).
The case-insensitive pattern for one full non-padded 4-char tuple is basically: [a-z0-9+/]{4}.
The last 4-char tuple (or the single tuple if the decoded data is <= 3 bytes in length) however can be a full 4-char tuple or padded tuple in the form of XX== or XXX=, the regex pattern for the last tuple in the encoded Base64 string thus being (with white-spaces for legibility): ( [a-z0-9+/]{4} | [a-z0-9+/]{2}(=|[a-z0-9+/])= )
Therefore, the full regex pattern that matches non-empty Base64-strings that consist of one or more 4-character tuples:
(?i)^([a-z0-9+/]{4})*([a-z0-9+/]{4}|[a-z0-9+/]{2}(=|[a-z0-9+/])=)$

If the schema you are designing should be interoperable/compatible with various different schema validators (which is probably a good idea to follow regardless of whether you have this particular requirement right now or not), it's preferable to not use the (?i) inline-flag in the regex pattern (as it is not part of the ECMAScript/JavaScript regex dialect the Json Schema regex specification for the pattern keyword refers to). Instead, use both the a-z and A-Z ranges in the character classes to achieve case-insensitive matching, like for example so:
^([a-zA-Z0-9+/]{4})*([a-zA-Z0-9+/]{4}|[a-zA-Z0-9+/]{2}(=|[a-zA-Z0-9+/])=)$

(No guarantee about me not making a silly error here when plonking down the regex pattern here. Please do verify it yourself before putting it into production code...)

Please read through the documentation.  You will find that @elgonzo's response is correct.
Another solution is to create a custom format.  Information for doing so can be found in the linked documentation.


test lazy resampling

requires the latest dev
by default the resampling is using the pytorch backend, using
BUILD_MONAI=1 within a monai docker container can trigger monai's precompiled resampling backend

/integration-test


Feature Request: pkg update after rebuilding repo

Is it possible for synth to do a "pkg update -f" after rebuilding the repo?
Once the synth repo is rebuilt, "pkg stats" does not show the correct numbers until after you run that command.

You're assuming a repository is a person, one machine thing.
The common model is that machine X builds the repository, it gets uploaded to a server, and many pkg clients subscribe to it.
Your requires serves the case where Machine X builds the repository, doesn't upload it, and a local instance of pkg subscribes to the local repository.
Moveover, machine X could be responsible for building multiple repositories, none of which are meant for the local machine.  Plus there's no guarantee that the pkg's conf file is pointing the the repository it just built.
Do you see what I'm getting at?

You're assuming a repository is a person, one machine thing.
The common model is that machine X builds the repository, it gets uploaded to a server, and many pkg clients subscribe to it.
Your requires serves the case where Machine X builds the repository, doesn't upload it, and a local instance of pkg subscribes to the local repository.
Moveover, machine X could be responsible for building multiple repositories, none of which are meant for the local machine.  Plus there's no guarantee that the pkg's conf file is pointing the the repository it just built.
Do you see what I'm getting at?

I see what your getting at, but I believe a lot more people use Synth for case #2 than you may realize.
What harm could come from running that command in either of those cases? Are they not going to get updated anyways when a package is installed in the local system?

I see what your getting at, but I believe a lot more people use Synth for case #2 than you may realize.
What harm could come from running that command in either of those cases? Are they not going to get updated anyways when a package is installed in the local system?


(PUP-9936) Change deviceconfdir section to agent

Setting $deviceconfdir in the main section makes puppetserver want to create it, which it shouldn't.
Starting puppetserver with an affected puppet version fails because of this. Changing the section of $deviceconfdir to agent fixes the issue.

@gimmyxd the only change needed in .travis.yml was to add openjdk8 since Xenial defaulted to 11 and tests failed on it. We don't need trusty since 6.0.x does not test against ruby 1.9.

CLA signed by all contributors.


questions on dns-sd and the host_addresses list

I am running the nmos-cpp-registry on a couple of raspberry pi-based systems and getting different behavior.
My simple test  for some level of working is to start the registry on the raspberry pi, run the Riedel NMOS explorer on a windows PC and see if the registry appears as a node in the explorer. On one system, this passes, on another, it does not.
On the system under test that works, there are 2 network interfaces. One is for a static address on a subnet which does not have a dhcp server or a dns server. The other network interface is the wifi and this is connected to a subnet with dhcp and dns services. The windows PC is connected to both subnets.
The other system under test just has the static address an a subnet without dhscp or a dns server. For the most part, the NMOS explorer does not see the nmos-cpp-registry. Sometimes, it seems to find it via P2P but mostly not.
On the first system under test, if the wifi is turned off, then it seems to behave like the second system.
So I assume I need a dns server in the subnet for this to work on both configurations.
My second question is that I start the registry with a host_address of the static ip address and an host_addresses list of just the static ip address but on the system with the wifi turned on, it still seems to send information out on the wifi interface even though that interface is not in the list of host_addresses. I was thinking that the host_addresses list was the list of interfaces which could be used for nmos-cpp-registry related traffic but it seems to use all the interfaces on the system even though I thought I was telling it not to.
Apparently, I don't understand what the purpose of specifying a list of host_addresses. So my second question is if the host_addresses list is a subset of all the interfaces on the system, should the registry be using any interfaces which are not in the indicated subset?
Thanks.

Looks like the wifi did not matter. It was tried again and the explorer took some time (17 seconds) but it eventually found the registry.
On another PC though, it could not find the registry. Wireshark seemed to show that the mdns packets were not getting in. Looking into whether the switch is keeping these out.
Still want to know about what effect host_addresses is supposed to have.
Thanks.

First off, investigating DNS-SD advertising and browsing vagaries on different platforms with the various, variously buggy, implementations, and different network environments, has been by far the biggest time sink on this project. So I feel your pain.
From settings: https://github.com/sony/nmos-cpp/blob/6434665c3414d6c785d3300e8b343ba7e03fade4/Development/nmos/settings.h#L54
Setting host_addresses is primarily about what is advertised in the JSON and HTTP response headers.
As it stands mDNS advertisements are not limited to particular interfaces.

Good enough. I guess there is a reason they call them demons. :)
Thanks for your help.

Ha ha ha! 😀
Always very happy to look at docs or code PRs if there's something we can do better!


Just curious... how has it performed for you?

I spent a few hours working on something similar to this and was curious to see if anyone has had any luck with something like this. Its a simple enough concept, and a good algorithm could work well, but I wonder how well it will work given that coinbase doesn't have very quick transfers... usually it takes a couple days before the coin is yours to sell.

I wrote this years ago when transactions were fast and almost free, I'm surprised it keeps getting traffic.  The algorithm specified in the README doesn't work, you can prove it to yourself with this script: https://gist.github.com/pirate/eac582480aa34b5adda9e6adc1878190


Team3 Review: Constraint Mentioned As Requirement

Throughout the SRS and in the requirements, it is mentioned that this is an iOS app, however this should have been stated with rationale within the constraints. The rationale was provided in the requirements section, however this is not where it belongs.
TAs: @NickCapstone @tomashetMcMaster

Added a system constraint for OS's.