Add lib.interface / qualifiers

Better implementation of interface/implementation duality
with predicates.
Public API:
from antidote import implements, inject, interface, world, QualifiedBy

V1 = object()
V2 = object()

@interface
class Service:
    pass

@implements(Service).when(qualified_by=V1)
class ServiceImpl(Service):
    pass

@implements(Service).when(QualifiedBy(V2))
class ServiceImplV2(Service):
    pass

world.get[Service].single(qualified_by=V1)
world.get[Service].all()

@inject
def f(service: Service = inject.impl(QualifiedBy(V2))) -> Service:
    return service

@inject
def f(services: list[Service] = inject.impl(qualified_by=[V1, V2])) -> list[Service]:
    return services

Experimental Predicate API:
from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Optional

from antidote import implements, interface, QualifiedBy, world
from antidote.lib.interface import Predicate

@dataclass
class Weight:
    value: float

    @classmethod
    def of_neutral(cls, predicate: Optional[Predicate[Any]]) -> Weight:
        if isinstance(predicate, QualifiedBy):
            # Custom weight
            return Weight(len(predicate.qualifiers))
        return Weight(0)

    def __lt__(self, other: Weight) -> bool:
        return self.value < other.value

    def __add__(self, other: Weight) -> Weight:
        return Weight(self.value + other.value)

@dataclass
class LocaleIs:
    lang: str

    def weight(self) -> Weight:
        # Higher weight than 0, because if the language matches it should be prioritized over the
        # alternative implementations.
        # English has a lower weight because it always matches, as the default, and other languages
        # should be able to override it.
        return Weight(1000 if self.lang != 'en' else 500)

    def evaluate(self, predicate: Optional[LocaleIs]) -> bool:
        if predicate is None:
            # If no language is specified, there's just no need for it.
            return True

        return self.lang == predicate.lang or predicate.lang == 'en'

@interface
class Alert:
    def text(self) -> str:
        pass

@implements(Alert).when(LocaleIs('fr'))
class FrenchAlert(Alert):
    def text(self) -> str:
        return "Quelque chose en français!"

@implements(Alert).when(LocaleIs('en'))
class DefaultAlert(Alert):
    def text(self) -> str:
        return "Something in English!"

assert world.get[Alert].single(LocaleIs("fr")) is world.get(FrenchAlert)
assert world.get[Alert].single(LocaleIs("it")) is world.get(DefaultAlert)
assert world.get[Alert].single(LocaleIs("en")) is world.get(DefaultAlert)

EDIT: used a dataclass for the Weight.

Codecov Report

Merging #36 (a082e4e) into master (d2e8559) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##            master       #36    +/-   ##
==========================================
  Coverage   100.00%   100.00%
==========================================
  Files           52        61     +9
  Lines         2790      3322   +532
  Branches       497       567    +70
==========================================
+ Hits          2790      3322   +532

Impacted Files
Coverage Δ

src/antidote/_internal/argspec.py
100.00% <ø> (ø)

src/antidote/world/test/_methods.py
100.00% <ø> (ø)

src/antidote/__init__.py
100.00% <100.00%> (ø)

src/antidote/_constants.py
100.00% <100.00%> (ø)

src/antidote/_factory.py
100.00% <100.00%> (ø)

src/antidote/_implementation.py
100.00% <100.00%> (ø)

src/antidote/_internal/__init__.py
100.00% <100.00%> (ø)

src/antidote/_internal/dispatch.py
100.00% <100.00%> (ø)

src/antidote/_internal/utils/__init__.py
100.00% <100.00%> (ø)

src/antidote/_internal/utils/debug.py
100.00% <100.00%> (ø)

... and 29 more

Continue to review full report at Codecov.

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

Resolves #33, resolves #32

Let's say I did this: @implements(Alert). It would cover both of these cases, right?
assert world.get[Alert].single(LocaleIs("it")) is world.get(DefaultAlert)
assert world.get[Alert].single(LocaleIs("en")) is world.get(DefaultAlert)

If you added a class like this:
@implements(Alert)
class NoLangAlert(Alert):
    def text(self) -> str:
        return "???"

when using the constraint LocaleIs("it"), the evaluate() method would be called with None. In this implementation, I choose to return True. So it would be a valid candidate and would be returned with world.get[Alert].all(LocaleIs("it")). However, with world.get[Alert].single(LocaleIs("it")) the result wouldn't change. The weight of an implementation with no predicate is determined by calling the of_neutral method of the weight class with None, which returns 0 in this case. Less than the other implementations:
from antidote.lib.interface import ImplementationsOf

# note: probably need a simpler way to expose this.
print(world.debug(ImplementationsOf(Alert).all()))

<∅> Interface Alert
├── [Weight(value=1000)] FrenchAlert
├── [Weight(value=500)] DefaultAlert
└── [Weight(value=0)] NoLangAlert

Oh and if there only was a single implementation without predicate, yes it would be used because evaluate(None) returns True. As there would be no other implementations, the weight wouldn't matter.

Here's a common case: overriding a built-in. Let's say I ship a pluggable app with this:
@implements(Alert)
class DefaultAlert(Alert):
    def text(self) -> str:
        return "The built-in alert"

Someone makes a local site with my pluggable app. But they don't like my Alert and want to replace it. For all cases -- no predicate:
@implements(Alert)
class DefaultAlert(Alert):
    def text(self) -> str:
        return "The built-in alert"

They'd like the "last" registered Alert. I tried doing world.get[Alert].single() but it requires some qualification. I tried world.get(Alert) and got:
  File "src/antidote/core/container.pyx", line 466, in antidote.core.container.RawContainer.get
antidote.core.exceptions.DependencyNotFoundError: examples.override.Alert

Looking at world.get[Alert].all() I see them in reverse order of registration, but not sure if that is stable.
I guess I expected world.get(Alert) to figure an override had happened.

Interesting example! The order is stable, but it depends on the import order in your case since weights are equal which IMHO is bad idea. With the current implementation, you could handle it with a negative weight:
class NoAlternativeImplementations:
    def weight(self) -> Weight:
        return Weight(float('-inf'))

@implements(Alert).when(NoAlternativeImplementations())
class DefaultAlert(Alert):
    def text(self) -> str:
        return "The built-in alert"

@implements(Alert)
class CustomAlert(Alert):
    def text(self) -> str:
        return "The custom alert"

assert isinstance(world.get[Alert].single(), CustomAlert)

Off the top of my head Antidote could provide an override mechanism though like the following:
@implements(Alert).overridding(DefaultAlert)
class CustomAlert(Alert):
    def text(self) -> str:
        return "The custom alert"

I would explicitly require the implementation to override though as I don't want it to depend on the import order. It would replace the DefaultAlert in the same conditions. A second override on DefaultAlert would raise as it's not present anymore.

It's also unclear to me for now whether world.get(Alert) should work or not. It would have the same behavior as world.get[Alert].single(). The latter is more explicit, but moving from a "@serviceto@interface` becomes painful.

I'm likely to have a lot of comments on this branch. Do you want them here or in individual tickets?

The .overriding is an interesting and useful DX. It could go even shorter: @overrides(Alert). Though I could see a second override as being useful. Imagine Sphinx defines a bundled Logo, and a theme overrides it with ThemeLogo. But in my local site, I replace with PaulLogo.
These aren't variations in different cases (predicates). It's all still a replace-in-all-cases.

If you don't provide something like .overriding, perhaps you could add something like DefaultWeight but for negative values. Though more semantically accurate, like BaseWeight.

In your NoAlternativeImplementations example, I tried writing a function to inject an Alert. This form works:
@inject
def warning() -> str:
    alert: Alert = world.get[Alert].single()
    return f'{alert.text()}!'

...but this doesn't:
@inject
def warning(alert: Alert = inject.me()) -> str:
    return f'{alert.text()}!'

This should work:
@inject
def warning(alert: Alert = inject.impl()) -> str:
    return f'{alert.text()}!'

I'm currently making the distinction between interfaces and the rest, but I think it's a mistake. I'll redo a pass on it to make it as simple as possible and merge inject.me() and inject.impl().

The .overriding is an interesting and useful DX. It could go even shorter: @overrides(Alert).

At first sight I'll keep @implements(Alert).overriding(DefaultAlert), or equivalent, because:

I need to know for which interface you're actually overriding DefaultAlert. I could track it, but I currently don't.
I think that it's better in terms of DX. At least you know that every possible implementation is decorated with @implements(Alert) making it relatively easy to search for.

I'm likely to have a lot of comments on this branch. Do you want them here or in individual tickets?

Depends. :) If those are features, please open an issue, it'll be easier to track. For bugs or anything else that you find weird, you can put it here. I'm going to merge this PR in the coming days with some fixes and more documentation.
Thanks for all the feedback!

This PR is looking great! I just worry about the possibility of using it on Python 3.7. Unfortunately, a lot of infrastructure is still stuck on it, and in my use case at least, upgrading to 3.8 is not a possibility at this moment (but it  will eventually happen).
I see that the new decorator expression syntax dominates this new API, and I'm all for it, but it's only supported on 3.9 onwards. This is not a problem, though, because one could easily set the expression to a variable and use it afterwards as a decoration.
I haven't yet delved into the details of this PR. Will do so in the coming week, but just wanted to make this humble plea. :D I really want to advocate for the use of Antidote in my codebases today, but the minimum Python version will delay us quite a bit.

@implements(Alert)
class CustomAlert(Alert):
    def text(self) -> str:
        return "The custom alert"

The syntax looks good. I just worry about the duplication there (repeating  Alert twice). I suppose that, in the vast majority of cases, this single inheritance will be the norm, because most services may do a single job (if you follow, e.g. SRP, etc).
Considering that, we could check the decorated class' __mro__ and see if it has a single entry. If it has, and it IS an abstract class, AND cls is not abc.ABC (because you can inherit abc.ABC to make a class abstract), then we could assume that the single superclass is the interface the user is implementing, without ambiguities. This verification could be done at decoration time, and we could raise an exception if conditions are not met, and then ask the user to be explicit about which interface he's providing.
Although this would look a bit weird:
@implements().when(NoAlternativeImplementations())
class DefaultAlert(Alert):
    def text(self) -> str:
        return "The built-in alert"

