Dagger fails if invalid or expired GHCR token is present in ~/.docker/config.json file

Problem
Since dagger pulls the engine image from ghcr, it'll try to use a token if present in the ~/.docker/config,json file and if invalid or expired, it'll fail with an error similar to this one:
 go run main.go
panic: EOF: Error: resolving image digest: GET https://ghcr.io/token?scope=repository%3Adagger%2Fengine%3Apull&service=ghcr.io: DENIED: denied

Which can be difficult for users to troubleshoot.
Alternatives
1 Do nothing.
2 Better error handling and tell the user to fix the token issues themselves.
3 If token issue, try "without" a token as long as the default engine image is used (no _EXPERIMENTAL_DAGGER_RUNNER_HOST).
Thoughts?
I think we could start with 2 since 3 will require some more custom token code handling as all the pulling logic is mostly being handled by docker run today AFAIK. Please correct me if I'm wrong @sipsma
cc @shykes @sipsma

Until we had proper support for authenticated pull: #4242 (instead of relying on docker auth), we should at least display a proper error message. I would discuss/implement the rest as part of #4242.
Do we have a record of users impacted? Raise the priority nonetheless.

Thx for the reply Sam. As you know, the engine image pull and the from step follow two very different code paths to perform that action. Just bringing this up since #4242 does not refer to this first scenario which is the one that triggered this issue.
Shall we expand the scope of #4242 to also cover this case? In the meantime I'll just add some basic error handling for this particular case

Do we have a record of users impacted? Raising the priority nonetheless.

I was an impacted user :). I was trying to use dagger for something today and took me a while to find the reason why it wasn't working.

I agree it can be solved as part of #4242, my point was that until auth is implemented natively in dagger, this should at least be handled from an error handling perspective when the token expires, to avoid confusion.

Impacted as well today.

@dolanor @TomChv If one of you have some bandwidth, could you take a look? In particular not sure if it should be part of #4242 or if there is a stopgap for handling this error.

Context
It took me some time to figure out how to reproduce this error.
My ~/docker/config.json file was relying on computer credentials:
{
	"auths": {
		"docker.com": {},
		"ghcr.io": {
                       "auth": "Z3JvdXZpbGxlOndyb25nCg==",
                 },
		"https://index.docker.io/v1/": {},
	},
	"credsStore": "desktop",
	"experimental": "disabled",
	"stackOrchestrator": "swarm"
}

The above works because docker relies on my credsStore.
To reproduce:
{
        "auths": {
                "ghcr.io": {
                        "auth": "Z3JvdXZpbGxlOndyb25nCg=="
                }
        }
}

PR on the way, impacting

@dolanor @TomChv If one of you have some bandwidth, could you take a look? In particular not sure if it should be part of #4242 or if there is a stopgap for handling this error.

This will be impacted by https://github.com/dagger/dagger/pull/4489 (issue: https://github.com/dagger/dagger/issues/4484).
New behavior after merge: whenever the pull fails, it will first try to see if a local engine is currently running and use it if it present. Otherwise it will fail.
Solution
After checking, it shall not be part of #4242, as it touches the imageprovider part of our codebase: https://github.com/dagger/dagger/blob/main/internal/engine/docker.go#L48-L52
As it was a pretty niche use-case (on my side). The most logical solution is to parse the error message and make it clearer ? (maybe by checking for DENIED in error message)

After checking, it shall not be part of #4242, as it touches the imageprovider part of our codebase: https://github.com/dagger/dagger/blob/main/internal/engine/docker.go#L48-L52

This was my initial thought here: https://github.com/dagger/dagger/issues/4381#issuecomment-1382606068

@laupse, would you be interested in contributing to this one too ? As your PR https://github.com/dagger/dagger/pull/4489 seems to be in a mergeable state and fixing this one is just managing the DENIED use-case to orient the user ?

@laupse, would you be interested in contributing to this one too ? As your PR #4489 seems to be in a mergeable state and fixing this one is just managing the DENIED use-case to orient the user ?

(Don't want to force you at all ahah, it just seems to be a logical follow-up)

I can ofc. Correct me if i wrong, we want to give a nice message indicating to check the docker creds if we encounter a DENIED ?

I can ofc. Correct me if i wrong, we want to give a nice message indicating to check the docker creds if we encounter a DENIED ?

Yes exactly, that seems to be an acceptable solution given the scope of this issue 😇

Closed by #4489


Resize is ignoring $mode parameter

Q
A

Bug?
maybe

New Feature?
no

Version Used
0.6.1

FFmpeg Version
FFmpeg 5.4.0

OS
Windows 10

Actual Behavior
Video gets anamorphosis at all resize modes. It looks like mode changing is ignoring
Expected Behavior
I want to resize video using mode 'inset' without proportions anamorphosis.
Steps to Reproduce
Here is the code I'm using:
$ffmpeg = FFMpeg::create([
    'ffmpeg.binaries' => 'D:\bin\ffmpeg\ffmpeg.exe',
]);
$video = $ffmpeg->open($path . $filename);

$video->filters()
    ->resize(new \FFMpeg\Coordinate\Dimension(640, 360), \FFMpeg\Filters\Video\ResizeFilter::RESIZEMODE_INSET)
    ->synchronize();

The output is same with any mode like I'm using the 'fit' mode.

Hi @aziev,
Could you try using a string instead of the const?
$video->filters()
    ->resize(new \FFMpeg\Coordinate\Dimension(640, 360), 'inset')
    ->synchronize();

I'll try to see on my side why this doesn't work...

@Romain thank you for the response,
If I using string 'inset' it has the same behavior

Thanks for this feedback.
I've tried this filter on my side, it works great:
$ffmpeg = FFMpeg\FFMpeg::create([
            'ffmpeg.binaries'  => $this->container->getParameter('ffmpeg_ffmpeg_path'), // the path to the FFMpeg binary
            'ffprobe.binaries' => $this->container->getParameter('ffmpeg_ffprobe_path'), // the path to the FFProbe binary
            'timeout'          => $this->container->getParameter('ffmpeg_timeout'), // the timeout for the underlying process
            'ffmpeg.threads'   => $this->container->getParameter('ffmpeg_threads'),   // the number of threads that FFMpeg should use
], $logger);

$video = $ffmpeg->open('/path/to/test.mp4' );

$video
            ->filters()
            ->pad(new FFMpeg\Coordinate\Dimension(300, 300), \FFMpeg\Filters\Video\ResizeFilter::RESIZEMODE_INSET)
            ->synchronize();

        $video
            ->save(new FFMpeg\Format\Video\X264(), '/path/to/test-resized.mp4');

Hi I have quite similar issue,
Seems like the \FFMpeg\Filters\Video\ResizeFilter::RESIZEMODE_FIT mode has no chance to work since FFmpeg by default tries to save source video aspect ratio.
In order to resize to precise resolution (is that what RESIZEMODE_FIT should do?) the filter would have to use
-filter_complex 'scale=w=1280:h=720,setsar=1/1'

instead of currently used
-s 1290x720

Hi @paq85,
Yes, RESIZEMODE_FIT intends to resize a video to a specific resolution.
Could you point me to the FFMPEG doc of the filter you're talking about? I've been browsing it but with no luck. I'd like to compare it to what the actual FFMPEG Resize filter does, to understand the differences between both.
Thanks


File Handling in Java: A Beginner's Guide

Title Of Blog Post : File Handling in Java: A Beginner's Guide
Short Description of what is expected : This blog post aims to provide a beginner-friendly introduction to file handling in Java. Readers will learn how to read from and write to files using Java's file input/output operations, and gain a fundamental understanding of working with files in Java programming.
Category : Java Programming
Tags : Java File Handling, Beginners, File Input/Output

hey @holygrimm can you assign this issue to me.


Project status

It seems that this project is inactive for about two years.
There're many issues are waiting for concerning and pull requests need to be reviewed and merged.
@dapphp, is it possible to add more collaborators to join this repository :)?

This comment about sums it up. I will gladly add anyone as a collaborator if they are interested.

@dapphp in the light of the above-mentioned comment, I think it would be a good idea to make it more explicit that this project is no longer maintained / abandoned and looking for someone to take it over. I would suggest at least updating the repository's description and adding a note on the README file here on GitHub, as well as the home page at https://www.phpcaptcha.org/.
Anyway, sorry to hear that, and many thanks for the time and efforts you invested into this, securimage has served us well over the years and it is sad to see it go.

I recommend to read @dapphp 's post https://github.com/dapphp/securimage/issues/66#issuecomment-636279862

To follow.

It is a little alive...

Closed because it's alive...

@peter279k: I have requested a new build:

https://github.com/dapphp/securimage/issues/117


Update iot-hub-devguide.md

Correct a type error under "OriginalMessageId" field.
Correct the example about the JSON feedback message.

Hi @ppatierno, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
We will now validate the agreement and then real humans will evaluate your PR.
TTYL, AZPRBOT;


Canvas support and minor improvements

