PhantomData is too verbose in safe code

PhantomData often feels more verbose than it ought to be, especially when it's needed just to satisfy "unused type parameter" errors in fully safe code, rather than to uphold (rarer, trickier) unsafe-code invariants.
In particular, it seems like I often end up writing types that could have very simple declarations – tuple-like or unit structs where all fields are public and all clients use the built-in constructors directly, too simple to need any specialized methods – if not for the fact that there's a type parameter, unused in the struct itself, that needs a corresponding PhantomData field.  Just because of that, I have to declare a ::new method (in order to avoid making clients pass PhantomData themselves, which is ugly), and destructuring becomes uglier.
As a concrete example, in this code, a type parameter is needed to serve as an associated item for an impl.  I've omitted the bounds, but basically Vecish has to implement FromIterator and IntoIterator on the same element type.
// error: unused type parameter
pub struct Repeat<Con, Vecish>(/*count*/ usize, /*inner*/ Con) where ...;
impl<Con, Vecish> Construct for Repeat<Con, Vecish> {
    type NativeTy = Vecish;
    ...
}

I'd like to be able to just write Repeat(123, foo) (assuming type inference can figure out the parameter), but that declaration complains about an unused type parameter, so I have to stick in a PhantomData:
pub struct Repeat<Con, Vecish>(/*count*/ usize, /*inner*/ Con, PhantomData<Vecish>) where …;

In the same project, I have a marker type that has no actual data, but is cluttered with a PhantomData:
pub struct IntFormat<IntTy>(PhantomData<IntTy>);

Although I mostly just use this type as a type rather than creating instances of it, there are cases where it could be handy to accept it as a function argument (not type parameter), mainly just because it looks nicer that way.  That would be trivial if it were a unit struct; as it is, though, I have to either write a ::new method for a zero-sized type (ew), or avoid the approach altogether.
Yet another example: in this struct, I have no fewer than three PhantomData fields (although I suppose I should be able to combine them into one - but still).  In this case, unlike the last two, all the type parameters can be inferred just by looking at the argument, so inference should almost always be possible rather than sometimes needing turbofish.  Anyway, once again I'd like to have a one-field tuple struct and be able to write NestedConstructDec(|d| whatever), but instead I need a ::new to supply the PhantomDatas.
struct NestedConstructDec<'a, NativeTy, D, DecodeFunc>
    where D: Decoder<'a>,
          DecodeFunc: FnOnce(&mut D) -> Option<NativeTy> {
    pd1: PhantomData<*const NativeTy>,
    pd2: PhantomData<*const D>,
    pd3: PhantomData<&'a ()>,
    decode_func: DecodeFunc,
}

My preferred solution
Allow explicitly declaring (in)variance on type parameters somehow, removing the need for errors if they're unused.  After all, PhantomData is a pretty quirky way to declare variance.  It was designed largely with unsafe code in mind (typical example: a lifetime parameter goes unused because the implementation uses raw pointers), and there it makes sense, because it's easy to screw things up and end up with unsoundness, and PhantomData handles variance, auto traits, and drop check all in one.  But in safe code, auto traits and drop check are not a big deal (the compiler will complain if I try to do anything illegal).  And as for variance, well, most of the time I have no need for variance, but the 'idiomatic' way to indicate that to the compiler is with a PhantomData of a raw pointer – which is extremely surprising, to say the least, and hard to understand and remember.  In fact, I got the last example wrong due to misremembering which kind of raw pointer provides invariance (*mut does but not *const; was that different at some point in the past?).
Alternatives

Do nothing.  (Maybe I should just stop writing code like this.)
Create some weird syntax for 'fake' fields that are be left out when creating or destructuring a struct.  For regular structs, using _ in place of a field name could work:

struct Foo<T> { _: PhantomData<T> }

…but that wouldn't work for tuple-like structs.

Make destructuring programmable.  After all, you can already simulate tuple-like struct constructors, by declaring a type with the same name as a fn.  For example:

struct FakeTupleStruct<T> { a: i32, b: i32, pd: PhantomData<T> }
fn FakeTupleStruct<T>(a: i32, b: i32) -> FakeTupleStruct<T> {
    FakeTupleStruct { a, b, pd: PhantomData }
}

But the true nature of the struct will be revealed if a client tries to use FakeTupleStruct(a, b) in a pattern.  If there were a way to make that work, my PhantomData issues could be fixed transparently from the client's perspective - maybe with a macro to make it more ergonomic for the declarer.
I think programmable destructuring would be a great feature in general, but for this issue it's basically just a workaround.

I'd think pub struct IntFormat<IntTy>(_: PhantomData<IntTy>); could parse just fine, no?
Do we know enough about subtyping to rule out declaring inheritance situations in the Go-like Foo { _: Bar} style or we know that this usage would not conflict?
What about an Omitable trait for types with exactly one value, like PhantomData, that permits skipping that value in creation and match?  Or a  struct Initalizer<T, const T>(T); that initializes an omitted field?  That sounds useful elsewhere, but maybe people would prefer doing it differently.

I'd like to know why we need explicit PhantomData at all. It seems unnecessary?

It tells the compiler about the variance of the type parameters.

How?

Can Foo<&'static T> coerce into a Foo<&'a T>?

Depends on how it's being used? The compiler can solve that by analyzing the code, PhantomData is a (somewhat restrictive) hint?

I'm not convinced the compiler could in fact solve that, but in any case, there are plenty of places where the compiler asks the user to provide information it could in theory figure out on its own. It could, for example, infer the signatures of functions based on their use, but that would require whole program analysis and very nonlocal inference which we don't feel would be a good experience.

Don't worry it's just NP-complete. Not too hard.

At the type level, there is no need for PhantomData if the type actually appears, but you need it if the type does not appear anywhere, like say https://github.com/rust-lang/rust/blob/master/src/librustc_data_structures/indexed_vec.rs#L125 or https://doc.rust-lang.org/src/core/ptr.rs.html#1082-1090 or read https://doc.rust-lang.org/std/marker/struct.PhantomData.html
I suspect PhantomData only exists as a value to coordinate lifetime passing properly for consumption by unsafe code, and hence the caveat "in safe code" in this issue's title.  I donno if it even helps coordinate polymorphism for types without lifetime parameters.  In any case, you set up the lifetimes for unsafe code using safe code, so you still benefit from passing around the PhantomData value.


blog: Compress OpenAI embedding by subscript and binary quantization

@VoVAllen Could you please post the link to the dataset for the OpenAI embedding subscript

https://huggingface.co/datasets/Qdrant/dbpedia-entities-openai3-text-embedding-3-large-3072-1M


Plan-290 Plan-291 : Dev conflicts

This adds the other 3 conflicts types to the list of conflicts for a session. They need to be displayed in the session conflict area of the sched screen


ErrorException in Date.php line 10: Declaration of Jenssegers\Date\Date::setTranslator() should be compatible with Carbon\Carbon::setTranslator

Today trough composer update i got this error. Probably because a new version of Carbon is being installed.
ErrorException in Date.php line 6: Declaration of Jenssegers\Date\Date::setTranslator() should be compatible with Carbon\Carbon::setTranslator
Someone got this exception?

I ran into the same problem today. It's probably because you use nesbot/carbon @ dev-master
Maybe you have minimum stability: dev in your composer.json - remove that or specifiy, that you want exactly: nesbot/carbon last stable version (1.22.1 at the moment).

This happened to me also. As a workaround, I added jenssengers/date to my composer.json and specified the version 3.2. Updating works as expected now
"require": {
        "jenssegers/date": "^3.2",
    },

Doesn't work for me

doesn't work for me

Adding: , $parts =1 to the function is the solution.
public function diffForHumans(Carbon $since = null, $absolute = false, $short = false, $parts = 1)

Can you please sort this so we aren't having to manually fix files as it completely breaks auto deployments. Thanks!


Re-add Medium Blog link to About navigation

@gmoranxyz noticed that the "Blog" link on the About section did not work.
I attempted to fix this various ways (#33 see commits), but couldn't find anything successful, so, in light of the launch later today, I've temporarily removed the link.
The core of the problem is here. nuxt-link are internal-only. I tired various configurations to change the action from nuxt-link to a, but no joy.
I'd rather leave this to the professionals given I couldn't create a hacky solution.

Thank you, @timelytree


Update https-cloning-errors.md

Why:
Partially fixes #429
What's being changed:
Fixed the existing documentation on HTTPS Cloning Errors and Cached Credentials to include the author's suggestion. Since "incorrect or out of date credentials cached" depends on the developer choosing to use password caching, I opted for extending the existing tip note instead of complementing the introductory paragraph (just to keep things within the same context).
Please note that this PR only fixes one of the possible three alterations required by this issue, as described/proposed in this comment.
Check off the following:

[x] All of the tests are passing.
[x] I have reviewed my changes in staging.
[x] For content changes, I have reviewed the localization checklist
[x] For content changes, I have reviewed the Content style guide for GitHub Docs.

👋 Thanks @casals! I'll get this triaged for review 🎉

Thanks for raising the two new issues for the remaining work on this issue 😄


Field(allow_mutation=False) doesn't have same behavior as pydantic

First Check

[X] I added a very descriptive title to this issue.
[X] I used the GitHub search to find a similar issue and didn't find it.
[X] I searched the SQLModel documentation, with the integrated search.
[X] I already searched in Google "How to X in SQLModel" and didn't find any information.
[X] I already read and followed all the tutorial in the docs and didn't find an answer.
[X] I already checked if it is not related to SQLModel but to Pydantic.
[X] I already checked if it is not related to SQLModel but to SQLAlchemy.

Commit to Help

[X] I commit to help with one of those options 👆

Example Code
import pytest
import sqlmodel
import pydantic

class MyPydanticModel(pydantic.BaseModel):
    id: str
    data: str = pydantic.Field(allow_mutation=False)

    class Config:
        validate_assignment = True

class MySqlmodelModel(sqlmodel.SQLModel):
    id: str
    data: str = sqlmodel.Field(allow_mutation=False)

    class Config:
        validate_assignment = True

class TestSuite:
    def test_pydantic_can_create(self):
        MyPydanticModel(id='abc', data="foo")

    def test_pydantic_raises_on_update(self):
        my_pyd_mdl = MyPydanticModel(id='abc', data="foo")
        with pytest.raises(TypeError):
            my_pyd_mdl.data = "bar"

    def test_sqlmodel_can_create(self):
        MySqlmodelModel(id='abc', data="foo")

    def test_sqlmodel_raises_on_update(self):
        my_sqlmdl_mdl = MySqlmodelModel(id='abc', data="foo")
        with pytest.raises(TypeError):
            my_sqlmdl_mdl.data = "bar"

Description
When setting a Field(allow_mutation=False) in combination with the required validate_assignment = True configuration on a SQLModel, the framework doesn't even allow the field to be set in the initial construction of the model. This is allowed in pydantic. I've attached a test suite that we should expect to pass, but it fails both the SQLModel specific tests.
Operating System
macOS
Operating System Details
Big Sur 11.3.1
SQLModel Version
0.0.6
Python Version
3.9.9
Additional Context
No response

Several issues have been reported about inconsistencies between sqlmodel and pydantic: https://github.com/tiangolo/sqlmodel/issues/87, https://github.com/tiangolo/sqlmodel/issues/230, etc. This particular issue is caused by these lines in main.py:
# Do not set values as in Pydantic, pass them through setattr, so SQLAlchemy
# can handle them
# object.__setattr__(__pydantic_self__, '__dict__', values)
object.__setattr__(__pydantic_self__, "__fields_set__", fields_set)
for key, value in values.items():
    setattr(__pydantic_self__, key, value)

The last line is assignment, which is forbidden by allow_mutation=False. Unfortunately, the problem is not so easily fixed, because the handling of attributes is rather complex in sqlmodel. I have fixed it here, but it feels like duct tape.

I also hope the immutatable model can be possible in sqlmodel.  The same problem is reported in stackoverflow here

Hi! Does the recent version of SQLModel (0.0.14) solves the issue? :)


