[Bug] setExtraLibs/addExtraLib does not update/remove existing extra libs

Reproducible in vscode.dev or in VS Code Desktop?

[X] Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

[ ] Not reproducible in the monaco editor playground

Monaco Editor Playground Code
const editor = monaco.editor.create(document.getElementById("container"), {
    value: `test`,
    language: "typescript"
});

monaco.languages.typescript.typescriptDefaults.setExtraLibs([{ content: `declare const test = "initial";` }])

setTimeout(() => {
    monaco.languages.typescript.typescriptDefaults.setExtraLibs([{ content: `declare const test = "updated";` }])
}, 5000);

Actual Behavior
When hovering over the variable test in the playground, the initial declaration const test: "initial" from the first setExtraLibs call gets applied as it should.
After a timeout of 5000ms setExtraLibs is called a second time and the declaration should change to const test: "updated" but it stays the same.
Expected Behavior
The extra libs should be replaced with every subsequent setExtraLibs call but they actually remain on the values from the initial setExtraLibs call.
Additional Context
The same thing seems to happen when using addExtraLib, which also has no effect on the extra libs.

It was probably fixed in the latest update a couple of hours old.

Yes it is fixed in v0.32.0. Thank you.


Notifications feed is broken

I get notifications in the dropdown but clicking on the feed gives me a never ending spinner and

okay, I'll take a look
On Tue, Apr 5, 2022, 12:29 Martin Zackrisson @.***>
wrote:

I get notifications in the dropdown but clicking on the feed gives me a
never ending spinner and
[image: bild]
https://user-images.githubusercontent.com/8041100/161801685-045ad912-28e8-4b08-927d-2042eaa90a47.png
—
Reply to this email directly, view it on GitHub
https://github.com/JammerCore/JammerCore/issues/2115, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAL7MCJIZAUJC3JDAOA6PFLVDRS7JANCNFSM5STKFHPQ
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

It managed to parse the first response and request the relevant stuff it seems like:

It's times like this I wish we had the debug build available (i.e. with symbols). I appreciate a good obfuscate, but n doesn't tell us much.

Agree, I tried to read the compiled code to figure out what might be wrong, I'll check the source later today or tomorrow to see if I can spot something dubious

Today I can see the notification feed again (or at least on mobile) so might be one of the notifications just pushed out of my feed or you fixed something or it is a timing issue.

Yeah, I'd guess timing as well (meaning a missing check before use). I did
recently fix the "note" vs "node" naming annoyance (note is now comment). I
was pretty sure I changed every reference, and updated the database
accordingly (nb. we should not be using a string for notification types).
Anyway I don't think it's that, but I can't be sure I didn't break
something without realizing it. Would have to reproduce to be sure.
I do want to give the notifications a look over myself, sometime after my
holiday.
On Wed, Apr 6, 2022, 15:45 Martin Zackrisson @.***>
wrote:

Today I can see the notification feed again (or at least on mobile) so
might be one of the notifications just pushed out of my feed or you fixed
something or it is a timing issue.
—
Reply to this email directly, view it on GitHub
https://github.com/JammerCore/JammerCore/issues/2115#issuecomment-1090698318,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAL7MCKQLEXD2YAYDC3W6ULVDXSWFANCNFSM5STKFHPQ
.
You are receiving this because you commented.Message ID:
@.***>

I checked today and it's not timing issues that trigger it, but if I click on the "More" button it always happens (when I wrote the issue it happened as soon as I got to the notifications feed) so it's one of these that trigger the error:
{
	"status": 200,
	"caller_id": 655,
	"rate_limit": {
		"cost": 1,
		"remaining": 4991
	},
	"offset": 40,
	"limit": 40,
	"max_read": 11325175,
	"count": 4607,
	"feed": [
		{
			"id": 10807763,
			"node": 277020,
			"comment": 772185,
			"type": "comment",
			"created": "2022-03-16T01:21:28Z"
		},
		{
			"id": 10807240,
			"node": 277020,
			"comment": 772151,
			"type": "comment",
			"created": "2022-03-13T01:02:14Z"
		},
		{
			"id": 10807127,
			"node": 277020,
			"comment": 772147,
			"type": "comment",
			"created": "2022-03-12T16:53:10Z"
		},
		{
			"id": 10806893,
			"node": 277020,
			"comment": 0,
			"type": "post",
			"created": "2022-03-11T17:31:26Z"
		},
		{
			"id": 10802586,
			"node": 67837,
			"comment": 772020,
			"type": "comment",
			"created": "2022-02-26T23:38:11Z"
		},
		{
			"id": 10802387,
			"node": 219474,
			"comment": 772013,
			"type": "comment",
			"created": "2022-02-25T07:43:34Z"
		},
		{
			"id": 10799598,
			"node": 67837,
			"comment": 771941,
			"type": "comment",
			"created": "2022-02-18T02:54:26Z"
		},
		{
			"id": 10797839,
			"node": 67837,
			"comment": 771890,
			"type": "comment",
			"created": "2022-02-11T22:20:43Z"
		},
		{
			"id": 10796562,
			"node": 198339,
			"comment": 771847,
			"type": "comment",
			"created": "2022-02-06T09:20:57Z"
		},
		{
			"id": 10792414,
			"node": 67837,
			"comment": 771719,
			"type": "comment",
			"created": "2022-01-18T21:49:46Z"
		},
		{
			"id": 10792359,
			"node": 67837,
			"comment": 771718,
			"type": "comment",
			"created": "2022-01-18T21:49:30Z"
		},
		{
			"id": 10789435,
			"node": 165586,
			"comment": 771630,
			"type": "comment",
			"created": "2022-01-05T10:17:21Z"
		},
		{
			"id": 10786637,
			"node": 260011,
			"comment": 771536,
			"type": "comment",
			"created": "2021-12-21T01:57:53Z"
		},
		{
			"id": 10783599,
			"node": 165586,
			"comment": 771451,
			"type": "comment",
			"created": "2021-12-11T05:54:20Z"
		},
		{
			"id": 10783229,
			"node": 35423,
			"comment": 771441,
			"type": "comment",
			"created": "2021-12-10T07:42:55Z"
		},
		{
			"id": 10780682,
			"node": 271966,
			"comment": 771338,
			"type": "comment",
			"created": "2021-11-22T09:06:44Z"
		},
		{
			"id": 10780197,
			"node": 173817,
			"comment": 771329,
			"type": "comment",
			"created": "2021-11-21T18:57:57Z"
		},
		{
			"id": 10779630,
			"node": 165586,
			"comment": 771307,
			"type": "comment",
			"created": "2021-11-19T13:58:11Z"
		},
		{
			"id": 10777285,
			"node": 263736,
			"comment": 771207,
			"type": "comment",
			"created": "2021-11-08T10:40:10Z"
		},
		{
			"id": 10777240,
			"node": 144335,
			"comment": 771206,
			"type": "comment",
			"created": "2021-11-08T10:37:35Z"
		},
		{
			"id": 10777029,
			"node": 261156,
			"comment": 771192,
			"type": "comment",
			"created": "2021-11-04T19:40:35Z"
		},
		{
			"id": 10776592,
			"node": 261156,
			"comment": 771174,
			"type": "comment",
			"created": "2021-11-03T22:25:11Z"
		},
		{
			"id": 10776164,
			"node": 173817,
			"comment": 771160,
			"type": "comment",
			"created": "2021-11-02T12:15:06Z"
		},
		{
			"id": 10776051,
			"node": 153248,
			"comment": 771155,
			"type": "comment",
			"created": "2021-11-01T11:37:30Z"
		},
		{
			"id": 10774228,
			"node": 275085,
			"comment": 0,
			"type": "post",
			"created": "2021-10-26T21:32:34Z"
		},
		{
			"id": 10773247,
			"node": 263736,
			"comment": 771075,
			"type": "comment",
			"created": "2021-10-26T00:38:04Z"
		},
		{
			"id": 10770000,
			"node": 153248,
			"comment": 770930,
			"type": "comment",
			"created": "2021-10-22T12:08:04Z"
		},
		{
			"id": 10766766,
			"node": 263736,
			"comment": 770775,
			"type": "comment",
			"created": "2021-10-22T03:57:15Z"
		},
		{
			"id": 10766583,
			"node": 274929,
			"comment": 0,
			"type": "post",
			"created": "2021-10-22T03:35:25Z"
		},
		{
			"id": 10766493,
			"node": 263736,
			"comment": 770768,
			"type": "comment",
			"created": "2021-10-22T03:20:58Z"
		},
		{
			"id": 10765601,
			"node": 274911,
			"comment": 0,
			"type": "post",
			"created": "2021-10-22T01:54:20Z"
		},
		{
			"id": 10759913,
			"node": 267118,
			"comment": 770558,
			"type": "comment",
			"created": "2021-10-21T19:29:05Z"
		},
		{
			"id": 10759417,
			"node": 270871,
			"comment": 770537,
			"type": "comment",
			"created": "2021-10-21T19:21:31Z"
		},
		{
			"id": 10759248,
			"node": 270871,
			"comment": 770529,
			"type": "comment",
			"created": "2021-10-21T19:19:43Z"
		},
		{
			"id": 10758510,
			"node": 267118,
			"comment": 770492,
			"type": "comment",
			"created": "2021-10-21T19:08:30Z"
		},
		{
			"id": 10758209,
			"node": 259641,
			"comment": 770475,
			"type": "comment",
			"created": "2021-10-21T18:58:31Z"
		},
		{
			"id": 10758100,
			"node": 263299,
			"comment": 770472,
			"type": "comment",
			"created": "2021-10-21T18:58:10Z"
		},
		{
			"id": 10756643,
			"node": 268943,
			"comment": 770420,
			"type": "comment",
			"created": "2021-10-21T18:34:05Z"
		},
		{
			"id": 10755193,
			"node": 261156,
			"comment": 770349,
			"type": "comment",
			"created": "2021-10-21T17:52:44Z"
		},
		{
			"id": 10754801,
			"node": 261443,
			"comment": 770326,
			"type": "comment",
			"created": "2021-10-21T17:38:13Z"
		}
	]
}