I was recently browsing for an opensource solution to publish my obsidian wiki with canvases and finally came up to taking your https://github.com/TuanManhCao/digital-garden and updating it with https://github.com/zachdoty/BrainPress ideas to enable canvases
I forked digital-garden and made my own solution (https://github.com/mrdrprofuroboros/digital-garden) which serves me well, but is definitely an ad-hog for my purposes, so I'd like to prepare a normal PR for everybody.
This is a proposal list for what I've done in my fork and I'd like to involve you in prioritization and discussion:
1st priority:

nextjs 13 (needed for rectflow for canvases)
caching (current backend architecture reads filesystem too many times. it would be much better to rewrite it a bit more accurate, but a simple cache in couple of places speeds up building a magnitude)
gfm (github flavour markdown, external link were not recognized in current build)
customizable index page (I need it to be a canvas page in my project and I'd suggest making a config file which will be parametrizing the index page name

2nd priority:

docker (I'm deploying it to a vps with docker, made a docker build + compose with traefik proxy for auth if needed)
canvases support (with reactflow) - needs discussion on the essential steps - supporting the whole functionality of obsidian would be too much work, needs prioritization here. my own request is rather simple - I need a link-type cards (without iframe previews) that can be connected with simple arrows, have colors. each card has a href link to a corresponding markdown page
I'd suggest changing slug system - current one is a bit hacky and seem too bulky + the urls aren't pretty enough.
strip .md extension from file names in a tree
update favicon =)

3rd priority:

ideally - split tree view and pages to be separately loaded to minimize page size (I have several hundreds of pages and it gets fat pretty fast)
full typescript migration
further work on canvas support (files, iframes)
search! (https://github.com/turtton/volglass has a search and it is a great helper)
dark mode (not so essential for me, but a nice-to have)

what do you think about it? if there is something more important you'd suggest including in that list?

Hi Dmitry,
Thanks for your very details write up. I agree with most of the items that you have above. I think I would like to approach building MindStone out in a few key principles below:

It should be easy to deploy, and lean toward free options like: Vercel, Netlify, etc. Which allow user to just set up the project on Github, and just point Vercel or Netlify to the repo, hit deploy and have everything up. In short, deployment should be as simple as possible
It should use easy to use tech stack, in our case, I think it's a safe bet to use NextJS and Typescript (although type script might add a little bit of friction for new people, since its getting more and more popular and has great value to improve the project in the future so I think. NextJS + Typescript is probably the way to go here
Let's focus on just a few key features, and do it well.

Ok, so circling back to your suggestions, I would love to have:
First Priority

NextJS 13 upgrade and maybe with basic typescript support.
Bug fixes:

Issue menu navigation on mobile

Second priority:

Better slug system as you said, but getting this one right is a bit tricky, since there are many edge cases, and we want to use some human-readable format but also avoid name conflicts
strip .md extension from file names in a tree => Yes, since it's shouldn't be too difficult
Canvases support (with reactflow) -, yes go ahead, and do this, but I would love to make this one optional if possible.
GFM (github flavour markdown, external link were not recognized in current build)

Some other items I think are lower priority are:

Improve caching, from my experience, only if I work in local environment, this is an issues. Otherwise, when I tested deploying with some large collection of notes like Nick Milo's template, Vercel can still handle it. So I would worry about performance later on.
Docker support, I would love to keep deployment simpler, but if you already get it working feel free to add it, but also add a clear instructions for people who are not technical savvy enough to deploy with docker.
Search, yeah super awesome if we can add it in, but let's keep in mind that it should be a free solution and easy enough to build :D
Dark mode, yeah, would be nice.

Also here are a few other things I wanted to build when I started
🎯 Obsidian, Notion, VSCode Plugin
🎯 Page Preview (like Obsidian Core plugin)
🎯 Andy Sliding pane
🎯 Full text search with Cmd + K
🎯 Infinite canvas for browsing through notes and connections
Thanks Dmitry, hope this is helpful. Looking forward to see your's PR.


GUI-NX [v-guinx-18.01.22] - Generate/Load C.A.-Text is not user-intuitive.

I'm submitting a ...

[ ] bug report
[ ] feature request
[ ] support request
[x] improvement

Informational text for users is not in the best form, what text should be inserted ? - not intuitive

Please tell us about your environment:

Version: v-guinx-18.01.22
Environment: [docker-compose]
Operating system: [Ubuntu 16.04]

Verificar também na criação de certificado usando csr, e usar meu certificado.


Get image from disk without caching it in memory

I was using the following code to get the image from the disk cache:
YYImageCache.sharedCache().getImageForKey(diskCacheKey, withType: .Disk)
After fetching a bunch of images I discovered that the memory usage was highly increased. A bit of searching revealed it was due to this line in getImageForKey method.
For now to reduce the memory usage I must add the following line after each getImageForKey call:
YYImageCache.sharedCache().memoryCache.removeObjectForKey(diskCacheKey)
So, I have a suggestion: I guess, it would be more convenient to have a parameter like needsMemoryCaching to control how the images are fetched from the disk cache. Or maybe even a separate method like getImageFromDiskForKey which would return an image without caching it in memory.
Best regards.

You may set the memory cache limit with these code:
YYImageCache.sharedCache().memoryCache.costLimit = 20 * 1024
or you can disable the memory cache:
YYImageCache.sharedCache().memoryCache.countLimit = 0
If you want get a image from disk cache, you may use:
let key = YYWebImageManager.sharedManager().cacheKeyForURL(url)
let image = YYImageCache.sharedCache().diskCache.objectForKey(key) as! UIImage

Oh, it turns out I've overlooked the fact that by default the memory cache has no limits. I have configured the cost limit as per your suggestion and it works fine now. Thanks for clarifications!


sky.Image is backed by SkBitmap (deprecated) instead of SkImage

From @vlidholt on June 23, 2015 21:28
In the bindings layer the sky.Image is backed by SkBitmap instead of SkImage. SkImage is a newer API and offer optimizations that aren't available through SkBitmap.
Copied from original issue: domokit/mojo#265

From @collinjackson on June 23, 2015 21:33
The decoding happens in https://github.com/domokit/mojo/blob/master/sky/engine/core/loader/CanvasImageDecoder.cpp
Right now we're calling decoder->frameBufferAtIndex(0)->getSkBitmap()
If there is an easy way to get an SkImage instead that would be great

From @reed-at-google on June 23, 2015 21:40
If I make modifications to the imagedecoders, should that be directly here, or if they are updated in chromium/blink, will those changes be "merged" back into mojo?

From @eseidelGoogle on June 23, 2015 22:19
We are completely forked from Blink. :)  We don't merge anything from Blink.  The mojo project occasionally merges a couple directories from Chromium:
https://github.com/domokit/mojo/wiki/Directory-guide

From @collinjackson on June 23, 2015 21:43
That is a good question for @abarth or @eseidel

We now use SkImage.


Bump Quarkus to 3.5.0

Please check the relevant options

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[x] Dependency update
[ ] Refactoring
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] This change requires a documentation update
[ ] This change requires execution against OCP (use run tests phrase in comment)

Checklist:

[x] Example scenarios has been updated / added
[x] Methods and classes used in PR scenarios are meaningful
[x] Commits are well encapsulated and follow the best practices

run tests

Hmm, you marked this as "require OCP run" and I merged it without it. will see soon enough in weekly's, never mind.

Hmm, you marked this as "require OCP run" and I merged it without it. will see soon enough in weekly's, never mind.

I did run tests, see above. Everything was green.

hmm, but I can see them in this tab

looks like a GH bug to me.


Add section to wiki for testing with product flavors

I just realized that we don't seem to have anything on our wiki on how to test the app (as far as I can see). With #857 merged, I think it would be good to have a page on the wiki explaining to newcomers how this works, so that people don't send bad images to real Commons servers, or feel like they can't do any testing because they don't have proper images to upload.

Should it cover things like these for the beta site/flavor?

Beta site: https://commons.wikimedia.beta.wmflabs.org/

Beta site's account creation: https://commons.wikimedia.beta.wmflabs.org/w/index.php?title=Special:CreateAccount
Beta site's upload form: https://commons.wikimedia.beta.wmflabs.org/w/index.php?title=Special:UploadWizard

What to upload:

Take a picture with camera (emulator's pseudo camera should give you images of a moving square)
Find a public domain image and copy it from https://commons.wikimedia.org/wiki/Category:Public_domain (and probably a good idea to shrink images before uploading for quicker response during testing)

@whym Looks good to me. I think we could also emphasize that with the beta flavor, it's okay to keep uploading duplicate images or bad images as they won't be sent to the actual Commons server?

I would like to work on this :)

@sepicoder It is yours. :)


Create Codecov reports

create Realm tests;
setup Jacoco and Codecov report;
add Codecov badge to readme.md

Codecov Report

:exclamation: No coverage uploaded for pull request base (master-2.0@0a7f412). Click here to learn what that means.

@@             Coverage Diff             @@
##             master-2.0   #124   +/-   ##
===========================================
  Coverage              ?     0%
===========================================
  Files                 ?     32
  Lines                 ?   2221
  Branches              ?    307
===========================================
  Hits                  ?      0
  Misses                ?   2221
  Partials              ?      0

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 0a7f412...9df163c. Read the comment docs.


[Improvement] Use Content-Disposition to Name Downloaded File

When using the "Download after Send" feature it would be convenient if the Content-Disposition header were inspected for a filename property. If it exists, use the value for the name of the downloaded file. Otherwise do whatever Insomnia currently does. This would make it easier to open the file after download since it will have the proper extension, etc., if provided by the server.

Nice suggestion @SingleShot !


Faster loading

Makes the duration attribute of MultiTrack a property so it is only computed when accessed. Considerable speed up in initializing a MultiTrack object.

@justinsalamon can you confirm that this solves #68 ?

Coverage increased (+0.02%) to 79.752% when pulling a12866d166f6cf6346affbb60d06b2da24b14677 on faster-loading into cd49449ff4fca87db328fcb7078644e1825fd67a on master.

Just gave it a spin, dramatically better, thanks!!


feat: remove storage depth

Checklist

[ ] I have read the coding guide
[ ] My change requires a documentation update and I have done it
[ ] I have added tests to cover my changes.

Description

Motivation and context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

This change is

might be a missing lock in one of the dm/export_test functions?
otherwise looks great


Currencies in .convertlist are listed twice

This is on the public Nadeko bot. Most of the currencies seem to be listed twice.

Verified with selfhost.
units.json doesn't list currencies twice....
Random thing that probably doesn't matter: SKK is the one that doesn't repeat, also happens to be the last on in units.json 🤔 .

@Kwoth label as bug ^_^ ?


downloads require logged in google account

the commands on https://www.semi.network/knowledge-base/implement/weaviate/#download-binary requires you to be logged in google. So from command line they always fail. is there also a real public option, without the need to be logged into a google account?

Obsolete.


improve docs

Coverage remained the same at 100.0% when pulling 96f6a6ff5868d69f0f870d11dcb2789fc5d5521a on improve_docs into 6de3ecb191b840e56906952a8573937b44bc16ec on main.


Dao error mechanism is error prone

in kong/dao/error.lua
  local t = {
    is_dao_error = true,
    [err_type] = true,
    message = err
  }

the [err_type] = true line above is akward.
Creating an error of type constants.DATABASE_ERROR_TYPES.DATABASE for example can now be tested using if my_error.database then ... (the constants table defines the values as lowercase)
Shouldn't that be my_error.DATABASE (uppercase) as it is a constant, and make it explicit to the reader as such.
But even then it violates DRY, the code is littered with magic values this way. The above exmaple uses 2 magic values per error type, DATABASE and database in this case.
Proposal:
Introduce a type field and then use if my_error.type == constants.DATABASE_ERROR_TYPES.DATABASE then ...
or shorter;
local dberrors = require("kong.constants").DATABASE_ERROR_TYPES

if my_error.type == dberrors.DATABASE then ...

This is more verbose, but less error prone when combined with an access check on constants.DATABASE_ERROR_TYPES. (a metatable that trows an error when accessing an non-existing key) This will quickly catch any typos in the magical values.