[BUG] Map Will Not load - OSX

It will not load the map it just stays here and never loads. Let me know if there is any more info you might need.

Have this trouble too. Windows 7 x64. Help please


Change report year from 2023 to 2024 in contractor article

Fix auditor general report year (from 2023 to 2024)

Damn, obvious mistake.


Immutability detection.

Hi there,
how can I detect whether the instance is immutable data structure created with Immutable.js?

Right now I am checking that [obj instanceof Collection] for https://github.com/astorije/chai-immutable.
Probably not the best way to do it, but I didn't investigate much. I'll keep an eye on this thread and will add a Chai matcher to my plugin when a better answer comes in.

But I need to avoid having any direct references to Immutable.js.
It's for external library.

Detect that the obj is an Object, both "hashCode" and "equals" properties are functions.
This will be included formally in the next major version as Immutable.isValue() but you can write it yourself as a cheap detection.
If your library is calling any methods on Immutable collections (like perhaps, "get") then it's good practice to check to ensure those properties are also functions.
Does that make sense?
—
Sent from Mailbox
On Fri, Mar 27, 2015 at 1:03 PM, Jérémie Astori<EMAIL_ADDRESS>wrote:

Right now I am checking that [obj instanceof Collection] for https://github.com/astorije/chai-immutable.
Probably not the best way to do it, but I didn't investigate much. I'll keep an eye on this thread and will add a Chai matcher to my plugin when a better answer comes in.
Reply to this email directly or view it on GitHub:
https://github.com/facebook/immutable-js/issues/421#issuecomment-87073502

@leebyron hope so, thanks!

Albeeert

Thank you for reporting this issue and appreciate your patience. We've  notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.


Extend UsePythonVersion Task to allow download from gh-actions version manifest

I am a HUGE FAN of the installers provided by gh-actions. They are already set up to be used with the images.
@lmazuel here is as close to official support for pre-GA python versions as AZDO will give us. I honestly expect this to fail given all the missing crypto dependencies.

Closing the PR. These checks firing is uselessly eating the public pool.


"Livezi", "Bălăneasa", "Orășa", "Poiana", "Prăjoaia", "Scăriga" are villages in "Livezi" common, "BACĂU" county

Description : When user is typing the villages in the search bar, the locations should appear in the dropdown menu correctly spelled and with localities information (as in Law nr. 2 din 16 februarie 1968)
Preconditions : the website (https://peviitor-ro.github.io/ui.orase/) is up and runing.
After every step delete the text you typed from the search bar.

Steps 1: Click on the search bar and write "Livezi"
Expected result: In the drop down menu you find "Livezi, Bacău"

Steps 3: Click on the search bar and write "Orășa"
Expected result: In the drop down menu you find "Orășa, Bacău (Livezi)"

Steps 4: Click on the search bar and write "Poiana"
Expected result: In the drop down menu you find "Poiana, Bacău (Livezi)"

Steps 5: Click on the search bar and write "Prăjoaia"
Expected result: In the drop down menu you find "Prăjoaia, Bacău (Livezi)"

Steps 6: Click on the search bar and write "Scăriga"
Expected result: In the drop down menu you find "Scăriga, Bacău (Livezi)"


Introduce lib dir

Move all library modules under a lib dir to distinguish from other auxiliary files

done ... https://github.com/jollytoad/deno_http_fns/commit/b27db978e29e88ff1133de83785267f09dd88149


Show dialog after first run

experimental - staged here

@johnpryan can we update the text to:
"Success! While you are building with DartPad, let’s get Flutter installed in the background so that you can unlock all features (like Hot Reload). Click here to install in a new tab."

Other thoughts:

Open the link to install on a new tab vs. the same dartpad tab
Update the Install SDK link to always be Flutter install

It will be useful to add a campaign ID to the URL, so that we can track this from the website analytics.
Documentation: https://support.google.com/analytics/answer/1033863

The button on the message prompt says "OK", which is ambiguous. Can we change it to something like "Dismiss"?
And I think the message could be shorter, like:
Success!

Click here to install Flutter SDK and unlock all the features like Hot Reload.

Can we change it to something like "Dismiss"

Unfortunately, no. Here are the options we have available:

That's a bummer! What if we remove the button altogether and just have a little [x] on the top right corner?

@jayoung-lee thanks, that's updated now.


homescreen: Fix systemd service template for sed

For the record if was tested with oniro using:
SERVICE_EXEC_START_PARAMS:pn-ivi-homescreen-debug = "--f --a=/usr/share/gallery --t=DMZ-White"
SERVICE_UNIT:pn-ivi-homescreen-debug = "Requires=weston.service\nAfter=weston.service\n"
SERVICE_USER_GROUP:pn-ivi-homescreen-debug = "User=weston\nGroup=weston"
SERVICE_ENVIRONMENT:pn-ivi-homescreen-debug = "Environment=HOME=/home/weston\nEnvironment=XDG_RUNTIME_DIR=/run/user/1000"

Forwarded: https://github.com/meta-flutter/meta-flutter/pulls?q=author%3Arzr
Relate-to: https://github.com/meta-flutter/meta-flutter/pull/71
Relate-to: https://booting.oniroproject.org/distro/oniro/-/merge_requests/541
Signed-off-by: Philippe Coval<EMAIL_ADDRESS>

@rzr Ah I missed that file in the re-work.  Thanks for catching it.

@rzr sure.  Also heads up I'm working on enabling ivi-homescreen to use gatreamer by default.  So a package config override will be needed if you don't want video player support.  That is going into dunfell, then honister.


support absolute paths to golden files

Allows pointing to absolute golden files.
I need this when I want to point to an existing file or when I want to use https://github.com/gotestyourself/gotestyourself/tree/master/fs to setup a more complex set of testing files.

I've made the changes thanks for the feedback. I am still uncomfortable with the ability for the update to update absolute paths but I'll let that up to you.


UuidGenerator::generate takes EntityManager parameter, not EntityManagerInterface

UuidGenerator::generate takes EntityManager parameter, not EntityManagerInterface
Thease causes problem using EntityManager decorator, because our $em parameter is instance of EntityManagerDecorator. In addition it is a violation of Dependency Inversion principle https://en.wikipedia.org/wiki/Dependency_inversion_principle

@voff4eg thanks for reporting, we're aware and already fixing this for v3 (since it's a BC-break)

Already fixed in develop (3.0): #6599.

@lcobucci, @Majkl578 thanx


sync or replicate function not defined?

After using cordova-sqlite adapter, i get error when calling,, sync or replicate.from() function.
    this.localDB.sync(this.remoteDB, {
      live: true,
      retry: true
    });

i get error like this:
this.localDB.sync is not a function. (In 'this.localDB.sync(this.remoteDB, {
            live: true,
            retry: true
        })', 'this.localDB.sync' is undefined)

localDB is just this
this.localDB = new PouchDB('dbname', { adapter: 'cordova-sqlite'});

happens on both android and ios

It looks like you are using a custom build of PouchDB and did not include the pouchdb-replication plugin. Is that right?

pouchdb-replication i'm not using this, but was working with websql before. and what do you mean by custom build of pouchDB? i got from your repo.
Am i suppose to use pouchdb-replication plugin? I'll try..

Hm, I thought maybe you were using Custom Builds: https://pouchdb.com/custom.html. That is a very strange bug, and I'm not sure what's going on. Do you have some sample code to reproduce?

my code is very simple
let localDB = new PouchDB('tag', { adapter: 'cordova-sqlite'});
let remoteDB = new PouchDB('https://mydomain.com/tag', {adapter: 'https'});
localDB.sync(remoteDB, {
      live: true,
      retry: true
    });

simple?

OOooops, sorry i should have mentioned this
I'm using this plugin in cordova
https://github.com/driftyco/cordova-plugin-wkwebview-engine
2016-08-23 20:03:06.317 MyProject[44611:4124285] ERROR: Unhandled Promise rejection: this.localDB.sync is not a function. (In 'this.localDB.sync(this.remoteDB, {
                live: true,
                retry: true
            })', 'this.localDB.sync' is undefined) ; Zone: <root> ; Task: Promise.then ; Value: TypeError: this.localDB.sync is not a function. (In 'this.localDB.sync(this.remoteDB, {
                live: true,
                retry: true
            })', 'this.localDB.sync' is undefined)

any news? my ios app is just blocked.

I'm sorry, I don't have time to look at this right now. I have no idea why this wouldn't be working. Does it only not work in iOS, or in Android too?

I am unable to reproduce. A lot of folks seemed to have trouble figuring out how to include this in a new project, so I added some additional instructions and a full demo app to the README: https://github.com/nolanlawson/pouchdb-adapter-cordova-sqlite#usage
Please reopen if this doesn't solve your problem.


How to recretae the sphere.npy for larger point clouds of size more than 2048 points

Hi,
Very impressed to see this work and the results.
I was wondeing whether the sphere.npy strcture can be changed when using point clouds of size more than 2048.
How to recreate the spere.npy for a point cloud of size 5000,3.
Eagerly awaiting for your response.

I have a question: The method you provided seems unable to ensure uniformity on the spherical surface. @antao97


Vector indexing

vectors can be array[indexed] directly, you don't need to advance an iterator

Vector indexing used here: https://github.com/gfanti/bitcoin/commit/41ef8dd367dd3ac989c31b00befad61438b56aaa#diff-eff7adeaec73a769788bb78858815c91R977


Formulas missing when importing Excel

Describe the bug
Formulas missing when importing Excel.
To Reproduce
Steps to reproduce the behavior:

Create a Table with formulas on Excel. Save
Import to Obsidian and open the file

Device (please complete the following information):

OS: Mac OS
14.5 (23F79)

**Obsidian

Version 1.5.12

Does not support the import feature.
#8


During python installation, kernel changing is failed

Issue Type: Bug
Open new notebook, switch kernel from SQL->Python to tigger Python installation.
Kernel dropdown display: Changing kernel, during installationation, got
     Failed to change kernel. Kernel SQL will be used. Error was: Notebook process exited prematurely with error: 1, StdErr Output: The system cannot find the path specified.