I also noticed there might be missing a second comment fetching the last from the list do reference comments at least...


Debian jessie minimal (without the bloatware)

Hi,
First, thanks this great script! Although I still wonder why we just cant upgrade the gentoo kernel to full linux without chroot or dualboot. ;)
After succesfully trying ubuntu+lxde+xiwi+chrome, i wanted to try debian. I works fine, but it has a lot of bloatware like games, bittorrent, unwanted media tools.
I will try to uninstall them. But it would be nice if there would be an option to select the minimal install.
Debian has an option ' --variant=minbase' in debootstrap. I guess this would do the job?
Thanks in advance, flexjoly

I don't think crouton installs much bloatware by default?


feature: Paragraph.add_hyperlink()

Protocol might be something like this:
>>> hyperlink = paragraph.add_hyperlink(text='foobar', url='http://github.com')
>>> hyperlink
<docx.text.Hyperlink instance at 0xdeadbeef1>
>>> hyperlink.url
'http://github.com'
>>> hyperlink.text
'foobar'

XML specimen:
<w:p>
  <w:r>
    <w:t xml:space="preserve">This sentence has a </w:t>
  </w:r>
  <w:hyperlink r:id="rId5" w:history="1">
    <w:r>
      <w:rPr>
        <w:rStyle w:val="Hyperlink"/>
      </w:rPr>
      <w:t>hyperlink</w:t>
    </w:r>
  </w:hyperlink>
  <w:r>
    <w:t xml:space="preserve"> in it.</w:t>
  </w:r>
</w:p>

@robertdodd, @AKimZ: I continue @robertdodd's work and adding styles and multiple runs for the same link are possible now.

@tanyunshi Thank you! This is awesome. I wonder if you'll be able to merge what you have with the most recent version of python_docx (since we can adjust the color of text to be blue).

@johnzupancic, hihi, merge done here https://github.com/tanyunshi/python-docx/commit/90237e81a61810c7272c73fbef8edeb6b8be63bd

Hi guys,
Looks like adding hyperlinks now possible, but what about reading them from paragraph?
I have a problem that after reading text from paragraph I missed hyperlinks.
Can I do this using changes which done in this thread?

Hi @scanny
When this feature implementation on main repo?

Is adding a hyperlink now supported?

I'm curious if this will be implemented in the main repo as well. Otherwise great work on the project and the documentation is actually really useful.

@scanny Any chance of this being merged into the main repo?

Hi @Courthold , I dont think this will be merged into the main repo as it lacks tests and the API has not been vetted. Here comes the dicussion https://github.com/python-openxml/python-docx/pull/162.
The API might be need to vetted first (see also @gordeychuk).

For anyone needing a workaround you can use this function.
def add_hyperlink(paragraph, url, text):
    """
    A function that places a hyperlink within a paragraph object.

    :param paragraph: The paragraph we are adding the hyperlink to.
    :param url: A string containing the required url
    :param text: The text displayed for the url
    :return: A Run object containing the hyperlink
    """

    # This gets access to the document.xml.rels file and gets a new relation id value
    part = paragraph._parent._parent.part
    r_id = part.relate_to(url, RT.HYPERLINK, is_external=True)

    # Create the w:hyperlink tag and add needed values
    hyperlink = OxmlElement('w:hyperlink')
    hyperlink.set(qn('r:id'), r_id, )
    hyperlink.set(qn('w:history'), '1')

    # Create a w:r element
    new_run = OxmlElement('w:r')

    # Create a new w:rPr element
    rPr = OxmlElement('w:rPr')

    # Create a w:rStyle element, note this currently does not add the hyperlink style as its not in
    # the default template, I have left it here in case someone designs their own
    rStyle = OxmlElement('w:rStyle')
    rStyle.set(qn('w:val'), 'Hyperlink')

    # Join all the xml elements together add add the required text to the w:r element
    rPr.append(rStyle)
    new_run.append(rPr)
    new_run.text = text
    hyperlink.append(new_run)

    # Create a new Run object and add the hyperlink into it
    r = paragraph.add_run()
    r._r.append(hyperlink)

    # A workaround for the lack of a hyperlink style (doesn't go purple after using the link)
    r.font.color.theme_color = MSO_THEME_COLOR_INDEX.HYPERLINK
    r.font.underline = True

    return r

Great job!
How I can make hyperlink inside file to other paragraph ?

How I can make hyperlink inside file to other paragraph ?

It would be best to unzip a word document and figure out whats needed. Personally, to figure the above out I made documents with only the required feature in it, unzipped them and determined the code that differed. What made it easier was putting things in a table so you get logical containers for certain parts of code.
I would assume that you would use the above code and with the exception that the line
r_id = part.relate_to(url, RT.HYPERLINK, is_external=True)
would change to something like
r_id = part.relate_to(internal_tag, RT.HYPERLINK, is_external=False)
Then you would need to make an internal_tag for some other part of the document.

The workaround didn't work for me. I had to modify it to insert the hyperlink directly into the paragraph:
def add_hyperlink(paragraph, url, text):
    """
    A function that places a hyperlink within a paragraph object.

    :param paragraph: The paragraph we are adding the hyperlink to.
    :param url: A string containing the required url
    :param text: The text displayed for the url
    :return: The hyperlink object
    """

    # This gets access to the document.xml.rels file and gets a new relation id value
    part = paragraph.part
    r_id = part.relate_to(url, docx.opc.constants.RELATIONSHIP_TYPE.HYPERLINK, is_external=True)

    # Create the w:hyperlink tag and add needed values
    hyperlink = docx.oxml.shared.OxmlElement('w:hyperlink')
    hyperlink.set(docx.oxml.shared.qn('r:id'), r_id, )

    # Create a w:r element
    new_run = docx.oxml.shared.OxmlElement('w:r')

    # Create a new w:rPr element
    rPr = docx.oxml.shared.OxmlElement('w:rPr')

    # Join all the xml elements together add add the required text to the w:r element
    new_run.append(rPr)
    new_run.text = text
    hyperlink.append(new_run)

    paragraph._p.append(hyperlink)

    return hyperlink

document = docx.Document()
p = document.add_paragraph()
add_hyperlink(p, 'http://www.google.com', 'Google')
document.save('demo.docx')

@rushton3179 can you elaborate more? eg. how can we create the internal_tag?

@johanvandegriff  Your solution works fine for me. I just haven't mastered the skills needed to change color, font etc on the returned hyperlink. Can I get the function to return a 'run' instead so I can use run.style or run.underline?

@posterberg I don't know how to make a workaround that returns a run, but I have improved the current one to take the color and underline as arguments.
Here are the steps I took to change the text color, in case you need to add other properties:

Open the generated document in MS Word or LibreOffice and add a property by hand (in this case, change the text color).
Save the document
Unzip the .docx file (.docx files are normal zip archives).
Go into the word/ folder in the unzipped archive and open document.xml
It's a bit of a mess, so search for the link text (in this case "Google").
Look for the element that causes the property to change. For color it was <w:color w:val="FF8822"/> inside the <w:rPr> element. (Side note: rPr stands for "run Properties")
Add an argument to the add_hyperlink function
Add a block of code that adds the property to rPr.

    # Add color if it is given
    if not color is None:
      c = docx.oxml.shared.OxmlElement('w:color')
      c.set(docx.oxml.shared.qn('w:val'), color)
      rPr.append(c)

Last step: post your solution so other people can benefit from it.

Here is the updated workaround with control of color and underlining:
import docx

def add_hyperlink(paragraph, url, text, color, underline):
    """
    A function that places a hyperlink within a paragraph object.

    :param paragraph: The paragraph we are adding the hyperlink to.
    :param url: A string containing the required url
    :param text: The text displayed for the url
    :return: The hyperlink object
    """

    # This gets access to the document.xml.rels file and gets a new relation id value
    part = paragraph.part
    r_id = part.relate_to(url, docx.opc.constants.RELATIONSHIP_TYPE.HYPERLINK, is_external=True)

    # Create the w:hyperlink tag and add needed values
    hyperlink = docx.oxml.shared.OxmlElement('w:hyperlink')
    hyperlink.set(docx.oxml.shared.qn('r:id'), r_id, )

    # Create a w:r element
    new_run = docx.oxml.shared.OxmlElement('w:r')

    # Create a new w:rPr element
    rPr = docx.oxml.shared.OxmlElement('w:rPr')

    # Add color if it is given
    if not color is None:
      c = docx.oxml.shared.OxmlElement('w:color')
      c.set(docx.oxml.shared.qn('w:val'), color)
      rPr.append(c)

    # Remove underlining if it is requested
    if not underline:
      u = docx.oxml.shared.OxmlElement('w:u')
      u.set(docx.oxml.shared.qn('w:val'), 'none')
      rPr.append(u)

    # Join all the xml elements together add add the required text to the w:r element
    new_run.append(rPr)
    new_run.text = text
    hyperlink.append(new_run)

    paragraph._p.append(hyperlink)

    return hyperlink

document = docx.Document()
p = document.add_paragraph()

#add a hyperlink with the normal formatting (blue underline)
hyperlink = add_hyperlink(p, 'http://www.google.com', 'Google', None, True)

#add a hyperlink with a custom color and no underline
hyperlink = add_hyperlink(p, 'http://www.google.com', 'Google', 'FF8822', False)

document.save('demo.docx')

This function is the hyperlink equivalent of duct tape: It get the job done, but becomes harder to use when the complexity of the task increases.

Nice job @johanvandegriff :)
Just a note for anyone who doesn't know about it, opc-diag can be very handy for poking around inside .docx packages as an alternative to unzipping and reformatting the XML yourself. Also works for .xlsx and .pptx files.

@johanvandegriff Thank you so much!

How can I make the "inline_shape" as the hyperlink?

@scanny is anyone working on this? I was potentially going to pick it up this weekend and have a look at implementing it.