My original thought too but @thefosk wanted it to contain a Boolean so that it could be less verbose.

If you modify the error metatable and include a comparison method, I think we can reduce it further to;
local dberrors = require("kong.constants").DATABASE_ERROR_TYPES

if my_error == dberrors.DATABASE then ...

(maybe easier to make the error types tables with metatables in that case)

no longer applicable


ferdi: 5.6.2 -> 5.6.3

Motivation for this change
ChangeLog: https://github.com/getferdi/ferdi/releases/tag/v5.6.3
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
21.11 Release Notes (or backporting 21.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 145569 run on x86_64-linux 1

1 package built:

ferdi

Minimal testing seems to look fine.

Since this update, I can't open Ferdi by left clicking the icon in the tray menu and even right click in the menu "Show Ferdi" doesn't show the window. Only calling it with dmenu/rofi or from terminal works to open then window when ferdi is running but in minimized to tray.
Running it from terminal and clicking the tray icon show:
TypeError: Cannot read properties of undefined (reading 'isMinimized')     at Object.<anonymous> (/nix/store/8f0h8kmzkmvypmy4fzwdiqg3l5blc3vh-ferdi-5.6.3/opt/Ferdi/resources/app.asar/lib/Tray.js:1:1853) (Fixed in: https://github.com/getferdi/ferdi/releases/tag/v5.6.4-nightly.7)
Should we update to the nightly, revert the update or wait for 5.6.4? :)

Since this update, I can't open Ferdi by left clicking the icon in the tray menu and even right click in the menu "Show Ferdi" doesn't show the window. Only calling it with dmenu/rofi or from terminal works to open then window when ferdi is running but in minimized to tray.
Running it from terminal and clicking the tray icon show: TypeError: Cannot read properties of undefined (reading 'isMinimized') at Object.<anonymous> (/nix/store/8f0h8kmzkmvypmy4fzwdiqg3l5blc3vh-ferdi-5.6.3/opt/Ferdi/resources/app.asar/lib/Tray.js:1:1853) (Fixed in: https://github.com/getferdi/ferdi/releases/tag/v5.6.4-nightly.7)
Should we update to the nightly, revert the update or wait for 5.6.4? :)

Looking at the changelog from 5.6.3, I think reverting would be a security issue (there was a Electron upgrade in 5.6.3, also some security changes).
So I would prefer to wait 5.6.4, unless this is really an issue for you. Than I think upgrading to nightly would be better.

Thanks for the fast response, sounds reasonable to not downgrade!
Personally I upgraded to the nightly on my machine through an overlay and could provide a PR for it if wanted - but I'm also fine with waiting for 5.6.4 :) Now it's even documented for others having the issue 👍🏻

OK, it doesn't seem as if there's a reasonable way to "inject" the patch into the binary, so I agree that we should wait for the next release.


Make functions in angle.rs more generic

Allows writing rad(1) + deg(45).
Allows using cos/sin/etc. with degrees as well.

Nice! Ready to merge?

Yes


Issues with programs that spawn child windows

Hi! I've stumbled across this issue while using KeePassXC, specifically when clicking on buttons that spawn child windows, such as the password generator.
With hyprctl clients:
This is the main window, which is obviously locked when a modal window is on:
Window 5d0c00f43390 -> Passwords - KeePassXC:
	mapped: 1
	hidden: 0
	at: 2112,1279
	size: 1536,864
	workspace: -93 (special:scratch_keepassxc)
	floating: 1
	monitor: 1
	class: org.keepassxc.KeePassXC
	title: Passwords - KeePassXC
	initialClass: org.keepassxc.KeePassXC
	initialTitle: Passwords.kdbx [Locked] - KeePassXC
	pid: 43896
	xwayland: 0
	pinned: 0
	fullscreen: 0
	fullscreenmode: 0
	fakefullscreen: 0
	grouped: 0
	swallowing: 0
	focusHistoryID: 3

This is the child (modal) window created:
Window 5d0c00f6ad90 -> Generate Password:
	mapped: 1
	hidden: 0
	at: 2112,2160
	size: 1536,864
	workspace: -93 (special:scratch_keepassxc)
	floating: 1
	monitor: 1
	class: org.keepassxc.KeePassXC
	title: Generate Password
	initialClass: org.keepassxc.KeePassXC
	initialTitle: Generate Password
	pid: 43896
	xwayland: 0
	pinned: 0
	fullscreen: 0
	fullscreenmode: 0
	fakefullscreen: 0
	grouped: 0
	swallowing: 0
	focusHistoryID: 7

Since both windows share the same class but not the same window address, they can be shown at the same time by pypr?
Anyways, have a nice day/night :)

Should I understand that the first window is managed as expected, but the popups it triggers aren't ?
This is indeed not supported and makes little sense: a scratchpad is one window, any "position", "size" etc applied to more than one window would just be inconsistent.
In theory one could just add support for multiple client windows but:

it would force to always listen to every window creation & deletion to understand the lifecycle of each
it would require some fuzzy rules to try to make the difference between the different windows, find a way to express it in the config, etc...

I don't see how that could work, if you know please enlight me :)
Regardless, I think I see your use case and use a very similar one for some VPN app.
Check toggle_minimized in https://github.com/hyprland-community/pyprland/wiki/Plugins#commands - the name can be a bit confusing, it's more generic than this...

I just released a new version : 1.8.0
I believe a special workspace can do the job, if you need to quickly move windows between the special workspace and the normal active one, in two directions, have a look at https://github.com/hyprland-community/pyprland/wiki/toggle_special (same as I recommended before, but now it has its own plugin and has been renamed for clarity).
Closing the issue since I don't think scratchpads is meant to cover those use cases. If you have a proposition or a clear feature request feel free to re-open or create a new issue.

It also causes other issues, for example:

I have slack as pyprland scratchpad - works great for single window
My coworker starts a huddle with me and shares the screen, I pop-up the video window to be able to see it
The popped window is now inaccessible because it is in a scratch:slack special workspace
Toggle only toggles my main slack window (which is OK and I can agree it is expected behaviour)