@flisboac brings up an interesting point about @implements(Alert) and duplication in class CustomAlert(Alert).
From a type theory perspective, is the implementation a subclass -- a type of -- the interface? I thought it was a structural subtyping thing and thus the interface should not be inherited from.

From a type theory perspective, is the implementation a subclass -- a type of -- the interface? I thought it was a structural subtyping thing and thus the interface should not be inherited from.

@interface / @implements support both Protocols and inheritance. It'll enforce the subclass if possible, so for inheritance and @runtime_checkable protocol. Unfortunately, it's runtime only. I lack the ability to specify constraints between type variables for static type checking...

The syntax looks good. I just worry about the duplication there (repeating Alert twice). I suppose that, in the vast majority of cases, this single inheritance will be the norm, because most services may do a single job (if you follow, e.g. SRP, etc).

I thought about that, my main issue with automatically detecting the interface is that it makes it harder to search for implementations. When forcing @implements(Alert), you can do a text-search for it and find all implementations easily, supposing you're not doing too much magic / using your own decorator. By @implements() you would need to rely on the IDE showing you the subclasses, and some of them may not be exposed to Antidote at all. It's not a big deal, but neither is writing Alert explicitly. So for now I'm leaning to the conservative side as it's easier to add than remove.
@flisboac, just in case as I don't find your comment anymore, the decorator expression can be easily used in Python 3.7 with this trick:
def _(x: T) -> T:
    return x

@_(implements().when(NoAlternativeImplementations()))
class DefaultAlert(Alert):
    def text(self) -> str:
        return "The built-in alert"

Or eventually by using your wrapper implements_when(...). It's not perfect, but to me, it feels good enouch.

If you don't provide something like .overriding, perhaps you could add something like DefaultWeight but for negative values. Though more semantically accurate, like BaseWeight.

That's something I'd like to avoid. I'd like Antidote's own weight system to be as simple as just a neutral weight. This makes it not too painful to use your custom weight. You only need to support the neutral case. The complexer Antidote's system is, the harder it'll be to declare your own weights.

(...)
Or eventually by using your wrapper implements_when(...). It's not perfect, but to me, it feels good enouch.

That's a good trick, thanks! What I alluded to, in my deleted comment, was that I could simply alias the expression to a local variable, and use it to decorate whatever it is needed. But my comment overall was made because I was worried that Python 3.7 support was being dropped. I then quickly realised by looking at the PR that this was not the case, and deleted the comment as fast as I could. :p

From a type theory perspective, is the implementation a subclass -- a type of -- the interface? I thought it was a structural subtyping thing and thus the interface should not be inherited from.

Well, the way I see it, it doesn't really matter.
Wherever an Alert is expected, any implementation of it could be used, if you follow LSP. On paper, interface implementation can be realised either by way of subclassing, or structural equivalence, the important factor being that it must provide and respect the interface's contract. The way the interface is described, or how the implementation is done, is limited or determined by what the language offers. (And Python offers a lot.)
From a static analysis point of view, both ways of implementing an interface (nominal and structural) work fine. The difference between them is more syntactic (more concerned with language peculiarities) than semantic (actually offering an implementation that respects the contract). (Btw, some type systems don't even make that distinction e.g. TypeScript; but some do, e.g. Java.)
Now, the advantage of nominal subtyping is that it's relatively trivial to check, both at static-time and runtime. For protocols and structural typing, things get a bit more difficult, or may incur more processing (ie. how to ensure @runtime_checkable, check if attributes exist one by one, etc). Antidote could abstract away the interface, but this would make dependency lookup a bit more difficult or cumbersome (because you need that information at runtime, and it's effectively missing, or should be given separately). That's why I think nominal subtyping has more value here.
Also, because you can replace one implementation with another, it's not far fetched to assume that there's a kind that's common to all of them, the interface. It could be a superclass of all implementations, and all conditions would still be met.

I thought about that, my main issue with automatically detecting the interface is that it makes it harder to search for implementations. When forcing @implements(Alert), you can do a text-search for it and find all implementations easily, supposing you're not doing too much magic / using your own decorator. By @implements() you would need to rely on the IDE showing you the subclasses, and some of them may not be exposed to Antidote at all. It's not a big deal, but neither is writing Alert explicitly. So for now I'm leaning to the conservative side as it's easier to add than remove.

That's reasonable. And indeed, it's not a big deal. The fact that qualifiers are coming is already good enough! :D

I was worried that Python 3.7 support was being dropped.

I'm keeping support for all Python versions that haven't reached their end-of-life yet, so for Python 3.7 it's until mid-2023 AFAIK.


Catch if Hue bridge goes unavailable

Description:
Mark all Hue lights as unavailable when the bridge goes offline.
Related issue (if applicable): #12935
Example entry for configuration.yaml (if applicable):
hue:

Checklist:

[x] The code change is tested and works locally.
[x] Local tests pass with tox. Your PR cannot be merged unless tests pass

@arsaboo could you test this one too?

Start HASS and have it connect to the Hue bridge and show the lights
Disconnect the Hue bridge (unplug network cable)
HASS should mark lights as unavailable
Plug cord back in
HASS should mark lights as available

Tested this and it works as expected 👍
After unplugging the bridge, the Hue lights are unavailable in about 20 seconds. After I plug it back in, the bulbs become available as soon as the network is established (typically about 50 seconds or so).

Just noticed these errors in the logs from around the time I unplugged the bridge (it did not affect the performance):
2018-03-12 08:43:17 ERROR (SyncWorker_8) [phue] GET Request to <IP_ADDRESS>/api/REDACTED timed out.
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/phue.py", line 651, in request
    connection.request(mode, address)
  File "/usr/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/usr/lib/python3.6/http/client.py", line 936, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
socket.timeout: timed out
2018-03-12 08:43:41 ERROR (SyncWorker_12) [custom_components.light.hue] Cannot reach the bridge
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/light/hue.py", line 123, in unthrottled_update_lights
    api = bridge.get_api()
  File "/home/homeassistant/.homeassistant/custom_components/hue/__init__.py", line 266, in get_api
    return self.bridge.get_api()
  File "/srv/homeassistant/lib/python3.6/site-packages/phue.py", line 838, in get_api
    return self.request('GET', '/api/' + self.username)
  File "/srv/homeassistant/lib/python3.6/site-packages/phue.py", line 651, in request
    connection.request(mode, address)
  File "/usr/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/usr/lib/python3.6/http/client.py", line 936, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
OSError: [Errno 113] No route to host
2018-03-12 08:44:09 ERROR (SyncWorker_21) [custom_components.light.hue] Cannot reach the bridge
Traceback (most recent call last):
  File "/home/homeassistant/.homeassistant/custom_components/light/hue.py", line 123, in unthrottled_update_lights
    api = bridge.get_api()
  File "/home/homeassistant/.homeassistant/custom_components/hue/__init__.py", line 266, in get_api
    return self.bridge.get_api()
  File "/srv/homeassistant/lib/python3.6/site-packages/phue.py", line 838, in get_api
    return self.request('GET', '/api/' + self.username)
  File "/srv/homeassistant/lib/python3.6/site-packages/phue.py", line 663, in request
    result = connection.getresponse()
  File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/usr/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.6/http/client.py", line 266, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

Yeah phue will log the full exception and then raise the appropriate exception. Those logs are safe to ignore.


"Can #cudainclude#_subset.h be generated automatically using generate_code.py?"

I want to intercept more CUDA APIs through hooks, so I would like to use the generate_code.py in your repository to generate hook function source code for all .h files under the cuda/include directory.

Not yet.


exclude_pattern=  does not seem to work from within RSpec.configure block

This is what I'm trying to achieve:
RSpec.configure do |config|
  if some_condition
    config.exclude_pattern=  '**/dummy/spec/models/post_spec.rb'
  end
end

but the test in post_spec.rb are still executed.
(I also don't get a warning, and putting puts("**** #{config.files_to_run}") seems to take the the pattern into account.)
Also, using the exclude_pattern from the command line does seem to work.

Awww, my bad. I was putting the above codeblock in rails_helper.rb, which is only required in the file I'm trying to exclude, so exactly in the file I'm trying to exclude.
Fixed the issue by requiring rails_helper in .rspec...

FWIW, we recommend you avoid putting --require rails_helper in .rspec, since rails_helper loads rails and is quite heavyweight.  That means you have no way in your project to run RSpec w/o loading Rails, which means you have no way to get fast, subsecond test feedback when writing specs against components that do not depend upon rails.  For configuration that you want to always be loaded, we recommend you put it in spec_helper, which is meant to be light weight and always loaded.  Is there any reason that wouldn't work for you?

I came to think the same just a few moments ago, so I already applied your suggestions :)
Thanks anyway!


Quickfix extension.js

adding --html argument, because scalene standard is no longer html

As of now, the extension shipped from the marketplace does not work and this PR is a valid fix.  Perhaps should it be merged in main?


contact page enhanced

I have enhanced the contact page.
My issue no #157

@harikasayani it is looking a little wierd right now. Try to improve it.

Hi,
Again I have improved the contact form.
My issue number #157

This time you have just changed the colour which is not matching with the website. You may explore some other websites and see the styling of the forms and improve.

Hi,
I have changed the contact form once again and added the icons to become attractive.
Once check it.

Can you add border like this and the symbols which you have shown above. Rest keep the same.

Hi @Suchitra-Sahoo,
My issue number: #157
Yes I have added border to this contact form now. If there is no conflicts will you merge it.

Hi @Suchitra-Sahoo
I have resolved the conflicts please merge it if there is no conflicts.

Hi @Suchitra-Sahoo
Wil you merge my pull request.
If there is no conflicts.

Hi @Suchitra-Sahoo
I have resolved my conflicts.
Will you merge it.

Hi @Suchitra-Sahoo,
I have resolved all the conflicts.
Will you please merge it if their is no conflicts.

Don't change the colour as it is not looking suitable just add the icons and borders. Refer the image I have sent.

Hi @Suchitra-Sahoo ,
I have recently updated my contact form.
Once please check it.

Hi @Suchitra-Sahoo
Please add GSSOC label and level

