Refactor CLI init steps to be consistent across scripts

Checklist
GitHub

[X] I've given this PR a concise, self-descriptive, and meaningful title
[X] I've linked relevant issues in the PR body
[X] I've applied the relevant labels to this PR
[x] I've assigned a reviewer

PR contents

[X] I've consulted SCT's internal developer documentation to ensure my contribution is in line with any relevant design decisions
[ ] I've added relevant tests for my contribution
[ ] I've updated the relevant documentation for my changes, including argparse descriptions, docstrings, and ReadTheDocs tutorial pages

Description

Motivation: Currently, we can call some, but not all scripts using sct_function.main(). This is because script init steps are inconsistent between scripts.
So, this PR refactors scripts to all have the same consistent structure, as described in the CLI script conventions dev Wiki page. This includes some format tidying. For most of the scripts, the necessary changes were very straightforward:

Adding arguments to main.
Renaming variables (args -> argv, args -> arguments, verbosity -> verbose).
Grouping statements at the top of main.
Removing some Param() objects that were unnecessary.
Adding missing verbose arguments (-v).
Creating a main function when it didn't exist.

But, for some scripts, a more involved refactor was needed. So, extra care should be given to the following scripts when reviewing:

sct_apply_transfo: Had some unique parsing behavior (flatting lists for -w and -winv before parsing). But, this was only ever used in one call to sct_apply_transfo, so I figured it wasn't worth the extra complexity. I removed the parsing behavior, and left it to be handled at the site of the call. (In this case, a single call within sct_register_to_template was modified.)
sct_check_dependencies: Doesn't have -v and instead uses -complete for verbose. A bit strange, but I cleaned this up a bit.
sct_denoising_olm: Did parsing within if __name__ == "__main__", then main() accepted parsed arguments. I refactored so that main accepted the unparsed argument list, then did parsing inside main.
sct_dmri_compute_dti: Param().verbose was used as a sort of global default. I refactored this to use an explicitly passed verbose variable.
sct_download_data: The function get_parser took a dict_url parameter, when usually this function doesn't take parameters. Instead, I made dict_url a global variable.
sct_extract_metric: Like sct_denoising_olm, it did parsing within if __name__ == "__main__", then main() accepted parsed arguments. I refactored so that main accepted the unparsed argument list, then did parsing inside main.
sct_flatten_sagittal: Like sct_denoising_olm, it did parsing within if __name__ == "__main__", then main() accepted parsed arguments. I refactored so that main accepted the unparsed argument list, then did parsing inside main.
sct_get_centerline: Add verbose typing.
sct_register_multimodal: The function get_parser took a paramregmulti parameter, when normally this function doesn't take parameters. Instead, I made paramregmulti a global variable, which also removed a duplicate definition in the process.
sct_warp_template: Param() was used as a sort of global default. I refactored this to use an explicitly passed variables (verbose, folder_template, folder_atlas, folder_spinal_levels, file_info_label, list_labels_nn)
unit_testing/test_centerline and unit_testing/test_qmri: I made a quick tweak because they were calling init_sct to set logging levels.

Linked issues

Fixes #3085.

See https://github.com/neuropoly/spinalcordtoolbox/pull/3091/files#diff-67e76316116b9f8c81ccb907f018ca6710adf11a6f8f261a06fa5823ab48d0a8R119 --> should it display 'all' the verbose possibilities ? (0,1 and 2)

Thanks for this amazing work. This is huge! I tried to be as exhaustive as possible in my list regarding the inconsistent verbose help. Otherwise it looks pretty good !

I agree, verbosity is indeed inconsistent. I was kind of avoiding fixing verbosity in this PR, just because there is another issue for handling verbosity (#2676), and I thought it would be better to split the work across 2 PRs. 😅

Oh ok, I get it! No problem, you are right it might be a bit out of the scope of this PR.

On second look, @lrouhier, I think you were right about verbosity. I think it needs to be handled in this PR.
In many places, verbose = int(arguments.v) was used. (i.e. the type conversion was done outside of argparse). Thus, I also needed to fix every instance of string verbosity in argparse, which I haven't done yet.

Apologies for the expanded scope of the PR, but could you re-review the PR (specifically a89c09b), @jcohenadad?

Ah, I didn't realize how strange comment threads look on GitHub when a review is given on a specific commit. Oops. :sweat_smile:

didn't have time to dig deep, but i'm helping a group in Zurich with an SCT pipeline, i'm on your branch, and i ran into this:
sct_process_segmentation -i t2_tra_seg.nii.gz -perslice 1 -vertfile t2_tra_vertlevels.nii.gz -o /Users/julien/temp/20201217_inspired/results4/results/csa-SC_T2.csv -append 1 -qc /Users/julien/temp/20201217_inspired/results4/qc -qc-subject HC02
--

Traceback (most recent call last):
  File "/Users/julien/code/sct/spinalcordtoolbox/scripts/sct_process_segmentation.py", line 352, in <module>
    main(sys.argv[1:])
  File "/Users/julien/code/sct/spinalcordtoolbox/scripts/sct_process_segmentation.py", line 343, in main
    generate_qc(fname_segmentation, args=args, path_qc=os.path.abspath(path_qc), dataset=qc_dataset,
NameError: name 'args' is not defined

meaning: we might also want to make our tests more sensitive (this is the kind of stuff that should be caught by our CI)

meaning: we might also want to make our tests more sensitive (this is the kind of stuff that should be caught by our CI)

Yes, agreed. sct_process_segmentation is only tested using the command sct_process_segmentation -i t2/t2_seg-manual.nii.gz. None of its other arguments are tested (e.g. -qc in this case), and no results are checked.
I would be happy to spend time writing additional tests to increase coverage. It's just a matter of prioritizing. :sweat_smile:

I would be happy to spend time writing additional tests to increase coverage. It's just a matter of prioritizing. 😅

that would be amazing, and yes, i am fully aware of the massive amount of work ahead of us 😅

Hiyo, this seems to have broken install_sct? https://travis-ci.com/github/neuropoly/spinalcordtoolbox/jobs/465498727#L1036
Validate installation...
--
Spinal Cord Toolbox (git-HEAD-ade09ab7f5b22aa3c9028d3a719a591125968a85)
sct_check_dependencies
--
usage: sct_check_dependencies
       [-h]
       [-complete]
       [-short]
Check the installation and environment variables of the toolbox and its dependencies.
OPTIONAL ARGUMENTS:
  -h, --help  Show this
              help
              message and
              exit
  -complete   Complete
              test.
              (default:
              False)
  -short      Short test.
              Only shows
              SCT
              version,
              CPU cores
              and RAM
              available.
              (default:
              False)
Open a new Terminal window to load environment variables, or run:
source /Users/travis/.bashrc
Installation finished successfully!

-h should return an error code unless the user asked for it. I think the subtle mistake is this line:
https://github.com/neuropoly/spinalcordtoolbox/blob/d925ab5da582f52c8d8f495876a13adceea01523/spinalcordtoolbox/scripts/sct_check_dependencies.py#L207
argparse should already be smart enough to handle no args -- and to return an error code -- in that case. What happens if you just leave that off?

Answering my own question: removing else ['--help'] repairs sct_check_dependencies. It's usual call has always just been sct_check_dependencies.
Are there other scripts that might have the same glitch?


feature: goleft indexcov output in multiqc report

Hi Brad,
Would it be possible to include the output of goleft indexcov in the multiqc report? This is already supported by multiqc natively and would be a nice addition to an already awesome report.
Thanks!
M

Matthias;
I'll have to dig into this more as it should work. I wrote the MultiQC goleft indexcov module to integrate with bcbio, so it did work at some point so I'm not sure what happened to make it stop functioning. To troubleshoot, does your project have goleft output in coverage/sample/indexcov? indexcov doesn't always work with smaller panels and exome data, which could explain it for a specific sample. Thanks for the help debugging.

Hi Brad,
Thanks for the reply. The only output we have incoverage/sample/indexcov is the one from sambamba, so no indexcov.
I noticed there was some code related to indexcov and MultiQC, but I've never really seen any output from it. I'll try and play around with some more settings and files. Since we only have exome data, this could be the cause.
Thanks again
M

Matthias;
Sorry, that's my mistake. You'd expect to see the files in the QC directory qc/sample/coverage/indexcov. Practically indexcov works best on whole genome BAMs as the data in the index isn't defined enough to give a ton of information on exomes or panels, so may not produce any output. If you see indexcov output and it's not going into MultiQC definitely feel free to reopen and we can investigate more.


Add User-Agent header to all outbound requests coming from the API

Fixes

Fixes #826 by @sarayourfriend
Description

The fix should be applied to all outbound requests that could make a request to Wikimedia, not just in the Watermark endpoint. This is all of our outbound requests, so I've had to update all our outbound requests for it.
I tried to explore some ways of centralising this configuration, primarily by subclasses requests.Session and forcing a purpose kwarg to be present on all calls to ::request that would then configure the UA header, but it seemed heavy and I wasn't sure exactly how it would work or if folks would like that. I think it would make things a little easier to manage, or at least easier to not make mistakes with. But we also use grequests and urlopen which would still need their own bespoke solution... so I opted for the simplest approach across the board for now. We can improve this/generalise/abstract on it later if we want.
Testing Instructions

Run the app locally and ensure there are no issues.
Check out the unit tests. The ones involving urlopen were a complete nightmare to write!
Checklist

[x] My pull request has a descriptive title (not a vague title like Update index.md).
[x] My pull request targets the default branch of the repository (main) or a parent feature branch.
[x] My commit messages follow best practices.
[x] My code follows the established code style of the repository.
[x] I added or updated tests for the changes I made (if applicable).
[x] I added or updated documentation (if applicable).
[x] I tried running the project locally and verified that there are no visible errors.

Developer Certificate of Origin

Developer Certificate of Origin
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.

Blocked by https://github.com/WordPress/openverse-api/pull/875


Please consider to add progress indicator for time consuming command in the clusteradm

So far, there are several time consuming command in the clusteradm,
E.g.
clusteradm join
During the command runs, there is no indicator to show the progress, which makes user confused that whether the command is running or it already die.

/label enhancement

This could be an enhancement

@kim-fitness , Currently, there is a --wait option,  it could display our internal process. Is that could meet your request, Thanks :
llhu@huleis-mbp clusteradm % bin/clusteradm join --hub-token XXXX --hub-apiserver https://<IP_ADDRESS>:62556 --wait --cluster-name llhu-1  --force-internal-endpoint-lookup
CRD successfully registered.
⠸ Waiting for registration operator to become ready... (ContainerCreating)   <<<<<<<<<<<<<<<<

@kim-fitness , Currently, there is a --wait option, it could display our internal process. Is that could meet your request, Thanks :
llhu@huleis-mbp clusteradm % bin/clusteradm join --hub-token XXXX --hub-apiserver https://<IP_ADDRESS>:62556 --wait --cluster-name llhu-1  --force-internal-endpoint-lookup
CRD successfully registered.
⠸ Waiting for registration operator to become ready... (ContainerCreating)   <<<<<<<<<<<<<<<<

If the --wait is a global parameter, then I think it fulfilled the requirement.


Copy and paste

Problem description
Right now, it is not possible to copy content from cell/cells and paste it.
Steps to reproduce it

The user opens the ODE.
Go to ADD---FILE and selects a tabular file.
Once the ODE previews the data, delete content from one cell.
Try to copy content from one cell and paste it.

Suggested solution
Enable copy and paste. This will save a lot of time, especially when making changes in large tables.

Hi! Adding more context here :)
In the current version of the ODE, it is not possible to copy and paste content from cell to cell, but also from a range of cells.
In addition, I was wondering if it is possible to apply shortcuts here: Ctrl + C to copy and Ctrl + V to paste data.
Note: the cut function is also inactive. Do you want me to create a separate ticket for that @guergana?

For reference: https://reactdatagrid.io/docs/clipboard#copy-paste-selected-cells

Hello @roll @romicolman @pdelboca for this ticket there is a functionality included in our tables component to do it but I get this message in the console 😅 . I think that for the magnitude of this project and other features we may need it is worth investing in the Enterprise Edition. What do you think?

The price is a bit steep considering that there's a lot of functionality that is free... but why spend time trying to invent the wheel if this has already been developed and there may be a budget for it.
https://reactdatagrid.io/pricing

@guergana @roll and @pdelboca From the product perspective: while it is true the cut function is useful, let's first focus on enabling the copy and paste. What I can do is create a separate ticket for the cut feature and if we have time before the release of the stable version, we can handle it at that time.

@guergana @pdelboca and @roll let's discuss this today's stand-up. I think what @roll suggested on the Slack channel is a good way to go :)