But even when I got to my special workspace and I moved it to my normal workspace next time pyprland toggles slack it moves both windows to scratch:slack and I'm back at step 1.
I think matching windows would need to be matched by any attribute, similar to hyprland rules (in this case I could use initialTitle .
Example hyprctl output:
Window 559f59faa260 -> person1, person2 (DM) -  Slack [Main] 🏠:
	mapped: 1
	hidden: 0
	at: 1600,1440
	size: 1920,1296
	workspace: -35 (special:scratch_slack)
	floating: 1
	monitor: 1
	class: Slack
	title: person, person2 (DM) - Trint - Slack [Main] 🏠
	initialClass: Slack
	initialTitle: Slack
	pid: 8758
	xwayland: 0
	pinned: 0
	fullscreen: 0
	fullscreenmode: 0
	fakefullscreen: 0
	grouped: 0
	swallowing: 0
	focusHistoryID: 3

Window 559f5bafb380 -> Huddle: person1, person2  - Slack 🎤:
	mapped: 1
	hidden: 0
	at: 1696,116
	size: 2488,1265
	workspace: -35 (special:scratch_slack)
	floating: 1
	monitor: 1
	class: Slack
	title: Huddle: person1, person2 - Slack 🎤
	initialClass: Slack
	initialTitle: Huddle
	pid: 8758
	xwayland: 0
	pinned: 0
	fullscreen: 0
	fullscreenmode: 0
	fakefullscreen: 0
	grouped: 0
	swallowing: 0
	focusHistoryID: 2

So to be sure, in your scenario, you want the original window to be the scratchpad but sub-windows to not have a special threatment ?
And that could work by, for instance, refactoring the class_match into something like:
match_by="class" which would reuse the class attribute...
and for your case match_by="initialTitle" ?
You would provide initialTitle="Slack" directly in the properties of the scratch ? or
match_value="Slack" to avoid nme clash between the scratchpad's configuration items & the client's attributes...

Hi, thank you for a quick response!
I think that would work, or if possible something similar to hyprland windowrule where it's possible to match by any field(s) with regex, as that could probably cover more use-cases in the future

Hi, thank you for a quick response! I think that would work, or if possible something similar to hyprland windowrule where it's possible to match by any field(s) with regex, as that could probably cover more use-cases in the future

If I push some experimental version later, are you able to test it without having a proper release (use the latest git version)?

Yes I should be able to to test it tomorrow. Thank you!

Not sure what update did it (might by hyprland) but the behaviour changed for the better.
Now pyprland toggle toggles only the main slack window, which is great. The only issue is that it still opens in the scratchpad at the beginning so it's hard to access it, but after I move it manually to regular workspace all works as expected. Can we prevent opening newly spawned windows in the scratchpad?

Not sure what update did it (might by hyprland) but the behaviour changed for the better.
Now pyprland toggle toggles only the main slack window, which is great. The only issue is that it still opens in the scratchpad at the beginning so it's hard to access it, but after I move it manually to regular workspace all works as expected. Can we prevent opening newly spawned windows in the scratchpad?

In theory only one is added... so it must be a rule in your hyprland.conf ?
It works as follows:
when launching an app, the PID is kept, then it waits for a window using this PID and associates it to the scratchpad. A single window per scratchpad is supported at the moment...
Actually you made me think about implementing some kind of group of windows and matching multiple clients, but today it's not possible so I'm surprised this is happening for you.

The new window has the same PID as the original one (in slack - see below). I don't have any window rules for slack, it must by from pyprland
Window 564ba188d5f0 -> Huddle: Anna, Jinn  - Slack:
        mapped: 1
        hidden: 0
        at: 3972,739
        size: 1142,695
        workspace: 2 (2)
        floating: 0
        monitor: 1
        class: Slack
        title: Huddle: Anna, Jinn - Trint - Slack
        initialClass: Slack
        initialTitle: Huddle
        pid: 9669
        xwayland: 0
        pinned: 0
        fullscreen: 0
        fullscreenmode: 0
        fakefullscreen: 0
        grouped: 0
        swallowing: 0
        focusHistoryID: 2

Window 564ba17da140 -> product-feedback (Channel) - 1 new item - Slack [Main] 🏠:
        mapped: 1
        hidden: 0
        at: 1600,1440
        size: 1920,1296
        workspace: -45 (special:scratch_slack)
        floating: 1
        monitor: 1
        class: Slack
        title: product-feedback (Channel) - 1 new item - Slack [Main] 🏠
        initialClass: Slack
        initialTitle: Slack
        pid: 9669
        xwayland: 0
        pinned: 0
        fullscreen: 0
        fullscreenmode: 0
        fakefullscreen: 0
        grouped: 0
        swallowing: 0
        focusHistoryID: 5

In theory only the first created one will be the scratchpad... it should be visible in pyprland's log file... (passed via --debug)

sorry just edited above with some extra info

Note that now you can match by initialTitle if you like...

didn't expect this to be relevant to others 😄 maybe a wiki entry or a guide on this matter would be helpful for future references. i'll try to add if i find the time!

There is a chance Hyprland assigns the child window to the special workspace...
I can maybe add a feature / option so that every window on the scratchpad will be moving with the "main" scratchpad, needs to be tested, I'm not sure it can easily work without adding a lot of logic.


Difference of two NodeLists returns every element

The _.difference method should return an array containing only elements which are present in the first array but not in any of the subsequent array.  If you pass it 2 NodeLists it always returns all the elements in the first list regardless of which elements appear in both.
    divs = document.querySelectorAll("div");
   _.difference(divs, divs);

returns an array which contains every element from 'divs'.  It would be super if difference could handle NodeLists as if they were arrays, as it's a useful case. The core logic of the function works on NodeLists so
_.filter(divs, function(el){ return !_.contains(divs, el); });

returns the expected result.

I've learned that Underscore isn't meant to address host objects, so I think the best thing you can do is to _.toArray() the NodeLists before using _.difference(), which would work as you'd expect:
var divsArray = _.toArray(document.querySelectorAll('div'));
_.difference(divsArray, divsArray); // []

Yep, @PatrickStankard is right here.


css missing (maybe)

I have installed this library with npm in a CLI project, i've followed the quick walk through but this is the result

somebody can help me?

Same issue over here.
this.modal.alert()             .size('lg')             .showClose(true)             .title('A simple Alert style modal window')             .body(
Alert is a classic (title/body/footer) 1 button modal window that
does not block.
Configuration:

Non blocking (click anywhere outside to dismiss)
Size large
Dismissed with default keyboard key (ESC)
Close wth button click
HTML content
)             .open();

Add this to your index.html ``


Iranian Election Violence web app does not reference local geometry service

@nfeuerstein Note: milestone set for next Ops Server release.
The index.html file located under \afmiedev\SolutionsWeb\Apps\IranianElectionViolence references arcgisonline geometry service. The Ops Server does have this service so we should reference the Ops Server service.

Does not apply to NSEC.  Closing.


Add subsection "Data privacy when using a work profile"

Rendered article section for review:
https://review.learn.microsoft.com/microsoft-edge/privacy-whitepaper/?branch=pr-en-us-2900#data-privacy-when-using-a-work-profile
AB#47343393

When working with the work profile, the organization may see the following data:
For example, when the user works in the profile of<EMAIL_ADDRESS>Contoso may see the data.


How to inline asm ?

I want to implement syscall，
Inline compilation required，
1、linux syscall

if you compile all into EXE(executable) file

create C file with all functions u need to do
add declare function <name_of_c>(p1: TypeOf<1>) etc
when compile code add OBJ file from C file

done.
have a look into \docs\how\ to see how to use TSC with C/C++ compilers


Backdrop issue

Hi!
I just installed the Classic-beta bransch and got the following message upon logging in. Any ideas what's causing it?
Message: Interface\AddOns\Filger\Filger.lua:585: attempt to call method 'CreateBackdrop' (a nil value)
Time: Sat Dec  5 13:05:36 2020
Count: 1
Stack: Interface\AddOns\Filger\Filger.lua:585: attempt to call method 'CreateBackdrop' (a nil value)
Interface\AddOns\Filger\Filger.lua:585: in function `Spawn'
Interface\AddOns\Filger\Filger.lua:550: in function `?'
Interface\AddOns\Filger\Filger.lua:534: in function <Interface\AddOns\Filger\Filger.lua:532>

Locals: self = Filger {
 0 = <userdata>
 Retail = false
 Description = "Minimal buff/debuff tracker"
 MyName = "Profila"
 PostUpdateAura = <function> defined @Interface\AddOns\Filger\Filger.lua:258
 Print = <function> defined @Interface\AddOns\Filger\core\functions.lua:12
 AddOnCommands = <table> {
 }
 Dummy = <function> defined @Interface\AddOns\Filger\core\init.lua:25
 unit = "player"
 MyLevel = 60
 MyRealm = "Razorgore"
 LCD = <table> {
 }
 PLAYER_LOGIN = <function> defined @Interface\AddOns\Filger\Filger.lua:543
 ADDON_LOADED = <function> defined @Interface\AddOns\Filger\Filger.lua:537
 FilterAuras = <function> defined @Interface\AddOns\Filger\Filger.lua:399
 BuildSpellList = <function> defined @Interface\AddOns\Filger\Filger.lua:465
 Debug = <function> defined @Interface\AddOns\Filger\core\functions.lua:16
 IconCoord = <table> {
 }
 Classic = true
 WelcomeMessage = "Filger 1 - /filger help"
 CreateAura = <function> defined @Interface\AddOns\Filger\Filger.lua:114
 MyClass = "HUNTER"
 SetPosition = <function> defined @Interface\AddOns\Filger\Filger.lua:92
 MyRace = "NightElf"
 Title = "Filger Classic"
 FormatTime = <function> defined @Interface\AddOns\Filger\core\functions.lua:21
 MyFaction = "Alliance"
 VersionNumber = 1
 Version = "1.0"
 Spawn = <function> defined @Interface\AddOns\Filger\Filger.lua:554
}
index = 1
data = <table> {
 caster = "player"
 showOnlyPlayer = true
 growth-y = "DOWN"
 unit = "player"
 filter = "PLAYER|HELPFUL"
 initialAnchor = "BOTTOMRIGHT"
 name = "PLAYER_AURAS"
 spacing = 3
 anchor = <table> {
 }
 growth-x = "LEFT"
 limit = 8
 size = 32
}
frame = Filger1 {
 0 = <userdata>
 initialAnchor = "BOTTOMRIGHT"
 isDebuff = false
 caster = "player"
 filter = "PLAYER|HELPFUL"
 hidePlayer = false
 growth-y = "DOWN"
 unit = "player"
 showOnlyPlayer = true
 createdAuras = 0
 limit = 8
 spacing = 3
 anchor = <table> {
 }
 growth-x = "LEFT"
 name = "PLAYER_AURAS"
 size = 32
}
(*temporary) = nil
(*temporary) = Filger1 {
 0 = <userdata>
 initialAnchor = "BOTTOMRIGHT"
 isDebuff = false
 caster = "player"
 filter = "PLAYER|HELPFUL"
 hidePlayer = false
 growth-y = "DOWN"
 unit = "player"
 showOnlyPlayer = true
 createdAuras = 0
 limit = 8
 spacing = 3
 anchor = <table> {
 }
 growth-x = "LEFT"
 name = "PLAYER_AURAS"
 size = 32
}
(*temporary) = "attempt to call method 'CreateBackdrop' (a nil value)"
Font = "Interface\AddOns\Filger\medias\fonts\pixel_font.ttf"
FontSize = 12
FontStyle = "MONOCHROMEOUTLINE"
OnEvent = <function> defined @Interface\AddOns\Filger\Filger.lua:426

As it turns out the addon appears to be dependants on your Tukui edit. Sorry I missed that, not sure where this is mentioned =)
Is it possible to make this addon completely standalone?

Duplicated of #2


Create Workbench layer

Fixes #38.

Codecov Report

Merging #150 into master will increase coverage by 0.2%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master     #150     +/-   ##
=========================================
+ Coverage   97.38%   97.58%   +0.2%
=========================================
  Files          56       58      +2
  Lines        5540     5834    +294
=========================================
+ Hits         5395     5693    +298
+ Misses        145      141      -4

Impacted Files
Coverage Δ

stix2/__init__.py
100% <ø> (ø)
:arrow_up:

stix2/workbench.py
100% <100%> (ø)

stix2/environment.py
100% <100%> (+6.45%)
:arrow_up:

stix2/datastore/__init__.py
100% <100%> (ø)
:arrow_up:

stix2/test/test_environment.py
100% <100%> (ø)
:arrow_up:

stix2/test/test_workbench.py
100% <100%> (ø)

stix2/test/test_tool.py
100% <100%> (ø)
:arrow_up:

stix2/test/constants.py
100% <100%> (ø)
:arrow_up:

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 e92db24...4a2ac6d. Read the comment docs.


Inkwell touch feedback is flowing over bottomNavigationBar when no background color is provided.

Steps to Reproduce

Execute flutter run on the code sample
Scroll until an item is half visible, and the other half is behind the bottomNavigationBar
long press on the item to see how the touch feedback is flowing over bottomNavigationBar (the body's z-index is greater)

this problem exists because no background color was provided to the bottomNavigationBar

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: ListView.builder(
        itemCount: 20,
        itemBuilder: (BuildContext context, int index) {
          return InkWell(
            onTap: () {},
            child: Container(
              padding: const EdgeInsets.all(50),
              child: Text('Item $index'),
            ),
          );
        },
      ),
      bottomNavigationBar: Container(
        // color: Colors.blue,
        padding: const EdgeInsets.all(30),
        child: const Text('a'),
      ),
    );
  }
}

Logs
adnanfahed@Adnans-MacBook-Pro bug_report % flutter analyze
Analyzing bug_report...
No issues found! (ran in 2.4s)

adnanfahed@Adnans-MacBook-Pro bug_report % flutter doctor -v
[✓] Flutter (Channel stable, 2.5.3, on macOS 11.5.2 20G95 darwin-x64, locale en)
    • Flutter version 2.5.3 at /Users/adnanfahed/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (4 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/adnanfahed/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.1, Build version 13A1030d
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.62.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] VS Code (version 1.62.2)
    • VS Code at /Users/adnanfahed/Downloads/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • iPhone (mobile) • 7c0edb93134cbbf0493eb34ada73e295cffa68cf • ios            • iOS 15.0.1 19A348
    • Chrome (web)    • chrome                                   • web-javascript • Google Chrome 95.0.4638.69

• No issues found!

@adnanjpg
You are seeing that behavior because you wrapped bottomNavigtionbar with Container. If you directly try the official code sample, you'll get the expected behavior as below:

bottomNavigationBar: BottomNavigationBar(
        items: const <BottomNavigationBarItem>[
          BottomNavigationBarItem(
            icon: Icon(Icons.home),
            label: 'Home',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.business),
            label: 'Business',
          ),
          BottomNavigationBarItem(
            icon: Icon(Icons.school),
            label: 'School',
          ),
        ],
      //  currentIndex: _selectedIndex,
        selectedItemColor: Colors.amber[800],
     //   onTap: _onItemTapped,
      ),