There was this pull request a while back but it stalled pretty early on: https://github.com/python-openxml/python-docx/pull/278
The comments on that PR should be good guidance. Best to start with the enhancement proposal (analysis document) so we can be sure we have the API sorted out. Can't change our mind about that later so it's best to get it right up-front. And implementing the wrong API isn't terrifically productive :)

I should add that most folks get stuck on the tests. If you're already a TDD guy these shouldn't be too surprising, but in any case you can usually find and adapt an existing example for both the acceptance tests and the unit tests. There's a lot of "repeating theme" going on in this particular application domain :)

If I create hyperlinks using the above workaround, what would the code to extract the URLs look like?

And indeed, having created a link like this
hyperlink = add_hyperlink(p, 'http://www.google.com', 'Google', '0000FF', True)
print p.text
You can no longer access the paragraph text. Is there a workaround?

see #85

@scanny would you be able to have a look over testing so far so I know I am on the right track?
https://github.com/rushton3179/python-docx/tree/feature/hyperlink-tdd
Also I have been thinking and do we need methods to be able to collect hyperlinks from a paragraph? My instinct would be to leave it as a more simple class as it begins to bring doubt on how collecting runs from a paragraph may work. I feel it may be better to leave them and if the original Hyperlink objects are not held onto by the project then they are considered lost to be created again. The core functionality of the Paragraph class seems to be to create paragraphs and not to parse and process them.

@rushton3179 It's probably best to continue this as a pull request (PR). That way there's a segregated "space" where all the proposed changes are, along with any review conversation we might have. As you rebase and re-push the PR branch on your repo, it updates things in the PR. If you haven't done it before you might want to read up.
Anyway, it's pretty flexible, so it's not too early to get one going.
I've left you some comments on your branch, but let's continue from here in a PR :)

@johanvandegriff I'm able to get the color (using '0000EE' as the default blue hyperlink color) using your workaround but not the underlining. Interestingly enough, when I open my document in WordPad I get the color and and the underlining, but in Word 2016 I only get the former. Have you come across this at all? (I'm currently using a Word macro as an alternative.)

@dmitriy5 I have been using LibreOffice, so I don't know if it works in Word. You might want to add the underlining in Word, save it, and see how the xml has changed.

Underline was not working for me in word either using @johanvandegriff code. To have it underline by default, you need to add:
      u = docx.oxml.shared.OxmlElement('w:u')
      u.set(docx.oxml.shared.qn('w:val'), 'single')
      rPr.append(u)

before you run new_run.append(rPr). You can also set 'single' to 'double' to double underline.

Hello, the solution is working for a new paragraph. But it's possible to use this to insert an hyperlink to a table in a docx document??
Something like this
row.cells[1].paragraphs[0].text = add_hyperlink(...)
Best regards

Hello,
I had a look all over Google to find a way to add hyperlinks to my .docx files using python-docx.
The only working solution i found was the code sample in this topic, bus as said @Naff16, it does not work in tables:
hdr_cells = table.rows[1].cells
p = hdr_cells[1].paragraphs[0]
add_hyperlink(p, ....)

the resulting .docx file is corrupted and can be restaured, but without the hyperlink...
Any idea/help ? My need is to add hyperlinks to others files on the PC (the .docx would be too heavy if i add all pictures directly, so I prefer storethem in an other folder, and just add hyperlink to them)
I know it works to add hyperlinks in the document, but I absolutely need to insert those hyperlinks in a table...
Thanks

Hello !
After several tests, it appears that the "does not work in tables" is, in my case, because the table I tried to insert the hyperlink in was copied from another .docx file using deepcopy(), and somehow, this is a problem. So the solution I found is:

insert the table in the document

#cartouche is a table deepcopied form an other .docx
p = self.document.add_paragraph()
p._p.addnext(cartouche._tbl)

2)then, insert the link in the table, which is the last table inserted in document

 for f in element.files:
            p_table = self.document.tables[-1].rows[2].cells[1].add_paragraph()
            file_name = f.split('/')[-1]
            file_path = 'EVIDENCES/{}'.format(file_name)
            # ajout du lien
            add_hyperlink(p_table,file_name, file_path)

this worked just fine for me

Hi!
How to add a hyperlink to an internal heading paragraph?

It's work for me (Libre)
Thanks @neilbilly !
def add_bookmark(run, bookmark_name):
    ''' Adds a word bookmark to a run '''
    tag = run._r
    start = docx.oxml.shared.OxmlElement('w:bookmarkStart')
    start.set(docx.oxml.ns.qn('w:id'), '0')
    start.set(docx.oxml.ns.qn('w:name'), bookmark_name)
    tag.addprevious(start)

    text = docx.oxml.OxmlElement('w:r')
    tag.append(text)

    end = docx.oxml.shared.OxmlElement('w:bookmarkEnd')
    end.set(docx.oxml.ns.qn('w:id'), '0')
    tag.addnext(end)

    return run

As for a common case, I have a text like """I am trying to add an hyperlink in a MS Word document using docx module for Python. Just do it.""", and keyword for "Python", link for "python.org".
Just add a function based on @johanvandegriff ,
`def add_text_link(document, text):
paragraph = document.add_paragraph()
text = re.split(r'|',text)
keyword = None
for i in range(len(text)):
if not is_text_link(text[i]):
if text[i] != keyword:
paragraph.add_run(text[i])
elif i + 1<len(text):
url=text[i]
keyword=text[i + 1]
add_hyperlink(paragraph, url, keyword, None, True)
document.save('test.docx')`

        p_table = self.document.tables[-1].rows[2].cells[1].add_paragraph()

Thank you for this!
This is the bit I needed to properly reference the paragraph so I could insert a hyperlink in a cell.  All working now.

We also got it running with @johanvandegriff 's solution, thanks! Once the feature is shipped then we'll move to the official solution :) thanks guys

I thank you all for the works trying to improve this wonderful project.
Sorry I have not a real understanding of how all these implementations work, but please take this comment into account before merging code into an official solution.
I tried many of these code samples trying to add links to a document, using both examples given here and in StackOverflow.
Although many of them worked, in the sense that hyperlinks do appear when I open the docx file in Word, ... there is still something which must be different to the standard .docx way of hyperlinking.
I say this because when I upload these docx files to Google Drive in order to share them ... the hyperlinks get lost after conversion to Google Docs format (which I do because this format does not consume my Drive quota).
This does NOT happen to hyperlinks in an "standard" .docx file created with MS Word (they still remain when you convert them to Google Doc format).
This might seem irrelevant to many of you, but I think it reveals some error in the way hyperlinks are being created.  It could affect to future conversions/compatibility of your files (I just tried Google Docs but there might be other conversions which are already failing).
Fortunately, I found one implementation in this thread (thanks @michaelu123) where hyperlinks are not being lost. There is a similar implementation by @brasky in #610 too.
So @johanvandegriff @scanny @tanyunshi @robertdodd @ryan-rushton ... please take a look at @michaelu123 code before making a final version.
Thanks a lot again to all of you!!

I'm trying to add a hyperlink to my table inside of one of the cells, but when I use this method it messes up the spacing of the column. The hyperlink isn't wrapped around in the cell like I want it to be.

how to add file logo in the place of hyperlink

This issue is 8 years old and a basic part of docx, can this be implemented

It seems there is little new code accepted in this repo nowadays. Should we be pushing @mimino666 to https://github.com/BayooG/bayoo-docx instead?

This issue is 8 years old and a basic part of docx, can this be implemented

python-docx is well-designed in terms of its low-level API but not very satisfying on its high-level API. Everything can be done utilizing its low-level API as long as you are familiar with WordProcessingML, but there're so many basic functions that are not implemented such as insert paragraphs, insert field codes, insert hyperlinks and so on, which are not that complicated to implement (most of them can be done within dozens of lines of code.
If this is the design philosophy of the owner, I think maybe we need a radical fork of the project, where we can implement all these features.


Pitch: String processing algorithms

@itingliu let me know when's a good time to do another pass over the prose. I don't want to conflict or interrupt any reorganizing you're doing.

Overall LGTM. I think some of the "backwards" future direction is salvageable and should be mentioned, but it doesn't need to be presented as a big deal.
After that, ship it!

I reworked it a little bit and added it back. Thanks!

@swift-ci please test


Add a simple hostport-to-service proxy

Example: a pod like the  below should
proxy port 53 TCP and UDP to the main DNS service.
apiVersion: v1beta3
kind: Pod
metadata:
  name: localhost-dns-proxy
spec:
  containers:
  - name: proxy-udp
    image: thockin/proxy-to-service:1.0
    args: [ "udp", "53", "kube-dns.default" ]
    ports:
    - name: udp
      protocol: UDP
      containerPort: 53
      hostPort: 53
  - name: proxy-tcp
    image: thockin/proxy-to-service:1.0
    args: [ "tcp", "53", "kube-dns.default" ]
    ports:
    - name: tcp
      protocol: TCP
      containerPort: 53
      hostPort: 53