Then kernel switches back SQL.
Azure Data Studio version: azuredatastudio 1.5.1-insider (6f1a03587a44b7fddc644f250116514997d95256, 2019-03-14T20:45:05.791Z)
OS version: Windows_NT x64 10.0.17763

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz (8 x 3600)

GPU Status
2d_canvas: enabledchecker_imaging: disabled_offflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onnative_gpu_memory_buffers: disabled_softwarerasterization: enabledvideo_decode: enabledvideo_encode: enabledwebgl: enabledwebgl2: enabled

Memory (System)
63.92GB (49.62GB free)

Process Argv

Screen Reader
no

VM
0%

Extensions: none

Closing due to no repro.


Including new vulnerability and p to theta curves

Purpose
The purpose of this PR is to change the vulnerability curve (K(P)) and water retention curve (to convert between P and theta) used in plant hydraulics, as well as to add in the infrastructure for adding new models for this/allowing for modularity.
#159 -- this will link to issue 159
Review checklist
I have:

followed the codebase contribution guide: https://clima.github.io/ClimateMachine.jl/latest/Contributing/
followed the style guide: https://clima.github.io/ClimateMachine.jl/latest/DevDocs/CodeStyle/
followed the documentation policy: https://github.com/CliMA/policies/wiki/Documentation-Policy
checked that this PR does not duplicate an open PR.

In the Content, I have included

relevant unit tests, and integration tests,
appropriate docstrings on all functions, structs, and modules, and included relevant documentation.

[x] I have read and checked the items on the review checklist.

bors r+

bors r+


Time execution length skewed by beforeEach and afterEach

The time metrics produced by tap result in skewed results. First, if you have a beforeEach block, the first test time will be significantly higher than subsequent subtests (even if they do the same routine). Here is an example test:
const tap = require('tap');

tap.test('check if before/after mutate test times', t => {
  t.beforeEach(done => {
    done();
  });
  t.afterEach(done => {
    done();
  });
  t.test('first test', t => {
    t.ok(true);
    t.end();
  });
  t.test('second test', t => {
    t.ok(true);
    t.end();
  });
  t.test('third test', t => {
    t.ok(true);
    t.end();
  });
  t.test('fourth test', t => {
    t.ok(true);
    t.end();
  });
  t.done();
});

Results:
TAP version 13
# Subtest: check if before/after mutate test times
    # Subtest: first test
        ok 1 - expect truthy value
        1..1
    ok 1 - first test # time=2.873ms

    # Subtest: second test
        ok 1 - expect truthy value
        1..1
    ok 2 - second test # time=0.735ms

    # Subtest: third test
        ok 1 - expect truthy value
        1..1
    ok 3 - third test # time=0.625ms

    # Subtest: fourth test
        ok 1 - expect truthy value
        1..1
    ok 4 - fourth test # time=0.564ms

    1..4
ok 1 - check if before/after mutate test times # time=17.921ms

1..1
# time=24.71ms

You will see in the results that the first test time is 2.609ms while the subsequent tests are 0.73ms, 0.635ms, and 0.836ms respectively. If we subtract the times from tests 2-3 we see that test 1 is 0.408ms which is closer, but still too fast for it to be right. All the tests do the exact same routine (t.ok(true) ) so I am expecting a time range between 0.6 to 0.8 seconds.
Now, if we introduce an afterEach delay we see that each test adopts the afterEach time delay for it's time metric:
const tap = require('tap');
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));

tap.test('check if before/after mutate test times', t => {
  t.beforeEach(done => {
    done();
  });
  t.afterEach(async done => {
    await delay(500);
    done();
  });
  t.test('first test', t => {
    t.ok(true);
    t.end();
  });
  t.test('second test', t => {
    t.ok(true);
    t.end();
  });
  t.test('third test', t => {
    t.ok(true);
    t.end();
  });
  t.test('fourth test', t => {
    t.ok(true);
    t.end();
  });
  t.done();
});

Results:
TAP version 13
# Subtest: check if before/after mutate test times
    # Subtest: first test
        ok 1 - expect truthy value
        1..1
    ok 1 - first test # time=507.917ms

    # Subtest: second test
        ok 1 - expect truthy value
        1..1
    ok 2 - second test # time=505.286ms

    # Subtest: third test
        ok 1 - expect truthy value
        1..1
    ok 3 - third test # time=503.668ms

    # Subtest: fourth test
        ok 1 - expect truthy value
        1..1
    ok 4 - fourth test # time=502.596ms

    1..4
ok 1 - check if before/after mutate test times # time=2027.743ms

1..1
# time=2031.953ms

In this example, each adopt the 500ms timing from afterEach and the first test is no longer a multiple of each other test.
The expectation is that each test time metrics is reflective of just the test itself, independent of beforeEach/afterEach.

Hello,
I have the same very annoying behavior, I have lost two days on this issue.
afterEach is triggerring before the end of my test without any reason.
I have to add the await delay(XXX) trick too, but i don't think it's the better approach.
Any help would be appreciated.
I'm using tap 15.0.0
PS: Thank you @ematta for having created this issue 👍

Not an issue in tap 18.  Get it with npm i tap@pre.  Be sure to review the changelog, as there have been many many updates in this version.


⚠ Minecraft has degraded performance

In 029081e, Minecraft (https://www.minecraft.net) experienced degraded performance:

HTTP code: 200
Response time: 1009 ms

Resolved: Minecraft performance has improved in cf3fcc9.


Expose hostname property in request object

@wawjr3d - based on what we discussed

cool stuff @rashmiraman! can you update the docs here https://github.com/bloomberg/brisket/blob/master/docs/brisket.requestobject.md too?

Thanks @wawjr3d  - I've updated based on your comments

looks good


Service Catalogue - Contact confirmation message is too short

When you contact CloudOpting through the contact form, the message received is too short and lacks explanation.
Instead of:
"Dear /Name/,
Message:
/ Message sent to CloudOpting/
has been sent."
It should be:
"Dear (Name),
We have received the following message, with ID (ID of the message), from you:
(Message sent to CloudOpting)
We will get back to you with an answer as soon as possible.
Kind regards,
CloudOpting Team"

I made the change, but I cannot test it locally because the captcha is not working when running the application from localhost and the "Send message" button is not enabled:

Added localhost and dev.cloudopting.org to the list of allowed domains for our recaptcha key.

Closed - commit 39923f7214b1bd863108496012b67f9616d0df49


Support of css classes and styled components (beta)

This PR adds allows to use the className attribute in PIXI components and refers to classes defined in css files as if you would do while working with HTML DOM applications. This introduces also CSS media queries, CSS animations and transitions and the support for styled-component library.
Related issue (if exists): #155

@inlet can't see the logs to figure out while is failing

Looks super neat! 👏 for the great work so far.
But having extra dependencies (like gsap for instance) is not really desirable.
Maybe it's a good idea to have this css-support as a separate package?

Hi,
thank you for the appreciation. Gsap is not required unless you want to use
css transitions, the code contains conditions in order not to break if it
is not a peer dependency in your project
On Wed, 13 Nov 2019 at 10:15, Patrick Brouwer<EMAIL_ADDRESS>wrote:

Looks super neat! 👏 for the great work so far.
But having extra dependencies (like gsap for instance) is not really
desirable.
Maybe it's a good idea to have this css-support as a separate package?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/inlet/react-pixi/pull/164?email_source=notifications&email_token=AALLTDFEXE3FXOP3VO7E6S3QTPASTA5CNFSM4JMVLTVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOED5NV6I#issuecomment-553310969,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AALLTDCAXMCAA6DNK6JREI3QTPASTANCNFSM4JMVLTVA
.

There is a check that whenever a css contains code that is meant to use animations but gsap is not installed, it triggers a console error

And when we bundle the umd version which is used via CDN, does it contains the gsap and deepmerge libs as well? I'd like to keep the footprint as small as possible

I really like it, but it feels more like to have it available through an addon instead of merging it with the core code base. What do you think?

Here's the full log.
Netlify's build

10:31:49 AM: Build ready to start
10:33:54 AM: ⚠  warning
10:33:54 AM: Treating warnings as errors because process.env.CI = true.
10:33:54 AM: Most CI servers set it automatically.
10:33:54 AM: ✖  fatal     Failed to compile.
10:33:54 AM: ✖  fatal     Error: ./src/cssManager/cssSource.js
10:33:54 AM: Module not found: Can't resolve 'gsap' in '/opt/build/repo/src/cssManager'
10:33:54 AM: ./src/cssManager/tweens.js
10:33:54 AM: Module not found: Can't resolve 'gsap' in '/opt/build/repo/src/cssManager'
10:33:54 AM: ./src/cssManager/tweens.js
10:33:54 AM: Module not found: Can't resolve 'gsap/PixiPlugin' in '/opt/build/repo/src/cssManager'
10:33:54 AM:     at /opt/build/repo/node_modules/docz-core/dist/index.js:1311:21
10:33:54 AM: error Command failed with exit code 1.

What I can do is to make certain that unless gsap is imported in the project, it won't be part of the bundle, and like I said, the applications handles the expection and only trigger a console error isn case on your css rules there is one that uses animationName or transitionProperty.
About inmerge I might be able to remove it from the package, even though it is quite small

Having gsap imported based on usage-detection in your project bundle works if you use a bundler like webpack and use reactpixi with node, but reactpixi is also used via CDN (like unpkg), meaning that we need to include gsap in the bundled output.
A solution could be to load gsap dynamically during runtime so it is not outputted in your bundle at all, but this has some other drawbacks.

I managed to remove deepmerge. Now I'll do a test with umd, but I think it would work if gsap is also loaded through CDN

Hi @inlet, I checked and the bundles are all without gsap, to the footprint only increased for the lines of code added for the actual feature. I created a project where I added all dependencies as external JS through CDN (PIXI, React, React-Pixi and GSAP) and all worked perfectly if GSAP is installed. But you're right, there is definitely a small change I can do, which is to remove the import of GSAP, as it is still checking with require if the lib exists, and we can avoid that, as this library, like PIXI and React is globally present, so we actually don't need reference to it in the project, but only a check if TweenMax is undefined or not. So, if you really feel this feature would make for a really additional change to the library I can do that in little time.  The animations are only an optional, as the real core part of this PR is being able to write PIXI component properties in css and support also mediaqueries and styled component

Thanks! Sounds great, I'll take a proper look somewhere the coming days.
btw when loading gsap from CDN, make sure to use GSAP 3 and load a fixed url (best to use unpkg as cdn).

I made the changes above. There is no import or conditional require of gsap, only the handling of its presence (or absence) in the global scope to determine whether or not to support css animations.
Therefore the lib expects gsap to be imported in the project, otherwise it returns an error if a css class refers to animation or transition properties
I checked that it works correctly with a fixed url on a cdn and it handles in the same way gsap
I also made a comparison before and after the additional feature and here's a report:
dist/react-pixi.cjs-dev.js
Bundle Size:  675.21 KB → 698.31 KB
Minified Size:  252.3 KB → 264.57 KB
Gzipped Size:  71.72 KB → 75.46 KB
dist/react-pixi.umd-dev.js
Bundle Size:  705.71 KB → 730 KB
Minified Size:  240.11 KB → 249.61 KB
Gzipped Size:  69.95 KB → 73.26 KB
dist/react-pixi.module-dev.js
Bundle Size:  674.83 KB → 697.92 KB
Minified Size:  251.97 KB → 264.25 KB
Gzipped Size:  71.7 KB → 75.44 KB
Destination: dist/react-pixi.cjs.js
Bundle Size:  108.24 KB → 120.51 KB
Minified Size:  108.2 KB → 120.48 KB
Gzipped Size:  31.63 KB → 35.35 KB
Destination: dist/react-pixi.umd.js
Bundle Size:  96.5 KB  → 106.03 KB
Minified Size:  96.43 KB → 105.91 KB
Gzipped Size:  30.11 KB → 33.34 KB
Destination: dist/react-pixi.module.js
Bundle Size:  96.36 KB → 105.85 KB
Minified Size:  96.29 KB → 105.75 KB
Gzipped Size:  30.09 KB → 33.37 KB
On average, gzipped it only adds 3/4 kb, even though it does a lot of nice (hopefully :) ) stuff
Let me know