Yes you are right, but it is common to use bottomNavigationBar for another purposes other than putting multiple navigation items as shown in the example you've provided.

@adnanjpg There are some default attributes for the BottomNavigationBar widget. If you see carefully then you can notice that bottomNavigationBar expects Widget? as a parameter, not a BottomNavigationBar. You pass any widget as a parameter. So if you want attributes like  BotBottomNavigationBar then you have to use it or create a widget that contains the same attributes like BottomNavigationBar then it will behave as you are expecting.

it is not about what i expect, as i mentioned above i was able to make it bahave as i am expecting by providing a background color to the widget provided as a value for the bottomNavigationBar parameter. i am not sure if this is an expected behaviour or a bug

@adnanjpg
Would like to understand more about your use case you are trying to achieve. Can you elaborate on it by providing an example ?

Sure, here is an example:
return Padding(
  padding: const EdgeInsets.all(16),
  child: Row(
    mainAxisAlignment: MainAxisAlignment.spaceBetween,
    children: [
      ElevatedButton(
        onPressed: () {},
        child: const Text('previous'),
      ),
      const Text('1/3'),
      ElevatedButton(
        onPressed: () {},
        child: const Text('next'),
      ),
    ],
  ),
);

if the background color is not specified, then this problem will appear

Thanks for the details. Although I am able to replicate it and see the same behavior, but I am not sure if this is a bug. Keeping it open for further insights from the team.
/cc @HansMuller

Hi  @adnanjpg
This is a known issue, it seems to be fixed by adding Material to ListView. https://github.com/flutter/flutter/issues/86584#issuecomment-916407888

minimal code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Material(
        child: ListView.builder(
          itemCount: 20,
          itemBuilder: (BuildContext context, int index) {
            return InkWell(
              onTap: () {},
              child: Container(
                padding: const EdgeInsets.all(50),
                child: Text('Item $index'),
              ),
            );
          },
        ),
      ),
      bottomNavigationBar: Container(
        // color: Colors.blue,
        padding: const EdgeInsets.all(30),
        child: const Text('a'),
      ),
    );
  }
}


Use sed instead of tail for terraform-docs command

PR o'clock
Description
Use sed instead of tail for the terraform-docs command since it is more universally compatible. Thanks to @dpiddockcmp for your suggestion at https://github.com/terraform-aws-modules/terraform-aws-eks/pull/209#issuecomment-446671578
Checklist

[x] terraform fmt and terraform validate both work from the root and examples/eks_test_fixture directories (look in CI for an example)
[ ] Tests for the changes have been added and passing (for bug fixes/features)
[ ] Test results are pasted in this PR (in lieu of CI)
[x] Docs have been updated using terraform-docs per README.md instructions
[ ] I've added my change to CHANGELOG.md
[x] Any breaking changes are highlighted above

Not my call, I'm just a peon helping out, but I like that idea.

@max-rocket-internet What do you think?

@antonbabenko

Guys, I may sound strange, but why don't you want to use the same pre-commit-terraform which I am using in other terraform-aws-modules.

Sure thing, let's do it 👍
Will it work on multiple platforms like what this PR is solving?

Let me know if you want me to help with it and I can open a PR.

Please do!

Oops wrong button...

@antonbabenko

Guys, I may sound strange, but why don't you want to use the same pre-commit-terraform which I am using in other terraform-aws-modules.

Sure thing, let's do it
Will it work on multiple platforms like what this PR is solving?

Let me know if you want me to help with it and I can open a PR.

Please do!

Both options should be available and equivalent. The pre-commit needs to be installed locally for it to work.

OK well let's merge this now as it solves a problem and await a nice PR from Anton.


Add document: l10n best practices for developers

Fixes #224
@mozilla-l10n/pm-group
You might have seen this document in the past (it used to live on MDN before "the purge").
I've taken that document, reorganized it and removed a bunch of things (localizers had access and added a lot of examples, making it very chaotic). I've also added a few things about Fluent.
Do you have time to take a look? The markdown version is available here
https://github.com/mozilla-l10n/documentation/blob/best_practices/src/localization/dev_best_practices.md
There are two things I'm interested in:

That the English is not broken. I've been staring at this the whole week, and errors might have slipped through the cracks.
Are there problems that you see often in your project, and are not covered here?

On the latter, I would really like to try and avoid going into too much detail for a specific format (e.g. Fluent), because we already have several documents scattered here and there, and this document is already very long. If necessary, we should think about creating a Fluent doc here, and try to gather all the information in one place.

Thanks all for the help 👍🏼


[WIP] Updates for macOS

Current coverage is 39.52% (diff: 100%)

Merging #1364 into master will not change coverage

@@             master      #1364   diff @@
==========================================
  Files           109        109
  Lines         21212      21212
  Methods        2924       2924
  Messages          0          0
  Branches          0          0
==========================================
  Hits           8383       8383
  Misses        12829      12829
  Partials          0          0

Powered by Codecov. Last update 188b091...f3a953c


Stable ABI

Use the stable Python ABI
Return ~memoryview~ bytearray from compression methods
~Error when specifying incorrect size on decompression~
Eliminate some boilerplate in the C module

I don't think this is going to work (yet). The biggest issue is that Py_buffer was not stabilized until 3.11. I could change the API to just accept bytes, or just read-only bytes-like objects (via the y# format), but would rather not.

It was not added to the Stable ABI, that doesn't mean it wasn't stable.

The biggest issue is that Py_buffer was not stabilized until 3.11.

It's the "Limited API" and "Stable ABI". Something can be a stable part of the API but not be part of the "Limited API".


Ambiance: modularizing css

Please, review the code

OK, so no more fixed values in that file, I like that. Could we move all the rules into a separate file called theme.scss or basetheme.scss. Then this file would have only the color definitions and one rule saying something like .ambiance-theme extends .base-theme (or whatever the sass syntax is for extending)
That way all theme files would just have different color definitions and would be really easy to manage. I'm pretty confident that this is possible with sass since it can import and extend rules: http://sass-lang.com/documentation/file.SASS_REFERENCE.html

right, the goal is to define a new theme with a file that has just 10-15 color definitions.

Updated. Please, check this approach

Modularization looks good. We'll have to update it with additional css changes that were added to master in the meantime.

please bring this up to date with master

There are some totally new properties in the ambiance scss file like cursor image on various elements that need to be included.

Updated. Please, check.

markdown blockquote fix has been lost it seems.

Fixed.

kick jenkins

:dolphin:

Up to date with master. Please, check.


Auto hide persistent scrollbar in Edge, IE 10/11

Prevents content shift due to the scrollbar in Edge and IE 10/11.
Aligns Windows IE 10/11 and Edge experience with Mac.

+1

I understand that this fits into the "normalize" philosophy but I think it is worth considering these tweets from Adrian Roselli:

“Should You Use a Custom Scroll Indicator? A Study with Eye-Tracking”
https://viget.com/inspire/should-you-use-a-custom-scroll-indicator-a-study-with-eye-tracking …
No. At best, waste of dev. At worst confusing.

and

I also think custom styling is bad and removing like OSX & mobile do is poor UX. So I think this is a terrible idea

@thierryk, a custom scroll indicator (which I’ve seen a lot of news websites doing lately) is very different than this.
That study proved that users just scrolled to get a feel for where where they were at, and this change would have no impact on that behavior.
As you mentioned, this fits into the “normalize” philosophy. It normalizes behavior across devices and improves a the less-than-ideal experience in IE where scrollbars shift content.

@jonathantneal I only mentioned the first tweet because Adrian replied in that context saying "I also think [auto hiding persistent scrollbar] is a terrible idea."
Another tweet from that thread:

It seems like this would confuse regular Edge/IE users. What's the benefit?

I'd advise against this change. In IE11 (and potentially IE10) the auto-hiding scrollbar shows itself too easily, making it difficult to click things on the right edge of the viewport since they get overlapped by the scrollbar. See https://github.com/twbs/bootstrap/issues/18543

@thierryk, @cvrebert, you are right. This contradicts the expected Windows behavior. Thanks much for chiming in. I’m closing this.
I also looked at twbs/bootstrap#18775 as a possible change, but changing the latest Edge expectation seems equally opinionated, so perhaps this is best left in Bootstrap. @cvrebert, since you’ve been following both issues, any concerns or objections?

@jonathantneal Yes, I think tinkering with this is too opinionated for Normalize. IMO, scrollbar behavior ought to match the norm for the respective platform that the browser is running on, and querying for that norm isn't currently possible from CSS.
We only reluctantly set it in Bootstrap because being responsive via @-ms-viewport is more important to us, but causes https://github.com/twbs/bootstrap/issues/18543 as a side-effect, and setting -ms-overflow-style was the least-worst workaround we could find.


Directshow is not anymore supported to the last dcx?

In my oldversion of dcx.dll (2.0 build 1120), the directshow object works perfectly, i've created a directshow object to play a gif file in it and when i turned on to 3.1 389 build:
D_CERROR xdialog -c diagbox: Unable To Create Control (Control Type not supported: directshow)

fixed


SCRUM-50 + RESET PASSWORD NEW PAGE https://healthybite.atlassian.net/…

…browse/SCRUM-50

Pull Request Test Coverage Report for Build<PHONE_NUMBER>0
Details

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 100.0%

Totals

Change from base Build<PHONE_NUMBER>8:
0.0%

Covered Lines:
4

Relevant Lines:
4

💛  - Coveralls

Pull Request Test Coverage Report for Build<PHONE_NUMBER>0
Details

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 100.0%

Totals

Change from base Build<PHONE_NUMBER>8:
0.0%

Covered Lines:
4

Relevant Lines:
4

💛  - Coveralls


Java: Implement Example66_FunctionCallingStepwisePlanner

Planners are beta in .NET v1, would be nice to have, do this example if we have time.

Not implementing planners in v1 for Java SK. We will start with tool calling instead, and if necessary revisit planners  in the future.


Selectfield dropdown position

How to set position of dropdown of selectfield. I want to show dropdown below selectfield i dont want it should come above it

@Muneem It looks like you could use the menuStyle prop as discussed here near the bottom of the page.
I have also used the Popover component as an alternative to the DropDownMenu. It allows easier control over the visual position of the Popover menu.

i want drop down only in select field..how can we control vertical position of drop down.right now menu overlapping and hiding the select field label.