risk: none (it's contrib)
rationale: allow people to bind services to low ports.

@justinsb @bgrant0607 it's a stop-gap but useful, I think.

Needs a README.md.
Put the YAML in the PR description into a file and update it to v1.

@thockin thank you very much for your help with this. I'm probably missing something, but I need to get udp:53 traffic from outside the k8s cluster (coming from the google load balancer) into the cluster. My current understanding was that I need to use NodePort in order to listen for traffic from outside the k8s cluster - if I run this pod on every minion would I then just send traffic from the load balancer to every minion and not run a service object at all?

If this pod is used with a replication controller with replica count = node count, the scheduler should automatically have one pod per node, to avoid host port conflicts.

The service needs to be run as well..
The dns request path would be : request comes to this pod, goes out to the service ip:port, finally reaching the cluster dns pod.

@bgrant0607 README added
@statik I'm afraid there is no to use kubernetes to control a UDP Google Cloud balancer yet.  That said, you might be able to do a semi-manual install.  First, you need to run a Service in your cluster, no matter what.  You don't need to make it a NodePort Service in this case - the node port is not helping you.  Second, run this new pod on one or more nodes, claiming HostPort 53 and forwarding to your own Service.    Lastly, open the firewall for 53.
This is theoretical.  I tried setting it up and it did not quite work yet.  I can see the packet on tcpdump on the receiver and the name lookup appears to happen.  The packet is sent back but does not arrive properly.  I don't know if it has to do with NAT or something else on my client side.
I have to run off now, but I can try to look more later.

This is related to https://github.com/GoogleCloudPlatform/kubernetes/issues/9995 correct?
I like this solution since it seems to be the most reliable way to avoid port collisions, shouldn't affect error handling and doesn't change the model for higher port numbers.
Just my 2 cents.

@ArtfulCoder thanks!
@thockin thanks! This explanation helps a lot. I will try it now. I think what I was missing before was that I could get the GCE load balancer to send traffic in to the nodes even without using NodePort.
Based on my previous experimenting with running our dns service behind a google load balancer outside of k8s, I believe that for UDP responses to work correctly the dns service needs to specify the Source IP of the UDP response packet by bind()ing to the (nonlocal) external IP of the load balancer - otherwise the UDP response does get sent back out through the firewall and load balancer but the client (such as dig) will be unhappy that the source IP does not match and will discard the response.

If I do it direct to the node:53, rather than the GCLB it works.

Indeed, setting this up on TCP works.

@thockin Got push?

pushed

LGTM

@k8s-bot test this please

@thockin - is this safe to merge, or are the consecutive e2e failures indicative of a real problem?

this is safe to merge. changes are in contrib folder, the e2e failures are for different reasons each time.

Added ok-to-merge. This is contrib, and not used for testing.


Can we train with this yet?

Just wondering if we can train with LJS on this implementation thanks!

Hi @EmElleE , yes you could but need to tune hparam for residual encoder and it is really close to.

@keonlee9420 quick question do you have the LJS Model? I would like to finetune on this, do you know how much data is required for fine tuning? also is the quality close to tacotron2? it seems like these days people use tacotron2 because it works well cloning voices. Do you think Parallel-Tacotron2 is similar or capable ?

Hi @ArEnSc , I don't have it yet, but I'll share when I get it. But please note that the result would be much worse than expected since the maximum batch is too small compared to the original paper.

Take a look at this:
speaker_embedding_m = speaker_embedding.unsqueeze(1).expand(
    -1, max_mel_len, -1
)

position_enc = self.position_enc[
    :, :max_mel_len, :
].expand(batch_size, -1, -1)

enc_input = torch.cat([position_enc, speaker_embedding_m, mel], dim=-1)

speaker_embedding_m and mel both have max_mel_len in channel-1, but position_enc has max_seq_len+1 which is different. Therefore torch.cat will raise exception
Am I right?

Hi @phamlehuy53 , position_enc also has max_seq_len in the last dimension.

Hi @phamlehuy53 , position_enc also has max_seq_len in that dimension.

But you notice that speaking_embedding_m and mel have max_mel_len instead, don't you?

oh, sorry I mistyped. position_enc has max_mel_len, not max_seq_len.
position_enc = self.position_enc[
    :, :max_mel_len, :
].expand(batch_size, -1, -1)

oh, sorry I mistyped. position_enc has max_mel_len, not max_seq_len.
position_enc = self.position_enc[
    :, :max_mel_len, :
].expand(batch_size, -1, -1)

Yep, when max_mel_len is higher than max_seq_len, the 1st dim of position_enc is sitll max_seq_len in length. That makes mismatch of dim in torch.cat's arguments


Configurable Label Name + Optional CgroupParent as Label Value

This PR adds 2 features + changes the way --owner-label works for consistency:

The ability to specify the --label-name used for new resources/filtering (defaults to the previous com.buildkite.sockguard.owner key/name)
The ability to use --label-value (instead of --owner-label) to set an arbitrary value for the label.

If you use --owner-label it will output a deprecated error explaining to use the new syntax
Default value is the same sockguard-pid-# value if no flag specified

Adds an optional --label-value-cgroup-parent flag to use the value of CgroupParent on the running container as the label.

This allows doing some creative things such as "auto GC" of all resources created via this sockguard instance on termination of some sidecar (eg. a well configured docker-gc)
For our infra, I plan to run a bash wrapper in a container, that when it detects SIGTERM it will fire off docker-gc and cleanup all resources with the right label, regardless of age.
This ensures when our Jenkins agent ECS task terminates, it cleans up anything left behind by the running job (we have found different test suites notorious for leaving junk running to cleanup later)

Note: for this to cleanly merge/build, we need https://github.com/buildkite/sockguard/pull/5 finalised and merged to master. Feel free to review what is going on here in the meantime, but don't merge until the other PR is done and dusted, thx.

I'm not sure I understand what is going on here 🤔Can you walk me through the problem you are trying to solve @CpuID?

@lox the name change is self explanatory I hope, but more cosmetic than anything else. Also the change from owner-label to label-value is mostly to align with the fact the label name can be something other than owner.
The likely more interesting part is --label-value-cgroup-parent, which since we will run sockguard as a unique sidecar container per Jenkins agent in our topology, we will then be able to reference which containers were spawned by which Jenkins agent instance (based on the common CgroupParent value). This also allows us to garbage collect those resources on ECS task termination (also via a sidecar that does the cleanups during the 10-30~sec window we have after a SIGTERM is sent before a SIGKILL is fired). Docker by default uses 10 seconds for SIGTERM -> SIGKILL, but we have ours a little higher in ECS currently to allow for graceful shutdowns etc.
All filtering/label addition operations should work as they originally were designed here, the desire is not to change that logic. If you spot any errors in that, obviously let me know :)

Changing it away from a simple owner label makes it heaps harder to grok what sockguard is doing at first glance. It's important to me that it's purpose is clear and it's easy to audit. I'm trying to get my head around why you'd want different labels in a broad set of use cases.

Is your intention here to just support the addition of arbitrary labels?

Or is the intention to allow a single sockguard socket and support a hierarchy of namespaces of security domains? I reckon that would need a bit more thought, as it's not what I had in mind when designing the existing implementation.

Changing it away from a simple owner label makes it heaps harder to grok what sockguard is doing at first glance. It's important to me that it's purpose is clear and it's easy to audit. I'm trying to get my head around why you'd want different labels in a broad set of use cases.

I mostly just wanted to take the buildkite name out of our label filtering tbh... :) I plan to use a single unique label name throughout our infra, I'm sure others may want to do the same potentially.

Or is the intention to allow a single sockguard socket and support a hierarchy of namespaces of security domains? I reckon that would need a bit more thought, as it's not what I had in mind when designing the existing implementation.

No intentions of going that complexed, just allow the user of sockguard to pick the name of a single label to use for filtering + applying to new resources. Same functional concept as today, all operations use one name=value.

Or is the intention to allow a single sockguard socket and support a hierarchy of namespaces of security domains? I reckon that would need a bit more thought, as it's not what I had in mind when designing the existing implementation.

One thing to note, the PID approach doesn't work so well when run in a Docker container, as it's always sockguard-pid-1 most likely. Hence the uniqueness of a CgroupParent, I can foresee other variations here as well (container ID?), future PRs welcome for that :)

I'd be fine with changing the owner to sockguard.owner, and I'd also be fine with a --label parameter for adding extra labels, but I'd like to keep the simplicity of a predictable owner tag at this stage.

I'm fine with not adding the ability to apply >1 extra labels here, a single label feels perfectly fine. I'd mostly likely to provide flexibility over the name and value of the label. I'd argue allowing >1 labels is easy for applying to new resources, but adds a bunch of complexity on filter operations (do you filter on all labels matching? or at least 1 matching? etc etc)

but I'd like to keep the simplicity of a predictable owner tag at this stage.

If you want to go with sockguard.owner as a consistent label name, thats an acceptable compromise for now.

I'd definitely like to keep --label-value-cgroup-parent as part of all this, to allow our GC mechanism to work as designed.

I'm fine with not adding the ability to apply >1 extra labels here, a single label feels perfectly fine. I'd mostly likely to provide flexibility over the name and value of the label. I'd argue allowing >1 labels is easy for applying to new resources, but adds a bunch of complexity on filter operations (do you filter on all labels matching? or at least 1 matching? etc etc)

This is why I think it's important to keep things simple and use an owner tag with a unique value. I'd be fine with swapping that value to be a unique value to a random value or a uuid. The addition of tags wouldn't be filtered on, it would purely be informational or to play nicely with your other systems that look at tags.
FWIW, I'd planned for these sorts of customizations to happen outside of sockguard.  Can't we just provide things like --cgroup-parent and --owner and let folks provide all this custom stuff with a bash script wrapper?

FWIW, I'd planned for these sorts of customizations to happen outside of sockguard.  Can't we just provide things like --cgroup-parent and --owner and let folks provide all this custom stuff with a bash script wrapper?

