Reposition a center-attached element to left- or right-attached

Opening this PR to discuss the feasibility and desirability of repositioning center-attached elements if they move outside of their constrainer. This originated in a Drop discussion but the fix here is in Tether.
Example:

If this is a desirable feature, I'd be happy to update the change in order to make it mergeable :+1:

:+1:

:beers:

I like this solution as well.
As Tether is no longer CoffeeScript based, the patch just needs some refreshments imho.

@markalfred Do you mind if I close this PR in favor of https://github.com/HubSpot/tether/compare/horizontal-overflow-fix. This is a great feature we would love to incorporate into Tether and the branch has your changes applied to the new project structure.

:+1: Sorry for falling off the face of the earth. I ran into some problems trying to implement the same functionality on a middle (y) position element and never revisited. The above fix looks great, thanks for this!

whats up with this? is it in or not? I didn't understand @geekjuice 's comment

I've been busier than expected these past few months and haven't had the bandwidth to fully test these changes and merge them into master. As of now, the changes are still only on the branch (which can be pulled down if you need them right away).
My comment was that the changes on this branch were applied before a large project restructuring (when the project still used coffeescript), so there would have been major merge conflicts. The branch I mentioned above ported these changes into the new project format (using ES6).
If you'd like to help get this into master sooner, I'd be more than grateful if you'd like to pull down the branch above and help make sure nothing is broken by the changes.

I've updated to the latest version 1.2.0 and used these settings:
attachment: 'top center'
targetAttachment: 'middle center'
constraints: [
    to: 'window'
    attachment: 'together element'
]