I had to revert back your PR because after your changes the feedback option is not visible below contact form. Also the footer section got totally disturbed.

Ok I will do it again


Add PlatformIO compatibility

As discused in https://github.com/HomeSpan/HomeSpan/pull/374 in comment https://github.com/HomeSpan/HomeSpan/pull/374#issuecomment-1236348925 this replaces:
#include <core_version.h>
with
#include <esp_arduino_version.h>

This change by itself will not work.   HomeSpan.cpp needs to be updated as well to pull version numbers from esp_arduino_version.h instead of core_version.h.   If you run HomeSpan with this PR you will see that the version number is listed as ARDUINO_ESP32_GIT_DESC (the name of the macro that is in core_version.h, but is no longer defined without core_version.h included).
Also, note that Arduino.h already includes esp_arduino_version.h, so no need to include it as a separate line item.

I’m working on a fork of a project that uses HomeSpan and I had some issues since I’m using PlatformIO.
Yesterday it wouldn’t work without this change.
Today it works fine without this change.
I’m closing it for now.


train data should jpg or png ,why?

Usually, images are saved with jpg or png format.

Can i include both JPG and PNG formats?

if you just use jpg format, is there quality issue after SR

@qingfengmingyue
You can include both JPG and PNG in the training folder.


Load project data from non-Paratext 9 folder

We need to make a way to have ParatextData.dll access a different project folder. We want Paranext to access a different directory of projects and resources.
Everything will be in the exact same data format as Paratext 9.
We also need to bundle an open source project or two into Paranext. Maybe we can grab WEB and OEB or something and convert it to Paratext format.
There are two files that are required to initialize ParatextData.dll that are not part of projects: usfm.sty and en.ldml. We need those in the file bundle.

The USFM can be gotten from: https://github.com/ubsicap/usfm/tree/master/sty
The English LDML file can be gotten from: https://github.com/silnrsi/sldr/blob/master/sldr/e/en.xml (rename the XML extension)

This might be "tiny" for Windows, but it is far from tiny when we include Linux.
Here are some (but probably not all) things that need to change in ParatextData for this to work on current versions of Linux:

[ ] Update ICU.net from version 2.8.1 to version 2.9.0.  Functionality was added in 2.9.0 that makes the icu.net.dll.config file work properly.
[ ] Remove the lock in of using ICU version 59.  ParatextData has a check related to whether FieldWorks is installed and should be used.  If FieldWorks is not installed, then we are locked into ICU version 59.  Newer versions of Linux are past that version, and there isn't a clean way to downgrade ICU in Linux.  Given the variety of Linux distributions and versions, it would be best to let ICU decide what version it should on its own unless we know that won't work for some reason.  It has its own logic to find installed versions.
[ ] Either shim registry access so that we don't try to access registry keys when running outside of Windows or do a deeper scrub of all code paths Paranext will need to call to avoid using the registry when specific initialization options are provided.

To get past the first two issues I was able to produce a private build (on my dev box) of ParatextData.dll with these changes.  The third requires much deeper experience with Paratext than I have at the moment.

Copying response I made in Discord:

