text:
call props.onChange on Form component mount to set any defaults in sc…

Reasons for making this change
This fixes #1033 where schema defaults aren't being set on any model that is being updated using the form onChange prop.
Checklist

[ ] I'm updating documentation

[ ] I've checked the rendering of the Markdown text I've added
[ ] If I'm adding a new section, I've updated the Table of Content

[x] I'm adding or updating code

[x] I've added and/or updated tests
[ ] I've updated docs if needed
[x] I've run npm run cs-format on my branch to conform my code to prettier coding style

[ ] I'm adding a new feature

[x] I've updated the playground with an example use of the feature

Hi @glasserc @n1k0
Would you be able to take a look at this PR?

Thanks for the great write-up! (And sorry for taking so long to get to this.)
My intuition is that if we use a default anywhere in the formData, then the data has changed, but if the default isn't used (because e.g. there's a value for that property already) then the data has not changed. I'd prefer to see onChange only called when the data actually changes, but I'm willing to accept something like this if figuring that out is difficult.
Looking at the code, I see that Form calls getStateFromProps in componentWillReceiveProps. Does that mean we need to add a call to onChange somewhere in that part of the lifecycle too?

Thanks for taking a look at this.
I see what you're saying about the onChange callback only being called when the data has actually changed. I can do a deep compare of the the state vs the props formData in the componentDidMount and only call onChange in this case:
  componentDidMount() {
    if (this.props.onChange
      && !deepEquals(this.state.formData, this.props.formData)) {
      this.props.onChange(this.state);
    }
  }

Would you be happy with that?
To your second point about the other lifecycle events, I think in theory onChange could be called in componentWillReceiveProps if and only if the the schema has changed. Something like this:
// Form.js
  componentWillReceiveProps(nextProps) {
    const nextState = this.getStateFromProps(nextProps);
    this.setState(nextState);
    if (!deepEquals(this.props.schema, nextProps.schema)) {
      if (this.props.onChange) {
        this.props.onChange(nextState);
      }
    }
  }

The problem with this is that unless the formData prop is cleared on the form before the schema prop is changed, it will have no effect on the internal formData state of the rjsf form. This is because getStateFromProps calls getDefaultFormState which effectively takes the current formData and merges in the default values (which wouldn't occur as they've already been set). I guess the question is: is it worth doing a deep compare of the schema on every prop change when with the current implementation it doesn't set the default in any case?

Regarding componentWillReceiveProps,  I was thinking in terms of the caller of rjsf changing the formData or schema props out from under us. If the schema adds a field with a default, or adds a default to an existing field, wouldn't that involve setting the default? But then I realized I didn't know if componentWillReceiveProps is the appropriate lifecycle method or not, and when I went to the React docs, and I see that it's being renamed to UNSAFE_componentWillReceiveProps. Oh boy. Well, maybe it's better not to rely on such a method. I get the feeling that we need to really rethink all this deepEquals stuff that we're doing all over the place, but that's way outside the scope of this PR. So let's drop this point for the time being.
One suggestion in the docs is that we update state in the component constructor. Maybe we should do the calls to onChange in the constructor -- what do you think? Otherwise, yes, doing deepEqual like you propose is fine.

Moving the componentDidMount logic into the contructor makes sense 👍  - I'll go ahead and do this with the deep equals check.
I think the correct method to use to replace componentWillReceiveProps is probably componentDidUpdate. This would involve doing a deep compare of all those props and also moving the library from react 15 to React 16.x.
For now componentWillReceiveProps is the best way to hook into the lifecycle event for changes to the schema or form data props, so I propose checking for changes to those inside there and firing onChange if required.
A bigger piece of work will be to upgrade the library to a newer version of react - a lot of the components may need to be changed. For now they are supporting the legacy lifecycle methods until version 17 albeit with the UNSAFE_ prefix which we could run this codemod to update the library.

I don't think this is the correct solution - I think rjf should expose a function to clean formData and crash if it receives unclean formData

Getting an onChange error and endless loop now with my form -- it seems like updating state in the componentWillReceiveProps is the problem. Investigating further now.

@graingert what do you mean by "clean data"? The problem I was seeing was if you had a form where you were using the onChange prop to store form state outside of rjsf and the schema contained some defaults, then your "external" form state would not reflect the defaults that rjsf sets in it's internal form state on initialisation.

@ml242 how did your investigations go? Any chance you could create a jsfiddle demonstrating the problem?

@llamamoray currently rjsf calls onChange with cleaned data immediately during construction. This shouldn't happen

authors: glasserc graingert llamamoray ml242

repo: mozilla-services/react-jsonschema-form


text:
Infer field type from const value

This change adds support for schemas that use the const keyword
without and adjacent type keyword. For example:
{
  "type": "object",
  "properties": {
    "firstName": {
      "const": "Chuck"
    }
  }
}

Signed-off-by: Lucian lucian.buzzo@gmail.com
Checklist

[ ] I'm updating documentation

[ ] I've checked the rendering of the Markdown text I've added

[x] I'm adding or updating code

[x] I've added and/or updated tests
[ ] I've updated docs if needed
[x] I've run npm run cs-format on my branch to conform my code to prettier coding style

[ ] I'm adding a new feature

[ ] I've updated the playground with an example use of the feature

@epicfaace Good idea, I've added the test

source: gharchive/pull-request

license_type: permissive

license_source: github-api


text:
Incorrect information displayed in manage user page

Steps to reproduce:

As an admin open the mange page of any user.

Expected results:
Everything is displayed correctly.
Actual results:
The username, display name and the email address are not correctly displayed. Also the user photo, location and other info are not correct or their fields are empty
Notes/Issues:
This issue is only reproducing in manage user page (as an admin), this is not reproducing in edit profile page.
Verified in FF42 (Win7) Issue can be reproduced in addons.allizom.org and addons-dev.allizom.org
Screencast for this issue: http://screencast.com/t/rGPF8qNxLp

This is the issue that @wagnerand fixed in #1023

The issue is still reproducing in addons-dev.allizom.org
Please view this screencast: http://screencast.com/t/oGmdj2j6lp

Fixed now, there was a problem with the deploy.

source: gharchive/issue

authors: andymckay madalincm

repo: mozilla/olympia

license_source: bigquery


text:
Link to blank Open Canvas template

I was expecting to find a blank Open Canvas but I can't find one. On this page above, there is the version that has questions and the version that is filled out as an example. Is there a blank template?
If so, and there is a link, I would like to suggested linking to it here in the markdown.
~This PR is just a wip and should not be merged until a real link is filled in.~

Found a blank template on Abby's twitter feed :)

LGTM

Thanks for this @mateoclarke

authors: betatim mateoclarke

repo: mozilla/open-leadership-training-series

license: MIT


text:
[BUG]: All page lines are merged into a single line

Attach (recommended) or Link to PDF file here:
pdf example link
Configuration
Osx 10.13.4
"pdfjs-dist": "^3.2.146",
Steps to reproduce the problem
public async readFile(
    pageParser: (data: PDFLine[]) => any
  ): Promise<void> {
    try {
      PDFJS.GlobalWorkerOptions.workerSrc = pdfjsWorker;
      const doc = await PDFJS.getDocument(this.pdfPath).promise;
      const pages = doc.numPages;
      for (let i = 1; i <= pages; i++) {
        const page = await doc.getPage(i);
        const data = await page.getTextContent({
          disableCombineTextItems: true,
        });
        pageParser(data.items as PDFLine[]);
      }
    } catch (err) {
      return err;
    }
  }

What is the expected behavior?
Each line of the pdf should be considered as a unique line.
What went wrong?
All lines of the page are merged into one or two lines (instead of 40+ lines). The line breaks are not properly taken into account. Please note it doesn't always happens depending on the pdf. Sometimes it works. PDFJS parsing is not regular.

"pdfjs-dist": "^3.2.146",

That version is no longer supported, please find the latest releases at https://mozilla.github.io/pdf.js/getting_started/#download

Steps to reproduce the problem

Please see https://github.com/mozilla/pdf.js/blob/master/.github/CONTRIBUTING.md (emphasis mine):

If you are developing a custom solution, first check the examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare a short well-documented example that demonstrates the problem and make it accessible online on your website, JS Bin, GitHub, etc. before opening a new issue or contacting us in the Matrix room -- keep in mind that just code snippets won't help us troubleshoot the problem.

Each line of the pdf should be considered as a unique line.

I checked a couple of different pages in that document with the browser dev-tools, calling the the getTextContent method manually, and generally it seemed that "lines" were handled correctly.
It's not really clear here which specific page(s) you're referring to!?

All lines of the page are merged into one or two lines (instead of 40+ lines). The line breaks are not properly taken into account. Please note it doesn't always happens depending on the pdf. Sometimes it works. PDFJS parsing is not regular.

That's a limitation of the PDF format itself, since in most cases glyphs are absolutely positioned and there's simply no concept of "lines" in the majority of all PDF documents.

It's not really clear here which specific page(s) you're referring to!?

All of the pages actually. For exemple, on page 1 (juste after the title page), I should receive:
lines[0].str = "INT. FITTS HOUSE - RICKY'S BEDROOM - NIGHT"
lines[1].str = "On VIDEO: JANE BURNHAM lays in bed, wearing a tank top. She's"
lines[2].str = "sixteen, with dark, intense eyes."
etc.
Instead, I receive only 2 lines. The first one has a huge width of 6559px:
lines[0].str = "INT. FITTS HOUSE - RICKY'S BEDROOM - NIGHT On VIDEO: JANE BURNHAM lays in bed, wearing a tank top. She's (...) Of course, I don't know that yet."
lines[1].str = "(CONTINUED)"
So it doesn't work. I've upgraded pdfjs to the latest version: 3.4.120.