And I have this bug, when re-sizing the window (FF 44.0.2 & Chrome 48.0.2564.116 on Win7), the tether element "jumps" (it should be attached to the "star" icon:

@yairEO do you mind setting up a simple jsbin/fiddle/codepen reproducing the issue and providing the link? Then I'll be happy to take a look.

I'll set it up

An unsubscribe link is needed in these emails. It's a faff on to
unsubscribe on a smartphone.
It's standard practice to do so.
Thanks
On 23 Feb 2016 17:33, "vsync"<EMAIL_ADDRESS>wrote:

I'll set it up
—
Reply to this email directly or view it on GitHub
https://github.com/HubSpot/tether/pull/81#issuecomment-187806581.

@xandrani There's an unsubscribe link on the right sidebar on the site if you open in a browser. Also that comment doesn't contribute to this thread in any way and should be addressed to GitHub support where it can actually be handled.

Twat
On 23 Feb 2016 17:38, "Nicholas Hwang"<EMAIL_ADDRESS>wrote:

@xandrani https://github.com/xandrani There's an unsubscribe link on
the right sidebar on the site if you open in a browser. Also that comment
doesn't contribute to this thread in any way and should be addressed to
GitHub support where it can actually be handled.
—
Reply to this email directly or view it on GitHub
https://github.com/HubSpot/tether/pull/81#issuecomment-187808699.

I'd have to sign in first. Which is a pain.
There's no righthand sidebar
Your abrasive attitude is a bad stereotype of programmers of yesteryear.
On 23 Feb 2016 17:39, "Mike"<EMAIL_ADDRESS>wrote:

Twat
On 23 Feb 2016 17:38, "Nicholas Hwang"<EMAIL_ADDRESS>wrote:

@xandrani https://github.com/xandrani There's an unsubscribe link on
the right sidebar on the site if you open in a browser. Also that comment
doesn't contribute to this thread in any way and should be addressed to
GitHub support where it can actually be handled.
—
Reply to this email directly or view it on GitHub
https://github.com/HubSpot/tether/pull/81#issuecomment-187808699.

@xandrani I'm sorry you feel that my attitude was abrasive when I was just trying to provide some actionable solutions rather than commenting on a thread that really can't do anything about adding an unsubscribe button to your email.

I'd have to sign in first. Which is a pain.
That's fair, but a lot of mobile email clients do have ignore and unsubscribes baked in so many you should look into one of those clients.

There's no righthand sidebar
I'll admit I was a bit hasty to mention the righthand sidebar, but I do recall an unsubscribe in the mobile browser. However, there is a righthand sidebar in the browser so technically I'm not wrong to mention it.

Your abrasive attitude is a bad stereotype of programmers of yesteryear.
See first comment. To be fair, I haven't been in the industry too long so maybe you could set an example of how I should act.

Twat
See above comment.

There is an unsubscibe button on the bottom of the web version of this page.
Lets all delete our comments and clean this thread so future developers who might come here won't curse us.

@yairEO I agree.

I've produces a simple example page:
Try resizing the output area
seems like tether goes crazy when the target element has float:right. (other properties might also cause this)

I unsubscribed but I'm still getting these emails. GitHub needs to be
renamed ShitHub obviously.
On 27 Feb 2016 18:57, "vsync"<EMAIL_ADDRESS>wrote:

I've produces a simple example page
http://jsbin.com/vitarij/edit?html,css,output:
Try resizing the output area
seems like tether goes crazy when the target element has float:right.
(other properties might also cause this)
—
Reply to this email directly or view it on GitHub
https://github.com/HubSpot/tether/pull/81#issuecomment-189702747.


Liaison: A love story between the frontend and the backend

After spending some time analyzing a few of the most popular RealWorld example apps implemented in JavaScript, I came to a not-so-bright conclusion. Although carefully crafted, I think they all suffer from some serious issues: code scattering, duplication of knowledge, and too much boilerplate.
Code scattering
Ideally, implementing a new feature would require to modify two files: one file in the frontend, and another file in the backend.
Frontend and backend are natural layers that cannot be avoided. We build a backend mainly because we don't want to expose all data and features to everyone accessing the frontend. So, through an authentication mechanism, we restrict access to some parts of the application. And that can only be achieved on the backend side.
How about all other layers such as the UI, the API client, the API server, and the database? Well, for most applications (including the RealWorld example apps), those extra layers are not actual requirements. We build them because we don't have much choice, and we fall into the trap of accidental complexity. So, the code needed to implement a feature ends up being scattered into many layers, and our well-architected application becomes a hell to maintain.
Sometimes there are valid reasons to split the code into different layers. For example, we plan to build multiple UIs for the same shared domain model, or we want to expose a public REST (or GraphQL) API in addition to the application's internal API. But these extra layers should be built on deliberate choices, and not because we use a technology that forces us to do so.
Duplication of knowledge
Since the code is scattered into many layers, it is challenging to not duplicate knowledge.
Frontend and backend models get duplicated. We duplicate schemas and validation logic. And to make our frontend smoother, we implement optimistic updates that duplicate some business logic.
On the backend side, if we are lucky enough, we use an ORM abstracting the database so we don't have so much duplication.
However, at some point, we must expose the backend to the frontend, so we build a web API, and this is where the duplication occurs.
 They don't provide any features to the application. They are just a necessary evil so the frontend can communicate with the backend.
Using a state manager like Redux sounds appealing at first. Pure functions or immutability satisfy the scientific mind of the engineer, but they generate a lot of boilerplate code.
Binding the domain model to the UI is another source of boilerplate. Some libraries (e.g., MobX) are doing a good job at reducing it as much as possible, but still, since the UI components are living in a completely different world from the domain model, the binding code is quite cumbersome.
So what?
The result is that we waste time, the developer experience is not great, and the risk of producing poor quality software increases.
Don't get me wrong. I am not throwing rocks at the authors of the RealWorld example apps, let alone the authors of the libraries and frameworks.
Considering the paradigms that drive software development today, everyone is doing their very best to build the most appropriate solutions.
So what's wrong? Well, perhaps it is time to reconsider the prevailing paradigms.
Introducing Liaison
I experimented with new approaches for trying to solve the problems mentioned above. The result is a set of libraries gathered into something called Liaison.
Cross-layer class inheritance
First of all, Liaison strives to reconcile the frontend with the backend. Typically, they are living in two very separate worlds, making communication between them difficult. Even if they are implemented with the same language, they cannot communicate directly. They need a web API in between, and that ruins all the developer experience.
So here's the first crazy idea. What if the frontend could somehow inherit some classes from the backend, and the subclasses in the frontend could call the backend directly?
This is precisely what Liaison offers – a mechanism enabling class inheritance across layers.
The backend can expose some classes so they can be used in the context of the frontend as regular JavaScript classes. They can be extended, their methods can be overridden, etc. And when a method is called, it doesn't matter if the execution happens in the frontend or the backend. For the developer, frontend and backend become one unified world.
For example, let's say the frontend is running the following code:
await user.follow(anotherUser);

Depending on the implementation of follow(), the execution can happen in the frontend, the backend, or both. When a method is missing in the frontend, and there is a corresponding method exposed by the backend, this method is automatically executed.
The attributes of the involved instances (user and anotherUser) are transported to the backend, the method is executed, and if some attributes have changed during the execution, the changes are reflected in the frontend.
So there is no need to build a web API anymore. For sure, you can still implement such an API if you need it (for example, you intend to open your application to third party developers), but for all your internal needs, you will greatly benefit from doing without it.
With this approach, we can dramatically reduce code scattering, duplication of knowledge, and boilerplate.
View methods
The second crazy idea is to implement the UI views as methods of the domain models.
Typically, we implement models and views into completely different classes. We used to do so because views were mostly made of imperative code, but now that we have functional UI libraries such as React, why not just implementing the views as methods of the models they rely on?
For example, here is a User model with a Summary view:
class User {
  Summary = () => {
    return <div>{this.firstName} {this.lastName}</div>;
  };
}

Then, to render the summary of a User instance, we can just do:
<user.Summary />

Is there something wrong with it? I don't think so.
Of course, if you don't want to clutter your models with views, or if you need to implement views for different platforms, you are free to subclass your models and implement the views into these subclasses.
Anyway, collocating models and views in the same classes (or in some subclasses) greatly helps reducing code scattering.
Routable methods
The third idea might not be so crazy because it is already present in some popular frameworks such as Spring for Java. However, I haven't seen it yet in the JavaScript ecosystem.
The idea is simple. A route defines an alternate way to call a method.
For example, in our User class, let's decorate the signIn() method with a route:
class User {
  @route('/sign-in') signIn() {
    // ...
  }
}

Now, our method is callable with an URL:
user.$callRoute('/sign-in'); // Equivalent to `user.signIn()`

However, in practice, you will rarely call your methods like that. It's easier to call them directly. Routes are leveraged by @liaison/router that tracks the browser's current location. And when the location changes, the method matching the URL is called automatically.
Routes can include parameters, and since methods can implement views (see above), we get a nice way to organize our frontend pages.
For example, here is how we may implement a user profile page:
class User {
  @route('/users/:username') static Profile({username}) {
    // Fetch the user by username
    // ...
    // Then call the `Profile` instance view
    return <user.Profile>;
  };
}

This way, we don't need to define the routes in a separate file (typically, a central router), so there is no code scattering.
My RealWorld implementation
I implemented the RealWorld example (both frontend and backend) with Liaison.
I might be a bit biased, but the outcome looks quite amazing to me: high code cohesion, 100% DRY, and zero boilerplate.
In terms of the amount of code (in case it matters) my implementation is significantly lighter (see results here) than any other I have examined.
If you can, please have a look at the code. I'd like to know what you guys think.
Liaison is still at the stage of proof of concept though, and quite a lot of work remains so it can be used in production. I am working actively on it, and I hope I'll be able to release a beta version in early 2020.

I know this is old issue but I have a particular question that I can't find satisfied answer no matter how I google it: I am particularly unhappy with the duplication of code/knowledge about Router logic in both frontend and backend.
Basically both backend (especially REST api server ) and frontend need router codes and most of times (in my app) they are duplicated in many ways. For example the router code in backend with Expressjs (or whatever framework) and the router code in frontend with React/Vue isn't much different. But I can't find any way to reduce the duplication. I google the issue and can't find any articles talking this as if this is not a problem at all.
I would like know what is your thought about this ?
Thanks.

For example the router code in backend with Expressjs (or whatever framework) and the router code in frontend with React/Vue isn't much different. But I can't find any way to reduce the duplication.

Front and backend routes are 2 different things, you might find some common patterns for simple examples but it won't scale. There is no duplication here, just 2 different responsibilities having common patterns.

For example, this is one of my projects, the frontend uses vue, its router.js looks like following
const routes = [
    {
        path: '/',
        name: 'home',
        component: Layout,
        redirect: () => {
            return {
                name: 'home-view'
            }
        },
        children: [
            {
                path: '/statistics',
                component: () => import(/* webpackChunkName: "home" */ '../views/home'),
                name: 'home-view'
            },
            {
                path: '/statistics/:id',
                ...
            },
            {
                path: '/call/call_record',
                ...
            },
            {
                path: '/call/call_screen',
                ....
            },
            {
                path: '/call/outcall_task',
                ....
            },

The backend router.js has the similar codes, for each path in frontend, there is a correspond  path defined.

Thanks for the details.
It only works for simple use cases: at some point, it's pretty common to get a page relying on data retrieved from different endpoints: With RealWorld example, you need data from the user, the tags and the articles on the Home page.
And as your application evolves, the endpoints do too, that's common to use the versioning in the endpoint URL like /api/v2/call/call_record. It would break on the frontend side here.

We had a related discussion about that on the Angular Discord server a few days ago though.

Given your snippet, while there is work in progress to run Angular on the server side with improvements on Angular Universal, other SSR solutions are embracing a common codebase philosophy, like Remix or NextJS, without relying on an interface like a REST API between the 2 layers.

Thanks for the reply. I think we can further explore what you said, which also happens in my case:

It's pretty common to get a page relying on data retrieved from different endpoints ...  that's common to use the versioning in the endpoint URL

When that happen, backend needs to add new APIs and the correspond router settings. But there is alway a need (at least in my case) combine all these APIs together so each frontend page gets all the data it needs. In my case it is the frontend combines/call all APIs together. But actually backend can do this job too, so the frontend page can just call one API (or so) to get the data it needs.
So one of my points is that this knowledge is sharable but unfortunately right now it falls on the hand of who does the combining job. In my team, backend guys often does not have a clear idea which API is for which page or for this particular page what APIs it needs. Documentation is always easier said than done. I can't find an easy solution.

That's the responsibility of the consumer to combine, not the provider.
Combining is about more than just getting the data. It's about getting errors too, redirecting to another page if some data is in failure without calling the others, getting some data ahead of time, about having a way to cancel one call only, about using different loaders based on the data, about caching some parts in the browser too.


BUG fix compilers

cc @damonge @rmjarvis @c-d-leonard This one should pass and is ready for review!

Pull Request Test Coverage Report for Build 4953

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 96.995%

Totals

Change from base Build 4947:
0.0%

Covered Lines:
3260

Relevant Lines:
3361

💛  - Coveralls

fast-pt is not on conda for python 2.7, so I have removed those builds now

Yeah, that's fine. About time!

Not for this PR, but are we saying explicitly anywhere that we don't support python2 anymore?

It is deprecated and I believe we already did the same.

Also, I lost my permissions to restart and cancel jobs on travis. :/

@beckermr Try logging out and back in on Travis.  It gets confused sometimes about your collaborations.

We good to merge @damonge?


Update sponsors.

Autogenerated by the sponsors-maintainers-man-completions workflow.

A new version of markdownlint was released with new linter rules.
We're failing these two:

MD055 - Tables: Each row must start and end with a '|'
MD057 - Tables: In the second row every column must have at least '---',
possibly surrounded with alignment ':' chars

https://github.com/markdownlint/markdownlint/blob/main/CHANGELOG.md#rules-added

Thanks @apainintheneck! Can you open an issue (or just a PR) for that?
It may be there's an autofix option for that.


Tasks are not reloaded

Steps to reproduce:

Thanks @itohatweb for finding this bug

@Skillz4Killz can you take a look at this?


Export CSV Error on empty Filter

When creating a data table filter, I can generate reports in CSV, the problem arises when removing a filter to reprint all the data, it generates an error, which comes from not being able to ignore an empty filter, since the querystring is requested with empty information.
This is my filtering working correctly and in this case the button if it generates the appropriate report

but then, when I remove the filter and want to reissue the CSV, I get the following error

removing the filter removes only the value but not the field in the url
For it to work, the URL must look like this

I think the easiest solution comes from the add-on "Export CSV" being able to ignore the empty fields and thus not generate conflicts, since there are several types of filtering that generate the same problem, and I think it would be crazy to fix one by one so that they do not do that.

I noticed that this happens when using the "* Field" module to filter, and not the "Select" module.


bug(floating-terminal): refocus puts you into normal mode

Did you check docs and existing issues?

[X] I have read all the LazyVim docs
[X] I have searched the existing issues of LazyVim
[X] I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)
0.9.4
Operating system/version
Ubuntu 22.04.3
Describe the bug
Not sure if this is expected behavior, but I found that refocusing your terminal window puts you into normal mode when using the floating terminal. This can be disorienting as you are then unable to input any further commands and must know that insert mode must be activated before you can continue using the terminal.
Steps To Reproduce
Open the floating terminal ctrl + /
Focus another window
Focus your terminal again
You will now be in Normal Mode
Expected Behavior
Open the floating terminal ctrl + /
Focus another window
Focus your terminal again
You will continue to be in insert mode
Repro
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/LazyVim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

I totally understand if this is a behavior of nvim itself and cannot be changed, but figured if we could do something about it, its definitely worth thinking about.
Before I realized exactly what was happening, my workflow was to
esc
esc
q
ctrl + /
To regain control of the terminal error.
This was totally me not understanding that I could just press i to regain control, but I suspect new users will experience the same friction.
Thanks for all your hard work on LazyVim!

This is not the case for me. Every time I focus the terminal buffer it's in insert mode. That's the default behavior. Do you have some kind of customization in your configuration?

I am using this configuration
https://github.com/codymikol/nvim @ https://github.com/codymikol/nvim
I tried removing all customization except for my minimal changes to the lazy.lua file at that sha and am still experiencing the same issue.

I am using this configuration
https://github.com/codymikol/nvim @ https://github.com/codymikol/nvim
I tried removing all customization except for my minimal changes to the lazy.lua file at that sha and am still experiencing the same issue.

Are you able to reproduce with the code below
1. `mkdir ~/.config/lazytest`
2. `git clone https://github.com/LazyVim/starter ~/.config/lazytest`
3. `NVIM_APPNAME=lazytest nvim` and wait for the installation to complete
4. Restart Neovim with the command provided in step 3

Cleanup
rm -rf ~/.config/lazytest
rm -rf ~/.local/share/lazytest
rm -rf ~/.local/state/lazytest
rm -rf ~/.cache/lazytest

A screencast of how it behaves with default LazyVim starter template.
https://github.com/LazyVim/LazyVim/assets/12776461/d0ae5650-6b80-49fa-99b8-59a58539b192

Yes, I can reproduce the problem as shown
Screencast from 01-05-2024 11:16:08 AM.webm

What do you use to unfocus? I didn't see your cursor focusing another window. In my screencast you can see my cursor going to the window behind and then when it comes back to the terminal it goes straight into insert mode. How do you unfocus? Do you press <esc>? If yes, that's normal behavior.

Yeah, my understanding is that's normal behavior. Even if you don't "unfocus" the way you mean it, clicking with the mouse anywhere inside Neovim while the terminal is open, will take you to Normal mode (that is even happening with stock Neovim terminal). There is no way for Neovim to understand the focus of the terminal emulator window I believe (of course I might be wrong since I know very little portion of Neovim's behavior). Neovim only understands focus in terms of buffers inside Neovim itself, as far as I understand it.
Anyway, I doubt this is a LazyVim bug, as it also happens with default Neovim terminal. To observe the default Neovim behavior, open Neovim with nvim --clean and then type :terminal to open the stock Neovim terminal. Same thing happens.
If you agree that this is not a LazyVim bug, kindly close this issue.

I agree that this is not a LazyVim bug, thank you for all your hard work!

I'm just a user like you that tries to help others. I haven't put any hard work into this project. Others have contributed way more.

Also just FYI if you read :h terminal-input, there's this quote

Mouse input has the following behavior:

If another window is clicked, terminal focus will be lost and nvim will jump
to the clicked window

That seems to be the case in the scenario you described I believe.


fix: Refactor no default BSL code validation

Description
Refactor validation of no default BSL and also check error messages of validations.
How to test
Run make test.

/lgtm

/cherry-pick oadp-1.3

once https://github.com/openshift/oadp-operator/pull/1294 merges, cherry-pick should work.

tide Pending — Not mergeable. Retesting 14 jobs.

it's retesting against latest HEAD from prior merges.. patience :)

/retest

/override ci/prow/4.13-e2e-test-azure
/unhold
from virt backup suite which we discussed should not fail

/test 4.14-e2e-test-aws

/override ci/prow/4.14-e2e-test-aws
snapshots errors and PROW timeout (that we need to investigate, are our E2E tests taking more than 2 hours to run?), and want to unblock Sachin's PR

/override ci/prow/4.14-e2e-test-aws


[iOS] App group/Share extension support?

Hi,
I wanted to know if there is support for sharing storage between app groups. I'm trying to share storage between
the main target and share extension target.
From what I found, it looks like the library is using /Library to store which is not accessible by both the main target and share extension.
Do you have any ideas on how to get this to work?

Hi,
I wanted to know if there is support for sharing storage between app groups. I'm trying to share storage between
the main target and share extension target.
From what I found, it looks like the library is using /Library to store which is not accessible by both the main target and share extension.
Do you have any ideas on how to get this to work?

I will add support for it in the next release using app groups.

Question for you,
To access mmkv data from some extension, I  initialized mmkv natively using your suggestion here
which is also mentioned in mmkv's docs
But I was still unable to access the same storage as the main app
I'm guessing the issue is that I need to use <MMKVAppExtension/MMKV.h> as mentioned in their docs
https://github.com/Tencent/MMKV/wiki/iOS_setup#installation
Which means I somehow need a copy of this library that uses MMKVAppExtension for the extension part.
Is there a better way of doing this?

Question for you,
To access mmkv data from some extension, I  initialized mmkv natively using your suggestion here
which is also mentioned in mmkv's docs
But I was still unable to access the same storage as the main app
I'm guessing the issue is that I need to use <MMKVAppExtension/MMKV.h> as mentioned in their docs
https://github.com/Tencent/MMKV/wiki/iOS_setup#installation
Which means I somehow need a copy of this library that uses MMKVAppExtension for the extension part.
Is there a better way of doing this?

I am using it in my App in Share Extension so it does work although I am on older version 0.4 of this library. I will let you know what I did. Basically you need to set the correct path which can be accessed by extension and the app.

Here's how you can do it:
NSString *myGroupID = @"your.group.id"; // the group dir that can be accessed by App & extensions

       NSString *groupDir = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:myGroupID].path;
       NSString *rootDir = [groupDir stringByAppendingPathComponent:@"mmkv"];

       // Do not include this directory in cloud backups.
        NSError *error = nil;
        NSURL *url = [NSURL fileURLWithPath:rootDir isDirectory:YES];
        [url setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error];
       [MMKV initializeMMKV:rootDir];

You have to make these changes here:
https://github.com/ammarahm-ed/react-native-mmkv-storage/blob/67eaf54bd0d4b5a99c9ed15c389606600e32021f/ios/MMKVNative.mm#L71

Did the app compile normally without errors after you made the changes. You don't need to use MMKVAppExtension. Can you read/write in extension and in app separately? Do the values persist in both App and Extension after restarting?

Thanks a lot, really appreciate the answer.
I did intialize it the same way but I didn't append the "mmkv" to the path.
Also, I did it in a separate native module, since I thought mmkv uses a single instance (singleton), which did kinda work but kept erasing all my data.
I'll try it out asap, thanks for the help and the awesome library.

HI,
I've just tested it and it doesn't seem to be working.
Maybe it has something to do with redux-persist or encryption.
I did share connect the extension by app group and keychain.

I'm interested too for my react-native app extension! any news?
I'm trying to write a custom (swift) ViewController extending the ReactShareViewController of 'react-native-share-menu' library (https://https://github.com/meedan/react-native-share-menu) in order to properly initialize MMKV with the same group directory of the main app.
I think that the correct way is overrid the viewDidLoad method and insert here the mmkv initialization instructions. But i don't know which instructions to use in swift and what import...

I used the same stuff, got it to work with keychain for now, but I think I'll plugin mmkv later(not sure if the encryption).
You can put it in ShareMenuManager.m
Small notes: be-careful of 120mb limit, only load the data you need, debug is more consuming so it might work as well as release,  rn-share-menu does not work with some apps like telegram, rn-share-menu hasn't had a release for a year
I think a plugin library for all the share stuff would be really good, something that combines rn-share-menu/rn-share-extension with rn-mmkv-storage and has support for encryption, multi share, and share sheet support. If I get the time, I might give it a go.

@humaidk2  Were you using MMKV in both app and extension with encryption when you tried it out? You are saying that it worked to some level but your data kept getting erased, so basically it worked but when you would write data on app, it would not appear in extension and when you would write data in extension, it would not appear in the app?

Yeah exactly,
I use redux and the store would persist in both, but i could never load the data from one to the other. I an definitely using app groups and they were connected.
Whenever I launched the share extension,  it would erase the mmkv store of my main app.

Yeah exactly,
I use redux and the store would persist in both, but i could never load the data from one to the other. I an definitely using app groups and they were connected.
Whenever I launched the share extension, it would erase the mmkv store of my main app.

I understand now why that happened. Actually the library uses an IDStore internally which needs to initialize on multi process if it is to be accessed between app and the extension. Since the IDStore is initialized on a single process mode, it cannot be accessed in both app and extension simultaneously. The IDStore` consists the information about each instance and how to decrypt it.
To fix this, all that needs to be done is to init the IDStore on multi process mode so both app and share extension can access it and decrypt the storage instance.

To fix this, all that needs to be done is to init the IDStore on multi process mode so both app and share extension can access it and decrypt the storage instance.

Thanks, what is the correct way to do this initialization? During initializeMMKV in MMKVNative.mm or directly from js code?

@r3vsan  See the updated comment above for instructions.


add russian localization files #253

adds russian localization files task #253

Codecov Report

Merging #260 into dev will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##                dev     #260   +/-   ##
=========================================
  Coverage     79.06%   79.06%
  Complexity      223      223
=========================================
  Files            81       81
  Lines           731      731
=========================================
  Hits            578      578
  Misses          153      153

Continue to review full report at Codecov.

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

@morozovalexander thanks for the translation. :+1:


.md file with profiling instructions

This document describes how to build and run for profiling.
Sadly, stack doesn't seem to work; the nix option does work but there are some questions there too. It would be good to have some other eyes on this.
@adinapoli-iohk can you ping some relevant people?

Thank you very much @edsko !

the nix option does work but there are some questions there too. It would be good to have some other eyes on this.

I see -- @jmitchell , @cleverca22  mind helping us here as well? 😉

Also, @erikd is rapidly becoming our "code practice & operational knowledge base" overlord and gate keeper, so I would also like to put this on his radar 😉

Possibly related nix question, although probably entirely orthogonal to this PR. Running
nix-build -A cardano-sl-wallet-new --arg enableProfiling true

as in the instructions, then CTRL-Cing this at the very end when it runs the tests for the new wallet (i.e., having built all dependencies), and then running the exact same thing again, results in a ton of dependencies being rebuilt again. Dunno why that is. May or may not be due to the use of src = ./../lib etc in the generated default.nix.

I needed to enable stack traces recently and because stack traces use the profiling machinery, I need profiling. However, I only use stack and/or nix to do a final test of my PR before I push it to github.
My usual build tool is mafia which I use in conjunction with jenga. With mafia, building with profiling was as easy as mafia build -p and after it rebuilt to whole world I got my stack trace.

Regarding the profiling build failures: #2720

Merging this one overriding CI as it's only touching documentation stuff.
We can improve it later to cover the nix stuff with suggestions from the Devops folks.


Copy-to-clipboard button was added to invite users via generated url

While generating a link, to invite users, existing users had to manually copy the link by highlighting it. I've added the COPY-LINK button for cleaner interface and ease of copying the url.
This PR is in reference for issue #16442 . The copy link button was added to invite users via GENERATED LINK.
Testing Plan:
GIFs or Screenshots:

@timabbott could you review this one? Thanks :)

@aniketsonu can you clean up your Git history?  You should always rebase rather than using merge commits.
Check out our GitHub guide and commit guidelines for more details.

Mentioning #16084 for possible merge conflicts.
(The html for invite link element was moved to a new handlebars file)

Mentioning #16084 here for possible merge conflicts.
(The html for invite link element was moved to a new handlebars file)

I don't think this should be a problem cause we are using the generated link for inviting?

Thanks for working on this!  It's functional, but could use some work on styling.  While reviewing, I rewrote the commit message to match our style (Check out the Zulip commit message guidelines for more details: https://zulip.readthedocs.io/en/latest/contributing/version-control.html#commit-messages) and applied the following patch:
diff --git a/templates/zerver/app/invite_user.html b/templates/zerver/app/invite_user.html
index d8f2bd17d7..af16a6e0f5 100644
--- a/templates/zerver/app/invite_user.html
+++ b/templates/zerver/app/invite_user.html
@@ -57,7 +57,7 @@
                 <button class="button exit small rounded" data-dismiss="modal">{{ _('Cancel') }}</button>
                 <button id="submit-invitation" class="button small rounded sea-green" type="button"
                   data-loading-text="{{ _('Inviting...') }}">{{ _('Invite') }}</button>
-                <button type="button" style="display: none;" id="copy_generated_invite_link" data-clipboard-target="#multiuse_invite_link">Copy-link</button>
+                <button type="button" class="hide" id="copy_generated_invite_link" data-clipboard-target="#multiuse_invite_link">Copy-link</button>

         </form>

to set the initial state via CSS, and then pushed back here.
I'd like this to be styled not as an ugly grey button but as a clipboard icon inline with the link itself, (the icon should be similar to how the "view source" feature in the message feed works).  Can you rework this to use that sort of visual styling?  Thanks @aniketsonu!
@sumanthvrao FYI as someone who can help if you're having trouble getting the icon working.

This is much improved, thanks @aniketsonu!  I did the finishing bits of this and merged it as 28aaf24a615061fcaaafe59ac81473cc109e60fd:

Fixing the missing space after the : that made things look weird
Removed Invitation to make the links fit better within a single line.
Reworked the template rendering to be simpler and not involve JS post-processing of HTML templates.

Thanks for making this happen @aniketsonu!


CB-20483 E2E test to validate Java11

See detailed description in the commit message.

retest this please

retest this please


Crash when connecting to pmac: macroIcAddresses[i] out of range

The application crashed when trying to connect to a pmac:
Traceback (most recent call last):
  File "/dls_sw/prod/python3/RHEL7-x86_64/dls_pmaccontrol/3.0.0/prefix/lib/python3.7/site-packages/dls_pmaccontrol/motor.py", line 294, in remoteConnect
    self.table.setRowCount(self.pmac.getNumberOfAxes())
  File "/dls_sw/prod/python3/RHEL7-x86_64/dls_pmaccontrol/3.0.0/lightweight-venv/lib/python3.7/site-packages/dls_pmaclib/dls_pmacremote.py", line 315, in getNumberOfAxes
    self._numAxes = 8 + self._getNumberOfMacroStationAxes()
  File "/dls_sw/prod/python3/RHEL7-x86_64/dls_pmaccontrol/3.0.0/lightweight-venv/lib/python3.7/site-packages/dls_pmaclib/dls_pmacremote.py", line 307, in _getNumberOfMacroStationAxes
    if macroIcAddresses[i] != "$0":
IndexError: list index out of range
Aborted

The pmac possibly has the wrong setting, but we still do not want the application to crash.

The issue here was that 4 commands were being sent to the pmac to determine the macro IC addresses. The code expects a 4 element array to therefore be returned. However in this case the pmac was returning an error ('\x07ERR005') and hence the index went out of range of the list.
I have fixed this by catching the case where the return array does not have a length of 4 and if so return 0 for the number of macro stations. See commit: https://github.com/Observatory-Sciences/dls-pmac-lib/commit/8a17350172aa28d0c218733fc7c47425204f6975


Non documented breaking change between typescript-operation 1.18.4 and 2.0.1 ?

Describe the bug
My TS compilation failed after upgrading this package. I'm transforming query operations that use fragments on GraphQL interfaces. The trick is that I don't define a fragment for each possible type. It's easier to show than to explain, see below section
To Reproduce
Steps to reproduce the behavior:
https://codesandbox.io/s/crazy-chatterjee-gwewo?file=/types.ts

My GraphQL schema:

interface Ref {
  ref: ID!
}

type Foo implements Ref {
  ref: ID!
  foo: String
}

type Bar implements Ref {
  ref: ID!
  bar: String
  lol:String
}

type Query {
  entityByRef(type: String!, ref: ID!): Ref
}

My GraphQL operations:

query getFoo($ref:ID!) {
    entityByRef(type:"Foo", ref:$ref) {
        ... on Foo {
            foo
        }
        # Not defining fragment for Bar because I know it can't be anything but a Foo
    }
}

My codegen.yml config file:

schema: schema.graphql
documents: document.graphql
generates:
  types.ts:
    plugins:
      - typescript
      - typescript-operations
    config:
      preResolveTypes: true
      skipTypename: true

Expected behavior
Note the generated type GetFooQuery:
export type GetFooQuery = { entityByRef?: Maybe<{ foo?: Maybe<string> } | {}> };

In previous version it was:
export type GetFooQuery = { entityByRef?: Maybe<{ foo?: Maybe<string> }> };

There was no | {} which I guess represents the other possible types of Ref interface. Though the former output makes more sense, I'd like to known if there's a way to go back to the latter output.
Environment:

OS: MAcOS
"@graphql-codegen/add": "^3.0.0",
"@graphql-codegen/cli": "^2.0.1",
"@graphql-codegen/fragment-matcher": "^3.0.0",
"@graphql-codegen/typescript": "^2.0.0",
"@graphql-codegen/typescript-operations": "^2.0.1",
"@graphql-codegen/typescript-react-apollo": "^3.0.0",
NodeJS: v14.15.1

Additional context
I was updating from:
"@graphql-codegen/add": "^2.0.2",
"@graphql-codegen/cli": "^1.21.7",
"@graphql-codegen/fragment-matcher": "^2.0.1",
"@graphql-codegen/typescript": "^1.23.0",
"@graphql-codegen/typescript-operations": "^1.18.4",
"@graphql-codegen/typescript-react-apollo": "^2.3.1",

Thanks

The previous typing was actually incorrect. The new one is more accurate. Not sure why we should provide a option to use the wrong types. Could you explain that further?

I know the new way is the correct way but it happens to give me more work to do: now I need to make sure that the object I get from my query is actually a Foo by wrapping my code with some type guard such as: if('foo' in entity) { ... }.
Anyhow I'll close the issue since there's nothing to do.
Thanks

If anyone found this issue, here is how i removed it:
// is T an object and has no key, then remove it from NoEmpty, else use T
type NoEmpty<T> = T extends {} ? (keyof T extends never ? never : T) : T;

const foo = data.entityByRef as NoEmpty<typeof data.entityByRef>;


evinse is possibly broken on v11

All the slices are getting created successfully, and yet it fails with the error Unable to identify component evidence.
node /Volumes/Work/CycloneDX/cdxgen/bin/cdxgen.js -o bom.json -t java . --profile research --include-crypto
Executing '/Users/prabhu/.sdkman/candidates/maven/current/bin/mvn dependency:copy-dependencies -DoutputDirectory=/var/folders/tj/qpj19ty13n193twz68w6phj80000gn/T/mvn-deps-tTRKEM -U -Dmdep.copyPom=true -Dmdep.useRepositoryLayout=true -Dmdep.includeScope=compile -Dmdep.prependGroupId=false -Dmdep.stripVersion=false' in /Volumes/Work/sandbox/bouncycastle-examples
About to identify class names for all jars in the path /var/folders/tj/qpj19ty13n193twz68w6phj80000gn/T/mvn-deps-tTRKEM
Executing 'mvn dependency:tree -DoutputFile=/var/folders/tj/qpj19ty13n193twz68w6phj80000gn/T/cdxmvn-KiH61T/mvn-tree.txt' in /Volumes/Work/sandbox/bouncycastle-examples
Creating reachables slice for /Volumes/Work/sandbox/bouncycastle-examples. Please wait ...
Creating usages slice for /Volumes/Work/sandbox/bouncycastle-examples. Please wait ...
Unable to identify component evidence for the input SBOM. Only java, javascript, python, swift, and php projects are supported by evinse.

Simply re-running the command, makes it work correctly as normal.
node /Volumes/Work/CycloneDX/cdxgen/bin/cdxgen.js -o bom.json -t java . --profile research --include-crypto
Executing '/Users/prabhu/.sdkman/candidates/maven/current/bin/mvn dependency:copy-dependencies -DoutputDirectory=/var/folders/tj/qpj19ty13n193twz68w6phj80000gn/T/mvn-deps-3z8j53 -U -Dmdep.copyPom=true -Dmdep.useRepositoryLayout=true -Dmdep.includeScope=compile -Dmdep.prependGroupId=false -Dmdep.stripVersion=false' in /Volumes/Work/sandbox/bouncycastle-examples
About to identify class names for all jars in the path /var/folders/tj/qpj19ty13n193twz68w6phj80000gn/T/mvn-deps-3z8j53
Executing 'mvn dependency:tree -DoutputFile=/var/folders/tj/qpj19ty13n193twz68w6phj80000gn/T/cdxmvn-4su55X/mvn-tree.txt' in /Volumes/Work/sandbox/bouncycastle-examples
bom.json created successfully.

https://github.com/AppThreat/vulnerability-db/actions/runs/12415082754/job/34660613981#step:9:39


Linguist not updating after adding .gitattributes for vendored code

Preliminary Steps
Please confirm you have...

[x] reviewed How Linguist Works,
[x] reviewed the Troubleshooting docs,
[x] considered implementing an override,

that's what I did

[x] verified an issue has not already been logged for your issue (linguist issues).

this issue has been raised before, but no workaround has worked

Problem Description
Shortly after I pushed to my repo, the color bar was updating to include new code I added (Smarty), which wasn't present before. However, when it updated, it didn't update based on the .gitattributes file I added, which added linguist-vendored to many files. I'm not sure if this is a caching issue, GitHub's servers just taking their time (as mentioned in the README), or whatever else, since the new language was added relatively quickly.
Further, css/animate.css, css/bootstrap.css, css/jquery-ui.min.css, etc. are all showing up as CSS, even though they're listed in  https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml.
URL of the affected repository:
https://github.com/sumanthratna/website
Last modified on:
2020-04-03
Expected language:
n/a
Detected language:
n/a
Note: I would run linguist locally to investigate myself, but I can't install it, as I'm on a macOS beta. I'll raise another issue for this if I can't fix it, but for now, this issue is of higher priority for me.

You've not clearly stated what you're seeing but are expecting to see so I'm going to take a guess from your other comments that you don't expect CSS to be the predominant language.
I can confirm your .gitattributes is taking effect. The reason CSS is the predominant language is because your two remaining CSS files that count, count for more bytes of code than the rest of your files:
CSS 61.5 KB
Smarty 59.4 KB
PHP 12.5 KB
JavaScript 4.03 KB
$ github-linguist --breakdown .
44.77%  CSS
43.21%  Smarty
9.09%   PHP
2.94%   JavaScript

PHP:
admin.php
auth.php
contact.php
index.php
setup.php

CSS:
css/style.scss
style.css

JavaScript:
js/main.js

Smarty:
templates/footer.tpl
templates/header.tpl
templates/pages/about.tpl
templates/pages/admin/login.tpl
templates/pages/admin/manage.tpl
templates/pages/blog/index.tpl
templates/pages/blog/post.tpl
templates/pages/contact.tpl
templates/pages/home.tpl
templates/pages/search.tpl
templates/socials.tpl

$
$ /bin/ls -lh css/style.scss style.css
-rw-r--r--  1 lildude  staff    29K  5 Apr 09:42 css/style.scss
-rw-r--r--  1 lildude  staff    33K  5 Apr 09:42 style.css
$

As you can see, none of the vendored files have been included in the analysis.
As you're vendoring your other SCSS files, you might want to vendor css/style.scss too.
As for:

Further, css/animate.css, css/bootstrap.css, css/jquery-ui.min.css, etc. are all showing up as CSS…

They're not. See output above. What you're looking at are the search results which are completely independent from Linguist and deliberately ignore the .gitattributes content. If it didn't, you'd never be able to search for your vendored files 😄.


a11y improvements

There are likely a number of accessibility-related adjustments to be made to Fine Uploader UI, the docs site, and the home page.  In the interest of accommodating any and all users who must interact with Fine Uploader, we should make a concerted effort to address any related deficiencies in this library and associated sites.
Here is a running list of improvements to make (please add comments to cover anything I missed):

[x] Ensure upload button is fully keyboard accessible in all browsers
[ ] Update default templates to use semantic HTML, aria attributes where semantic HTML isn't possible
[ ] Ensure docs site is accessible
[ ] Ensure demos on home page follow a11y best practices
[ ] Ensure website non-demo content is accessible

The file input button should be reachable via keyboard (tab) in all browsers, with the possible exception of the current version Safari.  Safari seems to have accessibility issues on all sites, so not much we can do here.
In IE, two tabs are required to navigate past a file input element.  This is due to the fact that IE treats the file input element as two separate elements.  The first tab hits the file input's text box and you cannot invoke the chooser via keyboard at this point.  The second tab hits the file input's button.  To invoke the chooser, you must hit the space bar.  All other browsers only take one tab to navigate past the file input, and the enter key will invoke the chooser.
Previously, keyboard access to the file input was disabled in IE due to the two-tab issue.  I removed this condition as I believe flawed keyboard access is better than no keyboard access.
There are other potential solutions to ensure consistent keyboard access across all browsers, but all of them involve using JavaScript to either focus the file input, or click it.  The former trips security checks in Firefox, and the latter prevents the underlying form from being submitted via JavaScript in IE.  So, the current behavior is as good as it's gonna get.

Our website certainly needs some work (JavaScript embedded in <script> tag, global vars everywhere, inline styles everywhere, etc) but the site is much more accessible after my changes.  The templates, demos, and examples have been updated as well.  All that's left is the docs site: up next.
Changes to the docs site, main site, and code will go out with the next scheduled release, which is 5.2.0 at this time.

Docs site has been updated.  Once our doc generator is fixed, I'll verify and this will be done and ready for 5.2.

No a11y errors on the develop docs site according to wave.  I'll need to run the same tests on the website and an uploader instance as well before declaring Fine Uploader WCAG compliant.

Fine Uploader's a11y work should be complete at this point!  Staged in the develop and site/5.2.0 branches.


Suggestion: Endpoint to interact with polls

I would like to suggest the addition of an endpoint that can vote on polls.

No plans to do this in near future...


[ANDROID] Promise is not resolving on second time paying.

Hi guys.
Few days ago started with upgrading BT SDK from 2.17 to latest 3.14.2 as faced Google Play team warning like related to this issue.
Found really disgusting issue right there then after upgrading. If you use like new 3.14.2 BT SDK version promise on requestOneTimePayment native method still remains the same each time you trigger this method. This lead to promise to be useless as it won't run resolve or reject on second request and then. HashCode of promise still remains the same. As on BT SDK v2.17 promise has different HashCode each time you trigger requestOneTimePayment method.

Yes found same issue in android only.Have you found any solution for it?

@krupalikevadiya  actually, having a talk with PayPal development team so they researching this issue. Once I will get any response, will write right there

Are there any kind of news about this issue?

Are there any kind of news about this issue?

@valerio-fornace  There's an open MR that needs a tweak but it should be ready to go after that.  If I don't get a response for a few days I'll finish up the fix and do a release

@nzankich thanks this is a good news!

fixed on 4.0.1
be sure to follow the upgrade instructions for 4.0.0 https://github.com/smarkets/react-native-paypal/releases/tag/4.0.0

@nzankich
still getting same issue in android.
"react-native": "0.64.2",
"react-native-paypal": "4.1.0",


Filter out empty path components

The routing login below relies on parts[0] being empty

@alecthomas updated. How does it look now?


[GLUTEN-2219] Cover more modules with spotless maven plugin

What changes were proposed in this pull request?
Spotless maven plugin is added for more modules' pom.xml. Thus, format check failure can be reported. The other code changes are mostly generated by mvn spotless:apply .... command to fix the code format issues.
Will update a document for developers in a separate PR.
(Fixes: GLUTEN-2219)

@baibaichen, could you please help review this patch? Thanks!


Running Image fails on my Windows WSL2 Docker

Hello,
please, excuse my lack of knowledge of docker.
This docker image runs perfectly on my linux virtual machine.
but, I couldn't run it on my windows machine.
My setup: I've

Iwsl2 installed running ubuntu.
docker for windows with wsl2 enabled.
git cloned this repo
run docker compose up -d
gone to <IP_ADDRESS>:8800

then I faced this error

Here are server log.
2023-11-21 22:15:57 cgwire-zou-app      | Resetting search index.
2023-11-21 22:15:57 cgwire-zou-app      | 0 assets indexed
2023-11-21 22:15:57 cgwire-zou-app      | 1 persons indexed
2023-11-21 22:15:57 cgwire-zou-app      | 0 shots indexed
2023-11-21 22:15:57 cgwire-zou-app      | Search index resetted.
2023-11-21 22:15:57 cgwire-zou-app      | [2023-11-21 20:15:57 +0000] [1] [INFO] Starting gunicorn 21.2.0
2023-11-21 22:15:57 cgwire-zou-app      | [2023-11-21 20:15:57 +0000] [1] [INFO] Listening at: http://<IP_ADDRESS>:5000 (1)
2023-11-21 22:15:57 cgwire-zou-app      | [2023-11-21 20:15:57 +0000] [1] [INFO] Using worker: gevent
2023-11-21 22:15:57 cgwire-zou-app      | [2023-11-21 20:15:57 +0000] [11] [INFO] Booting worker with pid: 11
2023-11-21 22:15:58 cgwire-zou-app      | [2023-11-21 20:15:58 +0000] [12] [INFO] Booting worker with pid: 12
2023-11-21 22:15:58 cgwire-zou-app      | [2023-11-21 20:15:58 +0000] [13] [INFO] Booting worker with pid: 13
2023-11-21 22:17:57 cgwire-kitsu        | <IP_ADDRESS> - - [21/Nov/2023:20:17:57 +0000] "GET / HTTP/1.1" 500 579 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Safari/537.36"
2023-11-21 22:17:57 cgwire-kitsu        | 2023/11/21 20:17:57 [error] 21#21: *1 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: <IP_ADDRESS>, server: localhost, request: "GET / HTTP/1.1", host: "<IP_ADDRESS>:8800"
2023-11-21 22:17:57 cgwire-kitsu        | 2023/11/21 20:17:57 [error] 21#21: *2 rewrite or internal redirection cycle while internally redirecting to "/index.html", client: <IP_ADDRESS>, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "<IP_ADDRESS>:8800", referrer: "http://<IP_ADDRESS>:8800/"
2023-11-21 22:17:57 cgwire-kitsu        | <IP_ADDRESS> - - [21/Nov/2023:20:17:57 +0000] "GET /favicon.ico HTTP/1.1" 500 579 "http://<IP_ADDRESS>:8800/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/<IP_ADDRESS> Safari/537.36"

Additional info:
this is what I see when going to -> http://localhost:8800/api/status
{"name":"Zou","version":"0.17.50","database-up":true,"key-value-store-up":true,"event-stream-up":true,"job-queue-up":true,"indexer-up":true}

I think the problem somehow relates to wsl networking.

Closing this issue as the docker image works perfectly fine on my Linux virtual machine.
I believe the problem is in Windows WSL2 Networking.


Access Denied on Windows 10

Hi I have been trying to connect to a Tenveo VHD202U on Windows 10 (COM5) using the plugin but every time I try it errors out saying Access denied.
Is there something special I have to do to get the plugin to work with this camera?\
I can control the camera via the obs visca plugin so I know the settings are correct but when I restart the computer and try and access the com port via the plugin it gives me the access denied.

@br8kpoint It seems nobody actually answers issues here. But I would suspect an Access denied would be caused by the OBS plugin. Serial ports can only be used by one application at once. So the first app to get access keeps it.

FYI this is a volunteer module, submitted in case it may be useful, but it does get used a lot.
Real life does get in the way and sometimes things get overlooked.
Access denied for the serial port suggests another program/service has possession.
@derrynj  is probably correct. If OBS has control, Companion will get errors.


Google GeocoderQuotaExceeded, though API Console doesn't show exceeding usage

Hi all,
Trying to geocode 55 records, and only getting 1/2way through before I get the error:
geopy.exc.GeocoderQuotaExceeded: The given key has gone over the requests limit in the 24 hour period or has submitted too many requests in too short a period of time.
Looking at my Google Developers Console, the API usage is nowhere near the limit (i'm only < 100 per day) and the requests / second aren't near the limit either.
Is there a middle man here that I can't see that is causing this error? Is GeoPy sending requests too fast?
Thanks!

Seems to have resolved itself without any further issues or change to my code... strange!

What is the quota limit?
I tried using GeoPy to identify the latitude and longitude of a number of addresses but now I get this error message:
GeocoderQuotaExceeded: HTTP Error 429: Too Many Requests

The Google API documentation has the quotas listed - I'd share a link but they all seem to be connected to my account. You'll have to dig around a bit.

For Google it's https://developers.google.com/maps/documentation/geocoding/usage-and-billing

Trying to geocode 55 records

Google does rate-limit to 50 requests per second, so that could cause the blocking.


Reimplement functionality similar to PinnedQueryBuilder

PinnedQueryBuilder is removed as part of removal x-pack, this is a track ticket to develop similar functionality in OpenSearch.
https://github.com/elastic/elasticsearch/blob/v7.10.2/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java#L1385

Is your feature request related to a problem? Please describe.
We need to promote a list of documents, for example 240.
And at the same time all filters should be applied, so we make sure that this documents are searchable and match criteria's.
What we need already implemented in X-Pack https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-pinned-query.html#query-dsl-pinned-query

Pending more votes from the community to prioritize it.

It's starting to get some traction! C'mon! This works like a charm when mixing ES with a recommendation engine. 🚀

@asknacho @hronom want to try to contribute this feature?
We cannot take non-APLv2 code, but happy to merge a PR if someone wants to reimplement this functionality, confirming that they aren't copying/looking at non-APLv2 code.

There is a contributor @Aero-Blue who composed a design document for the feature, and wrote some code aiming to make the feature as a plugin. If anyone has got the interest to implement the feature, please feel free to refer to those achievements.

Thanks @tlfeng. I am the original contributor for this project, it is incomplete because I had to leave due to medical issues unfortunately. I didn’t have time to update the design document but after further research it was decided that it would be best implemented as a plugin. I was able to figure out and modify the requests to include 2 attributes, pinned_query which indicates wether the result is pinned, and a score which indicates it’s position in the pinned results. What I needed to figure out was how to modify the response to a user search before it got to the user and rearrange the results using the attributes mentioned above before returning the request to the user. It should be fairly simple to add to the current project. I’d love it if this project could be continued as I very much enjoyed my internship and time at Amazon and hope I have contributed at least something to the progress of OpenSearch.

Querqy has been ported to OpenSearch and works with OpenSearch 2.3.

@macrakis Shall we close this issue then?


Setting up docker stops at mailhog_1

On initial setup setup stops at mailhog_1    | [APIv1] KEEPALIVE /api/v1/events and keep trying but keeps displaying line above over and over again.

It sounds like you just run docker-compose up without -d flag and just follows the containers' logs

Thank you @csandanov 👍

플래그 docker-compose up없이 실행 -d하고 컨테이너의 로그를 따르는 것처럼 들립니다.

how can I use docker-compose up??


chore: project addition by anilkoduru

Add a new project to the list
Url shortener project addition to the repo
Record

[X] I have checked the existing issues
[X] I have read the Contributing Guidelines
[X] I agree to follow this project's Code of Conduct
[X] I want to work on this issue

could you share your progress on this issue?

it appears that this particular issue has not been resolved within the past few days. As it involves a simple pull request, we would like to kindly inform you that we are closing this issue.
If you still wish to work on this project, we encourage you to create a new issue and submit a pull request accordingly. Please ensure to review the contributing guidelines
Thank you for your understanding.


ORMLite Android - Prevent Upgrade inside catch

I'm trying find a way to prevent the database version from updating in the event that something goes wrong inside the onUpgrade method.
I have the following helper class
public class DatabaseHelper extends OrmLiteSqliteOpenHelper
{
   private DatabaseHelper(Context context)
   {
      super(context, DATABASE_NAME, null, DATABASE_VERSION, R.raw.ormlite_config);
   }

   @Override
   public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion)
   {
       try
       {
         MigrationHelper.RunMigrations(mContext,oldVersion,this);
       }
       catch (Exception e)
       {
            //How can I prevent the version from updating if the migration fails?
       }
    }
}

Prefferably I want to be able to show a message dialog to the user so just throwing an unhandled exception (that would cause the application to crash) isn't really ideal.
Thanks in advance
Edit:
I found a way to do what i needed.  I'm not sure if this is the best way to go about it but it accomplishes what I need.
First I created a new interface that looks something like this:
public interface MigrationFailedListener
{
    void onMigrationFailed(String message);
}

And then I modified my DatabaseHelper to look something like this:
public class DatabaseHelper extends OrmLiteSqliteOpenHelper
{
    public static MigrationFailedListener migrationFailedListener;

     @Override
       public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int oldVersion, int newVersion)
    {
        Log.e("onUpgrade", "oldVersion: " + oldVersion + " newVersion: " + newVersion);
        try
        {
            MigrationHelper.RunMigrations(mContext.get(),oldVersion,this);
        }
        catch (Exception e)
        {
            //Notify the listener that the migration has failed
            if(migrationFailedListener != null)
            {
                migrationFailedListener.onMigrationFailed(e.getMessage());
            }
            //Throwing a RuntimeException appears to be caught by the OrmLiteSqliteOpenHelper and
            //prevents version increasing (So next to the app is run it will try to upgrade again)
            throw new RuntimeException(e.getMessage());
        }
    }

}

Then I simply set the the migrationFailedListener before any database calls are made like so:
//Set the Migration failed callback
DatabaseHelper.migrationFailedListener = message ->
{
   DatabaseHelper.clearInstance();
   okDialog = new OkDialog(LoginActivity.this, "Database Migration Failed", "There was an issue while migrating database. Application will now close", view ->
    {
      okDialog.cancel();
      finishAndRemoveTask();
     });
    okDialog.show();
};

Can you add some comments to help others @Murded ?

@j256 I've updated my original post, if you have any suggestions / issues with my solution please let me know


fix: Broken notification channel creation in Android O and above, whi…

…ch caused app crash after started.

I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!


[15] added support to install externals from a directory and updated dependencies (master)

please # if ready

added the # sign


Reg usage

Hi,
can you please let me know on how to include these files to work on XPath 2.0 expressions?
Thanks,
Jeya

Hi, do you want to run it in browser or in node?

@ilinsky   yes, we need to run this in browser.

Should this issue still be relevant, please reopen it. Otherwise closing.


Issue with system_fingerprint Returning as "None" in OpenAI API Response

tried to make the completion output consistent while it's working and its consistent to some degree, but when I checked the API response the system_fingerprint=None was coming ....
example API response,
ChatCompletion(id='chatcmpl-8IKPGoyfgVAYPTQ270zYHV5MuwCKE', choices=[Choice(finish_reason='length', index=0, message=ChatCompletionMessage(content="Once upon a time, in a not-so-distant future, humanity had set its sights on the red planet: Mars. Excitement filled the hearts of scientists, explorers, and dreamers alike as they prepared for a groundbreaking journey into the unknown.\n\nAmong them was Captain Amelia Carter, a seasoned astronaut known for her unwavering determination and unwavering spirit. She had been selected to lead the crew of the Ares-1, the first manned mission to Mars. Alongside her were five exceptional individuals, each with their own expertise and a shared passion for discovery.\n\nAs the day of departure drew near, the crew underwent rigorous training, preparing themselves physically and mentally for the challenges that lay ahead. They studied the Martian landscape, practiced living in confined spaces, and simulated emergency situations. They became a tight-knit family, relying on each other's strengths and supporting one another through the journey that lay ahead.\n\nFinally, the day arrived. The Ares-1 stood tall on the", role='assistant', function_call=None, tool_calls=None))], created=1699379038, model='gpt-3.5-turbo-0613', object='chat.completion', system_fingerprint=None, usage=CompletionUsage(completion_tokens=200, prompt_tokens=31, total_tokens=231))

code-piece to replicate
import asyncio
from openai import OpenAI
import pprint
import difflib
from IPython.display import display, HTML

GPT_MODEL = "gpt-3.5-turbo"
client = OpenAI(
    api_key="",
)

async def get_chat_response(system_message: str, user_request: str, seed: int = None):
    try:
        messages = [
            {"role": "system", "content": system_message},
            {"role": "user", "content": user_request},
        ]

        response = client.chat.completions.create(
            model=GPT_MODEL,
            messages=messages,
            seed=seed,
            max_tokens=200,
            n=1,
            temperature=1,
        )
        response_content = response.choices[0].message.content
        system_fingerprint = response.system_fingerprint
        prompt_tokens = response.usage.prompt_tokens
        completion_tokens = response.usage.total_tokens - response.usage.prompt_tokens

        table = f"""

Response	{response_content}

System Fingerprint	{system_fingerprint}

Number of prompt tokens	{prompt_tokens}

Number of completion tokens	{completion_tokens}

        """
        # Print the HTML table content
        display(HTML(table))

        return response_content
    except Exception as e:
        print(f"An error occurred: {e}")
        return None

# This function compares two responses and displays the differences in a table.
# Deletions are highlighted in red and additions are highlighted in green.
# If no differences are found, it prints "No differences found."

def compare_responses(previous_response: str, response: str):
    d = difflib.Differ()
    diff = d.compare(previous_response.splitlines(), response.splitlines())

    diff_table = "
"
    diff_exists = False

    for line in diff:
        if line.startswith("- "):
            diff_table += f"
{line}
"
            diff_exists = True
        elif line.startswith("+ "):
            diff_table += f"
{line}
"
            diff_exists = True
        else:
            diff_table += f"
{line}
"

    diff_table += "
"

    if diff_exists:
        display(HTML(diff_table))
    else:
        print("No differences found.")

system_message = "You are a creative writing companion, aiding me in crafting captivating stories."
user_request = "Compose a thrilling short story about a time-traveling detective who solves perplexing mysteries in the streets of Victorian London, blending historical elements with a touch of the supernatural."

prev_response = await get_chat_response(
        system_message=system_message, user_request=user_request
    )

response = await get_chat_response(
        system_message=system_message, user_request=user_request
    )
    # The function compare_responses is then called with the two responses as arguments.
    # This function will compare the two responses and display the differences in a table.
    # If no differences are found, it will print "No differences found."
compare_responses(prev_response, response)

version detail ,
Name: openai
Version: 1.1.1
Summary: Client library for the openai API
Home-page:
Author:
Author-email: OpenAI <[support@openai.com](mailto:support@openai.com)>
License:
Location: /usr/local/lib/python3.10/dist-packages
Requires: anyio, distro, httpx, pydantic, tqdm, typing-extensions
Required-by: llmx

I am consistently getting system_fingerprint returned as None, just for a simple request such as
resp = openai.chat.completions.create(
          model="gpt-3.5-turbo",
          messages=[
              {
                  "role": "user",
                  "content": "Write me a haiku in pirate english"

              }
          ],
          temperature=0.7,
        )
print(resp.system_fingerprint)

None

If I specifically request one of the new models (e.g. gpt-4-1106-preview) then it is returned.  Can this be clarified in the documentation anywhere?

Thanks for the feedback, we'll try to clarify this in the documentation!
Since this repo is just for the Python library, not the API itself, I'll go ahead and close this issue for now, but we do hope to improve that.

Hi,
I am using openai==1.3.3
It is returning System fingerprint to None , on second call onwards

I am too getting System_Fingerprint----------->None. How to resolve it


Is autoscaling required for Priam?

We have an existing cluster in AWS that isn't in an autoscaling group.  Can we still use Priam?  It seems that we should be able to, but there's this:
NOTE: Your cluster name is inferred from your ASG name to fetch Priam properties.

@ysgard Priam assumes that your cluster is behind autoscaling group to ensure that new instances come up and priam can grab the dead token and start Cassandra automatically.

Closing this as we have bigger discussion going on #589


chore: bundle node util in node env too

There are 2 approaches, see first and second commit. In the first approach, we'll need to add the node module name every time we use a new module, in 2nd approach, we'll need to add the deps name every time we add a new deps and don't want to bundle it.
check discord channel for more context
fixes: #316

I was in vacation and after that I forgot about this pr, @favna applied your suggestion in the last commit


Invalid character 'ï' looking for beginning of value

Some generated files raise this error when starting krakend:
ERROR parsing the configuration file: Fatal error config file: While parsing config: invalid character 'ï' looking for beginning of value

It's not related to the content of the file but the Byte Order Mark (BOM) introduced to identify the file as UTF-8.
Temporary fix is to copy/paste the content in a new file, this usually fixes the problem as major editors don't introduce BOM. Or if your editor supports it, save the same file without BOM

Fixed in production (Make sure to refresh browser cache)

If someone is facing the same issue on windows,
1. Create new file in notepad++ using ctrl+n
2. Save file as krakend.json and use it. (Don't open it in vs code until extreme necessary)

Hello friends, can anyone help me, I am having an error with the Singbox program in every configuration file
decode config: invalid character 'l' looking
for beginning of value: row 1, column 1
It says: "Sing-box 1.9..0 rc 16


Updated Readme Section

References to other Issues or PRs or Relevant literature

Brief description of what is fixed or changed
Other comments

LGTM for now


Added new email template for full inbox notification.

Added new email template for a full inbox notification.
Main message in message.html.
README.md file also provided with pretext and objective.

@Silburfuchs, not all browsers accept classes for email messages, convert those into inline styling, then you should be good to go.

@Silburfuchs Also Please provide pictures of the email being rendered so we can add it to the email templates README.md file.

@Silburfuchs Thank you for the new template.


[DO NOT MERGE] Experimental support for Epiphan DVI2PCIe Duo on Windows 10

Closes #69
TODOs:

[ ] revert ccb8ef2
[ ] consider documenting / revising 39557f66c6a913a42fd3e213483d012bdc8e9692 c254fc67c096ba28bdd358d4f8a75bc0f70bd6a3 13a6f33251996648eec22ae620ca80eaf17e644c

Changes shown above (as of 16 Apr 2019) are not valid: git diff 69-support-for-epiphan-on-windows-10 experimental-windows on the command line shows:
diff --git a/doc/build.md b/doc/build.md
index 2bfe8dd..5b35da3 100644
--- a/doc/build.md
+++ b/doc/build.md
@@ -47,16 +47,15 @@ In addition, also the following two **BSD-3-incompatible** options are available

 ## Epiphan DVI2PCIe Duo

-`-D USE_EPIPHAN_DVI2PCIE_DUO=ON` (requires [OpenCV](tips.md#opencv) and [libVLC](tips.md#libvlc))
+`-D USE_EPIPHAN_DVI2PCIE_DUO=ON` (requires [libVLC](tips.md#libvlc), supports only [I420][i420] colour space captures)

-OpenCV and libVLC are needed for capturing in the BGRA and [I420][i420] colour spaces respectively.
-Both options are active by default.
-Append `-D USE_BGRA=OFF` or `-D USE_I420=OFF` to deactivate the respective option.
-
-Also Epiphan Video Grabber SDK can be used instead of libVLC:
+To enable BGRA colour space captures, please use Epiphan Video Grabber SDK instead of libVLC:
 `-D USE_EPIPHAN_DVI2PCIE_DUO=ON -D ENABLE_NONFREE=ON -D USE_EPIPHANSDK=ON` (requires zlib, pthreads and [Epiphan Video Grabber SDK](tips.md#epiphan-video-grabbing-sdk)).
 This option **makes GIFT-Grab undistributable**.

+Both colour spaces are active by default.
+Append `-D USE_BGRA=OFF` or `-D USE_I420=OFF` to deactivate the respective option.
+
 [i420]: https://wiki.videolan.org/YUV/#I420


Extract the content of flask-k8s to a separate package

Applicable spec:
Overview
Refactor and separate the contents of flask-k8s into a distinct package. Several modules have been adapted for use by other 12-factor applications other than just Flask.
Rationale
This modification is required to allow the charmcraft init command to generate a charm based on the flask-k8s charm without reproducing every file from the flask-k8s repository. Most source files will be incorporated as an independent Python package.
Juju Events Changes
None.
Module Changes
Most modules have been refactored and moved to the xiilib package.
Checklist

[x] The charm style guide was applied
[x] The contributing guide was applied
[x] The changes are compliant with ISD054 - Managing Charm Complexity
[x] The documentation is generated using src-docs
[x] The documentation for charmhub is updated
[x] The PR is tagged with appropriate label (urgent, trivial, complex)

Superseded by https://github.com/canonical/flask-k8s-operator/pull/70


2nd "restore" operation always uses default DB file locations no matter "Relocate all files" overriding

Issue Type: Bug

right-click in "Databases" section in the left "Connections" pane, choose "Restore"
choose "backup file" as a source
restore the backup, wait until it finishes successfully
one more time: right-click in "Databases" section in the left "Connections" pane, choose "Restore"
choose "backup file" as a source (you may choose the same backup file)
switch to "Files" tab, check "Relocate all files", type a folder path in both "Data file folder" and "log file folder", different from the default paths
go to "Options" tab, select "Overwrite the existing database (WITH REPLACE)"
start the restoration

Expected result:
the DB is restored successfully, DB files reside in the folders specified at "Files" tab
Actual result:
the restored DB files reside at the default locations
Azure Data Studio version: azuredatastudio 1.30.0 (59c4b8e90cf2d3a24bed72623197f10f8d090fdc, 2021-06-16T19:04:08.858Z)
OS version: Windows_NT x64 10.0.19041

System Info

Item
Value

CPUs
Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz (4 x 3000)

GPU Status
2d_canvas: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onoop_rasterization: enabledopengl: enabled_onprotected_video_decode: enabledrasterization: enabledskia_renderer: enabled_onvideo_decode: enabledvulkan: disabled_offwebgl: enabledwebgl2: enabled

Load (avg)
undefined

Memory (System)
15.89GB (3.89GB free)

Process Argv

Screen Reader
no

VM
0%

Extensions (3)

Extension
Author (truncated)
Version

profiler
Mic
0.11.0

azdata-sanddance
msr
3.2.0

poor-sql-formatter
WSR
0.1.0

I have this bug, too. Relocate all files not set new path properly

Hi @BurstX - I tested this with version 1.34.0 and did not see the same behavior.  Can you confirm if it's fixed for you?  Thanks!


Return nodes/documents associated with a response.

When returning a response, based on an index and query, e.g. response = index.query(query, response_mode="default"), it would be nice to have some traceback to the nodes and/or documents that contributed to the response (but not all nodes and documents that created the index). I can't really see a way to do this. Any thoughts would be appreciated.

If you look in the response, there should already be a source_nodes field that encapsulates this!

Thanks @emptycrown. I have used source_nodes, which appears to return all source nodes associated with the index, not just the nodes that generated the response. Ideally, I'd like the latter. For example, if a corpus is generated from books on Birds, Fish, and Mammals, and the query was, "How fast is an eagle", I'd like to return the formulated response, along with the Birds source.  How that makes sense.

source_nodes should be just the nodes that generated the response. by default the chunk sizes are quite big, so source_nodes may contain all the text in the document.
try setting chunk_size_limit=512 (or some other low number) and looking at the index.query source_nodes results

Ah, that makes sense. My oversight. Thanks @jerryjliu for this awesome repo!


Backport fixes for at.js

This PR fixes:

keyboard navigation not interfering with mouse
position the caret properly after pressing spacebar after @

@kencheeto

:+1:, poke around to see if writing a test is easy?


Fix markup and typos in readme

I noticed that some of the readme's tables and headings were rendered incorrectly on GitHub. This pull request fixes these issues together with some general typos in the readme.

Fixes markdown issues that caused some headings and tables to be rendered incorrectly.
Fixes some typos in the readme.

One typo fix is a duplicate of the one provided in #81. However, this pull request was not updated since Jan 25 so I thought I'd include the fix nonetheless. Therefore, if merged, this pull request closes #81.

Closing due to inactivity on the project.


CommsSerializer high CPU usage

Hello, we are using CommsSerializer to deserialize notifications for compliance recording bot. This method however can take up to a few seconds. Can we do something to reduce this time or optimize? When there is a lot of calls it results in quite high cpu usage.
private CommsNotifications GetGraphNotifications(string rawData)
{
    CommsNotifications result = null;
    try
    {
        #region "Initialization"
        if (string.IsNullOrEmpty(rawData))
        {
            return result;
        }
        #endregion

        Stopwatch stopwatch = new Stopwatch();
        stopwatch.Start();

        result = NotificationProcessor.ExtractNotifications(rawData, new CommsSerializer());

        stopwatch.Stop();
        _logger.LogDebug("GetGraphNotifications execution time: {0} ms", stopwatch.ElapsedMilliseconds);
    }
    catch (Exception ex)
    {
        ErrorAction(GetCurrentMethod(), ex);
    }
    return result;
}

The root cause of the Problem is the vague build CommsNotification-Object, the use of the object purely relies on AdditionalData, but other objects do also have Additional Data. The Additional Data object fields causes the Serealizer to first read the type field of the json objects in the notifications, then dynamically search for the class and create an instance of it. To improve this situation, the notifications would need to be more type-static, field types in the json should be inferred from field names and the type fields should not be included/needed for parsing notifications.
In practice, this means replacing AdditionalData with actual possible properties. While you can do this yourself, it makes your code very vulnerable to updates from Microsoft, which may rename, add, update, or change fields by simply sending you other requests without warning, because the additional data is flexible in responding to these changes.


Artifact Transformer. Asm(java 8) cannot parse java module info(java 9+) classes

Hello! I need assistance in resolving an issue related to artifact transformation in Gradle. I've encountered an error due to ASM (Java 8) being unable to process classes with Java module information (Java 9+).  If you have the opportunity to analyze the code and identify potential issues, I would appreciate your help. Thank you!   snippets of code: build.gradle - https://hastebin.com/share/nujemijoyu.javascript buildSrc/src/main/groovy/org/example/JavaModuleTransform.groovy - https://hastebin.com/share/ofiwevahow.java
Errors:
https://pastebin.com/pbnBXt0C
Java 8 Gradle 8.1.1

Hi @NikitaFeaucher. The error you shared looks like the problem is not (directly) related to artifact transforms. The stack points at ASMModParser:
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:439) ~[asm-debug-all-5.2.jar:5.2]
at net.minecraftforge.fml.common.discovery.asm.ASMModParser.<init>(ASMModParser.java:57) ~[ASMModParser.class:?]

That is using a very old version of ASM here (asm-debug-all-5.2). You should try to upgrade that somehow. ideally to asm-9.6 – implementation("org.ow2.asm:asm:9.6"). Unfortunately from what you shared I cannot see how this all plays together in your project.
Can you maybe share a complete reproducer project that I can try out?


Delegate calls by references instead of by value in #[union_fn] macro expansion

According to the compiler explorer this significantly improves the Rust/LLVM codegen of the Call[WithContext] impl of the generated opt type.
In essence the Call[WithContext] impl turns into a tail call under --release settings independent of the Args type in use by the #[union_fn] macro invocation.

Codecov Report

Merging #3 (efc4df2) into main (b4f93e5) will decrease coverage by 0.33%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main       #3      +/-   ##
==========================================
- Coverage   15.40%   15.07%   -0.34%
==========================================
  Files          13       13
  Lines        1947     1983      +36
==========================================
- Hits          300      299       -1
- Misses       1647     1684      +37

Impacted Files
Coverage Δ

macro/src/expand.rs
0.00% <0.00%> (ø)

src/lib.rs
23.10% <0.00%> (-0.76%)
:arrow_down:

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


Add support to Llama 3.1

Description & Motivation
In the Tensor Parallel example here while the proposed model is a Llama3 like model, the forward pass is different from the Llama3.1 model in the official code here, by example the Transformers's forward pass:
def forward(self, tokens: torch.Tensor, start_pos: int):
        _bsz, seqlen = tokens.shape
        h = self.tok_embeddings(tokens)
        self.freqs_cis = self.freqs_cis.to(h.device)
        freqs_cis = self.freqs_cis[start_pos : start_pos + seqlen]

        mask = None
        if seqlen > 1:
            mask = torch.full((seqlen, seqlen), float("-inf"), device=tokens.device)

            mask = torch.triu(mask, diagonal=1)

            # When performing key-value caching, we compute the attention scores
            # only for the new sequence. Thus, the matrix of scores is of size
            # (seqlen, cache_len + seqlen), and the only masked entries are (i, j) for
            # j > cache_len + i, since row i corresponds to token cache_len + i.
            mask = torch.hstack(
                [torch.zeros((seqlen, start_pos), device=tokens.device), mask]
            ).type_as(h)

        for layer in self.layers:
            h = layer(h, start_pos, freqs_cis, mask)
        h = self.norm(h)
        output = self.output(h).float()
        return output

so there is the additional support to the mask, etc.
This cause issues when trying to train and run the updated Llama3.1 model from that example.
While I have tried to adapt the llama31 code to the example code, removing the mask
    def forward(self, tokens: torch.Tensor, start_pos: int):
        _bsz, seqlen = tokens.shape
        h = self.tok_embeddings(tokens)
        self.freqs_cis = self.freqs_cis.to(h.device)
        freqs_cis = self.freqs_cis[start_pos : start_pos + seqlen]

        mask = None
        if seqlen > 1:
            mask = torch.full((seqlen, seqlen), float("-inf"), device=tokens.device)

            mask = torch.triu(mask, diagonal=1)

            # When performing key-value caching, we compute the attention scores
            # only for the new sequence. Thus, the matrix of scores is of size
            # (seqlen, cache_len + seqlen), and the only masked entries are (i, j) for
            # j > cache_len + i, since row i corresponds to token cache_len + i.
            mask = torch.hstack(
                [torch.zeros((seqlen, start_pos), device=tokens.device), mask]
            ).type_as(h)

        for layer in self.layers.values():
            #h = layer(h, start_pos, freqs_cis, mask)
            h = layer(h, freqs_cis)
        h = self.norm(h)
        output = self.output(h).float()
        return output

I'm not sure this is correct in inference infact I 'm getting a number of bad generated tokens from my generation function
from typing import Optional
def text_completion(tokenizer, model, prompts: list, temperature: float = 0.6, top_p: float = 0.9, max_gen_len: Optional = None):
        if max_gen_len is None:
            max_gen_len = max_seq_len - 1
        # Convert each prompt into tokens
        prompt_tokens = [tokenizer.encode(prompt, add_bos=True, add_eos=False) for prompt in prompts]
        # Make sure the batch size is not too large
        batch_size = len(prompt_tokens)
        assert batch_size <= max_batch_size, f"batch size must be less than or equal to {max_batch_size}"
        max_prompt_len = max(len(prompt) for prompt in prompt_tokens)
        # Make sure the prompt length is not larger than the maximum sequence length
        assert max_prompt_len <= max_seq_len, f"prompt length must be less than or equal to {max_seq_len}"
        total_len = min(max_seq_len, max_gen_len + max_prompt_len)

        # Create the list that will contain the generated tokens, along with the initial prompt tokens
        pad_id = tokenizer.pad_id
        tokens = torch.full((batch_size, total_len), pad_id, dtype=torch.long, device=device)
        for k, t in enumerate(prompt_tokens):
            # Populate the initial tokens with the prompt tokens
            tokens[k, : len(t)] = torch.tensor(t, dtype=torch.long, device=device)

        eos_reached = torch.tensor([False] * batch_size, device=device)
        prompt_tokens_mask = tokens != pad_id # True if the token is a prompt token, False otherwise
        cur_iterator = tqdm(range(1, total_len), desc="Generating tokens")
        for cur_pos in cur_iterator:
            with torch.no_grad():
                logits = model.forward(tokens[:, cur_pos-1:cur_pos], cur_pos)
                #logits = model.forwar(tokens[:, cur_pos-1:cur_pos])
            if temperature > 0:
                # The temperature is applied before the softmax
                probs = torch.softmax(logits[:, -1] / temperature, dim=-1)
                next_token = _sample_top_p(probs, top_p)
            else:
                # Greedily select the token with the max probability
                next_token = torch.argmax(logits[:, -1], dim=-1)

            next_token = next_token.reshape(-1)
            # Only replace token if it is a padding token
            next_token = torch.where(prompt_tokens_mask[:, cur_pos], tokens[:, cur_pos], next_token)
            tokens[:, cur_pos] = next_token
            # EOS is reached only if we found an EOS token for a padding position
            eos_reached |= (~prompt_tokens_mask[:, cur_pos]) & (next_token == tokenizer.eos_id)
            if all(eos_reached):
                break

        out_tokens = []
        out_text = []
        for prompt_index, current_prompt_tokens in enumerate(tokens.tolist()):
            # Cut to the EOS token, if present
            if tokenizer.eos_id in current_prompt_tokens:
                eos_idx = current_prompt_tokens.index(tokenizer.eos_id)
                current_prompt_tokens = current_prompt_tokens[:eos_idx]
            out_tokens.append(current_prompt_tokens)
            out_text.append(tokenizer.decode(current_prompt_tokens))
        return (out_tokens, out_text)

the output token emitted are eos, the input token from the string The and a sequence of 0 padded token
Generating tokens: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 127/127 [00:04<00:00, 31.37it/s]
([[128000, 791, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], ['The!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'])

Pitch
Add full support to Llama3 updated model code from meta-llama here
Alternatives
adapt the current code to support masking
Additional context
No response
cc @borda

[UPDATE]
My first naive attempt in adding Llama3.1 resulted in a failed initialization due to the fairscale integration of missing the _MODEL_PARALLEL_GROUP initialization for the parallel group
    self.tok_embeddings = VocabParallelEmbedding(
  File "/home/coder/.local/lib/python3.8/site-packages/fairscale/nn/model_parallel/layers.py", line 118, in __init__
    self.num_embeddings, get_model_parallel_rank(), get_model_parallel_world_size()
  File "/home/coder/.local/lib/python3.8/site-packages/fairscale/nn/model_parallel/initialize.py", line 157, in get_model_parallel_rank
    return torch.distributed.get_rank(group=get_model_parallel_group())
  File "/home/coder/.local/lib/python3.8/site-packages/fairscale/nn/model_parallel/initialize.py", line 128, in get_model_parallel_group
    assert _MODEL_PARALLEL_GROUP is not None, "model parallel group is not initialized"
AssertionError: model parallel group is not initialized

Now of course in the context of distributed data and model If I try to init it manually like:
def setup_model_parallel(rank, master_addr, master_port, world_size, backend='nccl') -> Tuple[int, int]:
    '''
        this will not work with LightningModule
    '''
    local_rank = int(os.environ.get("LOCAL_RANK", "0"))
    world_size = int(os.environ.get("WORLD_SIZE", "4"))
    print("local_rank:", local_rank, "world_size:", world_size)

    torch.distributed.init_process_group(backend)
    initialize_model_parallel(world_size)
    torch.cuda.set_device(local_rank)

    # seed must be the same in all processes
    torch.manual_seed(1)
    return local_rank, world_size

and
import torch.multiprocessing as mp
local_rank, world_size = setup_model_parallel()
mp.spawn(setup_model_parallel, args=(master_addr,master_port,world_size,), nprocs=world_size)
model = Llama3()

I will get a networking error EADDRINUSE, message: address already in use
    torch.distributed.init_process_group(backend)
  File "/home/coder/.local/lib/python3.8/site-packages/torch/distributed/c10d_logger.py", line 79, in wrapper
    return func(*args, **kwargs)
  File "/home/coder/.local/lib/python3.8/site-packages/torch/distributed/c10d_logger.py", line 93, in wrapper
    func_return = func(*args, **kwargs)
  File "/home/coder/.local/lib/python3.8/site-packages/torch/distributed/distributed_c10d.py", line 1361, in init_process_group
    store, rank, world_size = next(rendezvous_iterator)
  File "/home/coder/.local/lib/python3.8/site-packages/torch/distributed/rendezvous.py", line 258, in _env_rendezvous_handler
    store = _create_c10d_store(master_addr, master_port, rank, world_size, timeout, use_libuv)
  File "/home/coder/.local/lib/python3.8/site-packages/torch/distributed/rendezvous.py", line 185, in _create_c10d_store
    return TCPStore(
RuntimeError: The server socket has failed to listen on any local network address. useIpv6: 0, code: -98, name: EADDRINUSE, message: address already in use

because I assume this has already been assigned by Lightning distributed when I did
strategy = FSDPStrategy(
                timeout=CUSTOM_TIMEOUT,
                cpu_offload=True,
                activation_checkpointing_policy=encoder_decoder_policy,
                auto_wrap_policy=auto_wrap_policy,
                # for numerical stability mixed precision keeps the model weights in full float32 precision
                # while casting only supported operations to lower bit precision.
                mixed_precision=MixedPrecision(param_dtype=torch.torch.bfloat16, cast_forward_inputs=True),
                process_group_backend="nccl",
                sharding_strategy="FULL_SHARD"
            )
trainer = L.Trainer(
        logger=logger,
        # The number of training batches (4) is smaller than the logging interval Trainer(log_every_n_steps=50).
        # Set a lower value for g_every_n_steps loif you want to see logs for the training epoch.
        log_every_n_steps=1,
        # '16-true', '16-mixed', 'bf16-true', 'bf16-mixed', '32-true', '64-true', 64, 32, 16, '64', '32', '16', 'bf16')
        precision="bf16-true",
        callbacks=[checkpoint_callback],
        accelerator="cuda",
        devices=devices,
        num_nodes=num_nodes,
        strategy=strategy,
        limit_train_batches=10,
        max_epochs=1,
        deterministic=True
    )

So I assume this cannot be done manually, so how to add support to fairscale of parallel layers
from fairscale.nn.model_parallel.layers import (
    ColumnParallelLinear,
    RowParallelLinear,
    VocabParallelEmbedding,
)

within Lightning?


[SPARK-39533][ML] Deprecate scoreLabelsWeight in BinaryClassificationMetrics

What changes were proposed in this pull request?
Deprecate scoreLabelsWeight in BinaryClassificationMetrics
Why are the changes needed?
scoreLabelsWeight in BinaryClassificationMetrics is a public variable, but it should be private since it is only for internal purpose.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
existing UT

@srowen hmm, I just think it is an internal variable, should not be exposed to end users, like other priavte variables in MulticlassMetrics and so on. However, it had been public for a long time...

Right, it was still public in the binary code. If there's an easy way to retain source compatibility, that's great, otherwise OK

since it is only exposed in the .mllib side, and it is not listed in the official documents  , so I think it seems relatively safe to remove it.
may I also ask for your opinions? @huaxingao @WeichenXu123

Even though this method is not listed in the official doc, there still might be a chance a user calls this directly. I think we probably need to document this in release notes if we want to remove?

OK, maybe we can first deprecate it now, and remove it in the future.

Merged to master


Clarification for runtime vs standalone

Removed some redundant language by including all the details in the bullet point comparison. Also added a note about Vuex requiring the standalone-build. Hopefully this is a bit more complete and easier to read.

FYI Vuex store does not require the standalone build. If it does then it's a bug.

oh, sorry...

I hit this when I imported the runtime only build, this.$store was undefined:  https://github.com/vuejs/vuex/issues/409

@ubershmekel I think you have some misunderstanding about the builds. The recommended solution is configuring the alias via your bundler so that import Vue from 'vue' always points to the desired build everywhere in your application. We explicitly tell you to NOT do import Vue from 'vue/dist/vue.common.js.

I currently have an alias like vue: 'vue/dist/vue.esm.js', and am using Webpack 2. I am really lost as to why this.$store would not be be defined while this.$router is. I am passing both to constructor of Vue and am doing use for both plugins.