I'm guessing the problem is that the Linux build of Paratext has always been completely separate from the Windows build and kept on different branches. What we probably need to do is to look at the old Paratext Linux branch and see if we can pull some/all the changes into main without causing issues. I was hoping we wouldn't have to do that, but if you keep finding/fixing issues, then it's likely the branches are more different than I thought.
It might be worth talking to Tom Hindle who did 99.9% of the Linux work for Paratext (back when we supported Linux). Theoretically we only need changes that would affect a ParatextData.dll build (and it's dependencies).

I found some descriptions of how we can create a cross-platform NuGet package. I'm not entirely certain we'll need the native code for the tech demo, but we'll likely need some native libraries as we did deeper (e.g. Mercurial, TEKKit, etc.).
Also, it seems like someone else had the same problem with the ICU library on Ubuntu 22. According to @lyonsil, it should just involve upgrading to a newer version of ICU.Net.

Here is a patch file with changes to Paratext (master branch) that Tim and I used to get ParatextData.Initialize() to work without throwing exceptions.  It seems unlikely these changes are what we really want to apply to ParatextData, but they give a sense of the important updates.
linux-support.patch.txt


Onboard CCR performance test to new build.ci.opensearch.org

Signed-off-by: Mohit Kumar<EMAIL_ADDRESS>Description
This PR contains the necessary changes related to triggering the CCR performance test and updation of parameters to be taken for running the tests.
Issues Resolved
Closes #3178
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Codecov Report

Merging #3189 (093395f) into main (71becf2) will decrease coverage by 1.26%.
The diff coverage is n/a.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
@@            Coverage Diff             @@
##             main    #3189      +/-   ##
==========================================
- Coverage   94.15%   92.90%   -1.26%
==========================================
  Files         157      167      +10
  Lines        4242     4622     +380
==========================================
+ Hits         3994     4294     +300
- Misses        248      328      +80

Impacted Files
Coverage Δ

src/system/temporary_directory.py
64.44% <0.00%> (-28.89%)
:arrow_down:

src/manifests/test_manifest.py
85.71% <0.00%> (-11.66%)
:arrow_down:

src/test_workflow/integ_test/integ_test_suite.py
85.71% <0.00%> (-8.41%)
:arrow_down:

src/system/os.py
94.73% <0.00%> (-5.27%)
:arrow_down:

src/test_workflow/test_cluster.py
85.33% <0.00%> (-3.24%)
:arrow_down:

src/manifests/component_manifest.py
91.52% <0.00%> (-0.48%)
:arrow_down:

src/run_sign.py
91.66% <0.00%> (ø)

src/paths/script_finder.py
100.00% <0.00%> (ø)

src/assemble_workflow/dists.py
100.00% <0.00%> (ø)

src/sign_workflow/sign_args.py
100.00% <0.00%> (ø)

... and 28 more

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

@mohitamg Groovy tests are failing. You might have to run ./gradlew test -info -Ppipeline.stack.write=true.
More on this here - https://github.com/opensearch-project/opensearch-build/blob/main/DEVELOPER_GUIDE.md#jenkins-pipelines-and-shared-libraries

@opensearch-project/engineering-effectiveness Can we get some 👀  on this PR?

LGTM!
adding @gaiksaya and @peterzhuamazon

Yes @gaiksaya , as a starting point I am keeping 2.4.0 only for performance testing, if everything is fine , then will add other versions as per necessity.


Add remote support to resources.Get

Implement resources.FromRemote, inspired by #5686
Closes #5255
Supports #9044

One example use case is the RSS/XML feed parsing as discussed in #9044 another use case could be the generation of Open Graph images (in this case using https://bruzu.com):
   {{- $image := resources.FromRemote ( print "https://img.bruzu.com/?" (querify
        "bi" "https://example.com/img/og-background.png" "h" "627" "w" "1200"
        "a.oy" "top" "a.ox" "left" "a.x" "100" "a.y" "100" "a.w" "1000" "a.h" "68" "a.c" "#ffffff" "a.ta" "left" "a.fs" "40" "a.lh" "1" "a.fw" "900" "a.ff" "Roboto" "a.maxHeight" "120"
        "b.tp" "textbox" "b.x" "100" "b.y" "200" "b.w" "1000" "b.h" "244" "b.oy" "top" "b.ox" "left" "b.c" "#ffffff" "b.ta" "left" "b.fs" "20" "b.lh" "1.2" "b.fw" "400" "b.ff" "Roboto" "b.ox" "left" "b.oy" "top" "b.maxHeight" "250"
        "a.t" .Title
        "b.t" .Summary
    )) -}}
    <meta property="og:image" content="{{ $image.Permalink }}" />

Addressed the comments and implemented options, you can now specify the request headers in the options, optionally combined with a request method and body (see also related issue #7699).
{{ $postResponse := resources.Get "https://example.org/api"  (dict
    "method" "post"
    "body" `{"complete": true}`
    "headers" (dict
        "Content-Type" "application/json"
    )
)}}

I will merge this once the tests go green, it looks very good, I really like how the API turned out.


Starting a container from bootlocal.sh fails with TLS error

This is a repost of:
http://stackoverflow.com/questions/29321917/container-cannot-be-started-from-bootlocal-sh
which comments/answers.
Running Boot2Docker 1.5.0 under Windows. A container gastrobase exists and can be started manually with docker start gastrobase.
When I put this command into /var/lib/boot2docker/bootlocal.sh, upon startup I get
Post http:///var/run/docker.sock/v1.17/containers/gastrobase/start: dial unix /var/run/docker.sock: no such file or directory.  Are you trying to connect to a TLS-enabled daemon without TLS?  time="2015-03-28T19:50:51Z" level="fatal"  msg="Error: failed to start one or more containers" in var/log/bootlocal.log.
Running ./bootlocal.sh manually starts Ok.

This proved to be a racing condition: With the following in bootlocal.sh startup works
sleep 1
docker start gastrobase

Any suggestion how to make this more robust? Wait for what?

Would --restart=always be enough to achieve the goal?
https://docs.docker.com/articles/host_integration/

Can this be used on the command line? How?
I always thought it is for systemd only.

Seems to work mostly, but hangs (not reproducibly) occasionally.
A better refererence is:
https://docs.docker.com/reference/run/#restart-policies-restart

To avoid race conditions, and lag from my boot2docker's hosting VM, I put this line before my docker commands:
while [ ! -e /var/run/docker.sock ]; do sleep 1; done
This is, admittedly, hacky, but it gets the job done.


Fix dashboard

Title of Pull Request HERE
What user problem are we solving?
What solution does this PR provide?
Testing Methodology
How did you test your changes and verify that existing
functionality is not broken
Any other considerations

Safe and tested in my presence. Just going to reclarify the PR


Problem with Pannellum and Ionic on mobile device

Hello,
using Pannellum with the Ionic-Framework (which is build on Angularjs) works great - as long as not switching from scene to scene. The first scene loads perfectly, but when switching to another scene for the first time, it simply does not show the new image. Crazy though: The new hotspots are shown, one can click on then, even switch to another scene. What will happen then, is the following: It will load the image of the scene you were into (instead of the new one), who were not shown when entering the scene. So there is always a lag of one image. This is really weird. To make it even more confusing: This only happens on a mobile device. In a desktop browser everything works perfect.
I know, this must be a special issue with the ionic framework. So I am not expecting any help. But maybe someone has made the same experience or has some knowledge, why things like that happen with ionic.
Ionic is really a great framework. And Pannellum is simply amazing. Combining both would be a dream.
Greetings from Germany
Burkhardt

Per the change in d51ade0, mobile app frameworks are not officially supported.


Persisting session cookies is not working

I am having an issue persisting the correct cookies when trying to test an endpoint that requires authentication.
When I test an endpoint that requires a user to be logged in, I would expect to receive a http status of 201 success, but am receiving a 403 forbidden.
Here is an overview of what my test spec file is doing:

I create a mocha describe function with a before() and after() and inside those callbacks, I start my server and then add a dummy user and some dummy content in my test mongoose database.
My first it() function uses agent to make a connection to the endpoint without signing in and that test expect(403) is correct.
My second it() function then uses agent to attempt to sign in with the credentials for the dummy user I created earlier. I expect(200) to pass, which it does. I also console.log(res.headers[set-cookie]) and I see the output is as follows:

connect.sid=s%3Aze-bIOV3kWJc6TdjWMhxqnmcregTXBKZ.HIACLrWQwReMqj8YVLSXkjAPhBEwT0EuUJfkgeC%2BfpU; Domain=localhost; Path=/'

The problem arises with my third it() function, where I want to make a call to an endpoint that requires a user to be logged in. What I would expect to see here is  expect(201), but instead get expect(403) suggesting to me that the user is not logged in, and the cookie is invalid. Indeed, when I log the value of the cookie as above I see the following, which is completely different:

connect.sid=s%3AVStxZsDf_RxxDj50c4kmvzebKeMGz51N.Y0qojAAqf8Uw92vGv5u941FArM57P%2FXEG10dsSsx2bc; Domain=localhost; Path=/'

This is the contents of my spec file for testing these endpoints:
'use strict';

let app         = require('../../../server/app.js'),
    testutils   = require('../testutils.js'),
    request     = require('supertest');

describe('POST /answer/:id/comment', function() {

    let answer_id,
        server,
        agent;

    before(function(done) {
        app().then(function(result) {
            server = result.server;
            agent = request.agent(server);
            testutils.addUser()
            .then(testutils.addQuestion)
            .then(testutils.addAnswer)
            .then(function(answer) {
                answer_id = answer._id;
                done();
            });
        });
    });

    after(function(done) {
        testutils.mongoClear();
        done();
    });

    it('should return a json encoded error message with a http status of 403 for a logged out user.', function(done) {
        agent
        .post('/answer/' + answer_id + '/comment')
        .expect('Content-Type', /json/)
        .expect(403)
        .expect({info: 'You need to be signed in to comment.'}, done);
    });

    it('should then log a user in and save a cookie', function(done) {
        agent
        .post('/user/login')
        .send({email<EMAIL_ADDRESS>authkey: 'password1'})
        .expect('set-cookie', /connect.sid/)
        .expect(200)
        .end(function(err, res) {
            console.log({
                cookie: '/user/login ' + res.headers['set-cookie']
            });
            if(err) return done(err);
            done();
        });
    });

    it('should then be able to post a comment for an answer given a logged in user with the correct role', function(done) {
        agent
        .post('/answer/' + answer_id + '/comment')
        .expect(201)
        .end(function(err, res) {
            console.log({
                cookie: '/answer/:id/comment ' + res.headers['set-cookie']
            });
            if(err) return done(err);
            done();
        });
    });
});

A brief description of before() and after()
before(function(done) {
    app().then(function(result) {
        server = result.server;
        agent = request.agent(server);
        testutils.addUser()
        .then(testutils.addQuestion)
        .then(testutils.addAnswer)
        .then(function(answer) {
            answer_id = answer._id;
            done();
        });
    });
});

after(function(done) {
    testutils.mongoClear();
    done();
});

What I am doing inside before() is ensuring that the express() server has booted, that mongoose has started and that my dummy data has been inserted to the test database - all before any of these tests are started. This seems to be working fine and from my understanding, the before function should run to completion.
I am also assigning request.agent to a running instance of my express() server.
Finally, once everything is set up as expected, the first it test starts running and completes with the expected result, so it passes.
The second test runs as expected and passes.
The Third test fails because a 403 is returned where a 201 status would be expected. When looking closely at the cookie strings between the two tests, I see that they are completely different. This has been highlighted in this StackOverflow post.
Here is what I have tried:

I wanted to make sure that everything that was needed was ready before any tests ran, including making sure that Mongoose was running, the express server was running and that all the dummy data needed was inserted.
I place a console log message inside the /user/login endpoint to see if the session data was being set and it was. For reference, this is what the endpoint looks like.

app.post('/user/login', (req, res) => {
    user.checkUserCredentials(req.body)
    .then((result) => {
        if(!result.isactive) {
            res.status(403).json({
                info: 'Could not sign you in because your account has been deactivated.'
            });
            return;
        }
        user.setUserCookie(req, res, result);
        console.log(req.session); // This shows the user id correctly so I know it is working
        res.status(200).json({
            info: 'Login successful.',
            user: result
        });
    })
    .catch((error) => {
        res.status(403).json({
            info: 'Login unsuccessful.',
            error: error
        });
    });
 });

Inside the second test, I tried saving the cookies following some users suggestions, as follows:

.end(function(err, res) {
    if(err) return done(err);
    agent.saveCookies(res);
    done();
});

I then tried to retrieve that cookie in testing the endpoint that requires the user to be logged in, as follows:

it('should allow the user to post something', function(done) {
    let call = agent.post('/need/to/be/signed/in');
    agent.attachCookies(call);
    call
    .send({some: 'Content'})
    .expect(201)
    .end(function(err, res) {
        if(err) return done(err);
        done();
    });
});

For reference, I am also using the express-session module and inside my app.js file I have the following.
app.use(session({
    secret: 'dummysecret',
    resave: false,
    saveUninitialized: true,
    httpOnly: true,
    store: new connectMongo({
        mongooseConnection: mongoose.connection
    }),
    cookie: {
        httpOnly: false,
        maxAge: null,
        domain: app.config.cookieDomain,
        secure: app.config.httpsEnabled
    }
}));

I'm out of ideas as to what could be causing this. I have trawled through issues and discussion fora and tried many things to get it working, but to no avail. Could the code above be causing the issue?

I was able to get this working in the end by doing the following:

First I set a global cookie variable at the top of my test

let cookie;

Then assigned the value of res.headers['set-cookie'] to that

it('POST answer/:id/comment - should then log a user in and save a cookie', function(done) {
        agent
        .post('/user/login')
        .send({email<EMAIL_ADDRESS>authkey: 'password1'})
        .expect('set-cookie', /connect.sid/)
        .expect(200)
        .end(function(err, res) {
            cookie = res.headers['set-cookie']; //Setting the cookie
            if(err) return done(err);
            done();
        });
    });

Then in subsequent calls, I did something like this.

it('POST answer/:id/comment - should then be able with a logged in user.', function(done) {
        let call = agent.post('/answer/' + answer_id + '/comment');
        call.set('Cookie', cookie); //And then using it here
        call.send({content: 'A comment.'})
        .expect(201)
        .expect(function(res) {
            if(!res.body.info) throw new Error('info is missing');
            if(!res.body.comment) throw new Error('comment is missing');
        })
        .end(done);
    });

This is the only thing that seems to do the trick as a workaround.

@matfin I have the same use-case here, and I was able to get things working using the private saveCookie (now _attachCookie) API in superagent (see https://github.com/visionmedia/superagent/issues/1014).
I think it would be great to have a better way of automatically handling this in supertest!
cc: @pornel

Any news about cookies?

The internal failure is mostly due to the incorrect use of `.toValueString()` in superagent's  _attachCookies`.
That method call should be removed entirely. It prevents setting multiple cookies, hence killing, for instance, signed cookies' signatures (or multiple same-name cookie values). There's no good reason for it being used there.

Hey folks, has anyone tried patching the above? I've run into the same issue, with koa-session setting multiple cookies so there's no way to persist except manually parsing and passing.

Believe I'm seeing a similar issue because my app includes the csurf library with the 'use cookies' option

Yep, running into this problem on Node/Express. I'd greatly appreciate a patch

Same problem here!

@rimiti If the issue still exists, why are you closing it? Clearly there is demand/desire to have this support.

Is anyone can propose a pull request? 🙏
I'm actually busy.

My root cause came from the secure configuration that I passed into express-session
It should be false when running test as supertest runs the express app on an insecure (HTTP) port.
session({
  // ...
  cookie: {
    secure: config.isDevelopment ? false : true,
  },
  // ...
});

I also had the same issue with @ReeganExE. In case we want to effectively test whether we are returning the cookies with secure flag or not in our unit tests, what should we do?


Update Boilerplate

Update Boilerplate

Auto-generated by [flyte-bot]

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@6f82bd9). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master       #5   +/-   ##
=========================================
  Coverage          ?   71.45%
=========================================
  Files             ?       94
  Lines             ?     2000
  Branches          ?        0
=========================================
  Hits              ?     1429
  Misses            ?      504
  Partials          ?       67

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 6f82bd9...95ac618. Read the comment docs.


Pause Before Checking HTTP Keyword

Is it a duplicate question?
No
Is your feature request related to a problem? Please describe.
Keyword checker is unable to check sites with delayed javascript (I think)
Describe the solution you'd like
Essentially I am trying to monitor specific sites for keywords, however if the words are loaded in javascript, it will always error (Can't be found). Would it be simple enough to 'wait' a given time for the page to fully load, then check for keywords? Is this possible?

Likely impossible without Puppeteer (a.k.a. Chrome Headless), because it need to parse the frontend JS code. And this library will use a lot of RAM, I probably will not implement it.

Thanks for the reply. No worries!


tiled: 1.1.2 -> 1.1.3

Semi-automatic update generated by https://github.com/ryantm/nix-update tools. These checks were done:

built on NixOS
Warning: no binary found that responded to help or version flags. (This warning appears even if the package isn't expected to have binaries.)
found 1.1.3 with grep in /nix/store/vx3qsix626qzpfrb2sxrgapymrlmwq4b-tiled-1.1.3

cc @dywedir for review

Success on x86_64-linux (full log)
Attempted: tiled
Partial log (click to expand)
/nix/store/vx3qsix626qzpfrb2sxrgapymrlmwq4b-tiled-1.1.3

No attempt on x86_64-darwin
The following builds were skipped because they don't evaluate on x86_64-darwin: tiled
No log is available.

Success on aarch64-linux (full log)
Attempted: tiled
Partial log (click to expand)
shrinking /nix/store/gh8gs310i066npyn0mkm3bji5k0ds90d-tiled-1.1.3/lib/tiled/plugins/libcsv.so
shrinking /nix/store/gh8gs310i066npyn0mkm3bji5k0ds90d-tiled-1.1.3/lib/libtiled.so.1.0.0
gzipping man pages under /nix/store/gh8gs310i066npyn0mkm3bji5k0ds90d-tiled-1.1.3/share/man/
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/gh8gs310i066npyn0mkm3bji5k0ds90d-tiled-1.1.3/lib  /nix/store/gh8gs310i066npyn0mkm3bji5k0ds90d-tiled-1.1.3/bin
patching script interpreter paths in /nix/store/gh8gs310i066npyn0mkm3bji5k0ds90d-tiled-1.1.3
checking for references to /build in /nix/store/gh8gs310i066npyn0mkm3bji5k0ds90d-tiled-1.1.3...
postPatchMkspecs
postPatchMkspecs
/nix/store/gh8gs310i066npyn0mkm3bji5k0ds90d-tiled-1.1.3

duplicate of https://github.com/NixOS/nixpkgs/pull/36415


changed spaced indentation to tabs

This is more compatible with various Godot versions. 3.2.3 changes 4 spaces to tabs by default when you run the project. This means that you get mixed indentation if you use 2 space indentation.

I cannot run the example for same reasons.
This PR looks good to me :-)

Why is this closed without a reason? No credits for @Salvakiya :-/
I neither see a commit fixing this PR apart from my comment above in d30c57628e016877e51833c3c77836391f4d0802
@xsellier this project does not run in (my) Godot due to space mixed with tabs which IMHO opinion was the intend of @Salvakiya right?

Hey,
So, I use spaces not tabulations in my projects, Im not going to change that.
Thanks to your IDE you can easily change that, but I won't update that repository for tabulation instead of spaces.
Sorry

More in depth explanations:

This PR contains conflicts
Not update for 2 months
Updated only the script.gd file, but not the plugin.gd or ayn examples.

This project misses a CONTRIBUTE.md file indeed.
There is another gd-chart project which is really complete, and I suggest you to use it instead:
https://github.com/fenix-hub/godot-engine.easy-charts

So I do:

git clone git@github.com:binogure-studio/chart-gd.git
start Godot 3.3.2.stable and get immediately

Unable to load addon script from path: 'res://addons/GDCharts/plugin.gd'. This might be due to a code error in that script.
Disabling the addon at 'res://addons/GDCharts/plugin.cfg' to prevent further errors.

Ignoring that I can run the example scene :-)
Not sure what went wrong the previous time triggering my tabs versus spaces :-/

I suppose you can do that directly in godot, change the Text Editor > Indent > Type setting in the Editor Settings to default to space

Hmmm ... found tabs in example.gd :-p
My console output has some more

ERROR: _load_data: Condition "!f" is true. Returned: ERR_CANT_OPEN
At: scene/resources/texture.cpp:502.
ERROR: _load: Failed loading resource: res://.import/graph-plot-white.png-b2db87f2374c8f05649a10994a5a9092.stex. Make sure resources have been imported by opening the project in the editor at least once.
At: core/io/resource_loader.cpp:283.
ERROR: _load: Failed loading resource: res://addons/GDCharts/graph-plot-white.png. Make sure resources have been imported by opening the project in the editor at least once.
At: core/io/resource_loader.cpp:283.
SCRIPT ERROR: GDScript::reload: Parse Error: Can't preload resource at path: res://addons/GDCharts/graph-plot-white.png
At: res://addons/GDCharts/script.gd:21.
ERROR: reload: Method failed. Returning: ERR_PARSE_ERROR
At: modules/gdscript/gdscript.cpp:583.
SCRIPT ERROR: GDScript::reload: Parse Error: Couldn't fully preload the script, possible cyclic reference or compilation error. Use "load()" instead if a cyclic reference is intended.
At: res://addons/GDCharts/plugin.gd:6.
ERROR: reload: Method failed. Returning: ERR_PARSE_ERROR
At: modules/gdscript/gdscript.cpp:583.
ERROR: set_path: Another resource is loaded from path 'res://addons/GDCharts/graph-plot-white.png' (possible cyclic resource inclusion).
At: core/resource.cpp:82.

I did not know Convert indent on Save :-)
(case closed)


Animation

Details

Created Animation for Social media icons to rotate once hovered.
Created a scale translator for the Header "Software Engineer" to Grow On Hover.
Created a continuous scale to animate the Work Arrows to direct Users down

1.The animation was accomplished and tested successfully.
2.Runs well in all browsers.
3.No Linter errors


Error when setting model_dir for tf.keras.estimator.estimator_from_model()

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
TensorFlow installed from (source or binary): binary
TensorFlow version (use command below): tf.VERSION = 1.4.0 tf.GIT_VERSION = v1.4.0-rc1-11-g130a514
Python version: 2.7.12
Bazel version (if compiling from source): N/A
GCC/Compiler version (if compiling from source): N/A
CUDA/cuDNN version: 8.0.61/6.0.21
GPU model and memory: NVIDIA Tesla M60 8 GB
Exact command to reproduce: See Below

Describe the problem
When trying to use an estimator that is derived from tf.keras.estimator.estimator_from_model() and training with tf.estimator.train_and_evaluate(), setting model_dir either in the RunConfig or in tf.keras.estimator.model_to_estimator causes a NotFoundError to be thrown. If the model_dir is not set, then a tmp directory is used as expected and the training is completed successfully.
I also tested this with the canned estimator tf.estimator.DNNRegressor, and the settings were applied as expected when the RunConfig was passed to the estimator or the model_dir passed to the estimator directly.
Below is code to demonstrate this issue.
Source code / logs
Minimal example, NotFoundError is thrown:
import os
import numpy as np
import tensorflow as tf

tf.logging.set_verbosity(tf.logging.INFO)

inputs = tf.keras.layers.Input(shape=(10,))
outputs = tf.keras.layers.Dense(10)(inputs)
model = tf.keras.models.Model(inputs, outputs)
model.compile(optimizer='sgd', loss='mse')

# Both of these result in a NotFoundError
run_config = tf.estimator.RunConfig(model_dir='min_out')
est_keras = tf.keras.estimator.model_to_estimator(keras_model=model, config=run_config)
#est_keras = tf.keras.estimator.model_to_estimator(keras_model=model, model_dir='min_out')

input_name = model.input_names[0]
data = np.random.rand(1000,10).astype(np.float32)
train_input_fn = tf.estimator.inputs.numpy_input_fn({input_name:data}, data, batch_size=10, num_epochs=None, shuffle=False)

train_spec = tf.estimator.TrainSpec(input_fn=train_input_fn, max_steps=1000)
eval_spec = tf.estimator.EvalSpec(input_fn=train_input_fn, steps=10)
tf.estimator.train_and_evaluate(est_keras, train_spec, eval_spec)

Error generated:
$ python minimal_modeldir.py
INFO:tensorflow:Using the Keras model from memory.
2017-11-22 21:40:44.540162: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2017-11-22 21:40:46.525335: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2017-11-22 21:40:46.525573: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties:
name: Tesla M60 major: 5 minor: 2 memoryClockRate(GHz): 1.1775
pciBusID: 0000:00:1e.0
totalMemory: 7.43GiB freeMemory: 7.35GiB
2017-11-22 21:40:46.525595: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: Tesla M60, pci bus id: 0000:00:1e.0, compute capability: 5.2)
INFO:tensorflow:Using config: {'_save_checkpoints_secs': 600, '_session_config': None, '_keep_checkpoint_max': 5, '_tf_random_seed': None, '_task_type': 'worker', '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fa7fe724890>, '_model_dir': 'min_out', '_num_worker_replicas': 1, '_task_id': 0, '_log_step_count_steps': 100, '_master': '', '_save_checkpoints_steps': None, '_keep_checkpoint_every_n_hours': 10000, '_service': None, '_save_summary_steps': 100, '_num_ps_replicas': 0}
INFO:tensorflow:Running training and evaluation locally (non-distributed).
INFO:tensorflow:Start train and evaluate loop. The evaluate will happen after 600 secs (eval_spec.throttle_secs) or training is finished.
INFO:tensorflow:Create CheckpointSaverHook.
2017-11-22 21:40:47.048052: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: Tesla M60, pci bus id: 0000:00:1e.0, compute capability: 5.2)
INFO:tensorflow:Restoring parameters from min_out/model.ckpt-1
2017-11-22 21:40:47.076405: W tensorflow/core/framework/op_kernel.cc:1192] Not found: Key dense_1/kernel not found in checkpoint
2017-11-22 21:40:47.079173: W tensorflow/core/framework/op_kernel.cc:1192] Not found: Key SGD/iterations not found in checkpoint
2017-11-22 21:40:47.079637: W tensorflow/core/framework/op_kernel.cc:1192] Not found: Key dense_1/kernel not found in checkpoint
         [[Node: save/RestoreV2_5 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_5/tensor_names, save/RestoreV2_5/shape_and_slices)]]