Just wanted to leave this here, in case someone else has the same question in 1.0:
`
<Select
MenuProps={{
getContentAnchorEl: null,
anchorOrigin: {
vertical: "bottom",
horizontal: "left",
}
}}

`

@JeremyGrieshop you are the champ :D

@JeremyGrieshop Dropping in the future to to thank you

@JeremyGrieshop You make my day

Is it possible to use menuStyle to shift a component up or down by a few pixels? I'm having an issue where the menuStyle prop won't allow me to shift position of a component but it will allow other stylings like border colour.

Yeah this is awesome!

<Select           defaultValue=""           id="grouped-select"           MenuProps={{             anchorOrigin: {               vertical: "bottom",               horizontal: "left"             },             transformOrigin: {               vertical: "top",               horizontal: "left"             },             getContentAnchorEl: null           }}         >           <MenuItem value="">             None           </MenuItem>           <ListSubheader>Category 1</ListSubheader>           <MenuItem value={1}>Option 1</MenuItem>           <MenuItem value={2}>Option 2</MenuItem>           <ListSubheader>Category 2</ListSubheader>           <MenuItem value={3}>Option 3</MenuItem>           <MenuItem value={4}>Option 4</MenuItem>         </Select>

<Select
defaultValue=""
id="grouped-select"
MenuProps={{
anchorOrigin: {
vertical: "bottom",
horizontal: "left"
},
transformOrigin: {
vertical: "top",
horizontal: "left"
},
getContentAnchorEl: null
}}
>

None

Category 1
Option 1
Option 2
Category 2
Option 3
Option 4

<Select
          defaultValue=""
          MenuProps={{
            anchorOrigin: {
              vertical: "bottom",
              horizontal: "left"
            },
            transformOrigin: {
              vertical: "top",
              horizontal: "left"
            },
            getContentAnchorEl: null
          }}
        >
          <MenuItem value={1}>Option 1</MenuItem>
          <MenuItem value={2}>Option 2</MenuItem>
</Select>

@JeremyGrieshop 2 years after, thank you! 💯

@JeremyGrieshop  please help me, I did as you said but my position after click is viewport bottom and viewport left. Please help.
<Menu
     anchorBuyer={anchorBuyer}
     anchorOrigin={{ vertical: "top", horizontal: "left" }}
     id={menuIdBuyer}
     keepMounted
     transformOrigin={{ vertical: "top", horizontal: "left" }}
     open={isMenuBuyerOpen}
     onClose={handleMenuCloseBuyer}
   >

had an issue that label becomes missing when select is clicked after successfully changing dropdown position from answers above, turns out the default styling changes input label color to white on focus which is my background color. To fix it, simply override the styling <InputLabel classes={{focused: classes.X}}> where class X contains color: "initial".  mui v4.11.0

