Uninstalling pyasn1==0.2.2 throws an apparently spurious exception

Hi there!
I ran pip install -U . in a clone of the repo checked out at tag 0.2.2 and, though the upgrade appeared to cause the correct transformation, the process raised an OSError.
I believe the cause is a bug in the uninstall logic
Replication:

check that pyasn1==0.2.2 is installed:

root@REDACTED:/home/jenkins# pip freeze | grep pyasn1
pyasn1==0.2.2

check that /usr/local/lib/python2.7/dist-packages/pyasn1-0.2.2-py2.7.egg exists (and that other versions do not):

root@REDACTED:/home/jenkins# ls -la /usr/local/lib/python2.7/dist-packages/pyasn1*
-rw-r--r-- 1 root staff 119738 Sep 20 17:18 /usr/local/lib/python2.7/dist-packages/pyasn1-0.2.2-py2.7.egg

uninstall pyasn1:

root@REDACTED:/home/jenkins# pip uninstall pyasn1
Uninstalling pyasn1-0.2.2:
  /usr/local/lib/python2.7/dist-packages/pyasn1-0.2.2-py2.7.egg
Proceed (y/n)? y
  Successfully uninstalled pyasn1-0.2.2
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 11, in <module>
    load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/__init__.py", line 233, in main
    return command.main(cmd_args)
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 252, in main
    pip_version_check(session)
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/utils/outdated.py", line 102, in pip_version_check
    installed_version = get_installed_version("pip")
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 838, in get_installed_version
    working_set = pkg_resources.WorkingSet()
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 644, in __init__
    self.add_entry(entry)
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 700, in add_entry
    for dist in find_distributions(entry, True):
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1949, in find_eggs_in_zip
    if metadata.has_metadata('PKG-INFO'):
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1463, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1823, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1703, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/pkg_resources/__init__.py", line 1643, in load
    mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/pyasn1-0.2.2-py2.7.egg'

check the state of '/usr/local/lib/python2.7/dist-packages/pyasn1*`:

root@REDACTED:/home/jenkins# ls -la /usr/local/lib/python2.7/dist-packages/pyasn1*
ls: cannot access '/usr/local/lib/python2.7/dist-packages/pyasn1*': No such file or directory

My belief is that the uninstall command is correctly removing the referenced .egg and then incorrectly asserting that it expects the .egg to exist.    Since the uninstall logic is a component of the pip install --upgrade process, this causes my upgrade-dependent infrastructure to fail.
Thanks for your software!

Hmmm
This bug seems to only occur when I initially install with:
python setup.py install
So pip uninstall pyasn1 does work when install was also managed with pip.

It seems that pip uninstall specifically warns that this case is not supported:
https://pip.pypa.io/en/stable/reference/pip_uninstall/


support similar ruby sdkblock_assembler_config methods ？

ruby sdk support block_assembler_config，run the gem is so complex。
puts wallet.block_assembler_config

[block_assembler]
code_hash = "0x9e3b3557f11b2b3532ce352bfe8017e9fd11d154c4c7f9b7aaaa1e621b539a08"
args = ["0x03ae708e284f6a53d12da45f7fe5e8c232c353c2"]

It's fairly easy to support this but we highly recommend minder use ruby demo to achieve that. SDKs are targeting general usage but not specific to mining.
FYI, regarding block_assembler_config, code_hash is from the system script and args (the only one hex string) is your public key's blake2b 160 hash. These could already be fetched from the JS APIs.


Remove AssemblyUtil references

As far as I can tell, including the AssemblyUtil cient and references are hold-overs from the KB-SDK tutorial. None of our Apps use Assembly objects (obviously). Let's do some cleanup.

Removed all calls to the Assembly Utils client. kb-sdk tests ran successfully.


fix: font size format issue

:books: Linear Ticket :books:
#LIQ-132

@bradleySuira I can't seem to be able to merge.

not sure why @Jennievon , maybe it's about permissions we can ask to @monokh that has admin permissions

It worked in the last PR, wonder what happened again.


add support for project labels metadata

Hi, I was talking to @dsyer and @dussab after getting an interesting criticism on Twitter about how overwhelming all of our projects were for the novice, and that it should be easier to started with our projects. I've heard this criticism before, but  I want to help people understand how projects relate to each other and it occurred to me that we could visualize the projects in a graph (maybe using d3.js or something?) based on shared tags/labels.
This PR adds support for a ProjectLabel that adds metadata to the project information we keep in the database and adds a /project_metadata/projects endpoint to enumerate all the project names. With these two additions, and all the data I added to the schema & DDL, it should be easy to build a visualization that shows how projects relate to each other. the graph could show all the projects and connect them in terms of shared labels. we could make certain nodes in the graph have more 'weight' if they are 'aggregator' projects like Spring Cloud or Spring Data. The labels are things like tools, web, api, etc. i've added some basic labels and did some initial mapping from projects but we could easily change / add / remove them. I just want a rich ontology.