2017-11-22 21:40:47.080045: W tensorflow/core/framework/op_kernel.cc:1192] Not found: Key SGD/lr not found in checkpoint
2017-11-22 21:40:47.080601: W tensorflow/core/framework/op_kernel.cc:1192] Not found: Key SGD/decay not found in checkpoint
2017-11-22 21:40:47.081693: W tensorflow/core/framework/op_kernel.cc:1192] Not found: Key dense_1/bias not found in checkpoint
2017-11-22 21:40:47.081871: W tensorflow/core/framework/op_kernel.cc:1192] Not found: Key training/SGD/Variable not found in checkpoint
2017-11-22 21:40:47.082097: W tensorflow/core/framework/op_kernel.cc:1192] Not found: Key SGD/momentum not found in checkpoint
2017-11-22 21:40:47.082403: W tensorflow/core/framework/op_kernel.cc:1192] Not found: Key training/SGD/Variable_1 not found in checkpoint
Traceback (most recent call last):
  File "minimal_modeldir.py", line 23, in <module>
    tf.estimator.train_and_evaluate(est_keras, train_spec, eval_spec)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/training.py", line 430, in train_and_evaluate
    executor.run_local()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/training.py", line 609, in run_local
    hooks=train_hooks)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 302, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 780, in _train_model
    log_step_count_steps=self._config.log_step_count_steps) as mon_sess:
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 368, in MonitoredTrainingSession
    stop_grace_period_secs=stop_grace_period_secs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 673, in __init__
    stop_grace_period_secs=stop_grace_period_secs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 493, in __init__
    self._sess = _RecoverableSession(self._coordinated_creator)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 851, in __init__
    _WrappedSession.__init__(self, self._create_session())
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 856, in _create_session
    return self._sess_creator.create_session()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 554, in create_session
    self.tf_sess = self._session_creator.create_session()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 428, in create_session
    init_fn=self._scaffold.init_fn)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/session_manager.py", line 273, in prepare_session
    config=config)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/session_manager.py", line 205, in _restore_checkpoint
    saver.restore(sess, ckpt.model_checkpoint_path)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1666, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 889, in run
    run_metadata_ptr)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1120, in _run
    feed_dict_tensor, options, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1317, in _do_run
    options, run_metadata)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1336, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Key dense_1/kernel not found in checkpoint
         [[Node: save/RestoreV2_5 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_5/tensor_names, save/RestoreV2_5/shape_and_slices)]]
         [[Node: save/RestoreV2_2/_9 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_30_save/RestoreV2_2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

Caused by op u'save/RestoreV2_5', defined at:
  File "minimal_modeldir.py", line 23, in <module>
    tf.estimator.train_and_evaluate(est_keras, train_spec, eval_spec)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/training.py", line 430, in train_and_evaluate
    executor.run_local()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/training.py", line 609, in run_local
    hooks=train_hooks)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 302, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 780, in _train_model
    log_step_count_steps=self._config.log_step_count_steps) as mon_sess:
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 368, in MonitoredTrainingSession
    stop_grace_period_secs=stop_grace_period_secs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 673, in __init__
    stop_grace_period_secs=stop_grace_period_secs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 493, in __init__
    self._sess = _RecoverableSession(self._coordinated_creator)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 851, in __init__
    _WrappedSession.__init__(self, self._create_session())
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 856, in _create_session
    return self._sess_creator.create_session()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 554, in create_session
    self.tf_sess = self._session_creator.create_session()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 419, in create_session
    self._scaffold.finalize()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/monitored_session.py", line 212, in finalize
    self._saver.build()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1227, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1263, in _build
    build_save=build_save, build_restore=build_restore)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 745, in _build_internal
    restore_sequentially, reshape)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 470, in _AddShardedRestoreOps
    name="restore_shard"))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 427, in _AddRestoreOps
    tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 267, in restore_op
    [spec.tensor.dtype])[0])
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_io_ops.py", line 1021, in restore_v2
    shape_and_slices=shape_and_slices, dtypes=dtypes, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
    op_def=op_def)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1470, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