@sapetti9 This is the issue we discussed yesterday.

Email sent to the ReactDataGrid team. I'll keep the issue "on hold" until I get a reply.


upgrade to react 16.6

@zerob4wl thank you for your contribution, i'll check it ASAP.

@mberneti waiting for this...


Bitboards should use tuples rather than lists

This should be a pure performance win.

thanks for the hint
are you referring to the moves list (or arrays in general)?
https://github.com/alemelis/Bobby.jl/blob/2e1e8b27bd0a6c007c14ed681b73d868e1e1627e/src/structs.jl#L52-L54

No. I meant things like lines 1-10 of king.jl (and for all the other magics). This matters because tuples are immutable, so lots more optimizations become valid by default.

this is a good point
indeed I guess it would be beneficial to add some benchmarks to the repo so that all these improvements can be tracked
(by the way, PRs are welcomed 🙂  )


Listening.close() does not close the server

I'm trying to run a hyper server, but after closing the guard, I can't drop it and it hangs. Here's some example code where it happens (sorry for the muda, was trying a ton of things)
fn request_temp_code() -> TempCode {
    Command::new("xdg-open").arg(format!("https://slack.com/oauth/authorize?client_id={}", SLACK_CLIENT_ID)).output().unwrap();
    let server = Server::http(Ipv4Addr(127, 0, 0, 1), 9999);

    let (tx, rx) = channel();
    let mtx = Mutex::new(tx);

    let mut guard = server.listen(move |req: Request, res: Response| {
        match req.uri {
            AbsolutePath(path) => {
                // Trying to manually drop to see if this is the problem
                let tempcode = extract_temp_code(&path).unwrap();
                let gmtx = mtx.lock().unwrap();
                gmtx.send(tempcode).unwrap();
                drop(gmtx);
            },
            _ => ()
        }

        let mut res = res.start().unwrap();
        res.write_all(b"Thanks! Please return to Lax").unwrap();
        res.end().unwrap();
    }).unwrap();

    let tempcode = rx.recv().unwrap();
    guard.close().unwrap();
    println!("{}", "Auth code received!");
    println!("{}", "Server closed!");
    // Hangs here
    tempcode
}

I haven't tried this with earlier versions of hyper (I think, not tracking numbers), however one of the last commits did involve changes related to the thread spawning into the acceptor. Have I found a possible bug?

I also tried unparking the thread, to no avail

Hmmm... It's likely that the guard returned by server.listen is incorrectly blocking for too long. I have to take another look at the code because this should work fine.
In order to facilitate fixing this, can you provide a standalone example that reproduces?

Sure! Let's see if I can do that in under ten minutes :-)

Ohh, close https://github.com/timonv/hyper_blocking_example