the idea behind all of this metadata is to drive analysis of the landscape of the projects, and how they relate to each other. i created a prototype UI (shown in the picture) that renders all the project info and labels. you can see which projects relate to others. they form natural clusters and its easy to see , for a given field of application, which projects might be of interest to somebody. Here's the prototype UI code.  Imagine it not as you see it above, but in a nice slick Sagan-hosted page with proper style/design applied. I imagine that when somebody clicks on a given project node they'd see on the right side of the UI (or a popup or.. whatever) all the information that we can draw from the REST API for the projects (eg: http://sagan/project_metadata/spring-boot) which shows up on http://spring.io/projects/spring-boot on the right side (the git repo, the site url, releases, etc.)

Sagan will be soon retired. A note has been added to the README.
We don't accept contributions anymore as a result.
Thanks for your help!


Need a workflow to delete a particular DEB version

We are using aptly to manage our APT repository for MW Agent.
Need a workflow to delete particular DEV version from APT repository.

@bhogayatakb  Could you please clarify the issue a bit further to help us understand it better?


rhels-6-level-1-scored-v2-0-1.yaml: CIS-5.2.11 Requires unnecessary whitespace

The module rule for CIS-5.2.11 requires that the 'Ciphers' line in sshd_config have trailing whitespace. This causes false positives on valid configurations that end the line after the third cipher.
This should match EOL ($) instead, or in addition.
Other CIS modules should be checked, as well.

This issue was moved to hubblestack/hubble-salt#42


Why protected?

Why is the validateLocation function protected and not private?

There are sitemap format extensions such as Google's one for video. Location validation is general enough to be used if you want to implement something like that.


Updated url and version of Andika (SIL)

Previous download URL was broken. Updated the URL from Google to the
upstream repository at SIL.

There was a pull request template when you submitted. It must be filled.
If you were not presented a template, you may have submitted via a CLI tool (likely hub). It that was the case, you may wish to see if the tool has a way to let you use the template (hub is working on it).
In either case, please refer to the template and update your comment.
Also, in the future, please submit separate pull requests for each cask, as more often than not this type of pull request brings problems with one or more of them, and it halts the inclusion of the other ones.

Thank you for the contribution. It needed some fixes, so they were made in c96b00ca442a29055f4660416e0765dddfe2976a. Your contribution is still included (and still credited to you), with the appropriate modifications. Please feel free to ask about any of the changes.

Thanks, @vitorgalvao! Indeed, I did not get the template but will make sure to follow the procedure next time! Many thanks for you kind advice and the fixes!


Switch to build service for sharing resolved rules between projects

This uses the same slightly hacky technique of allowing the first project that registers a build service to set a parameter to allow the first project configured to do the heavy lifting.
This has the disadvantage of exposing a resolutionRules configuration on each project and will mean the configuration is locked in every subproject again, but I don't see an another way to make this a singleton that's safe for parallelism.
The addition of Serializable all over the place is because build service parameters are subject to isolation.
My recollection is last time I tried to lock and resolve the resolutionRules configuration directly we ran into exceptions when the configuration needed to be modified after the fact, but I can't see why that would be the case.
I'll also follow this up with removal of our alignment implementation making core alignment the default, and make this a major release.

configuration is locked in every subproject again
How this will behave when introduced into existing projects? If we would start reading resolution rules configuration from each submodule and not just a root won't it be unlocked until the locks are regenerated? That would mean even projects with older lock state would suddenly start consuming the latest rules without any lock update.

configuration is locked in every subproject again

How this will behave when introduced into existing projects? If we would start reading resolution rules configuration from each submodule and not just a root won't it be unlocked until the locks are regenerated? That would mean even projects with older lock state would suddenly start consuming the latest rules without any lock update.

A perhaps intermediate state would be to introduce the resolution rules configurations to each subproject and let that soak for a while.
Then this build service change can be brought in & many of the projects will have already locked the needed configurations in each subproject.

I see this gets rid of copyConfiguration which the blocker to use modern JDKs to run builds 🥳


Merging Selective Connection

I've uploaded my Selective Connection subproject to ANT repository. (PR #69)
It's now in subprojects/sc directory.
ANT is currently using communication framework library(libant-cmfw), not selective connection.
Major difference between libant-cmfw and selective connection is the condition of switching between Bluetooth and Wi-fi Direct.
libant-cmfw switches Bluetooth and Wi-fi Direct according to the explicit function call of app or framework, such as wfd_on() or wfd_off().
On the other hand, Selective Connection  according to the expected energy or latency of data transfer.
Therefore, if Selective Connection is merged to ANT framework, energy consumption or transfer latency will be enhanced.

In the long-term plan, it is good to merge selective connection to the new ANT API (designed to support both IoT.js and node.js).


KMeans for Duplex

Thank you again for sharing the code!
If I understand correctly, when we use KMeans, k(Y) is deprecated. Another set of latent codes K is exploited to explicitly form spatial aware attention between image X and latent Y.  I have some questions with regards to intuition as well as implementation:

In Sec 3.1.2. A notation of  K = a(Y, X) is used. I am super confused about this line.

However, from line https://github.com/dorarad/gansformer/blob/main/training/network.py#L688. The Y is not used to compute centroid. Actually, if I understand correctly, the centroid is computed by K and the HxW image features.

A very detailed question: why do you concat  _queries and queries - _queries in line?
https://github.com/dorarad/gansformer/blob/3c0bcdee049d82318cb2f9327c8d6c7808664cd2/training/network.py#L587

Seems positional encoding for latent is never used in k-means + simplex setting? The gradient only flows to g_mapping

Thank you again and looking forward to your reply!

Hi, thanks so much for reaching out and apologies for the large delay in my response!

Note that the centroids are computed by multiplying the from_elements which is indeed a function of the queries (and in turn of X) by the from_to tensor. When we use 0 iterations of K-means (in the case of simplex attention as in the pretrained models), then it is initialized to a parameter. However, when setting i > 0, the tensor becomes a weighted averages over X elements based on the attention distribution between them and the Y latents, yielding the centroids.
Note that this is similar to how K-means operate, where the means are first initialized e.g. randomly, and then later are updated based on their interaction with the X elements. Here, each centroid is corresponding to a latent component from Y and its updates are based on the similarity between that Y latent and the X elements.

I added the _queries for backwards compatibility with the pre-trained models. It would be more elegant to just based them directly on queries. Will add a note about that!

hmm.. I'm actually surprised to hear that, since the code passed the latents' positional encodings to the transformer layer here and they are then should impact the keys through this line. I'll look into that further to see if there's anything incorrect in the implementation, but it should impact the attention distribution!


endDate is undefined on range date picker

Description
I tried to get endDate from this date picker. The start date is given properly but then the end date is undefined.
Console Log

LOG  start "2024-02-06T18:30:00.000Z"
LOG  end undefined

My Code
const DateRangePickerModel = () => {
    const [startDate, setStartDate] = useState(dayjs());
    const [endDate, setEndDate] = useState(dayjs());
    const setDate =  (startDate: any, endDate: any) => {
        console.log("start", startDate);
        console.log("end", endDate);
    };

    return (
        <View style={styles.container}>
            <DateTimePicker
                mode="range"
                startDate={startDate}
                endDate={endDate}
                onChange={({startDate, endDate}) => setDate(startDate, endDate)}
                displayFullDays={true}
                timePicker={false}
                selectedItemColor={Colors.ui_dark_bg}
                selectedTextStyle={styles.selectedTextStyle}
                headerButtonStyle={styles.headerButtonStyle}
                headerButtonColor={Colors.color_white}
                headerTextStyle={styles.headerTextStyle}
                todayContainerStyle={styles.todayContainerStyle}
            />

        </View>
    );
};

Additional Information
react: 18.2.0
react-native:  0.73.4
react-native-ui-datepicker":  2.0.1,

I am also experiencing the same issue. I can select start or end date. when i tap a date i get the feedback reported above

Same issue here, I downgrade to 1.0.11,  it looks like v2.x break many things, and not mentioned in the release log, like onChange(it is onValueChange in 1.0.11) return a dayjs object not a js date, and time picker performance issue still exists...It's a little frustrating

Same issue for me

I am getting this same issue

I personally had this issue when mutating/cloning the startDate/endDate DateTimePicker gives me (like formatting, or re-calling days on startDate/endDate)
Once passing the exact same object I received from the callback, it works fine:
const MyDatePicker = () => {
    const [startDate, setStartDate] = useState<Dayjs>(dayjs())
    const [endDate, setEndDate] = useState<Dayjs>(dayjs())
    const setDates =  (startDate: Dayjs, endDate: Dayjs) => {
        setStartDate(startDate)
        setEndDate(endDate)
    }

    return (
        <DateTimePicker
            mode="range"
            startDate={startDate} // <- This object has to be the exact one coming from `onChange`
            endDate={endDate} // <- This object has to be the exact one coming from `onChange`
            onChange={({ startDate, endDate }) => setDates(startDate, endDate)}
        />
    )
}

If you need to apply extra formatting, you probably need to use temporary states while manipulating the picker, and then setting your other formatted state

It's quite odd, I didn't quite understand what you suggested @xavier-villelegier . I'm facing the same problem here...

It's quite odd, I didn't quite understand what you suggested @xavier-villelegier . I'm facing the same problem here...

@joelpiccoli  Can you repro your piece of code with the issue on a Snack so that I can check ?

Actually @xavier-villelegier , I fixed it yesterday during the night here in Brazil. The problem was I was applying a format in the endDate to show it. I removed it and everything works. It's strange, that a ".format()" can influence a useState?

Description I tried to get endDate from this date picker. The start date is given properly but then the end date is undefined.
Console Log

LOG  start "2024-02-06T18:30:00.000Z"
LOG  end undefined

My Code
const DateRangePickerModel = () => {
    const [startDate, setStartDate] = useState(dayjs());
    const [endDate, setEndDate] = useState(dayjs());
    const setDate =  (startDate: any, endDate: any) => {
        console.log("start", startDate);
        console.log("end", endDate);
    };

    return (
        <View style={styles.container}>
            <DateTimePicker
                mode="range"
                startDate={startDate}
                endDate={endDate}
                onChange={({startDate, endDate}) => setDate(startDate, endDate)}
                displayFullDays={true}
                timePicker={false}
                selectedItemColor={Colors.ui_dark_bg}
                selectedTextStyle={styles.selectedTextStyle}
                headerButtonStyle={styles.headerButtonStyle}
                headerButtonColor={Colors.color_white}
                headerTextStyle={styles.headerTextStyle}
                todayContainerStyle={styles.todayContainerStyle}
            />

        </View>
    );
};

Additional Information react: 18.2.0 react-native: 0.73.4 react-native-ui-datepicker": 2.0.1,

Changing the name from 'endDate' to something else in the component state should solve the issue, this worked for me.


Tests for the Project file Parser

Adds unit tests (and an associated fixture) for the csproj file parser. Also adds support for the Target Framework Profile property in project files (crucial when working with PCLs and the Client profile).
First PR, so let me know if it needs work. Build script didn't highlight anything and I tried to base the tests off some existing ones where possible, so it should be alright from what I can tell.
Thanks!

Hi @agc93,
Thanks for your contribution :+1: , left some minor feedback, please adjust, rebase and squash commits and I'll review again for merging this in. Could you also please raise an issue and reference it in this PR. Please let us know if anythings unclear.

Relates to #879

This resolves #879 and #880

@agc93 just checking for our release planning is this something you'll be able to look at in near future or should we postpone it to next release?

@devlead I actually did rebase (clearly got the squash wrong) and referenced from issues and everything, it's just it's gone out of sync already before anyone merged it. Is there any way to predict when a merge will be possible to avoid having to do the rebase over and over?

@agc93 it's harder when you don't have a feature branch, if you don't work in develop, then you can just pull from upstream there and rebase feature branch continuously against your local develop branch.
As we have protected branches as PRs get merged others PRs need to be rebased again before they can be merged, this ensures issuer as used latest source & our CI also built against latest.

@devlead Okay makes sense. Should/can I close and reopen a new PR given the broken squash, initial lack of issue references, and being in the wrong branch?

@agc93 not if you don't want to, for this PR enough if you rebase it so it's aligned with upstream develop.

@agc93 are you wanting some help to bring this PR up to date?  I can walk you through the process if you want?

Ah, I'd actually forgotten about this :confounded: . In saying that, @gep13 a rundown on process would be great, particularly the rebase and squash process as I think I got it wrong last time..

NOTE: Please read all of this before actually doing anything..
@agc93 sure, these are the steps that I would follow...
Go to the local folder that you have the clone of the Cake repository in.  Run the following command:
git remote -v
This will hopefully contain something like the following:

i.e. this will contain a "link" to your fork of the repository on GitHub, an hopefully a "link" to the original repository, i.e. https://github.com/cake-build/cake.git
If this is not the case, then run the following command:
git remote add upstream https://github.com/cake-build/cake.git
So, now, what we want to do is to essentially update the local clone that you have of the Cake repository locally to your machine, to what is actually in the upstream repository.  With that in place, we can then rebase those changes into your branch, and then push only your changes into the PR branch that you have.  To do that, we will follow these commands:
First up, checkout the develop branch
git checkout develop
Fetch the most recent changes from the upstream repository
git fetch upstream
Add all of these changes into your local develop branch
git rebase upstream/develop
Push these changes into your fork on GitHub
git push origin develop
Move to your local branch...
Doh!  I have just typed out all of the above, and I hadn't checked if you had a local branch.  It looks like you don't :cry: This makes things much harder!
What I was going to say was...
Move to you local branch, and run
git rebase develop
This will then replay your commits on top of the most recent changes on the develop branch.  From there, you would then need to do:
git push -f
Which will force push the changes to your fork, which would then update the PR branch.
@devlead @patriksvensson do you have any suggestions on how best to proceed with this PR?

@gep13 @agc93 I would clone your fork into a temp folder(so you have your current local untouched if anything should go wrong),in develop do git checkout -b featurebranchname, so you have a feature branch with your pr changes. In your case i would do:
git clone https://github.com/agc93/cake.git
cd cake
git checkout develop
git checkout -b feature/GH879
git remote add upstream https://github.com/cake-build/cake.git

Then reset local develop to be as upstream, reset can be done via:
git fetch upstream -v
git reset --hard upstream/develop

Then develop is identical with upstream and you should be able to rebase your feature branch like this
git checkout feature/GH879
git rebase develop

, if all succeeds you can overwrite your forks develop with your local feature branch i.e. git push -f remote local_branch:remote_branch in this case
git push -f origin feature/GH879:develop

Disclaimer haven't tested above code as I'm writing on phone in sofa & typing git commands from memory , but it feels correct ;) , ping me if you have issues and I'll try steps against your repo
This is just because I wanna play safe, do as much locally as possible before pushing, you could probably just do
git checkout develop
git fetch upstream
git rebase upstream/develop
git push -f

But if it fails you could end up with a bad state in you repo.
If you get merge conflicts end up in a bad state you could just  clone your fork, create feature branch, reset develop. not rebase feature branch but  instead stay in develop, checkout the files you've changed from feature branch while in develop, add them, do a new commit and force push develop branch.

Alright so lesson 150% learned re feature branches before making changes. I followed @devlead 's couch-authored instructions and looks like that worked. I'll make sure I branch it out first next time :)
Let me know if it needs more work.

@agc93 Great that you got it sorted, LGTM 👍 Merged! Thanks for contributing!

@agc93 really glad to hear that you got it working!

@agc93 said...
Alright so lesson 150% learned re feature branches before making changes

Yip, this is the most important thing, even for small changes.  Using branches making syncing with upstream repository very simple.  Going forward, the steps that I laid out above should allow you to keep everything up to date.
Let me know if you have any questions.


Cetmodules migration

First stage of cetmodules migration for Spack build of DUNESW stack

Some of the version numbers have evolved -- I'll make my own PR subsuming this one and update the version numbers for ROOT, srproxy, and line up the product version with the latest in develop


[ci] Remove python 3.7 runners from test workflow.

This PR removes Python 3.7 from the CI as it reached it's end of life a year ago (and not all runners are still available in Github Actions). Python 3.8 will reached its EOL in three months so I would propose to support it until then.

Tests for python>3.8 currently fail because of numpy 2.0, see #618.


Unexpected shift key bubbling

VSCode Version: 1.10.1
OS Version: macOS Sierra

Steps to Reproduce:

Hold CMD
Hold SHIFT
Release CMD
Release SHIFT