Hello All,
Currently not having any success (no change in the MenuItems' position) with @JeremyGrieshop and @pzanwar03 methods. Do you think this might be due to the fact that my  is wrapped around the  ? Thanks for any advise in advance.
`

Type
<Select
MenuProps={{
anchorOrigin: {
vertical: "bottom",
horizontal: "left"
},
transformOrigin: {
vertical: "top",
horizontal: "left"
},
getContentAnchorEl: null
}}
labelId="demo-simple-select-outlined-label"
id="demo-simple-select-outlined"
value={props.x}
onChange={props.handleChange}
label="x"
name="x"
            >
                <MenuItem value={'1'}>1</MenuItem>
                <MenuItem value={'2'}>2</MenuItem>
                <MenuItem value={'3'}>3</MenuItem>
                <MenuItem value={'4'}>4</MenuItem>
                <MenuItem value={'5'}>5</MenuItem>
                <MenuItem value={'6'}>6</MenuItem>
                <MenuItem value={'7'}>7</MenuItem>
                <MenuItem value={'8'}>8</MenuItem>
            </Select>
        </FormControl>

`

Hello All,
Currently not having any success (no change in the MenuItems' position) with @JeremyGrieshop and @pzanwar03 methods. Do you think this might be due to the fact that my <Select> is wrapped around the <FormControl> ? Thanks for any advise in advance.
<FormControl className={classes.textField}>
    <InputLabel id="demo-simple-select-outlined-label">Type</InputLabel>
    <Select
        MenuProps={{
            anchorOrigin: {
                vertical: "bottom",
                horizontal: "left"
            },
            transformOrigin: {
                vertical: "top",
                horizontal: "left"
            },
            getContentAnchorEl: null
        }}
       labelId="demo-simple-select-outlined-label"
       id="demo-simple-select-outlined"
       value={props.x}
       onChange={props.handleChange}
       label="x"
       name="x">
           <MenuItem value={'1'}>1</MenuItem>
           <MenuItem value={'2'}>2</MenuItem>
    </Select>
</FormControl>`


Revert "Linechart (#104)"

This reverts commit 56c699572d611086670372af47dac86dbd990f34.
The data used in the linechart example not really make any sense, and did not add any value to the getting started section. It also introduced a lot of duplicated code and broke the links in the examples.
If we decide that a linechart example is valuable, it will need to be redesigned.

We should definitely have a line chart (and perhaps also bar chart) example to expand visualization examples with picasso, if this is easier than solving #107 by refactoring I'm OK with it.

@peol I have removed the duplicated resources and merged the two visualizations to one page on this branch, if we decide to refactor instead. Even if we remove the duplicated code, we still need to pick a better data to use for the linechart.

I will refactor the hello-visualization example instead and update the linechart.


static_vars = None fails for the CGANTrainer

If static_vars is assigned, then the aux_hr variable is defined. However, for static_vars = None, aux_hr is not defined and the code fails. See lines 338-341 (https://github.com/carlos-gg/dl4ds/blob/232ae495151a4d3607402b3e7c8afd51d6bfa3de/dl4ds/training/cgan.py#L338). I added a aux_hr=None on line 342 and got the code to run.

There is a similar issue on line 440 where hr_arrtest is not defined if the static_vars is None.


[fusion] Missing fusion of truncation with source compute operations of higher bitwidth

Using the input model here : https://gist.github.com/MaheshRavishankar/d69c5987b65fb13650c831c731f86e13 compiling with
iree-compile --iree-hal-target-backends=rocm --iree-flow-enable-aggressive-fusion --compile-to=executable-sources --iree-hal-dump-executable-sources-to=sources/

module_main$async_dispatch_18.mlir is
hal.executable public @main$async_dispatch_18 {
  hal.executable.variant public @rocm_hsaco_fb target(<"rocm", "rocm-hsaco-fb", {iree.gpu.target = #iree_gpu.target<arch = "gfx908", features = "", wgp = <compute =  fp64|fp32|fp16|int64|int32|int16|int8, storage =  b64|b32|b16|b8, subgroup =  shuffle|arithmetic, dot =  dp4xi8toi32, mma = [<MFMA_F16_16x16x16_F32>, <MFMA_F16_32x32x8_F32>], subgroup_size_choices = [64], max_workgroup_sizes = [1024, 1024, 1024], max_thread_count_per_workgroup = 1024, max_workgroup_memory_bytes = 65536>>, ukernels = "none"}>) {
    hal.executable.export public @main$async_dispatch_18_matmul_transpose_b_2x1280x1280_f16xf16xf32 ordinal(0) layout(#hal.pipeline.layout<push_constants = 2, sets = [<0, bindings = [<0, storage_buffer, ReadOnly>, <1, storage_buffer, ReadOnly>, <2, storage_buffer>]>]>) attributes {hal.interface.bindings = [#hal.interface.binding<0, 0>, #hal.interface.binding<0, 1>, #hal.interface.binding<0, 2>]} {
    ^bb0(%arg0: !hal.device):
      %x, %y, %z = flow.dispatch.workgroup_count_from_slice
      hal.return %x, %y, %z : index, index, index
    }
    builtin.module {
      func.func @main$async_dispatch_18_matmul_transpose_b_2x1280x1280_f16xf16xf32() {
        %cst = arith.constant 0.000000e+00 : f32
        %c0 = arith.constant 0 : index
        %0 = hal.interface.constant.load[0] : i32
        %1 = hal.interface.constant.load[1] : i32
        %2 = arith.index_castui %0 : i32 to index
        %3 = arith.index_castui %1 : i32 to index
        %4 = hal.interface.binding.subspan set(0) binding(0) type(storage_buffer) alignment(64) offset(%2) flags(ReadOnly) : !flow.dispatch.tensor<readonly:tensor<2x1280xf16>>
        %5 = hal.interface.binding.subspan set(0) binding(1) type(storage_buffer) alignment(64) offset(%c0) flags(ReadOnly) : !flow.dispatch.tensor<readonly:tensor<1280x1280xf16>>
        %6 = hal.interface.binding.subspan set(0) binding(2) type(storage_buffer) alignment(64) offset(%3) : !flow.dispatch.tensor<writeonly:tensor<2x1280xf32>>
        %7 = flow.dispatch.tensor.load %4, offsets = [0, 0], sizes = [2, 1280], strides = [1, 1] : !flow.dispatch.tensor<readonly:tensor<2x1280xf16>> -> tensor<2x1280xf16>
        %8 = flow.dispatch.tensor.load %5, offsets = [0, 0], sizes = [1280, 1280], strides = [1, 1] : !flow.dispatch.tensor<readonly:tensor<1280x1280xf16>> -> tensor<1280x1280xf16>
        %9 = tensor.empty() : tensor<2x1280xf32>
        %10 = linalg.fill ins(%cst : f32) outs(%9 : tensor<2x1280xf32>) -> tensor<2x1280xf32>
        %11 = linalg.matmul_transpose_b ins(%7, %8 : tensor<2x1280xf16>, tensor<1280x1280xf16>) outs(%10 : tensor<2x1280xf32>) -> tensor<2x1280xf32>
        flow.dispatch.tensor.store %11, %6, offsets = [0, 0], sizes = [2, 1280], strides = [1, 1] : tensor<2x1280xf32> -> !flow.dispatch.tensor<writeonly:tensor<2x1280xf32>>
        return
      }
    }
  }
}

The issue here is that the output is fp32 when it should be fp16. Looking at https://gist.github.com/MaheshRavishankar/3dc7f45f6779c8ef35e07d070dfd120e the relevant parts are
%27 = flow.dispatch.region -> (tensor<2x1280xf32>) {
    %5308 = linalg.matmul_transpose_b ins(%26, %__auto.add_embedding.linear_2.weight : tensor<2x1280xf16>, tensor<1280x1280xf16>) outs(%13 : tensor<2x1280xf32>) -> tensor<2x1280xf32>
    flow.return %5308 : tensor<2x1280xf32>
}
...
%61 = flow.dispatch.region -> (tensor<2x1280xf16>) {
    %5308 = linalg.matmul_transpose_b ins(%16, %__auto.time_embedding.linear_2.weight : tensor<2x1280xf16>, tensor<1280x1280xf16>) outs(%13 : tensor<2x1280xf32>) -> tensor<2x1280xf32>
    %5309 = linalg.generic {indexing_maps = [affine_map<(d0, d1) -> (d0, d1)>, affine_map<(d0, d1) -> (d1)>, affine_map<(d0, d1) -> (d0, d1)>, affine_map<(d0, d1) -> (d1)>, affine_map<(d0, d1) -> (d0, d1)>], iterator_types = ["parallel", "parallel"]} ins(%5308, %__auto.time_embedding.linear_2.bias, %27, %__auto.add_embedding.linear_2.bias : tensor<2x1280xf32>, tensor<1280xf16>, tensor<2x1280xf32>, tensor<1280xf16>) outs(%14 : tensor<2x1280xf16>) {
    ^bb0(%in: f32, %in_4384: f16, %in_4385: f32, %in_4386: f16, %out: f16):
      %5310 = arith.truncf %in : f32 to f16
      %5311 = arith.truncf %in_4385 : f32 to f16
      %5312 = arith.addf %5311, %in_4386 : f16
      %5313 = arith.addf %5310, %in_4384 : f16
      %5314 = arith.addf %5313, %5312 : f16
      %5315 = arith.negf %5314 : f16
      %5316 = math.exp %5315 : f16
      %5317 = arith.addf %5316, %cst_1 : f16
      %5318 = arith.divf %cst_1, %5317 : f16
      %5319 = arith.mulf %5318, %5314 : f16
      linalg.yield %5319 : f16
    } -> tensor<2x1280xf16>
    flow.return %5309 : tensor<2x1280xf16>
  }

The arith.truncf generated for truncating the first matmul_transpose_b is now fused with the similar f16 truncation and subsequent operations of another matmul_transpose_b. In an ideal world this would not happen. The truncf should stay with the matmul_transpose_b. This is pretty involved to solve though since you want truncf operations to fuse with subsequent elementwise operations in fp16. Preventing that would mean that the second dispatch.region would not be able to fuse the f16 operations. with the truncate, and there would be a third dispatch for just those operations. Not clear which is better.

A similar issue is happening with  module_main\$async_dispatch_1723.mlir . Looking at  https://gist.github.com/MaheshRavishankar/3dc7f45f6779c8ef35e07d070dfd120e
  %141 = flow.dispatch.region -> (tensor<2x640x64x64xi32>) {
    %5308 = linalg.conv_2d_nchw_fchw {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%140, %expanded_123 : tensor<2x320x64x64xi32>, tensor<640x320x1x1xi32>) outs(%114 : tensor<2x640x64x64xi32>) -> tensor<2x640x64x64xi32>
    flow.return %5308 : tensor<2x640x64x64xi32>
  }
 ...
  %145 = flow.dispatch.region -> (tensor<2x640x64x64xf16>) {
    %5308 = linalg.conv_2d_nchw_fchw {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%inserted_slice_119, %134 : tensor<2x640x66x66xi32>, tensor<640x640x3x3xi32>) outs(%114 : tensor<2x640x64x64xi32>) -> tensor<2x640x64x64xi32>
    %5309 = linalg.generic {indexing_maps = [affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>, affine_map<(d0, d1, d2, d3) -> (d1)>, affine_map<(d0, d1, d2, d3) -> (d0, d2, d3)>, affine_map<(d0, d1, d2, d3) -> (d1)>, affine_map<(d0, d1, d2, d3) -> (d1)>, affine_map<(d\0, d1, d2, d3) -> (d0, d1, d2, d3)>, affine_map<(d0, d1, d2, d3) -> (d1)>, affine_map<(d0, d1, d2, d3) -> (d0, d2, d3)>, affine_map<(d0, d1, d2, d3) -> (d1)>, affine_map<(d0, d1, d2, d3) -> (d1)>, affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>], iterator_types = ["p\arallel", "parallel", "parallel", "parallel"]} ins(%141, %__auto.down_blocks.1.resnets.0.conv_shortcut.bias3Aqs, %collapsed_125, %collapsed_126, %__auto.down_blocks.1.resnets.0.conv_shortcut.bias3Ad, %5308, %__auto.down_blocks.1.resnets.0.conv2.bias3Aqs, %collapsed_12\7, %collapsed_128, %__auto.down_blocks.1.resnets.0.conv2.bias3Ad : tensor<2x640x64x64xi32>, tensor<640xi32>, tensor<2x64x64xi32>, tensor<640xi8>, tensor<640xf32>, tensor<2x640x64x64xi32>, tensor<640xi32>, tensor<2x64x64xi32>, tensor<640xi8>, tensor<640xf32>) outs(%125\ : tensor<2x640x64x64xf16>) {
    ^bb0(%in: i32, %in_4384: i32, %in_4385: i32, %in_4386: i8, %in_4387: f32, %in_4388: i32, %in_4389: i32, %in_4390: i32, %in_4391: i8, %in_4392: f32, %out: f16):
      %5310 = arith.extsi %in_4391 : i8 to i32
      %5311 = arith.muli %in_4390, %5310 : i32
      %5312 = arith.addi %in_4388, %in_4389 : i32
      %5313 = arith.subi %5312, %5311 : i32
      %5314 = arith.sitofp %5313 : i32 to f32
      %5315 = arith.mulf %5314, %in_4392 : f32
      %5316 = arith.extsi %in_4386 : i8 to i32
      %5317 = arith.muli %in_4385, %5316 : i32
      %5318 = arith.addi %in, %in_4384 : i32
      %5319 = arith.subi %5318, %5317 : i32
      %5320 = arith.sitofp %5319 : i32 to f32
      %5321 = arith.mulf %5320, %in_4387 : f32
      %5322 = arith.truncf %5315 : f32 to f16
      %5323 = arith.truncf %5321 : f32 to f16
      %5324 = arith.addf %5323, %5322 : f16
      linalg.yield %5324 : f16
    } -> tensor<2x640x64x64xf16>
    flow.return %5309 : tensor<2x640x64x64xf16>
  }

Again the i32 -> f16 conversion of first dispatch is fused with a similar computation in the second dispatch. It is unclear how to draw the line to get things in the right place.

https://github.com/iree-org/iree/pull/17745 is an attempt to fix it. Doesnt quite work though.

I was talking to Stella, and realized after the fact that it is easy to forget state on this. So documenting as to what the issue is here....
Before any fusion kicks in we have
matmul (fp16 -> fp32)    matmul (fp16 -> fp32)
            |                       |
 truncf(fp32 -> fp16)       truncf(fp32 -> fp16)
                 \            /
                    \      /
                        |
          elemwise op1 (f16 -> f16)
                        |
          elemwise op2 (f16 -> f16)
                        |
          elemwise op3 (f16 -> f16)

The obvious thing to do is to say truncf needs to go with the producer and not the consumer and stop fusing truncf with elementwise op1, but the same decision will apply to both sides. So to get the right "cut" I will have to know that it is ok to fuse one of the truncf -> elemwise op but not the other. Just not sure how to write those "heuristics"

any bright ideas @qedawkins @Max191  or @IanWood1 ?

I'm not in the weeds enough to have an idea on heuristics, but generally you either turn this into three dispatches (with trunc glued to the producer because the one rule of fusion is "never make it bigger"). Or you pick one and sequentialize it, having all of the output ops fused into the one you choose second and the trunc being on the first.
There's not a generally right answer. If these were really big matmuls that can saturate the device on their own, then sequential isn't a penalty. If small then benefits of scheduling them in parallel is traded off against launch overhead (in the current impl).

matmul (fp16 -> fp32)    matmul (fp16 -> fp32)
            |                       |
 truncf(fp32 -> fp16)       truncf(fp32 -> fp16)
                 \            /
                    \      /
                        |
          elemwise op1 (f16 -> f16)
                        |
          elemwise op2 (f16 -> f16)
                        |
          elemwise op3 (f16 -> f16)

What are the shapes here? Can we make this one dispatch?

Why do we need to end up with three dispatches if ElementwiseOpFusion does not fuse them all into one generic? Can we just have multiple consumers on one of the matmuls? In which case we can just pick to fuse based on dominance info (i.e. fuse with the more dominant matmul to keep things as parallel as possible).

Why do we need to end up with three dispatches if ElementwiseOpFusion does not fuse them all into one generic? Can we just have multiple consumers on one of the matmuls? In which case we can just pick to fuse based on dominance info (i.e. fuse with the more dominant matmul to keep things as parallel as possible).

I am not sure I follow.

Basically we let ElementwiseOpFusion produce this
matmul (fp16 -> fp32)    matmul (fp16 -> fp32)
            |                       |
 truncf(fp32 -> fp16)       truncf(fp32 -> fp16)
                 \            /
                    \      /
                        |
          elemwise op1 + op2 + op3 (f16 -> f16)

and then we form dispatches like this
matmul (fp16 -> fp32)
truncf(fp32 -> fp16)
  |
  |
matmul (fp16 -> fp32)
truncf(fp32 -> fp16)
elemwise op1 + op2 + op3 (f16 -> f16)

I might have misunderstood the problem though.

Basically we let ElementwiseOpFusion produce this
matmul (fp16 -> fp32)    matmul (fp16 -> fp32)
            |                       |
 truncf(fp32 -> fp16)       truncf(fp32 -> fp16)
                 \            /
                    \      /
                        |
          elemwise op1 + op2 + op3 (f16 -> f16)

and then we form dispatches like this
matmul (fp16 -> fp32)
truncf(fp32 -> fp16)
  |
  |
matmul (fp16 -> fp32)
truncf(fp32 -> fp16)
elemwise op1 + op2 + op3 (f16 -> f16)

I might have misunderstood the problem though.

Thats exactly what I was going to do :)


Support Microsoft Office and LibreOffice

Two users on Google Play mention that they would like to remove metadata from office files and I find that useful too.

Seens doable too using Apache POI

Seens doable too using Apache POI

That sounds awesome.

Yes, I'll work on it.

Added in v2.0.3.  🥳


Support screen sizes smaller than 80x24

Numerous people have been successful in using LifeLines on hand-held devices using terminal emulators and screen sizes smaller than 80x24; these minimums are hard-coded.
The attached patch shows how LifeLines can function with a smaller screen size.
[Notes from Matt Emmerton -- The patch itself doesn't seem complete, as it merely hard-codes a 58x17 screen size instead of 80x24.  However, this is a good start for a solution that establishes a "minimum" screen size and then drives all placement based on the current screen size. ]
patch-src_screen.c.txt

After conversing with a chain of individuals, credit for this patch should go to Kyle Davenport.


Sidebar 'typedoc-sidebar.cjs' is generated with backward slashes instead of forward slashes

What package is the bug related to?
docusaurus-plugin-typedoc
Describe the issue
Summary
Introduced with version 1.0.3 the typedoc-sidebar.cjs is generated with \\ in the path resulting in an error "sidebar document ids do not exist". With version 1.0.2 everything works fine.
Details
We are using the docusaurus-plugin-typedoc to generate markdown documentation from source. This also automatically generates a typedoc-sidebar.cjs.
With version 1.0.2 the sidebar looked like this:
// @ts-check
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const typedocSidebar = { items: [{"type":"category","label":"Variables","items":[
    {"type":"doc","id":"api-references/viewer/variables/emitter","label":"emitter"}
]}]};
module.exports = typedocSidebar.items;

With version 1.0.3 the sidebar ids contain \\:
// @ts-check
/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const typedocSidebar = { items: [{"type":"category","label":"Variables","items":[
    {"type":"doc","id":"api-references\\viewer/variables/emitter","label":"emitter"}
]}]};
module.exports = typedocSidebar.items;

Although the sidebar file is created, the build fails after that with the error:

[ERROR] Error: Invalid sidebar file at "config/sidebars.js".
These sidebar document ids do not exist:

api-references\viewer/variables/emitter

Available document ids are:

README
api-references/viewer/globals
api-references/viewer/index
api-references/viewer/variables/emitter
at Object.checkSidebarsDocIds (C:\Dev\viewer\node_modules@docusaurus\plugin-content-docs\lib\sidebars\utils.js:181:19)
at addDocNavigation (C:\Dev\viewer\node_modules@docusaurus\plugin-content-docs\lib\docs.js:206:19)
at doLoadVersion (C:\Dev\viewer\node_modules@docusaurus\plugin-content-docs\lib\index.js:106:55)
at async loadVersion (C:\Dev\viewer\node_modules@docusaurus\plugin-content-docs\lib\index.js:113:28)
at async Promise.all (index 0)
at async Object.loadContent (C:\Dev\viewer\node_modules@docusaurus\plugin-content-docs\lib\index.js:121:33)
at async C:\Dev\viewer\node_modules@docusaurus\core\lib\server\plugins\index.js:35:25
at async Promise.all (index 0)
at async loadPlugins (C:\Dev\viewer\node_modules@docusaurus\core\lib\server\plugins\index.js:34:27)
at async load (C:\Dev\viewer\node_modules@docusaurus\core\lib\server\index.js:76:58)

Note that the id is otherwise correct, just the / vs. \ after api-references is different.
Reverting docusaurus-plugin-typedoc to 1.0.2 in package-json resolves the issue.
Please let me know if the description is not enough and you need more information.
TypeDoc configuration
snippet from site-config.js
[
      'docusaurus-plugin-typedoc',
      {
        entryPoints: ['../../src/core/api.ts'],
        tsconfig: '../../tsconfig.json',
        out: 'docs/api-references/viewer',
        excludePrivate: true,
        excludeProtected: true,
        excludeInternal: true,
        disableSources: true,
        gitRevision: 'main',
      },
]

Expected behavior
Page ids generated in typedoc-sidebar.cjs should be valid and match existing ids. They should not contain backward slashes when ids are otherwise only containing forward slashes.

Thanks - Should be fixed in<EMAIL_ADDRESS>

@tgreyuk : awesome. Works like a charm. Thank you for the immediate fix 😄
Should I close the issue or will you do?

Ok great - i'll close it (but feel free to close in future). thanks.


Fixed AttentionalDecoder truncating to 20 chars

When labels for a task are longer than 20 characters, they would be decoded as truncated to 20 characters. So instead we first look at the length of the longest known token.
Before this fix, we would get extremely low test scores for datasets with e.g. long part of speech tags: after all, truncated labels don't match the original ones.
#73 / #74 almost completely rewrites AttentionalDecoder.predict_max() for a speed up. However, it still contains the same bug mentioned here. Notably, our fix here greatly slows down predict_max() for long labels. For example, I went from 2min44s to 11m00s trying to evaluate the same set & model before and after this fix.
Therefore, I'm pinging @PonteIneptique as well, as I'm not sure how this fix would work in the improved predict_max().
Naively inserting the fix at line 344 and removing line 424 throws an error:
Traceback (most recent call last):
  File "/pie/pie/evaluate.py", line 84, in <module>
    run(model_path=args.model_path, test_path=args.test_path,
  File "/pie/pie/evaluate.py", line 56, in run
    for task in model.evaluate(testset, trainset,
  File "/pie/pie/pie/models/base_model.py", line 83, in evaluate
    preds = self.predict(inp, **kwargs)
  File "/pie/pie/pie/models/model.py", line 314, in predict
    hyps, prob = decoder.predict_max(
  File "/pie/pie/pie/models/decoder.py", line 362, in predict_max
    outs, _ = self.attn(outs, enc_outs, lengths)
  File "/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
    return forward_call(*args, **kwargs)
  File "/pie/pie/pie/models/attention.py", line 164, in forward
    mask = mask.unsqueeze(0).expand_as(weights)
RuntimeError: The expanded size of the tensor (20) must match the existing size (43) at non-singleton dimension 2.  Target sizes: [1, 12576, 20].  Tensor sizes: [1, 12576, 43]

Hey :)
I continued developing Pie on the PaPie repository. Given https://github.com/emanjavacas/pie/issues/84#issuecomment-1647598500, I don't know if @emanjavacas is gonna support Pie more (I'll let him reply :D )
As for the fix, while the issue you note is important, I am a bit puzzled by this sentence in the issue that is fixed:

Before this fix, we would get extremely low test scores for datasets with e.g. long part of speech tags

Normally, PartOfSpeechTags are categorical, not generated. Can you provide your configuration ?
As for the lemmas though, you are right it might be an issue, I'll check that next week (I am going on vacation tonight)

Hi both,
We could just increase the default max_seq_len to accommodate. However,
this decoder is only meant for tasks like lemmatization. It's hard to
imagine a language with lemmas longer than 20, but still we could enlarge
the default max_seq_len. If you are using this decoder for POS tagging,
that's something I cannot see right now the use for it. And yeah POS labels
are categorical anyway, you could always map them to integers or use
whatever coding scheme.
I am not going to commit to great changes in PIE, but  I think it's still
quite robust and should meet the demands of many. I tested it on pytorch
2.0 and it passes all tests. But I don't want to change it in a way that
makes it harder to maintain, which is probably the reason why Thibault (hi
Thibault!) forked it.
On Fri, Oct 27, 2023 at 11:49 AM Thibault Clérice @.***>
wrote:

Hey :)
I continued developing Pie on the PaPie repository. Given #84 (comment)
https://github.com/emanjavacas/pie/issues/84#issuecomment-1647598500, I
don't know if @emanjavacas https://github.com/emanjavacas is gonna
support Pie more (I'll let him reply :D )
As for the fix, while the issue you note is important, I am a bit puzzled
by this sentence in the issue that is fixed:
Before this fix, we would get extremely low test scores for datasets with
e.g. long part of speech tags
Normally, PartOfSpeechTags are categorical, not generated. Can you provide
your configuration ?
As for the lemmas though, you are right it might be an issue, I'll check
that next week (I am going on vacation tonight)
—
Reply to this email directly, view it on GitHub
https://github.com/emanjavacas/pie/pull/85#issuecomment-1782625390, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ABPIPIYPTPGM2K355CZYEN3YBN7TTAVCNFSM6AAAAAA6SRI7ZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBSGYZDKMZZGA
.
You are receiving this because you were mentioned.Message ID:
@.***>

--
Enrique Manjavacas

The config file used had the tasks defined as:
    "tasks": [
        {
            "name": "lemma",
            "target": true,
            "context": "sentence",
            "level": "char",
            "decoder": "attentional",
            "settings": {
                "bos": true,
                "eos": true,
                "lower": true,
                "target": "lemma"
            },
            "layer": -1
        },
        {
            "name": "pos",
            "target": false,
            "context": "sentence",
            "level": "char",
            "decoder": "attentional",
            "settings": {
                "bos": true,
                "eos": true,
                "lower": true,
                "target": "pos"
            },
            "layer": -1
        }
    ],

I'm guessing the 'pos' task should have been defined at token level, not char level? And I suppose then that you should use a linear or crf encoder, instead of attentional?

Yup,
don't use the "attentional" decoder for POS, use "linear" as shown in the
example config for PoS
https://github.com/emanjavacas/pie/blob/master/configs/pos.json#L12
On Fri, Oct 27, 2023 at 12:02 PM Vincent Prins @.***>
wrote:

The config file used had the tasks defined as:
"tasks": [
    {
        "name": "lemma",
        "target": true,
        "context": "sentence",
        "level": "char",
        "decoder": "attentional",
        "settings": {
            "bos": true,
            "eos": true,
            "lower": true,
            "target": "lemma"
        },
        "layer": -1
    },
    {
        "name": "pos",
        "target": false,
        "context": "sentence",
        "level": "char",
        "decoder": "attentional",
        "settings": {
            "bos": true,
            "eos": true,
            "lower": true,
            "target": "pos"
        },
        "layer": -1
    }
],

I'm guessing the 'pos' task should have been defined at token level, not
char level? And I suppose then that you should use a linear or crf encoder,
instead of attentional?
—
Reply to this email directly, view it on GitHub
https://github.com/emanjavacas/pie/pull/85#issuecomment-1782642936, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ABPIPI7SOANUCQ7OAV6HYG3YBOBCTAVCNFSM6AAAAAA6SRI7ZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBSGY2DEOJTGY
.
You are receiving this because you were mentioned.Message ID:
@.***>

--
Enrique Manjavacas


Proposal: expose issuecredential eventProps publicly

I believe there's value in exposing the eventProps publicly from issuecredential, especially when using the client interface. Consider that custom action handlers have no type-safe casts at the moment and have to get values out of the map for now.
The work itself would be very similar to https://github.com/hyperledger/aries-framework-go/blob/e05b76b09fcb32c95ff754a697ef361f9247d47f/pkg/didcomm/protocol/didexchange/event.go#L10

@sudeshrshetty, happy to throw a PR, but what are your thoughts first? Or am I missing something very obvious?