My main motivator for doing --label-value-cgroup-parent within sockguard as opposed to a bash wrapper is the LoE involved to obtain the correct value is non-trivial (as we've seen, 2 step approach), and duplicating that for --inherit-cgroup-parent in go here + reimplementing it in bash to feed into a --label-value (or equivalent) arg feels anti-DRY :)
I can see where you are going though, remove --inherit-cgroup-parent from sockguard + skip --label-value-cgroup-parent, and do both in bash (or some outside go binary, likely bash though) and use the input var to feed both CLI args to sockguard. Yea?

I don't mind adding smarts to sockguard, I just really hate maintaining code. We do annual external security reviews too so I'm always mindful of adding complexity that I have to audit, explain to security researchers and support too.
I'm always happy to be convinced, but me default position is generally to avoid adding too many ways to customize a thing.
Is there much point in adding --label-value-cgroup-parent vs using a uuid for owner? Seems like switching the owner to a uuid is just a good sensible default, which are my favourite kind of defaults.

The non-deterministic aspect of what that label value is feels like it may have unintended future consequences, hence preferring to use the deterministic value of CgroupParent. At least then I can follow the breadcrumbs back (knowing that value will reference an ECS Task ID in our use case), whereas a generated UUID will have no traceability.

Right, agreed, let's focus on that problem! What if we kept the owner a simple non-deterministic unique value, but added ways to add informational tags. We have things like --tags-from-ec2 and --tags-from-gcp in buildkite-agent, perhaps we could have --labels-from-ecs or --labels-from-docker in sockguard?
In terms of cleanup, seems like there are lots of options. You can either clean up all sockguard resources with docker system prune --filter "label==buildkite.owner" or filter on a specific label that you add.
I'd be totally up for --cleanup-on-shutdown removing all tagged resources when sockguard exits.

I'd be totally up for --cleanup-on-shutdown removing all tagged resources when sockguard exits.
Ah, although I remembered that you are running sockguard in a long-lived mode in ECS, which I'm still a bit unsure about. sockguard was designed to be run in the background up for once-offs runs.

In terms of cleanup, seems like there are lots of options. You can either clean up all sockguard resources with docker system prune --filter "label==buildkite.owner" or filter on a specific label that you add.

I can't cleanup all resources with that owner tag (against a non-guarded socket), as there could be N Jenkins agents on a single VM (the Jenkins plugin seems to fire off a new ECS task for each job, which spawns an ephemeral agent, completes the job then terminates it). If there were 2 on a system at once, I would be causing race conditions by terminating Docker resources prematurely.
Terminating all resources via a guarded socket on SIGTERM (via a sidecar) without filtering seems the most logical, and depend on the guarded socket to only return resources with the correct owner in list volume/image/container operations. I'm perfectly fine with this approach.

I'd be totally up for --cleanup-on-shutdown removing all tagged resources when sockguard exits.

This feels like scope creep on the sockguard side. Just firing docker-gc on SIGTERM (via a sidecar) against a guarded socket feels more portable/less reinventing the wheel :)

the Jenkins plugin seems to fire off a new ECS task for each job, which spawns an ephemeral agent, completes the job then terminates it

Right, so are you planning on creating a sockguard sidecar for each job?

What if we kept the owner a simple non-deterministic unique value

See https://github.com/buildkite/sockguard/pull/11#issuecomment-408721755 - I'd like to keep it deterministic for breadcrumb/traceability purposes.

but added ways to add informational tags. We have things like --tags-from-ec2 and --tags-from-gcp in buildkite-agent, perhaps we could have --labels-from-ecs or --labels-from-docker in sockguard?

I can see potential use cases for these, especially if you were using Docker in Swarm mode as the backend/upstream Docker socket. In this instance the container may not actually be on the local VM/system, and tagging might be useful to determine it's origin etc.
Outside of that, we don't have a use case (at least not now) requiring the addition of arbitrary informational tags/labels to resources. My other worry here would be scope creep/dependency bloat of having to interrogate external systems to populate any of those --tags-from-* / --labels-from-* args with values. To use your words: "Add extra complexity as it's merited by actual use-cases vs pre-emptively is generally my philosophy" :)

I think I know where to go with this PR + https://github.com/buildkite/sockguard/pull/5 now, I'll go over it tomorrow and let you know when both are ready for review. I think they will yield less code in the end.

I think I know where to go with this PR + #5 now, I'll go over it tomorrow and let you know when both are ready for review. I think they will yield less code in the end.

Sounds good!

Right, so are you planning on creating a sockguard sidecar for each job?