Opening your PDF document with https://mozilla.github.io/pdf.js/web/viewer.html (using e.g. drag-and-drop) and executing await PDFViewerApplication.pdfViewer.getPageView(1).pdfPage.getTextContent() in the console gives reasonable looking results:
{
  "items": [
    {
      "str": "INT. FITTS HOUSE - RICKY'S BEDROOM - NIGHT",
      "dir": "ltr",
      "width": 294.5279999999998,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        711
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "On VIDEO: JANE BURNHAM lays in bed, wearing a tank top. She's",
      "dir": "ltr",
      "width": 427.67999999999984,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        687
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "sixteen, with dark, intense eyes.",
      "dir": "ltr",
      "width": 231.45599999999988,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        675
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "JANE",
      "dir": "ltr",
      "width": 28.04399999999997,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        252,
        651
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "I need a father who's a role model,",
      "dir": "ltr",
      "width": 245.47199999999978,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        639
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "not some horny geek-boy who's gonna",
      "dir": "ltr",
      "width": 245.47199999999978,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        627
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "spray his shorts whenever I bring a",
      "dir": "ltr",
      "width": 245.47199999999978,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        615
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "girlfriend home from school.",
      "dir": "ltr",
      "width": 196.41599999999977,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        603
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "(snorts)",
      "dir": "ltr",
      "width": 56.08799999999994,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        209.004,
        591
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "What a lame-o. Somebody really",
      "dir": "ltr",
      "width": 210.4319999999998,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        579
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "should put him out of his misery.",
      "dir": "ltr",
      "width": 231.45599999999973,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        567
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "Her mind wanders for a beat.",
      "dir": "ltr",
      "width": 196.41599999999985,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        543
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "RICKY (O.S.)",
      "dir": "ltr",
      "width": 84.15599999999989,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        252,
        519
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "Want me to kill him for you?",
      "dir": "ltr",
      "width": 196.41599999999977,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        507
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "Jane looks at us and sits up.",
      "dir": "ltr",
      "width": 203.42399999999986,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        483
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "JANE",
      "dir": "ltr",
      "width": 28.04399999999997,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        252,
        459
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "(deadpan)",
      "dir": "ltr",
      "width": 63.07199999999993,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        209.004,
        447
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "Yeah, would you?",
      "dir": "ltr",
      "width": 112.13999999999986,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        435
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "FADE TO BLACK:",
      "dir": "ltr",
      "width": 98.14799999999997,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        411
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "FADE IN:",
      "dir": "ltr",
      "width": 56.08799999999998,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        387
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "EXT. ROBIN HOOD TRAIL - EARLY MORNING",
      "dir": "ltr",
      "width": 259.48799999999983,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        351
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "We're FLYING above suburban America, DESCENDING SLOWLY toward",
      "dir": "ltr",
      "width": 427.67999999999995,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        327
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "a tree-lined street.",
      "dir": "ltr",
      "width": 140.1239999999998,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        315
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "LESTER (V.O.)",
      "dir": "ltr",
      "width": 91.15199999999989,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        252,
        291
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "My name is Lester Burnham. This is",
      "dir": "ltr",
      "width": 238.46399999999977,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        279
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "my neighborhood. This is my street.",
      "dir": "ltr",
      "width": 245.4719999999997,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        267
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "This... is my life. I'm forty-two",
      "dir": "ltr",
      "width": 231.4559999999998,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        255
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "years old. In less than a year,",
      "dir": "ltr",
      "width": 217.43999999999977,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        243
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "I'll be dead.",
      "dir": "ltr",
      "width": 91.15199999999993,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        231
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "INT. BURNHAM HOUSE - MASTER BEDROOM - CONTINUOUS",
      "dir": "ltr",
      "width": 336.5759999999998,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        195
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "We're looking down at a king-sized BED from OVERHEAD:",
      "dir": "ltr",
      "width": 371.61599999999976,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        171
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "LESTER BURNHAM lies sleeping amidst expensive bed linens,",
      "dir": "ltr",
      "width": 399.6479999999998,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        147
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "face down, wearing PAJAMAS. An irritating ALARM CLOCK RINGS.",
      "dir": "ltr",
      "width": 420.67199999999997,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        135
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "Lester gropes blindly to shut it off.",
      "dir": "ltr",
      "width": 259.4879999999998,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        108,
        123
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "LESTER (V.O.)",
      "dir": "ltr",
      "width": 91.15199999999989,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        252,
        99
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "Of course, I don't know that yet.",
      "dir": "ltr",
      "width": 231.4559999999998,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        180,
        87
      ],
      "fontName": "g_d1_f3",
      "hasEOL": false
    },
    {
      "str": "",
      "dir": "ltr",
      "width": 0,
      "height": 0,
      "transform": [
        12,
        0,
        0,
        12,
        463,
        39
      ],
      "fontName": "g_d1_f3",
      "hasEOL": true
    },
    {
      "str": "(CONTINUED)",
      "dir": "ltr",
      "width": 77.16000000000007,
      "height": 12,
      "transform": [
        12,
        0,
        0,
        12,
        463,
        39
      ],
      "fontName": "g_d1_f3",
      "hasEOL": false
    }
  ],
  "styles": {
    "g_d1_f3": {
      "fontFamily": "monospace",
      "ascent": 0.79150390625,
      "descent": -0.21630859375,
      "vertical": false
    }
  }
}

Ok, the error came from the option "disableCombineTextItems: true". Thank you very much for your help.


text:
A0 sized pdfs are extremely slow

A0 sized pdfs are extremely slow to display above 110% zoom on the viewer.
Configuration:

Web browser and its version: Chrome/51.0.2704.84
Operating system and its version: windows 10 pro
PDF.js version: 1.4.20

Steps to reproduce the problem:

upload @ viewer
zoom 130% +

What is the expected behavior? Slow rendering
What went wrong? Slow rendering
PDF:
HDR-Ashill-Land-Ltd-PDA-05-Matter-4.pdf
Above file grabbed from online @ https://www.sevenoaks.gov.uk/__data/assets/pdf_file/0005/128651/HDR-Ashill-Land-Ltd-PDA-05-Matter-4.pdf initial problem found using my own pdfs locally, was recreated using the viewer and externally sources pdf.

Update:
Also noticed occasionally when you zoom in beyond 130% and zoom back out, the image flips/mirror images. I've noticed this has been mentioned previously, with no solution, but "it works for me". I'd assume the two issues are connected via the zoom functionality.

Closing since this file renders almost instantly now after optimizations from the last few years.

authors: chrisdunne timvandermeij


text:
PDFJS fails to print on Awesomium

I'm trying to print a PDF file on Awesomium 1.7.5 on Windows 7 x64 using PDFJS (stable version 1.4.20).
I'm using WPF to launch the browser and PDFJS is loaded as an internal resource (.pak file) via an "asset://" protocol (defined by Awesomium)
Any PDF file is rendered properly by using method PDFViewerApplication.open(bytearray) since the PDF is obtained through an array of bytes. Nevertheless, when I print executing Javascript function "window.print()" blank pages are printed.

I'm using WPF to launch the browser and PDFJS is loaded as an internal resource (.pak file) via an "asset://" protocol (defined by Awesomium)

This particular setup appears "special" enough to warrant pointing to https://github.com/mozilla/pdf.js/blob/master/.github/CONTRIBUTING.md (emphasis mine):

If you are developing a custom solution, first check the examples at https://github.com/mozilla/pdf.js#learning and search existing issues. If this does not help, please prepare a short well-documented example that demonstrates the problem and make it accessible online on your website, JS Bin, GitHub, etc. before opening a new issue or contacting us on the IRC channel -- keep in mind that just code snippets won't help us troubleshoot the problem.

Furthermore, it seems unlikely that this is really a PDF.js bug; closing as INCOMPLETE/INVALID?

authors: Snuffleupagus ghost


text:
[api-minor] Add more general OpenAction support (PR 10334 follow-up, issue 11642)

This patch deprecates the existing getOpenActionDestination API method, in favor of a better and more general getOpenAction method instead. (For now JavaScript actions, related to printing, are still handled as before.)
By clearly separating "regular" Print actions from the JavaScript handling, it's thus possible to get rid of the somewhat annoying and strictly incorrect warning when the viewer loads.
Fixes #11642

/botio test

botio-windows fonttest

/botio-windows fonttest

/botio test

/botio-windows unittest

Could you elaborate a bit on how this solves the issue, i.e., why was the fallback bar shown in the first place? AFAICT we handled the print actions before too.

Could you elaborate a bit on how this solves the issue, i.e., why was the fallback bar shown in the first place? AFAICT we handled the print actions before too.

In this case the OpenAction dictionary contains a simple entry (see below), similar to other more standard Named Actions (as handled e.g. by PDFLinkService), but no actual JavaScript.
The old implementation, for history reasons probably, converted that to "fake" JavaScript; see this code.
All-in-all, it seems completely wrong to warn about a non-existent script in that case.
OpenAction (dict) [id: 34, gen: 0]
  S = /Named
  Type = /Action
  N = /Print

@timvandermeij Since I personally find that explaining things in a clear and concise way (in writing) can be difficult; did https://github.com/mozilla/pdf.js/pull/11644#issuecomment-596806448 address your question is a satisfactory way? If not, please ask again :-)

Yes, I see that the old code did not trigger on the named action itself but instead converted that named action to JS that could be executed by the browser. I'm also not entirely sure why we do that, but it does look better to not generate the "fake" JS.

/botio-linux preview

Looks really good! I have confirmed that the warning no longer appears, and separating the named action handling from the JS handling for printing also looks cleaner. Thanks!