In China many input methods use SHIFT key to switch between English and Chinese mode, however in vscode & macOS Sierra if we try "hold CMD -> hold SHIFT -> (press any other key) -> release CMD -> release SHIFT" system will detect a keypress event of SHIFT key and change the input mode, which is very annoying in coding job
I know this issue is related to webkit since google chrome has the exact same behavior, however vscode is deeply affected by it because there are many key combinations when coding, e.g. "CMD + SHIFT + LEFT" to select characters before cursor, this can randomly trigger the change of input mode, so is it possible this issue could be fixed in the scope of vscode?

This is an upstream issue (possibly within Chromium), and there are no known workarounds that we could implement on our side. This means there is no possible code change for us to do in VS Code sources to improve things.
To keep the number of issues in our inbox at a manageable level, we’re closing issues that have been on the backlog for a long time but haven’t gained traction or that are not actionable. Thank you for your time and understanding.


Error message when trying to use PCA

Hi,
I've just discovered Whatlies library and I was able to produce some interesting visualization. Though as soon as I try to import the PCA transformers (from whatlies.transformers import Pca), I get an error.
It also happens if it's the first line in the code, so I guess it must be somehow related to my specific modules/python combination.
I am running python 3.9.1 and here is the list of pip packages (I'm showing them all since I'm not sure about dependencies). Error message is afterwards.
Thanks,
Ivano
Package               Version
--------------------- -----------
altair                4.1.0
apparmor              3.0.1
appdirs               1.4.4
argon2-cffi           20.1.0
asn1crypto            1.4.0
async-generator       1.10
attrs                 20.3.0
backcall              0.2.0
bcc                   0.18.0
binaryornot           0.4.4
biplist               1.0.3
bleach                3.2.1
blis                  0.7.4
bob                   0.1
bpemb                 0.3.2
Brlapi                0.8.0
btrfsutil             5.9
CacheControl          0.12.6
catalogue             1.0.0
cffi                  1.14.4
chardet               3.0.4
click                 7.1.2
colorama              0.4.4
contextlib2           0.6.0.post1
cryptography          3.3.1
cycler                0.10.0
cymem                 2.0.5
decorator             4.4.2
defusedxml            0.6.0
distlib               0.3.1
distro                1.5.0
docutils              0.16
en-core-web-sm        2.3.1
entrypoints           0.3
fasttext              0.9.2
flashfocus            2.2.2
gensim                3.8.3
html5lib              1.1
i3ipc                 2.2.1
idna                  2.10
ipykernel             5.3.4
ipython               7.19.0
ipython-genutils      0.2.0
ipywidgets            7.5.1
it-core-news-lg       2.3.0
it-core-news-md       2.3.0
it-core-news-sm       2.3.0
jedi                  0.17.2
jeepney               0.6.0
Jinja2                2.11.2
joblib                0.17.0
jsonschema            3.2.0
jupyter               1.0.0
jupyter-client        6.1.7
jupyter-console       6.2.0
jupyter-core          4.7.0
jupyterlab-pygments   0.1.2
keyring               21.5.0
kiwisolver            1.3.1
LibAppArmor           3.0.1
libfdt                1.6.0
lit                   0.10.1.dev0
llvmlite              0.34.0
louis                 3.16.0
MarkupSafe            1.1.1
marshmallow           3.10.0
matplot               0.1.9
matplotlib            3.3.3
meson                 0.56.1
mistune               0.8.4
msgpack               1.0.2
murmurhash            1.0.5
nbclient              0.5.1
nbconvert             6.0.7
nbformat              5.0.8
nest-asyncio          1.4.3
networkx              2.5
nltk                  3.5
notebook              6.1.5
numba                 0.51.2
numpy                 1.19.4
ordered-set           4.0.2
packaging             20.8
pandas                1.1.5
pandocfilters         1.4.3
parso                 0.7.1
pep517                0.9.1
pexpect               4.8.0
pickleshare           0.7.5
Pillow                8.0.1
pip                   20.2.4
pkginfo               1.6.1
plac                  1.1.3
ply                   3.11
powerline-status      2.8.1
preshed               3.0.5
progress              1.5
prometheus-client     0.9.0
prompt-toolkit        3.0.8
psutil                5.8.0
ptyprocess            0.6.0
pybind11              2.6.1
pycparser             2.20
pyexifinfo            0.4.0
Pygments              2.7.3
PyGObject             3.38.0
pykerberos            1.2.1
pyloco                0.0.139
pynndescent           0.5.1
pyOpenSSL             20.0.1
pypandoc              1.5
pyparsing             2.4.7
pyrsistent            0.17.3
python-dateutil       2.8.1
python-gitlab         2.5.0
python-xlib           0.29
pytz                  2020.4
PyYAML                5.3.1
pyzmq                 20.0.0
qtconsole             5.0.1
QtPy                  1.9.0
readme-renderer       28.0
regex                 2020.11.13
requests              2.25.1
requests-kerberos     0.12.0
requests-toolbelt     0.9.1
resolvelib            0.5.4
retrying              1.3.3
rfc3986               1.4.0
scikit-learn          0.23.2
scipy                 1.5.4
seaborn               0.11.1
SecretStorage         3.3.0
Send2Trash            1.5.0
sentencepiece         0.1.95
setuptools            51.1.1
SimpleWebSocketServer 0.1.1
six                   1.15.0
sklearn               0.0
smart-open            4.0.1
spacy                 2.3.4
spacy-lookups-data    0.3.2
srsly                 1.0.5
sshuttle              1.0.5
team                  1.0
terminado             0.9.1
testpath              0.4.4
thinc                 7.4.3
threadpoolctl         2.1.0
toml                  0.10.2
toolz                 0.11.1
tornado               6.1
tqdm                  4.54.1
traitlets             5.0.5
twine                 3.2.0
typing                <IP_ADDRESS>
umap-learn            0.5.0
urllib3               1.26.1
ushlex                0.99.1
wasabi                0.8.0
wcwidth               0.2.5
webencodings          0.5.1
websocket-client      0.57.0
whatlies              0.5.10
widgetsnbextension    3.5.1
xcffib                0.11.1
xlrd                  1.2.0
xpybutil              0.0.6

And here is the error message:

---------------------------------------------------------------------------
TypingError                               Traceback (most recent call last)
<ipython-input-13-b73e1d05c847> in <module>
      6 emb = EmbeddingSet(*[lang[w] for w in words])
      7
----> 8 from whatlies.transformers import Pca
      9 pca_plot = emb.transform(Pca(2)).plot_interactive(x_label='pca_0', y_label='pca_1')

~/.local/lib/python3.9/site-packages/whatlies/transformers/__init__.py in <module>
      1 from whatlies.transformers._pca import Pca
----> 2 from whatlies.transformers._umap import Umap
      3 from whatlies.transformers._noise import Noise
      4 from whatlies.transformers._addrandom import AddRandom
      5 from whatlies.transformers._tsne import Tsne

~/.local/lib/python3.9/site-packages/whatlies/transformers/_umap.py in <module>
----> 1 from umap import UMAP
      2
      3 from ._transformer import SklearnTransformer
      4
      5

~/.local/lib/python3.9/site-packages/umap/__init__.py in <module>
      1 from warnings import warn, catch_warnings, simplefilter
----> 2 from .umap_ import UMAP
      3
      4 try:
      5     with catch_warnings():

~/.local/lib/python3.9/site-packages/umap/umap_.py in <module>
     45 )
     46
---> 47 from pynndescent import NNDescent
     48 from pynndescent.distances import named_distances as pynn_named_distances
     49 from pynndescent.sparse import sparse_named_distances as pynn_sparse_named_distances

~/.local/lib/python3.9/site-packages/pynndescent/__init__.py in <module>
      1 import pkg_resources
      2 import numba
----> 3 from .pynndescent_ import NNDescent, PyNNDescentTransformer
      4
      5 # Workaround: https://github.com/numba/numba/issues/3341

~/.local/lib/python3.9/site-packages/pynndescent/pynndescent_.py in <module>
     19 import heapq
     20
---> 21 import pynndescent.sparse as sparse
     22 import pynndescent.sparse_nndescent as sparse_nnd
     23 import pynndescent.distances as pynnd_dist

~/.local/lib/python3.9/site-packages/pynndescent/sparse.py in <module>
    328     },
    329 )
--> 330 def sparse_alternative_jaccard(ind1, data1, ind2, data2):
    331     num_non_zero = arr_union(ind1, ind2).shape[0]
    332     num_equal = arr_intersect(ind1, ind2).shape[0]

~/.local/lib/python3.9/site-packages/numba/core/decorators.py in wrapper(func)
    216             with typeinfer.register_dispatcher(disp):
    217                 for sig in sigs:
--> 218                     disp.compile(sig)
    219                 disp.disable_compile()
    220         return disp

~/.local/lib/python3.9/site-packages/numba/core/compiler_lock.py in _acquire_compile_lock(*args, **kwargs)
     30         def _acquire_compile_lock(*args, **kwargs):
     31             with self:
---> 32                 return func(*args, **kwargs)
     33         return _acquire_compile_lock
     34

~/.local/lib/python3.9/site-packages/numba/core/dispatcher.py in compile(self, sig)
    817             self._cache_misses[sig] += 1
    818             try:
--> 819                 cres = self._compiler.compile(args, return_type)
    820             except errors.ForceLiteralArg as e:
    821                 def folded(args, kws):

~/.local/lib/python3.9/site-packages/numba/core/dispatcher.py in compile(self, args, return_type)
     80             return retval
     81         else:
---> 82             raise retval
     83
     84     def _compile_cached(self, args, return_type):

~/.local/lib/python3.9/site-packages/numba/core/dispatcher.py in _compile_cached(self, args, return_type)
     90
     91         try:
---> 92             retval = self._compile_core(args, return_type)
     93         except errors.TypingError as e:
     94             self._failed_cache[key] = e

~/.local/lib/python3.9/site-packages/numba/core/dispatcher.py in _compile_core(self, args, return_type)
    103
    104         impl = self._get_implementation(args, {})