From the code in your example I think it's very likely that the problem was some deadlock in your code fixing channels and mutexes, since there is no reason hyper would treat that function different than any other function.
Closing, unless you can reproduce (since I can't :/).

You can't? The example I gave doesn't work. :(

@reem Not sure if I need to mention for closed issues, but doing it anyway. Why would it deadlock? The mutex guard should be dropped right after the handler finishes it's shizzle. Is there anything else I can do to make this work? Maybe if Handler supported Copy I could just use an Arc.
I'd like to have this out of the way as its just the auth part of the project anyway :')

@timonv I looked at the example more closely and the issue is actually clear, I just didn't spot it before. The guard is created in get_message, so get_message is going to block until the entire server is done, have get_message also return the guard or create it in main to make things work.

@reem So I can't just create a server, get the token and ditch the server again? I can have the guard in the main loop sure, but that seems like an ugly and unneeded solution, as it would essentially keep the entire server open for the duration of the app. If it blocks untill the entire server is done, then you'd kinda expect it to stop over time.

You can close the server by calling .close() on the guard. You should just do this after you receive the message, if you want to close the server right then.

However, know that hyper runs servers with a thread pool by default, so you should take care to set the thread number to 1.

@reem I was already closing the guard. I tried moving to a single thread for gigs yesterday but it didn't work. https://github.com/timonv/hyper_blocking_example/blob/master/src/main.rs
The weird thing is, if you print some giberish at the end of the handler, it gets printed. What could Thread::scoped's join guard be waiting for? No trouble dropping the mutex guard either.

I will investigate this further, reopening.

@reem I seem to be facing the same issue in a similar use case: [very simplified version] (https://gist.github.com/Ryanl92/fc31efbef1c3ce530a77). I've narrowed it down to a problem when the Listening struct is dropped.
Of note also is that the handler is still active after the call to close().
Is there anything I can help with to track down this problem?

At the moment, std::net::TcpListener has lost the ability to closed, which is what used to power this functionality. In order fix this, we would likely need some sort of channel that would send(Close), and the ListenerPool would need to recv on this channel to determine if it should continue listening. It would also need to close the listening port.

I just want to remark that I'd like to use close. A solution would be appreciated! :)

I encountered this issue too. For reference, here's a simpler piece of code that shows Listening.close() doesn't work:
extern crate hyper;

use hyper::server::{ Server, Request, Response };
use std::thread;

fn hello(_: Request, res: Response) {
    res.send(b"Hello World!").unwrap();
}

fn main() {
    let mut listening = Server::http("<IP_ADDRESS>:8000").unwrap().handle(hello).unwrap();
    println!("SERVER STARTED");
    // Check with your OS that the port is open. For instance:
    // `watch -n 0.1 "lsof -Pan -i tcp  | grep 8000"`
    thread::sleep_ms(5000);
    listening.close();
    println!("SERVER STOPPED");
    // See the port is still open
    thread::sleep_ms(5000);
}

I wonder if we shouldn't update the documentation, until a fix gets merged.

It now does do something on master.

I'm sorry but I don't understand why this bug has been closed. The problem still exists right?
I am doing intergration test and spin up a new hyper server for each test. I use a pool of port number but the thing is that Hyper never release the port after being closed meaning that I can't run all my tests...

I have the same use case as @thibaultdelor, and am seeing the same problem. Using hyper 0.9.12 and rustc 1.14.0-nightly (5665bdf3e 2016-11-02)

I am still having this issue (using iron 0.5.1, hyper 0.10.4, rustc 1.15.0. @seanmonstar should this issue be really closed?

Yeah I'm seeing this on iron 0.5.1, hyper 0.10.7, and rustc 1.16.0 still.  Calling close at least seems to let the drop happen without a deadlock, but the server is obviously not shut down.

I'm not sure this belongs here necessarily, but the code references this issue specifically.
It think it would be useful if detach returned the spawn handle, so a join could be done later on for the main thread to block. Any thoughts on this?
https://github.com/nickel-org/nickel.rs/blob/d5b9271b18d22e858c9dc858ef52deef95d7f11a/src/server.rs#L106

Definitely still happening with rustc 1.23.0-nightly and hyper 0.10.13. This issue should be reopened.

The 0.10 branch is no longer seeing development. A way to shutdown servers that works is in 0.11. Fixing this is non trivial, and so likely won't be fixed. If someone would like to submit a change that fixes this in 0.10, a new release could be made.


Environments page showing error on Dev Boxes

Dev Home version
0.1201.466.0
Windows build number
10.0.26100.1
Other software
OS Build Version: 10.0.26100.1.amd64fre.ge_release.240331-1435
.NET Version: .NET 8.0.3
Steps to reproduce the bug
Open environments
Expected result
Hyper-V VMs and Dev Boxes load without showing an error
Actual result
Saw an error "Microsoft DevBox Unable to retrieve Dev Boxes.


added CI for MinGW

Added CI for MinGW
While testing the MinGW_build_support, we needed CI to check if the implementation was correct.
Type of change

[x] New feature (non-breaking change which adds functionality)

@RohanKrMahato you created the PR again but it's the same code as before, I can't see the build matrix..

I am leaving this here for reference: https://github.com/msys2/setup-msys2/blob/main/examples/cmake.yml

@RohanKrMahato you created the PR again but it's the same code as before, I can't see the build matrix..

I was testing on my local machine and different branch on the forked repo. I will push here, a little bit of work remaining :)

@viferga

Added all the combination of Release and Debug, also added the Ctest... Sir, I have changed the Default shell from Msys2 shell to Cmd and it is now working fine. (the test in the image are red as I have tested it on a repo which don't handle MinGW cases).

@viferga Sir, I'm sorry for the last comment, but what I noticed that changing the default Shell can have consequences, actually what was happening ( and why i thought it was working ) was that the cmd for all the test in Msys2 environment was taking the same compiler.
Note: Now I changed the Default shell to Msys2 however now Clang64 is working fine, but not MinGW 64,32 & Ucrt64 (it is giving the following error, may be it is because of the strict type conversion feature of compiler).
I'm attaching the error with MinGW64, (Ucrt also giving the similar error)
types]
  134 |                 NULL, 1, 0, (LPTSTR *)lpt_str, NULL);
      |                             ^~~~~~~~~~~~~~~~~
      |                             |
      |                             CHAR ** {aka char **}
In file included from D:/a/_temp/msys64/mingw64/include/windows.h:70,
                 from D:\a\core\core\source\log\source\log_policy_stream_syslog.c:23:
D:/a/_temp/msys64/mingw64/include/winbase.h:2578:165: note: expected 'const CHAR **' {aka 'const char **'} but argument is of type 'CHAR **' {aka 'char **'}
 2578 |   WINADVAPI WINBOOL WINAPI ReportEventA (HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID, PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCSTR *lpStrings, LPVOID lpRawData);
      |                                                                                ~~~~~~~~^~~~~~~~~
mingw32-make[2]: *** [source\log\CMakeFiles\log.dir\build.make:469: source/log/CMakeFiles/log.dir/source/log_policy_stream_syslog.c.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:5501: source/log/CMakeFiles/log.dir/all] Error 2
mingw32-make: *** [Makefile:155: all] Error 2


Feature request "focus follow mouse"

[ ] focus follow mouse
[x] mouse follow focus https://github.com/nikitabobko/AeroSpace/issues/12#issuecomment-2254162063

Okay, since I don't use this feature, and I don't understand why people use it. What are the workflows of people who use it?
There are several controversial questions:

How should users be able to access the menu bar? (in macOS, the menu is not within window borders) Once the mouse is moved out of the window border, the focus changes
If the cursor is within the currently focused window bounds, and I change focus with keybinding. Then I slightly move the mouse keeping it within the previously focused window, should the window receive the focus back? Or does the focus change only once the mouse crosses borders?
How floating windows should be handled? Are they prioritized over tiled windows?

https://www.reddit.com/r/i3wm/comments/141mkdy/comment/k84qrp7/?utm_source=share&utm_medium=web2x&context=3

+1 for this feature, it will be hard for me to leave yabai without this

example workflows

when using web browser using touchpad, and I'll want to change focus to the text editor - it's faster to change focus with focus follow mouse feature when I already have my hand on touchpad, than press CMD+ (especially if the window that I want to focus is further away, eg Id have to do CMD+left+left+up).
I want for example click play on a song in Apple Music while having focus on some other window. When using touchpad and without having FFM, I need to mouse-click on the window to first activate it before I can use it, meaning, without FFM I need to click twice to actually play the song

I'll describe my use-case as well:

How should users be able to access the menu bar? (in macOS, the menu is not within window borders) Once the mouse is moved out of the window border, the focus changes

I'll rarely use the menu bar - I either use shortcuts or if make my window fullsize if I need it

If the cursor is within the currently focused window bounds, and I change focus with keybinding. Then I slightly move the mouse keeping it within the previously focused window, should the window receive the focus back? Or does the focus change only once the mouse crosses borders?

I use focus follows mouse + mouse follows focus in i3/sway/yabai, so the cursor moves to the center of the focused window if I use the keyboard to change focus.

How floating windows should be handled? Are they prioritized over tiled windows? How to choose between several overlaping floating windows? It looks like macOS doesn't allow to check "the stack" of windows, so I can't just pick the most recent

I don't know the solution to this one, but I would personally be fine with this working any way (or not) with floating windows as I don't mind clicking these.

This could be a good reference for implementing it: https://github.com/sbmpost/AutoRaise

I use this feature a lot in i3. My most use case for copy pasting. I select a text with a mouse on workspace A, move my mouse to workspace B and paste there. I don't need to click on a mouse to focus the window buy just hit the copy and paste shortcut.

This is how I use it, hope it helps.

How should users be able to access the menu bar? (in macOS, the menu is not within window borders) Once the mouse is moved out of the window border, the focus changes

With Sway/i3 and Yabai, the menubar (or whatever bar) does not steal focus, ever. So it is very much possible to use it while focus follow mouse is enabled.
I believe that is the default behavior of macOS menubar even without focus follow mouse. When clicking it, the current focused window remain focused.
If the current focused window is floating, leaving the window and moving the mouse over the (empty) desktop does not make it lose focus

Clicking on the desktop might make it lose focus however, if the user have file/app icons on desktop (I don't).

If the layout is horizontal (one window on top of another) then it is only possible to access the menubar menu of the top window, since the mouse must hover over it to reach the menubar.

If the cursor is within the currently focused window bounds, and I change focus with keybinding. Then I slightly move the mouse keeping it within the previously focused window, should the window receive the focus back? Or does the focus change only once the mouse crosses borders?

Yes, the slight change on the mouse gives the focus back to the window below it.

As @fmasa suggested, using it in conjunction with mouse follows focus remediates this issue
I believe some WMs have a deadzone or minimum motion to prevent accidentally moving the focus away, but I never tested it.

How floating windows should be handled? Are they prioritized over tiled windows? How to choose between several overlaping floating windows? It looks like macOS doesn't allow to check "the stack" of windows, so I can't just pick the most recent

Just like tiled windows. If the mouse move inside its boundaries they gain focus. When the mouse leaves them, the window below gain focus.
If I do remember, in Sway, floating windows are always on top. With Yabai they might move behind a tiling window, which can be annoying since it becomes out of reach.

+1 for this. The key use case for me is to be able to switch to windows on multiple monitors for copy paste from browser to editor.

+1 for adding this in. In the meantime for anyone wanting this functionality, I found that https://github.com/sbmpost/AutoRaise gets the job done.

Pretty please. This seems like a no-brainer to have.

My use case is simply having the mouse follow me to the active screen; can't do everything with keyboard and this saves time compared to dragging it all the way to the next screen. Luckily AutoRaise also covers this with its warping!

+1

To add context on why this is useful:

I have dual monitors
I'm coding in my IDE and I click a button to run my app (workspace 1)
I use my keyboard to snap to my web browser running on my second monitor (workspace 2)

If I need to click a button on my web browser I now have to drag my house across potentially 2 full monitors. It's not the end of the world but it's annoying.
Would anybody mind sharing their AutoRaise config btw?

This my config (stored at ~/.config/AutoRaise/config):
#AutoRaise config file
pollMillis=50
delay=2
focusDelay=2
warpX=0.5
warpY=0.5
scale=1.5
altTaskSwitcher=true
ignoreSpaceChanged=false
invertIgnoreApps=false
ignoreApps=""
ignoreTitles=""
stayFocusedBundleIds="com.apple.SecurityAgent,..."
disableKey="control"
mouseDelta=0.2

I wish that it wouldn't focus my background "stacked" windows which sometimes I get surprised by when I mouse over them. I'd still much rather have this in AeroSpace itself to "focus" windows in the workspace when I switch. But for now this hack works fine.
I can't get it to auto-launch with AeroSpace in my config properly, so I just run this in a terminal. Good enough, but if somebody knows how to make it launch in the background that would be pretty cool too!

I second everything that was said above, and I'd add that since creating a new window doesn't automatically focus it (I often do cmd + shift + enter to open a new terminal and then immediately start typing because i have a command in mind), after a window is created I have to look for where it is, THEN click - so 2 "tasks". I want to have to only look for where it is, fling my mouse over there and start going. It's ridiculous how often I send a mistaken slack message whose content is ghci instead of running it because i forgot to click on the new window which i obviously want to focus immediately after creating (i tried to hack around this using list-windows and matching on any newly created window in on-window-detected, but because there's no metadata to the windows regarding which was most recently created, this is impossible).

If you want to have "mouse follow focus" feature from autoraise remember to enable altTaskSwitcher=true and the warpX and warpY at 0.5 or it won't work.

Update
Since 0.13.1-Beta, AeroSpace introduces:

move-mouse command https://nikitabobko.github.io/AeroSpace/commands#move-mouse
on-focus-changed/on-focused-monitor-changed callbacks https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks

The combination of these two allows to have very configurable "mouse follows focus" workflow (but not vice-versa yet):
on-focused-monitor-changed = ['move-mouse monitor-lazy-center'] # mouse lazily follows focused monitor (default in i3)
# or
on-focus-changed = ['move-mouse window-lazy-center'] # Mouse lazily follows any focus (window or workspace)

Consider sponsoring the project to see more cool stuff! https://github.com/sponsors/nikitabobko

@nikitabobko Following your call to action I went ahead and sponsored, hoping maybe it'll help you be able to work on this.

How should users be able to access the menu bar? (in macOS, the menu is not within window borders) Once the mouse is moved out of the window border, the focus changes

This happens to me in yabai; I usually just cmd+tab back to the window that previously had focus once I reach the menubar. Not ideal, but it's an acceptable tradeoff. Probably worth noting that I personally do not use "mouse follows focus" as I sometimes switch to a window just to use a keyboard shortcut and don't want the mouse jumping around on me.

Adding to this discussion, I also used yabai and now Amethyst, and find focus follows mouse invaluable. I have resigned using the menubar with mouse and instead Cmd Shift /. It is the tradeoff I have accepted. I also do not use mouse follows focus.
yabai was quite finicky when I used it, and I appreciate Amethyst for playing nicer as an app, which happily seems to be what this project is aiming to be.

How should users be able to access the menu bar? (in macOS, the menu is not within window borders) Once the mouse is moved out of the window border, the focus changes

In yabai you can assign a key which temporarily disables "focus_follows_mouse" when held. From yabai docs:

Focus follows mouse is disabled while holding the mouse modifier key so that you can access the menu bar easily.

+1 for FFM

damn sorry to see Aerospace lacking this essential functionality.. but glad to see a lot of people requesting it!

Is it possible to ignore certain apps/windows for the on-focus-changed event? I set it up with the move-mouse command to implement focus follows mouse. With yabai I was able to except iStat Menus from this since it doesn't play well with the option:
yabai -m rule --add app="(^.*iStat Menus Status.*$)" mouse_follows_focus=off manage=off

But I don't see a way to do this in Aerospace


Add page_token into CallOptions (and retire is_page_streaming)

From https://github.com/googleapis/toolkit/issues/139:

CallOptions should accept 'page_token' field as a parameter to start a stream from a specific position
PagedEnumerable should provide the interface to access to the current response object and the next page token in the current response (they are accessible through page instance, but a bit obscure).
remove is_page_streaming from CallOptions. page-streaming methods should always return PagedEnumerable.

#20 actually fixed this.


ta3 (simulation/calibration/optimization)result cache

Summary
Simple FIFO cache to reduce the number of API requests we make to fetch TA3 results.
In a nutshell we have a tendency to fetch the same set of things multiple times; for example forecast-result is used for both the preview-component and the full drilldown-component. Having an application-level cache means we make less API requests.
Testing
Run simulate or calibrate, there shouldn't be any errors.
The actual performance gain of the cache is hard to observe, because the other requests (e.g. fetching Dataset) overshadows the improvements made here. But roughly it takes around 400ms to fetch simulation results + light processing, with cache this drops to around 30-40ms.

I do not understand why we are not caching on the back-end and provide proper caching tag on the request so that the browser would handle that itself?

I do not understand why we are not caching on the back-end and provide proper caching tag on the request so that the browser would handle that itself?

@YohannParis you are talking about two separate things, but we definitely could do one or both of them

caching on the backend, sure
caching tags is actually caching on the front end, this is a bit more complicated because the browser doesn't always follow your instructions and generally doesn't like to cache responses past some threshold size

The benefit of this client-side caching, is that it is easy to implement and you can more closely tailor it to the user's actions, this is also possible at the backend but your cache-tables/cache-maps will probably become more complicated (e.g. if you want to do per user or per session cache).


composer error

[InvalidArgumentException]
Could not find package sngrl/php-firebase-cloud-messaging at any version for your minimum-stability (stable). Check
the package spelling or your minimum-stability

At the moment there is only a dev-master version, most likely you have a property composer.json "minimum-stability" is set as "stable". Change it to "minimum-stability: dev" and it will work.
Write whether you have received from you.

In La-ravel 5.2, I encountered same error as reported here.
I only changed that: Instead of keeping the package name in the require, I kept inside the require-dev. Then, it's working fine for me

I wouldn't advice anyone to just convert to dev stability, what you should do is:
{
  "minimum-stability": "dev",
  "prefer-stable": true
}

This would allow only packages that can't resolved with stable version to use dev.

What is the ETA on a stable version?


Ideas for resources

Description of the new feature / enhancement

The Settings file is huge. We can split off the OOBE and Flyout strings to a new file.

https://learn.microsoft.com/windows/uwp/app-resources/localize-strings-ui-manifest#factoring-strings-into-multiple-resources-files
Maybe OOBE and Flyout should be a separate project?

There are a few cases where a module's name is set in a few redundant strings. We could remove the duplicates and re-use the remaining ones. (think of Settings > ModuleTitle versus OOBE and Navigation strings)

This also prevents different translations

We can "squash" all the "Enable <module>" into one general "Enable". Same for all the "Learn more about ..." HyperLinks.

use "Enable {0}" where the name is filled in (or...)
is <Hyperlink><Run x:UID="LearnMore"><Run x:UID="ModuleName"></HyperLink> possible?

Every data name="<modulename>.SecondaryLinksHeader" is identical and thus redundant.
Check for unused data.

src/modules/fancyzones/FancyZonesLib/Resources.resx
src/runner (e.g. STARTUP_DISABLED_BY_USER)

Should we be using resX or resW?

I wonder if there's an automated way to filter out all unused strings from the Resources file. I think, due to UI changes and other things, we might have a lot of dead strings that can be removed.

I wonder if there's an automated way to filter out all unused strings from the Resources file. I think, due to UI changes and other things, we might have a lot of dead strings that can be removed.

I can't think of anything. Maybe somebody can write a AutoIt script that takes the data-names from the res, crawls through all the files and makes a list of all the ones that it can't find 😅

@ethanfangg what are your thoughts?


pip error

first line "python >= 3.9" giving me pip error: "ERROR: No matching distribution found for python>=3.9". commenting that resolves the issue

Hi Riko,
One way to solve this is just comment out or remove the first line in the requirements.txt, as pip can not install python itself.
You are required to have python interpreter and pip first, what should be noted the cryspr should work with python 3.9+.
Although requirements.txt is typically for dependencies installation, I personally not recommend to use it but to use pip install [package] directly.
To make requirements.txt more usable, I've updated the it to work properly for pip install -r.
Should be noticed that if you use conda to install the dependencies, the distribution names for torch and mace-torch (which is the names on pypi) should be pytorch and pymace (for conda distribution).
Hope this help.
;)