Yep thats what we do today (already using it via https://github.com/CpuID/sockguard/tree/forked-with-extra-features while these PRs are finished for merge) :) ECS fires off a task with 2 containers (soon to be 3): jenkins agent, sockguard, and (soon) docker-gc.

Ok right, I was concerned you'd have sockguard running across multiple jobs. Instance per job is aligned with how we've designed things 👍🏻

@lox I'm going to close this PR and start a new one, and just vary the ownerKey hard set label name in it. I think the rest of this can be culled based on discussions above yea? Also since my bash wrapper is now detecting CgroupParent I can feed that into owner-label instead.


Possible to pass a directory?

is it possible to pass a directory for translation?

Currently not supported, but considering it!

Supported in v1.1 :tada:
Please check the release for specific instructions.
https://github.com/3ru/gpt-translate/releases/tag/v1.1


Inverse Abel's transform with already-integrated data

I have been working on a plasma physics-based experiment and dealing with some flux recordings arranged as a matrix of n observations (rows) and m channels (columns). Starting from each row, which consists of m line integrals along pre-defined lines of sight, whose spatial orientation is known in terms of polar coordinates (radius and angle), I would use the PyAbel package to reconstruct the original, spatial 2D profile from these line integrals. Is it possible?
Just to give you an idea, this is a piece of code I wrote from scratch:
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import os
import abel
# Upload data
rootDirectory = Path(os.path.dirname(os.path.realpath(__file__))).parent
shot          = '42830'
fileName      = '\Shot_' + shot + '_Ordered_By_Impact_Parameter_Filtered_68_Channels.csv'
fullPath      = str(rootDirectory) + '\Results\Files' + fileName
wholeData     = np.loadtxt(fullPath, delimiter = ",")
nRows, nCols  = np.shape(wholeData)
# Mean by columns
nSamples     = 10000
if nSamples > nRows:
    nSamples = 500
selectedData = wholeData[0:nSamples,]
inputData    = np.mean(selectedData, axis = 0)
# Run the inversion
outputData = abel.direct.direct_transform(inputData, direction = "inverse", correction = True)
# Visualisation
plt.plot(outputData)
plt.show()

Apart from trivial operations for data loading and selection (I do not want to use all the rows momentarily, therefore I decide to pick just a reduced number of rows and average them so that inputData is the 1D input vector for the algorithm), I do not know whether the transformation is properly executed. Consider that the 1D array that the transformation outputs ought to be "rotated" around its axis to create a surface.
If you may help to figure this out, I would really appreciate (so far, I have not found anything useful in the documentation, but that will be just my fault). Thanks in advance!

Hi @spinang!
I'm a little confused about exactly what your data corresponds to. Is there a previous paper that shows how the data is collected, or can you provide a drawing or something? Is the experiment indeed taking a projection of a 3D object as shown in this figure: https://user-images.githubusercontent.com/1107796/48970223-1b477b80-efc7-11e8-9feb-c614d6cadab6.png It sounds like the data is perhaps recorded in polar coordinates instead of cartesian, which would differ slightly from that figure.
For your example code, we would need the data file to really play with it. If it's okay with you, perhaps you can upload that too so that we can run your example. You could use a Github Gist   to upload the file and then include the link here. Or, if you'd rather not share your experimental data, prepare some sort of basic example that we can look at.

Hello @DanHickstein, thanks for replying me so soon.
I am sorry if my comment was unclear, let me try to explain it better. As far as I understood, to perform the inverse Abel's transform the package relies on 2D or even 1D profiles, such as Gaussian curves as shown in many examples throughout the documentation. The problem I have been trying to solve is slightly different, because the data I have at disposal are ALREADY line integrals through an unknown, spatial profile I have to rebuild. To help you to understand, I have reported a picture that shows the scenario of my interest:

Each chord is a line projection fully identified by an angle and a radius (or impact parameter) and each column within my data set is essentially a chord (i.e., each of the m columns). Thereby, each pair (row, column) determines the value of a line integral at a given time, for a given chord. What I would like to do is to feed these rows into the algorithm for Abel's inversion and obtain the spatial profile again or, at least, a planar representation that ought to be symmetrically "rotated" around its axis to get the final surface. I am sorry I cannot provide you the data, because they are reserved for ongoing research purposes at the moment.
Please let me know if there are further details you need and I will try to give you them at the earliest opportunity.

@spinang note in the PyAbel example image, the 3D distribution has cylindrical symmetry. The 2D projection is the integrated intensity through the 3D distribution along the x-axis. i.e. each pixel of the 2D projection is similar to the chord measurement that you describe.

Where is the cylindrical symmetry axis of your distribution? Are your measurements relative to a fixed position of the symmetry axis?

@spinang,
Does your object have cylindrical or spherical symmetry? At least cylindrical symmetry is a requirement of the Abel transform.
Also, for each time, you say that you have many chords (projections at a specific radius and angle). In our typical situation, we also have projections, but they are all at the same angle and at various, evenly spaced radii.

Hi @spinang, I hope that you found a solution to your problem. I'm going to close this issue for now for bookkeeping purposes. If you'd like to continue the discussion, just post here and I'll re-open the issue, or start a new Issue with a new question. I hope you are enjoying using PyAbel!

Hi @spinang, I hope that you found a solution to your problem. I'm going to close this issue for now for bookkeeping purposes. If you'd like to continue the discussion, just post here and I'll re-open the issue, or start a new Issue with a new question. I hope you are enjoying using PyAbel!


Implement GET /cards/multiverse/:id

Closes #13.

Codecov Report

Merging #63 (bd8af09) into main (9f322ab) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #63   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files           40        40
  Lines          652       671   +19
=========================================
+ Hits           652       671   +19

Impacted Files
Coverage Δ

lib/src/scryfall_api_client.dart
100.00% <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 9f322ab...bd8af09. Read the comment docs.

Codecov Report

Merging #63 (bd8af09) into main (9f322ab) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #63   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files           40        40
  Lines          652       671   +19
=========================================
+ Hits           652       671   +19

Impacted Files
Coverage Δ

lib/src/scryfall_api_client.dart
100.00% <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 9f322ab...bd8af09. Read the comment docs.


Add factory_girl_rails and faker to production Gemfile for generating demo data

Who is this PR for?
developers
What problem does this PR fix?
Running bundle exec rake db:seed for the production demo site fails, because the seed task uses FactoryGirl and Faker and those gems aren't installed.  I think this was introduced in https://github.com/studentinsights/studentinsights/pull/1508, which removed FakeIncident to consolidate into the DisciplineIncident factory and use it in seeding.
Alternately, we could remove FactoryGirl from the seed path, but that may lead to forking the demo data and test data uses.
What does this PR do?
Adds both gems to the production Gemfile.  I deployed this to the demo site and ran it manually to verify it works.
There's probably some minimal memory overhead for these gems, and this is pure waste in production since we're not using these in the production sites aside from the demo site, but I'm not sure we need to worry about that right now.

This looks good to me!


Is it possible to replace charting_library with lightweight-charts?

Currently frontend depends on a private repo charting_library of trading view which I guess need to be paid to gain access. Trading view has an open source chart, do you guys have an estimation on the feasibility of using it to replace charting_library?

I'll look into it and see! I think it's possible but I'll need to look into it to see how limited lightweight-charts is compared to what the current frontend is using

Closed in #217


Update package.json: newest version of sharp.

Any sharp version below 30.6 are vulnerable to a remote code execution: https://snyk.io/vuln/npm:sharp.

Hi,
just saw the branches from dependabot. When do you guys think you merge it?
Thank you


Memory management issue with the playlist demo

Description of the problem
The demo playlist player does not seem to be correctly released when using split view on iPad.
Relevant stack trace or log output
No response
Reproducibility
Always
Steps to reproduce

Open any playlist demo on an iPad with split view enabled.
Resize the split view while playing.
Now close the player. Sound continues in the background.

A few remarks:

Simple players are not affected, only the playlist demo is.
When sound is still heard in background, resizing the split view on the showcase list fixes the problem.

Library version
0.1
Operating system
iPadOS 16.2
Code sample
No response
Is there an existing issue for this?

[X] I have searched existing issues and found no similar bug report.

The issue seems already present on macOS (even easier to reproduce). Requires #228 to be fixed first, though.

The issue also affects the iPhone:

Display the playlist demo.
Open the item list.
Rotate the device. Close the list without any choice.
Rotate the device and close the player. Sound continues in background.

Rotating the device once more with the player closed fixes the issue.

Fixed by cleaning state management and moving to the iOS 16 navigation API, see #421.


Different pnpm versions used for local and docker builds

For local builds, it uses 8.14.0, for docker it's 8.9.0. Should we bump the docker to 8.14.0?
https://github.com/verdaccio/verdaccio/blob/3b3cf86b54dfbcd4cabb50b8cd3ae79821f3cf83/package.json#L187
https://github.com/verdaccio/verdaccio/blob/3b3cf86b54dfbcd4cabb50b8cd3ae79821f3cf83/Dockerfile#L14

Oh yeah, well the Dockerfile at root is not entirely used right now, the official one is 5.x but I think the whole docker file on the master branch might need some big clean up.

I did a 3way comparison. I now see the docker setup in master is very different from 5x and 6x. Learning more about the incredible automation setup in this project 👍


Add possible id attribute 'id'

I'm kind of surprised I needed this change, but I don't have control over the XML I'm receiving and need to validate its signature.

@cava23 can you add a test case? 😄

Certainly!

published in v0.8.5


Automatic replacement of MC NotReady nodes

Similarly to what we do on WCs, we should have an automatic replacement feature of MC nodes when they get not ready

@giantswarm/team-hydra is there any feature like this implemented in the CAPI world?

CAPI does have the concept of health checks for machines. Unfortunately, it only works with machine deployments and not with machine pools because a machine resource CR (or machine set CR) needs to be present.

Waiting for CAPA to stabilize implementation of machinepools/machinedeployments

did some progress in giantnetes-terraform 14.12.0.
We run a script in the masters that take the node down if services are down

In CAPI all MCs will also be WCs at the same time (with all CAPI CRs and managed my CAPI), so it will be possible to use MachineHealthChecks (however well/bad they work).
Currently it should be possible to use MachineHealthChecks for control plane nodes and workers created with machine deployments (CAPG and CAPZ, and I think all onprem providers).
When it comes to MachinePool support (currently used in CAPA), there is an open PR to implement MachinePoolMachine, which should then make it possible to implement MachineHealthChecks for MachinePool as well.

CAPA is currently using it for the control planes nodes.

Nowadays I think this is a duplicate of https://github.com/giantswarm/giantswarm/issues/28006. I think I'd close this one @T-Kukawka

agreed, closing


Remove logical cross join in planning

Which issue does this PR close?

Closes #.
Rationale for this change
This simplifies (optimization) code dealing with logical plan, as it only has to deal with LogicalPlan::Join.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

This is now ready for review


fix: #15

Hello,
This error (#15 ) is raised by old navigators (like LG WebOs 3.0 or old Samsung Tizen models).
Best Regards,

Hi there, is there any progress on this pr? Facing the same issue.

Did this ever get fixed/ released? I'm seeing the same issue in Chrome 70, 37 and 99 (weirdly, as I thought this issue only went to 80)


fix: large DraggableFloat composables break close float move

was using wrong coercion values on DraggableFloat's followFloat fn


CP-121: Django 1.9 Upgrade (backwards compatible changes, part 2)

See an overview of the changes here.

Closing because changes got merged into mvne-platform #4776.


Update for eForms

TO-DO:

[x] Move SimpleIdentifier definition to ocds_1_2_draft_extension

I'm mid-review - I'll try to finish it today.

I created an issue about removing non-conformant content from the standard's schema descriptions: https://github.com/open-contracting/standard/issues/1610


Invariant Violation: Invariant Violation

🐛 Bug Report
Most of the times one of my page.something actions fail, I get a Invariant Violation: Invariant Violation error, paired with the proper "Jest formatted" error (for example,  No node found for selector: [data-action="blabla"])
To Reproduce
I'm not sure what's the proper way to reproduce it, to me it happens without doing anything more than running await page.waitForSelector('foobar') and waiting for the timeout to fail the action.
Expected behavior
I would expect to see just the No node found for selector: [data-action="blabla"] error.
Link to repl or repo (highly encouraged)
I'll see what I can do to provide one, sorry.
Run npx envinfo --system --binaries --npmPackages expect-puppeteer,jest-dev-server,jest-environment-puppeteer,jest-puppeteer,spawnd --markdown --clipboard
Paste the results here:
## System:
 - OS: macOS 10.14.4
 - CPU: (4) x64 Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz
 - Memory: 817.66 MB / 24.00 GB
 - Shell: 5.3 - /bin/zsh
## Binaries:
 - Node: 11.14.0 - /usr/local/bin/node
 - Yarn: 1.15.2 - /usr/local/bin/yarn
 - npm: 6.7.0 - /usr/local/bin/npm
## npmPackages:
 - expect-puppeteer: ^4.1.1 => 4.1.1
 - jest-puppeteer: ^4.1.1 => 4.1.1

Hello @FezVrasta, writing integration test is hard. Be careful of writing your selector carefully and try to pause your test to see what's going on.

Oh, never-mind, it seems to be app specific, sorry for that!


[SPARK-44747][CONNECT] Add missing SparkSession.Builder methods.

What changes were proposed in this pull request?
This PR adds a couple methods to SparkSession.Builder:

conf - this group of methods allows you to set runtime configurations on the Spark Connect Session.
master - this is a no-op, it is only added for compatibility.
appName - this is a no-op, it is only added for compatibility.
enableHiveSupport  - this is a no-op, it is only added for compatibility.

Why are the changes needed?
We want to maximize compatiblity with the existing API in sql/core.
Does this PR introduce any user-facing change?
Yes. It adds a couple of builder methods.
How was this patch tested?
Add tests to SparkSessionSuite and SparkSessionE2ESuite.

@HyukjinKwon PTAL

Merged to master and branch-3.5.

create https://issues.apache.org/jira/browse/SPARK-44750?filter=-2 to track the python side, will work with @michaelzhang-db on it


SIGTERM

Hello,
First, TY for your package. I am learning a lot of Node.js reading the source. It is very clean.
Currently, I have doubts about stopping the agent. If I create a simple source, like this one:
const agent = require('skyapm-nodejs');

agent.start({
  serviceName: 'foobar',
});

process.on('SIGTERM', function () {
  process.exit(0);
});

I can stop the process. Without SIGTERM handling, it will never stop.
Is it right? Is there something to gracefully stop the agent?

BTW, I am trying to develop a plugin for mongodb and fastify.

Is it right? Is there something to gracefully stop the agent?

There may be some timer/setTimeout that are not .unrefed, you can find them out and unref them, but basically, in reality, we usually kill the process actually

BTW, I am trying to develop a plugin for mongodb and fastify.

Welcome to contribute


Changed IDs of pictures

I think you may have branched from the wrong commit! Please rebase to master


Added first() method to ActiveRecord and Query classes.

Q
A

Is bugfix?
no

New feature?
yes

Breaks BC?
no

Tests pass?
yes

Fixed issues

Find one selects all data from DB and then reduce it to one record.
Find first set limit to returned data.
For example, you can execute this:
$lastLog = BigLogTable::find()->orderBy(['insert_stamp' => SORT_DESC])->one();
And you do not suspect that all entries will be selected before result truncated to one record.
This speciality discussed on yii forums, but not included in repository yet.

Feature rejected: such code overcomplication is not justified.

@klimov-paul, in 99% of cases it's necessary to use a limit.
Very-very small cases needs to use one() without limit().
Many peoples don't know that need to use limit() before one() because it's implicitly.
May be change default behavior and append limit everytime?
But when you need no limit for optimization, you can add limit(false) before one()?

Also ->first() is less obvious than ->limit(1)->one() to the reader of the code.

I think that it's conversely.
Set limit(1) before call one() looks strange.
Adding first() method desides this.


OkGlobal Coin Singapore logo upload

Token Address
https://scan.tomochain.com/address/0x37c8c4fd1434de2d50be39079c14070172a3838f
Token Symbol
OKGSG
Token Name
OkGlobal Coin Singapore
Token Logo
PNG 256px by 256px
Token Description
Security coin issued by OkGlobal Coin Singapore
Website
www.okglobalcoinsg.com
Social links
e.g Github, telegram, twitter


Push required client

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

@anangaur Can you review my edits here? I believe you meant to say that nuget.exe 4.3.0 is required for nuget.org, but is that true for all other package sources? I wouldn't think it is, so my edits make it clear that the requirement is for nuget.org specifically.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs/Create-Packages/Publish-a-package.md
:white_check_mark:Succeeded

docs/Create-Packages/Symbol-Packages.md
:white_check_mark:Succeeded

docs/Tools/nuget-exe-CLI-Reference.md
:white_check_mark:Succeeded

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.

@kraigb makes sense. I have updated the text. I will be merging these in now.


escape dash

hi. is there any way to escape the dash (minus sign) character ?
jexl
  .eval('foo-bar == "foobar"', {
    "foo-bar": "foobar"
  })
  .then(console.log)
  .catch(console.error);

results false

Jexl is very similar to Javascript in that top-level variables in the context cannot contain dashes, start with a number, etc. But it's also similar to javascript in that, if it's not at the top level, you can quote it:
const context = { baz: { 'foo-bar': 'foobar' } }
const res = jexl.evalSync('baz["foo-bar"] == "foobar"', context)
console.log(res) // true

Hope this helps!

Closing until this need is articulated again :)


Unable to init project use operator-sdk 1.0.1

Hi
my operator-sdk version info:
operator-sdk version
operator-sdk version: "v1.0.1", commit: "4169b318b578156ed56530f373d328276d040a1b", kubernetes version: "v1.18.2", go version: "go1.13.15 linux/amd64", GOOS: "linux", GOARCH: "amd64"

When I init a new project
mkdir memcached-operator
cd memcached-operator
operator-sdk init --domain=example.com --repo=github.com/example-inc/memcached-operator

It occurs an err
FATA[0041] failed to initialize project with version "3-alpha": exit status 2
Please help
tks

I find this (issue)[https://github.com/operator-framework/operator-sdk/issues/3889], but it is not useable

Hi @MrYourM
Could you please upgrade your go version to 1.15 and check. The go version which is used with this particular version of the tool seems to be 1.15.

@varshaprasad96
Thanks, when i first to use operator-sdk 1.0.1, go verison is 1.15.2, but it also produce this erro
FATA[0041] failed to initialize project with version "3-alpha": exit status 2
my os verison:
ubuntu 18.04.3 LTS
could you tell me how to trouble shoot or other possible reasons？

HI @varshaprasad96,
The change in the PR https://github.com/operator-framework/operator-sdk/pull/3987 is not released yet. The version 1.0.1 uses 1.13+. See: https://github.com/operator-framework/operator-sdk/blob/v1.0.1/go.mod.
Hi @MrYourM,
I am unable to reproduce this scenario. It shows to be related to your local env setup. So, I'd recommend checking it by:

Ensure that you have just 1 go version installed
Check your go installation. See: https://golang.org/doc/install/source#testing
A common problem is related to the Go env vars setup. Try to export GOROOT=$(go env GOROOT) and check if it will solve.
Also, check if your GOPROXY has the GOPROXY="https://proxy.golang.org,direct"
try to create a new project and download some go module to check if you have permission to it in your env

mkdir test
cd test
go mod init
go get github.com/operator-framework/operator-lib

If the above info is not enough for you to solve the problem, could you please add here the output of go env for we try to help you with? Also, could you please try to do the same inside of the $GOPATH to see if it will change mkdir $GOPATH/src/mkdir memcached-operator?


hip_impl::make_kernarg throws an exception

I am trying to get tensorflow 1.14 to run with a hand-built ROCm (including HIP.) I'm using the latest git.
I got to the point where it all loads and then I get an C++ exception.
The relevant gdb trace is:

#5  0x00007f23fb04b5bd in __cxxabiv1::__cxa_throw (obj=<optimized out>,
    tinfo=0x7f23fb182330 <typeinfo for std::exception>, dest=0x7f23fb04a440 <std::exception::~exception()>)
    at /build/gcc/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:95
#6  0x00007f23fa99467f in hip_impl::hip_throw(std::exception const&) () from /opt/rocm/lib/libhip_hcc.so
#7  0x00007f23fa96fe24 in hip_impl::program_state_impl::kernargs_size_align(unsigned long) ()
   from /opt/rocm/lib/libhip_hcc.so
#8  0x00007f23fa96fb89 in hip_impl::program_state::get_kernargs_size_align(unsigned long) ()
   from /opt/rocm/lib/libhip_hcc.so
#9  0x00007f2400ef7371 in std::vector<unsigned char, std::allocator<unsigned char> > hip_impl::make_kernarg<Eigen::TensorEvaluator<Eigen::TensorAssignOp<Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::Tens                                             orConversionOp<float, Eigen::TensorMap<Eigen::Tensor<long long const, 1, 1, long>, 16, Eigen::MakePointer> const> const>                                              const, Eigen::GpuDevice>, long, Eigen::TensorEvaluator<Eigen::TensorAssignOp<Eigen::TensorMap<Eigen::Tensor<float, 1, 1                                             , long>, 16, Eigen::MakePointer>, Eigen::TensorConversionOp<float, Eigen::TensorMap<Eigen::Tensor<long long const, 1, 1,                                              long>, 16, Eigen::MakePointer> const> const> const, Eigen::GpuDevice>, long>(void (*)(Eigen::TensorEvaluator<Eigen::Ten                                             sorAssignOp<Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorConversionOp<float, Eigen::TensorMap<Eigen::Tensor<long long const, 1, 1, long>, 16, Eigen::MakePointer> const> const> const, Eigen::GpuDev                                             ice>, long), std::tuple<Eigen::TensorEvaluator<Eigen::TensorAssignOp<Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>,                                              16, Eigen::MakePointer>, Eigen::TensorConversionOp<float, Eigen::TensorMap<Eigen::Tensor<long long const, 1, 1, long>, 1                                             6, Eigen::MakePointer> const> const> const, Eigen::GpuDevice>, long>) ()
   from /usr/lib/python2.7/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so
#10 0x00007f2400ef726e in Eigen::internal::TensorExecutor<Eigen::TensorAssignOp<Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorConversionOp<float, Eigen::TensorMap<Eigen::Tensor<long long const, 1,                                              1, long>, 16, Eigen::MakePointer> const> const> const, Eigen::GpuDevice, false, false>::run(Eigen::TensorAssignOp<Eigen:                                             :TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorConversionOp<float, Eigen::TensorMap<                                             Eigen::Tensor<long long const, 1, 1, long>, 16, Eigen::MakePointer> const> const> const&, Eigen::GpuDevice const&) ()
   from /usr/lib/python2.7/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so
#11 0x00007f2400eb224d in tensorflow::functor::CastFunctor<Eigen::GpuDevice, float, long long>::operator()(Eigen::GpuDevice const&, Eigen::TensorMap<Eigen::Tensor<float, 1, 1, long>, 16, Eigen::MakePointer>, Eigen::TensorMap<Eigen::Tensor<l                                             ong long const, 1, 1, long>, 16, Eigen::MakePointer>, bool) ()
   from /usr/lib/python2.7/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so
#12 0x00007f2400e95ec8 in std::_Function_handler<void (tensorflow::OpKernelContext*, tensorflow::Tensor const&, tensorflow::Tensor*, bool), tensorflow::GetGpuCastFromInt64(tensorflow::DataType)::{lambda(tensorflow::OpKernelContext*, tensorf                                             low::Tensor const&, tensorflow::Tensor*, bool)#10}>::_M_invoke(std::_Any_data const&, tensorflow::OpKernelContext*&&, te                                             nsorflow::Tensor const&, tensorflow::Tensor*&&, bool&&) ()
   from /usr/lib/python2.7/site-packages/tensorflow_core/python/_pywrap_tensorflow_internal.so
#13 0x00007f2400e61c6e in tensorflow::CastOpBase::Compute(tensorflow::OpKernelContext*) ()

Upon some investigation, it looks like tensorflow is trying to launch the aforementioned kernel and that process involves finding the size of its arguments (function kernargs_size_align() in src/program_state.inl.)
In that function, the first test (checking that the kernel exists) is successful (the entry is found in the container returned by get_function_names()), but the second test fails (the entry is not in the container returned by get_kernargs().)
That is because the first container has ~300,000 entries, but the second only has  a handful (what looks like the kernels actually implemented on the GPU, the ones from rocrand.so, rocblas.so, etc.)
I don't understand how this is supposed to work. Did I somehow build this wrong, or is it a bug?

I've sorted it out (I think). The tensorflow library itself needs to be built with hcc. I did
bazel clean
export CC=/opt/rocm/bin/hcc
export CXX=/opt/rocm/bin/hcc

reconfigured, rebuilt, and now it runs. It even uses the GPU (the chip gets to 56 C).
It does not run very well (with an AMD Radeon RX Vega 64, I'm seeing about 1/10th the speed I'm getting on an NVIDIA GeForce 1080i using the exact same tensorflow model), but it's a big step in the right direction.

And the biggest reason it wasn't running very well is that several tensorflow ops (all reduction ops and Relu) were not ROCm-enabled. Consequently, a lot of processing was CPU-side and a lot of data had to be shuffled back and forth over the PCIe bus.
Reenabling the missed ops was trivial: https://github.com/ekuznetsov139/tensorflow/commit/6f016006575afaad88b7352a8284b2a8b338857f
(I had to skip complex64 and complex128 versions, they weren't compiling, but all others worked fine.)
That gets me up to 50% of the speed of the 1080i.


x/mobile: gobind Gradle plugin not working with Android Studio 3.0

Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go1.8.1 linux/amd64
Does this issue reproduce with the latest release?
Don't know, this is the latest release available in Debian Stretch (backports).
What operating system and processor architecture are you using (go env)?
linux/amd64 (Debian Stretch)
What did you do?
I tried to run the  mobile/example/bind/android example with AndroidStudio 3.0.1, which uses Gradle 4.1 and version 3.0.1 of the Android Gradle build plugin.
What did you expect to see?
A successful Gradle project sync.
What did you see instead?
Gradle project sync failed.
Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform

Failed to transform file 'hello.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
 > java.io.FileNotFoundException: /home/user/gocode/src/golang.org/x/mobile/example/bind/android/hello/hello.aar (No such file or directory)
    > /home/user/gocode/src/golang.org/x/mobile/example/bind/android/hello/hello.aar (No such file or directory)

Even if I create the hello.aar file manually via command line using gomobile bind and copy it to the above location, it get's deleted again as soon as I run the Gradle sync in Android Studio.

Same problem here.
My current workaround is to build the .aar file manually with gomobile bind,  then import .aar module into the Android Studio project (New/New Module/Import .jar/.aar). In other words, I do not use the plugin at all, just manually import the .aar module into the project, and make the project dependent on it.
You can test it with bind/hello example. Delete the "hello" folder with its cradle file from the android project first, then build the hello.aar manually, in the original location of the hello.go package, import the .aar into the Android Studio project, and make the project dependent on the newly added module.

After a bunch of blind poking and prodding in GobindPlugin.groovy, I have something that works. I don't know if it's the right way to fix this bug, but I am able to sync and build my project again.
Specifically, I moved the 'clean task':
    Task cleanTask = project.tasks.create("clean", {
        project.delete(project.name+".aar")
    })

from the GobindPlugin.apply method to BindTask.run method.
If someone who is more knowledgeable about writing Gradle plugins sees this, can you weigh in on if this is a reasonable way to fix the issue?
Here's a diff for reference:
--- ./agent/external-deps/src/golang.org/x/mobile/misc/androidstudio/src/main/groovy/org/golang/mobile/GobindPlugin.groovy      2017-10-30 14:09:08.182858589 -0700
+++ ./buildSrc/src/main/groovy/org/golang/mobile/GobindPlugin.groovy    2018-02-23 14:47:11.943655069 -0800
@@ -66,9 +66,11 @@
                        null,
                        gomobileTask))