Hi @paolotozzo,
I finally took some time to review your PR 🙌
I'd like to test the overall performance impact for this PR as it does some things during reconciliation.
A simple trick is adding code blocks around the reconciler methods and save the result in a Map variable:
hostconfig.js
export const measurements = new Map()

const start = performance.now()
// code to run
const end = performance.now()

if (!measurements.has('methodName')) {
   measurements.set('methodName', [])
}
measurements.get('methodName').push(end - start)

and log them once the tests are finished. (for this I use jest config setupFilesAfterEnv: ["./test/measure.js"])
On the master branch everything went well, but as soon as I try to run the tests with your PR some tests are failing.
failing tests:

  ● cssManager init › that it should call addMediaQueryListener when starting the cssManager

    expect(jest.fn()).toHaveBeenCalled()

    Expected mock function to have been called, but it was not called.

      115 |   test('that it should call addMediaQueryListener when starting the cssManager', () => {
      116 |     const spy1 = jest.spyOn(cssSource, 'addMediaQueryListener')
    > 117 |     expect(spy1).toHaveBeenCalled()
          |                  ^
      118 |   })
      119 |
      120 |   test('that it should call removeMediaQueryListener when removing the element', () => {

      at Object.toHaveBeenCalled (test/cssManager.spec.js:117:18)

  ● cssManager init › that it should call removeMediaQueryListener when removing the element

    expect(jest.fn()).toHaveBeenCalled()

    Expected mock function to have been called, but it was not called.

      121 |     const spy1 = jest.spyOn(cssSource, 'removeMediaQueryListener')
      122 |     stage.removeChild(element)
    > 123 |     expect(spy1).toHaveBeenCalled()
          |                  ^
      124 |   })
      125 | })
      126 |

      at Object.toHaveBeenCalled (test/cssManager.spec.js:123:18)

  ● cssManager setCSSProps › add single stylesheet generate by styled components and take last selector of the class when passing styled:true

    expect(jest.fn()).toHaveBeenCalledWith(expected)

    Expected mock function to have been called with:
      ["", "selector-2"]
    But it was not called.

      149 |     cssMan.setCSSProps('selector-1 selector-2')
      150 |     const spy1 = jest.spyOn(cssSource, 'addStyleSheet')
    > 151 |     expect(spy1).toHaveBeenCalledWith('', 'selector-2')
          |                  ^
      152 |   })
      153 |   test('when it is an update, it is not needed to add the stylesheet again', () => {
      154 |     cssMan.setProps({ styled: true })

      at Object.toHaveBeenCalledWith (test/cssManager.spec.js:151:18)

  ● cssManager setCSSProps › that it should return an object with the props set by the css

    expect(received).toEqual(expected) // deep equality

    - Expected
    + Received

      Object {
    -   "scaleX": 2,
    -   "scaleY": 2,
        "style": Object {},
    -   "y": 650,
      }

      167 |     cssMan.setProps({ styled: false })
      168 |     const cssProps = cssMan.setCSSProps('selector-1 selector-2')
    > 169 |     expect(cssProps).toEqual({
          |                      ^
      170 |       y: 650, scaleX: 2, scaleY: 2, style: {},
      171 |     })
      172 |   })

      at Object.toEqual (test/cssManager.spec.js:169:22)

  ● cssManager setCSSProps › that it should return an object with the props set by the css and any element specific prop passed as additional

    expect(received).toEqual(expected) // deep equality

    - Expected
    + Received

      Object {
    -   "scaleX": 2,
    -   "scaleY": 2,
        "style": Object {},
        "width": 300,
    -   "y": 650,
      }

      177 |       width: 300,
      178 |     })
    > 179 |     expect(cssProps).toEqual({
          |                      ^
      180 |       y: 650, scaleX: 2, scaleY: 2, style: {}, width: 300,
      181 |     })
      182 |   })

      at Object.toEqual (test/cssManager.spec.js:179:22)

  ● cssManager setCSSProps › that it should give the element a getCSSBasedProps which return an object

    expect(received).toEqual(expected) // deep equality

    - Expected
    + Received

      Object {
        "style": Object {},
    -   "y": 650,
      }

      187 |       width: 300,
      188 |     })
    > 189 |     expect(element.getCSSBasedProps()).toEqual({
          |                                        ^
      190 |       y: 650, style: {},
      191 |     })
      192 |   })

      at Object.toEqual (test/cssManager.spec.js:189:40)

  ● cssManager setCSSProps with Text type elements › Font properties should be part of the style object

    expect(received).toEqual(expected) // deep equality

    - Expected
    + Received

      Object {
    -   "style": Object {
    -     "fontFamily": "Arial",
    -     "fontSize": 10,
    -     "fontStyle": "Italic",
    -     "fontWeight": 300,
    -   },
    +   "style": Object {},
      }

      254 |     cssMan.setProps({ styled: false })
      255 |     const cssProps = cssMan.setCSSProps('text')
    > 256 |     expect(cssProps).toEqual({
          |                      ^
      257 |       style: {
      258 |         fontSize: 10, fontFamily: 'Arial', fontStyle: 'Italic', fontWeight: 300,
      259 |       },

      at Object.toEqual (test/cssManager.spec.js:256:22)

  ● cssManager setCSSProps adding the later removing classes › that it should always return the initial properties when a property is initially set by a css and then later is not

    expect(received).toEqual(expected) // deep equality

    - Expected
    + Received

      Object {
        "style": Object {},
    -   "x": 200,
      }

      282 |     cssMan.setProps({ styled: false })
      283 |     cssProps = cssMan.setCSSProps('x-200')
    > 284 |     expect(cssProps).toEqual({
          |                      ^
      285 |       x: 200, style: {},
      286 |     })
      287 |     cssProps = cssMan.setCSSProps('x-200 y-300', true)

      at Object.toEqual (test/cssManager.spec.js:284:22)

  ● cssManager setCSSProps calling tween methods for transitions or animations › that it should call the convertAnimationToTween when a css class has animation-name prop and the animation exists

    expect(jest.fn()).toHaveBeenCalledWith(expected)

    Expected mock function to have been called with:
      [{"getCSSBasedProps": [Function anonymous], "on": [Function mockConstructor], "position": {"x": 10, "y": 10}, "scale": {"x": 1, "y": 1}, "setProps": [Function mockConstructor]}, {"0": {}, "100": {}}, {"animationName": "animation-1"}]
    But it was not called.

      320 |     const spy1 = jest.spyOn(tweensUtils, 'convertAnimationToTween')
      321 |     const cssProps = cssMan.setCSSProps('animation')
    > 322 |     expect(spy1).toHaveBeenCalledWith(element, { 0: {}, 100: {} }, { animationName: 'animation-1' })
          |                  ^
      323 |     expect(cssProps).toEqual({ alpha: '0.5', style: {} })
      324 |   })
      325 |

      at Object.toHaveBeenCalledWith (test/cssManager.spec.js:322:18)

  ● cssManager setCSSProps calling tween methods for transitions or animations › that it should call the convertTransitionToTween when a css class has a transition-property prop, but only after the 1st time

    expect(received).toEqual(expected) // deep equality

    - Expected
    + Received

      Object {
    -   "alpha": "0.5",
        "style": Object {},
    -   "y": 300,
      }

      337 |     cssProps = cssMan.setCSSProps('transition y-300')
      338 |     expect(spy1).not.toHaveBeenCalled()
    > 339 |     expect(cssProps).toEqual({ alpha: '0.5', y: 300, style: {} })
          |                      ^
      340 |     cssProps = cssMan.setCSSProps('transition y-300', true)
      341 |     expect(spy1).toHaveBeenCalledWith(element, { y: 300 }, { transitionProperty: 'x,y' })
      342 |   })

      at Object.toEqual (test/cssManager.spec.js:339:22)

And could you add visual examples to the docs (mdx) using the Docz playground, thanks!

Hi @inlet, I had a look at the issue of the tests. I solved it by moving the measure definition
export const measure = new Map() measure.set('appendChild', []) measure.set('removeChild', []) measure.set('insertBefore', []) measure.set('diffProperties', []) measure.set('createInstance', []) measure.set('commitUpdate', [])
in a separate file, imported then in the hostconfig and in the setup. By doing so the tests are running fine showing also the speed results. I honestly have no idea why the failures when importing the hostconfig in the setup, not sure if this is confusing jest, I'll investigate more asap but at least in the meantime this might allow you to conduct further performance tests

Hopefully performance shouldn't be a problem though, the things that at least at a glance might  look a bit more expensive (such as the parsing of the css and creations of the initial set of objects) are done at the mounting of the stage (therefore only once at the start of the application), then an object literal is created with all the classes, therefore the speed to access a css class (which contains the props to be applied to the component)  is as fast as accessing an obj[prop]

Hi @paolotozzo
I've run several performance tests calculating the effect on the reconciler, here are the results:
appendChild:       -7.34% (slower)
removeChild:       1.68% (faster)
insertBefore:      -2.46% (slower)
diffProperties:    -1.50% (slower)
createInstance:    -39.70% (slower)
commitUpdate:      -3.32% (slower)