TLS integration for tempo endpoints and server

TLS integration support for Tempo charm
In principle ready for review, but it depends on ingress #94
Testing instructions:
juju add-model test-tempo-tls
juju deploy cos-lite --trust
charmcraft pack
jhack deploy
jhack imatrix fill

you should be able to see charm traces in grafana for all the charms.
verify that all receiver endpoints are using https:
juju run tempo/0 list-receivers

if we enable tls for tempo and another charm for charm tracing
and then we disable tls on tempo and the other charm, App data will not change (internal_scheme will still remain as https) and that will fail non-tls communication
is this a valid scenario to cover?

@PietroPasotti  @mmkay
when certificates are pushed into the workload container, its an ephemeral volume
so, in case of pod crash and restart, the certificates will be no longer there. Once tempo is back up, it will run as non-tls, but all databags are expected to send to a tls endpoint, so tls is now broken.
prometheus handles that https://github.com/canonical/prometheus-k8s-operator/blob/main/src/charm.py#L546


implement 'realpath' in Host to properly resolve symlinks

With https://github.com/Microsoft/TypeScript/pull/8486 it is now possible to follow symlinks obtained as a result of module resolution to its actual location. In order to support this custom implementations of CompilerHost should expose realpath function which will be called by the compiler as an epilogue of node module resolution.

