raidemulator: Convert LogEventHandler and NetworkLogConverter to typescript

NetworkLogConverterWorker will need to wait until the CombatantTracker class and dependencies are converted.
This PR should be considered downstream from #2917 due to zoneID => zoneId property rename. As such, this PR's compile will fail until that PR is merged. When that one's merged I'll rebase this to upstream/main.

diff --git a/ui/raidboss/emulator/data/LogEventHandler.js b/ui/raidboss/emulator/data/LogEventHandler.ts
index 7868f946..79c1d2c3 100644
--- a/ui/raidboss/emulator/data/LogEventHandler.js
+++ b/ui/raidboss/emulator/data/LogEventHandler.ts
@@ -1,13 +1,16 @@
 import EmulatorCommon from '../EmulatorCommon';
 import EventBus from '../EventBus';
 import { LocaleNetRegex } from '../../../../resources/translations';
+import { Lang } from 'types/global';
+import LineEvent from './network_log_converter/LineEvent';
+import { LineEvent0x01 } from './network_log_converter/LineEvent0x01';

 export default class LogEventHandler extends EventBus {
-  static doesLineMatch(line, regexes) {
+  static doesLineMatch(line: string, regexes: Record<string, RegExp>): RegExpExecArray | false {
     for (const i in regexes) {
-      const res = regexes[i].exec(line);
+      const res = regexes[i]?.exec(line);
       if (res) {
-        if (LocaleNetRegex.areaSeal[i])
+        if (LocaleNetRegex.areaSeal[i as Lang] && res.groups)
           res.groups.language = i;
         return res;
       }
@@ -15,96 +18,101 @@ export default class LogEventHandler extends EventBus {
     return false;
   }

-  static isMatchStart(line) {
+  static isMatchStart(line: string): RegExpMatchArray | false {
     let res;
     res = LogEventHandler.doesLineMatch(line, EmulatorCommon.countdownRegexes);
     if (res) {
-      res.groups.StartIn = res.groups.time * 1000;
+      res.groups = res.groups ?? {};
+      res.groups.StartIn = (parseInt(res.groups.time ?? '0') * 1000).toString();
       res.groups.StartType = 'Countdown';
       return res;
     }
     res = LogEventHandler.doesLineMatch(line, EmulatorCommon.sealRegexes);
     if (res) {
-      res.groups.StartIn = 0;
+      res.groups = res.groups ?? {};
+      res.groups.StartIn = '0';
       res.groups.StartType = 'Seal';
       return res;
     }
     res = LogEventHandler.doesLineMatch(line, EmulatorCommon.engageRegexes);
     if (res) {
-      res.groups.StartIn = 0;
+      res.groups = res.groups ?? {};
+      res.groups.StartIn = '0';
       res.groups.StartType = 'Engage';
       return res;
     }
     return false;
   }

-  static isMatchEnd(line) {
+  static isMatchEnd(line: string): RegExpMatchArray | false {
     let res;
-    res = LogEventHandler.doesLineMatch(line, [EmulatorCommon.winRegex]);
+    res = LogEventHandler.doesLineMatch(line, { '': EmulatorCommon.winRegex });
     if (res) {
+      res.groups = res.groups ?? {};
       res.groups.EndType = 'Win';
       return res;
     }
-    res = LogEventHandler.doesLineMatch(line, [EmulatorCommon.wipeRegex]);
+    res = LogEventHandler.doesLineMatch(line, { '': EmulatorCommon.wipeRegex });
     if (res) {
+      res.groups = res.groups ?? {};
       res.groups.EndType = 'Wipe';
       return res;
     }
-    res = LogEventHandler.doesLineMatch(line, [EmulatorCommon.cactbotWipeRegex]);
+    res = LogEventHandler.doesLineMatch(line, { '': EmulatorCommon.cactbotWipeRegex });
     if (res) {
+      res.groups = res.groups ?? {};
       res.groups.EndType = 'Cactbot Wipe';
       return res;
     }
     res = LogEventHandler.doesLineMatch(line, EmulatorCommon.unsealRegexes);
     if (res) {
+      res.groups = res.groups ?? {};
       res.groups.EndType = 'Unseal';
       return res;
     }
     return false;
   }

-  constructor() {
-    super();
+  public currentFight: LineEvent[] = [];
+  public currentZoneName?: string;
+  public currentZoneId = -1;

-    this.currentZoneName = null;
-    this.currentFight = [];
-    this.currentZoneId = -1;
-  }
-
-  parseLogs(logs) {
+  parseLogs(logs: LineEvent[]): void {
     for (let i = 0; i < logs.length; ++i) {
-      const lineObj = logs[i];
+      const lineObj = logs[i] as LineEvent;

       this.currentFight.push(lineObj);

-      lineObj.offset = lineObj.timestamp - this.currentFight[0].timestamp;
+      lineObj.offset = lineObj.timestamp - (this.currentFight[0]?.timestamp ?? 0);

       const res = LogEventHandler.isMatchEnd(lineObj.networkLine);
       if (res) {
         this.endFight();
-      } else if (lineObj.zoneName) {
-        this.currentZoneId = lineObj.zoneId;
-        this.currentZoneName = lineObj.zoneName;
+      } else if (lineObj instanceof LineEvent0x01) {
+        const castLineObj = lineObj;
+        this.currentZoneId = parseInt(castLineObj.zoneId ?? '0');
+        this.currentZoneName = castLineObj.zoneName;
         this.endFight();
       }
     }
   }

-  endFight() {
+  endFight(): void {
     if (this.currentFight.length < 2)
       return;

-    const start = new Date(this.currentFight[0].timestamp);
+    const start = new Date(this.currentFight[0]?.timestamp ?? 0).toISOString();
+    const end = new Date(this.currentFight.slice(-1)[0]?.timestamp ?? 0).toISOString();
     this.currentZoneName = this.currentZoneName || 'Unknown';
     this.currentZoneId = this.currentZoneId || -1;

     console.debug(`Dispatching new fight
 Start: ${start}
-End: ${new Date(this.currentFight[this.currentFight.length - 1].timestamp)}
+End: ${end}
 Zone: ${this.currentZoneName}
 Line Count: ${this.currentFight.length}
 `);
-    this.dispatch('fight', start.toISOString().substr(0, 10), this.currentZoneId, this.currentZoneName, this.currentFight);
+    void this.dispatch('fight', start.substr(0, 10), this.currentZoneId, this.currentZoneName, this.currentFight);

     this.currentFight = [];
   }

diff --git a/ui/raidboss/emulator/data/NetworkLogConverter.js b/ui/raidboss/emulator/data/NetworkLogConverter.ts
index 90b983f3..e4ef38ee 100644
--- a/ui/raidboss/emulator/data/NetworkLogConverter.js
+++ b/ui/raidboss/emulator/data/NetworkLogConverter.ts
@@ -1,30 +1,41 @@
 import EventBus from '../EventBus';
+import LineEvent from './network_log_converter/LineEvent';
 import LogRepository from './network_log_converter/LogRepository';
 import ParseLine from './network_log_converter/ParseLine';

 export default class NetworkLogConverter extends EventBus {
-  async convertFile(data) {
+  convertFile(data: string): LineEvent[] {
     const repo = new LogRepository();
-    const ret = await this.convertLines(
+    return this.convertLines(
         // Split data into an array of separate lines, removing any blank lines.
         data.split(NetworkLogConverter.lineSplitRegex).filter((l) => l !== ''),
         repo,
     );
-    return ret;
   }

-  async convertLines(lines, repo) {
-    this.Combatants = {};
+  convertLines(lines: (string | LineEvent)[], repo: LogRepository): LineEvent[] {
     repo = repo || new LogRepository();
-    lines = lines.map((l) => ParseLine.parse(repo, l)).filter((l) => l);
+    // This is a bit ugly but we can't keep the original lines array values around
+    // due to memory issues
+    // Convert from string to LineEvent
+    lines =
+      (
+        (lines as string[])
+          .map((l) => ParseLine.parse(repo, l)) as (LineEvent | boolean)[])
+        .filter((l) => l) as LineEvent[];
+
+    // Call `convert` to convert the network line to non-network format and update indexing values
+    lines = (lines as LineEvent[])
+      .map((l, i) => {
+        l.convert(repo);
+        l.index = i;
+        return l;
+      });

-    for (let i = 0; i < lines.length; ++i) {
-      lines[i].convert(repo);
-      lines[i].index = i;
-    }
     // Sort the lines based on `${timestamp}_${index}` to handle out-of-order lines properly
-    return lines.sort((l, r) => (l.timestamp + '_' + l.index).localeCompare(r.timestamp + '_' + r.index));
+    return (lines as LineEvent[])
+      .sort((l, r) => (`${l.timestamp}_${l.index}`).localeCompare(`${r.timestamp}_${r.index}`));
   }
-}

-NetworkLogConverter.lineSplitRegex = /\r?\n/gm;
+  static lineSplitRegex = /\r?\n/gm;
+}

As a follow up question, it seems like a lot of these typescript conversions aren't going to be detected as a rename. Should these PRs instead be two commits (renames first, then code adjustments)? I believe that will fix the rename detection issue.

Had to include a slight adjustment to NetworkLogConverterWorker because convertLines is no longer async.

Also, just as feedback, it is very hard to review your patches when you force push on every change. I can't see what changed and have to re-read the entire thing and try to remember what was there before. This is especially true the larger the patch is.

I started squashing the commits down (or using git commit --amend, in actuality) because that's what you were doing when merging them in regardless. If you'd rather a bunch of commits and squash them on merge instead, that's fine too. That does circle back to a question I asked previously on this PR:

As a follow up question, it seems like a lot of these typescript conversions aren't going to be detected as a rename. Should these PRs instead be two commits (renames first, then code adjustments)? I believe that will fix the rename detection issue.

Should I start doing this as well?

If you want to make the review process easier for reviewers, I would recommend:
* add separate commits for any changes due to review, so folks can look at a single commit to see what changed
* only rebase on main and force push when you need to include other changes from main
  * but don't squash commits when you do this
  * alternatively, merge main in to preserve commit history on the branch

I think a rebase to main shouldn't require a force push, though I might be wrong? As such, my preferred methodology is to rebase to main any time I need to make further commits, just to avoid future merge issues and to make sure that something hasn't changed on main that would impact the changes in the PR.

* ideally push a commit first and then publish comments second that say "done".  If you comment "will be done in the future", then now I have to remember at some indefinite point later to try to compare what was done.
  * My workflow is usually to leave a draft review comment that says "done" and then publish all the comments at once when I push changes.

I don't think I can draft a comment on someone else's review? I can't seem to find that option, either way. Would you prefer that I comment that the changes have been made after pushing the commit, or just mark the conversation as resolved without commenting? I'm not sure which states github notifies for.

Also, just as feedback, it is very hard to review your patches when you force push on every change. I can't see what changed and have to re-read the entire thing and try to remember what was there before. This is especially true the larger the patch is.

I started squashing the commits down (or using git commit --amend, in actuality) because that's what you were doing when merging them in regardless. If you'd rather a bunch of commits and squash them on merge instead, that's fine too. That does circle back to a question I asked previously on this PR:

Yeah, I think the only time it makes sense to have a clean history in the PR itself is if you think the change should be rebase+merge instead of squash+merge onto main so that the commits are preserved.  But I think that's probably a really rare case and probably those should just be different squashed PRs in the end.

As a follow up question, it seems like a lot of these typescript conversions aren't going to be detected as a rename. Should these PRs instead be two commits (renames first, then code adjustments)? I believe that will fix the rename detection issue.

Should I start doing this as well?

I think if it's in the same PR, then yeah, maybe rename first then changes as separate commits might help make it more readable.

If you want to make the review process easier for reviewers, I would recommend:
* add separate commits for any changes due to review, so folks can look at a single commit to see what changed
* only rebase on main and force push when you need to include other changes from main
  * but don't squash commits when you do this
  * alternatively, merge main in to preserve commit history on the branch

I think a rebase to main shouldn't require a force push, though I might be wrong? As such, my preferred methodology is to rebase to main any time I need to make further commits, just to avoid future merge issues and to make sure that something hasn't changed on main that would impact the changes in the PR.

Yeah, a rebase requires a force push when you've changed the base.  The only time a rebase wouldn't require a force push is if there were no commits since the last time you did it.

* ideally push a commit first and then publish comments second that say "done".  If you comment "will be done in the future", then now I have to remember at some indefinite point later to try to compare what was done.
  * My workflow is usually to leave a draft review comment that says "done" and then publish all the comments at once when I push changes.

I don't think I can draft a comment on someone else's review? I can't seem to find that option, either way. Would you prefer that I comment that the changes have been made after pushing the commit, or just mark the conversation as resolved without commenting? I'm not sure which states github notifies for.

This is github interface weirdness, but this is the difference between the main PR page (where you can cancel/comment/resolve) and the files changed page (where you can cancel/add single comment/start a review).  It's the same difference between merging in somebody's suggestions one at a time vs batching them in the files changed page.  At any rate, "starting a review" should let you write draft comments and then publish at once.  "Add single comment" or "comment" from the main PR page both are instant with no draft.

Was hoping I wouldn't have to change my local back to the branch to apply those but looks like that's a no-go. Let me fix those up, give me a few minutes...


Handling multiplexing datasets with complex or partial inputs

In a basic implementation of multiplexing that will work for many standard cases, we expect every cycle (round of acquisition, probably each cycle would be a resource in Fractal parlance) to consist of images of the same regions and each acquisition to have the same number of images per channel.
In that case, we can just match FOV 1 in cycle 2 to FOV 1 in cycle 1 etc. => easy matching by field number as long as the data is complete.
But there are some more complicated cases. This issue will try to list the relevant categories and we can discuss here which of those will be handled directly within Fractal or what mitigation strategies could be applied.
Summary:
I can think of 3 complex input cases. I think we should discuss how we handle case 1, and declare cases 2 & 3 out of scope.
@gusqgm @MaksHess Have I missed any cases? Are there important examples of cases 2 & 3 that we should really be supporting?
@tcompa What's your opinion on case 1?

1. The cycles have the same number of field of views, but the indices don't match & there are multiple folders for some cycles
Reasons: An acquisition at the microscope (e.g. the new Apricot microscope in the Pelkmans lab) failed and the cycle now consists of 2 rounds of acquisitions, both belonging to the same cycle.
(a simpler sub-case may be: single folder per cycle, but FOV numbers don't match. But I can't think of a setting where this would arise)
Test case: By @MaksHess , being prepared
Mitigation strategies:
a) The user needs to prepare the data to match expectations. That means: Creating a new folder with the combined images (e.g. linking images into the new folder using ln) and renaming them to fit the numbering system of cycle 1. Also, the user provides a pandas dataframe with the relevant metadata that fits the renamed images (see https://github.com/fractal-analytics-platform/fractal/issues/124)
b) Partial adaptation by the user, but Fractal does half the work: The user needs to provide a single input folder (e.g. using the strategy above). That probably means renaming the (linked/copied) files, because otherwise multiple sites are F001. The user also provides a metadata table fitting the renamed files. But the user would not have to worry about matching the field of view numbers, because Fractal takes care of this (by matching ROI locations of Cycle 1 with ROI locations of later cycles and mapping Cycle 2 FOV X to Cycle 1 FOV Y).
c) Fractal can handle this natively: Going further with the logic in b, Fractal also takes 1 to n folders as the input for each cycle, can parse the metadata file for each input folder, combine the metadata (safely) and then do the same matching as in b to match site numbers.
Personally, I'd prefer if Fractal only needs to handle a, because it keeps the tasks & input structures simpler. We could write some example scripts or jupyter notebooks to handle this.
@tcompa Based on the current dataset structure, how feasible is it to go with route c? I'd be mostly worried about how we handle different resources belonging to the same cycle. But given that we're still defining resources, maybe having 1-n resources per cycle wouldn't actually be a big deal?

2. Not the same number of FOVs per cycle
Reason: A user changed experimental design in the middle of their multiplexing or the microscope crashed leading to a partial acquisition.
My first reaction would be that we don't support this use case (at least at this stage).
Mitigation: A user could create blank image data if just a few images are missing (this is how we handled such cases in TissueMaps) & provide the metadata table like above in b. => this can be worked around on the user side
Alternatively, a user may continue acquiring the missing FOVs after a microscope crash, turning this into case 1 again.
3. FOVs do not have the same locations
Reason: Field of views may have small shifts
I don't understand yet how this case arises. Can you elaborate @MaksHess ? My first reaction is that we would not support this.
I also don't see an easy way to work around this from a user side.
An alternative approach to tackle 2 & 3 would be for Fractal to be ultimately general here, where each cycle has its own ROI definition (and potentially its own coordinate space). In that setting, different cycles could have varying numbers of FOVs and the positions of those FOVs could also vary. Would make parsing a bit complicated, because we don't know in the first cycle how big the dask array for the well eventually needs to be. And would make downstream processing very complicated, because any physical location may have actual image data from 0 to n different channels.

Thanks for summarizing @jluethi! Here are some thoughts on the individual points, also I've added an example that should cover our use case (individual re-imaged sites with inconsistent filenames) to /data/active/fractal/3D/PelkmansLab/ZebrafishMultiplexingAdvanced. The code on how I process multiplexing experiments one cycle at a time is in abbott/Maks/deoploy/compress_cv8k_cycle_cluster.py
1. Inconsistent field names & re-imaged wells
The problem arises because of issues we currently have with the microscope (i. e. some embryos are not imaged properly and need to be re-imaged). The workaround we use is deleting all the wells (&| individual embryos) from the .mes file and run the acquisition again. The resulting files can not be matched based on filenames, so I mitigated the problem by indexing the positions by (well, x-y-position). This only works if the same .mes file is used, i. e. one can not run search first a second time but I thinks that's a reasonable constraint on a multiplexing experiment.
Although I'm hoping that Yokogawa will be able to mitigate this specific issue at some point, during my experiment the microscope also crashed, which led to me having to run the second part of the acquisition again (also leading to inconsistent filenames). Due to the way I indexed the sites this issue was also covered.
2. Not the same number of FOVs per cycle
Here's an example on how this could come up. If I have 90% embryo retention per cycle and wanna save time on the acquisition of later cycles. So I might delete individual sites or whole wells during an experiment. Or I add QC-cycles on some wells in the end of an experiment. Again, indexing by well & x-y-position can handle all those cases.
3. FOVs do not have the same locations
This was an issue Shayan brought up, he seems to have some embryos that move slightly during the experiment, which is why he might want to re-run search first after a couple cycles. Given this would be adding a lot of complexity and we don't yet know how often this happens I think we can safely ignore this for now.
Regarding the mitigation strategies you proposed: I personally have a strong preference for c (i. e. the possibility of having 1-n folders where the matching of sites happens based on x-y-position the metadata found in MeasurementData.mlf). This is what I've implemented for our current experiments and it solves both 1 & 2 which gives the user more flexibility during an experiment while keeping complexity reasonable (only constraint is one search first run an the beginning of an experiment that defines the positions that can be imaged).

Thanks @MaksHess for the feedback!

This only works if the same .mes file is used

For context: The .mes files are microscope files that control which positions are acquired. So if the same .mes files are used, the acquired positions are exact matches in well, x & y position, right? I would also limit the scope to this for the moment.

I don't think such time-savings alone are worth the complexity to a processing architecture for the moment. Yes, parsing could probably handle this fairly well without large workarounds. But how do we know which ROIs have actual data in which cycle? Do we just have 0s when we have no actual data? Do we still make measurements with all 0s? What processing steps assume that they always have the same channels available?
=> Parsing is simple, downstream handling could get more complicated. I would suggest we get into this as part of how we handle multiplexing registration. We may also have to tackle these questions. If we find a good answer to them, we can then also allow more complex inputs to be parsed. Until then, I'd focus on covering part 1.

Good let's be aware that multiple independent search-first may (eventually) be of interest, but not approach that right now. Depending on what we figure out for the issues in 2, that may also make this easier or harder :)

I personally have a strong preference for c

Whether we can implement this custom parsing depends on two things from my perspective:

Architecture complexity: Can we make the more diverse inputs fit our architecture, e.g. having multiple resources per cycle (but still know they belong to the same cycle) [side note: could be the same for having time data from long acquisitions that may come as different folders] => I'll discuss this with @tcompa
Time to implement: Depending on the answer to 1), it may be much faster (& more flexible) to implement strategy a) with some notebooks to allow users to preprocess data. But if c) is not too much extra effort, we can look into building this. The actual implementation is less of a Fractal infrastructure job though, as it's fairly custom to a given set of acquisition preferences, metadata structures etc. So we'll have to see where we can fit it in the priorities and whether that's something we implement together (@MaksHess & me) or if it's part of building the architecture flexibility for 1).

Quick note: From an architecture side, it should be feasible to provide multiple inputs per cycle. The task would need to get quite a bit more complex, but it's anyway based on a list of input directories + some metadata.
Conclusion:
Let's build the generic multiplexing input first, then see if we can write a special parsing task that would also handle such inputs & do the parsing.

Thank you @jluethi and @MaksHess  for the nice discussion points!

**1. ** Are we considering here also the cases where the microscope .mlf file outputs acquisition error for particular FOV's and therefore skips them? This is something that can happen with search-first (SF) acquisitions, and has been observed here from time to time, apparently related with 384 wells plates. The errors in the .mlf file may look like:  '' . In those cases the user might want also to reimage the wells on particular cycles / all of them.
**2. ** One way this can happen when a user images with SF and on a particular cycle the signal of a channel was not strong enough, so search first with low magnification discards this FOV for a second pass. Ultimately the data for different cycles will have different number of FOV, and the only way to match them is by looking at their positions in space. Indeed, the point here mentioned by @jluethi  is important and we need to know how to deal with having no recorded FOV for that particular cycle when extracting features. How about just adding camera noise? Drogon usually adds camera noise for all SF discarded FOV's by default, so that the well never has 0's. But in my opinion we could leave the 0's for the generally never acquired FOV's and only add camera noise for the FOV's where only particular cycles did not work. It is possibly not the ultimate solution, though.
**3. ** So far I have not see a case where there are large shifts between cycles.
All in all I think the generic multiplexing input is a logical first step to pursue as well!
Eventually we need to be able to handle error messages from the metadata, as this could also aid us in dealing with unimaged FOV's, and potentially in finding better ways to deal with strategies on how to best estimate feature extraction based on the missing information.

Thanks for the additional input @gusqgm . Quick feedback

The variant of case 1 you're describing is also covered in this issue in further detail, as you mention in the end: https://github.com/fractal-analytics-platform/fractal/issues/75
If we manage to do matching by position, not by FOV index, I think we should have this issue covered. How we handle absence of FOVs in some cycle then leads into issue 2.

Yes, the broader question of how to deal with missing data. Running repeated search-first instead of relying on a .mes file that is run for every cycle could also produce varying site numbers. But that likely also goes into the part for 3, where the positions of FOVs do not necessarily match anymore over cycles, right? i.e. one FOV may be at xy position (120, 150) while the one in the next round would be at position (125, 145)? That for me is the very general case of imaging arbitrary parts of a well each cycle and somehow aggregating this.
I think that case may be too general to easily tackle and I would start with enforcing that FOV positions match, even if sometimes some FOVs may be missing. That can be achieved by using the same measurement file for multiple cycles, no? Handling arbitrary acquisitions of subsets of wells about which we know nothings (no consistencies between FOVs enforced) becomes very hard and I would not tackle this now.
On the "what do we do with background": Broader discussion to be had. I'm strongly against just putting in random noise for 3 reasons. First, it massively reduced the compression performance. Second, we're pretending that there is information that doesn't actually exist. Third, there is no benefit of having that noise vs. just 0s that I'm aware of (e.g. I tested model performance with & without background subtraction for Organoid segmentation, we don't see any real differences)
=> Let's open a separate issue if someone wants to discuss this further. Otherwise, I'd default to saving 0s as the default state of the Zarrs.


[HOLD for payment 2024-11-11] Remove redundant reassure tests and improve documentation

Coming from this proposal in Slack.
Problem:
There are redundant/flaky performance tests in the Reassure suite. These tests are difficult to maintain and provide low value, as their scenarios are already covered elsewhere or offer little regression detection. This creates unnecessary complexity, slows down the test suite, and increases the likelihood of false positives.
Solution:
Remove the redundant tests that verify scenarios already covered in separate tests. Eliminate tests that check interactions with minimal impact on regression detection. Focus on retaining tests that provide high-value regression coverage, and reorganize the test suites for better maintainability by moving essential tests to lower levels where they are easier to manage.

Move the reassure test documentation to the contributingGuidelines
Update the guidelines to provide more guidance on how to prevent adding any redundant tests

Issue OwnerCurrent Issue Owner: @strepanier03

There is nothing to add here, we just removed redundant reassure tests now and review was handled internally so nothing to pay out


Disable spaces around zones don't work.

Microsoft PowerToys version
0.64.0
Installation method
PowerToys auto-update
Running as admin
Yes
Area(s) with issue?
FancyZones
Steps to reproduce
In layout editor, select to disable spaces around zones.
✔ Expected Behavior
Spaces around de zones disappears.
❌ Actual Behavior
Disable spaces around zones don't work.
Other Software
No response

/dup of https://github.com/microsoft/PowerToys/issues/21630

/dup #21630


Update docker images to 0.5.45

Problem
Update yaml files to adapt the docker update in #13488
Change overview
Update yaml files to 0.5.45
Testing
N.A.

The prerequisite of this PR is #13488.

/rebase


"dist" not cleaned by the deploy

The appcache contains multiples (oudated) entries atm.
CACHE MANIFEST
# Appcache generated by Statinamic
/statinamic/404.html.f3d82a4d938b593823c37ead979b3b86.json
/statinamic/assets/dx-play.jpg
/statinamic/assets/dx.mp4
/statinamic/assets/react.svg
/statinamic/docs/advanced/engine/index.html.4f7335d38a7d93b6ee00a0a0feda0299.json
/statinamic/docs/advanced/good-practices/index.html.20bb1db589792a567f68597b1bde93f9.json
/statinamic/docs/advanced/index.html.c90e36b70ddf6378e20c90ff0d836f08.json
/statinamic/docs/advanced/offline-browsing/index.html.4b71cdc8fca3a85cc54ee9b42a187160.json
/statinamic/docs/advanced/redux/index.html.8487bc257045fcb55e0109a5d0e04ec3.json
/statinamic/docs/faq/index.html.fdce758e8267f9ed6811486402bb7710.json
/statinamic/docs/index.html.cb6a329ccb08947b3ac94ae953328a3e.json
/statinamic/docs/setup/index.html.1ad3f025044052794babb6b44ac7ebe4.json
/statinamic/docs/usage/collections/index.html.1879fd819004f04d62085320c89601ce.json
/statinamic/docs/usage/configuration/index.html.7b8f12b439aadf511e71e094920abde5.json
/statinamic/docs/usage/feeds/index.html.4944795479679c90344fc99784b808e2.json
/statinamic/docs/usage/gh-pages/index.html.2c93a36972a6f2bd0e73ebe283ca3bed.json
/statinamic/docs/usage/index.html.740e6a3056fc4c7372f15e63d8263972.json
/statinamic/docs/usage/layouts/index.html.f49f7b70162dbb2b2e24d07fe47308ef.json
/statinamic/docs/usage/styling/index.html.16b3c0c22fdb8eacae1cfdca081d6c8a.json
/statinamic/docs/usage/write/index.html.da63af9b0f40bc15c08c5d69a950ec2f.json
/statinamic/feed.xml
/statinamic/index.html.80e977941de4cef04b8d005d038cfa1b.json
/statinamic/main.207a76e966cc8342c12a.css
/statinamic/main.4bf4a58a853001ea9564.css
/statinamic/main.515cd9fa85294f0ba763.css
/statinamic/main.ac3763f7752c2f659546.css
/statinamic/main.ae6d28e788a632823fbf.css
/statinamic/main.c1dff6d914dd2dadf80a.css
/statinamic/main.dec9451ffe017e7f67f3.css
/statinamic/statinamic-client.0f0fd4525f91405d6866.css
/statinamic/statinamic-client.0f0fd4525f91405d6866.js
/statinamic/index.html

NETWORK:
*

FALLBACK:
/statinamic/ /statinamic/

I will consider not using gh-pages but a simpler method that use an orphan branch each time.

@thangngoc89 byw the fallback is weird isn't it?

You mean those "main... css" right ?
They are created by babel-plgin-webpack...  I wrote a script to delete them before deploy.
Fallback is fine imho. Extracly what I wrote in test

Ah... So maybe we should just provide an outputPath or something to webpack static config in order to avoid those files?

https://github.com/istarkov/babel-plugin-webpack-loaders/issues/48

This will be more complicated than expected, but we will handle that :)

After all with recent changes, it tooks a single line of secret configuration :)


Do not pause connection stream to detect closed connections immediately

Resolves / closes #210
Builds on top of #188
Prerequisite for #39

Rebased to resolve merge conflict now that #317 is in :shipit:


Cache Go modules

Resolves #48

Did you look at the time improvement? Funny/Interesting that Go 1.11 second build was much faster but Go 1.12 did not improve much or significantly. I wonder if Go 1.12 already caches it.


Store StartTime as an int64 with metadata that it is a timestamp in…

Store StartTime as an int64 with metadata that it is a timestamp in millis. The number of milliseconds since unix epoch long exceeded so this will always overflow :facepalm:.

I'm going to merge this as I think it's pretty uncontroversial

LGTM!


Changed button component to functional

Refactor button component with react hooks. Related issue #136

Looks good. please use react.memo if possible ( unless there is no actual benefit from it or it breaks the current functionality  )


bigtop-deploy: replace hiera() with lookup

I noticed the following while trying to run the docker provisioner:
Warning: The function 'hiera' is deprecated in favor of using 'lookup'.
See https://puppet.com/docs/puppet/5.5/deprecated_language.html
I know that we need to keep compatibility with older OSes, but with Bigtop 3.x we may be able to have a more up to date puppet version available.

@elukey Could you file a JIRA issue and put the id (BIGTOP-xxxx) on the title of this PR?
https://cwiki.apache.org/confluence/display/BIGTOP/How+to+Contribute

I got following error on CentOS 7 with the patch. Could you take a look? Puppet 3.6.2 was install on CentOS 7 by bigtop_toolchain/bin/puppetize.sh.
$ ./docker-hadoop.sh --create 1 --image bigtop/puppet:trunk-centos-7 --memory 16g --repo file:///bigtop-home/output --disable-gpg-check --stack hdfs,mapreduce,yarn
...
Error: Function lookup() did not find a value for the name 'bigtop::jdk_preinstalled' on node 8ae2b15d58b0.bigtop.apache.org
Error: Function lookup() did not find a value for the name 'bigtop::jdk_preinstalled' on node 8ae2b15d58b0.bigtop.apache.org

$ ./docker-hadoop.sh --exec 1 puppet --version
3.6.2

@elukey Could you file a JIRA issue and put the id (BIGTOP-xxxx) on the title of this PR?
https://cwiki.apache.org/confluence/display/BIGTOP/How+to+Contribute

Definitely: BIGTOP-3525

I got following error on CentOS 7 with the patch. Could you take a look? Puppet 3.6.2 was install on CentOS 7 by bigtop_toolchain/bin/puppetize.sh.
$ ./docker-hadoop.sh --create 1 --image bigtop/puppet:trunk-centos-7 --memory 16g --repo file:///bigtop-home/output --disable-gpg-check --stack hdfs,mapreduce,yarn
...
Error: Function lookup() did not find a value for the name 'bigtop::jdk_preinstalled' on node 8ae2b15d58b0.bigtop.apache.org
Error: Function lookup() did not find a value for the name 'bigtop::jdk_preinstalled' on node 8ae2b15d58b0.bigtop.apache.org

$ ./docker-hadoop.sh --exec 1 puppet --version
3.6.2

This is very strange, I can repro (but not on Debian 10). In theory bigtop::jdk_preinstalled has a default "false", no idea why it yields this error, will keep checking!

With a more fresh mind, Debian 10 installs puppet 5.5, so lookup in there is probably different and not comparable. It seems as if the lookup in puppet 3.6.2 doesn't really accept the default_value, ending up in not finding anything.
Debian 9 has also different problems (with puppet 4), see:
Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Lookup of key 'hadoop::kerberos_realm' failed: DataBinding 'hiera': Invalid interpolation method 'lookup' at /bigtop-home/bigtop-deploy/puppet/modules/hadoop/manifests/init.pp:35:7  at /bigtop-home/bigtop-deploy/puppet/manifests/cluster.pp:230 on node b27e057e3765.bigtop.apache.org

Will  try to see if anything can be done, but maybe it is a task too difficult for the broad range of OSes supported, not sure :(

I am going to discard this there were a lot of efforts to migrate to puppet 5.x but we decided to avoid it:
https://issues.apache.org/jira/browse/BIGTOP-3161
<EMAIL_ADDRESS>I hoped to be able to move to lookup but the function varies too much from puppet 3 to 5, and adding a ton of conditionals in the code to support both seems only polluting the code with no benefit..


feat: add support for configuring runner worker root device name

Description
These changes add support for configuring the root device name for the Docker Machine instances. This is necessary when using an Amazon Linux AMI where the default device name of /dev/sda1 ends up creating a 2nd, unused, non-root volume.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html#available-ec2-device-names
Closes #1154
Verification
Confirmed root device on Docker Machine instances is correctly configured in both fleet-mode and non-fleet mode when using an AL2 AMI. Checked this in AWS Console.

Moved the images to a separate issue to get a cleaner commit message (as the whole PR description is used as commit message).


Adding back to top for readme file.

I want to add back to top at the end of read me since it is very long. I am a GSSOC contributor. I want to start with this.

Please assign me this issue as GSSOC 23 - I'm very much interested in updating the README file

already present


Unable to build shogun

I was trying to do a clean vm make of shogun, using this Dockerfile
The make procedure gets stuck after this line.
[  2%] Building CXX object src/shogun/CMakeFiles/libshogun.dir/classifier/LDA.cpp.o
I also tried running shogun installation using the same docker file, but I am getting the same error.

@palashahuja would really need more information than this...
like are you building yourself the docker image?
or just launching a docker container based on shogun/shogun-dev and try to compile shogun in it?

@vigsterkr  I am actually running a docker container based on shogun/shogun-dev, cloned that repo and ran the installation process. The installation seems to stop at that particular line.

ok so can you check your cpu load?

The make process that is running with PID 5089 is taking the maximum cpu usage.

@vigsterkr, I am unable to understand why is this exactly happening ?

Closing as this seems to be unrelated to Shogun


📖 Copy-editing docs/faq.md

What kind of change does this PR introduce?
Typos and copy-editing for docs/faq.md.

The failing checks seem to be about exceeding API rate limits.


Implement a game loop

I'd love to see a processing/rendering time independent game loop, so speed is calculated by how quick we can run the loop, meaning the user experience (train speed) is the same no matter if it is rendering at 2fps or 30fps.
Also implement a redraw rate limiter, no point in drawing over 30fps.

I think a draw loop and a game loop being separate makes sense. It would help with debugging :)

True. I think one hit timers would be the best bet. You run RenderBoard() and calculate time till next render is required. That way you can limit frames, 33ms - TimeToRender = Timer interval, giving max 30fps, and limit minimum redraw, eg, if TimeToRender >= 33ms, still sleep for 10ms or so, lowering the FPS but still giving CPU time to other operations.

TL;DR: Yes, 2 timers.

https://www.youtube.com/watch?v=KDFclOrzXeQ


chore: Refactor Accordion component to use state hook for panel activation

Fix #7001: chore: Refactor Accordion component to use state hook for panel activation

@rickhanlonii


Make TimerManager threads non-joinable

On gRPC shutdown, any unjoined TimerManager threads will cause TSAN to detect thread leaks. This PR resolves issues I saw on end2end test shutdown in another PR, where a single timer manager thread was always alive after the test ended.
The long-term solution is to integrate the new ThreadPool here, but this unblocks me for now.

The train ran a few hours late today, but did finally arrive 9 hours later ... none of the 20 errors were related.


非project目录构建提示警告

在非project目录构建会提示警告
warning: You are working in the project directory(/home/ekko/work/projects/SG-xmake) and you can also
force to build in current directory via run xmake -P .
如何配置来关闭这个提示呢？

你上层有xmake.lua，当前不是项目根目录 请到项目根目录执行xmake


Rename to BeepBoop

May as well resolve #81 if we are going to the trouble of changing the app id

Never mind, snaps can't be renamed.


unmarshalling JSON error: network.NewUsagesClient returns float64 instead of int64

Bug Report
networkClient := network.NewUsagesClient(*subscription.SubscriptionID)
networkClient.Authorizer = AzureAuthorizer
for _, location := range locationGroupArray {
    _, _ := networkClient.List(context, location)
}

results in following error:
panic: network.UsagesClient#List: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal number 8.0 into Go struct field Usage.currentValue of type int64' JSON = '{
  "value": [
    {
      "currentValue": 8.0,
      "id": "/subscriptions/xxxxxxxxxxxxx/providers/Microsoft.Network/locations/westeurope/usages/VirtualNetworks",
      "limit": 50.0,
      "name": {
        "localizedValue": "Virtual Networks",
        "value": "VirtualNetworks"
      },
      "unit": "Count"
    },

Might be a duplicate from #906 but it's still not working. When will this be fixed? The definition is still using int64 😞

It looks like a bug in the swagger as it's been defined as int64.
https://github.com/Azure/azure-rest-api-specs/blob/master/specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/usage.json#L111
The limit field also has the same problem.
I've opened issue https://github.com/Azure/azure-rest-api-specs/issues/3537 to track fixing the swagger.

@mblaschke finally heard back from the service team, they're working on a fix now.

Closing as it is tracked in  Azure/azure-rest-api-specs#2366


Add support to insert a layer above a reference layer

Right now, only the below layer is exposed. This exposes the above layer as well.
I do realise that there is some code generation setup in the repo (see scripts), but I don't really know how to use them, or even if you are planning on keeping them (the repo does not seem very active to be honest).
Are the changes fine like this, or should I try to get them through the codegen? For the latter, how do you run the codegen?
@RomanBapst: FYI

@JonasVautherin Yes this repo is pretty stale.
Please see this issue: https://github.com/maplibre/maplibre-native/issues/1189
We're planning to merge the Annotations functionality back into the main repo, for easier maintainability. If you could share your thoughts, also in the context of this issue, that would be very helpful.

Yes this repo is pretty stale.

Does that mean we should just maintain and publish a fork until we see how it goes with #1189 and get a chance to have our changes merged there?

@JonasVautherin Definetly a good question! I was not aware that we had code generation in this repo at all.
To answer the question how to use it: provided that you are at the root of your repository, and that nodejs is installed,

Make sure the submodule is in place with git submodule init && git submodule update
Run node plugin-annotation/scripts/code-gen.js

I think we can extract multiple todos from this:

document codegen
sync codegen with current code (as we had multiple PRs that did not update the codegen code, including from me)

sync codegen with current code (as we had multiple PRs that did not update the codegen code, including from me)

So now I think I have more questions :sweat_smile::
@louwers above seemed to suggest that those plugins would be rewritten soon. Should we bother getting the codegen in sync with the previous changes? I'm happy to make the codegen work for this PR, but it means that you will lose your previous changes, right?

@JonasVautherin Happy to merge this and make a release.
Yeah there is code gen involved, I haven't really looked into it much. 🥲

@RomanBapst Could you also review these changes?
@JonasVautherin Let me know when it is ready to merge.

@RomanBapst Could you also review these changes?

Note that all I did was move the changes into the template and have the file auto-generated. So it's really the same thing, except for two UiThread annotations that we apparently did not need before (and that are now autogenerated).

Let me know when it is ready to merge.

@louwers: I think it would be nice to first merge https://github.com/maplibre/maplibre-plugins-android/pull/36, such that we could see here that it passes the unit tests here :innocent:

I think it would be nice to first merge https://github.com/maplibre/maplibre-plugins-android/pull/36, such that we could see here that it passes the unit tests here

I merged #36, so if you were to rebase onto main, we would be able to get new test results :)


refactor: guest.php with best practices ⚒✨

Description

Requesting a refactoring of the guest.php script in the Shorty repository to improve maintainability and readability.
The goal is to enhance the code structure and ensure it follows best practices for better collaboration and future contributions.
The important change we want to make is to prevent SQL Injection and vulnerabilities, the refactored guest.php script will use mysqli_real_escape_string() to sanitize user inputs effectively.

Proposed Changes

Organize the script into functions for better readability and reusability.
Sanitize user inputs using mysqli_real_escape_string() to prevent SQL injection.
Optimize the script logic and reduce repetitions.
Simplify the URL validation logic.
Improve user feedback messaging for better user experience.

Hey there @apoorvaron 👋🏻
Please make sure to assign this issue to me, this is important one 🚨
Let's proceed with refactoring the guest.php script in the Shorty repository, ensuring SQL injection prevention and empowering contributors on their journey to a more secure and efficient codebase! 🤝🚀"

@0xabdulkhalid Assigned && also create a separate guest.css file for the styling part inside (/shorty/assets/css/guest.css) move all the inline / internal code to guest.css

@apoorvaron Yeah i can work on the css part after you merge this #279, Because the styles are changed on that.
I can't work on css part without merging that, I want to pull the changes / update the branch to start my work

ok

@0xabdulkhalid start working on this


The lab applications are not examples.

The lab applications are not examples.

Need to figure out #616 before merge - I have no idea what the hell has happened to that PR I literally just upversioned .NET and now it's complaining about errors in the generated code even though we don't regenerate code aaaaaaaaaaaaaaaaaaaa, help would be appreciated.


Provide avg laptimes by class over time

The laptimes contained in the speedmap data should be used to calculate avg laptimes over 15min intervals.

Reduced the interval to 2min. Server side computation was no big deal and frontend graphs can handle the amount even for 24h races


Make it less complicated.

Summary of the new feature / enhancement
Make upgrading to Powershell 7.x easy. It's so complicated and frustrating. There should be a simple installer that gives the option to migrate everything, including the Developer shortcuts especially, as well as $PROFILE (either by copying or symlink--give an option). It's crazy how much time it takes to transition and how error prone and brittle the process is. Developers have enough to worry about without all this craziness!
Proposed technical implementation details (optional)
Provide a graphical installer with options that automate all of this. Make developers especially a focus.

Powershell is portable application, which means you can unzip, copy and run it.
This is suitable for Windows, Linux, and ARM CPUs.
On win:
Iex "&{$(irm https://aka.ms/install-powershell.ps1 ）} - UseMSI - Quiet“
linux:
https://aka.ms/install-powershell.ps1
On Linux:
https://gitee.com/chuanjiao10/kasini3000_agent_linux

as well as $PROFILE

In my case powershell and pwsh profiles are not full compatible.

as well as $PROFILE

In my case powershell and pwsh profiles are not full compatible.

This is why the profile directories are kept separate.
I have made mine compatible on Windows PowerShell, PWSH 7 on Windows and PWSH on Linux (WSL), and created symbolic links to run the same file on all of them
For any non-trivial profile it is the user's call  whether they want to do extra work to keep things in sync but avoid compatibility issues,  or do extra work for compatibility but avoid sync issues.  But either way there is work.
I think what the OP is calling for would save a small amount of setup for people like me (who I think are the minority) and break things for @237dmitry  (and I think the majority, or at least a considerable minority) without an obvious fix.
Telling users "Put a profile here if you're happy it works with this version" is OK IMHO. Changing Windows PowerShell so it goes to a different directory if there is no \DocumentsWindowsPowerShell and to search the \program files\PowerShell\modules folder will result in things which don't work down level being loaded and probably can't be done at this stage. (Windows PowerShell is not changing any functionality only fixing bugs and security issues).  Changing PowerShell 7 to load a Windows PowerShell 5 profile which might not be correct for 7 will also cause problems.  So I think what we have is the "least worst" of the available choices
I totally agree with the sentiment of the OP. We have plenty of people who have been slow to get off Windows PowerShell and onto 6/7. Anything that can be done to make their lives easier is a plus. But something which migrates everything is likely to migrate things which should not be moved. My WindowsPowerShell directory has been a symbolic link to my personal one drive since it was called "Skydrive" and contains 15 year old junk that I've never bothered to clean up, so if the PowerShell 7.4 preview installer said "hey I'll copy that for you"  it would be the wrong thing.  So anything which tries to make this process easier comes with a risk of actually making matters worse.

I have made mine compatible on Windows PowerShell, PWSH 7 on Windows and PWSH on Linux (WSL), and created symbolic links to run the same file on all of them

It could be make a compatible profile, create symbolic links to it. But for this, it is necessary to organize branching in the profile. I think that this is superfluous, quite satisfied with the current state of affairs. My Windows PowerShell profile contains everything, and the PowerShell Core profile is rather the main function, if it could be compared it like that, and everything else is placed in external files (functions, classes, psstyle, custom formats and prompt files). As for Windows PowerShell I use it very rarely nowadays and did not edit its profile for a long time.

I do have a single profile that has certain checks depending on whether I am in ISE, VSCode, WinTerminal or a PowerShell v5.1 or 7.x session
Unfortunately this is going to be a very much user and device specific thing that we can't make simpler than it already is without a really really heavy amount of investment.
That said I am going to mark this for the engine & interactive console teams (I'm also a part of the Interactive team) so that they can also review this ask in case they have any further thoughts on your suggestion but personally I think this is very unlikely to happen anytime soon if it it even something that is likely to be possible without being too brittle and breaking people in the process. It certainly would be a nice to have if at all possible though, so thanks for raising it for consideration!

The interactive working group has reviewed this issue. As you can see from the conversation - this is very complicated issue.  At the moment, there are more questions than answers about the best direction and technical implimentation. We look forward to learning from the community on concrete steps we could take to further resolve this pain.  We will move this to a discussion to gather further conversation.


[react/jsx-handler-names] Definition for rule 'react/jsx-handler-names' was not found

Canonical is showing this error. Just reporting in case a plugin or something is missing.

Depends on https://github.com/yannickcr/eslint-plugin-react/issues/334.

https://github.com/gajus/canonical/commit/6adaba390fdf591ebd42bd0b8713543fbe72fe18


Add instructions for partner customer attribution in Bicep templates

@pthalamy
Thank you for your contribution. Would you take a moment to sign the Contributor License Agreement (CLA)? After the CLA is signed, someone can review your pull request.
Thanks!
#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@microsoft-github-policy-service agree

Hello @pthalamy , thank you for your contribution! In talking to the product team, they didn't feel that this was the right article to include the Bicep snippet. I'm continuing to track this internally with the deployment docs team to see if they would be interested in including and/or referencing this. #please-close


fix case_column_or_null with nullable when conditions

Which issue does this PR close?

Closes #13885 .
Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Thanks @richox and @xudong963 🙏


Added legend to the network map

Hi Somesh,
I've added legend to the network map.
I've used the male images for all the 3 cases. However, it would be better if it shows just the color and not the gender in the legend, so that its more generic.
Let me know if you have such images.

Hi, these are a little too big, are making the graph look cluttered. Consider a smaller design.

Hi, i've reduced the font size of the label and the size of the image.

Just occurred to me - can you make this so that it acts as a legend for other nodes as well, depending on the filter selected. Like for city, state, foreign destination, local destination.

Yeah that thought crossed my mind too. Lemme get back with another commit.

Can you merge from to latest master. The city cluster fixed so you can add legends for it.

Sure.

Have pushed again with the latest master code.

Thanks. Looks good! Merging.


Promises for remote API

Hi there,
great library you are maintaining for us. I appreciate how simple it is. With all this simplicity do you think some promise handling would fit in?
Imagine I have 2 components: Root, Child.
In Root.vue, I fetch item and assign it to the store upon app init:
store: {
  item: 'path.to.item'
}

mounted() {
    itemService
       .get(itemId)
       .then(item => {
            this.item = item
       })
}

In Child.vue, I want to use item but it hasn't been fetched yet.
store: {
  item: 'path.to.item'
}

mounted() {
    const itemKey = this.item.key // this.item is undefined
}

Is there some strategy how to handle it without modifying vue-stash? Or does need some promise support to handle this case?

This is an interesting challenge..
One possible solution, albeit not so elegant, might be..
root.vue
store: {
  item: 'path.to.item',
  iteamSet: false
}

mounted() {
  itemService.
    .get(itemId)
    .then((item) => {
      this.item = item
      this.itemSet = true
    })

child
computed: {
  itemKey() {
    return this.itemSet ? this.item.key : null
  }

The above snippet isn't exactly elegant, but I believe it'd work. I'm definitely open to alternative solutions and am intrigued by the problem itself. I don't however have a better idea off the top of my head.. I'll be sure to keep this challenge simmering in the back of my mind, hopefully something will come up.
Any ideas of your own?

@cklmercer Why not, it's a way too. Unfortunately, this way won't help if you for example need to subscribe to a particular destination in STOMP - the destionation string would just contain undefined.
I will use the same way like you. If my intuition finds out how to solve it I'll come back and post it.

Feel free to reopen this issue if you come up with a solution. I'll be sure and reference it if I do.


[New game]: Star Wars character game

🎮 Game Request
The game is based on the following tech stacks:

HTML
CSS
JS

You need to add your favorite character from the given list of characters and then you will be provided a character from the same list then a comparison will be made amongst both of these to check whether your character is same to the provided character or not.
Point down the features

system to rate disney
select favourite star war character
provide a star war character
make comparison

Select program in which you are contributing
GSSoC23
Code of Conduct

[X] I follow CONTRIBUTING GUIDELINE of this project.

Hey @S-ishita !
Thank you for raising an issue 💗
You can self assign the issue by commenting /assign in comment 😀
Make sure you follow CODE OF CONDUCT and CONTRIBUTING GUIDELINES 🚀
Don’t Forget to ⭐ our GameZone🎮
Make sure you join our Discord🕹

/assign

Hey @S-ishita ! Thank you so much for your raising the issue💗
It’s all yours, you can come anytime again and make some contributions! 🚀
Alone, we can do little, but together we can do so much! 😇


Make react-draggable work with React Bootstrap Modal

Is there a way to make react-draggable work React Bootstrap Modal?
I'm thinking at something like this (btw..this doesn't work):
<Draggable handle=".modal-header">
    <Modal className="myClass" {...this.props} bsSize='small' title='Modal heading' animation={false}>

            This is a test!

            <Button>Close</Button>

    </Modal>
</Draggable>

Please post a JSFiddle and elaborate on "doesn't work".
On 5/27/15 10:51 AM, Cosmin Nicula wrote:

Is there a way to make react-draggable work React Bootstrap Modal?
I'm thinking at something like this (btw..this doesn't work):
|
<Modal className="myClass" {...this.props} bsSize='small' title='Modal heading' animation={false}>

This is a test!

Close

|
—
Reply to this email directly or view it on GitHub
https://github.com/mzabriskie/react-draggable/issues/56.

Have a look at this Gist https://gist.github.com/cosminnicula/4fb7bcbf43d0e9f0271a
P.S. I'm using Webpack which outputs bundle.js and vendors.js. In vendors.js will be libraries like react, react-bootstrap and react-draggable
Let me know if you have any more questions.

Please import this into a jsfiddle so it can be run in the browser, or
submit a full working example in a repository that can be cloned and used.
On 5/27/15 11:05 AM, Cosmin Nicula wrote:

Have a look at this Gist
https://gist.github.com/cosminnicula/4fb7bcbf43d0e9f0271a
P.S. I'm using Webpack which outputs bundle.js and vendors.js. In
vendors.js will be libraries like react, react-bootstrap and
react-draggable
Let me know if you have any more questions.
—
Reply to this email directly or view it on GitHub
https://github.com/mzabriskie/react-draggable/issues/56#issuecomment-105977859.

I've create a repository here https://github.com/cosminnicula/ReactBootstrapModalDraggable

Okay.
It seems this is a limitation of the Modal code and won't be possible without a modification to React-Bootstrap.
The issue is the render(), which renders the Modal and its full-page backdrop:

  {/* Draggable should be inserted here */}

      {this.props.title ? this.renderHeader() : null}
      {this.props.children}

There should be an option to include a wrapper component here or otherwise replace the
 with a custom component.

Closing as this is not a React-draggable issue but rather a React-bootstrap issue.

For anyone who might bump in this and would like to have a draggable react-bootstrap dialog, I made a GIST.
https://gist.github.com/burgalon/870a68de68c5ed15c416fab63589d503

Thanks @burgalon , This may help me build a similar solution for react-modal (react-modal#45, react-modal#232)


Per process death and restart

Currently the fault type supported by Antidote is only killing an entire node, then restarting it will load the state back from disk and restart all connections (see tests here for examples https://github.com/SyncFree/antidote/blob/master/test/multiple_dcs_node_failure_SUITE.erl).  Differently, if a single process within the node dies and restarts it will not necessarily load the state correctly.  Fixing this should be easy and should simplify the entire node restart. (Note that transaction coordinator failure during transaction execution is not discussed here since that would require its own recovery process/protocol, here I am only considering the persistent processes running the db).
Here is a list of the processes and what is missing/working:
Stable time calculation (https://github.com/SyncFree/antidote/blob/master/src/meta_data_sender.erl and https://github.com/SyncFree/antidote/blob/master/src/meta_data_manager.erl):  This process doesn't need to recover any data since the stable time is calculated from other processes sending it values.  The only danger here is that if a process adds a stable time and it is missing an entry for a DC, the time for that DC will not be calculated correctly (see https://github.com/SyncFree/antidote/blob/master/src/stable_time_functions.erl#L42).  A simple fix would be for example to set the entry for that DC to 0 until it's safe.
inter_dc_log_sender_vnode : This process propagates transactions to other DCs.  The only sate it needs it the id of the last transaction it has sent.  On start it waits for the logging_vnode to send this data, instead it could fetch this data itself.  This process also sends heartbeats to other DCs based on a timer, it also waits for the logging vnode to start this timer (https://github.com/SyncFree/antidote/blob/master/src/inter_dc_log_sender_vnode.erl#L75).  Instead it could start its own timer once it knows the values of the ids previously mentioned.
inter_dc_sub_buf / inter_dc_sub_vnode : This process receives transactions from other DCs, it needs to know how the id of the last transaction received from each DC.  It loads this from the logging vnode (https://github.com/SyncFree/antidote/blob/master/src/inter_dc_sub_buf.erl#L56) so no change is needed here.
logging_vnode : The only in-memory state kept here is the id of the last transaction received from each DC and the id of the last transaction committed at this DC.  It loads this state on restart, but after restart it only keeps the local transaction id counter up to date.  It should also keep the external counter up to date as well, so that when the inter_dc_sub_buf requests this id it gives the correct value.
materializer_vnode : The state of the objects is loaded from the log on process restart, so no change is needed here.
inter_dc_sub : This process connects to other DCs through ZMQ.  It does not reconnect on restart, instead it waits for the check_node_restart function to do this (https://github.com/SyncFree/antidote/blob/master/src/inter_dc_manager.erl#L187).  It could do this itself.
inter_dc_query : This process handles all other interDC traffic (log recovery, bounded counters, cross DC reads in partial rep).  It also waits for the check_node_restart function to do reconnection on restart.  It could do this itself.
meta data (https://github.com/SyncFree/antidote/blob/master/src/stable_meta_data_server.erl) : This stores meta-data that needs to be persistent apart from the transactions. For example the name of the local DC and information about other DCs (ips/ports, etc).  This information is stored on disk (in dets) and is loaded into memory on process restart so no change is needed here.

I forgot his one:
clock_si_vnode : This process keeps in memory the transactions that have been prepared, but not yet committed.  On restart it should load this information from the log.
(As a side note here it is worth saying that in the current implementation, if an update for a key is prepared and is not committed, then that key is blocked forever from being accessed, i.e. there is no timeout or forced commit/abort).

Per process restart is not yet supported? What are some of the advantages of having it?

Per process restart is not yet supported? What are some of the advantages of having it?


[Documentation] Roadmap link is broken in the docs

In our docs, 'Our current Roadmap' link is broken at
https://docs.storefrontui.io/contributing/become-a-contributor.html#important-resources
Should we update it to any other GitHub project roadmap link from here https://github.com/DivanteLtd/storefront-ui/projects or
link it to the Roadmap file https://github.com/DivanteLtd/storefront-ui/blob/develop/ROADMAP.md

Thank you @AdamPawlinski and @mayashavin!


I try to use the apiserver config defined by myself but it doesn't take effect

If you want to define your own apiserver config, The better way is using constomized kubeadm config. #762 check this out.

I try to use the apiserver config defined by myself but it doesn't take effect

I know the reason, because the sealer machine and the k8s-master0 machine are not the same machine. the rootfs folder is not mounted on the machine where the sealer is executed
I think this is a bug
Originally posted by @wangkun-king in https://github.com/alibaba/sealer/issues/795#issuecomment-957330888

what is sealer version？


pin the version of nvidia-container-toolkit

Summary

This pr update our recipe to pin the version of nvidia-container-toolkit rpms to 1.16.2 so that we do not release the 1.17.1 version.
Implementation details

Testing

New tests cover the changes:
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Could you add in the PR description why we are pinning to this version? I believe there is a bug in 1.17.1 that we can reference somewhere?


Kiali Graph not working with istio 1.19 in a HA cluster

When installing Kiali 1.76 with istio 1.19 in a HA cluster, the graph does not work if the "display idle nodes" option is selected.

This issue also adds a new version of Istio 1.19.5 to dev-v2.8

This was fixed by https://github.com/rancher/charts/pull/3612


Add: zoneId to Dev

add zoneid from config to dev, for preview usage.
Is also necessary for --host to be implemented

approving this for now, but really what we should do is deduce the zoneid from the --host parameter directly. Think we can do that instead? We're trying to deprecate the zoneId param and it would be annoying to add it here for --host.

Yeah actually I think that's what we should do. Just not use zoneId, and just infer it from the passed host.

Here's an idea for inferring the zoneId:

Note: if the account has no workers.dev subdomain, we must provide a zoneId, even if the --host argument is not used.
List the zones for the account: GET /zones?status=active&account.id={}

If none, throw an error, encourage the user to create a workers.dev subdomain. (in the future, we can create 1 for them on the spot)
If 1, use that.
If more than 1:

If --host was provided, select the zone that matches the host.
If no --host is provided, or there is no match, have the user select the zone from a dropdown.

Going to implement inferred zoneid in #425


[help wanted] log ssh cmd errors

Issue Description
Type: feature request
Describe what feature you want
Sealer uses ssh cmd to execute some Linux commands,  but we do not know the real error output message
For example, in the following error, we do not know the real cause.

so we can log ssh cmd error to make it easier to know what went wrong.
Additional context
Add any other context or screenshots about the feature request here.

I want to do this, can you assign me : )

I want to do this, can you assign me : )

hhh, feel free to pr your code.


remove object file

Can I add object files to the gitignore?

Can I add object files to the gitignore?

I don't see any reason why we would want to check them in and even if we want to (at some weird point in time) the prohibition by the .gitignore can be ignored with --force.


create_slice in leptos_reactive

create_slice can take a complex signal and only react to parts of it. It has a green test but requires a better Docstring explaining what it is meant for

@Gentle, sorry I feel a little responsible for the build failure here...
The build was rejected because of a indentation issue.. its is a new thing
If, you run
cargo fmt

It will automatically fix the white-space/indentation issue.

In this particular case rebasing should fix it, as this is a formatting issue from outside your code that I've subsequently fixed on main.

Yeah this looks good. @Gentle, at your convenience could you add a slightly more descriptive doc comment as you mentioned, or do you want me to do it?

I changed the generic callback signatures to impl signatures since RA handles those more nicely (and everything else in leptos_reactive does it that way)
The example is now domain-specific and with more documentation about what a slice does and should be used for

This looks awesome! Thanks so much.


Update DG for FindAppt and Delete

Looks good to me! Thanks for helping to change Person -> Patient as well


HSEARCH-4920 Add lucene upgrade jobs

https://hibernate.atlassian.net/browse/HSEARCH-4920
I haven't found if there are snapshots for ES/OS images, so I haven't added anything for them...
As for the Lucene upgrade, I thought we could run the upgrade tests for the current 9 series as well as for the upcoming 10.

Hey, thanks for the links! I was looking at the ES docs and didn't find a snapshot repository (especially since there's a concept of snapshots in ES so 😄)
I have tested the Lucene 9 upgrade, but since it was failing if only a test module was built (I assumed that it might have to do with pulling snapshots) I wanted to see if it'll be ok on CI (Running a full build with the upgrade did work).
But now since you've asked 😃 I've tested the Lucene 10 upgrade as well and turned out there's a missing constant org.apache.lucene.util.automaton.RegExp#COMPLEMENT in the main branch... but it is not deprecated or anything like that in the current 9x series ... so I've removed the testing of Lucene 10 snapshots for now....
As for the Elasticsearch client -- the last published snapshot that I've found was 8.5.4 ... so since it's a bit dated 😃 I've tried running the tests against the latest container snapshot but keeping the client at whatever version it is in the pom.

But now since you've asked 😃 I've tested the Lucene 10 upgrade as well and turned out there's a missing constant org.apache.lucene.util.automaton.RegExp#COMPLEMENT in the main branch... but it is not deprecated or anything like that in the current 9x series ... so I've removed the testing of Lucene 10 snapshots for now....

Please keep it, we need to address that. Maybe in a wip/ branch? And we need to deprecate this flag in Hibernate Search 7.0... perhaps even 6.2.2?

As for the Elasticsearch client -- the last published snapshot that I've found was 8.5.4 ... so since it's a bit dated 😃 I've tried running the tests against the latest container snapshot but keeping the client at whatever version it is in the pom.

Yes, not upgrading the client is fine.
Oh, so they have a float tag for the latest version, that's great.

Any luck on the OpenSearch side of things?

Merging, thanks


chore(deps): bump newtonsoft json to 13.0.1 to fix packages with vuln…

#4117

@RicoSuter maybe you can review this PR.
Thanks in advance


Error when I view media from Photos Library

I want to show, with Grid, media from Photos Library, but I have this result.

The code is.
//ContentView File
import SwiftUI
import Photos
import Grid

struct ContentView: View {

    @State private var assetsStruct = [AssetStruct]()

    var body: some View {
        NavigationView {
            ScrollView {
                Grid(assetsStruct) { assetStruct in
                    NavigationLink(destination: Text(assetStruct.asset.localIdentifier)) {
                        MediaThumbView(asset: assetStruct.asset)
                    }
                }
            }
            .onAppear {
                self.assetsStruct = FetchMediaUtility().fetchNumLastAssetsStruct(numAssets: 20)
            }
            .gridStyle(
                ModularGridStyle(columns: .min(100), rows: .fixed(100))
            )
                .navigationBarTitle("Media from Photos Library", displayMode: .inline)
        }
        .navigationViewStyle(StackNavigationViewStyle())
    }
}

struct MediaThumbView: View {
    let asset:PHAsset
    var body: some View {
        let manager = PHImageManager.default()
        let requestOptions = PHImageRequestOptions()
        requestOptions.isSynchronous = true
        requestOptions.isNetworkAccessAllowed = true
        var thumbnail = UIImage()
        manager.requestImage(for: asset, targetSize: CGSize(width: 100, height: 100), contentMode: .aspectFit, options: requestOptions, resultHandler: {(result, info)->Void in
            if let result = result {
                print("Video o Image width: \(result.size.width) - height: \(result.size.height)")
                thumbnail = result
            }
        })
        return Image(uiImage: thumbnail).resizable().aspectRatio(contentMode: .fit)
    }
}

//File FetchMediaUtility
import Photos

struct AssetStruct: Identifiable {
    let id = UUID()
    let asset:PHAsset
}

class FetchMediaUtility {

    // Ultimi numAssets di AssetStruct
    func fetchNumLastAssetsStruct(numAssets:Int) -> [AssetStruct] {
        let fetchOptions = PHFetchOptions()
        fetchOptions.fetchLimit = numAssets
        fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
        let fetchAssets = PHAsset.fetchAssets(with: fetchOptions)
        var phAssetStructArray = [AssetStruct]()
        for index in 0..<fetchAssets.count {
            let asset = fetchAssets.object(at: index)
            phAssetStructArray.append(AssetStruct(asset: asset))
        }
        return phAssetStructArray
    }
}

Is there something wrong in my code or something on the Grid?
I hope someone will let me know how to make Grid work, because it is the only repositary that solves my problem.

@CPiersigilli one thing I can see why your images are blue color is this line
Image(uiImage: thumbnail).resizable().aspectRatio(contentMode: .fit)

should be
Image(uiImage: thumbnail).renderingMode(.original).resizable().aspectRatio(contentMode: .fit)

Do you expect a different layout as well or that was the only issue?

This is the result.

I change the code for view the image for date, but the image of 2020-03-28 is not in line.
The code is:
var body: some View {
        NavigationView {
            List(assetsForDate.keys.sorted(), id: \.self) { dateStr in
                ScrollView{
                    Section(header: Text("\(self.assetsForDate[dateStr]!.count) Media del \(dateStr)")) {
                        ScrollView {
                            Grid(self.assetsForDate[dateStr]!, id: \.creationDate) { asset in
                                NavigationLink(destination: Text(asset.localIdentifier)) {
                                    MediaThumbView(asset: asset)
                                }
                            }
                        }
                        .frame(minHeight: 100, idealHeight: 100, maxHeight: .infinity)
                    }
                }
            }
            .navigationBarTitle("Media from Photos Library", displayMode: .inline)
            .onAppear {
                self.assetsForDate = FetchMediaUtility().fetchNumLastGroupOfAssetsForDate(numAssets: 50)
            }
        }
        .navigationViewStyle(StackNavigationViewStyle())
    }

How do I have to change the code to see the photos correctly?
The code to change for me is: .frame(minHeight: 100, idealHeight: 100, maxHeight: .infinity)

@CPiersigilli you have a ScrollView inside a scroll view inside a list. List already has a scrollview built-in. Looks like both scrollviews are not needed here.

How do I have to change the code to see the photos correctly?
What is correctly in this situation? I don't see it. Can you please explain and I'm sure we can make this work.

What is correctly in this situation? I don't see it. Can you please explain and I'm sure we can make this work.

The screenshot above shows 11 media, but only 10 media are seen, because the second is partially hidden from the former.
Also if I delete .frame(minHeight: 100, idealHeight: 100, maxHeight: .infinity), I no longer see any image.
I really like the arrangement of the images as shown in StaggeredGridStyle, but I don't know how it is done.

Other example.

You read 6 media, but you only see 4 media, because the second and third are above the first.

@CPiersigilli oh I see. The following code will give you a staggered grid.
struct StaggeredGridView: View {
    var body: some View {
        ScrollView {
            Grid(1...69, id: \.self) { index in
                Image("\(index)")
                    .resizable()
                    .scaledToFit()
            }
        }
        .gridStyle(
            StaggeredGridStyle(tracks: .min(100), spacing: 1)
        )
    }
}

I change my code, so:
var body: some View {
        NavigationView {
            List(assetsForDate.keys.sorted(), id: \.self) { dateStr in
                ScrollView{
//                    Section(header: Text("\(self.assetsForDate[dateStr]!.count) Media del \(setDateStr(dateStr: dateStr))")) {
                    Section(header: SectionView(dateStr: dateStr, assetsForDate: self.assetsForDate[dateStr]!)) {
                        ScrollView {
                            Grid(self.assetsForDate[dateStr]!, id: \.creationDate) { asset in
                                NavigationLink(destination: GetMediaDetail(asset: asset)) {
                                    MediaThumbView(asset: asset)
                                }
                            }
                            .gridStyle(
                                StaggeredGridStyle(tracks: .min(100), spacing: 1)
                            )
                        }
//                        .frame(minHeight: 100, idealHeight: 100, maxHeight: .infinity)
                    }
                }
            }
            .navigationBarTitle("Media from Photos Library", displayMode: .inline)
            .onAppear {
                self.assetsForDate = FetchMediaUtility().fetchNumLastGroupOfAssetsForDate(numAssets: 50)
            }
        }
        .navigationViewStyle(StackNavigationViewStyle())
    }

but the result is:

If I enabled: .frame(minHeight: 100, idealHeight: 100, maxHeight: .infinity) the result is:

@CPiersigilli so you want sections by date with one row in each?

@CPiersigilli can you google the layout you are trying to do and send me an image?

so you want sections by date with one row in each?
Yes. I want every section to have all the images taken on that day, divided into the lines necessary to view all the images.
I can't show you any layout, because I'm not capable of it.

@CPiersigilli give me a couple of minutes I'll add this example to the repo.

This could be the example: 1 line, if there are for example 3 photos, 2 lines if there are 6, ect ..

@CPiersigilli check out the Sectioned grid example in macOS GridDemo. I think this is the one you are trying to do. Let me know if this helps.

I have changed my code with Sectioned grid example in macOS GridDemo, but the result is black screen:

The code is:
struct ContentView: View {
    @State private var assetsForDate = [String :[PHAsset]]()
    @State private var isSectionView = true
    var body: some View {
        NavigationView {
            ScrollView {
                ForEach(assetsForDate.keys.sorted(), id: \.self) { dateStr in
                    Section {
                        SectionView(dateStr: dateStr, assetsForDate: self.assetsForDate[dateStr]!, isSectionView: self.$isSectionView)

                        Grid(self.assetsForDate[dateStr]!, id: \.creationDate) { asset in
                            NavigationLink(destination: GetMediaDetail(asset: asset)) {
                                MediaThumbView(asset: asset)
                            }
                        }

                        Spacer(minLength: 16)
                    }
                }

                .padding(8)
            }
            .gridStyle(
                ModularGridStyle(columns: .min(100), rows: .fixed(100), spacing: 4)
            )
        }
        .navigationViewStyle(StackNavigationViewStyle())
    }
}

@CPiersigilli try replacing
MediaThumbView(asset: asset)

with
Rectangle().foregroundColor(.blue)

If it looks ok it's something in MediaThumbView

This is the result.

Here is the code of: MediaThumbView(asset: asset)
struct MediaThumbView: View {
    let asset:PHAsset
    var body: some View {
        let manager = PHImageManager.default()
        let requestOptions = PHImageRequestOptions()
        requestOptions.isSynchronous = true
        requestOptions.isNetworkAccessAllowed = true
        var thumbnail = UIImage()
        manager.requestImage(for: asset, targetSize: CGSize(width: 100, height: 100), contentMode: .aspectFit, options: requestOptions, resultHandler: {(result, info)->Void in
            if let result = result {
                print("Video o Image width: \(result.size.width) - height: \(result.size.height)")
                thumbnail = result
            }
        })
        return Image(uiImage: thumbnail).renderingMode(.original).resizable().aspectRatio(contentMode: .fit)
    }
}

Other result:

@CPiersigilli I think
 return Image(uiImage: thumbnail).renderingMode(.original).resizable().aspectRatio(contentMode: .fit)

should be
return Rectangle()
    .foregroundColor(.clear)
    .background(
        Image(uiImage: thumbnail)
            .renderingMode(.original)
            .resizable()
            .scaledToFill()
    )
    .clipped()

The result.

@CPiersigilli does Sectioned grid example looks ok when you run it?

No. I tried to edit MediaThumbView, without success. Other result:

Where I see writed 6 images, I see one images.

@CPiersigilli no I mean GridDemo in this repository. Please run it and see if it looks ok.

I have restructure my code and in particular MediaThumbView in this mode:
func mediaThumb (asset:PHAsset) -> UIImage {
    let manager = PHImageManager.default()
    let requestOptions = PHImageRequestOptions()
    requestOptions.isSynchronous = true
    requestOptions.isNetworkAccessAllowed = true
    var thumbnail = UIImage()
    manager.requestImage(for: asset, targetSize: CGSize(width: 100, height: 100), contentMode: .aspectFit, options: requestOptions, resultHandler: {(result, info)->Void in
        if let result = result {
            print("1-Size Media - width: \(result.size.width) - height: \(result.size.height)")
            thumbnail = result
        }
    })
    return thumbnail
}

and the ContentView file:
var body: some View {
        NavigationView {
            ScrollView {
                ForEach(assetsForDate.keys.sorted(), id: \.self) { dateStr in
                    Section {
                        SectionView(dateStr: dateStr, assetsForDate: self.assetsForDate[dateStr]!, isSectionView: self.$isSectionView)

                        Grid(self.assetsForDate[dateStr]!, id: \.creationDate) { asset in
                            NavigationLink(destination: GetMediaDetail(asset: asset)) {
//                                MediaThumbView(asset: asset)
                                Rectangle()
                                .foregroundColor(.clear)
                                .background(
                                    Image(uiImage: mediaThumb(asset: asset))
                                        .renderingMode(.original)
                                        .resizable()
                                        .scaledToFill()
                                )
                                .clipped()
                                .clipShape(RoundedRectangle(cornerRadius: 4))
                            }
                        }

                        Spacer(minLength: 16)
                    }
                }

                .padding(8)
            }
            .gridStyle(
                ModularGridStyle(columns: .min(100), rows: .fixed(100), spacing: 4)
            )
            .navigationBarTitle("Media from Photos Library", displayMode: .inline)
            .onAppear {
                self.assetsForDate = FetchMediaUtility().fetchNumLastGroupOfAssetsForDate(numAssets: 50)
            }
        }
        .navigationViewStyle(StackNavigationViewStyle())
    }

Now my code is similar your code, but your code works, my code no.

For me the problem is in the size of the image. Indeed from manager.requestImage(for: asset, targetSize: CGSize(width: 100, height: 100), contentMode: .aspectFit, options: requestOptions, resultHandler: {(result, info)->Void in I obtain this exit in console:
1-Size Media - width: 120.0 - height: 120.0
1-Size Media - width: 120.0 - height: 120.0
1-Size Media - width: 120.0 - height: 68.0
1-Size Media - width: 90.0 - height: 120.0
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 120.0 - height: 90.0
dateStr: 15-03-2020
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 120.0 - height: 66.0
dateStr: 17-03-2020
1-Size Media - width: 90.0 - height: 120.0
1-Size Media - width: 90.0 - height: 120.0
1-Size Media - width: 55.0 - height: 120.0
dateStr: 19-03-2020
1-Size Media - width: 90.0 - height: 120.0
dateStr: 20-03-2020
1-Size Media - width: 120.0 - height: 120.0
dateStr: 21-03-2020
1-Size Media - width: 67.0 - height: 120.0
1-Size Media - width: 68.0 - height: 120.0
1-Size Media - width: 68.0 - height: 120.0
1-Size Media - width: 68.0 - height: 120.0
dateStr: 22-03-2020
1-Size Media - width: 86.0 - height: 120.0
dateStr: 24-03-2020
1-Size Media - width: 67.0 - height: 120.0
1-Size Media - width: 67.0 - height: 120.0
1-Size Media - width: 67.0 - height: 120.0
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 120.0 - height: 90.0
dateStr: 25-03-2020
1-Size Media - width: 68.0 - height: 120.0
1-Size Media - width: 68.0 - height: 120.0
1-Size Media - width: 90.0 - height: 120.0
dateStr: 26-03-2020
1-Size Media - width: 120.0 - height: 68.0
1-Size Media - width: 120.0 - height: 68.0
1-Size Media - width: 120.0 - height: 68.0
1-Size Media - width: 54.0 - height: 120.0
1-Size Media - width: 58.0 - height: 120.0
1-Size Media - width: 120.0 - height: 109.0
dateStr: 27-03-2020
1-Size Media - width: 67.0 - height: 120.0
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 90.0 - height: 120.0
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 120.0 - height: 66.0
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 120.0 - height: 90.0
1-Size Media - width: 67.0 - height: 120.0
1-Size Media - width: 67.0 - height: 120.0
1-Size Media - width: 90.0 - height: 120.0
1-Size Media - width: 68.0 - height: 120.0
1-Size Media - width: 120.0 - height: 120.0
1-Size Media - width: 90.0 - height: 120.0
1-Size Media - width: 90.0 - height: 120.0
1-Size Media - width: 90.0 - height: 120.0
dateStr: 28-03-2020
dateStr: 28-03-2020
dateStr: 15-03-2020
dateStr: 17-03-2020
dateStr: 19-03-2020
dateStr: 20-03-2020
dateStr: 21-03-2020
dateStr: 22-03-2020
dateStr: 24-03-2020
dateStr: 25-03-2020
dateStr: 26-03-2020
dateStr: 27-03-2020
dateStr: 28-03-2020
dateStr: 15-03-2020
dateStr: 17-03-2020
dateStr: 19-03-2020
dateStr: 20-03-2020
dateStr: 21-03-2020
dateStr: 22-03-2020
dateStr: 24-03-2020
dateStr: 25-03-2020
dateStr: 26-03-2020
dateStr: 27-03-2020

I ask that the dimensions of the image are 100x100, but the result is very different and I don't think it can be done in a different way.
I don't understand why with your code:
Rectangle()
                                .foregroundColor(.clear)
                                .background(
                                    Image(uiImage: mediaThumb(asset: asset))
                                        .renderingMode(.original)
                                        .resizable()
                                        .scaledToFill()
                                )
                                .clipped()
                                .clipShape(RoundedRectangle(cornerRadius: 4))

cannot solve the problem.
I don't know how to solve this problem.

With this code I have all the media, but It isn't the solution that I would.
var body: some View {
        NavigationView {
            ScrollView(showsIndicators: false) {
                ForEach(assetsForDate.keys.sorted(), id: \.self) { dateStr in
                    Section {
                        SectionView(dateStr: dateStr, assetsForDate: self.assetsForDate[dateStr]!, isSectionView: self.$isSectionView)
                        List(self.assetsForDate[dateStr]!, id: \.creationDate) { asset in
                            NavigationLink(destination: GetMediaDetail(asset: asset)) {
                                Rectangle()
                                    .frame(width: 100, height: 100)
                                    .foregroundColor(.clear)
                                    .background(
                                        Image(uiImage: mediaThumb(asset: asset))
                                )
                                    .clipped()
                                    .clipShape(RoundedRectangle(cornerRadius: 4))
                            }
                        }
                        .frame(height: CGFloat(self.assetsForDate[dateStr]!.count * 110 + 10))
                        .listStyle(GroupedListStyle())
                    }
                }
            }
            .navigationBarTitle("Media from Photos Library", displayMode: .inline)
            .onAppear {
                self.assetsForDate = FetchMediaUtility().fetchNumLastGroupOfAssetsForDate(numAssets: 50)
            }
        }
        .navigationViewStyle(StackNavigationViewStyle())
    }

This is the result:

This is not the solution I wanted, but waiting for your solution, how can I remove the indicator scroll bar inside the section?

@CPiersigilli try aspectFill
manager.requestImage(for: asset, targetSize: CGSize(width: 100, height: 100), contentMode: .aspectFill

This is the result.

I think the problem stems from the fact that "manager.requestImage (for:" works in the "background", while your code works in the "main", so not all images are formed in the necessary sequence.
To check if what I said above is true, I should find a function with which to generate all the images before to be given to your code or to give at your test code the images in a async thread from "onAppear {".

I modified my code and now the situation has improved (see the screenshot below).

I have resized all the images and videos to 150x150, but for some images or videos this is not enough.
The biggest problems are for the videos and images received by Whatsapp, but I can't understand why. Where I have to check your code to understand why it does this.
I created a simple app with your Grid, downloading images from the "https://picsum.photos" website, all the same size (150x150) and your Grid works perfectly.
Why doesn't it work well with images from the Photo Library?

@CPiersigilli this is the code that calls each item and gives them a frame
            ZStack(alignment: .topLeading) {
                ForEach(self.items) { item in
                    item.view
                        .frame(
                            width: self.autoWidth ? self.preferences[item.id]?.bounds.width : nil,
                            height: self.autoHeight ? self.preferences[item.id]?.bounds.height : nil
                        )
                        .alignmentGuide(.leading, computeValue: { _ in geometry.size.width - (self.preferences[item.id]?.bounds.origin.x ?? 0) })
                        .alignmentGuide(.top, computeValue: { _ in geometry.size.height - (self.preferences[item.id]?.bounds.origin.y ?? 0) })
                        .background(GridPreferencesModifier(id: item.id, bounds: self.preferences[item.id]?.bounds ?? .zero))
                        .anchorPreference(key: GridItemBoundsPreferencesKey.self, value: .bounds) { [geometry[$0]] }
                }
            }

I think I have understood what the problem is.
In your GridPreferences.swift file, you assign:
subscript(id: AnyHashable) -> Item? {
        get {
            items.first(where: { $0.id == id })
        }
    }

On the other hand, I have:
Grid(self.assetsForDate[dateStr]!, id: \.creationDate) { asset in
     Image(uiImage: mediaThumb(asset: asset))
         .renderingMode(.original)
 }

When the creationDate is the same for more than one image in self.assetsForDate[dateStr]!  the code automatically removes the one that have the same creationDate.
I have changed, in my code, \.creationDate with \.localIdentifier:
Grid(self.assetsForDate[dateStr]!, id: \.localIdentifier) { asset in
     Image(uiImage: mediaThumb(asset: asset))
         .renderingMode(.original)
 }

and now, your Grid work very well (see screenshot below).

Thank you for the support.


No empty_cache after pretraining or in .fit method of dcsfa_nmf.py

I was looking over dcsfa_nmf.py today with Karim, and discovered there is no call to empty_cache (esp. for when self.device=="cuda"), which may be the reason why Karim's training is crashing in the first epoch loop after pretraining.
I suggest we add at least one call to empty_cache in the "if pretrain" condition, and consider adding periodic calls to empty_cache during the main training loop (say, if epoch or batch number mod 100 == 0, for example)

@zacharycbrown , do you know how big the arrays are? I'm guessing they're all being put on the GPU at the same time. One option may be to put only the current batch on the GPU.
It would be nice not to have to do anything fancy to make this work, but if transferring each batch to and from the GPU is too slow and it's able to run with just a couple empty_cache calls, then I'd say let's add the empty_cache calls. Could you check to make sure that this would work?
Best,
Jack


Remove the FromStr implementation from DynamicModInt<_>

It's just a footgun.

Why do you think is it a footgun?