--> 105         cres = compiler.compile_extra(self.targetdescr.typing_context,
    106                                       self.targetdescr.target_context,
    107                                       impl,

~/.local/lib/python3.9/site-packages/numba/core/compiler.py in compile_extra(typingctx, targetctx, func, args, return_type, flags, locals, library, pipeline_class)
    625     pipeline = pipeline_class(typingctx, targetctx, library,
    626                               args, return_type, flags, locals)
--> 627     return pipeline.compile_extra(func)
    628
    629

~/.local/lib/python3.9/site-packages/numba/core/compiler.py in compile_extra(self, func)
    361         self.state.lifted = ()
    362         self.state.lifted_from = None
--> 363         return self._compile_bytecode()
    364
    365     def compile_ir(self, func_ir, lifted=(), lifted_from=None):

~/.local/lib/python3.9/site-packages/numba/core/compiler.py in _compile_bytecode(self)
    423         """
    424         assert self.state.func_ir is None
--> 425         return self._compile_core()
    426
    427     def _compile_ir(self):

~/.local/lib/python3.9/site-packages/numba/core/compiler.py in _compile_core(self)
    403                 self.state.status.fail_reason = e
    404                 if is_final_pipeline:
--> 405                     raise e
    406         else:
    407             raise CompilerError("All available pipelines exhausted")

~/.local/lib/python3.9/site-packages/numba/core/compiler.py in _compile_core(self)
    394             res = None
    395             try:
--> 396                 pm.run(self.state)
    397                 if self.state.cr is not None:
    398                     break

~/.local/lib/python3.9/site-packages/numba/core/compiler_machinery.py in run(self, state)
    339                     (self.pipeline_name, pass_desc)
    340                 patched_exception = self._patch_error(msg, e)
--> 341                 raise patched_exception
    342
    343     def dependency_analysis(self):

~/.local/lib/python3.9/site-packages/numba/core/compiler_machinery.py in run(self, state)
    330                 pass_inst = _pass_registry.get(pss).pass_inst
    331                 if isinstance(pass_inst, CompilerPass):
--> 332                     self._runPass(idx, pass_inst, state)
    333                 else:
    334                     raise BaseException("Legacy pass in use")

~/.local/lib/python3.9/site-packages/numba/core/compiler_lock.py in _acquire_compile_lock(*args, **kwargs)
     30         def _acquire_compile_lock(*args, **kwargs):
     31             with self:
---> 32                 return func(*args, **kwargs)
     33         return _acquire_compile_lock
     34

~/.local/lib/python3.9/site-packages/numba/core/compiler_machinery.py in _runPass(self, index, pss, internal_state)
    289             mutated |= check(pss.run_initialization, internal_state)
    290         with SimpleTimer() as pass_time:
--> 291             mutated |= check(pss.run_pass, internal_state)
    292         with SimpleTimer() as finalize_time:
    293             mutated |= check(pss.run_finalizer, internal_state)

~/.local/lib/python3.9/site-packages/numba/core/compiler_machinery.py in check(func, compiler_state)
    262
    263         def check(func, compiler_state):
--> 264             mangled = func(compiler_state)
    265             if mangled not in (True, False):
    266                 msg = ("CompilerPass implementations should return True/False. "

~/.local/lib/python3.9/site-packages/numba/core/typed_passes.py in run_pass(self, state)
     90                               % (state.func_id.func_name,)):
     91             # Type inference
---> 92             typemap, return_type, calltypes = type_inference_stage(
     93                 state.typingctx,
     94                 state.func_ir,

~/.local/lib/python3.9/site-packages/numba/core/typed_passes.py in type_inference_stage(typingctx, interp, args, return_type, locals, raise_errors)
     68
     69         infer.build_constraint()
---> 70         infer.propagate(raise_errors=raise_errors)
     71         typemap, restype, calltypes = infer.unify(raise_errors=raise_errors)
     72

~/.local/lib/python3.9/site-packages/numba/core/typeinfer.py in propagate(self, raise_errors)
   1069                                   if isinstance(e, ForceLiteralArg)]
   1070                 if not force_lit_args:
-> 1071                     raise errors[0]
   1072                 else:
   1073                     raise reduce(operator.or_, force_lit_args)

TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Failed in nopython mode pipeline (step: nopython frontend)
Failed in nopython mode pipeline (step: nopython mode backend)
Failed in nopython mode pipeline (step: nopython mode backend)
Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<function make_quicksort_impl.<locals>.run_quicksort at 0x7f2061592700>) found for signature:

 >>> run_quicksort(array(int32, 1d, C))

There are 2 candidate implementations:
      - Of which 2 did not match due to:
      Overload in function 'register_jitable.<locals>.wrap.<locals>.ov_wrap': File: numba/core/extending.py: Line 150.
        With argument(s): '(array(int32, 1d, C))':
       Rejected as the implementation raised a specific error:
         UnsupportedError: Failed in nopython mode pipeline (step: analyzing bytecode)
       Use of unsupported opcode (LOAD_ASSERTION_ERROR) found

       File "../.local/lib/python3.9/site-packages/numba/misc/quicksort.py", line 180:
           def run_quicksort(A):
               <source elided>
                   while high - low >= SMALL_QUICKSORT:
                       assert n < MAX_STACK
                       ^

  raised from /home/talamo_i/.local/lib/python3.9/site-packages/numba/core/byteflow.py:269

During: resolving callee type: Function(<function make_quicksort_impl.<locals>.run_quicksort at 0x7f2061592700>)
During: typing of call at /home/talamo_i/.local/lib/python3.9/site-packages/numba/np/arrayobj.py (5007)

File "../.local/lib/python3.9/site-packages/numba/np/arrayobj.py", line 5007:
    def array_sort_impl(arr):
        <source elided>
        # Note we clobber the return value
        sort_func(arr)

Mhm. It seems to be related to numba inside of Umap. Since it's a bug in a dependency I'm not 100% what I might be able to do to fix it. I also only test on 3.6/3.7.
Could you confirm if the problem goes away after switching python versions?

Mhm. It seems to be related to numba inside of Umap. Since it's a bug in a dependency I'm not 100% what I might be able to do to fix it. I also only test on 3.6/3.7.
Could you confirm if the problem goes away after switching python versions?

I think I've found the culprit.  It's got to do with importing. I'll make a separate issue for this. I think it's time for this library to drop support for internal transformers and just switch to using the ones from the scikit-learn API. That scales and removes the need to download all manners of dependencies.

Closing this as it should now be fixed.


taskContent with 'ng-click',doesn't work

when i use task-content attribute to add a icon ,it works fine,however add ng-click it cann't  listen the event ,code is

                <gantt-tree></gantt-tree>
                <gantt-movable></gantt-movable>
                <gantt-tooltips></gantt-tooltips>
                <gantt-draw-task enabled="true"
                                 task-factory="drawTaskFactory">
                </gantt-draw-task>
                <gantt-resize-sensor enabled="true">
                </gantt-resize-sensor>
                <gantt-progress enabled="true"></gantt-progress>

and script is
$scope.taskContent = "{{task.model.name}}";

i guess Maybe it affected by other elements in the DOM,they override it, is there any method can fix it .

angular-gantt define a default CSS property that disable pointer events on many elements.
.gantt-side-content, .gantt-body {
    pointer-events: none;
}

.gantt-side-background, .gantt-body-background, .gantt-task, .gantt-row {
    pointer-events: auto;
}

.gantt a, .gantt input {
    pointer-events: auto;
}

Try to add pointer-events: auto to elements you want to handle click properly. Or use a link, like this
$scope.taskContent = " {{task.model.name}}";

This should be documented somewhere though.
Please tell me if you have fixed this issue using a link.

@Toilal  Thanks ! I update my code according to your suggestion.it also doesn't work. I try:
$scope.taskContent ="{{task.model.name}}";

and css:
.gantt-link{
    pointer-events:auto;
}

and i make a test , there was a problem if i add ng-click="editTaskContent()" on href attribute. page will open in new tab as link.
demo:
http://plnkr.co/edit/5pO9phndWgj1dvAcs1jd?p=preview

@zhendong590
It was due to many things, but i've fixed this in master.
One of the problem is that the content provided here is linked against the Task scope, so editTaskContent is undefined in this case, because gantt scope is isolated. Use scope.editTaskContent() instead. This is a new feature, scope is a dynamically injected variable containing the parent scope from gantt directive.

@Toilal Thank you!!!. I saw you change demo code ,but ng-click doesn't work on demo !
and  i downloaded new code ,the same problem I saw.

Make sure you have cleared your browser cache.
Tested at http://rawgit.com/angular-gantt/angular-gantt/master/demo/dist/index.html with chrome and firefox, it display an alert box when clicking icon from Development row and Create Concept task.

@Toilal cause I used  old codes.  i copy them to local to fix it .Thank you very much!

I just released v1.2.1 with latest fixes.

@Toilal i saw you added rowContent code ,i use content of json data,it works fine.but,i use attributes,it doesn't work.

            <gantt-tree enabled="options.sideMode === 'Tree' || options.sideMode === 'TreeTable'"
                        header-content="options.treeHeaderContent">
            </gantt-tree>
            <gantt-table enabled="options.sideMode === 'Table' || options.sideMode === 'TreeTable'"
                         columns="options.sideMode === 'TreeTable' ? options.treeTableColumns : options.columns"
                         headers="options.columnsHeaders"
                         classes="options.columnsClasses"
                         formatters="options.columnsFormatters"
                         contents="options.columnsContents"
                         header-contents="options.columnsHeaderContents">
            </gantt-table>
            <gantt-movable enabled="!options.readOnly"></gantt-movable>
            <gantt-tooltips></gantt-tooltips>
            <gantt-draw-task enabled="true"
                             task-factory="drawTaskFactory">
            </gantt-draw-task>
            <gantt-resize-sensor enabled="true">
            </gantt-resize-sensor>
            <gantt-progress enabled="true"></gantt-progress>

my script is
$scope.options = {
rowContentEnabled:"true",
        rowContent: "{{row.model.name}}",
        taskContentEnabled:"true",
        taskContent : "{{task.model.name}}",
}

I use v1.2.2

i fix it by
<gantt-tree enabled="options.sideMode === 'Tree' || options.sideMode === 'TreeTable'"
                        header-content="options.treeHeaderContent"
                        content = "options.rowContentEnabled ? options.rowContent : undefined">
            </gantt-tree>

getting this error after updated to lasted version "angular-gantt": "^1.3.0",
any ideas?


Handle bv* and array* types, add expect keyword

expect was added to Dafny recently: https://github.com/dafny-lang/dafny/pull/550

Thanks @robin-aws, I just released the plugin version 0.17.2 which containts the change.


Types number and explicitly constrained T extends unknown shouldn't be comparable

const num = 1;
function check<T extends unknown>(x: T) {
  return x === num;
}
check(num);

Expected: Error: This condition will always return 'false' since the types 'T' and '1' have no overlap.
Actual: No error.
Contrast this with the following example from #32768.
const num = 1;
function check<T>(x: T) {
  return x === num;
}
check(num);

I would expect both the explicit and implicit extends unknown to be comparable to 1.
It's sound that if x === num, then you can narrow x to 1.
Is there a reason to not want to allow that behaviour?

If it's disallowed, does that mean the code would then have to be,
const num = 1;
function check<T extends unknown>(x: T) {
  return typeof x === "number" && x === num;
}
check(num);

to work?

I suppose the following shouldn't be allowed either:
function check<T extends string | number>(x: T) {
  return x === 1;
}

The problem is not specific to extends unknown.

This seems backwards to me; it's clear that "This condition will always return 'false'" is a lie. In the example, it will return true!
The current <T extends unknown> behaviour is the correct one. The <T> behaviour is wrong.

@davidje13 The problem with that approach is that any two unrelated type parameters become comparable, which is a bug in many cases.
I'll probably wait on the design meeting before looking more into this --- it's not quite clear what the new behaviour should be. The code-path I linked on the other issue is the one influencing the unconstrained case, which means that the implicit constraint of T in <T> is the empty object type.

Does this mean that the new constraint of <T extends unknown> should be {} to bring them into parity? That seems wrong.
Does that mean we ignore the unknown constraint in <T extends unknown> and the implicit {} constraint in <T>? This would be a breaking change in both directions (but maybe reasonable?).
Or is there a special case for <T extends unknown> where we ignore the constraint completely, but then <T extends unknown> would be different to <T>, with the former being more conservative.

There may be more options I don't know about.

For what it's worth, there was a suggestion that "any two type parameters should be strictly rejected when comparing them", but the fact that that wouldn't cover keyof T being comparable to T is part of why that's not sufficient.

any two unrelated type parameters become comparable, which is a bug in many cases

It feels like you're trying to shoehorn code quality checks into a type system. If you make it behave this way, you will be breaking the correctness of the type checking and you'll be chasing weird edge cases throughout the system (not to mention forcing the use of any upon anybody who actually needs to perform these kinds of comparison). While this change may find the specific bad style of comparing 2 different generic variables, it is actually wrong from a types perspective.
To be clear, it is obvious that function isSame<T, U>(t: T, u: U) { return t === u; } can return true or false. The comparison is legitimate, and has potential value. From the type system's perspective, this is perfectly valid code (although, apparently, not right now unless you explicitly add extends unknown).
Of course, TypeScript should catch function foo<T, U>(t: T, u: U): U { return t; }. Because although T's unknown does overlap with U's unknown, neither extends the other. Comparison will always be possible between them, but assignment is not possible in either direction without further type narrowing. Note that when using extends unknown, the type system is already able to achieve this correctly.

It feels like you're trying to shoehorn code quality checks into a type system. If you make it behave this way, you will be breaking the correctness of the type checking and you'll be chasing weird edge cases throughout the system (not to mention forcing the use of any upon anybody who actually needs to perform these kinds of comparison).

I don't know what breaking the correctness of type checking means in this context, but it would not force users to use any. All values are comparable at type unknown.
function compare(x: unknown, y: unknown) {
    return x === y;
}

function test<T,U>(t: T, u: U) {
    if (compare(t,u)) {

    }
}

While this change may find the specific bad style of comparing 2 different generic variables, it is actually wrong from a types perspective.

There are plenty of languages that do not let you compare arbitrary generic types, so I'm not sure what you mean by 'wrong'.

@jack-williams see the original issue #32768 for my actual use-case which kicked this off.
There's clearly some miscommunication here because both of us think our view is the only possible logical interpretation. So to maybe clarify my perspective:
function compare<T, U>(t: T, u: U) {
  return t === u;
}

What we know before the comparison:

typeof t ⊆ T ⊆ unknown
typeof u ⊆ U ⊆ unknown

What we additionally know if the comparison is true:

typeof t ⊆ typeof u
typeof u ⊆ typeof t
i.e. typeof t = typeof u

What we additionally know if the comparison is false:

nothing

Clearly the false case is possible, and I don't think that's disputed.
The true case has the following combined type assertions:

typeof t ⊆ T ⊆ unknown
typeof u ⊆ U ⊆ unknown
typeof t = typeof u

Which resolves to saying that ∃ S : S ⊆ (T ∩ U), where S ≠ ∅ (above, S would be typeof t or typeof u). Or more simply, (T ∩ U) ≠ ∅
At this point, we do not have enough information to formally decide this one way or the other; (T ∩ U) might be the empty set, or it might not. Therefore, this branch might be possible, or might not. The undecidability means that we cannot possibly claim it "will always return 'false'", though that in itself could be fixed by just changing the error wording.
What I mean by "breaking the correctness of the type checking" is exactly this; if we choose to assume undecidable states cannot happen, we are no-longer modelling how the program can actually operate (i.e. the real behaviour it may exhibit). The only way to continue modelling how the program can actually operate is by assuming that undecidable states can happen, until we have enough information to prove that they cannot happen (at which point they cease being undecidable).
To hammer the point home, consider the closely related code:
function compare(t: string | number, u: string | number) {
  return t === u;
}

Once again, typeof t and typeof u might have no overlap (i.e. one may be a string and the other a number), but clearly we want to allow the comparison (and currently do allow it). The only difference here is the level of indirection; in this example the uncertainty is with (typeof t ∩ typeof u) ≟ ∅, whereas before it was a level higher. Going a level deeper again, we start looking at literal types and find ourselves defining the === operator itself as (typeof t ∩ typeof u) ≠ ∅ (i.e. it is defined as a runtime test for the region of undecidability). Doing differently at higher levels of indirection introduces an asymmetry in the type system.

Useful, consistent, correct: Pick any two 😅

To be clear, it is obvious that function isSame<T, U>(t: T, u: U) { return t === u; } can return true or false. The comparison is legitimate, and has potential value.

An additional desirable symmetry is that a generic function should be type checked such that an error is issued if any concrete version of the function would have errored. In this case, we can easily construct an erroring instatiation isSame<string, number>:
function isSame(t: string, u: number) { return t === u; }

Moreover, you have many options when writing isSame to decide how you want both the caller and the implementation to be checked. If you want to take any two values and compare them freely in the body, unknown, unknown is the proper signature. Choosing to write this function with type parameters should imply some other behavior because providing different behavior is why different syntax exists.

error is issued if any concrete version of the function would have errored.

That's actually a really good argument. And now that I'm thinking about it that way, I'm having trouble coming up with an example where T extends unknown should allow arbitrary comparisons.
The original issue's intent would have been better written as,
const isNum = (v: unknown) => {
  if (typeof v !== 'number') throw new Error('Not a number');
  return v;
};
const isString = (v: unknown) => {
  if (typeof v !== 'string') throw new Error('Not a string');
  return v;
};

function makeExampleValue<T extends number|string>(validator: (v: unknown) => T): T {
  if (validator === isNum) return 42 as T;
  if (validator === isString) return 'something' as T;
  throw new Error('unknown type');
}

Playground

Is the following behaviour intentional?

function check<T extends string|number> (t : T) {
    //This is okay, even though the instantiation of `T`
    //with `string` should make it non-comparable.
    //But becaues we are comparing a generic to a non-generic,
    //we seem to use the constraint `string|number`
    //and check if it is comparable to the non-generic `number`
    return t === 1;
}
function check2<T extends string|number, U extends string|number> (t : T, u : U) {
    //Doesn't work, though.
    //Cannot compare generic type `T` and `U`
    //because `T` could be `string`
    //and `U` could be `number`
    return t === u;
}

Playground

From a purely theoretical standpoint:
function foo<T>(x: T): boolean
{
    return x === 1;  // should this be an error?
}

foo is universally quantified over T.  i.e., for all types T, there is a function foo which accepts a value of type T and returns a boolean.
However, inside the function, T is existentially quantified: the implementation can be written assuming it represents a single concrete--but unknown--type.  Therefore it's tempting to also assume the comparibility relation (the question of whether x === 1 is kosher) should satisfy the logical statement:
∃T, Comparible(T, number)

But this is not necessarily sound.  Because the function as a whole is universally quantified, x === 1 can't be assumed to be sound until you've satisfied the stronger constraint of:
∀T, Comparible(T, number)

Which seems to be what @RyanCavanaugh is getting at above (minus the nerdiness 🤓).

@RyanCavanaugh I understand your viewpoint but I disagree. isSame<string, number> is a specific use-case of isSame where, yes, the branch would be useless. But that doesn't mean there are no occurrences of isSame<string, string> elsewhere in the code where the branch is useful.
@fatcerberus that is true for assignments or casts, etc. but not for comparison. The equality operator is, after all, able to compare anything with anything else, so even 1 === 'hello' is ok. That's why this becomes a question of reachability rather than type comparability (with comparability used as a stand-in for determining reachability), hence the observed (incorrect) error message talking about "always false".

@davidje13 Just for the record:

So by your argument, the above illustrated error needs to be removed too.

@fatcerberus no that's not what I'm saying (I updated my comment to add "at runtime" just as you posted that to clarify that exact point)
My point is that type-wise, the check is fine, but in that case the error is 100% correct about the reachability. It can be proven at compile time that the check will, guaranteed, be false every time it runs. That makes the check pointless, and TypeScript is correct to produce an error.
The discussion here is about what to do when it cannot be determined at compile time whether it will always be true, or always be false

@davidje13
FWIW I hadn't really expressed my view on the matter, I was just trying to lay out the consequences of the alternatives.

What I mean by "breaking the correctness of the type checking" is exactly this; if we choose to assume undecidable states cannot happen, we are no-longer modelling how the program can actually operate (i.e. the real behaviour it may exhibit). The only way to continue modelling how the program can actually operate is by assuming that undecidable states can happen, until we have enough information to prove that they cannot happen (at which point they cease being undecidable).

If I understand your description correctly you are describing completeness of type-checking, but this is not a property that most type-checkers ever try to satisfy---so I disagree that this is breaking any correctness criteria that TypeScript should ever realistically aim to satisfy.

I guess what I most don't understand is why these functions, as written, are generic.  Maybe it's just the danger of simplified repros, but since T isn't actually used for anything other than the type of the argument, I don't see why the functions in question can't just be written:
function foo(x: unknown): boolean
{
    return x === 1;  // no error
}

function isSame(x: unknown, y: unknown): boolean
{
    return x === y;  // also no error
}

Since you only care about equality here and not exactly what the types involved are, there's no reason to take a type parameter at all.  You can use the constraint directly, whatever it happens to be.  Generics are mainly for when you need to use the type parameter to more precisely type something else (such as the return value), which doesn't seem to be happening here.
Of course it's probably just that the real case is more complex and really does need to be generic, in which case this post would just be noise.  If so I apologize--just want to cover all the bases.

@davidje13
The problem here is an issue of "caller" vs "implementer" and what you know vs what you don't know.

To the caller, <string, number> is a perfectly valid instantiation because the function implementation is treated as a black box. It doesn't know the the implementation is trying to compare the types.
If it knew, it would give you errors, too.

To the implementer, <string, number> is an invalid instantiation because if it is always instantiated with <string, number>, then the types are not comparable because there is no overlap.
It doesn't know that <string, number> will never be instantiated. It just knows that it is possible, and that if it is instantiated, there's something wrong.

That isSame would have been better as,
function isSame<T, U extends T>(t: T, u: U) {
  return t === u;
}

This way, it doesn't matter what T and U are, there will always be overlap (because U is a subtype of T)

I think this will be my last comment on this issue, because it doesn't affect me too strongly (I can always use as any to get around any errors introduced), but to give a more concrete (but still contrived) example, since I think a lot of people are getting hung-up on the simplicity of isSame:
function mapReversed<T, U>(source: T[], target: U[], map: (t: T) => U): void {
  const count = source.length;
  if (target.length !== count) {
    throw new Error('target length mismatch');
  }
  if (source === target) {
    // cannot reverse in-place, so perform extra steps
    // (uses more memory and is slower, but guarantees correctness)
    const mapped = source.map(map);
    for (let i = 0; i < count; i++) {
      target[count - i - 1] = mapped[i];
    }
  } else {
    // reversing in-place is fine; use optimised code
    for (let i = 0; i < count; i++) {
      target[count - i - 1] = map(source[i]);
    }
  }
}

Ah right, it’s an optimization in a larger generic function.  Yeah, optimizations like that are generally one case where you have to go over the type system’s head at some point—speaking from experience.

And how would you call mapReversed<string, number>(myStringArray, myStringArray, toNumber)?

Everyone's raised some good points and I really appreciate the discussion here. 👍

I think this is the same problem:
function isEmpty<T>(thing: T, key: keyof T) {
    // This condition will always return 'false' since the types 'T[keyof T]' and 'string' have no overlap.
    return thing[key] === ''
}

Unfortunately, the workaround of T extends unknown doesn't work here.


bosh cck / hm resurrector broken with multi-cpi and different stemcells (eg: vpshere and openstack)

Describe the bug
When leveraging bosh multi-cpi feature, targeting 2 different iaas (vsphere iaas, and openstack iaas)

bosh deploy is ok
bosh cck is KO if vms are ok
bosh cck is KO if one vm is KO - directors mismatches stemcell type between cpi-config

To Reproduce
Steps to reproduce the behavior :

Deploy a bosh director on vsphere iaas, with appropriate cpi-config (multiple iaas backend) and cloud-config (map az to cpis)
Upload  vsphere stemcell
2b. Upload  openstack stemcell
Deploy a manifest leveraging multiple azs, using the difference cpi and this diffrent iaas type
delete a vm in one of the iaas
Run bosh cck to try to repair

Expected behavior
As bosh deploy is ok with multi CPI on 2 target iaas types, I expect bosh cck to be usable in that context (and also bosh hm resurrector)
Logs
see https://github.com/orange-cloudfoundry/paas-templates/issues/840
Task 12905289 | 14:22:32 | Scanning 1 VMs: Checking VM states (00:00:16)
Task 12905289 | 14:22:48 | Scanning 1 VMs: 0 OK, 0 unresponsive, 1 missing, 0 unbound (00:00:00)
Task 12905289 | 14:22:49 | Applying problem resolutions: VM for 'mysql/b9af1d12-d120-4dc9-9b8c-b92062a60587 (0)' missing. (missing_vm 3451): Recreate VM and wait for processes to start (00:00:02)
                     L Error: Required stemcell {"name"=>"bosh-openstack-kvm-ubuntu-xenial-go_agent", "version"=>"621.69"} not found for cpi region-2, please upload again
Task 12905289 | 14:22:51 | Error: Error resolving problem '19166': Required stemcell {"name"=>"bosh-openstack-kvm-ubuntu-xenial-go_agent", "version"=>"621.69"} not found for cpi region-2, please upload again

Task 12905289 Started  Mon Nov  2 14:22:32 UTC 2020
Task 12905289 Finishedon Nov  2 14:22:51 UTC 2020
Task 12905289 Duration 00:00:19
Task 12905289 error

==> mismatch, as region 2 is configured as vpshere iaas type
Versions (please complete the following information):

Infrastructure: vpshere and openstack
BOSH version 271.2.0
BOSH CLI version version 6.4.0-7e5d8860-2020-08-31T17:09:13Z
Stemcell version 621.84 (vsphere and openstack)

Deployment info:
Plain bosh deployment, using bosh ops files, with multi cpi az
Deployment:
Name                  Release(s)                  Stemcell(s)                                       Config(s)            Team(s)
01-cf-mysql-extended  bosh-dns/1.17.0             bosh-openstack-kvm-ubuntu-xenial-go_agent/621.84  122 cloud/default    -
                      bosh-dns-aliases/0.0.3      bosh-vsphere-esxi-ubuntu-xenial-go_agent/621.84   121 runtime/default
                      bpm/1.1.8                   bosh-vsphere-esxi-ubuntu-xenial-go_agent/621.84
                      cf-mysql/37.1.0
                      generic-scripting/3
                      minio/2020-06-18T02-23-35Z
                      node-exporter/5.0.0
                      os-conf/22.0.0
                      prometheus/26.2.0
                      routing/0.206.0
                      shield/8.7.2
                      syslog/11.6.0

Here is the cpi-config.yml :
cpis:
- name: region-1
  properties:
    datacenters:
		xxxx
  type: vsphere
- name: region-2
  properties:
	datacenters:
		xxxx
  type: vsphere
- name: region-3
  properties:
	xxxx
  type: openstack

Here is the cloud-config.yml:
azs:
- cpi: region-1
  name: z1
- cpi: region-1
  name: z2
- cpi: region-1
  name: z3
- cpi: region-2
  name: r2-z1
- cloud_properties:
    availability_zone: eu-west-0b
  cpi: region-3
  name: r3-z1

Additional context
Add any other context about the problem here.

@any insight / update on this issue ?

@any insight / update on this issue ?

Summary of the reverse-engineering performed with @o-orand:
With a manifest file structure as below, and the cpi-config.yml cloud-config.yml described in https://github.com/cloudfoundry/bosh/issues/2287#issue-738984393

addons:
- include:
    stemcell:
    - os: ubuntu-trusty
    - os: ubuntu-xenial
    - os: ubuntu-bionic

instance_groups.jobs
  name: mysql
  networks:
  - name: tf-net-osb-data-plane-dedicated-priv
  persistent_disk_type: large
  stemcell: default
  instances: 1
  azs:
  - z1
  - z2
  - z3

releases:
- exported_from:
  - os: ubuntu-bionic
    version: "1.1"
  name: cf-mysql
  stemcell:
    os: ubuntu-bionic
    version: "1.1"

stemcells:
- alias: default
  os: ubuntu-bionic
  version: "1.1"

When the cloud-check command fails, the following stack trace is displayed in bosh debug task
E, [2021-06-02T06:41:15.523131 #2760] [task:24935638] ERROR -- DirectorJobRunner: Error resolving problem '62674':
Required stemcell {"name"=>"bosh-openstack-kvm-ubuntu-xenial-go_agent", "version"=>"621.107"}
 not found for cpi region-1, please upload again
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/cloud_check/apply_resolutions.rb:39:in `block in perform'
[...]/bosh-director-0.0.0/lib/bosh/director/lock_helper.rb:7:in `block in with_deployment_lock'
[...]/bosh-director-0.0.0/lib/bosh/director/lock.rb:79:in `lock'
[.../bosh-director-0.0.0/lib/bosh/director/lock_helper.rb:7:in `with_deployment_lock'
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/cloud_check/apply_resolutions.rb:35:in `perform'
[...]/bosh-director-0.0.0/lib/bosh/director/job_runner.rb:99:in `perform_job'
[.../bosh-director-0.0.0/lib/bosh/director/job_runner.rb:34:in `block in run'
[...]/bosh_common-0.0.0/lib/common/thread_formatter.rb:50:in `with_thread_name'
[...]/bosh-director-0.0.0/lib/bosh/director/job_runner.rb:34:in `run'
[.../bosh-director-0.0.0/lib/bosh/director/jobs/base_job.rb:9:in `perform'
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/db_job.rb:32:in `block in perform'
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/db_job.rb:98:in `block (3 levels) in run'
[.../eventmachine-1.2.7/lib/eventmachine.rb:1077:in `block in spawn_threadpool'
[...]/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'

We're observing that the instances.spec_json database field documented within the director_schema has the incorrect stemcell value bosh-openstack-kvm-ubuntu-bionic-go_agent (instead of bosh-vsphere-esxi-ubuntu-bionic-go_agent)
We suspect that this instances.spec_json database field is assigned during a bosh deploy within the incorrect value assigned within https://github.com/cloudfoundry/bosh/blob/83813f6323c07d49a3af62fcff8e6a94209fadfc/src/bosh-director/lib/bosh/director/deployment_plan/stemcell.rb#L60 at the following stack trace, and assigned within the Bosh::Director::DeploymentPlan::InstancePlan in its nested Bosh::Director::DeploymentPlan::Instance.stemcell field
[...]/bosh-director-0.0.0/lib/bosh/director/deployment_plan/stemcell.rb:46:in `bind_model'",
[...]/bosh-director-0.0.0/lib/bosh/director/deployment_plan/assembler.rb:205:in `block in bind_stemcells'",
[...]/bosh-director-0.0.0/lib/bosh/director/deployment_plan/assembler.rb:204:in `each'",
[...]/bosh-director-0.0.0/lib/bosh/director/deployment_plan/assembler.rb:204:in `bind_stemcells'",
[...]/bosh-director-0.0.0/lib/bosh/director/deployment_plan/assembler.rb:34:in `bind_models'",
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/update_deployment.rb:94:in `block in prepare_deployment'",
[...]/bosh-director-0.0.0/lib/bosh/director/event_log.rb:105:in `advance_and_track'",
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/update_deployment.rb:87:in `prepare_deployment'",
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/update_deployment.rb:42:in `block in perform'",
[...]/bosh-director-0.0.0/lib/bosh/director/lock_helper.rb:7:in `block in with_deployment_lock'",
[...]/bosh-director-0.0.0/lib/bosh/director/lock.rb:79:in `lock'",
[...]/bosh-director-0.0.0/lib/bosh/director/lock_helper.rb:7:in `with_deployment_lock'",
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/update_deployment.rb:34:in `perform'",
[...]/bosh-director-0.0.0/lib/bosh/director/job_runner.rb:99:in `perform_job'",
[...]/bosh-director-0.0.0/lib/bosh/director/job_runner.rb:34:in `block in run'",
[...]/bosh_common-0.0.0/lib/common/thread_formatter.rb:50:in `with_thread_name'",
[...]/bosh-director-0.0.0/lib/bosh/director/job_runner.rb:34:in `run'",
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/base_job.rb:9:in `perform'",
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/db_job.rb:32:in `block in perform'",
[...]/bosh-director-0.0.0/lib/bosh/director/jobs/db_job.rb:98:in `block (3 levels) in run'",
[...]/eventmachine-1.2.7/lib/eventmachine.rb:1077:in `block in spawn_threadpool'",
[...]/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'"]

We're suspecting that unlike  a bosh deploy, the bosh cloud-check and bosh recreate don't yet select the instance stemcell from the instance az, but directly use the stemcell from the deployment plan.
This reverse engineering is based on source code analysis as well as adding debugging traces in the local source to dump models and stack traces.
We will now see if the bosh team could help us finding software architecture documentation, or potentially hint into the direction to contribute a fix.

This is a problem that I'd like to fix, but it's not easy.
I'll try to work on it 1/day per week.

thanks a lot @cunnie for your work. We're eager to help testing any fix you might be able to develop in our 3 az lab (2 vsphere and 1 openstack).
As a stop-gap workaround, we're currently patching our director instances https://github.com/cloudfoundry/bosh/blob/83813f6323c07d49a3af62fcff8e6a94209fadfc/src/bosh-director/lib/bosh/director/deployment_plan/stemcell.rb#L60 with  model = @models.last. In  our 3 az environments (2 vsphere and 1 openstack), this should select the vsphere stemcell which is present on more AZs than the openstack one, making it possible after a bosh deploy --recreate to use bosh cloud-check on vsphere instances part of a multi-cpi deployment.

Hello @cunnie , did you have an opportunity to investigate this issue ?
Thanks !

@o-orand I'll try to look at it tomorrow.

I think I may have a fix. Am testing it now.


Investigate peering issues

PR description
In discovery we seemed to see a lot of "misconfigured" nodes that share the same IP address and TCP port, but use different discovery ports. This PR checks for these nodes and removes them from the peer table.

very cool find @pinges - are there more tests you wanted to add?

11 holesky nodes - 10 of them get to 100% peers within 2h

the 11th one eventually gets to 100% peers (although it does take ~7h)

Current behaviour on holesky is > 90% of nodes get stuck at 0 peers indefinitely (require setting static peers to sync)
See #6805


Remove the "view details' button for claim proceeds to a market when its in the 3 day wait period- replace w (i)

Remove the "view details' button for claim proceeds to a market when its in the 3 day wait period  and the countdown clock is present....
I found it confusing to click view details and all it does is bring me to the trading pg
We should instead add an (i) and explain what is happening as to why the countdown clock is there and they cant actually claim their proceeds at that moment

doesn't apply - no wait period in v2
@pgebheim


Can't create project in k8s locally

When I try to create a new project in k8s locally, it doesn't seem to work and the result is always a 404 on the project page I'm redirected to:
fail: LexBoxApi.GraphQL.ErrorLoggingDiagnosticsEventListener[0]
      ResolverError: Unexpected Execution Error
      System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found).
         at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
         at LexBoxApi.Services.HgService.GetChangesets(String projectCode) in D:\code\languageforge-lexbox\backend\LexB
oxApi\Services\HgService.cs:line 67
         at LexCore.Entities.Project.GetChangesets(IHgService hgService) in D:\code\languageforge-lexbox\backend\LexCor
e\Entities\Project.cs:line 17
         at HotChocolate.Resolvers.Expressions.ExpressionHelper.AwaitTaskHelper[T](Task`1 task)
         at HotChocolate.Types.Helpers.FieldMiddlewareCompiler.<>c__DisplayClass9_0.<<CreateResolverMiddleware>b__0>d.M
oveNext()
      --- End of stack trace from previous location ---
         at DataAnnotatedModelValidations.ValidatorMiddleware.InvokeAsync(IMiddlewareContext context)
         at HotChocolate.Utilities.MiddlewareCompiler`1.ExpressionHelper.AwaitTaskHelper(Task task)
         at HotChocolate.Execution.Processing.Tasks.ResolverTask.ExecuteResolverPipelineAsync(CancellationToken cancell
ationToken)
         at HotChocolate.Execution.Processing.Tasks.ResolverTask.TryExecuteAsync(CancellationToken cancellationToken)

I realize now, I was actually running the api locally and everything else in k8s. If I run the api in k8s as well it works fine.
So, I assume what's happening here is that the actual repo is only on the local filesystem and so hg in k8s can't find it.
@hahn-kev @rmunn Is this something you've already thought through?

Yeah you're right. It'll work correctly if it's in k8s, but changes to the local file system won't make it into the volume. I tried to get skaffold to sync the files into the right place but I couldn't get it to work for some reason.


Feature Request: Template Folder Restructure

Describe the solution you'd like
IMO, contracts should not live within the Nextjs project.
The foundry project has a completely different build environment, deployment process, and potentially different team working on it.
A folder structure like this seems to make more sense:
.
├── README.md
├── .gitmodules
├── contracts
│   ├── foundry.toml
│   ├── lib
│   ├── src
│   ├── test
│   └── ...
└── web
    ├── package.json
    ├── public
    ├── src
    ├── tsconfig.json
    ├── yarn.lock
    └── ...

For example, like this project: https://github.com/papercliplabs/frames
Describe alternatives you've considered.
No response

YES!!!! 100% right
@Sneh1999 can you take this one?

Closing this request as this feature has been implemented!


VirtualMachineImage do not have an api to list images based on publisher, offer, sku instead it lists all images in given region.

rx.Observable<VirtualMachineImage> imageObservable = azure.virtualMachineImages().listByRegionAsync(Region.US_WEST);
And below is my filter predicate:
Func1<VirtualMachineImage, Boolean> imagePredicate = new Func1<VirtualMachineImage, Boolean>() {
    @Override
     public Boolean call(VirtualMachineImage image) {
     if(image.publisherName().equals("OpenLogic") &&
                        image.offer().equals("CentOs") &&
                        image.sku().equals("7.3")){
          return true;
         }
     return false;
    }
};

imageObservable
	       .filter(imagePredicate)
	       .toBlocking()
	       .subscribe(addImagesInList);

I kept on listening to observable and after 5 minutes or more, I made total of 15000 requests without getting desired result and I was prohibited to make any further request for short duration of time.
Error: Caused by: com.microsoft.azure.CloudException: Number of read requests for subscription 'cbaba14b-e672-47d7-bb59-4a0613d6d149' exceeded the limit of '15000' for time interval '01:00:00'. Please try again after '300' seconds.: Number of read requests for subscription 'cbaba14b-e672-47d7-bb59-4a0613d6d149' exceeded the limit of '15000' for time interval '01:00:00'. Please try again after '300' seconds.
at com.microsoft.azure.AzureClient.createExceptionFromResponse(AzureClient.java:601)
at com.microsoft.azure.AzureClient.access$000(AzureClient.java:31)
at com.microsoft.azure.AzureClient$10.call(AzureClient.java:577)
at com.microsoft.azure.AzureClient$10.call(AzureClient.java:574)
Issue:
There should be an api to filter images based on publsiher, offer and sku. If I do the same using Azure Cli then I am able to filter images based on above parameters.

Though your logic is correct, the filter is applied on all the elements in the upstream and that requires SDK to enumerate all images, which cause ToomanyRequest error from azure.
We can solve this by limiting number of request to azure by using different Rx operators. See below code sample (CLI uses something similar underneath).
Sample code uses first operator which unsubscribe from the upstream as soon as it finds the first event matching the given predicate, due to un-subscription further api calls won't be made by the SDK.
Observable<VirtualMachineImage> imagesInSku = azure.virtualMachineImages().publishers()
        .listByRegionAsync(Region.US_EAST)
        .first(new Func1<VirtualMachinePublisher, Boolean>() {
            @Override
            public Boolean call(VirtualMachinePublisher publisher) {
                return publisher.name().equalsIgnoreCase("OpenLogic1");
            }
        })
        .flatMap(new Func1<VirtualMachinePublisher, Observable<VirtualMachineOffer>>() {
            @Override
            public Observable<VirtualMachineOffer> call(VirtualMachinePublisher virtualMachinePublisher) {
                return virtualMachinePublisher.offers().listAsync();
            }
        })
        .first(new Func1<VirtualMachineOffer, Boolean>() {
            @Override
            public Boolean call(VirtualMachineOffer offer) {
                return offer.name().equalsIgnoreCase("CentOs");
            }
        })
        .flatMap(new Func1<VirtualMachineOffer, Observable<VirtualMachineSku>>() {
            @Override
            public Observable<VirtualMachineSku> call(VirtualMachineOffer offer) {
                return offer.skus().listAsync();
            }
        })
        .first(new Func1<VirtualMachineSku, Boolean>() {
            @Override
            public Boolean call(VirtualMachineSku sku) {
                return sku.name().equalsIgnoreCase("7.3");
            }
        })
        .flatMap(new Func1<VirtualMachineSku, Observable<VirtualMachineImage>>() {
            @Override
            public Observable<VirtualMachineImage> call(VirtualMachineSku sku) {
                return sku.images().listAsync();
            }
        });

imagesInSku.subscribe(new Action1<VirtualMachineImage>() {
            @Override
            public void call(VirtualMachineImage virtualMachineImage) {
                System.out.println(virtualMachineImage.id());
            }
        });

Note that above code is to get all images under a sku (which matches the title of this issue). If you are looking for the latest image in a sku (thus only one image) then getImage api call be used with version param as latest.
azure.virtualMachineImages()
    .getImage(Region.US_EAST, "OpenLogic", "CentOs", "7.3", "latest");

@anuchandy, getting image using getImage api do not work for 'latest' version.
I am getting below error-
com.microsoft.azure.CloudException: Status code 400, {
"error": {
"code": "InvalidParameter",
"target": "version",
"message": "The value of parameter version is invalid."
}
}: The value of parameter version is invalid.

@anuchandy, publishers api is not consuming too many request, but it still takes 5-6 sec to get latest image object. That will be a bottleneck for performance for my use case.

@anuchandy , I was on stable release 1.1.0. I moved to new release 1.2.0 and I am able to get image using 'latest' as version.
Thanks Man (y)

"latest' is introduced starting from 1.2. Regarding.the api latency, there is nothing we can do in the client side, getimage is a single api call, we can pass feedback to service team. Seems your original issue is resolved, hence closing this, feel free to reopen if you have questions.


added error handling

added error handling in api.py

Yup you can put my name in README

Nice! Thanks so much for the contribution again. It has been merged, and the next release will include your contribution as credit.
I am a bit new to contributing, so this has been a good learning experience.
Happy coding!


DimPlot.metabolism function

It seems DimPlot.metabolism doesn't support split.by function that is implemented in the original package?

I am experiencing the same issue. Thanks for clarifying?


README: better visibility of discord icon in badge

The original blue color blends in too much with the dark background on the small icon.

old:
new:

Messages

:book:
:sparkles: Thanks for your contribution to Shields, @tooomm!

:book:

Thanks for contributing to our documentation. We :heart: our documentarians!

  Generated by :no_entry_sign: dangerJS against 0381c7ce68f13b69b20c49a9ae0cd74f1ce7ec20

I don't feel strongly about whether we do this, though if we do it probably should be by tweaking the code used to auto-color the badges that were added in #2833.
You can see the results of the auto-coloring here: https://shields-staging.herokuapp.com/dev/logos
Though it rate limits; so it's easier to run that page locally.

Hey @tooomm could you please open an issue to discuss? If these colors are changed, it will need a different approach than what's in this PR.

Done, see #3301


Skip Enforcer plugin, because ...

Add skipping the enforcer plugin

Thanks for contribution but after thinking for a while I've decided to not merge it. I understand how it contributes to the joke, but in the end I think there is some value in yolo not being used purely as a joke. With all the checks disabled it somewhat works as "fast" profile for building projects and I think I like that.


Cannot build Realm by using Carthage on XCode 7.3 final

Hello,
I'm trying to build Realm Lib from carthage but this problem happen.
Please spend your time to investigate it.
Error:(7, 8) module file was created by an older version of the compiler; rebuild 'RealmSwift' and try again: /Users/myname/Workspace/project/Carthage/Build/iOS/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule
Xcode 7.3
Carthage latest version
Thanks,

As a temporary workaround, you can build the framweworks manually:
$ git clone https://github.com/realm/realm-cocoa.git
$ cd realm-cocoa/
$ git checkout v0.98.5
$ REALM_SWIFT_VERSION=2.2 sh build.sh build
and replace the ones installed by Carthage:
$ cp build/ios/swift-2.2/Realm.framework /Carthage/Build/iOS
$ cp build/ios/swift-2.2/RealmSwift.framework /Carthage/Build/iOS

This solution work to compile and run on an 9.3 device, but does not upload to iTunes connect. Is there a timeline to get it working with Carthage again?

@jpsim's comment in #3355 goes into why you're seeing this error, and what you can do to work around it. It boils down to having Carthage build Realm from source rather than using pre-built binaries, as pre-built binaries of Swift frameworks require that you're using the same version of Xcode that a Realm release was built with.

thanks @antfarm , it worked.

We have just released Realm Swift v0.98.6, built with Xcode 7.3, to address this issue.


Error with @dqbd/tiktoken when using RecursiveCharacterTextSplitter in langchain on AWS Lambda with Node.js 18.x runtime

Hi all,
I'm using langchain on an AWS Lambda with Node.js runtime version NODEJS_18_X. I'm trying to create a summary of an array of documents, and I'm using RecursiveCharacterTextSplitter to split the documents. However, I'm getting an error with @dqbd/tiktoken.
Here's the relevant code snippet:
  const textSplitter = new RecursiveCharacterTextSplitter({ chunkSize: 1000 });
  const newDocs = await textSplitter.splitDocuments(docs);
  const model = new OpenAI({
    temperature: 0,
  });
  const chain = loadSummarizationChain(model);

I've installed @dqbd/tiktoken to try to resolve the issue, but it hasn't worked. Here are the versions of the packages and Node.js that I'm using:
langchain: ^0.0.49
@dqbd/tiktoken: ^1.0.3
Node.js version: v18.X.X
Here's the error message that I'm seeing:
ERROR Invoke Error {
  "errorType": "Error",
  "errorMessage": "Please install @dqbd/tiktoken as a dependency with, e.g. `yarn add @dqbd/tiktoken`",
  "stack": [
    "Error: Please install @dqbd/tiktoken as a dependency with, e.g. `yarn add @dqbd/tiktoken`",
    "at importTiktoken (/var/task/index.js:747353:15)",
    "at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
    "at async OpenAIChat.getNumTokens (/var/task/index.js:762679:42)",
    "at async Promise.all (index 0)",
    "at async MapReduceDocumentsChain._call (/var/task/index.js:762999:26)",
    "at async MapReduceDocumentsChain.call (/var/task/index.js:746005:26)",
    "at async createSummaryDocOfShop (/var/task/index.js:873705:15)",
    "at async createIndexForShop (/var/task/index.js:873685:19)",
    "at async Runtime.handler (/var/task/index.js:877740:9)"
  ]
}

Additional Information:
I've tried uninstalling and reinstalling the @dqbd/tiktoken package, but it hasn't resolved the issue. I've also checked the documentation for langchain and @dqbd/tiktoken, but I haven't been able to find any solutions.

Unfortunately, I don't have the environment to test LangChainJS anymore. Since I wasn't able to solve this issue, I migrated my code to Python.


Azure CLI - Iot Hub list command fails

This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az iot hub list
Errors:
No module named 'azure.mgmt.iothub.iot_hub_client'
Traceback (most recent call last):
python3/dist-packages/knack/cli.py, ln 206, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 608, in execute
    raise ex
cli/core/commands/__init__.py, ln 666, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 659, in _run_job
    six.reraise(*sys.exc_info())
...
cli/core/commands/__init__.py, ln 306, in __call__
    return self.handler(*args, **kwargs)
azure/cli/core/__init__.py, ln 484, in default_command_handler
    client = client_factory(cmd.cli_ctx, command_args) if client_factory else None
cli/command_modules/iot/_client_factory.py, ln 9, in iot_hub_service_factory
    from azure.mgmt.iothub.iot_hub_client import IotHubClient
ModuleNotFoundError: No module named 'azure.mgmt.iothub.iot_hub_client'

To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Put any pre-requisite steps here...
az iot hub list

Expected Behavior
Environment Summary
Linux-5.8.0-43-generic-x86_64-with-glibc2.29
Python 3.8.5
Shell: fish

azure-cli 2.0.81

Extensions:
azure-iot 0.9.7
azure-devops 0.17.0

Additional Context

iot


Fix old layout

Repairs the layout so that we don't completely lose the controls on small devices.

Whoops, should have been vs. my fork. Closing.


feat: add disabled dates list or callback prop

Feature: Disable Custom Dates
In support of adding a feature that allows disabling custom dates I've added a prop disabledDates that accepts an array of dates (DateType[]) or a validation function ((date: dayjs.Dayjs) => boolean)
This change is very similar to JHPG PR but with the added compatibility for the disabled dates list inspired by the handling found in Stephy CalendarPicker project and adapted to use existing functionality like the areDatesOnSameDay method
An example of both was added to the example app App.tsx.
Demo (included in the example app comments) - disable weekends

Hi JHPG I’ve liked your approach and have extended the functionality by adding compatibility for disabling dates based on a disabled dates list. Here’s my PR.

I noticed a small bug in your code where if you had minDate or maxDate they wouldn't work and they would be overlapped by disabledDates here is a fix for that:
  if (minDate) {
    disabled = disabled || date < getDate(minDate);
  }
  if (maxDate) {
    disabled = disabled || date > getDate(maxDate);
  }
  if (disabledDates) {
    if (Array.isArray(disabledDates)) {
      const dates = disabledDates.filter((disabledDate) =>
        areDatesOnSameDay(date, disabledDate)
      );
      disabled = disabled || dates.length > 0;
    } else if (disabledDates instanceof Function) {
      disabled = disabled || disabledDates(date);
    }
  }

@timdimas Good catch, I'll update the PR with this fix. Since it's getting a little messy I'll refactor it into a new isDateDisabled helper method, similar to the other ones.

@mitri-dvp Great stuff, also i have been thinking, if you have the mode="range" and you put a range before and after the disabled dates, the disabled dates will be selected even thought they are disabled. Even thought it's a simple fix on the onChange function where you check for your disabled dates and if they overlap return null, i feel like this logic should be applied automatically, when you have disabled dates. I will look into in more and try to help you


Reduce overall Exception rate for gallery

See AppInsights

Catch ArgumentException on 404 page
Password reset before confirming user account no longer returns error 500
NullReferenceException in packagedownloadsbyversion.cshtml
WebException when refreshing download count data
ArgumentException in DependencySetsViewModel.cs when key already present in dictionary

Deployed.


A lot of erros

java.lang.NullPointerException: Attempt to invoke virtual method 'void info.kimjihyok.ripplelibrary.renderer.Renderer.render(android.graphics.Canvas, int, int, int, int, int)' on a null object reference
Even the empty java and only xml.It's too crazy please check it on andoridX and send a update or something because it looks brilliant but doesn't work at all.

i have the same problem

Same for me


Pools page no banner

Proposed Changes
No banner impl for @defi-er
Implementation
DONT MERGE

It has been left unattended for a long time, so it will be closed once.
Please reopen if necessary.


Add Equinix /metadata explanation to FAQ

Some old documentation talks about the Equinix /metadata endpoint. We should add information to the FAQ that notes its deprecated featuring in the 0.9 version and earlier only.

On hold as the endpoint is required by some hub actions. To remove the endpoint we'll need to coordinate with the work to expose hardware data to Tinkerbell templates and removing the dependency in whatever actions need it.


{   "code": 500,   "message": "An error has occurred: fetch failed",   "requestId": "ca5520d8-5cc6-40e3-9f27-ce1ae6227025" }

Hello everyone! 😊
I hope you're all doing well. I've recently encountered a puzzling issue with the authentication part of our application. Up until today, it was working smoothly, but suddenly, I'm facing some errors. Has anyone else experienced something similar or knows what might be causing this? Any insights or advice would be greatly appreciated!
Thank you in advance for your help! 🙏🌟

and

hi @Quintas0658, can you please reach out to us through support at https://supabase.help ? we'll need to access your project logs in order to investigate this further


Support for inheriting public api annotations (#1773)

What does this PR do?
Fixes #1773
Checklist

[x] This is an enhancement of existing features, or a new feature in existing plugins

[x] I have updated CHANGELOG.asciidoc
[x] I have added tests that prove my fix is effective or that my feature works
[x] Added an API method or config option? Document in which version this will be introduced
[x] I have made corresponding changes to the documentation

[ ] This is a bugfix

[ ] I have updated CHANGELOG.asciidoc
[ ] I have added tests that would fail without this fix

[ ] This is a new plugin

[ ] I have updated CHANGELOG.asciidoc
[ ] My code follows the style guidelines of this project
[ ] I have made corresponding changes to the documentation
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] I have updated supported-technologies.asciidoc
[ ] Added an API method or config option? Document in which version this will be introduced
[ ] Added an instrumentation plugin? Describe how you made sure that old, non-supported versions are not instrumented by accident.

[ ] This is something else

[ ] I have updated CHANGELOG.asciidoc

@eyalkoren Thank you for updating configuration.asciidoc!

Thank You!