For context, the realpath function is a fix for a real bug that my project encountered when using the "npm link" command.  For a repro, try running build.cmd from this archive:
NpmLinkRepro2.tar.gz

I am experiencing the symlink issue whilst using TypeScript with gulp-typescript.
I tried following the following advise from the readme of this project:
npm install typescript@next
...
Or in combination with a tsconfig file:

var tsProject = ts.createProject('tsconfig.json', {
    typescript: require('typescript')
});

However the issue still persists and I am not entirely sure whether gulp-typescript is using the latest development build or the older one that still exhibits this issue.
Many thanks

@kruncher symlinks were not supported yet when you wrote that, that was what this issue was tracking. You can now try the latest version, which should support them.


feat: support redirect, headers, and cors route rules

🔗 Linked issue
resolves #535, resolves #539, resolves #95
❓ Type of change

[ ] 📖 Documentation (updates to the documentation or readme)
[ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
[ ] 👌 Enhancement (improving an existing functionality like performance)
[x] ✨ New feature (a non-breaking change that adds functionality)
[ ] ⚠ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description
This implements redirect route rules (including platform-specific support for vercel + netlify cdns).
It also implements headers and cors route rules. Apologies @pi0, I spotted too late you had self-assigned the cors route rule. 😬 Not my intention; happy to revert it - or feel free to amend PR.
📝 Checklist

[x] I have linked an issue or discussion.
[ ] I have updated the documentation accordingly.

Thanks for this amazing PR @danielroe <3 I've added some notes, they need to be addressed before next nitropack release ~> #570 (selfassigned)


-g option for global packages

Clear and concise description of the problem
There is no way to check updates for packages installed in a global scope (npm/pnpm install * -g).
Suggested solution
Add -g option to check/write updates for packages installed globally.
Alternative
No response
Additional context
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guide.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Doesn't seem to support pnpm currently.

The loadGlobalPnpmPackage method throws an exception
Current environment

The pnpm version is 8.8.0.
taze version is 0.11.3.
The output of command pnpm ls --global --depth=0 --json is

[
    {
        "path": "C:\\Users\\simexce\\AppData\\Local\\pnpm\\global\\5",
        "private": false
    }
]

Reason
 pnpmOut => Object.entries(pnpmOut.dependencies)，pnpmOut.dependencies is undefined.

Also, does not work on Node 22.
PS C:\Windows\System32> taze -g
TypeError: Cannot convert undefined or null to object
    at Function.entries (<anonymous>)
    at loadGlobalNpmPackage (file:///C:/Users/User/.bun/install/global/node_modules/taze/dist/cli.mjs:942:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async checkGlobal (file:///C:/Users/User/.bun/install/global/node_modules/taze/dist/cli.mjs:850:22)
    at async Object.handler (file:///C:/Users/User/.bun/install/global/node_modules/taze/dist/cli.mjs:1060:18)


Enable SUPPORT_FRACTIONAL_TRANSLATION for desktop (and mobile if benchmarks permit)

See https://github.com/flutter/engine/search?q=SUPPORT_FRACTIONAL_TRANSLATION
Enabling SUPPORT_FRACTIONAL_TRANSLATION removes the physical pixel snap from engine layers. It is off by default due to mobile performance issues, specifically on iOS32 bit but potentially on newer devices as well. See also https://github.com/flutter/flutter/issues/56722
Unfortunately there are two major drawbacks of having this disabled, namely:

The physical pixel snap is much more noticeable on platforms that have lower DPRs. On desktop, close to 1.0 is common and that causes issues such as https://github.com/flutter/flutter/issues/71008.

The physical pixel snap causes flutter_tester to render nearly identical UI differently based on whether or not an engine composited layer is updated. This causes problems rolling into google3 due to the large number of golden tests, for example https://github.com/flutter/flutter/pull/102274

We should opt desktop into this define. This will require us to separately roll an engine variant with this enabled that would allow us to gradually opt-in google3.
Migration process:

Build a new engine host variant (linux is the only variant used for golden testing in g3) and roll that into google3. This variant will have SUPPORT_FRACTIONAL_TRANSLATION enabled and no raster cache in the tester.

Run a global presubmit in g3 to determine the impact of switching to the new tester. If the number of diffs is small, do this as an atomic change. If the number of diffs is large, then we'll perform a project by project opt-in, and finally switch the default to the new tester.

Once this has landed, we update the engine build rules so that all host variants are build with SUPPORT_FRACTIONAL_TRANSLATION. After this rolls into g3, we can switch the build rules back to the previous tester variant in a non-breaking way - since it should have the same rendering output as the new tester.

Finally, we delete the new engine variant.

FYI @goderbauer , once we update g3 to this I think we could probably back out the opacity changes with no change to scuba diffs

Alternatively, we may need to keep a variant without fractional translation enabled since we may not run all of the same tests on the platform variants

From b/233382771 , all internal clients have been migrated

I've opted desktop/tester in by default.
Waiting for that to roll to google3 so we can delete fractional tester. Similarly waiting https://github.com/flutter/engine/pull/34141 to evaluate performance

Last remaining task is to wait for another google3 roll and remove the fractional tester infra

This is now fixed


I18N Registrations

All versions of DarwinServer/DarwinCore have integrated translations and permissions prepared for internal modules. Allow the registration of custom entries using a common interface, which could be used for both permissions and translations. All entries should be stored in a configuration file, and should be manually configurable for the server administration.

Implemented in https://github.com/GuusLieben/DarwinServer/commit/90c8992138d2347892247881791e835282b05c82


Error creating session

session_regenerate_id(): Failed to create(read) session ID: user (path: /var/lib/php/sessions) in /var/www/html/backstage2/lib/common.php on line 9
This error is coming when I tried creating the backstage. Backstage has many errors, one by one i am fixing it. But this error is giving me headaches. Please if anyone could help.

Same here. Anyone?

Turn off error logging for backstage2.
On Jul 22, 2017 12:20, "ftrentini"<EMAIL_ADDRESS>wrote:

Same here. Anyone?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/wlox/wlox/issues/91#issuecomment-317197886, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AF1VdRXdg5zvpbQt21Eb1x4I9Bky9M7fks5sQi9sgaJpZM4OCP7U
.

Hi, Mr Mbassan, thanks for your answer.
I don't want to avoid see the errors, I want to fix them. This is causing a lot of malfuntion all over the site, linke missing links (shares.php @ frontend) or managing the languages. I am working on it for two days, and I'm sure I will figure out, just want to know if someone had this problem already.

Backstage is supposed to run on a different server entirely from the other
repos. Whatever problems you are facing are unrelated to PHP notifications
from backstage. Fixing it is not a good use of your time.
Use mbassan/wlox by the way.
On Jul 23, 2017 20:03, "ftrentini"<EMAIL_ADDRESS>wrote:

Hi, Mr Mbassan, thanks for your answer.
I don't want to avoid see the errors, I want to fix them. This is causing
a lot of malfuntion all over the site, linke missing links (shares.php @
frontend) or managing the languages. I am working on it for two days, and
I'm sure I will figure out, just want to know if someone had this problem
already.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/wlox/wlox/issues/91#issuecomment-317295853, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AF1VddbqwknpkTogtCsQaKm4aIUdbOogks5sQ-1ogaJpZM4OCP7U
.

Good night, Mr mbassan.
I tested everything in one server, but now i'm already moving it to another, just doing like recommended.
I used your fork, but I'm using now IbinexDev's.
Thanks.

Btw, do you know where can I find the file shares.php that was suppose to be on frontend's htdocs?

did you find a solution?


update Runtime to nodejs4.3

According to Node.js 4.3.2 Runtime Now Available on Lambda

starting October 2016 you will no longer be able to create functions using Node.js 0.10, given the upcoming end of life for the runtime

"nodejs" still worked as of  4 Jan 2017, but will likely break soon

Thanks, Kevin Hakanson!


[TOPIC] K8s - Wrapping Docker Image at Runtime

Would love to see a blogpost explaining what we're doing with K8s (needing to "wrap" a docker image at runtime in K8s; sidecar + socat). @davinchia @jrhizor . It seems like what we're doing here isn't super common, so it could be a cool go to article for people in similar situations.

This is done and covered in two articles in our engineering blog:

https://airbyte.com/blog/extending-docker-images-on-kubernetes
https://airbyte.com/blog/scaling-data-pipelines-kubernetes


example module to connect to an arbitrary TCP port

I am trying to write an example module to connect to an arbitrary TCP port, send the websocket data there, and return data from this port to apache - i.e. send decoded data to the TCP port. This is basically Issue Request #1 save that I was planning to fix it myself.
I am having a little difficulty understanding the threading model this module uses.
Firstly, can I block in my on_message() handler? Can I, for instance, write the data received from the web socket to the TCP port in a manner where the TCP port may block? Or do I have to buffer everything up (possibly infinitely) for another thread to process this, in which case how do I do flow control to stop apache sending me more data?
Secondly, I need to read data back from the tcp port and pass it to server->send(). I cannot solely serve this within my on_message() handler as the on_message() handler may not be called if there is no data going in the other direction (i.e. if there is no data going from websocket to tcp port, I still need to be able to handle data that arrives on the tcp port and needs to go to the web socket). I am presuming I need to create some sort of sister thread for this? If so, is it safe to call server->send() from that thread? Can server->send() itself block? If not, how does apache ever get to tell me to 'stop sending data to me'?
I'm sure these have obvious answers, but being a little new to apache internals I am having difficulty figuring them out.

Well, I did this myself. See
http://blog.alex.org.uk/2012/02/16/using-apache-websocket-to-proxy-tcp-connection/
Please feel free to put this in the examples directory. It seems to work.


SMC Read on a unhanded 'offset' returns an incorrect value

If the offset isn't 0x07 (keyboard) or 0x21 (mouse) the emulator returns a 0xff, while the SMC code appears to return 0x00.
Emulator:

SMC:

The SMC ignores unsupported offsets.  Tested on hardware, you do get 0xff when reading from other offsets.  The Wire.write(0) with your arrow is actually inside the handler for the 0x21 offset, and not actually in the same place as the default in the emu.


Using franc in the browser?

How would you use franc without npm in the browser, and also how does one turn the 3 letter language code into the full name of the language as seen in the demo?

Hi Tang 👋
Info on how to use franc in the browser is in the installation section.
The demo uses iso-639-3. We had some discussions earlier here on the issues about those. You can search for that here to find more on language codes.

Thanks.
On 30 June 2017 at 15:29, Titus<EMAIL_ADDRESS>wrote:

Closed #53 https://github.com/wooorm/franc/issues/53.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/wooorm/franc/issues/53#event-1146668162, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ARVCV8D5SBKpFSkWaaNEGlVZ1OUZ0IU8ks5sJWjBgaJpZM4OLDqG
.


List verbs in printHelp

This could be done my either making another function printHelpWithVerb or allowing printHelp to take an optional verb union.

I just ran into the same limitation


[Bittrex] Fixed balance adapters

Fixed BigDecimal calculation with now possible null values, due to Bittrex 02/27/2019 backend update

I am not so happy to replace the nulls with zeros, but that's how it seems to work on their side now.


Fix bug in Safari, where the navigator cannot be scrolled by dragging scrollbar

Bug/issue #, if applicable: 92337769
Summary
Navigator cannot be scrolled, by dragging the scrollbar puck in Safari. This PR fixes that by adding a one line CSS fix, forcing the browser to do some stacking changes.
Dependencies
NA
Testing
Steps:

Open enough items in the navigator, to cause a scroll
Try to click and drag the scrollbar using the mouse or touchpad in Safari

Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.

[ ] Added tests - no need, CSS only
[ ] Ran npm test, and it succeeded
[ ] Updated documentation if necessary

@swift-ci test


get_lexer_for_filename() ends wih traceback

(Original issue 1185 created by bialix on 2015-12-29T11:57:46.740982+00:00)
That's probably is not strictly bug in pygments but I have no idea what's going on and how to resolve this issue. One user reported bug which occured when in our code we're calling
#!python

lexer = get_lexer_for_filename(path, stripnl=False)

And then the rest of traceback:
#!python

  File "/usr/local/lib/python2.7/site-packages/pygments/lexers/__init__.py", line 147, in get_lexer_for_filename
    res = find_lexer_class_for_filename(_fn, code)
  File "/usr/local/lib/python2.7/site-packages/pygments/lexers/__init__.py", line 112, in find_lexer_class_for_filename
    for cls in find_plugin_lexers():
  File "/usr/local/lib/python2.7/site-packages/pygments/plugin.py", line 53, in find_plugin_lexers
    yield entrypoint.load()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2379, in load
    self.require(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2395, in require
    reqs = self.dist.requires(self.extras)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2640, in requires
    dm = self._dep_map
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2861, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2884, in _compute_dependencies
    distvers, mark = self._preparse_requirement(req)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2872, in _preparse_requirement
    distvers = re.sub(self.EQEQ, r"\1==\2\3", distvers)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 155, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 247, in _compile
    raise TypeError, "first argument must be string or compiled pattern"
TypeError: first argument must be string or compiled pattern

Python 2.7.11, Mac OSX 10.11.2, pygments-2.0.2 (the latest stable).
If you need I can provide a link to an original issue. Any ideas what's wrong here are highly appreciated.

(Original issue 1185 last updated on 2016-01-16T11:26:33.253681+00:00)
(Issue automaticaly closed due to status in Bitbucket: resolved)

(Original comment by birkenfeld on 2016-01-16T11:26:33.265634+00:00)
Not sure what I can do about it. Please make sure you have the latest versions of setuptools etc.
It also looks like you're mixing several Python installs (/usr/local vs the framework). I don't know much about Mac Python, so this may also be not a good idea.


Add the ability to insert a timestamp

Add the ability to insert a timestamp, in various ways, as a comment. In the menu under the pencil, where is the insert.
For example:

Thanks for suggestion, I'll add it.


iostest.bash: don't restart phones by default

It's delightful that iostest.bash wraps up everything needed to run all.bash on an iOS device. I was rather unpleasantly surprised, though, when the first thing it did was restart my phone.
Perhaps this is needed for dedicated builders, but for personal devices and manual runs, it's not super friendly and certainly unexpected. I'd suggest controlling this by an environment variable or some such.

Seems reasonable. Are there any environment variables to tell us we are running under the builder? If so it could be conditioned on it.

no, there is no environment variable for builders, and I believe
that's a good thing. We don't want tests to do things differently
just because it's running on the builders.
For this case, however, perhaps we should add a command line
flag to iostest.bash. Our builder infrastructure should be able to
pass a flag.

SGTM. We already have to set a flag to tell the builder to use "./iostest.bash". We can ask it to use "./iostest.bash -restart" instead.

I'd like to fix this, but I can't find the relevant builder code. Is it not in golang.org/x/build, or am I blind?

There's no code to fix. Right now the builder is run with a flag telling it to use iostest.bash. I can add -restart to that if you change iostest.bash
One day I will have OS X buildlets, then there will be code to change. But right now I'm distracted by work that needs to be completed before the 1.5 freeze.

That explains it. :) CL soon.


InPaint broken (ui.py, line 800)

When running InPaint with the default setting "Inpaint masked", I get the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/gradio/routes.py", line 273, in run_predict
output = await app.blocks.process_api(
File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 742, in process_api
result = await self.call_function(fn_index, inputs, iterator)
File "/usr/local/lib/python3.8/dist-packages/gradio/blocks.py", line 653, in call_function
prediction = await anyio.to_thread.run_sync(
File "/usr/local/lib/python3.8/dist-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/content/gdrive/MyDrive/sd/stable-diffusion-webui/modules/ui.py", line 800, in update_orig
same_size = state is not None and state.size == image.size
AttributeError: 'dict' object has no attribute 'size'

A picture is generated, but it's independent of the given image, meaning the mask is ignored.

@TheLastBen same issue

I'm aware of it

Same. when will this become stable? It seems to break every minor update or something.

The picture also duplicate to the left. Don't know if it's related.

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5360

AUTOMATIC1111/stable-diffusion-webui#5360 it's not the colab

have you fixed the collab?

@TheLastBen

this issue is to be fixed by A1111 team, I don't maintain that repo

this issue is to be fixed by A1111 team, I don't maintain that repo

but some user said they fixed by  git checkout a2feaa95fc0c4c94131eb75b5b1bc0eaa1696551 .\modules\img2img.py .\modules\ui.py this where to copy this??

this issue is to be fixed by A1111 team, I don't maintain that repo

but some user said they fixed by git checkout a2feaa95fc0c4c94131eb75b5b1bc0eaa1696551 .\modules\img2img.py .\modules\ui.py this where to copy this??

join the question. how to implement this please tell me

The issue is fixed with https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/8504db51704d238cc7616f6bf59eb049d3eb101d


Transparent Sync does not expand Branch Templates correctly

When an item is stored via Transparent Sync, and you add an item based on a branch template, the branch does not get expanded correctly and the item reflects the template minus the branch bits.
As well it seems that tokens don't expand on TS items (e.g. $name) correctly. Guessing a similar thing, but really weird that the expansion of a branch wouldn't seemingly pass at a higher level than the data provider.

Turned out that the token expansion was due to some funny things I was doing with event handlers that most people wouldn't ever see; it's nevertheless fixed if you rename an item and save it too in one batch.
The expansion of the branch was two issues, one of which necessitates adding __Originator to the included fields list (it was excluded by default in all 3.x releases).

This will be in 4.0.


Socks upgrade

This PR upgrade socks5 to v 0.2.1.

upgrade construct to 2.8.8
modify pyca_tls
upgrade socks5 to v0.2.1
fix socks related tests
add test for construct and protocol.tls.TlsClientHello

Coverage decreased (-0.01%) to 86.449% when pulling 4ab4a108b600c7483cc0941125b2fac543973e69 on socks-upgrade into ddbacbae127517790c9e00c2eba40b713d2877d8 on master.

Coverage increased (+0.4%) to 86.891% when pulling b1639d217e3a57c1edbac35e392261b8043e3301 on socks-upgrade into ddbacbae127517790c9e00c2eba40b713d2877d8 on master.

Hi @chhsiao90,
help me review this, tks.

Wow, the option Changes requested of code review is cool~

Will do, I'll push a new commit later.

Thanks for the review.
The new code review functionality is really good, except I forgot to press submit. Orz

Fix based on review, thanks.

Coverage increased (+0.4%) to 86.891% when pulling 1dffc2966d3d6a1817790432b8f08a0540a07274 on socks-upgrade into ddbacbae127517790c9e00c2eba40b713d2877d8 on master.


opt support partitionTopn for multi window exprs

Proposed changes
Issue Number: close #xxx
Support partitionTopn for multi window exprs.
If row_number exists, choose row_number; if not, choose the one with the minimal limit value.

run buildall

run buildall

run buildall

run buildall

run buildall

please add a sql example in "Proposed changes" section

please add a sql example in "Proposed changes" section

Done

run buildall


Upgraded webpack to 5.76.0

Related issue (if exists)
Webpack 5 before 5.76.0 does not avoid cross-realm object access. ImportParserPlugin.js mishandles the magic comment feature. An attacker who controls a property of an untrusted object can obtain access to the real global object.
copilot:summary

Walkthrough
copilot:walkthrough

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


Is it possible to keep the remaining placeholder value visible when user is typing?

and as user starts typing the placeholder goes away

As ux point of view it is not very intuitive as users can forget about the pattern and then again they have to go back to see the format. It would be extremely usefuly if this feature is available.

While I agree with the usability side, it’s not a feature I’ve seen anywhere else.
It feels like it would battle for attention.
Have you considered a “traditional” tooltip that shows up when the user starts typing, and goes away once the requirement is fulfilled?

Yes i can surely add tool-tip or label to avoid confusion but i really want to avoid any repetition. If you see jQuery Mask they add placeholder and its always visible https://github.com/RobinHerbots/Inputmask , but the issue is in this case the mask is quite prominent throughout which I do not need.

Have the possibility to make the placeholder always visible would be really great. Here is another example of project which provides this feature: https://github.com/santalu/maskara . I agree with @Tajwebdeveloper

@Tajwebdeveloper Why has this issue been closed?


league/flysystem-rackspace incompatible with CMS 1.2

Updated to CMS 1.2 with the following reqs in main composer.json:
    "require": {
        "php": "^8.0.2",
        "winter/storm": "dev-wip/1.2 as 1.2",
        "winter/wn-system-module": "dev-wip/1.2",
        "winter/wn-backend-module": "dev-wip/1.2",
        "winter/wn-cms-module": "dev-wip/1.2",
        "laravel/framework": "^9.1",
        "wikimedia/composer-merge-plugin": "~2.0.1"
    },

git cloneing this repo and running composer update in Winter root dir results in the following caused by the league/flysystem-rackspace req:
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install league/flysystem-rackspace 1.0.0 (conflict analysis result)
    - Conclusion: don't install league/flysystem-rackspace 1.0.1 (conflict analysis result)
    - Conclusion: don't install league/flysystem-rackspace 1.0.2 (conflict analysis result)
    - Conclusion: don't install league/flysystem-rackspace 1.0.3 (conflict analysis result)
    - Conclusion: don't install league/flysystem-rackspace 1.0.4 (conflict analysis result)
    - Conclusion: don't install league/flysystem-rackspace 1.0.5 (conflict analysis result)
    - Root composer.json requires league/flysystem-rackspace ~1.0 -> satisfiable by league/flysystem-rackspace[1.0.0, ..., 1.0.x-dev (alias of dev-master)].
    - Conclusion: don't install league/flysystem[3.0.19] | install one of league/flysystem[1.1.4, ..., 1.1.8] (conflict analysis result)
    - Conclusion: don't install league/flysystem[3.0.18] | install one of league/flysystem[1.1.4, ..., 1.1.8] (conflict analysis result)
    - Conclusion: don't install league/flysystem[3.0.17] | install one of league/flysystem[1.1.4, ..., 1.1.8] (conflict analysis result)
    - Conclusion: don't install league/flysystem[3.0.16] | install one of league/flysystem[1.1.4, ..., 1.1.8] (conflict analysis result)
    - Conclusion: don't install league/flysystem 1.1.4 (conflict analysis result)
    - Conclusion: don't install one of league/flysystem[1.1.8], laravel/framework[9.x-dev] | install one of league/flysystem[3.0.21, 3.0.22, 3.0.23, 3.1.0] (conflict analysis result)
    - Conclusion: don't install one of league/flysystem[1.1.7], laravel/framework[9.x-dev] | install one of league/flysystem[3.0.21, 3.0.22, 3.0.23, 3.1.0] (conflict analysis result)
    - Conclusion: don't install one of league/flysystem[1.1.6], laravel/framework[9.x-dev] | install one of league/flysystem[3.0.21, 3.0.22, 3.0.23, 3.1.0] (conflict analysis result)
    - Conclusion: don't install one of league/flysystem[1.1.5], laravel/framework[9.x-dev] | install one of league/flysystem[3.0.21, 3.0.22, 3.0.23, 3.1.0] (conflict analysis result)
    - Conclusion: don't install league/flysystem 3.0.21 (conflict analysis result)
    - winter/storm dev-wip/1.2 requires laravel/framework ^9.1 -> satisfiable by laravel/framework[v9.1.0, ..., 9.x-dev].
    - Conclusion: don't install laravel/framework v9.1.0 (conflict analysis result)
    - Conclusion: don't install league/flysystem 3.0.22 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.2.0 (conflict analysis result)
    - Conclusion: don't install league/flysystem 3.0.23 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.3.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.3.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.4.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.4.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.5.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.5.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.6.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.7.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.8.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.8.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.9.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.10.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.10.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.11.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.12.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.12.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.12.2 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.13.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.14.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.14.1 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.15.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.16.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.17.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.18.0 (conflict analysis result)
    - Conclusion: don't install laravel/framework v9.19.0 (conflict analysis result)
    - Conclusion: don't install league/flysystem 3.1.0 (conflict analysis result)
    - Conclusion: don't install league/flysystem 1.1.9 (conflict analysis result)
    - league/flysystem-rackspace 1.0.x-dev is an alias of league/flysystem-rackspace dev-master and thus requires it to be installed too.
    - Root composer.json requires winter/storm dev-wip/1.2 as 1.2 -> satisfiable by winter/storm[dev-wip/1.2].
    - league/flysystem-rackspace dev-master requires league/flysystem ~1.0 -> satisfiable by league/flysystem[1.0.0-alpha1, ..., 1.x-dev].
    - You can only install one version of a package, so only one of these can be installed: league/flysystem[1.0.0-alpha1, ..., 1.x-dev, 2.0.0-alpha.1, ..., 2.x-dev, 3.0.0, ..., 3.x-dev].
    - laravel/framework 9.x-dev requires league/flysystem ^3.0.16 -> satisfiable by league/flysystem[3.0.16, ..., 3.x-dev].
    - Conclusion: don't install league/flysystem[3.0.20] | install one of league/flysystem[1.1.4, ..., 1.1.8] (conflict analysis result)

I'm aware the README says to not use this plugin with composer installs, however the issue still remains that there is no version of league/flysystem-rackspace that works with CMS 1.2.

Ah, I see it's no longer supported as per the upgrade guide. I'll PR the removal.


Add entry to library when clicking Download

Describe your suggested feature
Previously in Tachiyomi, clicking download will have a dialogue asking to add to library or not.
It doesn't happen here.
I am on Mihon 0.16.3
Other details
No response
Acknowledgements

[X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
[X] I have written a short but informative title.
[X] I have updated the app to version 0.16.3.
[X] I will fill out all of the requested information in this form.

I checked and it did pop up for me immediately. Mihon also hasn't touched that part of the code base at this point.

It does not show up when you press the download button on the top. Please reconsider
Uploading Recording_2024-02-17-11-05-07.mp4…

https://github.com/mihonapp/mihon/assets/29143195/3b3b352d-aec9-483e-a71c-9b7c0a513ae1

https://github.com/mihonapp/mihon/assets/39014446/88622033-135d-497e-ae05-126b1881d5b9
Seems to be working fine for me? Try refreshing the entry and doing the download thing again

Yea refreshing the entry works. Thanks.
I swear it never happens when I was using Mihon. The screen recording I have up there is corrupted for some reasons but it shows that it does not pop up.

It does not show up when you press the download button on the top. Please reconsider
Uploading Recording_2024-02-17-11-05-07.mp4…

This happens when you send the comment before the upload finishes. The reason it worked for the next comment is because you waited long enough for the upload to finish 👍


Making whitespace the only word separator?

Currently, it seems that diffWords treats an apostrophe as a word separator? As you can see in the above image, the single letter change in the word am (am -> an) creates a new word. But, removing 'm from i'm just crosses out the 'm rather than separating the i into a new word.
I'd like to have it so that only whitespace counts as a word separator, so that for example i'm -> i would display a crossed out i'm and a separate i. Is this possible with current options?

Update: I was able to do this by making a new JsDiff.Diff() using src/diff/word.js as a base.


Add flair calls

I have added all but one flair API call (I have left POST [/r/subreddit]/api/flaircsv as I didn't know what it did). Three of the flair methods have deprecation markers on them because they don't work (Says invalid URI). I have been trying to fix them but to no avail so far, so if someone might be able to take a look.
There is a JUnit test for all of the working methods (not the deprecated ones) and an example for the flairs. I have updated the implemented_methods.md also. As mentioned in the commit f64825a, I have never done JUnit testing before, so if it is wrong let me know.
This is my first pull request ever so let me know if I need to do something else.

@sfat Most of the constructors and variable names are from another class that I used as a basis. I will change them when I get around to it tomorrow. The wildcards on imports seems to be the default practice in IntelliJ, so I didn't notice. I will update it all tomorrow with these recommendations.
Thanks for the notes.

@Vitineth look at this answer on SO, it will tell you how to "disable" intellij wildcard http://stackoverflow.com/a/3348855/471481


I fear I'm doing something stupid...

My pubspec.yaml looks like this:
name: sqlite_test
version: 0.0.1
description: A simple console application.
dependencies:
  sqlite: ^0.3.0

My main.dart looks like this:
import 'package:sqlite/sqlite.dart';

main(List<String> args) async {
  final db = new Database.inMemory();

  Row row =
      await db.query('SELECT ?+16, UPPER(?)', params: [2000, 'Ligue 1']).first;
  final int year = row[0];
  final String league = row[1];
  print('-- $league $year --');
}

And yet, running it fails like this:
$ pub run bin/main.dart
Unhandled exception:
Class 'Database' has no instance method 'query'.

NoSuchMethodError: method not found: 'query'
Receiver: Instance of 'Database'
Arguments: ["SELECT ?+16, UPPER(?)", params: Instance(length:2) of '_GrowableList']
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2      main.<main_async_body> (file:///Users/brett/dart-projects/sqlite-test/bin/main.dart:7:16)
#3      Future.Future.microtask.<anonymous closure> (dart:async/future.dart:144)
#4      _microtaskLoop (dart:async/schedule_microtask.dart:41)
#5      _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#6      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#7      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

Halp?

 What version of the library do you see when running pub deps?

As you have probably guessed, I was on v0.3.0 and was getting confused due to the API change. When I upgraded to v0.4.0 all the problems magically went away. Sorry, I should have mentioned that.
Thanks!

Glad it is now working!


Bump flutter_rust_bridge to 2.0.0-dev.38

This PR bumps flutter_rust_bridge dependency to 2.0.0-dev.38

Generate Dart bindings
flutter_rust_bridge has relative path issues with this new approach introduced in 2.0.0-dev.38, we'll be using the default rust_output path until it's addressed.

The fix for clippy seems to be
Index: lib/core/src/lib.rs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/core/src/lib.rs b/lib/core/src/lib.rs
--- a/lib/core/src/lib.rs	(revision 1268a5735f7fb36acdc525991d190966816cc31b)
+++ b/lib/core/src/lib.rs	(date<PHONE_NUMBER>966)
@@ -3,7 +3,7 @@
 pub mod error;
 pub(crate) mod event;
 #[cfg(feature = "frb")]
-pub mod frb_generated;
+pub(crate) mod frb_generated;
 pub mod logger;
 pub mod model;
 pub mod persist;

as described in https://github.com/fzyzcjy/flutter_rust_bridge/issues/466

The fix for clippy seems to be
Index: lib/core/src/lib.rs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/core/src/lib.rs b/lib/core/src/lib.rs
--- a/lib/core/src/lib.rs	(revision 1268a5735f7fb36acdc525991d190966816cc31b)
+++ b/lib/core/src/lib.rs	(date<PHONE_NUMBER>966)
@@ -3,7 +3,7 @@
 pub mod error;
 pub(crate) mod event;
 #[cfg(feature = "frb")]
-pub mod frb_generated;
+pub(crate) mod frb_generated;
 pub mod logger;
 pub mod model;
 pub mod persist;

as described in fzyzcjy/flutter_rust_bridge#466

Yes, that's true. It's a regression introduced when switching back to default rust_output path as a workaround for the relative path issue with new version.
I'm waiting for build to complete to push changes. Thanks!