@Snuffleupagus Can you check if the branches in openAction() are correct? if (!openAction) is checked in a number of places, but that is always true AFAICT, so I was wondering if some else in the containing branches is wrong here.

Can you check if the branches in openAction() are correct?

Sorry, but I don't really understand the question; actual links directly to the relevant code would definitely help here.

so I was wondering if some else in the containing branches is wrong here.

If you think that the current implementation is incorrect, then references to the PDF specification and/or PDF documents where the code as written isn't working would be most helpful; as-is I'm unfortunately a bit lost here...

Sorry if I was unclear. At https://github.com/mozilla/pdf.js/blob/master/src/core/obj.js#L609 openAction is initialized to null. At https://github.com/mozilla/pdf.js/blob/master/src/core/obj.js#L621 it is checked whether openAction is null (although it can't be any other value). At https://github.com/mozilla/pdf.js/blob/master/src/core/obj.js#L626 openAction is checked again, but the branch at line 625 is an else branch, so openAction couldn't be initialized at line 622, so if (!openAction) always evaluates to true again. I don't know if the current implementation is incorrect (i.e. if openAction can specify both dest and action at the same time), but I noticed the tautologies, so I thought I'd bring it to your attention.

I don't know if the current implementation is incorrect (i.e. if openAction can specify both dest and action at the same time)

The OpenAction entry in the catalog dictionary is specified here (with additional references to the format used): https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#page=82
Ignoring the specification for a moment; basically I don't think the situation you describe will ever happen in practice, at least I've never seen it, and anyway Catalog.parseDestDictionary will only extract one entry from the dictionary.

[...] so if (!openAction) always evaluates to true again.

We can't very well initialize the Object unconditionally, since we want the default case (i.e. no OpenAction dictionary present) to be easy to detect, hence the reason for initializing the Object only where necessary.

At https://github.com/mozilla/pdf.js/blob/master/src/core/obj.js#L621 it is checked whether openAction is null (although it can't be any other value). At https://github.com/mozilla/pdf.js/blob/master/src/core/obj.js#L626 openAction is checked again,

Well, generally speaking it was much easier to simply treat each individual case separately such that e.g. any future changes to this code won't end up accidentally overwriting data.

Given that the code, as written, works fine as far as I'm reading the specification it should hopefully not be necessary to make changes here (unless there's PDF examples to the contrary of course).

I don't know if the current implementation is incorrect (i.e. if openAction can specify both dest and action at the same time)

The OpenAction entry in the catalog dictionary is specified here (with additional references to the format used): https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#page=82
Ignoring the specification for a moment; basically I don't think the situation you describe will ever happen in practice, at least I've never seen it, and anyway Catalog.parseDestDictionary will only extract one entry from the dictionary.

[...] so if (!openAction) always evaluates to true again.

We can't initialize the Object unconditionally, since we want the default case (i.e. no OpenAction entry present) to be easy to detect, hence the reason for initializing the Object only where necessary.

At https://github.com/mozilla/pdf.js/blob/master/src/core/obj.js#L621 it is checked whether openAction is null (although it can't be any other value). At https://github.com/mozilla/pdf.js/blob/master/src/core/obj.js#L626 openAction is checked again,

Well, generally speaking it was much easier to simply treat each individual case separately (such that e.g. any future changes to this code won't end up accidentally overwriting data).
Ninja-edit: Basically you're saying, assuming I understand it correctly, that the it would be possible to assign openAction = Object.create(null); unconditionally. While that should work, given the current implementation, that however shouldn't mean that the existing code is thus wrong here :-)

Given that the code, as written, works fine as far as I'm reading the specification it should hopefully not be necessary to make changes here (unless there's PDF examples to the contrary of course).

Edit: Basically you're saying, assuming I understand it correctly, that it would be possible to assign openAction = Object.create(null); unconditionally in each branch. While that should work, given the current implementation, that however doesn't necessarily mean that the existing code is thus wrong here :-)