These numbers are not 100% accurate (removeChild for instance hasn't been changed and still gives 1.68% diff), but it does illustrate the overall performance impact ;)

As you can see above the most consuming part of the reconciliation is createInstance, which is executed on component creation. The rest is quite acceptable.
However 40% performance drop for creating component instances is huge and it also affect others that are not using this amazing feature.
Question is, can we enable/disable this feature in a way that only users who'd love to use this feature are affected by the above performance costs?
Here's a possible way to achieve this:

Add an supportCSS prop to <Stage>
Stage handles the prop and use a different reconciler src/reconciler/hostconfig-css-support.js
Maybe add a useCSSManager parameter (default = false) to createElement (src/utils/element.js) and provide true in the hostconfig-css-support.js reconciler.

Love to hear your thoughts.
Thanks!

Hi Patrick,
Glad you Mike the feature overall. The 1st option to add a prop to the
stage seems perfect. I'd also investigate because of the impact in the
creation as there might be some room for improvement (I also pointed out
that the feature is in beta, which gives to your idea about choosing or not
to use it even more sense.
I am currently away as in a holiday, I'll do it as soon as I get back
unless you already did it
El jue., 2 ene. 2020 16:03, Patrick Brouwer<EMAIL_ADDRESS>escribió:

Hi @paolotozzo https://github.com/paolotozzo
I've run several performance tests calculating the effect on the
reconciler, here are the results:
appendChild:       -7.34% (slower)
removeChild:       1.68% (faster)
insertBefore:      -2.46% (slower)
diffProperties:    -1.50% (slower)
createInstance:    -39.70% (slower)
commitUpdate:      -3.32% (slower)
These numbers are not 100% accurate (removeChild for instance hasn't been
changed and still gives 1.68% diff), but it does illustrate the overall
performance impact ;)
As you can see above the most consuming part of the reconciliation is
createInstance, which is executed on component creation. The rest is
quite acceptable.
However 40% performance drop for creating component instances is huge and
it also affect others that are not using this amazing feature.
Question is, can we enable/disable this feature in a way that only users
who'd love to use this feature are affected by the above performance costs?
Here's a possible way to achieve this:

Add an supportCSS prop to
Stage handles the prop and use a different reconciler
src/reconciler/hostconfig-css-support.js
Maybe add a useCSSManager parameter (default = false) to
createElement (src/utils/element.js) and provide true in the
hostconfig-css-support.js reconciler.

Love to hear your thoughts.
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/inlet/react-pixi/pull/164?email_source=notifications&email_token=AALLTDGQFIVS6JOC4UY6BB3Q3X65RA5CNFSM4JMVLTVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH6RHDA#issuecomment-570233740,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AALLTDHGWNZYI5U4SWJLXALQ3X65RANCNFSM4JMVLTVA
.

No worries @paolotozzo, take your time and enjoy your holiday
Cheers!

Hi @inlet
I am currently having a look at the performance results you reported.
I have two copies of the repo, in one I run the tests on master, in another one on the branch. I set the tests by using the patch, with the minor changes of having the measure definition on another file (because of the above issue of the failing test) and executing only the reconciler tests by adding  -t reconciler to the jest options. I run many times the tests manually on both copies.
I am using a macbook pro, and node v12.10.0
As it seemed the main culprit, I'll focus only on the createInstance.
First of all, I couldn't reproduce the performance impact described above. Here's the first 10 comparisons
createInstance: 1.3764605200000188 - css-support
createInstance: 1.9290204000000175 - master
createInstance: 1.4923147599999902 - css-support
createInstance: 1.8056069200000093 - master
createInstance: 1.2045227599999953 - css-support
createInstance: 1.281814839999961 - master
createInstance: 1.5772590799999897 - css-support
createInstance: 1.4509674800000356 - master
createInstance: 2.080007800000003 - css-support
createInstance: 1.4284117199999582 - master
createInstance: 1.9937948399999914 - css-support
createInstance: 1.4250312799999756 - master
createInstance: 1.908430199999998 - css-support
createInstance: 1.9615937600000053 - master
createInstance: 1.3357876799999964 - css-support
createInstance: 1.8122774799999661 - master
createInstance: 1.5586106399999835 - css-support
createInstance: 1.8411774400000558 - master
createInstance: 1.563024959999991 - css-support
createInstance: 1.4000363199999901 - master
css-support 16.090213239999957
master      16.335937639999975
In the end the branch results even 1.50% faster than master, but of course in the next 10 times it might be the other way around, but it is just to say that I couldn't find any issue.
And, looking at the code, it makes sense that it wouldn't have any impact because the cssManager is executed only if the className is used on a component (https://github.com/inlet/react-pixi/pull/164/files#diff-8003510ef51872d1108b0165983635deR67).
This somehow would already address your concern of impacting users that are not using the feature at all because there shouldn't be any additional cost of creating the component if not when interested in using the css support.
But my mistake, the only part that is currently not covered is the stage component (https://github.com/inlet/react-pixi/pull/164/files#diff-ec7947dd9ccc887abc867073e32ae2a7R110)
where there is a component cssSource that deals with the parsing of all css rules and stores them to be usable by the cssManager. This code is executed only once at the stage didMount, but as it parses all the css rules, looking for rules to be used by pixi, if there were css files, it would have impact on the application bootstrap even if then the feature is not used. So here I would make this line executed only if supportCSS is set to true (and maybe trigger a console alert to set it to true if className is applied to a component with the prop set to false). I'll make this change asap.
What do you think about it ? Did you execute the tests in a different fashion than mine, which would justify your 40% slowness ?
I found that, for example, having two shell tabs opened, when executing the tests simultaneously on the two branches rather than wait for one to end, there is a huge impact on the first one I launch caused by the second. Example, I launched the tests on master, and while jest is running, on the other tab I launch the tests on css-support branch, here's the result
"createInstance": 4.2854317199999965 master
"createInstance": 2.014077479999996 css-support
master took the double of the time!
I heard that Jest has some issues when run in more instances.
Let me know

Hey @paolotozzo @inlet , I see that this is a PR to support styling, but it's closed. Is this implemented already or just abandoned?
I'm having an issue right now, I need to apply custom styling to canvas, but can't do that, can't find any way to dig into Stage component and access canvas. If anyone knows how do do that I'd appreciate some help, thanks!


refactor: split up probes and main package

This PR refactors the program structure with the target to make easier to read and find specific parts of the code.
Sub functions are capsuled inside of other packages

:tada: This PR is included in version 1.5.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Empty structures are not supported

Should this be valid?
#[derive(Debug, Error)]
struct EmptyStruct;

Or should this have a custom Display impl (if so, docs on it would be nice).
Empty enum seems fine since that is just Void. Though I guess None is fine for the implementation of the methods there…

It works for me! You either need to provide the Display impl:
#[derive(Debug, Error)]
struct EmptyStruct;

impl Display for EmptyStruct {
    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
        /* ... */
    }
}

or give an attribute with the Display message if you want derive(Error) to write the impl:
#[derive(Debug, Error)]
#[error("...")]
struct EmptyStruct;

Ah, didn't realize the attribute worked on non-fields or variants. Thanks!


feat(*): support to register all methods for a Definition

What this PR does / why we need it:
close #343
Which issue(s) this PR is related to (optional, link to 3rd issue(s)):
Fixes #
Reference to #

Special notes for your reviewer:
/cc @gaocegege @simon-cj @hezhizhen

Release note:

NONE

/approve

/cherrypick release-0.2

/cherrypick release-0.2


Added support for toggling stats huds on mobile.

This commit adds a SetCore method called ShowStatsBasedOnInputString,
which calls the GuIService method of the same name. It also adds a new
client chat command called /togglestats, which works with the following:
/togglestats (Toggles the General stats hud)
/togglestats general (Toggles the General stats hud)
/togglestats rendering (Toggles the Rendering stats hud)
/togglestats network (Toggles the Network stats hud)
/togglestats physics (Toggles the Physics stats hud)
/togglestats summary (Toggles the Summary stats hud)
/togglestats custom (Toggles the Custom stats hud)

LGTM.

Rebooting this pull request with some changes and a less awkward fork of this repository:
https://github.com/Roblox/Core-Scripts/pull/1013


Ensure constraints are satisfied

In the past we found that VMCON was reporting that it had converged but the constraints were not accurately satisfied, although we never understood why.  To fix this we added code to ensure that the constraints were satisfied before VMCON exited.
    !  Check convergence of constraint residuals
    summ = 0.0D0
    !do i = 1,m
    ! This only includes the equality constraints Issue #505
    do i = 1,meq
      summ = summ + conf(i)*conf(i)
    end do
    sqsumsq = sqrt(summ)

    etc

    if (verbose == 1) then
      write(*,'(a,es13.5,a,es13.5)') &
        'Constraint residuals (sqsumsq) = ',sqsumsq, &
        ' Convergence parameter = ',sum
    end if

    ! Writting the step results in OPT.DAT file
    do i = 1, n
      delta_var(i) = delta(i)
    end do

    ! Comment in to write optional optimisation information output file
    !  write(opt_file, '(I5,E28.10,*(E18.10))') niter+1, abs(objf), sum, sqsumsq, conf, x, delta_var

    !  Exit if both convergence criteria are satisfied
    !  (the original criterion, plus constraint residuals below the tolerance level)
    !  Temporarily set the two tolerances equal (should perhaps be an input parameter)
    sqsumsq_tol = tol

    ! Store the lowest valid FoM (ie where constraints are satisfied)
    if (sqsumsq < sqsumsq_tol)  lowest_valid_fom = min(lowest_valid_fom, objf)

The line that actually checks for convergence:
    if ((sum <= tol).and.(sqsumsq < sqsumsq_tol)) then
      if (verbose == 1) then
        write(*,*) 'Convergence parameter < convergence criterion (epsvmc)'
        write(*,*) 'Root of sum of squares of residuals < tolerance (sqsumsq_tol)'
      end if
      exit_code = 1
      return
    end if

(original branch)
Proposed solution
It might help to add this additional convergence test to pyvmcon.  One could also add a new line to the input code to allow sqsumsq_tol and tol to be input separately.
@jonmaddock @timothy-nunn

Just as an example, in the large tokamak regression test the constraint residuals are five orders of magnitude larger than the convergence parameter:
 Square root of the sum of squares of the constraint residuals     (sqsumsq)                 5.639E-05  OP
 VMCON convergence parameter                                       (convergence_parameter)   5.589E-10  OP

In this run the error tolerance for VMCON is epsvmc = 1e-7.
The convergence parameter is given in the Crane report:

The constraint residuals are $c_i$, the Lagrange multipliers are  $\lambda_i$ and the superscript $j$ represents the iteration.  Somehow several of the Lagrange multipliers have become very small.  (This input file uses f-values, so all the constraints are equalities.)
We used to output the Lagrange multipliers - perhaps we should start doing so again.

Separate issues
This is related to my work on ensuring that the inequality constraints are completely satisfied (zero tolerance), whilst the equality constraints are allowed some tolerance (as in the current convergence criterion). The PR for this will be created shortly on the PyVMCON repository, as it is required for reliability analysis work. In my view, this should be merged separately.
The optional output of all terms in a .csv file is a good idea, and could also be handled separately.
However, the main point in this issue as I understand it is the possibility that a solution may be "converged" according to the original convergence criterion whilst having significantly large equality constraint residuals (as Michael reports above, "five orders of magnitude difference"). This is due to the Lagrange multipliers $\vec{\lambda}$ being sufficiently small as to reduce the effect of the constraint residuals in the convergence criterion, as Michael states.
Small Lagrange multipliers
At the solution, the Lagrange multipliers $\lambda^{*}$ are defined as:
$$\frac{df^{*}}{dc}(c) = \lambda^{*}(c),$$
where $f^{*}$ is the objective function at the solution. This can be interpreted as quantifying the effect on the objective function at the solution of tightening or loosening a constraint $c$ (for a given value of the constraint). $\lambda \ne 0$ only for "active" constraints; constraints that, when varied, change the objective function at the solution. In other words, the solution is "on" the constraint.
In the convergence criterion, $\lambda c$ gives the expected change in the objective function as a result of the constraint not being satisfied ($c \ne 0$). For $\lambda c \ne 0$, $\lambda \ne 0$ (constraint is active) and $c \ne 0$ (violated by some amount in the case of an equality constraint, satisfied or violated in the case of inequality). For a satisfied inequality constraint, $\lambda = 0$.
So, a small $\lambda_i$ implies that its corresponding constraint $c_i$ is active (practically always the case for equality constraints), but varying it doesn't dramatically affect $f$. At the solution, if the constraint is violated by a small amount (practically always the case for equality constraints), $\lambda_i c_i > 0$, but the contribution is small.
Effect of original convergence criterion
Using $\lambda_i c_i$ in the convergence criterion allows constraints that are less influential on the objective function (lower $\lambda_i$) to be violated more (larger $c_i$). This explains Michael's observed difference in orders of magnitude between a large sqsumsq and a small convergence_parameter; the (large) violated constraints have little effect (small Lagrange multipliers) on the objective function, so the solution is allowed to converge despite the large residuals.
Potential drawback
Whilst I think this is clever, if I'm not mistaken I think there is a drawback to this approach: $\lambda_i c_i$ only considers the effect on the objective function, not on the position of the solution $\vec{x}$. For example, allowing a constraint to be violated in a converged solution because it may not have much effect on the value of $f(\vec{x})$ is fine if you are only concerned about the value of $f$. However, allowing the constraint to be violated might have a large impact on the value of $\vec{x}$, the solution vector. In this case, the Lagrange multipliers might look like
$$\frac{d\vec{x}^{*}}{dc}(c) = \lambda^{*}(c),$$
instead, but I fear this is unnecessary.
Michael, forgive me if I've just caught up with you.
Possible solution
Taking on board Michael's original suggestion of a separate sqsumsq_tol (or alternative equality constraint tolerance), I wonder if it might be worth dropping the Lagrange multipliers altogether in the convergence criterion, and simply using sqsumsq < sqsumsq_tol instead. However, the Lagrange multiplier do help guard against the opposite situation where a slightly violated constraint $c_i$ has a large effect on $f$ (large $\lambda_i$); this would "get through" the sqsumsq < sqsumsq_tol test if it were the only requirement in the convergence criterion.
I therefore agree with Michael that an equality constraint tolerance (perhaps for each equality constraint individually, as per other solvers) should be added to the existing convergence criterion to ensure a certain level of equality constraint residuals is respected, irrespective of the Lagrange multipliers. This would also address the problem in the "potential drawback" section too, I believe.
Summary

Add a zero-tolerance inequality constraint check to the convergence criterion
Write out solution variables in .csv
Add a specific equality tolerance to the convergence criterion

Sounds good.  I would advise doing the zero-tolerance inequality check and the equality constraint check separately and testing each time since I have no idea what the zero-tolerance inequality check will do.


Enable possibility to use a jQuery element for scrollspy target

Currently it only allows a string selector.
I am using inside an angular directive that wraps the menu that uses scrollspy. The jquery element is instantiated elsewhere, so repeating the selector for the scrollspy declaration goes against the DRY principle (if I change the id, I need to remember changing in the Javascript side):
link: function( scope, element ) {
	$( "body" ).scrollspy({
		// "element" is the target I want to use here,
		// there is no need to repeat the selector
		target: "#chapter-menu"
	});
}

Is this something we need to leave open as a fix for v3 @cvrebert, or do we punt on it?

I edited the original post to clarify the issue.
I don't know what "punt" would mean here, but I just want to point out this is a valid use case. As far as I know Bootstrap should act as a middle man between development strategies and UI behavior, building the APIs without destroying the benefit of separation of concerns between DOM elements and behavior for other frameworks or development practices.
That is much more reasonable if the fix represents a simple change in a configuration input.

We're punting—closing—any issues that are feature requests as v3 won't be having any new features on account of us trying to get v4 out. I'm asking if we believe this to be a feature request or an important (bug) fix worthy of adding to v3.

hm yeah it is a feature request – that said, i'm surprised the api was like that to begin with, we're usually pretty good about accepting jquery like objects. i'll add a note for this for v4, thanks for reporting


Make Via HTML the default for LMS and Via 3

[x] https://github.com/hypothesis/via3/issues/236 - Send X% of users from LMS to ViaHTML
[x] Observe the performance of our subset of users
[x] https://github.com/hypothesis/via3/issues/237 - Remove Via 3 HTML component from Via 3
[x] https://github.com/hypothesis/via3/issues/245 - Remove the Via HTML feature flag from Via and LMS
[x] https://github.com/hypothesis/via3/issues/244 - Make LMS and Via 3 use Via HTML by default

Done!


When WTF OS is installed on 1.05 or 1.06 you lose all the new o3 settings such as 30fps mode, sharpening and noise control.

FIX
Installing wtfos after upgrading downgrades the firmware
If you update to V01.04.0000 (or similar) after rooting and then proceed to install wtfos, sometimes you can get kicked back to V01.00.0606 and loose O3 AU support. This happens because sometimes Assistant will only flash the second slot. Use the following commands in the configurator CLI:
unrd slot_1.status_successful 0
unrd slot_1.status_active 0
unrd slot_2.status_active 1
reboot
Then refresh the configurator. Health checks will come up saying slot 1 is corrupt. Press attempt fix, slot 1 will be re-flashed to the correct version.


Slug widget does not correctly use allow unicode slugs (since Wagtail 4.0)

Issue Summary
Slug widget does not correctly use the WAGTAIL_ALLOW_UNICODE_SLUGS setting when set to true and instead replaces unicode values with mappings to acii only values.
Steps to Reproduce

First, check that you have set WAGTAIL_ALLOW_UNICODE_SLUGS = False (the default)
In a Wagtail project, create any new page and enter the title Spam & ıçüş
Now, check the promote tab, and confirm it has been converted to a slug spam-icus
Now, change your setting WAGTAIL_ALLOW_UNICODE_SLUGS = True
Then, refresh your new page creation view and enter the same title Spam & ıçüş
Expected: The promote tab should show the slug spam-ıçüş
Actual: The promote tab should shows the slug spam-icus, ignoring the allow unicode setting

I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: (no)

Technical details
Originally posted by @laymonage in https://github.com/wagtail/wagtail/pull/11168#discussion_r1542436595

Wagtail version: Latest (6.1*), tested in 3.0 and this works, tested in 4.0 and this no longer works.

The issue is that stopped passing the options' unicodeSlugsEnabled value to URLify (code below). Which means that WAGTAIL_ALLOW_UNICODE_SLUGS option is effectively ignored, converting unicode to ascii.
Historically this used to be configured via window.unicodeSlugsEnabled in _editor_js.html, and we did away with in #10189. However, that happened in 5.0, so this issue has existed since before then.
Unfortunately, it looks like this broke in  510a6bf350e4124193e63b076398010a94e019d8 #8748 (Released in Wagtail 4.0).
The original code had.
const cleaned = URLify(val, 255, window.unicodeSlugsEnabled);

But when moved to client/src/utils/text.ts, it became
    const cleaned = window.URLify(val, 255);

Proposed fix
In the new SlugController we will need to pass the allowUnicode value to the urlify util AND add unit tests to cover this so that it does not break again in the future.
This, unfortunately, will mean that any sites with this setting enabled AND with draft pages (not yet published) with a title that has unicode will not be updated automatically if changed. This is a nuance of how our auto-slug field updates work (it will first check that the resolved value is the same as the slug field before doing any automatic updates to the slug field.
This is probably edge case enough that it can be addressed the release notes and it's still worth fixing.
As this has been a bug for some time though without being raised, it's possible this is not a massively used feature. We should probably consider backporting a fix to previous stable releases though.

I'll try to look at this soon but may not get a PR up before the 6.1 code freeze.


Refactor setup.py to build only wanted extensions.

This PR makes it possible to include or exclude different extensions in the python setups.
It also adds a brief overview of what is enabled by command line that should look like this:
Compiling extensions with following flags:
WITH_CPP_MODELS_TEST: False
FORCE_CUDA: False
DEBUG: False
TORCHVISION_USE_FFMPEG: True
TORCHVISION_USE_PNG: True
TORCHVISION_USE_JPEG: True
TORCHVISION_USE_NVJPEG: True
TORCHVISION_USE_FFMPEG: True
TORCHVISION_USE_VIDEO_CODEC: True
NVCC_FLAGS:

Do you believe it makes sense to add a similar report before building, to explain to the user which extensions are actually being built?

@vcarpani Thanks for the PR!
I think it's an improvement as it summarizes the variables for the users and improves the overall output. Perhaps we could review the messaging to ensure that it's clear to the user that TORCHVISION_USE_PNG==True doesn't mean that actually PNG is used. This is the only thing I feel can confuse people.
I saw you changed the names of the vars from has_* to use_*. I think that makes sense given the nature of the change.
@NicolasHug Any thoughts on the above?

Changed a bit the format, here is what it should look like:

Ok, shall I keep the same structure without the colors?

@vcarpani I'm unable to push to the branch the last changes and also update the main branch because you haven't clicked the "Allow edits from maintainers" option. Could you give access or alternatively you will need to make the last changes on your side and make sure your branch is up-to-date with main branch or else we won't be able to click the merge button on our side due to branch protection settings. Thanks!

@vcarpani I'm unable to push to the branch the last changes and also update the main branch because you haven't clicked the "Allow edits from maintainers" option. Could you give access? Alternatively you will need to make the last changes on your side and make sure your branch is up-to-date with main branch. Without this we won't be able to click the merge button on our side due to branch protection settings. Thanks!

I unfortunately cannot: https://github.com/github-community/community/discussions/5634?sort=top

@vcarpani No worries. The changes look good. You need to update the PR and merge the latest main branch. Right now the CI doesn't let me merge.

Hello, sorry to bother on this, but any news on merging this PR?

@vcarpani Literally Github doesn't let me merge it because the branch is out-of-date. Please merge one more time with main so we can do it. The problem is we need to synchronize your update because everytime someone merges something new, we need to remerge.

Sorry, next time I will use a private fork ;)

LGTM, thanks @vcarpani!
Yes please stick around, we would love to improve the situation on our building scripts. It might be worth indeed to send the PR from a different account/setup so that we can merge things easier.
To unblock others, I'll merge now. All relevant tests passed. I'll keep an eye on the tests post-merge and if something broke I'll revert and ping you.

Yes, I am also looking at the CPP part now, since we are using torchvision extensively at the company where I work, but we do not need all the modules built

@vcarpani Sounds good. I strongly recommend opening an RFC before writing any code because messing with the building scripts to exclude C++ modules is something that requires discussion as it can affect internal systems at Meta.

@vcarpani Sounds good. I strongly recommend opening an RFC before writing any code because messing with the building scripts to exclude C++ modules is something that requires discussion as it can affect internal systems at Meta.

My plan is to only make retrocompatible changes, I will make a simple PR with just one of them as an example, to see if an RFC is needed


No "make install" ?

Unless I missed something, there is no rake install or make install command available to install mruby once it's built. Looking at the homebrew formula (here: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/mruby.rb), I see that some directories are "manually" copied to the destination.
Any reason for not providing an "install" target? Any chance it could be added (with a prefix that can be changed)?

We consider the real product of mruby project is libmruby.a library and header files to embed Ruby VM in the application.
So the executable binary mruby is only a sample program for the project. That is the reason we don't have install target in the rakefile.
But we are open for the opinion. What do you really want to install, and where do you want to install?

I think what needs to be installed is everything that is in build/host after calling rake, as well as the  content of the include directory in the source tree (paying attention to the fact that build/host also has an include/mruby with a few generated header files).
This is what homebrew does. I also made mruby available as a package for the Spack package manager for high-performance computing (https://github.com/mdorier/mdorier-spack-packages/blob/main/packages/mruby/package.py) and this is what my package file does as well.


Cannot locate unread messages

Description
Since update to version 2 it is extremely difficult to locate unread messages. Please add unread option.
Devices and Versions
.63.3
2.0.2
Steps to reproduce
Attempt to locate unread channels or dms with hundreds of options.
Logs

@caesarcxiv The messages have a blue badge and different colors when unread. Please, be more specific about what you're looking for. I'm closing the issue for now.

Unread on top as an option when sorted alphabetically
On Thu, May 3, 2018, 6:50 PM Rafael Kellermann Streit <
<EMAIL_ADDRESS>wrote:

@caesarcxiv https://github.com/caesarcxiv The messages have a blue
badge and different colors when unread. Please, be more specific about what
you're looking for. I'm closing the issue for now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/RocketChat/Rocket.Chat.Android/issues/1137#issuecomment-386460274,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AMcgzBAJxWgHVBKaZ5Icv5dyAJXn-Iyyks5tu4mqgaJpZM4TcyfY
.


AuditEvent.entity slice is closed

Section Number
StructureDefinition/IHE.MHD.ProvideBundle.Audit.Recipient
StructureDefinition/IHE.MHD.ProvideBundle.Audit.Source
Issue
The slice on AuditEvent.entity is closed. It prevents adding entities (such as those described in BALP).
That slice in other AuditEvent profiles is opened.
Proposed Change
Open the slice.
Priority:

Low: Typo or other minor classification that an editor can manage. Requires no group discussion.

What is your use-case for adding more entity? It is closed because that is the two entities that are appropriate.

We want to add an entity for the transaction identifier (tracecontext) in the AuditEvent. It is related to https://github.com/IHE/ITI.BasicAudit/pull/100
For example, in IHE.MHD.SimplifiedPublish.Audit.Recipient:

the slice is open;
there's a slice for entity:transaction, but it only supports XRequestId (this is another issue, but the open slice makes it non-blocking).

In IHE.MHD.ProvideBundle.Audit.Recipient/IHE.MHD.ProvideBundle.Audit.Source:

the slice is closed;
there's no slice for entity:transaction.

Why the difference?

Thank you.

Let me know if this pull-request meets your needs. This pull-request will need committee review, may require a CP.

Hi @JohnMoehrke! Yes, that would allow us to create another slice for our use, thanks!
Let me know if there's a need to write a CP.


Source code for training the prediction model

I am wondering whether the source code of training the model used to do evaluation will be open?
Now, the model is only available as bin format at apollo/modules/prediction/data/mlp_vehicle_model.bin . Is there a way to know how the model is trained.
Thanks!

The training scripts are not open. Please fee free to compile your own features and labels to train your own model, and plug that into the evaluator_manager. Please refer to existing mlp_evaluator to write your own evaluator, and follow the instructions on https://github.com/ApolloAuto/apollo/blob/master/docs/howto/how_to_add_a_new_evaluator_in_prediction_module.md to activate your own evaluator.

@jyh0082007 we'll have the training scripts open in Apollo 2.0. Please be patient. :)

@jinghaomiao any updates on training scripts? is it open yet?


Aborting when replicate  localdb to remote db 6.4.3 but pull is working  (Replication Local to remote Not Working )

Hello,
I'm using PRN - 6.4.3
the issue is when i'm changing the localdb and start the Pouchdb.replicate(localdb,remotedb) so i'm always getting  ETIMEOUT and Doc not pushed on couchbase server.
Pouchdb 6.4.3
couchbase server  :  Enterprise Edition 5.0.1 build 5003
sync gateway : 2.0.0
{"code":"ETIMEDOUT","status":0,"result":{"ok":false,"start_time":"2018-09-27T06:10:22.869Z","docs_read":0,"docs_written":0,"doc_write_failures":0,"errors":[],"status":"aborting","end_time":"2018-09-27T06:10:24.583Z","last_seq":0}}
pouchdb:api http://xxxx.xxxx.in:4984/profile +132ms id error Error: ETIMEDOUT
at XMLHttpRequest.xhr.onreadystatechange (C:\Users\admin\Desktop\DigirecordsLite\node_modules\pouchdb-ajax\lib\index-browser.js:221)
at XMLHttpRequest.dispatchEvent (C:\Users\admin\Desktop\DigirecordsLite\node_modules\event-target-shim\lib\event-target.js:172)
at XMLHttpRequest.setReadyState (C:\Users\admin\Desktop\DigirecordsLite\node_modules\react-native\Libraries\Network\XMLHttpRequest.js:559)
at XMLHttpRequest.abort (C:\Users\admin\Desktop\DigirecordsLite\node_modules\react-native\Libraries\Network\XMLHttpRequest.js:541)
at timeoutReq (C:\Users\admin\Desktop\DigirecordsLite\node_modules\pouchdb-ajax\lib\index-browser.js:125)
at C:\Users\admin\Desktop\DigirecordsLite\node_modules\react-native\Libraries\Core\Timers\JSTimers.js:256
at _callTimer (C:\Users\admin\Desktop\DigirecordsLite\node_modules\react-native\Libraries\Core\Timers\JSTimers.js:152)
at Object.callTimers (C:\Users\admin\Desktop\DigirecordsLite\node_modules\react-native\Libraries\Core\Timers\JSTimers.js:405)
at MessageQueue.__callFunction (C:\Users\admin\Desktop\DigirecordsLite\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:351)
at C:\Users\admin\Desktop\DigirecordsLite\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:116

Did you solve this?

@d4rth-v4d3r  the issue is not solved yet due to the Pouchdb has not supported the couchbase sync gateway so we move ahead and migrate our DB.

Does this happen also for Apache CouchDb?

It's Working fine with Couchdb.


AutoHook doesnt work

It just pull back rod and cast again, when a fish bites.
I tried uninstall and reinstall but still doesnt work.

i have all weak strong and legendary on with all baits in hooking bait tag, time out 0s, nothing in fish caught tag and disabled extra


⚠ WIP:  Quickfix Import Export

Description:
The Import and reference of Media files caused errors. This is a quickfix as it imports only the units as placeholders with names, description and title.
Closes #42
Improvements

Deleted Unitcreater, media and files property on unit export

Known Issues:
Upon Import, the fileunit type gets changed to 'file' type, even if the unit before was a 'video' type.

Pull Request Test Coverage Report for Build 2658

3 of 3 (100.0%)  changed or added relevant lines in 2 files are covered.
2 unchanged lines in 1 file lost coverage.
Overall coverage increased (+0.04%) to 70.056%

Files with Coverage Reduction
New Missed Lines
%

api/src/models/Course.ts
2
87.26%

Totals

Change from base Build 2650:
0.04%

Covered Lines:
1285

Relevant Lines:
1775

💛  - Coveralls

Could you please reset package-json.lock? You didnt changed package.json.


Add pytest-cov to test extra

xref https://github.com/dask/dask/commit/464bc779e977a21b73437815bdd4c4bf61e26c03#r112313794
cc @QuLogic

Thanks for reviewing @j-bennet


Update registry cache docs to give details about an error message

We have a customer request "to update docs for registry caches to explain logging of 'error statting local store, serving from upstream: unknown blob' is not an error with the functionality of the cache but a message that the file does not yet exist in the local cache."

Propose adding this admonition to Deploy a registry server:
Note: If you see a message in the log that reads, error statting local store, serving from upstream: unknown blob, this isn't a cache error. It's a message telling you that the file doesn't exist yet in the local cache.


Unable to pass the file_path

I can't pass documents from my local desktop and unable to provide Url or file_path

@kasapu can you please specify which sample code you are running into this issue?

Hi @luzhang06 thanks for your response, I am using code in the attached path "SampleCode/Python/sample_rag_langchain.ipynb" & https://github.com/microsoft/Form-Recognizer-Toolkit/blob/0fbbc55826df93018cc9b2bc9e517b1c1c8d90de/SampleCode/Python/sample_rag_langchain.ipynb Thank You @luzhang06

@kasapu can you please share what error you see with this sample code? We support both local file and public URL as input. You can learn more here: https://python.langchain.com/docs/integrations/document_loaders/azure_document_intelligence.

@luzhang06, thank you for your response. I am trying to upload file but I am getting error as shown in below image. I tried data path and file path options. I checked file in folder and it is project folder and file is not opened. Please help me. Thank You Zhang.

@toothache any comment on this?

@kasapu it seems you are passing in the relative path which the file cannot be found.

Indeed, @luzhang06, I have passed the absolute path along but it hasn't worked as expected. I will make sure to send an email to the formrecog for further analysis. In the meantime, could you please provide me with the AI doc intelligence with any other framework GitHub repository link? I need it to demonstrate Azure AI Document Intelligence capabilities integrated with RAG to our clients. Thank You for your support and messages.

This is the most relevant one you can find. Other repos are not leveraging markdown output yet but you can probably have a try:
SDK and REST API
Quickstart: Document Intelligence SDKs – use your preferred SDK or REST API to extract content and structure from documents.
Sample code of using Layout API to output in markdown format.
Build “chat with your document” with semantic chunking
This cookbook shows a simple demo for RAG pattern with Azure AI Document Intelligence as document loader and Azure Search as retriever in Langchain.
This solution accelerator demonstrates an end-to-end baseline RAG pattern sample that uses Azure AI Search as a retriever and Azure AI Document Intelligence for document loading and semantic chunking.

Thank You much @luzhang06, I will try the links provided and will let you know if any. Thank You


Repo sequence

Similar to @nhunzaker's recent work on repo.all (or repo.parallel), this adds repo.sequence as a way to queue up a group of actions that are resolved/rejected as one unit. Since we already have support for returning a generator in an action, this is really just syntax sugar in front of that work:
let group = repo.sequence([
  repo.prepare(actionOne),
  repo.prepare(actionTwo)
])

group.onDone(function () {
  console.log('hurrah!')
})

In that example, the return value of actionOne will be passed in as an available argument to actionTwo. Another option for kicking this off is which bypasses that argument passing:
let group = repo.sequence([
  () => repo.push(actionOne),
  () => repo.push(actionTwo)
])

What kind of change does this PR introduce? (check at least one)

[x] Feature

Does this PR introduce a breaking change? (check one)

[x] No

Does this PR fulfill these requirements:

[x] All tests are passing
[x] Commits reference open issues

Related Issue

https://github.com/vigetlabs/microcosm/issues/229

Codecov Report

Merging #325 into repo-all will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           repo-all   #325   +/-   ##
=======================================
  Coverage       100%   100%
=======================================
  Files            23     23
  Lines           800    804    +4
=======================================
+ Hits            800    804    +4

Impacted Files
Coverage Δ

src/microcosm.js
100% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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

Wooah. Very cool. I can't look at it in depth right at the moment, but this is super awesome.


Add meta tag for blog RSS feed

Was referenced on Python Bytes, but the blog.pypi.org doesn't have the necessary HTML meta tags so the RSS feed is automatically picked up by RSS readers. I verified the source and it doesn't appear to have the meta tags. I wasn't able to reproduce with my own RSS reader because it auto-discovers it somehow anyways, but apparently this affects at least one RSS reader.

@mikekennedy Your RSS client should work soon! :)


too many opened file exception caused by large multipart/chunks number

Overview
I have a table-data resource with thousands of chunks.
resource.iter throw a "too many opened file" as the multipart.iter open all the streams at the same time.
Easy to solve by using a stream iterator instead.
I open a PR about this.

Please preserve this line to notify @roll (lead of this repository)

Fixed in #277


Cannot use containerized DockerComposeContainer if a remote Docker daemon is specified

A ContainerLaunchException with the following message is thrown by ContainerisedDockerCompose on startup if a remote Docker daemon is used:
Could not start container
Log output from the failed container:
.FileNotFoundError: [Errno 2] No such file or directory: <path to Docker compose file>

To reproduce:

Create a test case that uses DockerComposeContainer (as described in https://www.testcontainers.org/modules/docker_compose/).
Set the DOCKER_HOST environment variable to the location of a remote Docker daemon.
Ensure docker.client.strategy=org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy
Run the test case.

The issue seems to occur as ContainerisedDockerCompose adds Docker compose files using a bind mount - which is not supported when using a remote Docker daemon:
https://github.com/testcontainers/testcontainers-java/blob/63692d3d84d2c5e46788d0dea28acc33f4dc1d92/core/src/main/java/org/testcontainers/containers/DockerComposeContainer.java#L605

I seem to have the same issue trying to run a testcontainerstest with docker compose not installed locally.
Did you manage to find a workaround ? It seems that overriding this part of the lib for this specific use case is not possible

Are there any news about this Issue ?

If using DockerComposeContainer configured with withLocal(true), using a remote Docker daemon works fine. But this requires the Docker Compose executable to be available locally.
Would this help you @athlordJojo?

hey @kiview !
First of all, thank you for your answer!
Does this mean, that I need to include the binaries of docker compose inside my repository ?
it would be nice to have a working example.
Thank you

@athlordJojo You don't need to include binaries in your repository, your environment needs to have the Docker Compose executable available (e.g. by installing Docker Compose). In which environment are you experiencing issues?

it is currently gitlab hosted by the company for which I work, which is a completely different team. So only thing I can provide is an dockerimage which executes the tests. Would this be sufficient ?

or more detailed: would it be sufficient, if add the binary to the dockerimage which runs my tests ?

or more detailed: would it be sufficient, if add the binary to the dockerimage which runs my tests ?

Indeed, this should be the way to go.

ah ok, thanks. I will give it try!


Update adding some touchgraph demos.

I don't fully understand what's going on here, but that's mostly a feature of twiddling registers rather than using IDF functions. The demo works though, so that's pretty cool. Will obviously need some cleaning and API-ing so that it can be easily used by everyone else.


Tanka can't handle top level arrays

Having Jsonnet return an array at the top level makes Tanka fail.
This is because we unmarshal to map[string]interface{} here:
https://github.com/grafana/tanka/blob/1e37a24772d0ff5e91bc91b3a2299a5a91152fc6/pkg/tanka/parse.go#L143-L146
We should instead unmarshal to interface{}. The code that comes after that can already work with that, only some function signatures need to be adapted :)

Fixed in #321


GH-40443: [Python] Suppress python/examples/minimal_build/Dockerfile.* warnings

Rationale for this change
python/examples/minimal_build/Dockerfile.fedora:20 DL3040 warning: `dnf clean all` missing after dnf command.
python/examples/minimal_build/Dockerfile.fedora:20 DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
python/examples/minimal_build/Dockerfile.fedora:32 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
python/examples/minimal_build/Dockerfile.ubuntu:38 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`

What changes are included in this PR?

Ignore "DL3041 warning: Specify version with dnf install -y <package>-<version>." because we don't specify version.
Suppress other warnings.

Are these changes tested?
Yes.
Are there any user-facing changes?
No.

GitHub Issue: #40443

+1


Upcoming removals

Creating a tweet to promote awareness of v1beta1 API object removals. The stated API objects will only be available in the v1 API starting in 1.22. Links to the k-dev thread with more information.
cc: @mbbroberg
Wording suggestions/fixes welcome of course.
There will be several tweets, so putting a hold on this so we can select when to tweet.
/hold

/lgtm

/hold cancel

/lgtm


Update the heredoc support for embedded scripting languages

The heredoc support for the embedded scripting languages like python is
missing some of the features of the :let here document. For example,
leading indentation for the lines is not supported. This patch updates
the script heredoc support to be same as the :let command.
One difference is the script heredoc accepts '.' as the marker if the
marker is not supplied.

Supporting "trim" for the interfaces is lacking tests.

Codecov Report

Merging #5916 into master will increase coverage by 0.03%.
The diff coverage is 96.00%.

@@            Coverage Diff             @@
##           master    #5916      +/-   ##
==========================================
+ Coverage   86.24%   86.27%   +0.03%
==========================================
  Files         136      140       +4
  Lines      155482   155846     +364
==========================================
+ Hits       134088   134451     +363
- Misses      21394    21395       +1

Impacted Files
Coverage Δ

src/ex_getln.c
91.43% <90.00%> (-0.08%)
:arrow_down:

src/evalvars.c
94.95% <100.00%> (+<0.01%)
:arrow_up:

src/userfunc.c
92.75% <100.00%> (+0.02%)
:arrow_up:

src/vim9compile.c
94.86% <100.00%> (ø)

src/netbeans.c
27.20% <0.00%> (-0.23%)
:arrow_down:

src/gui.c
63.85% <0.00%> (-0.16%)
:arrow_down:

src/terminal.c
82.92% <0.00%> (-0.04%)
:arrow_down:

src/window.c
88.98% <0.00%> (-0.04%)
:arrow_down:

src/gui_gtk_x11.c
57.78% <0.00%> (ø)

src/memfile_test.c
100.00% <0.00%> (ø)

... and 8 more

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 7a1637f...df5f6b8. Read the comment docs.

Hi Bram,
On Mon, Apr 13, 2020 at 11:01 AM Bram Moolenaar<EMAIL_ADDRESS>wrote:

Supporting "trim" for the interfaces is lacking tests.

I have updated the PR with new heredoc tests for all the embedded
languages.
I have also updated the existing heredoc usage in the test scripts.

Yegappan


Table Event "RunTrigger is false" on Pages with MultipleNewLines = Yes

Bug Description
On List Pages with MultipleNewLines = Yes the Table OnAfterInsertEvent EventSubscriber is fired but empty lines always have false in the RunTrigger parameter.
Reproduce
Steps and to reproduce the behavior:

Create an EventSubscriber (see below)
Go to Customer Card
Go to  Customer Comments
Enter any text (Line No. 10000)
The Event is fired with RunTrigger = true for Line No. 10000
Cursor down, down and enter any text (Line No. 30000)
7.1. The Event is fired with RunTrigger = true for Line No. 30000
7.2. The Event is fired with RunTrigger = false for Line No. 20000

[EventSubscriber(ObjectType::Table, Database::"Comment Line", 'OnAfterInsertEvent', '', true, true)]
local procedure OnAfterInsertComment(var Rec: Record "Comment Line"; RunTrigger: Boolean)
begin
     // set a break point here and check "RunTrigger"
end;

Expected behavior
The Event is fired with RunTrigger = true also for "empty lines".
Versions:

AL Language: 5.0.312966
Tested in BC14 & 16 latest CU

Hi! Please take a minute to read the guidelines for this repository https://github.com/microsoft/AL and our collection of frequently asked questions https://github.com/Microsoft/AL/wiki/frequently-Asked-Questions .
As this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.
To open a support case, you can:

Open a support request to CSS through the PartnerSource portal
Contact your Service Account Manager (SAM) in your local subsidiary to understand what is included in your contract as of support incident and PAH (Partner Advisory Hours). Your SAM might also direct you "step by step" how to open a support request or how to get credentials, if this is the first time for you or your company

If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.


logic_rotgb_timescale inputs to directly double / halve the current speed

There are inputs for setting the speed to an absolute value, but the inputs for relatively doubling or halving the speed are missing.

Resolved via commit f561f7cb583760eb7da0d0f36da1eabc08bed6ab.


Case autoselect

-Moved session navigation logic that used to be executed in CommCareHomeActivity out into its own Android-independent class
-Added case list auto-select logic: If the autoselect flag is enabled for a module and there is exactly 1 case in the nodeset, that case will be selected for the user automatically, rather than showing an entity select screen with only 1 item in it. CommCare now automatically proceeds either to the detail confirm screen for that case, if it is defined, or to form entry if it is not.
-The new test file contains tests for both for the session navigation refactor and the case list auto-select functionality
cross: https://github.com/dimagi/commcare-odk/pull/642

Release Note: If the autoselect flag is enabled for a module and there is exactly 1 case in the nodeset, that case will be selected for the user automatically, rather than showing an entity select screen with only 1 item in it.

Nice tests and refactor. Ready to merge after fixing the minor lint warnings & code duplication that I pointed out.

@phillipm Thanks! Addressed your comments. @ctsims, do you want to do a pass before it's merged?


Move to maven repository for HeadDatabase

There seems to be an API available under mvnrepository.com to hook into and use HeadDatabase:
https://mvnrepository.com/artifact/com.github.shynixn.headdatabase/hdb-api

Added In latest commit


Add F-Droid link to ReadMe

Hi,
Please add F-Droid link to ReadMe

Hi. Thanks for the suggestion. I have submitted a request on the F-Droid repository. As soon as they publish the app, I will add a link to the F-Droid in the README.

The request was rejected due to trademark infringement.


Conda conflicts for notebook software environments

There are some conda conflicts when solving software environments for some notebooks (see https://github.com/coiled/notebooks/runs/1737519362?check_suite_focus=true for an example). @FabioRosado if you get a moment, would you mind investigating a little further?

Sure will do

Sure will do

Temporarily fixed, but we should revisit when the software environment refactor lands


return encoded url same as import.meta.resolve

updated resolvewithplus to

return this, 'file:///path/to/indexfile/file%20name%20with%20spaces.js'
rather than this, 'file:///path/to/indexfile/file name with spaces.js'

thanks