NotFoundError (see above for traceback): Key dense_1/kernel not found in checkpoint
         [[Node: save/RestoreV2_5 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_5/tensor_names, save/RestoreV2_5/shape_and_slices)]]
         [[Node: save/RestoreV2_2/_9 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_30_save/RestoreV2_2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

@fchollet @yifeif May be related to #14504 and/or #14776

@yifeif could you please take a look at this.

Thanks for reporting the issue @droidicus. This should be fixed with #14354.


Add micro-rollup-playground extension

Description
This extension lets developers quickly interact, debug and fetch information from their Micro-rollups. It leverages @stackrlabs's playground to mimic the fraction of the actual playground's capabilities right from Raycast.
Screencast

Checklist

[ ] I read the extension guidelines
[x] I read the documentation about publishing
[x] I ran npm run build and tested this distribution build in Raycast
[x] I checked that files in the assets folder are used by the extension itself
[x] I checked that assets used by the README are placed outside of the metadata folder

Will update you with a hosted example today.
Can you share a clip for "When you enter the command you’ll see a flicker before showing a form, if you hit escape it’s showing a list of items instead"?

Sure, here it is 🙂
https://github.com/user-attachments/assets/b00b1c05-3378-4542-acab-7bc2a5545f0c

Sure, here it is 🙂
Raycast20082024-hQlpqWBJ.png.mp4

Thanks a lot, it shouldn't do this. Will fix this and do the needful


index.js line 114

Login accepts added characters at end of username
handler.login(username+"morecharacters",password, ...


Is there a build in provision for keeping the application running forever using forever/ supervisor ?

I use pm2 and suggest it. Build has nothing to do with it. You can simply run pm2 start server.js
I think something similar applies for forever/supervisor also.

@shanavas786  quick question:  So I'm using docker so that i can mimic the linux / ubuntu platform while developing on mac.   Do you recommend running docker on ec2   (ubuntu ) again and run the app via that  or i can just get the app files from git and run it there ?

I haven't used docker.
It seems adding
CMD npm install -g pm2
CMD pm2 start server.js

to dockerfile would be enough.
https://hub.docker.com/r/meanjs/mean/ may help you

I appreciate that

Its easy just do
After installing gulp both as global and local,
sudo pm2 start gulp


Increase timeout on tests (from 10s to 30s) so that they pass

Increase timeout on tests (from 10s to 30s) so that they pass on my machine.
Also make it easy to see minutes, seconds, in the values.

Yeah I was considering that nice one, I did how ever make some changes so test now easily pass without this change (disable IDB for tests for example), can you confirm this?
I will end up merging in any case as we can afford a longer wait time on tests.

I am surprised you resisted from renaming Class1 ;)


Feature Request: tf.contrib.image.interpolate_spline partially known TensorShape

Please go to Stack Overflow for help and support:
https://stackoverflow.com/questions/tagged/tensorflow
If you open a GitHub issue, here is our policy:

It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).
The form below must be filled out.
It shouldn't be a TensorBoard issue. Those go here.

Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 10.13.5
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A
TensorFlow installed from (source or binary): pip
TensorFlow version (use command below): 1.8.0
Python version: 3.6
Bazel version (if compiling from source): N/A
GCC/Compiler version (if compiling from source): N/A
CUDA/cuDNN version: N/A
GPU model and memory: N/A
Exact command to reproduce: N/A

You can collect some of this information using our environment capture script:
https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh
You can obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
Describe the problem
Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.
When using tf.contrib.image.interpolate_spline(), the input cannot have partially known shape, e.g., a placeholder. I wonder if new features to allow inputs with partially known shape can be added. The following is a code snippet to demonstrate the problem. Thank you for helping!
Source code / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.
import tensorflow as tf
X = tf.placeholder(tf.float32, [None])
Y = tf.constant([4,5,6], tf.float32)
x2 = tf.constant([2.5,2.3,2.9], tf.float32)
x = tf.reshape([[X]], [1, -1, 1])
y = tf.reshape([[Y]], [1, -1, 1])
x2 = tf.reshape([[x2]], [1, -1, 1])
y2 = tf.contrib.image.interpolate_spline(x, y, x2, order=1)
with tf.Session() as session:
result = session.run(y2, feed_dict={X: [1, 2, 3]})
print(result[0,:,0])

/CC @rmlarsen, @davidbelanger, can either of you work on this?

Nagging Assignee @rmlarsen: It has been 15 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Sorry for the delay. I'm just returning from paternity leave. I can address
this issue some time in the next few days.
On Tue, Aug 14, 2018 at 3:58 PM, Alfred Sorten Wolf <
<EMAIL_ADDRESS>wrote:

Nagging Assignee @rmlarsen https://github.com/rmlarsen: It has been 15
days with no activity and this issue has an assignee. Please update the
label and/or status accordingly.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/tensorflow/issues/21136#issuecomment-412994534,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABH_qp3Z621tlSRS-XmY1z17K5BzxEAWks5uQyvigaJpZM4Vg6Uw
.


Improve min height calculation

Currently, the minimum height calculation allocates the minimum height for each section, then the remaining pool is available based on the ratio of the section. This makes small sections greedy, where they allocate even more height despite getting the minimum.
A less greedy solution is the following:

Have the normal pool share, but calculate from the smallest guy first and go onward (bottom to top).
Calculate the required area for the section based on its ratio. If less than the minimum, use the minimum height and subtract from remaining area. Otherwise, use the ratio.
Note: still need to draw from top to bottom, so the draw order is reversed from the calculation order.

Also, we can run out of room from all these small fries taking space. Need to precalculate beforehand to see if we will have a problem, and, if so, throw an exception.

Honestly not a big issue...


GoAccess Gist

Hello @allinurl !
I make a gist with steps to install GoAccess with no errors.
https://gist.github.com/richardwellerson/a1415726f70e8e8aeadb9b65ce28798a
Bye!

Awesome, thanks for sharing! I'll keep it open for sometime.


(PDB-163) Add the in-array operator to the query language

This commit adds the in-array operator to the query language.
For example:

        ["from", "nodes",
            ["subquery", "resources",
                ["in", "type",
                    ["array",
                      ["File",
                       "Apache::Mode",
                       "Apt::Pin"]]]]]

Refer to this link for build results (access rights to CI server needed):
http://jenkins-enterprise.delivery.puppetlabs.net/job/enterprise_puppetdb_init-multijob_githubpr-master/328/
Test PASSed.

this seems not to work for arrays of hashes

putting a nonexistent column after in when used with an array produces an NPE

Looks like UUID columns have the same problem, I'll take a look and add some more tests.

Addressed your comments @wkalt

Refer to this link for build results (access rights to CI server needed):
http://jenkins-enterprise.delivery.puppetlabs.net/job/enterprise_puppetdb_init-multijob_githubpr-master/329/
Test FAILed.

+1

Refer to this link for build results (access rights to CI server needed):
http://jenkins-enterprise.delivery.puppetlabs.net/job/enterprise_puppetdb_init-multijob_githubpr-master/330/
Test PASSed.


1.3.x deployment getting into immobilized state

Rancher Versions:
Server: 1.3.2
Docker Version:
1.12.6
Steps to Reproduce:
Symptoms:
Seems to affect deployments that have been upgraded from 1.1 -> 1.2 then to 1.3
active running processes low
large backlog of processes
setting process.replay.batch.size to a large number, say 100k, gets the server to pull in an actionable number of processes for it to work on.
Results:

With the release of Rancher 2.0, development on v1.6 is only limited to critical bug fixes and security patches.


⚠ ClamAV has degraded performance

In a3e0996, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 217 ms

Resolved: ClamAV performance has improved in fb3fef2 after 5 minutes.


Create HarmonyOS gitignore

HarmonyOS is a distributed operating system developed by Huawei to run on multiple devices
This is a new template:
HarmonyOS website: https://developer.harmonyos.com/en/develop
Created PR at Toptal too: https://github.com/toptal/gitignore/pull/425

Thanks for the contribution, however per the contribution guidelines this file should be placed in the community folder. Please edit the location of the file.
https://github.com/github/gitignore#specialized-templates


Fix for Blazor.Streams latest version (0.4.2)

Fix to work with the latest version of Blazor.Streams (0.4.2) WritableStream base class.
Missing a CreationOptions parameter for WritableStream constuctor.

Hey @jlchavez thanks for the PR. I planned to make an upgrade to have CreationOptions for all JS wrapper types in Blazor.FileAPI first and then do the same for this project followed by Blazor.FileSystemAccess. And while doing this also upgrade to use the newest version of Blazor.WebIDL in all the projects. Sorry that this was not clear from any issues or documentation.
If you need to use the newest version of Blazor.Streams then I can prioritize getting this done quickly so that you can proceed.

Thanks, I had to recompile FileSystem and FileApi, because of fixing Streams, but compilation failed because of WebIDL so had to pull all projects and recompile including DOM. Currently working with my forks, and when there is an update I'll update everything to using nuget.


Invalid code when formatting matches!() expressions with leading pipe also for the first alternative

When I format the following code using rustfmt src/cmds.rs (with rustfmt 1.5.2-stable (8ede3aa 2023-07-12)) I get invalid code.
Original valid code:
impl SwayrCommand {
    fn is_scripting_command(&self) -> bool {
        matches!(
            self,
            | SwayrCommand::GetWindowsAsJson { .. }
            | SwayrCommand::ForEachWindow { .. }
        )
    }
}

Invalid code after formatting:
impl SwayrCommand {
    fn is_scripting_command(&self) -> bool {
        matches!(self, |SwayrCommand::GetWindowsAsJson { .. }| {
            SwayrCommand::ForEachWindow { .. }
        })
    }
}

The issue seems to be caused by the pipe | before the first alternative which is probably uncommon but legal.

I hoped I could fix the subjectively strange indentation of matches!() where the 2nd to last alternative are indented much more than the first that way.  I.e., that's what I get now
impl SwayrCommand {
    fn is_scripting_command(&self) -> bool {
        matches!(
            self,
            SwayrCommand::GetWindowsAsJson { .. }
                | SwayrCommand::ForEachWindow { .. }
                | SwayrCommand::ForEachWindow2 { .. }
                | SwayrCommand::ForEachWindow4 { .. }
        )
    }
}

and what would please me more would be
impl SwayrCommand {
    fn is_scripting_command(&self) -> bool {
        matches!(
            self,
            SwayrCommand::GetWindowsAsJson { .. }
            | SwayrCommand::ForEachWindow { .. }
            | SwayrCommand::ForEachWindow2 { .. }
            | SwayrCommand::ForEachWindow4 { .. }
        )
    }
}

and by prefixing even the first alternative with a pipe, I would get
impl SwayrCommand {
    fn is_scripting_command(&self) -> bool {
        matches!(
            self,
            | SwayrCommand::GetWindowsAsJson { .. }
            | SwayrCommand::ForEachWindow { .. }
            | SwayrCommand::ForEachWindow2 { .. }
            | SwayrCommand::ForEachWindow4 { .. }
        )
    }
}

which is as aesthetically pleasing as the wished-for version.

I hoped I could fix the subjectively strange indentation of matches!() where the 2nd to last alternative are indented much more than the first that way. I.e., that's what I get now

Support for matches isn't perfect. see #5547 and the other linked issues.
For what it's worth, I've already started work to improve matches! formatting in #5554. I started working on that before the formation of the official style team, so I'll likely need to work with them to make sure the formatting is correct before we move forward.
I also just double checked and the code changes proposed in #5554 produce the following with your first input snippet:
impl SwayrCommand {
    fn is_scripting_command(&self) -> bool {
        matches!(self, SwayrCommand::GetWindowsAsJson { .. } | SwayrCommand::ForEachWindow { .. })
    }
}

The larger input snippet is formatted as:
impl SwayrCommand {
    fn is_scripting_command(&self) -> bool {
        matches!(
            self,
            SwayrCommand::GetWindowsAsJson { .. }
            | SwayrCommand::ForEachWindow { .. }
            | SwayrCommand::ForEachWindow2 { .. }
            | SwayrCommand::ForEachWindow4 { .. }
        )
    }
}


NuGet release 2.1.1 isn't tagged in this repo and isn't shown as a release with release notes

Describe the bug

On this package's NuGet page, https://www.nuget.org/packages/Microsoft.Windows.CsWinRT/2.1.1?_src=template#releasenotes-body-tab, the latest version 2.1.1 refers to https://github.com/microsoft/CsWinRT/releases to see release notes, but the new version isn't present yet.
To Reproduce

Go to https://www.nuget.org/packages/Microsoft.Windows.CsWinRT/2.1.1?_src=template#releasenotes-body-tab
Follow the release notes link https://github.com/microsoft/CsWinRT/releases
Try finding release 2.1.1 (not present)
Go to the tags page.
Try finding the 2.1.1 tag (not present)

Expected behavior

Binary NuGet package releases are based on the same tag as the ones in this repo, and the packages in GitHub release artifacts match the ones on NuGet.
Version Info

About CsWinRT 2.1.1
Additional context

Release notes / tags will be published soon.

Published.


refactor(semantic): move export-related reference flags logic to visit functions

#7829
#7828  👈 (View in Graphite)
main

How to use the Graphite Merge Queue
Add either label to this PR to merge it via the merge queue:

0-merge - adds this PR to the back of the merge queue
hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.


docs: typo in README, preffered to preferrred

Changed preffered to preferred

Thanks. While we're at it, out of curiosity, where did you discover this little lib?

where did you discover this little lib?

I was trying to learn about WebAuthN and was searching around for various providers.  Started with Auth0 and it was too complicated and still heavily relied on older OAuth fallbacks, then found Passwordless but that library seems poorer quality, then finally found this one and it seems to work for me.
I do still have trouble getting the roaming authenticators to work. (I can register, but not sign in with them) However, the platform authenticators work fine.  I think this might be an issue with how I am using it, not the library's problem though.


WIP create a new xpub from a token, without the admin key

@icellan whats the status on this PR?


Add builder API:  InRequired

Why you need it?
builder API of In, if para is null or empty, will ignored
builder API of InRequired, if para is null or empty, with return empty slice

repeated


FutureW : add an async short circuiting quorum method

In order to ensure application responsiveness we may want to short circuit some calculations or service calls after a specified time period, or number of successful results (or other criteria). A method that allows us to race futures and asynchronous collect the results would be very useful on the FutureW class. SimpleReact already offers something similar (but currently blocks on the response).
Quorum should race supplied Futures allowing user code to determine a short circuit point.
A FutureW should be returned from the quorum method and it's result populated asynchronously
 public static <T> FutureW<ListX<T>> quorum(Predicate<Status<T>> breakout,FutureW<T>... fts) {

        List<CompletableFuture<?>> list = Stream.of(fts)
                                                .map(FutureW::getFuture)
                                                .collect(Collectors.toList());

        return FutureW.of(new Blocker<T>(list, Optional.of(e-> {
                    log.error(e.getMessage(), e);
                })).nonBlocking(breakout));

    }

Merged in https://github.com/aol/cyclops-react/pull/339


Kmesh: Introduce sendmsg ebpf program for metadata encoding

What type of PR is this?

What this PR does / why we need it:
add ebpf program for Kmesh:
sendmsg: do metadata encode for waypoint
Which issue(s) this PR fixes:
Fixes #
NA
Special notes for your reviewer:
Does this PR introduce a user-facing change?:

/retest

../workload/include/encoder.h:27:25: error: use of undeclared identifier 'MAP_SIZE_OF_MAX'
__uint(max_entries, MAP_SIZE_OF_MAX);


🌌 (feat): New MD files.

Added README, FAQ, and CONTRIBUTING file. lmk how it looks.

im just going to merge

sure thats fine


Unittests & continuous integration

As mentioned in other tickets & pull requests, a clean way to test support for multiple versions of Django & Python is needed as some changesets actually brake support for Python 2 or 3 alternatively, etc.
This branch I started a couple of days ago got raced by work in #62 but the purpose here is to bring incremental changes picking up work from other contributors like in #28 and build on that. Also, you retain the ability to test the full matrix locally if you wish with tox (and in parallel with detox).
The net result should end up the same though.
If required, I can also rework #28 to make more atomic commits prior to getting this branch merged.
You can see from the Travis CI logs that even with the Py3 changes from #28, current master has broken python 3 support.

Django 1.9 is EOLed since April, 4th. See https://www.djangoproject.com/download/#supported-versions.

Makes sense. Thank you for explanation.


Wild Fall Damage - Titan

Both Orion and Atlas have fall damage disabled in the overworld. However, on Titan fall damage is on in the overworld.

Just changed the gamerule, should be fixed! Closing for now, thanks for the report!


Admin credentials are used to access description and contract endpoints

Describe the bug
Unable to use App credentials to request a resource description or initiate contract negotiation.
Currently, the admin credentials are required to call these endpoints.
To Reproduce
Steps to reproduce the behavior:
1.Call POST /api/ids/contract with App credentials or call POST /api/ids/description
Expected behavior
The endpoint is accessible.
Desktop (please complete the following information):

Version 6.2.0

Additional context
Full docker-compose from the Examples

Could be solved by either implementing identity and role management or setting up a reverse proxy.


Do not set TargetPort to Port when IsProxying is also set

When creating endpoint annotations, if a TargetPort is equal to the Port for a non-Container resource (and non-null) and IsProxying is true, that is an error: DCP cannot bind a proxy to a port which the target service is also bound to.
This PR does two things:

We do not set TargetPort to Port automatically if IsProxying is true.
If the resource is not a container and TargetPort == Port && IsProxying, then we throw during startup

Microsoft Reviewers: Open in CodeFlow

Can you re gen the manifests? I want to see if there are any changes

cc @vhvb1989

Can you re gen the manifests?

Is there a way to do that across all projects? We have some tests which check manifest output and they did not change

We should really add an official way to do it to the repo, but here's a hack powershell script that I used a few weeks ago:
$playground_apps = @(
    "C:\git\aspire2\playground\AWS\AWS.AppHost\",
    "C:\git\aspire2\playground\AzureSearchEndToEnd\AzureSearch.AppHost\",
    "C:\git\aspire2\playground\AzureStorageEndToEnd\AzureStorageEndToEnd.AppHost\",
    "C:\git\aspire2\playground\bicep\BicepSample.AppHost\",
    "C:\git\aspire2\playground\cdk\CdkSample.AppHost\",
    "C:\git\aspire2\playground\CosmosEndToEnd\CosmosEndToEnd.AppHost\",
    "C:\git\aspire2\playground\CustomResources\CustomResources.AppHost",
    "C:\git\aspire2\playground\dapr\AppHost\",
    "C:\git\aspire2\playground\DatabaseMigration\DatabaseMigration.AppHost",
    "C:\git\aspire2\playground\mongo\Mongo.AppHost\",
    "C:\git\aspire2\playground\mysql\MySqlDb.AppHost\",
    "C:\git\aspire2\playground\nats\Nats.AppHost\",
    "C:\git\aspire2\playground\OpenAIEndToEnd\OpenAIEndToEnd.AppHost\",
    "C:\git\aspire2\playground\orleans\OrleansAppHost",
    "C:\git\aspire2\playground\ParameterEndToEnd\ParameterEndToEnd.AppHost\",
    "C:\git\aspire2\playground\PostgresEndToEnd\PostgresEndToEnd.AppHost\",
    "C:\git\aspire2\playground\ProxylessEndToEnd\ProxylessEndToEnd.AppHost\",
    "C:\git\aspire2\playground\seq\Seq.AppHost\",
    "C:\git\aspire2\playground\signalr\SignalRAppHost\",
    "C:\git\aspire2\playground\SqlServerEndToEnd\SqlServerEndToEnd.AppHost\",
    "C:\git\aspire2\playground\TestShop\AppHost\")

foreach ($playground_app in $playground_apps)
{
Push-Location $playground_app
dotnet run -- --publisher manifest --output-path aspire-manifest.json
Pop-Location
}

I ran the script and compared main vs prior to this commit and got the same results.


安装依赖报错

$ yarn install
yarn install v1.22.10
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning element-ui > async-validator > babel-runtime ><EMAIL_ADDRESS>core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning jsonlint ><EMAIL_ADDRESS>Package no longer supported. Contact<EMAIL_ADDRESS>for more info.
error An unexpected error occurred: "https://github.com/sohee-lee7/Squire: read ECONNRESET".
info If you think this is a bug, please open a bug report with the information provided in "F:\鑷繁鐨勫伐浣淺\work\vue-element-admin\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Command failed.
Exit code: 1
Command: git
Arguments: pull
Directory: C:\Users\Administrator\AppData\Local\Yarn\Cache\v6.tmp\60cb5dac1cfafc1829af48c5dc5fdf3f
Output:
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> master
at ProcessTermError.ExtendableBuiltin (C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:721:66)
at ProcessTermError.MessageError (C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:750:123)
at new ProcessTermError (C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:790:113)
at ChildProcess.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:25884:17)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

同问

试试更改package.json
 "tui-editor": "1.4.10",

添加yarn代理
我的 node 版本为 12.22.7


every time vim in the bash edits file  always trigger the p-key which automately copy the trash into the file.

VSCode Version: Code 1.16.1 (27492b6bf3acb0775d82d2f87b25a93490673c6d, 2017-09-14T16:24:39.530Z)
OS Version: Darwin x64 17.0.0
Extensions:

Extension
Author (truncated)
Version

project-manager
ale
0.21.1

python
don
0.7.0

cpptools
ms-
0.12.4

(1 theme extensions excluded)

Steps to Reproduce:

Reproduces without extensions: Yes/No

Can you clarify a few things?

You are using vim, but where? In the editor? In the integrated terminal? Which bash are you using in the terminal?
Can you share repro steps? Screenshots or videos/gifs can be helpful

vim 8.0.10 in the integrated bash or zsh, both this situation happened, but in the MACOS system bash or zsh is ok for vim, this situation only happened in the  integrated editor both bash and zsh.
My steps is simple, install VScode whatever which version, then type vim in the integrated terminal bash or zsh, and type temple in the vim, then key-yy, and :wq in the vim, type the vim repeatedly. In the next entry to the vim, you will see vim key-p the paste board content for information without your consent, but never happen in the MACOS system bash or zsh.
This is the biggest bug in the VScode!!!

On 19 Sep 2017, at 5:46 AM, Ramya Rao<EMAIL_ADDRESS>wrote:
Can you clarify a few things?
You are using vim, but where? In the editor? In the integrated terminal? Which bash are you using in the terminal?
Can you share repro steps? Screenshots or videos/gifs can be helpful
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode/issues/34583#issuecomment-330365643, or mute the thread https://github.com/notifications/unsubscribe-auth/AHuUpEp1Awcdx5Fxjlbi5IT67RHQB0VPks5sjuTPgaJpZM4PbX2z.

vim 8.0.10 in the integrated bash or zsh, both this situation happened, but in the MACOS system bash or zsh is ok for vim, this situation only happened in the  integrated editor both bash and zsh.
My steps is simple, install VScode whatever which version, then type vim in the integrated terminal bash or zsh, and type temple in the vim, then key-yy, and :wq in the vim, type the vim repeatedly. In the next entry to the vim, you will see vim key-p the paste board content for information without your consent, but never happen in the MACOS system bash or zsh.
This is the biggest bug in the VScode!!!

I didn't install any plugin in this situation which vim repeatedly called the key-p to paste anything but in the paste board.

I figure out that this problem come from the specific vim version which from the source fo brew, using the macos default vim is ok.
please contact brew make compatible this vim with VScode.

So you are saying that this problem occurs when you build vim from source using brew?

yes, the vim from the<EMAIL_ADDRESS>is ok.

On 19 Sep 2017, at 2:11 PM, Ramya Rao<EMAIL_ADDRESS>wrote:
So you are saying that this problem occurs when you build vim from source using brew?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode/issues/34583#issuecomment-330439408, or mute the thread https://github.com/notifications/unsubscribe-auth/AHuUpM5R4QPy5TXs7n1_cwmqNBdu4elhks5sj1r8gaJpZM4PbX2z.

This version of VScode is seriously incompatible with SpaceVim and has many problems with integrated terminal which installed SpaceVim.

On 19 Sep 2017, at 2:11 PM, Ramya Rao<EMAIL_ADDRESS>wrote:
So you are saying that this problem occurs when you build vim from source using brew?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode/issues/34583#issuecomment-330439408, or mute the thread https://github.com/notifications/unsubscribe-auth/AHuUpM5R4QPy5TXs7n1_cwmqNBdu4elhks5sj1r8gaJpZM4PbX2z.

Yup, can confirm. However it seems to be a problem with the integrated terminal running zsh. If you type any command into zsh, does the command get printed out in a new line?

yes, This happened to me.

On 19 Sep 2017, at 6:48 PM, Ole Bläsing<EMAIL_ADDRESS>wrote:
Yup, can confirm. However it seems to be a problem with the integrated terminal running zsh. If you type any command into zsh, does the command get printed out in a new line?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/Microsoft/vscode/issues/34583#issuecomment-330502084, or mute the thread https://github.com/notifications/unsubscribe-auth/AHuUpGEQTeL_cF4RjFw9uXKnUeXdqZZ7ks5sj5wYgaJpZM4PbX2z.

Does anyone have reliable/precise repro steps for this? I just tried to:
brew install vim
/usr/local/Cellar/vim/8.0.1150/bin/vim

It seems to work just fine.

Do you use zsh? I only can reproduce this behaviour with zsh. bash works fine for me, too.

I tried with both zsh and bash.
There was a similar issue to this before but there was also no repro. I suspect this is something about the environment triggering this behavior, just not sure what it could be as it only seems to affect vscode's terminal.

I found the other issues, let's close this in favor of https://github.com/Microsoft/vscode/issues/34145


fix(side-panel): Добавлено значение по-умолчанию в useMatchMedia

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

1 of 1 (100.0%)  changed or added relevant line in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.009%) to 80.681%

Totals

Change from base Build<PHONE_NUMBER>:
0.009%

Covered Lines:
7313

Relevant Lines:
8263

💛  - Coveralls


v1.4.0 it.json

Italian localization created for the module v1.4.0

Please also update module.json

Done

Released in v1.4.1, grazie


Add typescript attribute to prevent .d.ts emit

Fixes #1691 by adding support for the #[wasm_bindgen(typescript = false)] syntax.

Thanks for this! I think though perhaps instead of typescript = false we could do something like skip_typescript? I'm not sure how many other things we'll want on the other side of the = for now perhaps?
It may also make sense to hold off on this for a bit while https://github.com/rustwasm/wasm-bindgen/pull/2012 is sorted out, since that's a pretty unwieldy PR and may be hard to rebase over this.

skip_typescript seems good to me. If you prefer to wait on that PR, I don't mind rebasing/reworking this once that's in.

Thanks!