Yes, that'd be possible, if (true) is picked up by some static analyzers, btw: https://lgtm.com/projects/g/mozilla/pdf.js/?mode=list
If all is good according to the spec (and there's an OR between destination and action, so it seems so), then it's good, thanks for checking.

That's an interesting website. I'll open a new ticket to see if we can resolve some of the warnings there. Most code is probably fine, but it can't hurt to check and maybe to rewrite it a bit to not trip up static analyzers. Thanks!


text:
For missing font, use a local font if it exists even if there's no standard substitution

If the font foo is missing we just try lo load local(foo) and maybe we'll be lucky.

/botio test

Looking at the Windows bot, there's a few things that doesn't look like improvements:

firefox-issue9195-page1, there's no longer a bold font used.
firefox-issue1096-page1, firefox-non-embedded-NuptialScript-page1, firefox-issue6117-page6; no longer uses a serif-font (Adobe Reader renders these with serif-fonts).

Given some of the test "failures", should we perhaps pass in the font-flags to the getFontSubstitution-function such that we're able to better choose between serif and sans-serif fonts in the fallback?

Given some of the test "failures", should we perhaps pass in the font-flags to the getFontSubstitution-function such that we're able to better choose between serif and sans-serif fonts in the fallback?

Yep, the flags aren't available when getFontSubstitution is called but it's the idea. I'll push my update soon.

/botio browsertest

That looks better, however we still have some "problems" at least on the Windows bot:

firefox-issue9195-page1, some of the text still isn't bold as expected.
firefox-issue11915-page1, the Arial Italic font isn't working correctly (the font is named /Arial-ItalicMT,Italic).

About issue11915, I added the font in the standard font map and the "weird" aspect is because we've an italic monospace (because the font is detected as monospace).
The monospace flag is because of:
https://github.com/mozilla/pdf.js/blob/master/src/core/evaluator.js#L3961
and it's why in the last version of the patch I clear the bit if it's required.

/botio browsertest

/botio-windows browsertest

It seems that the ArialBlack has now regressed on Windows, see e.g. firefox-artofwar (many pages), firefox-issue5801-page1, and firefox-issue7835-page1.

/botio browsertest

/botio-windows browsertest

/botio makeref

authors: Snuffleupagus calixteman


text:
Performance optimizations

Hey, that's my first Pull Request here, so please do hate me :)
I dug into the code a little, analyzing performance and trying to find potential bottlenecks.
Here's what I changed:

PageViewport

I refactored function by reducing the number of calculations within the function. I simplified some calculations on basic arithmetic level: ((b + a) / 2) - a => (b- a) / 2, a * n + b * n - c * n => (a + b - c) * n etc.
After code analysis, I've optimize the order of calculations (for example, offsetCanvasX was different for different rotation solely because width was switching with height when the viewport was rotated by 90 od 270 degrees) I've managed to reduce the code necessary to output what this function is supposed to.

That resulted in 20-40% performance increase in my tests. (~80 => 50 milliseconds per 10000 runs).

log2

I replaced custom solution with Math functions.
I placed a warning that log2 function is not exactly doing what the name suggests. Didn't change the name because I didn't want to make a commotion.

While I didn't measure how the change affected the performance in pdf.js, I did a simple test on jsperf which pointed native Math.log as a clear winner with 500% performance increase.
I've decided to use Math.ceil(Math.log(x) * Math.LOG2E) instead of Math.ceil(Math.log2(x)); for compatibility reasons; virtually every browser supports Math.log, while Math.log2 is only supported in modern browsers, while giving no performance bonus whatsoever.

CanvasGraphics_paintInlineImageXObject

I rewrote the function painting image so that it would not draw a temporary image on a canvas each time it goes through a loop which purpose is to divide widthScale and heightScale by 2 as long as they are bigger than 2.

I've measured the performance after implementing this change and the difference is big. In my test file, the function was called twice. Before the change, on average runs took 347 ms and 127 ms. After the change, they took 229 and 95 ms respectively. That's 32% performance increase. Woo! 🎉

/botio-linux preview

The default PDF file (Tracemonkey) now gives the following in the console:
Error: invalid canvas size
The second page doesn't render completely anymore because of it. I assume that this is related to the CanvasGraphics_paintInlineImageXObject change. Could you check that?

Hmmmm, yeah, I suspect the same. But I'm clicking furiously through it and I can't catch this error (but I caught several others. Do you know any more details? Does it happen on a specific page or with a specific scale?

It's triggered 100% for me when opening http://54.67.70.0:8877/6116cb2945c1db9/web/viewer.html and scrolling to page 2. It happens with any scale.

Yeah, I'm on it. It happens when scale is already at 1 so it won't ever enter this loop. I'm gonna push fixes very soon.

If I were to guess, I'd say that you probably didn't run any tests locally with these patches applied!?
Just doing a quick round of testing locally, it seems that this PR causes a number of rendering regressions in existing test-cases. Please refer to https://github.com/mozilla/pdf.js/wiki/Contributing, especially the parts about "Generating reference images" and "Run testing", for more information on the subject.
The title of the PR is "Performance optimizations", but the "Optimize performance of CanvasGraphics_paintInlineImageXObject function by not creating temporary images in while loop" commit isn't just an optimization, but actually alters the logic of the code. Most likely that this commit explains the regressions, and in my opinion it should be removed from the PR (https://github.com/mozilla/pdf.js/pull/8650#discussion_r127568469 explains perfectly well why the code looks like it currently does)!
Furthermore, I'm finding the "Optimize performance of PageViewport by reducing the number of calculations within the function" to make the code somewhat difficult to follow. I'll leave the actual review to @yurydelendik, but I cannot help wonder if needs to be this complicated?

I'm going to close this pull request because log2 is already fixed in #9256, the canvas graphics commit causes regressions and the page viewport changes are currently a bit hard to follow and needs more explanation as to why it works. If you want, you can revisit the page viewport changes in a new pull request, which will also make it easier to review. Thank you.

authors: Snuffleupagus timvandermeij wojtekmaj


text:
Mouse click events are not triggered

Just add a Canvas and a button inside the demo scene with default properties.
When not in VR mode (referring to the bottom right button) the hover event is well triggered but the click is not.
Everything works fine in the editor but not in the browser.
Unity 2017.2.0p3

@cvan Thank you for your answer.
Yes, I imported the project inside Unity 2017.2.0p3 and added a canvas with a button inside the scene provided in the package, which is indeed the scene you are refering to.
I am currently using Firefox 59.0.2 (64 bits)

@fire67: could you share a sample of your code?
are you using the WebVR Player template or the WebGL Player template?
are you using our index.html, webvr.js, etc. template files?

https://github.com/mozilla/unity-webvr-export/blob/master/Assets/WebGLTemplates/WebVR/webvr.js
https://github.com/mozilla/unity-webvr-export/blob/master/Assets/WebGLTemplates/WebVR/index.html#L62-L64

thanks for the response - and helping us diagnose your issue 👍

repo: mozilla/unity-webvr-export


text:
patch expo-image-picker to support "browse" on android

See: https://github.com/bluesky-social/social-app/pull/2384
I can't guarantee some of the options that you have in there will continue to work, but they should. The only one that doesn't work is limiting the number of selections. I added a quick fix to make sure it is limited to four though.
I also didn't bother making this work to select videos but I don't think that should be an issue for you? In bsky, I added a little toast whenever a user tries to select more than four. Takes the first four and let's them know the max is four 🤷♀
Also, test before using 🙏 works fine in bsky so should here too.

tysm ❤

authors: haileyok mozzius

repo: mozzius/graysky


text:
Correct battery estimation for esp32 options

Estimated battery life is based on esp8266 power consumption, update estimates to match the new esp32 options.

Updated calculations, will monitor and see if further corrections are needed.

repo: mp-se/gravitymon


text:
ParseError on Windows

I'm in the test/documents folder, then I'm getting this on Windows:
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-w64-mingw32

julia> using Weave
WARNING: Method definition latexinline(IO, Base.Markdown.Code) in module Markdown at markdown/render/latex.jl:43 overwritten in module Weave at C:\Users\anthoff\.julia\v0.5\Weave\src\format.jl:140.
WARNING: Method definition latex(IO, Base.Markdown.Paragraph) in module Markdown at markdown/render/latex.jl:49 overwritten in module Weave at C:\Users\anthoff\.julia\v0.5\Weave\src\format.jl:126.

julia> Weave.weave("plotsjl_test.jmd")
ERROR: ParseError("extra token \"}\" after end of expression")
 in #parse#310(::Bool, ::Bool, ::Function, ::SubString{String}, ::Int64) at .\parse.jl:184
 in (::Base.#kw##parse)(::Array{Any,1}, ::Base.#parse, ::SubString{String}, ::Int64) at .\<missing>:0
 in #parse#311(::Bool, ::Function, ::SubString{String}) at .\parse.jl:194
 in parse(::SubString{String}) at .\parse.jl:194
 in parse_doc(::String, ::Weave.MarkupInput) at C:\Users\anthoff\.julia\v0.5\Weave\src\readers.jl:102
 in parse_doc(::String, ::String) at C:\Users\anthoff\.julia\v0.5\Weave\src\readers.jl:71
 in read_doc(::String, ::Symbol) at C:\Users\anthoff\.julia\v0.5\Weave\src\readers.jl:50
 in #weave#4(::Symbol, ::Symbol, ::Symbol, ::Symbol, ::String, ::Void, ::String, ::Symbol, ::Void, ::Void, ::Void, ::String, ::Weave.#weave, ::String) at C:\Users\anthoff\.julia\v0.5\Weave\src\Weave.jl:79
 in weave(::String) at C:\Users\anthoff\.julia\v0.5\Weave\src\Weave.jl:79

julia>

Ok, I guess the error there is just in the plotsjl_test.jmd file, it still uses curly brackets for options.
When I remove those, I get a new error, though:
julia> using Weave
WARNING: Method definition latexinline(IO, Base.Markdown.Code) in module Markdown at markdown/render/latex.jl:43 overwritten in module Weave at C:\Users\anthoff\.julia\v0.5\Weave\src\format.jl:140.
WARNING: Method definition latex(IO, Base.Markdown.Paragraph) in module Markdown at markdown/render/latex.jl:49 overwritten in module Weave at C:\Users\anthoff\.julia\v0.5\Weave\src\format.jl:126.

julia> Weave.weave("plotsjl_test.jmd")
INFO: Weaving chunk 1 from line 3
INFO: Weaving chunk 2 from line 12
C:\Users\anthoff\Anaconda3\lib\site-packages\matplotlib\font_manager.py:1288: UserWarning: findfont: Font family ['Helvetica'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
libpng error: Write Error
WARNING: _show is not defined for this backend. m=text/plain
INFO: Weaving chunk 3 from line 16
libpng error: Write Error
INFO: Weaving chunk 4 from line 21
libpng error: Write Error
WARNING: _show is not defined for this backend. m=text/plain
libpng error: Write Error
WARNING: _show is not defined for this backend. m=text/plain
INFO: Weaving chunk 5 from line 27
libpng error: Write Error
INFO: Report weaved to plotsjl_test.html

julia>

I unable to reproduce this, both parsing and running the code work for me without any issues. This test also passes on appveyor (#68).
Using curly braces is still valid syntax for options, although it's not required.

When I run runtests.jl, everything passes on my system. But if I just run plotsjl_test.jl, I get the error from above. So if you tried to repo this by running runtests.jl, it wouldn't show up (and I also wouldn't expect to see this on appveyor because that also just runs runtests.jl).
I have figured out the problem with parsing, I'll open a new issue for that.

I do not get the error by just running plotsjl_test,jl . I'm not use if errors with libpng are related to Weave, figures are save using Plots.savefig command.

Do you also get libpng error if you try:
using Plots
pyplot()
plot(1:10)
savefig("test.png")

Actually, the error was just caused by an outdated python installation. Sorry for the noise.

authors: davidanthoff mpastell

license: mit


text:
AppID is to long

I receive today my app id from solarman and it is to long for the config.json if I validate the config.
The app id has 16 numbers.

That should be resolved by now via #61. This is fixed in the latest version and v0.8.2.
The AppId can now either be 15 or 16 chars.
You can find the whole schema here.

repo: mpepping/solarman-mqtt


text:
I can't get peers and download

hello. I want to use your library to download torrent file from my app.
But I have some trouble. I can`t get any peer....and download.
first, i check torrent file but, i works in rtorrent and transmission.
and also, i check your bin (of course, i mave jar file, to build dir), but also i can`t get any peer.
do i have to do something befor start torrent? or, is it problem that my app is running behind NAT?

2016-11-19 02:47:36,802 [bt-announce(..653630)    ] INFO : Starting announce loop...
2016-11-19 02:47:36,803 [bt-announce(..653630)    ] INFO : Announcing STARTED to tracker with 0U/0D/1847400574L bytes...
2016-11-19 02:47:36,803 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:47:39,804 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:47:42,804 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:47:45,805 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:47:48,805 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:47:51,806 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:47:54,807 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:47:57,807 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:48:00,808 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:48:03,808 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:48:06,809 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:48:09,809 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:48:12,810 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:48:15,810 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.
2016-11-19 02:48:18,811 [bt-client(..653630)      ] INFO : SHARING 0/881 pieces (0.00%) [0/0] with 0/0 peers at 0.00/0.00 kB/s.

Running behind a NAT might be an issue indeed. Can you run with debug logging enabled and give me that output?

@mpetazzoni Oh, I`m behind NAT...;; how can i overcome that?? And how can i run with Debugging Enable? I Cannot see in help

@knightpop Could you tell your solution？thank you very much

authors: ginger-k knightpop mpetazzoni

repo: mpetazzoni/ttorrent


text:
Tour scene image is broken when switching browser tab - macOS Mojave

I'm not sure if this is a bug with pannellum or some other issue with OS, GPU etc.
Please take a look at the attached Screen Recording.zip.
Any idea what might have caused this?
App is basically a pannellum tour (type: 'equirectangular') with some custom elements placed on top of the scene image with CSS position.
Relevant config:
 capturedKeyNumbers: [17, 27, 37, 39, 61, 65, 68, 83, 87, 107, 109, 173, 187, 189],
 friction: 1,
 ignoreGPanoXMP: true,
 default: {
   firstScene: '2',
   autoLoad: true
 }

The problem appeared on a system running macOS Mojave, with chrome Version 79.0.3945.130 (Official Build) (64-bit). It has since gone away after an OS upgrade to macOS Catalina.
System details:

Are there any errors or warnings printed to the browser's developer console? This looks like a browser bug to me.

No errors or warnings. Nothing printed to the browser's developer console.

I am unable to reproduce this using Sauce Labs. As there are no messages, there's not much I can do if I can't reproduce the issue.
As this appears to be a bug specific to a particular browser / OS combination that is now outdated, I'm going to close this issue. It can be reopened if new information comes to light, or if other people are able to reproduce the issue.

authors: mpetroff reviewingcode

repo: mpetroff/pannellum


text:
PsiInvalidElementAccessException: because: different providers

Short description
Catched by IntelliJ error reporting. Can't tell when it occurred.
Version information

IDEA Version:  193.4778.7
JDK Version: IDE: bundled JRE. Project: OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
OS Type & Version: Manjaro, Arch derivate, Linux
Lombok Plugin Version: 0.27-EAP
Lombok Dependency Version: 1.18.10

Stacktrace
com.intellij.diagnostic.PluginException: class de.plushnikov.intellij.plugin.psi.LombokLightParameter; valid=true; method.valid=true [Plugin: Lombook Plugin]
	at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:399)
	at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
	at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:58)
	at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.getNewParametersInfo(ChangeMethodSignatureFromUsageFix.java:328)
	at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.isAvailable(ChangeMethodSignatureFromUsageFix.java:150)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.addAvailableFixesForGroups(ShowIntentionsPass.java:149)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.lambda$getAvailableFixes$0(ShowIntentionsPass.java:82)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.getAvailableFixes(ShowIntentionsPass.java:82)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.getActionsToShow(ShowIntentionsPass.java:291)
	at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.doCollectInformation(ShowIntentionsPass.java:220)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:55)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:429)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:997)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:422)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:421)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:397)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:157)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:395)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:161)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: com.intellij.psi.PsiInvalidElementAccessException: Element: class com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl #JAVA  because: different providers: com.intellij.psi.DummyHolderViewProvider{myVirtualFile=LightVirtualFile: /DummyHolder, content=VirtualFileContent{size=0}}(e2a9c85); com.intellij.psi.SingleRootFileViewProvider{myVirtualFile=LightVirtualFile: /DummyHolder, content=VirtualFileContent{size=0}}(430e4524)
invalidated at: see attachment; Type element reference of class com.intellij.psi.impl.source.PsiFieldImpl #PsiFieldImpl #Language: JAVA; augmenters=[com.intellij.psi.impl.source.JShellPsiAugmentProvider@b87026a, de.plushnikov.intellij.plugin.provider.LombokAugmentProvider@630e4193, com.intellij.lang.aspectj.augment.AjPsiAugmentProvider@71272098]
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:177)
	at com.intellij.psi.impl.source.PsiClassReferenceType.resolve(PsiClassReferenceType.java:124)
	at com.intellij.psi.util.PsiUtil.ensureValidType(PsiUtil.java:1268)
	at com.intellij.psi.util.PsiUtil.ensureValidType(PsiUtil.java:1257)
	at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.getNewParametersInfo(ChangeMethodSignatureFromUsageFix.java:322)
	... 25 more

Duplicate of #649

authors: ewirch mplushnikov

repo: mplushnikov/lombok-intellij-plugin


text:
plugin error

com.intellij.diagnostic.PluginException: class de.plushnikov.intellij.plugin.psi.LombokLightParameter; valid=true; method.valid=true [Plugin: Lombook Plugin]
at com.intellij.ide.plugins.PluginManagerCore.createPluginException(PluginManagerCore.java:290)
at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:12)
at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:58)
at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.getNewParametersInfo(ChangeMethodSignatureFromUsageFix.java:332)
at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.isAvailable(ChangeMethodSignatureFromUsageFix.java:155)
at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.addAvailableFixesForGroups(ShowIntentionsPass.java:155)
at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.getActionsToShow(ShowIntentionsPass.java:300)
at com.intellij.codeInsight.daemon.impl.ShowIntentionsPass.doCollectInformation(ShowIntentionsPass.java:226)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:54)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:399)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:392)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:391)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:367)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:365)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:181)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: com.intellij.psi.PsiInvalidElementAccessException: Element: class com.intellij.psi.impl.source.PsiJavaCodeReferenceElementImpl #JAVA  because: parent is null
invalidated at: see attachment; Type element reference of class com.intellij.psi.impl.source.PsiFieldImpl #PsiFieldImpl, index=0 #Language: JAVA; augmenters=[com.intellij.psi.impl.source.JShellPsiAugmentProvider@23cb3a59, com.intellij.psi.impl.RecordAugmentProvider@a221558, de.plushnikov.intellij.plugin.provider.LombokAugmentProvider@5ae6408, com.intellij.lang.aspectj.augment.AjPsiAugmentProvider@1a3e0d9a]
at com.intellij.psi.impl.source.PsiClassReferenceType.resolveGenerics(PsiClassReferenceType.java:175)
at com.intellij.psi.impl.source.PsiClassReferenceType.resolve(PsiClassReferenceType.java:121)
at com.intellij.psi.util.PsiUtil.ensureValidType(PsiUtil.java:1220)
at com.intellij.psi.util.PsiUtil.ensureValidType(PsiUtil.java:1209)
at com.intellij.codeInsight.daemon.impl.quickfix.ChangeMethodSignatureFromUsageFix.getNewParametersInfo(ChangeMethodSignatureFromUsageFix.java:326)
... 22 more

Duplicate of #649

authors: chengtongtong mplushnikov


text:
On FormRequests

There's been quite some discussion on FormRequests in recent times. As I explained in #343, we're getting rid of them in v3. However, now that response calls are back and more powerful (#364), body parameters and query parameters are the only things developers may have to explicitly specify. I don't have a problem with that, but, as several people have pointed out, we all know that code can change pretty quickly, and a developer may forget to update the documentation.
With that in mind (and even though I still hold that FormRequests are for validation, not information), I'm exploring reintroducing FormRequests. It's quite a lot of work, so one of my aims is to keep it unambitious and go with the basics.  Here's a proposal for how they will operate:

This package will provide a ParameterDescription rule (which always passes). Custom descriptions for parameters was one of the most requested things for FRs, and this is one way we can add it (even though it is, admittedly, a hack). So developers will be able to write:

return [
  'user_id' => 'required|int|exists:users|desc:The ID of the user',
  'room_id' => [
    'required',
    'string',
    new ParameterDescription('The ID of the room')
  ],
];

It's ugly, sure, but it could work.

For starters, we'll only parse parameter type (int, numeric, date, string, array and similar rules) and required status (required rule only) from the ruleset., and extract the description from the description rule. We'll ignore every other rule. If things work out well, we could expand its abilities. (Note: this means that data provided in examples and used in response calls may not necessarily pass other validation rules)

I'd like to hear what you guys think. cc @hubertnnn, @Punksolid, @mykeels

Thank you for the effort to put FormRequests back. It will be necessary to have ParameterDescription?
As a hack I think it could be useful, but if no description its possible I think it's better, some form fields are detailed enough. If put it explicitly its necessary in order to have less effort in the v3, I think it's okey.
Thanks

I am thinking about if we should add the possibility to define more type rules.
Eg. I have a field that is a telephone number validated using Propaganistas/Laravel-Phone.
So my field will look like this: "contact_number" => "required|phone"
I know considering a phone number as field type is a bit far-fetched but I think we might need this level of customization.
My suggestion would be to use one of following solutions (or a mix of them):

Check if Request class has docs() method. If yes use its value as documentation

class CreateUserRequest extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'name'      => 'required|unique:users,name',
            'password'  => 'required|min:8|different:name|letters|numbers',
            'email'     => 'required|email|unique:users,email',
            'contact'   => 'required|phone',
        ];
    }

    public function docs()
    {
        return [
            'name' => 'The definition of name',
            'password' => [
                'status' => 'More than required',
                'type' => 'hidden string',
                'description' => 'The password, really',
            ],
            'contact' => null,
        ];
    }
}

As you can see in example you can use simple format just to specify description (like in name field) or more advanced to define all 3 columns, each being optional.
You can also skip a field by not including it on the list (it will use default values then)
or even explicitly tell to hide it from documentation by setting it to null

Add 3 PseudoRules, one for each column

return [
  'contact'   => 'status:sometimes required|type:phone number|desc:The contact',
];

Use translations file to match validator to definitions:

// resources/lang/en/validator.php
return [
    'status' => [
        'required' => 'Required',
        'nullable' => 'Optional',
    ],
    'type' => [
        'int' => 'Number',
        'numeric' => 'Number',
        'date' => 'Date',
        'string' => 'Text',
        'array' => 'Array',
        'phone' => 'Telephone number',
        // ...
    ],
    'description' => [
        'min' => 'Minimum: :param1',
        'different' => 'Must have a different value than parameter: :param1 ',
        // ...
    ],
]

Code for this one could be as simple as:
$rule = //Get rule name eg. "required`
$key = 'apidoc.description.' . $rule; //or 'apidoc.type.' or 'apidoc.status.'
if(trans($key) !== $key) { // We have a value for the field
}

All 3 solutions above have the advantage of giving the developer a way to define values for all 3 columns in the table. #1 and #2 Are more manual, where #3 is more automated.
In fact it should be possible to implement all 3 solutions at once if needed.
Personally I am not a fan of #2 since it will obstruct the validation code with documentation but at the same time its probably the simplest one to use.

There is 2 extra things that v2 was missing that I found problematic and need fixing in new implementation:

Fields in documentation are sorted differently than in code. That ended up with weird order like this: tags => array, name => string, tags.0 =>string where 2 fields that are related get separated by some unrelated fields. We need to keep the order that developer used in code for better visibility.

Old implementation did not support multiple requests, so if my controller had something like this:

public function index(DateRangeFilterRequest $request1, TypeFilterRequest $request2)
{
    // The code
}

It would only parse the first request.
I know its a rare case, but it should be easy to fix and one more point towards perfect package.

@hubertnnn thanks for your suggestions. My take:

No need for a rules method. This is not different from using @bodyParams. Also, this is a case of this dev package intruding on the application code.
Nope, we're not adding 3 pseudo-rules. Difficult to maintain and it would unnecessarily bloat the dev's codebase.
This is a lot of work for the dev and doesn't add significant value.

I think I'll just stick to dropping FormRequests for now.

No need for a rules method. This is not different from using @bodyParams. Also, this is a case of this dev package intruding on the application code.

Usually a developer using FormRequest would already define rules which the request is automatically validated against. I think it would be nice if the generator can use the existing rules to generate documentation, when @bodyParams is absent.

Sorry, I meant no need for a docs() method.

Hey @hagabaka
Does the generator now use existing rules method from FormRequest  to generate documentation if 'bodyParams' is absent?
I trying to figure it out my self but didn't find the solution yet.

@shalvah any change the proposed feature would become a reality soon?
return [   'user_id' => 'required|int|exists:users|desc:The ID of the user',   'room_id' => [     'required',     'string',     new ParameterDescription('The ID of the room')   ], ];

Nope. We've moved away from using Laravel validation rules. Check out the documentation on documenting request parameters here.

@shalvah
Thanks for confirming!
What about adding Dingo API form request as recommended here: https://github.com/mpociot/laravel-apidoc-generator/issues/505

Oh, yes, we can consider that. But you'll still be using the bodyParams annotations.

FormRequest rules() support is back in Scribe.😅

authors: Punksolid fatonsopa hagabaka hubertnnn shalvah

repo: mpociot/laravel-apidoc-generator


text:
Fatal error: while using version 1.6.2

Hello @mpociot , I run into this error:
 Fatal error: Call to undefined method Mpociot\VatCalculator\VatCalculator::shouldCollectVAT()
My version is: mpociot/vat-calculator (1.6.2)
I have checked the package in vender folder and the shouldCollectVAT method in VatCalculator.php is not present.
Nuno

Ha - you're right. I forgot to create a new release containing the newly added shouldCollectVAT method.
Please run composer up and you should get version 1.6.3

Tks

authors: mpociot nacr-dev

repo: mpociot/vat-calculator


text:
🛑 CVSR Trivia Night [cvsrtrivianight.org] is down

In 4813ba3, CVSR Trivia Night [cvsrtrivianight.org] (https://cvsrtrivianight.org) was down:

HTTP code: 0
Response time: 0 ms

Resolved: CVSR Trivia Night [cvsrtrivianight.org] is back up in 15b4d0b.


text:
🛑 SD County Escrow [sdcountyescrow.com] is down

In 05ef934, SD County Escrow [sdcountyescrow.com] (https://sdcountyescrow.com) was down:

HTTP code: 0
Response time: 0 ms

Resolved: SD County Escrow [sdcountyescrow.com] is back up in e76765c after 8 minutes.


text:
🛑 Simone & Blevins [landlordslegalcenter.com] is down

In 92a4842, Simone & Blevins [landlordslegalcenter.com] (https://landlordslegalcenter.com) was down:

HTTP code: 508
Response time: 1856 ms

Resolved: Simone & Blevins [landlordslegalcenter.com] is back up in 312ea03 after 20 minutes.


text:
🛑 SIA is down

In 59f961e, SIA (https://www.sickleinafrica.org) was down:

HTTP code: 0
Response time: 0 ms

Resolved: SIA is back up in 85b5201 after 16 minutes.

repo: mrejonas/websitemonitoring


text:
Brownouts / Power usage increase on new version of library

Good news - no more green boogies.
Bad news - the power consumption seems to have  increased.
Before I could run plasma test on USB for days without issue, now it lasts about 1/2 second before rebooting without external power.
New library draw -
10% coverage (Conway game of life)
5v/ .46A - Brightness 50
5v/ .32A - Brightness 20
5v/ .27A - Brightness 10
5v/ .25A - Brightness 5
100% coverage (plasma)
5v/ .36A - Brightness 5
5v/ .48A - Brightness 10
5v/  .59A - Brightness 15
5v/ .70A - Brightness 20
Over that = brownout/reset.
Win some, lose some!
Will add in a cap to see if that improves USB power brownout, otherwise will need to add in some code to try modulate power if its going to go over hard limits.

I'll look at this again in the coming days. That is too much of a
regression.
I like my RGB panels, but prefer if they're more energy efficient.
On Tue., 30 Jul. 2019, 5:02 am csloz, notifications@github.com wrote:

Good news - no more green boogies.
Bad news - the power consumption seems to have increased.
Before I could run plasma test on USB for days without issue, now it lasts
about 1/2 second before rebooting without external power.
New library draw -
10% coverage (Conway game of life)
5v/ .46A - Brightness 50
5v/ .32A - Brightness 20
5v/ .27A - Brightness 10
5v/ .25A - Brightness 5
100% coverage (plasma)
5v/ .36A - Brightness 5
5v/ .48A - Brightness 10
5v/ .59A - Brightness 15
5v/ .70A - Brightness 20
Over that = brownout/reset.
Win some, lose some!
Will add in a cap to see if that improves USB power brownout, otherwise
will need to add in some code to try modulate power if its going to go over
hard limits.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mrfaptastic/ESP32-RGB64x32MatrixPanel-I2S-DMA/issues/17?email_source=notifications&email_token=AC3TMKIW6TX55AMLNX46IT3QB64LTA5CNFSM4IHYFNAKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HCGE5QA,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC3TMKN336OQSBRCY5G6PUTQB64LTANCNFSM4IHYFNAA
.

Resolved with better library defaults.

authors: csloz mrfaptastic


text:
Images are always width = 100%

Hi,
if I include an image in a posting, images are always 100% in width, even I'm using the figure element
{{< figure src="./error.jpg" height="185px" width="473px" >}}
Is there any way to get a workaround or to solve this issue?
Kind Regards,
Danny

Hi @dannykorpan, you can add the following lines:
figure > img {
  height: 185px;
  width: 473px;
}

to the file: /static/hugo-theme-console/css/console.css

Hi,
thank you. But every image has another dimension. It would be great if every image keeps it's original size.
Kind Regards,
Danny

Hi @dannykorpan,
Please add the following lines:
img {
 width:none;
}

to the file: /static/hugo-theme-console/css/console.css

Hi,
thank you for your help and quick response! But I have still the same problem.

Kind Regards,
Danny

Update: Also the same issue with your second hint.

Hi,
are there any solution for my problem?
Kind Regards,
Danny

Hi @dannykorpan,
You should add the line with img at the end of the file. After the }.
}

img { width: none; }

Hi @mrmierzejewski,
thank you, but 'none' ist not working.

With 'unset' it work's now flawlessly.

Kind Regards,
Danny

Hi @dannykorpan, thank you for the suggestion.

authors: dannykorpan mrmierzejewski

repo: mrmierzejewski/hugo-theme-console


text:
'NoneType' object has no attribute 'getitem'

Getting this right after login:
Traceback (most recent call last):
File "mintapi/api.py", line 769, in
main()
File "mintapi/api.py", line 708, in main
mint = Mint.create(email, password, ius_session=options.session, thx_guid=options.thx_guid)
File "mintapi/api.py", line 74, in create
mint.login_and_get_token(email, password, ius_session, thx_guid)
File "mintapi/api.py", line 135, in login_and_get_token
session_cookies = self.get_session_cookies(**data)
File "mintapi/api.py", line 199, in get_session_cookies
'ius_session': driver.get_cookie('ius_session')['value'],
TypeError: 'NoneType' object has no attribute 'getitem'

Same issue for me.

Looks like driver.get_cookie() isn't getting the cookies for ius_session or thx_guid. I think this has to do with the domains for ius_session and thx_guid being accounts.intuit.com and pf.intuit.com respectively, but get_cookie() is called while on the domain mint.intuit.com, so it only sees cookies with domains mint.intuit.com and .intuit.com.
A workaround to get ius_session is to accounts.intuit.com and get the cookie there:
driver.get('http://accounts.intuit.com')
ius_session_cookie = driver.get_cookie('ius_session')['value']
Doesn't seem to be as simple as going to pf.intuit.com to get the thx_guid cookie, however... not sure of a solution there.

Thanks, fixed and released as 1.27!

authors: dherg dsinger51 mrooney musicmovesme

repo: mrooney/mintapi


text:
Try to fix the build of CI and Docker image

Checklist
Not all of these might apply to your change but the more you are able to check
the easier it will be to get your contribution merged.

[ ] CI passes
[ ] Description of proposed change
[ ] Documentation (README, docs/, man pages) is updated
[ ] Existing issue is referenced if there is one
[ ] Unit tests for the proposed change

cc #40

@mrtazz please take at a look at this one first, looks like the build need to be fixed, before I can verify #40, thanks.

repo: mrtazz/checkmake


text:
Docs: Example usage?

It’d be good if the docs showed how you’d install/run this. Not sure what commands would need to be run and how to pair it to a rower?

Hopefully added enough info for most users to get up and running. Would be nice in future to include details/files.packaging enabling installation this as headless service, although this information in freely available elsewhere.

authors: danpoltawski mrverrall

repo: mrverrall/go-row-cycle


text:
Table names are pluralized even when flag set to false

In the properties for the entire model, in the Database section, there's a Pluralize Table Names property. Table names are create as plural even when this is set to false.

Are you using an English language version of Visual Studio? That feature is dependent on the Microsoft Pluralization Service, which may or may not be implemented depending on the language version.
Now that you bring that up, though, I will make that setting unavailable if the tool detects the service is not present.
If you are using the English version (or some other version where it's implemented), I'll have more digging to do, because I can't reproduce that problem in my installation.

authors: Olivercomputing msawczyn


text:
🛑 Do53 Roost IPv4 UDP is down

In a44e75f, Do53 Roost IPv4 UDP (http://107.189.10.142:9202) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Do53 Roost IPv4 UDP is back up in 7dfb77a after 18 minutes.

repo: mschirrmeister/upptime-loopx


text:
INIT ERROR - Trail expired Tuya Developer Platform

Purtroppo oggi ho scoperto di non poter più accedere con IoTwebUI v.2.1.1 poichè il periodo di prova su Tuya Developer Platform è terminato. Soluzioni? Oppure ho attivato all'inizio qualcosa che non serviva e neanche c'è bisogno?
Comunque ora ho fatto richiesta di prolungamento, ma solo di altri 6 mesi del periodo trial, quindi è sempre una soluzione temporanea!

E' la strategia Tuya... Sanno benissimo le motivazioni dei loro 'sviluppatori' !
E' dal 2019 che rinnovo: non preoccuparti troppo.
Ciao

E' la strategia Tuya... Sanno benissimo le motivazioni dei loro 'sviluppatori' ! Pensa a tutti gli utenti Tuya + HA ;) E' dal 2020 che rinnovo: non preoccuparti troppo. Comunque mi fa piacere che lo stai usando e che ti trovi bene (altrimenti lo avrei saputo!) Ai primi di settembre la versione 2.2 ! Ciao
P.S. C'è un solo vincolo, gli accessi mensili all'API: Usandolo ininterrottamente, usare un loop di 2 minuti o più.

Aaah, ok, bene! In effetti mi hanno rinnovato subito la richiesta di prolungamento!
Si sì, ogni tanto lo uso, anche se non ho avuto molto tempo per approfondire le nuove funzionalità e customizzarlo ulteriori!
Devo partire per qualche giorno di ferie e volevo vedere le batterie dei sensori... Tutti in colpo, sulla stessa pagina! 😉✌
Grazie

repo: msillano/IoTwebUI


text:
#897: DSA point annotation etl

This PR:

refactor utilities from the dsa_annotations.py into dsa_api_handler.py
refactors existing requests from dsa_annotations.py and dsa_upload.py to use girder client instead of requests
Adds ability to pull point annotations from DSA

Very nice refactoring! The girder client makes the code much cleaner.

Codecov Report

Merging #248 (50fd222) into dev (d171f86) will decrease coverage by 9.38%.
The diff coverage is 36.91%.

@@            Coverage Diff             @@
##              dev     #248      +/-   ##
==========================================
- Coverage   53.87%   44.48%   -9.39%
==========================================
  Files          85       77       -8
  Lines        6023     5642     -381
==========================================
- Hits         3245     2510     -735
- Misses       2778     3132     +354

Impacted Files
Coverage Δ

...athology/luna/pathology/cli/dsa/dsa_api_handler.py
27.27% <19.26%> (-38.25%)
:arrow_down:

...ology/tests/luna/pathology/cli/dsa/test_dsa_viz.py
92.18% <76.19%> (-7.82%)
:arrow_down:

...una-pathology/luna/pathology/cli/dsa/dsa_upload.py
93.33% <94.73%> (+1.02%)
:arrow_up:

...e/tests/luna/clinical/proxy_table/test_generate.py
0.00% <0.00%> (-100.00%)
:arrow_down:

...hology/tests/luna/pathology/cli/test_load_slide.py
0.00% <0.00%> (-100.00%)
:arrow_down:

.../tests/luna/pathology/common/test_build_geojson.py
0.00% <0.00%> (-100.00%)
:arrow_down:

...ts/luna/pathology/cli/test_collect_tile_segment.py
0.00% <0.00%> (-100.00%)
:arrow_down:

...gy/point_annotation/refined_table/test_generate.py
0.00% <0.00%> (-100.00%)
:arrow_down:

...refined_table/regional_annotation/test_generate.py
0.00% <0.00%> (-100.00%)
:arrow_down:

...s/luna/pathology/common/test_slideviewer_client.py
0.00% <0.00%> (-92.43%)
:arrow_down:

... and 10 more

Continue to review full report at Codecov.

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

authors: armaank codecov-commenter doori

repo: msk-mind/luna


text:
Errors when automating stop_charging service

I have an iPace and I am looking to automate charging cycles, however, I am having trouble getting the stop_charging service to work. It works fine when I Call Service in Developer Tools as set up below:

However, if i set it up similarly in the Automations UI like this:

I get the following errors:
2020-09-03 09:11:41 ERROR (MainThread) [homeassistant.components.automation] Jaguar Stop Charging: Error executing script. Invalid data for call_service at pos 1: value should be a string for dictionary value @ data['entity_id']
2020-09-03 09:11:41 ERROR (MainThread) [homeassistant.components.automation] While executing automation automation.jaguar_stop_charging
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/init.py", line 409, in async_trigger
await self.action_script.async_run(variables, trigger_context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 756, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 173, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 181, in _async_step
await getattr(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 370, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1204, in async_call
processed_data = handler.schema(service_data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in call
return self._compiled([], data)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
return base_validate(path, iteritems(data), out)
File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: value should be a string for dictionary value @ data['entity_id']

I'll have a look at this over the weekend

If you have set up the automation exactly as your screenshot I think you have redundant information. You should not need anything in the Service data since you have selected the enity_id already in the combo box. Try to remove it and see if it works :)

Yeah, that's how I did it originally, with the same result.

Can you post the whole automation section from your automation.yaml file. Seen a few issues on google where setting up through gui can cause incorrect formatting in output yaml.

I'm away at the mo, I'll upload when I get back at end of week, ta.

As requested, here is the yaml (ignore the trigger, I just put in a dummy one):
`- id: '1599116461660'
alias: Jaguar Stop Charging
description: ''
trigger:

event: start
platform: homeassistant
condition: []
action:
data: {}
entity_id: sensor.jag_info
service: jlrincontrol.stop_charging
mode: single`

Dave, this is hard to see if there is a format error. Can you post as code segment.

Hmm, I'm not sure what you want me to do here, I did use Insert Code and noticed that the indentation was odd, but there doesn't seem to be any other option.

Post a screen shot

So this looks fine. I cant replicate this issue but i also dont have an EV to be able to properly test.  Can you try a couple of things and give me some more info.
Can you try and automate a different servicewith same entity and also different entity. Can you also try and use a different trigger that HA start to see if it is caused by the component not being fully loaded when HA start triggers.
Can you also tell me version of HA you are running.

Ok, so I tried :
Changing service to jlrcontrol.start_charging
Changing entity to sensor.jag_ev_battery
and got the same result and same errors as I originally had.
HA version is 0.113.0

Oh and my original automation did not use the HA Start trigger, it was a time based trigger (I created the latest automation as a trial just to rule out the other things I had in the original)

And just in case it helps, I've just upgraded to 0.115.1 and I still get the same result.

Ok.  So I have managed to recreate this and it seems it does the same this for all services.  It may take me a few days to debug and work out a fix but it is definitely some error in the component.  Just not sure what yet! ;-)

Cool no worries, I'm glad you managed to replicate it, that's half the battle.

Actually quicker (and easier than I thought).  I think this may be some issue with HA as when tried some of my other integrations, I got the same error - which is actually a bit misleading.  It is not sending and array instead of a string but sending nothing for entity id.
Are you seeing the same? It maybe that something has changed and it needs updating, however, I have a work around that will get this working for you, which I found from looking at automations that I have created by hand.
Basically, this issue is the format of the yaml created by the automation UI.  In your action section, change it to...

Let me know how you get on.

Well I no longer get the error, but then, neither does it do anything (car just carries on charging).

Does it show in the logs (need to set integration to debug level in configuration.yaml) that it is calling the service?

Assuming I should be looking in the Homeassistant Logs, then no, I don't see it being called.

Soz, there was a typo in my logger entry, it does call the service but it fails:
2020-09-20 14:28:20 INFO (MainThread) [custom_components.jlrincontrol.services] Service charging_stop called on vehicle Jag. Awaiting feedback on success.
2020-09-20 14:28:21 INFO (MainThread) [custom_components.jlrincontrol.services] InControl service call (charging_stop) to vehicle Jag failed due to None.
Full return is {'status': 'Running', 'statusTimestamp': '2020-09-20T13:28:21+0000', 'startTime': '2020-09-20T13:28:20+0000', 'serviceType': 'CP', 'failureDescription': '', 'customerServiceId': 'redacted', 'vehicleId': 'redacted', 'active': True, 'initiator': 'USER', 'eventTrigger': None, 'serviceCommand': None, 'serviceParameters': [{'key': 'CHARGE_NOW_SETTING', 'value': 'FORCE_OFF'}]}

Ok well some progress i guess. Just to confirm, this works when you run via developer tab and does stop the car charging?
This looks like it has called the service and sent to the car but it is not expecting a status of 'running' back from the jlr servers. It loops when status is 'started' and waits for a status other than that. If it gets a 'success' status then thats good, anything else is a fail.  This is not the final status and im guessing it needs to keep looping if status is running to wait for the final status message.
Did it actually stop charging at all?

You ask an interesting question. It previously worked with the developer tab but I haven't tried that again this time. However, I did try stopping it with the (generally useless) Jaguar app and (the much better) WattCat app. Neither worked. It never stopped charging but I'm wondering if the API calls are generally flaky. I'll experiment a bit more during the week and let you know.

As suspected, I am not able to stop charging using any of developer tab, HA automation or  either of the apps. I suspect you have fixed the original issue I had using the stop_charging service and now we are up against flaky JLR software.

authors: DaveGalbraith mariwing msp1974


text:
Add taper serialization

This branch adds missing serialization code for the set of objects defined in taper.h.   That includes true two-sided tapers as used, for example, in spectral analysis and the TopMute class (mapped in pybind11 code to _TopMute).
I didn't add test pickle code for TopMute because I still don't have pytest fully implemented.  I notice that I don't think there is any test code for Taper classes that I added pickle to either:  LinearTaper, CosineTaper, and VectorTaper.
There are some minor changes to the C++ taper test program that do test the boost serialization used in the C code.  The pybind11 serialization with pickle, however, is completely different for LinearTaper, CosineTaper, and TopMute.  VectorTaper directly applies the boost serialization. The reason I did that is that the first 3 are defined by 3 to 4 numbers that are easily serialized as a tuple in pybind11.   Should be must faster than preserving all the baggage of serializing the full object interface.  Note I tested all 4 pickle instances with the same one we use in all the other tests:
#data_object is the object we want to test with pickle
dcopy=pickle.loads(pickle.dumps(data_object))
# followed by assert to verify copy and original are equal

I can add the test code for TopMute easily of you want.  The taper objects, I think, are harder because we don't have any existing tests that I found.

Codecov Report

Merging #268 (c604a53) into master (d292827) will decrease coverage by 0.34%.
The diff coverage is 12.90%.

@@            Coverage Diff             @@
##           master     #268      +/-   ##
==========================================
- Coverage   47.89%   47.54%   -0.35%
==========================================
  Files         118      118
  Lines       15359    15505     +146
==========================================
+ Hits         7356     7372      +16
- Misses       8003     8133     +130

Impacted Files
Coverage Δ

cxx/include/mspass/algorithms/Taper.h
15.90% <0.00%> (-84.10%)
:arrow_down:

cxx/src/lib/algorithms/Taper.cc
46.99% <0.00%> (-1.20%)
:arrow_down:

cxx/test/taper/test_taper.cc
0.00% <0.00%> (ø)

cxx/python/algorithms/basic_py.cc
56.02% <23.45%> (-21.76%)
:arrow_down:

cxx/include/mspass/seismic/BasicTimeSeries.h
90.56% <100.00%> (ø)

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 d292827...c604a53. Read the comment docs.

Sure! I will work on it soon.

authors: Yangzhengtang codecov-commenter pavlis

repo: mspass-team/mspass


text:
Update retry-service-specific.md

Fixed a few grammatical errors

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/best-practices/retry-service-specific.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Are you sure? Operations is plural so the correct usage is "are". "Is" would be appropriate if we were dealing with a collective noun but operations is not a collective noun.
https://www.grammarly.com/blog/is-vs-are/

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/best-practices/retry-service-specific.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

@brianharwell The subject is the gerund 'using' - see https://english.stackexchange.com/a/18818 (Enslish grammar is weird...) - that said, I think the original sentence was awkward, so I've revised it. Thanks for the suggestions!

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/best-practices/retry-service-specific.md
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

authors: MikeWasson bennage brianharwell

repo: mspnp/architecture-center


text:
Second-time loads crash the program from trying to load User Config

It's probably still trying to access the filesystem, need to figure out an alternative way to store user config in browser that will stop Silk Brush from crashing whenever its loaded after the first time

Seems like the deserializer is using Dynamic Language Runtime, which of course uses System.Reflection.Emit in LigtLambda.cs, meaning I can't use it as is. I think the most straightforward option for now will be to rewrite the UserConfig class to make it more easily serializable from a simpler JSON utility like MiniJSON or even Unity's JsonUtility.

Swapped Nuget Newtonsoft.Json for https://github.com/jilleJr/Newtonsoft.Json-for-Unity, works like a charm. Hopefully won't run into any more JSON related issues


text:
Rebuild the icons based on SVG sources

The SVG was created by tracing with Inkscape

The color in clang64 one seems to blend with '2' letter. Also is it necessary to store the icons in repo? Can't those be built at build time with some pythin magic?

mockups welcome. re buildtime, it needs librsvg and imagemagick, both not available in the msys repo.

like so maybe?


text:
8000 cards are duplicated in the file

Around 8000 cards incorrectly have two entries in AllCards.JSON, one labeled with (a) and one with (b). Burning Wish as one example. This affects regular cards along with split cards, double-faced cards, etc.

Whoops... Will investigate soon


text:
Use a JS only tail implementation

In order to have the same behaviour between Linux and Windows (related to this issue: #197), I've switched to a lib that provide a JS only tail
This is still a work in progress, I still have to test it on Windows server, but I don't have it right now.

During a file rotation, we may loose couple of lines (until the retry). The native tail handle this in a better way though.
When we tail multiple files, tail has a syntax to display it:

test1.log sam. 21 mars 2020 17:54:08 CET
test1.log sam. 21 mars 2020 17:54:10 CET
test1.log sam. 21 mars 2020 17:54:11 CET
==> ../frontail/logs/test2.log <==
test2.log sam. 21 mars 2020 17:54:15 CET
test2.log sam. 21 mars 2020 17:55:04 CET
test2.log sam. 21 mars 2020 17:55:10 CET
test2.log sam. 21 mars 2020 17:55:12 CET
==> ../frontail/logs/test1.log <==
test1.log sam. 21 mars 2020 17:55:14 CET
test1.log sam. 21 mars 2020 17:55:17 CET
test1.log sam. 21 mars 2020 17:55:38 CET
test1.log sam. 21 mars 2020 17:55:47 CET

With this implementation, it's difficult to reproduce the same, so I changed the output (also, I allowed stdin to be followed along with other files):
../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:54:08 CET
../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:54:10 CET
../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:54:11 CET
../frontail/logs/test2.log - test2.log sam. 21 mars 2020 17:54:15 CET
                     stdin - stdin.log sam. 21 mars 2020 17:54:19 CET
                     stdin - stdin.log sam. 21 mars 2020 17:54:59 CET
                     stdin - stdin.log sam. 21 mars 2020 17:55:01 CET
                     stdin - stdin.log sam. 21 mars 2020 17:55:02 CET
../frontail/logs/test2.log - test2.log sam. 21 mars 2020 17:55:10 CET
../frontail/logs/test2.log - test2.log sam. 21 mars 2020 17:55:12 CET
../frontail/logs/test1.log - test1.log sam. 21 mars 2020 17:55:17 CET

Let me know what do you think about it :)

@teid is it ready to be reviewed?

Yes @mthenw, I validated that this change fixes the issue I had on the Windows server

Does this look mergeable @mthenw?
For me branch with @teid's work (thank you!) is the only way allowing me to use frontail with multiple files on Windows server.
Cheers

authors: kubawolanin mthenw teid

repo: mthenw/frontail


text:
🛑 https://mtit.pna.ps is down

In fd1dc78, https://mtit.pna.ps (https://mtit.pna.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://mtit.pna.ps is back up in bd50c9b.

repo: mtitservice/site


text:
🛑 https://reports.mtit.pna.ps is down

In b4d2a13, https://reports.mtit.pna.ps (https://reports.mtit.pna.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://reports.mtit.pna.ps is back up in b59dcf8.


text:
🛑 https://911.ps is down

In 6d5b851, https://911.ps (https://911.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://911.ps is back up in ee41edb.


text:
🛑 https://treport.mtit.pna.ps is down

In 0507dc4, https://treport.mtit.pna.ps (https://treport.mtit.pna.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://treport.mtit.pna.ps is back up in 76129c3.


text:
🛑 https://db.hcys.ps is down

In d1d9042, https://db.hcys.ps (https://db.hcys.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://db.hcys.ps is back up in 0944c67.


text:
🛑 https://www.pncecs.plo.ps is down

In f9c6a5d, https://www.pncecs.plo.ps (https://www.pncecs.plo.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://www.pncecs.plo.ps is back up in 3a00470.


text:
🛑 https://takaful.salfeet.plo.ps is down

In 7067e24, https://takaful.salfeet.plo.ps (https://takaful.salfeet.plo.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://takaful.salfeet.plo.ps is back up in f178ca4.


text:
🛑 https://palpro.ps is down

In c3ccf79, https://palpro.ps (https://palpro.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://palpro.ps is back up in d2d5224.


text:
🛑 https://verify.moj.pna.ps is down

In 1ff84ba, https://verify.moj.pna.ps (https://verify.moj.pna.ps) was down:

HTTP code: 0
Response time: 0 ms

Resolved: https://verify.moj.pna.ps is back up in d42b8c3.


text:
Chunked HTTP1 response piped gets interrupted

Hello,
I use Plug.Conn.Chunk to send output from an external program to the client.
When the clients (let's say wget, curl or httpie) writes the data to a file, it works all nicely.
But when the client pipes the output to another program there a strange behaviors:

Bandit 1.0.0-pre.16

on the Plug side, I see a premature end of connection   [error] Connection closed
on the client side, the response is incomplete

Bandit 1.0.0-pre.15

on the Plug side, the response is transmitted in chunks integraly without error
on the client side, the response is incomplete, and I have a broken pipe error

So I guess there is some improvement between pre.15 and pre.16 because we catch the error, but still there seems to be something wring in the Plug.Conn handling.
a verbose wget does not help much.  Can I increase bandit logs ?
My use case is not easy to reproduce, it depends a lot of my data. But I can be reactive and help out by trying fixes.

My first hunch is client error; there's nothing different to the server between the two cases (other than perhaps different timing), and I can't immediately see how the client's disposition of the response would affect anything.
The only changes between 15 and 16 that might affect chunked encoding are specifically to do with empty chunk encoding over HTTP/2, which is a pretty specific (though not impossible) case for you to be hitting. Some questions:

Are you 100% certain that the version difference makes a difference and it isn't just coincidental?
Is this local, or over the internet? How variable is the client/server connection?
Do you know if you're using http/2 as a transport? (also helpful: are you using https?)
If you're able to, running ThousandIsland.Logger.attach(:trace) should yield a boatload of logs (beware: they contain everything sent over the wire to Bandit, so anything sensitive will be in there too). Those would be helpful if you could isolate them to around one of the failures.

I worked on reproducing the issue, but I wasn't able to ... so strange.
Let's close the issue and I'll reopen it if necessary.
Thank you for your responses and support.

authors: jschaeff mtrudel

repo: mtrudel/bandit