+        /*
                Task cleanTask = project.tasks.create("clean", {
                        project.delete(project.name+".aar")
                })
+        */
        }

        private static void handleVariant(Project project, def variant) {
@@ -137,7 +139,9 @@
                        // fallback to ANDROID_HOME
                        androidHome = System.getenv("ANDROID_HOME")
                }

+        Task cleanTask = project.tasks.create("clean", {
+            project.delete(project.name+".aar")
+        })
                project.exec {
                        executable(exe)

Any updates?

Tips for manual installation with android studio 3.0

The CL should fix the issue. Note that only gradle sync fails; running a gomobile project from Android Studio does work.


Menu miss anchorEl position when scroll in virtualized list

[x] The issue is present in the latest release.
[x] I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯
I use BaseTable component, it's a virtualized data viewer based on react-window.
I have to use Material-UI Menu in that list, for the first time, when you click on the button it's all fine and Menu showed correctly under Button(anchorEl). But when you scroll the data then click again on the Button you will see menu showed on top of the List(virtualized table) and second click on the button will be fine again and after scroll again problem repeated.
Steps to Reproduce 🕹
You can see the example of problem in here:
https://codesandbox.io/s/funny-night-57ecb?fontsize=14

Steps:

Click on some button everything is fine.
Scroll and click on some button again problem is showed up.

Your Environment 🌎

Tech
Version

Material-UI
v4.4.3

React
16.9.0

Browser
Chrome , Electron and maybe all

@eAmin Oh wow, this is an interesting edge case. The provided anchorEl is present in the document after the prop-type checks run but is not before the effect that positions the modal runs. I would propose the following diff:
diff --git a/packages/material-ui/src/Popover/Popover.js b/packages/material-ui/src/Popover/Popover.js
index 451dae089..6b0d4c760 100644
--- a/packages/material-ui/src/Popover/Popover.js
+++ b/packages/material-ui/src/Popover/Popover.js
@@ -140,6 +140,27 @@ const Popover = React.forwardRef(function Popover(props, ref) {
           ? resolvedAnchorEl
           : ownerDocument(paperRef.current).body;
       const anchorRect = anchorElement.getBoundingClientRect();
+
+      if (process.env.NODE_ENV !== 'production') {
+        const box = anchorElement.getBoundingClientRect();
+
+        if (
+          process.env.NODE_ENV !== 'test' &&
+          box.top === 0 &&
+          box.left === 0 &&
+          box.right === 0 &&
+          box.bottom === 0
+        ) {
+          console.warn(
+            [
+              'Material-UI: the `anchorEl` prop provided to the component is invalid.',
+              'The anchor element should be part of the document layout.',
+              "Make sure the element is present in the document or that it's not display none.",
+            ].join('\n'),
+          );
+        }
+      }
+
       const anchorVertical = contentAnchorOffset === 0 ? anchorOrigin.vertical : 'center';

       return {
diff --git a/packages/material-ui/src/Popper/Popper.js b/packages/material-ui/src/Popper/Popper.js
index 1073cefea..37813d887 100644
--- a/packages/material-ui/src/Popper/Popper.js
+++ b/packages/material-ui/src/Popper/Popper.js
@@ -97,7 +97,33 @@ const Popper = React.forwardRef(function Popper(props, ref) {
       setPlacement(data.placement);
     };

-    const popper = new PopperJS(getAnchorEl(anchorEl), popperNode, {
+    const resolvedAnchorEl = getAnchorEl(anchorEl);
+
+    if (process.env.NODE_ENV !== 'production') {
+      const containerWindow = ownerWindow(resolvedAnchorEl);
+
+      if (resolvedAnchorEl instanceof containerWindow.Element) {
+        const box = resolvedAnchorEl.getBoundingClientRect();
+
+        if (
+          process.env.NODE_ENV !== 'test' &&
+          box.top === 0 &&
+          box.left === 0 &&
+          box.right === 0 &&
+          box.bottom === 0
+        ) {
+          console.warn(
+            [
+              'Material-UI: the `anchorEl` prop provided to the component is invalid.',
+              'The anchor element should be part of the document layout.',
+              "Make sure the element is present in the document or that it's not display none.",
+            ].join('\n'),
+          );
+        }
+      }
+    }
+
+    const popper = new PopperJS(resolvedAnchorEl, popperNode, {
       placement: rtlPlacement,
       ...popperOptions,
       modifiers: {

Do you want to submit a pull request? :)
Regarding your issue, you need to memoize the TableCell component (React.useCallback): https://codesandbox.io/s/hungry-jones-5tn9x.

@oliviertassinari Thanks mate, you made my day :)

Do you want to submit a pull request? :)

Of course, you made the changes and I just brought them all together.
#17599

@eAmin Not sure it is important, but the sandbox you provided has lots of warnings in the console. Can you fix those in the sandbox?

@croraf Fixed: https://codesandbox.io/s/musing-khorana-6e97h

I mean this react-base-table has the worst documentation ever. I cannot do anything with it.

@croraf I agree with you, but unfortunately I couldn't, actually it's like react-virtualized but better than it. Almost some APIs is similar to react-virtualized (if you do some stuff with react-virtualized you realized that).
BTW, my main issue is fixed and thanks to @oliviertassinari it turns out I have to memoize TableCell component.
I think we can use react-window library, if you want I can reproduce with react-window for more research.

@eAmin Cool. I made this sandbox to play with https://codesandbox.io/s/silent-surf-hbhpe

@croraf I've made change to that sandbox and you can access it in this link: https://codesandbox.io/s/frosty-fast-hgyjr
If we remove React.useCallback and use plain function, we missed anchorEl position completely.


Bug with state changes

Reported by Stefan Bodewig:

there seems to be a small bug with state changes. When I changed the
state to READY the button to send emails didn't get enabled. I had to
reload the page for the change to take effect. No big deal, but
confusing at first.

this happens a lot.

easy fix, made to the upcoming cve5 version


Flag original dates for observed days

When an observed day (i.e. holidays that are moved because they are on a weekend) is returned would it possible to flag what the original date was rather than relying on a string suffix?
Also, in some locations when a holiday falls on a weekend, it is moved to a weekday as an observed day. In some of these locations only the observed day is considered a holiday whereas in others both the observed and original days are considered holidays. This is an important distinction in some jurisdictions.
Is there any chance of supporting an additional flag against observed holidays that indicate the original day is or isn't a holiday?

The common way of implementing this behavior is that both the original and observed/substituted holiday are registered in the Holiday Provider. This is to have the possible to refer to the original holiday (rather than simply replacing it). The substituted holiday will indeed have a string suffix however is a considered a different day.
I think what you are requesting is already in place. Is there perhaps a situation where it is not the case at the moment?
Cheers! Sacha

I see that the substituted holidays are typically suffixed with a string such as "Observed" or "Holiday", but I'm not certain that this is always the case. I was hoping for a property against the substitute day that explicitly states what the original date was.
Cheers

Substituted holidays are represented with the Yasumi\SubstituteHoliday subclass. You can access the original holiday, i.e. the day being substituted, via the $substitutedHoliday property.

Closing this issue has Yasumi has a way of separating Substituted Holidays and the original substituted holiday.


Fixing squid: S134 Control flow statements "if", "for", "while", "switch" and "try" should not be nested too deeply

This pull request is focused on resolving occurrences of Sonar rule
squid:S134 - “Control flow statements "if", "for", "while", "switch" and "try" should not be nested too deeply ”. This PR will remove 90 min TD.
You can find more information about the issue here:
https://dev.eclipse.org/sonar/rules/show/squid:S134
Please let me know if you have any questions.
Fevzi Ozgul

Something wrong with the build process itself, according to the log files.

This is totally subjective, I don't think the change makes too much difference.

What a pity. I have spent some  time to construct it.


Literal on the type '%=type%' causes boolean literal error.

When using %=type% in patterns. The parser will error stating that the symbol = cannot be used on boolean types. The type classinfo should not be causing boolean type error.

Not sure how you are using this but the prefixes are not the same as in Skript. If I remember correctly:

~ means literals only
^ variables only
= can only be used with the boolean types and means that this only accepts ConditionalExpressions.

Slight correction: = means it can accept ConditionalExpressions, but not only that. Code like while true: should still parse correctly.

Does this answer the issue, @TheLimeGlass?

Yes