[ENG-4065] Feature/collections moderation

Ticket: ENG-4065
Feature flag: n/a

Purpose

Summary of Changes

Screenshot(s)

Side Effects

QA Notes

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

195 of 258 (75.58%)  changed or added relevant lines in 34 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.05%) to 71.739%

Changes Missing Coverage
Covered Lines
Changed/Added Lines
%

app/adapters/collection-submission.ts
3
4
75.0%

app/serializers/collection-submission.ts
1
2
50.0%

lib/collections/addon/components/collection-metadata/component.ts
1
2
50.0%

lib/collections/addon/guid/edit/controller.ts
0
1
0.0%

lib/collections/addon/guid/edit/route.ts
0
1
0.0%

lib/collections/addon/provider/moderation/route.ts
4
5
80.0%

lib/osf-components/addon/components/moderators/manager/component.ts
4
5
80.0%

lib/osf-components/addon/components/review-actions-list/review-action/component.ts
18
19
94.74%

lib/collections/addon/provider/moderation/moderators/controller.ts
0
2
0.0%

lib/registries/addon/branded/moderation/moderators/controller.ts
0
2
0.0%

Totals

Change from base Build<PHONE_NUMBER>:
0.05%

Covered Lines:
5562

Relevant Lines:
7532

💛  - Coveralls


update deploy script for Databricks

Haven't been able to test manually because it looks like I don't have permissions to actually push.
Signed-off-by: Thomas Graves<EMAIL_ADDRESS>

build

figured out way to test with test build in jenkins, I forgot to add classifier so updated.

build


gitignore: ignore config.php

Prevent configuration secrets from accidentally being released to the
public.


question: landscape page orinetation for a single page in all document outputs

hello @opoudjis i have a question about landscape page mode for a single page with a large figure, and wondering if that is now working in all document output types, such as PDF or possibly HTML. the link below says that MS-Word output is possible.
https://www.metanorma.org/author/topics/document-format/page-flow/
we have a large figure that is landscape mode and would like to rotate the page the figure is on.  IEEE style manual appears to support landscape orientation.  would you advise rotating the page or rotating the image?

@ronaldtse at your convenience, can you take a look at this and advise on how to handle it. i am currently leaning to a rotation of the image, rather than the page. thanks

Metanorma does not support image rotation, so the easiest way to rotate an image is to do it in the image itself.

thank you @ronaldtse i was planning to rotate the image outside of metanorma. i should have specified that in my earlier post. thank you for the confirmation.

@ReesePlews @ronaldtse Is this query still open?

sorry for not following up on this issue. @opoudjis lets close this now. the PR was closed and if we felt landscape mode on one or more pages was needed, then we should examine that in a new issue and discuss more. at this time, the issue with the strange image was solved. closing this.


is there block when the animation stop?

Not at the moment but you could assume the animation to take a fixed duration of about 1 seconds.

thank you.
I change the method animate,add the block as follows.

(void)animate :(void(^)())onComplete;


batch() / each()

I need to select batches by 10 at time (from 1000000+ rows)
foreach (Song::find()->batch(10) as $songs) {

    // var_dump($songs);      <-- array 10 object(app\models\Song)

    foreach ($songs as $song) {
        var_dump($song->id);
    }
}

It takes 10 objects, but it doesn't take next 10. How can i do it?

Russian forum discussion link: http://yiiframework.ru/forum/viewtopic.php?f=19&t=22850

    var_dump(Song::find()->count());

string(6) "265747"
    foreach(User::find()->each(2) as $model) {
        echo '<p>' . $model->id . '</p>';
    }

var_dump(METHOD) in BatchQueryResult class:
string(31) "yii\db\BatchQueryResult::rewind"
string(30) "yii\db\BatchQueryResult::reset"
string(29) "yii\db\BatchQueryResult::next"
string(34) "yii\db\BatchQueryResult::fetchData"
string(30) "yii\db\BatchQueryResult::valid"
string(32) "yii\db\BatchQueryResult::current"
1
string(29) "yii\db\BatchQueryResult::next"
string(30) "yii\db\BatchQueryResult::valid"
string(32) "yii\db\BatchQueryResult::current"
2
string(29) "yii\db\BatchQueryResult::next"
string(34) "yii\db\BatchQueryResult::fetchData"
string(30) "yii\db\BatchQueryResult::valid"
string(35) "yii\db\BatchQueryResult::__destruct"
string(30) "yii\db\BatchQueryResult::reset"

If i do:
$query = (new Query)->from('song');
foreach ($query->batch(10) as $song) {
    var_dump($song);
}

it's ok, but i need ActiveRecord

Unit test for bacth query result passes correctly:
https://github.com/yiisoft/yii2/blob/master/tests/unit/framework/db/BatchQueryResultTest.php
Sinse you are able to retrieve all data you need using plain Query this is also not MSSQL or PDO specific.
Most likely you have made some modifications of the ActiveQuery returned by Song::find(): setup of extra conditions, limit or something.


Setup failed for alarmo: Unable to import component: cannot import name 'STATE_ALARM_ARMED_VACATION'

Alarmo Version
v1.8.3
HA Version
2021.4.0
Bug description
Alarmo doesn't load, warning in logs
Setup failed for alarmo: Unable to import component: cannot import name 'STATE_ALARM_ARMED_VACATION' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)
I'm wondering if HACS has allowed me to update to a newer version of Alarmo than is actually compatible with my version of HA ?
Steps to reproduce
n/a
Relevant log output
Setup failed for alarmo: Unable to import component: cannot import name 'STATE_ALARM_ARMED_VACATION' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)

Downgrading to "v1.8.0" has solved the issue, but it's strange because I didn't think there was a known incompatibility between the HA I am running and v 1.8.3

I believe this is a bug caused by changes I made in v1.8.1.
It's strange that I never experienced the issues myself though, but I will investigate.

thanks, not an issue for me as have worked around it - but maybe for others?

This is not a bug.
Alarmo v1.8.1 and onwards require updating HA to 2021.8 or newer.

ah OK - so did I miss a breaking change or has the warning just been added? I did have a look when researching the bug (now non-bug) and don't remember seeing it.

From the side of Alarmo this is considered a new feature, as you can now set up a ‘vacation’ mode.
A breaking change would be that existing functionality is removed or has to be changed by the user.
In case you update Alarmo without updating HA, you may reach incompatibility which could break things.
I don’t know to what extend things remain backwards compatible, I only develop Alarmo with latest-greatest HA version.
I often have to change things from Alarmo’s side to keep up with changes in HA, so I advise to keep Alarmo updates in sync with HA.

actually strictly speaking I think a breaking change is
"A change in one part of a software system that potentially causes other components to fail"
but I don't want you to think I'm complaining - far from it - I am super impressed, in awe and grateful for what you do and others like you.
Just wondering how I could have avoided this issue - as I think your text warning was only added today?? Unless I'm wrong about that.
Anyway thanks again!! :-)

I am super impressed, in awe and grateful for what you do and others like you.

I'm glad to hear that! 😄

Just wondering how I could have avoided this issue - as I think your text warning was only added today?? Unless I'm wrong about that.

The obvious answer is to keep your HA version (more or less) up to date.
Looking back I can tell you that v1.8.6, v1.8.4, v1.8.2, v1.8.0 all contain changes which were made to keep up with changes in HA, which I don't consider as 'breaking changes' but this only holds in case users have their HA updated as well.
I could start mentioning (as far as possible) the linked HA versions for which the updates apply in the release notes.
However, since the release notes in HA are often very poorly written I don't always see them coming (I often find things broken and have to look inside the source code for the actual changes), and I don't want to test my changes against multiple HA versions to test backwards compatibility.
The conservative (and safest) approach would be to not update Alarmo to a more recent version than your HA version.


empty git status (:|✔) shows up even in non git directories

The command
RPROMPT='$(git_super_status)'
in my .zshrc has for effect that in a non git directory I get (:|✔)
This wasn't the case until my recent switch to fedora 26. Any idea on how to fix this issue ?

I have same issue on fresh install of debian 9...

I also have this issue on Manjaro

I have the same issue on ArchLinux. Every directory have (:|✔) in the prompt, even if it's not a git initialized directory.

My suggested fix for this:
diff --git a/gitstatus.py b/gitstatus.py
index d944fd4..28bdad4 100755
--- a/gitstatus.py
+++ b/gitstatus.py
@@ -12,7 +12,7 @@ branch, error = gitsym.communicate()

 error_string = error.decode('utf-8')

-if 'fatal: Not a git repository' in error_string:
+if 'fatal: not a git repository' in error_string.lower():
        sys.exit(0)

 branch = branch.decode("utf-8").strip()[11:]

That way the system doesn't care in which case the git binary returns this error.

@nimag42 solves for me
@QuinnyPig @Segaja does not solve for me
Loaded with zgen in Arch Linux

check what the output of git symbolic-ref HEAD is on your system. I see this as an error that the python script doesn't realize there is no repository.

@Segaja
In a non-git folder the output is:
git symbolic-ref HEAD
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Hm this should work. did you apply the entire change? the lowercasing of the first string and the .lower() function at the end?

Hi @Segaja ,
I used @QuinnyPig patch (branch in his fork) in my zgen load, which changes exactely what you said.

That is not enough. According to https://github.com/olivierverdier/zsh-git-prompt/pull/117 he only added the .lower() call at the end, but the "N" of "fatal: Not a git repository" is still uppercase.
So essentially this line checks if the string "fatal: Not a git repository" is present in the output of the git symbolic-ref HEAD command. But for some reason the cases of the words changed, that is why I propose to lowercase the command output (... in error_string.lower(): but then also lowercase the needle you search: "fatal: not a git repository".

Upon thinking more about this and reading above that some people have non-english system, maybe it makes more sense not to check the error string, but the return code of the command.
I forked the project and created #119 to push my changes back into this master.

@Segaja clever thought, nice seeing someone that understand english is not the only language on earth :p

@Segaja your newer solution that checks for the error code works for me, thank you!

Can we merge a fix here or is this project dead (last file change 2 years ago)?

@Kynde
I forked and implemented both working (for me) solutions for that problem in two different branches.
fam4r/zsh-git-prompt
I'm not going to fork and mantain that project, if someone wants to do that, please tell us!

Hmmm, well this is disappointing that the project not really being maintained. Olivier seems rather inactive and no indication looking for maintainer. I don't write Haskell much, do know a fair bit of python and shells. I am poking around now because like others my prompt stopped behaving well with recent changes, had to fix up my fork.
@fam4r What did you have in mind, we just make an issue and direct people to another fork?
You guys can see mine at: https://github.com/starcraftman/zsh-git-prompt
It is unfortunately a bit of a faux pas in its current state. I forked 4 years ago and haven't looked in much. I wanted parity with bash-git-prompt both thematically and functionally. I may have been rather ham fisted and less experienced. I suppose the main change is a large refactor of gitstatus.py and I deleted the Haskell stuff a while ago, hehe. Probably shouldn't have.
Current state isn't super ideal, I should probably tidy it up and replay the good bits over current Olivier master. I suppose not deleting the Haskell stuff would help too.

@olivierverdier Are you about or looking for a maintainer?

@starcraftman Haskell fan over here, i would fix the Haskell part, if someone wants to maintain a fork and work through all open issues and pull requests

I have since rebased my master to align with this project and replayed my changes into a single commit on top. So should be much more coherent if anyone looking. It is a lot of edited lines, I'll have to check everything more thoroughly that everything working as expected. Don't normally try the Haskell implementation.
@madnight Thanks, will keep that in mind. I suppose depends now if Olivier about to deputize a maintainer. Will wait a while. Otherwise I guess we can just work on my fork. In that case unfortunately we'd have low visibility.

@starcraftman yes, it can be a good way, the problem comes when other people make new issues: the one that points to new repo will be not be so longer visible.
In my (little) experience I saw something like that: https://github.com/eBrnd/i3lock-color/blob/master/README.md.
Putting a message in first lines of README could be a good way to let people follow right directions to the new repo/fork.
If @olivierverdier is ok with that, obviously.

Otherwise if @olivierverdier cannot do that for some reason, then just fix all existing bugs and do MR's and put a link in this repo issues to the fork, where those issues have been fixed. Monitor this repo issues and on any new issue put a link to our maintained fork. It takes a while, but after some time people will start to accept the fork as new upstream, even more so when this repo becomes fundamentally broken (unusable) in the future.

@madnight Yeah, that seems like what I'll have to do. Olivier doesn't seem responsive. Quite annoying. Github needs a better solution to dead original repositories. Though git is decentralized, their site only really promotes originals. It happens often and is much worse in larger more elaborate projects. Sadly looking at some old issues on github they've yet to agree on a plan.
I'll make some notes in my forked readme on my changes and that I can atm only personally guarantee the python interface. If you want to assist, I've added a few things to the python version that should be mirrored to Haskell. See issue 5 on my fork.
@robeirne If you just want a working prompt this has already been fixed on my active fork, along with some other extra features like stashed support and displaying the upstream. See here: https://github.com/starcraftman/zsh-git-prompt
Please star it for visibility. I'll have to make some formal announcement eventually.

Announcement made, hopefully other people make use of the fork.

@Segaja thank you. ps: it happened after macOS(10.13.6) installed command line tools update today.

@starcraftman I see you haven't been maintaining your fork either - should we hand it off to someone else?


Update creating-a-node.md

Purpose / why
A first pass at applying some Good Docs principles to our How-To pages.
What changes were made?
Added an Overview (that should be read critically by those who think alot about content modelling, because this is just my understanding and it's not my area of expertise) and a "Before you start" section to expose assumptions built into the how-to. In particular, it seems important to specify when the docs are built on islandora_defaults, as this one is.
Verification
Review the docs, verify that the new sections are accurate and informative. Check for typos 😄
Interested Parties
@Islandora/8-x-committers and probably a good one for the Users Call to see if it makes sense to the target audience.

Checklist

Pull-request reviewer should ensure the following

[ ] Does this PR link to related issues?
[x] Does the proposed documentation align with the Islandora Documentation Style Guide?
[x] Are the changes accurate, useful, free of typos, etc?

Person merging should ensure the following

[x] Does mkdocs still build successfully? (This is indicated by TravisCI passing. To test locally, and see warnings, see How To Build Documentation.)
[x] If pages are renamed or removed, have all internal links to those pages been fixed?
[ ] If pages are added, have they been linked to or placed in the menu?
[ ] Did the PR receive at least one approval from a committer, and all issues raised have been addressed?

Ooh, i forgot I was supposed to review the wording. Here's a PR on this branch. https://github.com/Islandora/documentation/pull/1646


[FLINK-16103] Translate "Configuration" page of "Table API & SQL" int…

…o Chinese

What is the purpose of the change
(For example: This pull request makes task deployment go through the blob server, rather than through RPC. That way we avoid re-transferring them on each deployment (during recovery).)
Brief change log
(for example:)

The TaskInfo is stored in the blob store on job creation time as a persistent artifact
Deployments RPC transmits only the blob storage reference
TaskManagers retrieve the TaskInfo from the blob cache

Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)

Added integration tests for end-to-end deployment with large payloads (100MB)
Extended integration test for recovery after master (JobManager) failure
Added test that validates that TaskInfo is transferred only once across recoveries
Manually verified the change by running a 4 node cluser with 2 JobManagers and 4 TaskManagers, a stateful streaming program, and killing one JobManager and two TaskManagers during the execution, verifying that recovery happens correctly.

Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): (yes / no)
The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
The serializers: (yes / no / don't know)
The runtime per-record code paths (performance sensitive): (yes / no / don't know)
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / no / don't know)
The S3 file system connector: (yes / no / don't know)

Documentation

Does this pull request introduce a new feature? (yes / no)
If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@leonardBang , could you help to review this translation?

@leonardBang , could you help to review this translation?
sure

@wuchong @leonardBang Thank you for taking the time to check the code for me.

你是对的，保证翻译结果准确性的情况下，音译过来更容易理解；
官网的中文翻译往往晦涩难懂，看完模棱两可、无所获；


Is there a rather-easy method to implement and apply a new plugin in tensor-llm?

Hi,  i'm just trying to make some code changes in Plugin-level (take cpp/tensorrt_llm/plugins/gptAttentionPlugin as an example). It looks like i have to Build TensorRT-LLM again (like Build TensorRT-LLM in docs/source/installation.md), after rewriting the codes. Is there another fast way for developers to check whether the new plugin works?

I think the simplest way is adding some debug message in your plugin.

You don't have to rebuild the entire TensorRT-LLM C++ code every time you make a change to the plugin. It should be able to use the incremental build and that should not take a lot of time.
Also, as long as you don't change the API of the plugin, it should not be needed to recreate the engine. The runtime will be able to load the plugin library.

thanks, i'll have a try!


Single click behavior and context menu!

Hi nice remote gui, has exactly everything I want, but it would be cool to have a selection system similar to the original app where you could select files with left mouse clicks and holding control instead of having the left click opening the properties and then have to press right click + select when you want something. Very useful to select batches of torrents but omit some of them in a more visual way.
We should be able to click out of the selection like in any other program instead of having to right click > cancel or click the cross, would be dope as well.
Also would be cool to have the context menu open right next to the mouse cursor with maybe a font that would be a bit smaller so it keeps a decent size.
Last thing I would see is maybe being able to open the folder with a right click instead of opening the properties.
Besides from that color scheme is insane the interface is way more detailed, so on and so forth. Thanks again for this.

Hi, thank you for all your suggestions.

select files with left mouse clicks and holding control instead of having the left click opening the properties and then have to press right click + select

You can already quickly select a torrent using the Shift key. This is not documented so I should specify this feature in the readme.

We should be able to click out of the selection like in any other program instead of having to right click > cancel or click the cross

The problem is that there's no free space between torrents so you can't click on an empty space. You can already cancel the selection using the Ctrl+Alt+C keyboard shortcut, but I grant you that it's not convenient, I should replace it with the Esc key.

Also would be cool to have the context menu open right next to the mouse cursor

The context menu is rather an action sheet like on Android/iOS. But I agree that it's not the best for large screens so I'll try to implement a real context menu for desktop.

being able to open the folder with a right click instead of opening the properties

I've already considered implementing this, but it would only be enabled if there's no more than one torrent selected.

Besides from that color scheme is insane the interface is way more detailed, so on and so forth.

Thank you very much!

I was not excepting the shift shortcut to work on there, cool! As for the other behaviors, those future ideas seem great and exactly what we need, thanks again for the prompt answer!

I've added some of your suggestions in v1.6.2, but I haven't found a viable solution for the context menu, so I'll work on that later.


Captcha Loading

In order to get the correct Captcha we have to manually disable the extension on certain sites. So it would be better if we could have something like "whitelist" or "add to white list" .

Hi @chessgeniusc2
whitelist was added in the latest extension release (1.1.0). You can now add hostnames to whitelist and images from that host will not be compressed.
Please, let me know if that helps you!

How do you add host names to white list?  For Google reCaptcha, bandwidth hero works fine. SolveMedia it doesn't work. And other basic captcha (don't know the company) doesn't work.


fix miss BoolLiteral when convert literal to Nereids' one

Proposed changes
Issue Number: close #xxx

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall


[Bug]: Pipe tests fail on latest Visual Studio

What Operating System(s) are you seeing this problem on?
Windows
dlib version
d5909ed9773f89f78203ba4d8324c066b8159925
Python version
N/A
Compiler
Visual Studio 2022, version 17.9.2
Expected Behavior
Tests pass on latest Visual Studio 2022.
Current Behavior
On the latest Visual Studio 2022 (version 17.9.2), the pipe test fails for Debug builds.
The reason appears to be that Microsoft seems to have added this check to their STL implementation:
"wait_until's caller must own the lock argument (N4958 [thread.condition.condvar]/17)"

Steps to Reproduce
Get latest Visual Studio 2022 (version 17.9.2), build Debug tests, and execute the pipe test.
Anything else?
It seems that the std::unique_lock object constructed with the std::defer_lock option in dlib::signaler::wait_or_timeout does not end up "owning" the mutex when calling the condition variable's wait_until, which appears to be something Microsoft's updated STL does not really like.
I am not sure if this is a bug in the Microsoft STL implementation (it might very well be), or something to change in dlib, but at bare minimum I need to find some workaround. If I should just #define _CONTAINER_DEBUG_LEVEL 0 for now, then so be it – but in any case wanted to at least post this for awareness, because expecting that other dlib users may stumble upon this as well, when they update their Visual Studio to the latest versions.
Please note that the underlying code has worked just fine on previous Visual Studio versions. In addition, Release builds (which do not have this check) still work great.
For the record: It seems that Microsoft have updated to N4958, which does say this for condition_variable::wait_until (on page 1893):

Preconditions: lock.owns_lock() is true

So I'm guessing that's where this precondition check basically comes from.

Huh yeah, not sure what I was thinking with that defer_lock use.  I guess that's equivalent to what was there before but obviously that's not how the std:: variant is meant to be used.  And the docs at https://en.cppreference.com/w/cpp/thread/condition_variable/wait say clearly that it's wrong.  So yeah, if you delete those two std::defer_lock uses it all starts working?  I.e. do this:
--- a/dlib/threads/threads_kernel_1.h
+++ b/dlib/threads/threads_kernel_1.h
@@ -92,7 +92,7 @@ namespace dlib
         void wait (
         ) const
         {
-            std::unique_lock<std::mutex> cs(m.cs, std::defer_lock);
+            std::unique_lock<std::mutex> cs(m.cs);
             cv.wait(cs);
         }

@@ -100,7 +100,7 @@ namespace dlib
             unsigned long milliseconds
         ) const
         {
-            std::unique_lock<std::mutex> cs(m.cs, std::defer_lock);
+            std::unique_lock<std::mutex> cs(m.cs);
             auto status = cv.wait_until(cs, std::chrono::system_clock::now() + std::chrono::milliseconds(milliseconds));
             return status == std::cv_status::no_timeout;
         }

That is pretty much what I tried first, but then it will complain already when trying to construct the unique_lock, apparently because the mutex is already locked:
// undefined behavior, only occurs for plain mutexes (N4950 [thread.mutex.requirements.mutex.general]/6)
_STD _Throw_Cpp_error(_RESOURCE_DEADLOCK_WOULD_OCCUR);

Debug builds that use dlib::server_http also fail with the same error when compiled with Visual Studio 2002 17.9.2.

Er, sorry, wasn't paying attention.  The lock is definitely already locked.  So what's there ought to be fine.  Like note that the signaler::wait_or_timeout() has a precondition that the associated lock is locked by the calling thread.  And if you check the pipe code you can see that it is indeed locked.  So this is totally a bug in visual studio.
Although we still need to deal with it because visual studio is what it is.  Anyway, if you just move std::unique_lock<std::mutex> cs(m.cs, std::defer_lock); so it's a member of the dlib::mutex class that probably works around it?  So like this:
--- a/dlib/threads/threads_kernel_1.h
+++ b/dlib/threads/threads_kernel_1.h
@@ -44,7 +44,7 @@ namespace dlib
     public:

         mutex (
-        )
+        ) : cs(m, std::defer_lock)
         {
         }

@@ -61,7 +61,8 @@ namespace dlib

         friend class signaler;

-        mutable std::mutex cs;
+        mutable std::mutex m;
+        mutable std::unique_lock<std::mutex> cs;

         // restricted functions
         mutex(mutex&);        // copy constructor
@@ -92,16 +93,14 @@ namespace dlib
         void wait (
         ) const
         {
-            std::unique_lock<std::mutex> cs(m.cs, std::defer_lock);
-            cv.wait(cs);
+            cv.wait(m.cs);
         }

         bool wait_or_timeout (
             unsigned long milliseconds
         ) const
         {
-            std::unique_lock<std::mutex> cs(m.cs, std::defer_lock);
-            auto status = cv.wait_until(cs, std::chrono::system_clock::now() + std::chrono::milliseconds(milliseconds));
+            auto status = cv.wait_until(m.cs, std::chrono::system_clock::now() + std::chrono::milliseconds(milliseconds));
             return status == std::cv_status::no_timeout;
         }

So this is totally a bug in visual studio.

Yep, it does look like that to me as well – although can't really say I've been able to get to the bottom of this just yet.

Anyway, if you just move std::unique_lock<std::mutex> cs(m.cs, std::defer_lock); so it's a member of the dlib::mutex class that probably works around it?

No, not really I'm afraid – it looks like this now leads to a deadlock or something. In addition, with this change, tests that would otherwise work start to fail, even in the previous Visual Studio version (where without this change things are generally working).
(To reproduce this issue in GitHub Actions, had to update Visual Studio and build a Debug version. And then on top of that, I just applied your patch.)

Oh, I'm pretty sure I see the issue. Dlib isn't quite right, not a bug in visual studio.  It's that std::unique_lock::owns_lock() is not telling you if the mutex is locked, but if the unique_lock was the one to make it locked.  That is, the bool telling if it's locked is in unique_lock, not the mutex itself.  And the precondition on wait() is that unique_lock()::owns_lock() == true.  Which is a fine way to setup the API for the normal use case.
Anyway, it should be this.  Pretty sure this will make everything square:
--- a/dlib/threads/threads_kernel_1.h
+++ b/dlib/threads/threads_kernel_1.h
@@ -92,16 +92,22 @@ namespace dlib
         void wait (
         ) const
         {
-            std::unique_lock<std::mutex> cs(m.cs, std::defer_lock);
+            std::unique_lock<std::mutex> cs(m.cs, std::adopt_lock);
             cv.wait(cs);
+            // Make sure we don't actually modify the mutex. Since the calling code will have locked
+            // it and it should remain locked.
+            cs.release();
         }

         bool wait_or_timeout (
             unsigned long milliseconds
         ) const
         {
-            std::unique_lock<std::mutex> cs(m.cs, std::defer_lock);
+            std::unique_lock<std::mutex> cs(m.cs, std::adopt_lock);
             auto status = cv.wait_until(cs, std::chrono::system_clock::now() + std::chrono::milliseconds(milliseconds));
+            // Make sure we don't actually modify the mutex. Since the calling code will have locked
+            // it and it should remain locked.
+            cs.release();
             return status == std::cv_status::no_timeout;
         }

It's that std::unique_lock::owns_lock() is not telling you if the mutex is locked, but if the unique_lock was the one to make it locked.

That's what I thought as well, so I tried to add an assertion that should trigger on Linux builds, too. But that did not happen – they completed just fine.
... and only now I realize that's just because I only added it to threads_kernel_1.h, which is not used for Linux builds at all 😂

Anyway, it should be this. Pretty sure this will make everything square:

Now running the same test here.

Looks like that test passed! Will also run my application-level tests now.

Looks like all good on my side. Thank you so much Davis for fixing this so quickly!!
For your convenience, I can wrap your patch into a PR. :)

Sweet, yeah thanks for posting the problem :)

@PiootrK, you may want to test that the latest master version works for you, too?

@PiootrK, you may want to test that the latest master version works for you, too?

Yes, it does! Thanks a lot guys!


Dark-mode canvas transition

With some tinkering I was able to implement animated canvas fill and stroke color transitions. Tried to match it as best as possible to how the header transitions. The projection page background also does an animated transition now as well (viewport div coming in handy).
The only things left that do not do a smooth color transition is the button background colors, and the PDF itself (may not be worth the effort? I haven't touched the PDF renderer stuff).

Ooo that’s smooth! I’m not sure it’s worth it to do the buttons or pdf. It looks way better as is. Up to you! I’m happy to merge this as is. Thank you!

Ooo that’s smooth! I’m not sure it’s worth it to do the buttons or pdf. It looks way better as is. Up to you! I’m happy to merge this as is. Thank you!

Yeah, after messing with it for a bit, I've decided it might be best to just leave it alone for now. I won't be making any more commits to this branch, so feel free to merge away 🫡

This is really cool and makes things feel so much more polished.


virt-handler looking for wrong multus interface name in 0.59.0

I originally thought this was a macvtap issue, so reported it there: https://github.com/kubevirt/macvtap-cni/issues/100
But it appears to actually be a Kubevirt issue, so I'm reporting it here now instead.
What happened:
In version 0.59.0 (but not 0.58.1), when I specify a multus network, virt-handler looks for an interface named after the name of the NetworkAttachmentDefinition. (That is, the name of the Kubernetes resource). Of course, it doesn't find that interface, since the interface is actually named net1. A workaround is to use net1 as the name of the NetworkAttachmentDefinition resource.
What you expected to happen:
I expected virt-handler to look for the net1 interface that it sets up.
How to reproduce it (as minimally and precisely as possible):
Here is the NetworkAttachmentDefinition I'm using. Note that I saw the same behaviour for macvtap and macvlan variations of this -- I didn't try others.
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
  name: bobnet
  namespace: windows
  annotations:
    k8s.v1.cni.cncf.io/resourceName: macvtap.network.kubevirt.io/vlan4
spec:
  config: |-
    {
      "cniVersion": "0.3.1",
      "name": "bobnet",
      "type": "macvtap"
    }

Note that leaving the name out of the config json doesn't make a difference.
And here is the relevant part of the VirtualMachine definition:
     networks:
     - name: extra
        multus:
          networkName: bobnet
     domain:
       devices:
         interfaces:
         - name: extra
           macvtap: {}
       resources:
         limits:
          macvtap.network.kubevirt.io/vlan4: 1

Note that I tried it with and without a pod network as well, which doesn't make a difference.
Here's the error message I get in the virt-handler pod in 0.59.0 (not 0.58.1). This prevents the VM from starting.
{
  "component": "virt-handler",
  "level": "info",
  "msg": "re-enqueuing VirtualMachineInstance windows/testvm",
  "pos": "vm.go:1474",
  "reason": "lstat /proc/1195600/root/sys/class/net/bobnet: no such file or directory",
  "timestamp": "2023-04-19T14:53:34.296066Z"
}

Note that virt-handler appears to be looking for an interface named bobnet, which is the name of the NetworkAttachmentDefinition resource, but there really isn't any reason to expect it to be the name of the interface.
Additional context:
As noted above, it works fine on 0.58.1 -- I'm only experiencing the problem in 0.59.0.
I originally had multus 3.9.3 installed, and then upgraded to 4.0.1, which did not help. (But works fine with 0.58.1).
Environment:

KubeVirt version (use virtctl version): 0.59.0
Kubernetes version (use kubectl version): 1.23.17
VM or VMI specifications: Noted above
Cloud provider or hardware configuration: Bare-metal
OS (e.g. from /etc/os-release): Debian GNU/Linux 11 (bullseye)
Kernel (e.g. uname -a): 5.10.0-21-amd64
Install tools: kubevirt operator (cluster is kubeadm)
Others: multus 3.9.3 (and then 4.0.1). Main cni is calico.

Note that there are a few additional details in the original issue here: https://github.com/kubevirt/macvtap-cni/issues/100  -- I left out some things which appear now not to be relevant, once I determined that v. 0.58.1 worked for me.

/cc @maiqueb

/cc @maiqueb
could you please take a look at this issue?

@cmu-rgrempel can you paste the resources available on your nodes ?

I'm using a nodeSelector at the moment to lock the VM to one node. Here's the data for that node (extracted from kubectl describe node)
Capacity:
 cpu:                                16
 devices.kubevirt.io/kvm:            1k
 devices.kubevirt.io/tun:            1k
 devices.kubevirt.io/vhost-net:      1k
 ephemeral-storage:                  286237024Ki
 hugepages-1Gi:                      0
 hugepages-2Mi:                      0
 macvtap.network.kubevirt.io/bond0:  0
 macvtap.network.kubevirt.io/vlan1:  50
 macvtap.network.kubevirt.io/vlan4:  50
 memory:                             132004900Ki
 pods:                               110
Allocatable:
 cpu:                                16
 devices.kubevirt.io/kvm:            1k
 devices.kubevirt.io/tun:            1k
 devices.kubevirt.io/vhost-net:      1k
 ephemeral-storage:<PHONE_NUMBER>82
 hugepages-1Gi:                      0
 hugepages-2Mi:                      0
 macvtap.network.kubevirt.io/bond0:  0
 macvtap.network.kubevirt.io/vlan1:  50
 macvtap.network.kubevirt.io/vlan4:  50
 memory:                             131902500Ki
 pods:                               110

Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource                           Requests           Limits
  --------                           --------           ------
  cpu                                12830m (80%)       35100m (219%)
  memory<PHONE_NUMBER>2 (43%)<PHONE_NUMBER>6 (42%)
  ephemeral-storage                  150M (0%)          0 (0%)
  devices.kubevirt.io/kvm            2                  2
  devices.kubevirt.io/tun            2                  2
  devices.kubevirt.io/vhost-net      2                  2
  macvtap.network.kubevirt.io/bond0  0                  0
  macvtap.network.kubevirt.io/vlan1  2                  2
  macvtap.network.kubevirt.io/vlan4  0                  0

Ah, and here it is from the node's yaml (not different, really):
  allocatable:
    cpu: "16"
    devices.kubevirt.io/kvm: 1k
    devices.kubevirt.io/tun: 1k
    devices.kubevirt.io/vhost-net: 1k
    ephemeral-storage: "263796040882"
    hugepages-1Gi: "0"
    hugepages-2Mi: "0"
    macvtap.network.kubevirt.io/bond0: "0"
    macvtap.network.kubevirt.io/vlan1: "50"
    macvtap.network.kubevirt.io/vlan4: "50"
    memory: 131902500Ki
    pods: "110"
  capacity:
    cpu: "16"
    devices.kubevirt.io/kvm: 1k
    devices.kubevirt.io/tun: 1k
    devices.kubevirt.io/vhost-net: 1k
    ephemeral-storage: 286237024Ki
    hugepages-1Gi: "0"
    hugepages-2Mi: "0"
    macvtap.network.kubevirt.io/bond0: "0"
    macvtap.network.kubevirt.io/vlan1: "50"
    macvtap.network.kubevirt.io/vlan4: "50"
    memory: 132004900Ki
    pods: "110"

@maiqueb , isn't this the fix?
If it is, perhaps you can extract it to its own PR.

I'm unfortunately been unable to reproduce the original issue; I see a different error:
Events:
  Type     Reason            Age   From                       Message
  ----     ------            ----  ----                       -------
  Normal   SuccessfulCreate  25s   virtualmachine-controller  Created virtual machine pod virt-launcher-vmi-multus-multiple-net-6bvst
  Warning  SyncFailed        14s   virt-handler               failed to configure vmi network: setup failed, err: failed plugging phase1 at nic 'net1': Critical network error: device or resource busy
  Warning  Stopped           14s   virt-handler               The VirtualMachineInstance crashed.

I am using the 0.82.0 operator, I'll try with something newer ...

@cmu-rgrempel / @fizzers123 would you be willing to test this PR out ?
It should address the interface name issue you've reported related to macvtap.

Hi @maiqueb
I compiled your branch an run it,  which seems to work well. I have attached the files if anyone wants to test it as well.
I started two Ubuntu VMs with random network names which worked well.
Network attachment definition
---
kind: NetworkAttachmentDefinition
apiVersion: k8s.cni.cncf.io/v1
metadata:
  name: gugu-net1-some-random-name # previously it needs to be named net1, otherwise the VM doesn't start.
  annotations:
    k8s.v1.cni.cncf.io/resourceName: macvtap.network.kubevirt.io/ens18
spec:
  config: '{
      "cniVersion": "0.3.1",
      "name": "gugu-net1-some-random-name",
      "type": "macvtap",
      "mtu": 1500,
      "promiscMode": true
    }'

Virt-Lanucher log
  Type    Reason          Age   From               Message
  ----    ------          ----  ----               -------
  Normal  Scheduled       25s   default-scheduler  Successfully assigned default/virt-launcher-vm-ubuntu-1-pnprv to node1
  Normal  AddedInterface  24s   multus             Add eth0 [<IP_ADDRESS>/18] from kube-ovn
  Normal  AddedInterface  24s   multus             Add net1 [] from default/gugu-net1-some-random-name
  Normal  Pulled          23s   kubelet            Container image "index.docker.io/fizzers123/virt-launcher@sha256:f4af669c2a465ddbe31f5445b0013b37c26f8fa3ab54a797d35f5d521517d108" already present on machine
  Normal  Created         23s   kubelet            Created container container-disk-binary
  Normal  Started         21s   kubelet            Started container container-disk-binary
  Normal  Pulled          21s   kubelet            Container image "quay.io/containerdisks/ubuntu:22.04" already present on machine
  Normal  Created         21s   kubelet            Created container volumecontainerdisk-init
  Normal  Started         20s   kubelet            Started container volumecontainerdisk-init
  Normal  Pulled          19s   kubelet            Container image "index.docker.io/fizzers123/virt-launcher@sha256:f4af669c2a465ddbe31f5445b0013b37c26f8fa3ab54a797d35f5d521517d108" already present on machine
  Normal  Created         19s   kubelet            Created container compute
  Normal  Started         19s   kubelet            Started container compute
  Normal  Pulled          19s   kubelet            Container image "quay.io/containerdisks/ubuntu:22.04" already present on machine
  Normal  Created         19s   kubelet            Created container volumecontainerdisk
  Normal  Started         18s   kubelet            Started container volumecontainerdisk

Virtlauncher interfaces
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: k6t-eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc noqueue state UP mode DEFAULT group default
    link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
3: tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc fq_codel master k6t-eth0 state UP mode DEFAULT group default qlen 1000
    link/ether ea:06:6e:39:26:5a brd ff:ff:ff:ff:ff:ff
132: net1@if2: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 3a:f2:66:f7:8a:1e brd ff:ff:ff:ff:ff:ff link-netnsid 0
134: eth0@if135: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc noqueue state UP mode DEFAULT group default
    link/ether 00:00:00:1f:53:86 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    alias ff3dff5e5701_c

It is possible to access to the local LAN is with enp2s0.
ubuntu@vm-ubuntu-1:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 52:54:00:ae:3b:74 brd ff:ff:ff:ff:ff:ff
3: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 3a:f2:66:f7:8a:1e brd ff:ff:ff:ff:ff:ff
ubuntu@vm-ubuntu-1:~$ lldpcli show neighbors
-------------------------------------------------------------------------------
LLDP neighbors:
-------------------------------------------------------------------------------
Interface:    enp2s0, via: LLDP, RID: 1, Time: 0 day, 00:02:08
  Chassis:
    ChassisID:    mac 52:54:00:d3:e4:3c
    SysName:      vm-ubuntu-2
    SysDescr:     Ubuntu 22.04.2 LTS Linux 5.15.0-71-generic #78-Ubuntu SMP Tue Apr 18 09:00:29 UTC 2023 x86_64
    MgmtIP:       <IP_ADDRESS>
    MgmtIface:    2
    MgmtIP:       fe80::5054:ff:fed3:e43c
    MgmtIface:    2
    Capability:   Bridge, off
    Capability:   Router, off
    Capability:   Wlan, off
    Capability:   Station, on
  Port:
    PortID:       mac 52:59:c1:9a:68:44
    PortDescr:    enp2s0
    TTL:          120
-------------------------------------------------------------------------------
Interface:    enp2s0, via: LLDP, RID: 2, Time: 0 day, 00:02:08
  Chassis:
    ChassisID:    mac 00:24:e8:35:ff:33
    SysName:      sentinel.local
    SysDescr:     Debian GNU/Linux 11 (bullseye) Linux 5.15.107-1-pve #1 SMP PVE 5.15.107-1 (2023-04-20T10:05Z) x86_64
    MgmtIP:       <IP_ADDRESS>
    MgmtIface:    7
    MgmtIP:       fe80::224:e8ff:fe35:ff39
    MgmtIface:    7
    Capability:   Bridge, on
    Capability:   Router, off
    Capability:   Wlan, off
    Capability:   Station, off
  Port:
    PortID:       mac 5a:97:6b:be:72:d9
    PortDescr:    tap200i0
    TTL:          120
-------------------------------------------------------------------------------
ubuntu@vm-ubuntu-1:~$

Next I started two Cisco routers with multiple interfaces which started successfully. (On the normal release the routers wont start because of the interface mismatch)
I will conduct some more testing on Friday.
macvtap-fix.zip

How does the macvtap device in vm assign IP automatically? Does it need to be manually bound?

macvtap-cni is basically a one trick pony: it was developed to expose an host's interface to the pods.
This means that your pods will get an IP from whatever DHCP server you have on your physical infrastructure.


Differentiate  and element  not found

let dataString1 = "<?xml version='1.0' encoding='utf-8'?><results><error>No entry for today</error></results>"
let dataString2 = "<?xml version='1.0' encoding='utf-8'?><results><entry>Some entry</entry></results>"

let data = dataString1.dataUsingEncoding(NSUTF8StringEncoding)

var xmlError: NSError?
if let xmlDoc = AEXMLDocument(xmlData: data!, error: &xmlError) {
    let errorTag = xmlDoc.root["error"]

    // always going to be true
    if xmlDoc.root["error"].name == "error" {
        let e = NSError(domain: "...", code: 101, userInfo: [NSLocalizedDescriptionKey: errorTag.stringValue])
        return onFailure(error: e)
    }

    // never gets to here...
}

When dataString1 is used, the code above behaves as expected. <error> tag is determined as "error" and handled as such.
When dataString2 is used, the above fails to find <error> tag in the data and the check omits element "error" not found "error".
There seems to be no way to distinguish between actual <error> tag and missing <error> tag unless I just make an exception for stringValue == element <error> not found.
I think that existence of <error> should not be handled inside AEXML. Or at least not be the same kind of error as is when xmlDoc.root["error"].name returns "error".
Checking for existence of <error> tag should be with a != instead of ==.
Should allow you to do xmlDoc.root["error"].name != "error" instead of the current xmlDoc.root["error"].name == "error".

I think that the best solution is just to 'namespace' internal error element in AEXML, so it's called 'AEXMLError' instead of 'error', and this could not happen in that case, do you agree?

AEXMLError sounds better alternative for errors pertaining to parsing or writing XML. But that's a different issue.
I think AEXML should not be bothered to check for <error> in the XML. Let the end-developer think about what goes in the XML content.

I now see how AEXMLError is related to this issue and hard to separate since at the moment AEXML returns any error in the form of AEXMLElement("error", ..).

For the time being, I'm using:
if xmlDoc.root["error"].name == "error" && xmlDoc.root["error"].stringValue != "element <error> not found" {
    ...
}

Hi, this is fixed.
Now you have errorElementName class property on AEXMLElement,
so you can check against it if some element doesn't exist, and parse  element like any other.
Thanks for the feedback,
// T


Zoning Tool works fine on first load, but fails after reload or load after another tool

If you first load the game, you will be able to use the Zoning Update Tool just fine if it is the first tool you use. If you use any other tool and then switch to the Zoning Tool, the tool will not work.
Gotta figure out why.

I was able to get the tool to work. Going to do some play testing, clean up code and then create a PR.


init() got an unexpected keyword argument 'biometric_weight'

when I train the Cosine loss，there has a TypeError:
` python main.py --base configs/stable-diffusion/v1-finetune_cosineloss.yaml -t  --actual_resume stable-diffusion/v1-5-pruned.ckpt   -n test1 --gpus 0,  --data_root  IJCB2023_TrainExamples/SubID_0029_NumImages_19/ --reg_data_root CelebA_regularization_NEW/ --class_word person --no-test
Global seed set to 23
Running on GPUs 0,
Loading model from stable-diffusion/v1-5-pruned.ckpt
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Traceback (most recent call last):
File "main.py", line 638, in
model = load_model_from_config(config, opt.actual_resume)
File "main.py", line 29, in load_model_from_config
model = instantiate_from_config(config.model)
File "/home/aiyun/ID-Preserving-Facial-Aging-main/ID-Preserving-Facial-Aging-main/ldm/util.py", line 86, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()), **kwargs)
File "/home/aiyun/ID-Preserving-Facial-Aging-main/ID-Preserving-Facial-Aging-main/ldm/models/diffusion/ddpm_cosineembedding.py", line 483, in init
self.instantiate_first_stage(first_stage_config)
File "/home/aiyun/ID-Preserving-Facial-Aging-main/ID-Preserving-Facial-Aging-main/ldm/models/diffusion/ddpm_cosineembedding.py", line 543, in instantiate_first_stage
model = instantiate_from_config(config)
File "/home/aiyun/ID-Preserving-Facial-Aging-main/ID-Preserving-Facial-Aging-main/ldm/util.py", line 86, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()), **kwargs)
TypeError: init() got an unexpected keyword argument 'biometric_weight'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 851, in
if trainer.global_rank == 0:
NameError: name 'trainer' is not defined
`
why does it happen? what should I do？ Any suggestions?

I have commented out biometric_weight in v1-finetune_cosineloss.yaml (Line 57) as that was not defined or needed in ddpm_cosineembedding.py. Hope this solves the issue.

It works! Thank you!


Error when training

Hi, Thanks for your great work！
But when I try to train a model，it shows errors as follows：
Error executing job with overrides: ['+experiment=cvt_nuscenes_road']
Traceback (most recent call last):
File "scripts/train.py", line 77, in
main()
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/main.py", line 48, in decorated_main
_run_hydra(
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/utils.py", line 377, in _run_hydra
run_and_report(
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/utils.py", line 214, in run_and_report
raise ex
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/utils.py", line 211, in run_and_report
return func()
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/utils.py", line 378, in
lambda: hydra.run(
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 111, in run
_ = ret.return_value
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/core/utils.py", line 233, in return_value
raise self._return_value
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/core/utils.py", line 160, in run_job
ret.return_value = task_function(task_cfg)
File "scripts/train.py", line 73, in main
trainer.fit(model_module, datamodule=data_module, ckpt_path=ckpt_path)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 768, in fit
self._call_and_handle_interrupt(
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 719, in _call_and_handle_interrupt
return self.strategy.launcher.launch(trainer_fn, *args, trainer=self, **kwargs)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 93, in launch
return function(*args, **kwargs)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 809, in _fit_impl
results = self._run(model, ckpt_path=self.ckpt_path)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1219, in _run
self._call_callback_hooks("on_fit_start")
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1634, in _call_callback_hooks
fn(self, self.lightning_module, *args, **kwargs)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/utilities/rank_zero.py", line 32, in wrapped_fn
return fn(*args, **kwargs)
File "/home/liumh/cross_view_transformers/cross_view_transformer/callbacks/gitdiff_callback.py", line 34, in on_fit_start
diff = git.Repo(PROJECT_ROOT).git.diff()
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/git/repo/base.py", line 224, in init
self.working_dir: Optional[PathLike] = self._working_tree_dir or self.common_dir
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/git/repo/base.py", line 307, in common_dir
raise InvalidGitRepositoryError()
git.exc.InvalidGitRepositoryError
Traceback (most recent call last):
File "scripts/train.py", line 77, in
main()
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/main.py", line 48, in decorated_main
_run_hydra(
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/utils.py", line 377, in _run_hydra
run_and_report(
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/utils.py", line 214, in run_and_report
raise ex
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/utils.py", line 211, in run_and_report
return func()
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/utils.py", line 378, in
lambda: hydra.run(
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/_internal/hydra.py", line 111, in run
_ = ret.return_value
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/core/utils.py", line 233, in return_value
raise self._return_value
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/hydra/core/utils.py", line 160, in run_job
ret.return_value = task_function(task_cfg)
File "scripts/train.py", line 73, in main
trainer.fit(model_module, datamodule=data_module, ckpt_path=ckpt_path)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 768, in fit
self._call_and_handle_interrupt(
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 719, in _call_and_handle_interrupt
return self.strategy.launcher.launch(trainer_fn, *args, trainer=self, **kwargs)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 93, in launch
return function(*args, **kwargs)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 809, in _fit_impl
results = self._run(model, ckpt_path=self.ckpt_path)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1219, in _run
self._call_callback_hooks("on_fit_start")
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/trainer/trainer.py", line 1634, in _call_callback_hooks
fn(self, self.lightning_module, *args, **kwargs)
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/pytorch_lightning/utilities/rank_zero.py", line 32, in wrapped_fn
return fn(*args, **kwargs)
File "/home/liumh/cross_view_transformers/cross_view_transformer/callbacks/gitdiff_callback.py", line 34, in on_fit_start
diff = git.Repo(PROJECT_ROOT).git.diff()
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/git/repo/base.py", line 224, in init
self.working_dir: Optional[PathLike] = self._working_tree_dir or self.common_dir
File "/home/liumh/anaconda3/envs/cvt/lib/python3.8/site-packages/git/repo/base.py", line 307, in common_dir
raise InvalidGitRepositoryError()
git.exc.InvalidGitRepositoryError
What can I do to solve this？ Thank you！

i has the same error, did you solve it?

@123Vincent2018 @lalaha1  do you have a way to solve this problem?do you have wechat，are you chinese？
if you are， i have some questions about cross_view_transformers to ask for you
13047219155 my wechat
thank you!

@123Vincent2018 @lalaha1 do you have a way to solve this problem?do you have wechat，are you chinese？ if you are， i have some questions about cross_view_transformers to ask for you<PHONE_NUMBER>5 my wechat thank you!

Hi Ihave the same error,  Have you solve it?

I have solved this problem ,you just need to enter: git init


Appreciation ticket

Having stumbled onto your story through the internet... It's absolutely whack and awesome to read through the whole step-by-step process. Huge kudos and I imagine it was an amazing learning experience.
That being said... Darkroom does exist in a form out there and still is functional here: https://darkroom.bgemyth.net/

Hey @ynazar1, thank you for your kind words! Yeah, I'm aware of that implementation, and used it quite a lot to validate my own code.


Any type as input if Expect is the first shard

Allow wires (especially valid for pure ones) to have Any type as input if Expect is the first shard

Seems okay. Still not sure why it actually needs a special bool to disable chekcing and can't just match Expect's Any input type against whatever input type is passed at runtime (using Do)?

well it's simply because there is an explicit check in wires.cpp trying to match the input and the wire input type.


hack/build-go.sh broken for Mac

Cleaning (ok)
~/go/src/github.com/mbforbes/kubernetes$ make clean
build/make-clean.sh
+++ Verifying Prerequisites....
!!! Build image not built.  Cannot clean via docker build image.
+++ Removing data container
+++ Cleaning out local _output directory
+++ Deleting docker image kube-build:build-c987c
+++ Cleaning all other untagged docker images
rm -rf _output
rm -rf Godeps/_workspace/pkg

Building (not ok)
~/go/src/github.com/mbforbes/kubernetes$ ./hack/build-go.sh
+++ Building go targets for darwin/amd64:
    cmd/kube-proxy
    cmd/kube-apiserver
    cmd/kube-controller-manager
    cmd/kubelet
    cmd/hyperkube
    plugin/cmd/kube-scheduler
    cmd/kubectl
    cmd/kubernetes
    cmd/e2e
    cmd/integration
    cmd/gendocs
    cmd/genman
go install runtime: mkdir /usr/local/go/pkg/darwin_amd64_cgo/: permission denied
!!! Error in /Users/maxforbes/go/src/github.com/mbforbes/kubernetes/hack/lib/golang.sh:284
  'CGO_ENABLED=0 go install -installsuffix cgo "${goflags[@]:+${goflags[@]}}" -ldflags "${version_ldflags}" "${binaries[@]}"' exited with status 1
Call stack:
  1: /Users/maxforbes/go/src/github.com/mbforbes/kubernetes/hack/lib/golang.sh:284 kube::golang::build_binaries(...)
  2: ./hack/build-go.sh:26 main(...)
Exiting with status 1
!!! Error in ./hack/build-go.sh:26
  'kube::golang::build_binaries "$@"' exited with status 1
Call stack:
  1: ./hack/build-go.sh:26 main(...)
Exiting with status 1

The error is go install runtime: mkdir /usr/local/go/pkg/darwin_amd64_cgo/: permission denied; I haven't mucked with my /usr/local/go/ files, so I think this isn't something I did? Do I just have to nuke something and start over?

I ran:
sudo chmod -R a+rw /usr/local/go/pkg/darwin_amd64_cgo
and it fixed things...
On Mon, Mar 16, 2015 at 11:23 AM, Maxwell Forbes<EMAIL_ADDRESS>wrote:

Cleaning (ok)
~/go/src/github.com/mbforbes/kubernetes$ make clean
build/make-clean.sh
+++ Verifying Prerequisites....!!! Build image not built.  Cannot clean via docker build image.
+++ Removing data container
+++ Cleaning out local _output directory
+++ Deleting docker image kube-build:build-c987c
+++ Cleaning all other untagged docker images
rm -rf _output
rm -rf Godeps/_workspace/pkg
Building (not ok)
~/go/src/github.com/mbforbes/kubernetes$ ./hack/build-go.sh
+++ Building go targets for darwin/amd64:
cmd/kube-proxy
cmd/kube-apiserver
cmd/kube-controller-manager
cmd/kubelet
cmd/hyperkube
plugin/cmd/kube-scheduler
cmd/kubectl
cmd/kubernetes
cmd/e2e
cmd/integration
cmd/gendocs
cmd/genman
go install runtime: mkdir /usr/local/go/pkg/darwin_amd64_cgo/: permission denied!!! Error in /Users/maxforbes/go/src/github.com/mbforbes/kubernetes/hack/lib/golang.sh:284
'CGO_ENABLED=0 go install -installsuffix cgo "${goflags[@]:+${goflags[@]}}" -ldflags "${version_ldflags}" "${binaries[@]}"' exited with status 1
Call stack:
1: /Users/maxforbes/go/src/github.com/mbforbes/kubernetes/hack/lib/golang.sh:284 kube::golang::build_binaries(...)
2: ./hack/build-go.sh:26 main(...)
Exiting with status 1!!! Error in ./hack/build-go.sh:26
'kube::golang::build_binaries "$@"' exited with status 1
Call stack:
1: ./hack/build-go.sh:26 main(...)
Exiting with status 1
The error is go install runtime: mkdir
/usr/local/go/pkg/darwin_amd64_cgo/: permission denied; I haven't mucked
with my /usr/local/go/ files, so I think this isn't something I did? Do I
just have to nuke something and start over?
—
Reply to this email directly or view it on GitHub
https://github.com/GoogleCloudPlatform/kubernetes/issues/5514.

I just hit this on linux as well. The above solved it for me, but I had to create the directory first.

I just saw this as well with testing. It appears to be fixed with @brendanburns workaround.
I was seeing similar output to: http://paste.k6c.io/view/d5265a8d as reported by @satnam6502

No so on my machine since the error is:
go install runtime: mkdir /usr/lib/google-golang/pkg/linux_amd64_cgo/: permission denied

but
ls /usr/lib/google-golang/pkg/
linux_amd64  linux_amd64_race  tool

After reading @jlowdermilk 's comment above I am now golden.
Will I need to do this every time I create a repo?

@satnam6502 , nope. should just need to do that once on your workstation/laptop.

What changed appears to be the building of static binaries, but why does it need to be writable?

Ah, what seems to be happening is that go is rebuilding the stdlib with new flags.
sudo make; sudo make clean
now mortals can run make.

(This might be useful to document somewhere, or do programmatically, rather than relying on people to find this issue.)

I'd surface it better in the build failure, @ArtfulCoder since it was because of static binaries

I think we should separate our build calls from some script that says you must first install these go tools.  In general, our scripts should verify any go tools are available prior to trying to install and run them.


Automated cherry pick of #4428: Bugfix: Pod or gateway interface use a different MAC from the

Cherry pick of #4428 on release-1.7.
#4428: Bugfix: Pod or gateway interface use a different MAC from the
For details on the cherry pick process, see the cherry pick requests page.

/test-all

/skip-e2e which failed on testOVSFlowReplay but the reason was unrelated to the PR, https://github.com/antrea-io/antrea/pull/4475 will fix it.


Do we need the java app ?

Do you actually need to be running the java software to use this library ?
And if so will this always be the case, would like to play around with the library but the requirement on java is making me hesitant.

If the amount of traffic is large enough, it is ok.


Select Search Pipeline in Search Comparison Tool

Step 1: Prototype
Step 2: Get UX input
Step 3: Implementation based on UX mock


temporarily pushing faulty js file to test hound integration.

Coverage remained the same at 100.0% when pulling d8e1be29dbbb192678e7f7063d52c0fba52e8ed5 on hound-integration-test into 6016ab27f4f04429b074d643ee6bca838de17024 on master.


First PR test

First PR test

Generally best not to PR changes unless you actually want someone to merge them.  We have a file for you to do exactly that: https://github.com/openaps/docs/blob/master/docs/docs/walkthrough/phase-0/loops-in-progress.md


In a VR demo, run the eyes in parallel

Running the two eyes concurrently takes the CPU time down from ~1.8ms to ~1.4ms on my iMac.

Rebased. Review ping @pcwalton?

It looks like pipelining makes this optimization difficult, since all the messages for camera 0 have to arrive before any of the messages for camera 1, so we'd need buffering to run the two cameras concurrently.

Also, pipelining already achieves some of the gains from this, because it runs the sequential bottleneck in parallel with the tiling.

This is no longer relevant with reprojection.


🐛 Hop energy from neutral to positive SiDB is calculated correctly.

Description:
This PR fixes a major bug. The hopping energy from a neutral to a positive SiDB was calculated incorrectly. Finally, this fix allows the successful simulation of positively charged SiDBs.
@samuelngsh I would strongly recommend to make this change in SiQAD as well. Many thanks!
Checklist:

[x] The pull request only contains commits that are related to it.
[x] I have added appropriate tests and documentation.
[ ] I have made sure that all CI jobs on GitHub pass.
[ ] The pull request introduces no new warnings and follows the project's style guidelines.

Note: The changes made lead to slightly better benchmarking results.
main:
benchmark name                       samples       iterations    est run time
                                     mean          low mean      high mean
                                     std dev       low std dev   high std dev
-------------------------------------------------------------------------------
QuickExact                                     100             1     1.69999 m
                                          1.0291 s      1.0275 s     1.03124 s
                                        9.34506 ms    7.36008 ms    14.3194 ms

QuickSim                                       100             1    422.327 ms
                                        4.29704 ms    4.26032 ms    4.34201 ms
                                        206.767 us    171.362 us    260.536 us

PR #364:
benchmark name                       samples       iterations    est run time
                                     mean          low mean      high mean
                                     std dev       low std dev   high std dev
-------------------------------------------------------------------------------
QuickExact                                     100             1     1.69137 m
                                         1.01837 s     1.01691 s     1.02041 s
                                        8.72947 ms    6.78313 ms    11.2649 ms

QuickSim                                       100             1     447.09 ms
                                        4.47946 ms    4.44835 ms     4.5125 ms
                                         163.73 us    145.971 us    189.081 us


Enhancement: Screensaver - radyohead

From https://forums.roku.com/viewtopic.php?f=34&t=72429&p=549036#p549036:
Radyohead, I'm curious, when you say preview is not full screen, are you referring to an album slide show or screensaver? Slide show display/download size is configurable in the Settings screen based on what your Roku player will support. SD vs HD vs FHD.  The screensaver is currently hard set at image max size of 400 px which is to mimic the jumping around of photos like other screensavers.
We could add an option to show full size photos in the screensaver as maybe people would want this..  I'm open to feedback!
Yes, that's what I meant, talking about the screensaver only. That might be it, 400px. It shows a smaller picture relative to the size of the TV. The rest of the screen is plain black.
If I can suggest improvements on the screensaver: have it full screen + implement a Ken Burns effect. That'd be the best way to enjoy my pictures whenever no one is using the Roku.

Checked into development. While there is no Ken Burns, there is a multi-scroll and Large (full screen) / small display now.


Allow multiple sql files with pattern matching for SQL Server Database Deploy

Question, Bug, or Feature?
Type: Feature
Enter Task Name: SqlDacpacDeploymentOnMachineGroup
Environment

Server - Azure Pipelines
Agent - Private

Issue Description
When using pattern matching to find the SQL file to deploy, an error is raised when there is more than 1 one: Found more than one file to deploy with search pattern **/*.sql. There can be only one.. But it is possible to execute multiple SQL files without pattern matching, by separating them with a ; as in file1.sql;file2.sql.
Please add to ability to have multiple sql files deployed when using pattern matching.
See also https://github.com/microsoft/azure-pipelines-tasks/issues/10195#issuecomment-493855770
Task logs
N/A
Error logs
N/A

Any ETA on this? It would be very helpful for me.

@N-Usha - Can you review the request.

Any ETA on this? It would be very helpful for me.

same here

Any ETA on this? It would be very helpful for me.

same here

same for me. Would be very nice

Any ETA on this? It would be very helpful for me.

same here

same for me. Would be very nice

Can this please be expedited somehow? Looks like there is a PR already for it...
Also, is there a workaround for deploying all *.sql files?

Can this please be expedited somehow? Looks like there is a PR already for it...
Also, is there a workaround for deploying all *.sql files?

I added a powershell script in  the pipeline to combine all the sql files into one single sql file. You can find it here: https://github.com/IamRui/Azure-pipeline-Azure-SQL-Database-deployment

Will it be implemented?

I would also like to upvote this feature request.
Without it, it becomes challenging to use this for any organisation making a larger product update or schema changes


OPENAI_API_BASE set to local llm but WebsiteSearchTool still requires OpenAI api key

Attempting to run crewAI with a locally hosted mistral-7b model (LM studio) following these instructions:
https://docs.crewai.com/how-to/LLM-Connections/#openai-compatible-api-endpoints
WebsiteSearchTool returns the following error:
Inserting batches in chromadb:   0%|          | 0/1 [00:00<?, ?it/s]
Failed to add batch due to a bad request: Error code: 401 - {'error': {'message': 'Incorrect API key provided: NA. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}
Successfully saved https://news.mit.edu (DataType.WEB_PAGE). New chunks count: 0
So all it ends up retrieving from the website is the title. Tested with gpt-4 too and everything works.

I thoroughly enjoyed reading this.Learned a lot. The writing style is PROFESSIONAL, and the content is both interesting and valuable. Looking forward to more! By the way,if you have any ICs' need, find all your chip needs at https://www.worldictown.com/ – your one-stop destination for a diverse range of chips and solutions.You can contact us on Worldictown

Hi. Did you find a solution for this?

Yes, we now updates the tool on the latest version to support opensource embeddings.
These RAG tools before would only work with GPT-4 to generate embeddings, that is not the case anymore, here is an example on how you cna use other models: https://docs.crewai.com/tools/WebsiteSearchTool/#customization-options
lmk if it doesn't work 🙏🏼

Thanks for the quick reply @joaomdmoura! I was running into the same error (Incorrect API key provided) without using any tools. Turned out it was because I had memory=True in the Crew object. I guess the memory also uses OpenAI for embeddings?

Yes, but you can also config it the same way with and Embedder option

(optional)	Configuration for the embedder to be used by the crew. mostly used by memory for now

Oh cool! Thanks

we now have specific docs for that too: docs.crewai.com/core-concepts/memory

I'm trying to use WebsiteSearchTool for a specific URL and Llama 2 but it keeps on saying that my tool is not defined.
It works when I configure Llama with a generic WebsiteSearchTool, or when I use "website" as a parameter. But it doesn't work when I try to combine both. Any idea why? Here is how I set it up:
    company_tool = WebsiteSearchTool(         config=dict(            website='https://www.amplemarket.com/',             llm=dict(                 provider="huggingface",                 config=dict(                     model=model_name,                     tokenizer=tokenizer                 ),             ),             embedder=dict(                 provider="huggingface",                 config=dict(                     model=model_name,                     tokenizer=tokenizer                 ),             ),         )     )

Yes, we now updates the tool on the latest version to support opensource embeddings. These RAG tools before would only work with GPT-4 to generate embeddings, that is not the case anymore, here is an example on how you cna use other models: https://docs.crewai.com/tools/WebsiteSearchTool/#customization-options lmk if it doesn't work 🙏🏼

@joaomdmoura, is it possible to share any notebook example from end to end?


Memory heap : best use of page "newPage" and urls "goto"

Tell us about your environment:

Puppeteer version<EMAIL_ADDRESS>Platform / OS version: Centos 7
URLs (if applicable): 500000 urls crawled one by one
Node.js version: v10.14.2

I'm using puppeteer to crawl web pages.
Should I create only one page to go to all urls (url by url)?
or should I create a new page for each url and close it once the page is loaded (always url by url, one after the other).
The problem with the first solution (creating only one page) is the high memory use.
The memory used by the page is constantly increasing. This error is :
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
This occurs when 1.5 GB of memory is reached.
The problem with the second solution (creation one page for each url) could be the creation/closing of 500000 pages (one page per url). Is it optimized,? Is it the the best practice?
Thanks

I've run into a similar (same?) issue and found a workaround that isn't too tough to implement. The leak seems to happen in the browser or something related, so disconnecting and reconnecting it worked pretty well in my case. After reconnecting, you will need to reassign your Page references.
const browser = await puppeteer.launch(/* options */);
const endpoint = browser.wsEndpoint();

while (true) {
  // do your page load, etc
  browser.disconnect();
  browser = await puppeteer.connect({
    browserWSEndpoint: endpoint,
    defaultViewport: null,
  });
  page = (await browser.pages())[0];
}

With this, I could reload the url using the same page indefinitely, whereas before it would run out of memory in about 2 days.


UI Manager update with progress bar and scoring fixes

Removed steps from UI Manager
Progress is passed from scene as float value (0.0-1.0f) to update progress bar.
Fixed scoring.
Fixed progress bar 100% on complete.

LGTM!


[Bug]: Main Unhandled Promise Rejection

Issue description
App Version: 1.3.0
platform: win32
platformVersion: 10.0.19043
platformArchitecture: x64
cpuCount: 8
totalMem: 16061.6 MB
freeMem: 3145.0 MB
Error Type: Main Unhandled Promise Rejection
Error: Uncaught Error: net::ERR_INTERNET_DISCONNECTED
Expected behaviour
The issue looks to be due to my internet connection dropping.
I would think the system should retry to connect after a period of time.
 System looks to have reconnected.
Can the issue reliably be reproduced?
No
Steps to reproduce the issue
No response
Diagnostics
App Version: 1.3.0

platform: win32
platformVersion: 10.0.19043
platformArchitecture: x64
cpuCount: 8
totalMem: 16061.6 MB
freeMem: 3145.0 MB

Error Type: Main Unhandled Promise Rejection

Error: Uncaught Error: net::ERR_INTERNET_DISCONNECTED

Errors
Sat, 22 Jan 2022 11:22:57 GMT
ClientError: `Response error with status code 404: {"error":{"code":"404","message":"Not Found, error: event not found: f6dbdad416e0470042d3fe429eb0e91683ba171279bce01be6d1d35a9909a981: code=404, message=Not Found"}}
`

Thu, 30 Dec 2021 11:41:43 GMT
LedgerMiscError: ledger transport error

Thu, 30 Dec 2021 11:30:46 GMT
LedgerMiscError: ledger transport error

Sat, 18 Dec 2021 04:11:26 GMT
ClientError: {}

Duplicate declaration

[X] I have searched the issues tracker this issue and there is none

Code of Conduct

[X] I agree to follow this project's Code of Conduct

@PackPro21 After you have closed this notification and had a stable Internet connection Firefly was operational again?

@MiKeF05 Yes, it looks like the internet connection was lost and the application failed to reconnect.
I'm sure it isn't a big issue, however being a programmer myself, I like to know all the things that prevent the application working seamlessly.

Was mentioned that we should just swallow these errors here: https://discord.com/channels/397872799483428865/930249834248691743/931295244878745710


riff build no longer works with eval $(minikube docker-env)

It's no longer possible to build any samples for minikube by using eval $(minikube docker-env) without using the --push option. The images now end up in the local docker daemon and not the minikube one

Fixed by 909491a1da5a52593d61a40ee8e387af5689b35d


Making format analyzer not flag stack traces

Closes #73
I added more logic to stop the format analyzer from flagging stack traces. I also merged in the added newlines in analyze_log_stream and the necessary changes to analyzer to make that compatible, so that hopefully there won't be merge conflicts.

I'm going to wait to review this until the other two PRs are merged in


add instructions for downloading older version that works with alfred 2

well that didn't actually work, i'm getting stuck at https://github.com/azai91/alfred-drive-workflow/issues/25 which I previously ran into, going to just cough up the $$ for alfred 3

I addressed a lot of issues with the 2.0 rewrite, so yeah, I would highly recommend that you upgrade Alfred rather than use the older version of this workflow.


TRIM EMailAddressable.emailAddress

It is easily possible to enter e-mail addresses with leading/trailing  blanks with the standard edit screen for e-mail addresses. Such e-mail  addresses cause all kinds of issues with mail servers if they are used  as e-mail recipients (illegal e-mail recipient, etc.).  e-mail addresses should be trimmed before they are persisted.

Trim EMailAddressable.emailAddress. Email addresses are trimmed before they are persisted.


Add parametricDrawingOf (generalizes LSU's randomDrawingOf and guiDrawingOf)

FYI @alphalambda
I think I'm hopeful that randomDrawingOf and guiDrawingOf belong in the core CodeWorld API.  They make for a nice transition between animations and more general parameterized drawings.
I'd like to combine them into a single entry point, though.  Maybe parametricDrawingOf?  That's a horrible name, but the idea is not to use "widget" because some of the common and earliest uses might not affect the UI at all.  I'll keep thinking, though!
The API would look something like:
-- Main entry point:
parametricDrawingOf :: ([Number] -> Picture, [Parameter]) -> Picture

-- Specific parameters:
slider :: (Text, Range, Point) -> Parameter
randomNumber :: Range -> Parameter  -- (invisible)
randomButton :: (Text, Range) -> Parameter
prompt :: Text -> Parameter  -- (invisible after program start)
currentHour, currentMinute, currentSecond :: Parameter  -- (invisible)
currentTime :: Parameter  -- (invisible, time since program start)
timer :: Point -> Parameter  -- (visible, with start and stop buttons)

-- Utility type, mainly to prevent confusion between position and range
data Range where Between :: (Number, Number) -> Range

-- API for creating parameters: basically activities with local state and an output number.
parameterOf
    :: ([Number] -> state,  -- Input is stream of random numbers
        (state, Event) -> state,
        state -> Picture,
        state -> Number)
    -> Parameter

Example:
program = parametricDrawingOf(picture, params)

params = [
    slider("Size", Between(1, 10), (5, 5)),
    randomNumber(Between(-10, 10)),
    randomButton("Change color", Between(0, 1)),
    prompt("How many circles?"),
    currentSecond
    ]

picture([size, x, color, num, sec]) = ...

@alphalambda also has a scheme where transformations can be applied to a widget (such as withConversion, etc.) rather than reimplemented each time.  I need to investigate this.  It seems to require a more complex UI for defining widgets (and indeed, in Extras.Widget, there are no user-defined widgets at all), and yet not be sufficient for anything more than what can be accomplished by passing a range in as a parameter.  In particular, transformations might be interesting if they could be changed over the life of the program, but they cannot in the current implementation.  My guess is that students would rather just give the desired range as an argument.
@alphalambda also has a scheme for stateful controls, which looks way trickier, but maybe useful.  Not sure how to think about that yet!

Some of the parameters above (like currentMinute, currentHour, prompt, etc.) would need unsafePerformIO in the implementation.  I think that's probably okay, and better than exposing IO to the user in the API.  In particular, since Parameteris an opaque type with no operations defined on it directly, the use of unsafePerformIO incurs a burden only to check that it's used correctly by the implementation of parametricDrawingOf.

prompt was a port from the Extras.Do by @alphalambda but it's really a poor fit here, because in the original, it didn't need to be a number!  There's no good way, though, to support parameters of heterogeneous types, so we'd only get some of the functionality.

One concern: this is a LOT to add to the prelude, especially if it consumes common words like timer.  And I could see growing a bigger collection of parameters in the future.  That makes me wonder if we might still want to put this into a new Parameters module.

@alphalambda
We have a working implementation of this in codeworld-api now.  I've been tinkering a bit lately.  The big question I have now is this: should placement of the widgets/parameters be up to the individual control, or should it be automatic?
The current implementation leaves each component choosing its own position, so a student has to give x and y coordinates to draw it at.  This is fine if you imagine yourself creating a GUI as a product.  But if the idea is duplicate things like Desmos sliders with a very simple student UI, then it seems to make more sense to place them automatically.  So a student could just write parametricDrawingOf(picture, [timer, slider(1, 5), randomNumber(1, 10)]), and the three components would automatically add themselves to the screen in different and non-overlapping locations.  Perhaps they would even be draggable, in case the student wanted to move them around manually.  This would make it impossible for a student to do something like build their own calculator.  This is a loss, but it doesn't seem like a huge one: I don't think anyone's goal here is to teach the use of GUI component frameworks.

I have been discussing this same issue with some people, and they pointed out that in systems like Desmos the sliders are actually
in a separate panel. They think it is important that students do not perceive the sliders as "just a way to interact with your
image" but as a separate interface to control the underlying parametric model. If students perceive it as a way to interact with
images, they will want more user interaction and probably will find the GUI to be artificially restrictive, which may demotivate
them. On the other hand, if the students perceive the sliders as just a way to modify the parametric model, then
they will be more content with them, just as they are with the Desmos interface.
I guess having the sliders in a separate panel requires too many changes to the user interface, so having them automatically place
themselves could be a reasonable trade-off. I'm not sure about letting the user drag them, because they become again "interaction with
the image". Probably, autoplaced sliders that can be hidden would accomplish the same goal. Rather than be draggable,
I'd prefer having a key, such as the spacebar, that can be used to show/hide all the sliders at once.
Nevertheless, I would still like the conversion to be performed explicitly and not based on ranges, for pedagogical reasons, even
if it they are slightly more inconvenient to use. And sliders should still have labels identifying them. So, I'd rather have your
example be:
parametricDrawingOf([ timer("jump"),
withConversion(slider("parameter 1"),  \x -> 1 + 4x),
withConversion(randomBox("New height"),\x -> 1 + 9x)
], mainPic)
On Tue, Dec 10, 2019 at 11:13:35AM -0800, Chris Smith wrote:

@alphalambda
We have a working implementation of this in codeworld-api now.  I've been tinkering a bit lately.  The big question I have now is this: should placement of the widgets/parameters be up to the individual control, or should it be automatic?
The current implementation leaves each component choosing its own position, so a student has to give x and y coordinates to draw it at.  This is fine if you imagine yourself creating a GUI as a product.  But if the idea is duplicate things like Desmos sliders with a very simple student UI, then it seems to make more sense to place them automatically.  So a student could just write parametricDrawingOf(picture, [timer, slider(1, 5), randomNumber(1, 10)]), and the three components would automatically add themselves to the screen in different and non-overlapping locations.  Perhaps they would even be draggable, in case the student wanted to move them around manually.  This would make it impossible for a student to do something like build their own calculator.  This is a loss, but it doesn't seem like a huge one: I don't think anyone's goal here is to teach the use of GUI component frameworks.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/google/codeworld/issues/1243#issuecomment-564188463

Great, sounds like we're basically in agreement on the overall direction.
I think it's worth seriously considering putting the controls into a separate collapsible panel outside of the program.  The major disadvantage would be that we'd lose the ability to define new parameter types in CodeWorld; we'd be stuck with a fixed set of system options, which would be implemented in JavaScript with a postMessage-based protocol to communicate with the running program.  But the major advantage would be that we can use accessible GUI widgets that work with the system clipboard, focus model, screen readers, etc.  Also, they stay out of the way of the student picture and don't feel like part of the program, as you mentioned.

Actually, I think putting the controls in a different window or panel would be a bad idea.  That's because it would make them inaccessible when you embed the result into its own frame.  It still might be better to use native JavaScript controls that float over the canvas instead of are drawing within CodeWorld, but I'd want them to live in the run frame, not in the editor.  This is a key difference from Desmos: in CodeWorld, you're making something that lives outside of the editor.

Wouldn't it be possible to have the runtime iframe contain 2 panels, one with the input widgets and the other with the image output?
I'm not sure whether it is worth the additional complexity or not, but I think it is possible. The same problem is currently present
with the message panel. When the output is embedded (or fullscreeen) errors and traced outputs are not shown, which could be
disconcerting sometimes. So, actually 3 panels (input,output,messages) seems to me the proper setting for the runtime frame.
Example:
https://code.world/run.html?mode=haskell&dhash=DL6CpzqJlgVGxahR5vRaBTw
Corresponding source code:
https://code.world/haskell#P7q2VD2vum01B_W1dsxAJxA
(Same thing could happen in the educational mode with my Do library)
On Tue, Dec 10, 2019 at 02:47:59PM -0800, Chris Smith wrote:

Actually, I think putting the controls in a different window or panel would be a bad idea.  That's because it would make them inaccessible when you embed the result into its own frame.  It still might be better to use native JavaScript controls that float over the canvas instead of are drawing within CodeWorld, but I'd want them to live in the run frame, not in the editor.  This is a key difference from Desmos: in CodeWorld, you're making something that lives outside of the editor.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/google/codeworld/issues/1243#issuecomment-564295006

I'm aware of the issue with stdout; when running in a frame of its own, it logs to the console instead.  I think that's a more reasonable choice than adding a GUI output panel to every program.  Students really don't think of programs as things that have standard output stream anyway, so I see stdout as a debugging tool, which should be hidden when the program is run outside of the IDE.
The parameterization stuff is less clear, but I'd rather take the less opinionated stance, which would be to hover over the program rather than adding a new panel.  I'll try to build a sample implementation at chessai's Haskathon this weekend, and see what you think.

What do you think about this?
https://code.world/haskell#PPRc3vsmyMBZwfjT7mX_6sA

One thing that would need to be fixed here before release is the Inspect window.  Currently it shows the structure of the widgets in addition to the user's own drawing.  Entering inspect mode should probably hide the widgets so that only the user program is inspected.

These are very similar to what I had. Here are a few suggestions:
I made the sliders have no background so that they do not block too much of the picture underneath. If you want to keep them inside
the output panel and want them have a background, then they should be draggable. Otherwise, the user basically loses a band 4 units
wide at the left side of the output, so they may want to put the "center" of their picture at (2.5,0) instead of (0,0).
The timer I have can be restarted, and that is sometimes handy.
Showing labels and values all the time works only for short labels. Otherwise, they spill over too soon.
These are all minor things, but maybe you could consider them.
On Wed, Dec 11, 2019 at 06:09:04PM -0800, Chris Smith wrote:

What do you think about this?
https://code.world/haskell#PPRc3vsmyMBZwfjT7mX_6sA
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/google/codeworld/issues/1243#issuecomment-564817569

A couple more suggestions:

Maybe the space bar should toggle hiding/showing all the widgets
The currentHour, currentMinute, etc Parameters do not need associated visuals.
I may want to use them to build my own clock, and having them show is not very useful.
I don't see the point of having a constant parameter. Just because it can be done
may not be a good reason to do it, and I'd rather have students use normal definitions
to define constants.

On Wed, Dec 11, 2019 at 06:09:04PM -0800, Chris Smith wrote:

What do you think about this?
https://code.world/haskell#PPRc3vsmyMBZwfjT7mX_6sA
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/google/codeworld/issues/1243#issuecomment-564817569

Good point about names.  One idea is that, even if we don't expose it to users, we could add a clipping feature to use internally.  But I could also redesign the widgets to be less likely to overflow, since clipping is obviously not a great experience either.
I'm feeling more and more like these should be draggable.  I don't think it's feasible to drop the background without making the controls moveable, because they will not be legible for many background colors.  I do think a 90% alpha look might be good, though, to at least make it feel like there's something behind the control.
So I have something like this in mind:
+----------------------+
| paramName         ◯ |
+----------------------+
|                      |
| control ui           |
|                      |
+----------------------+

where the button in the title bar is a minimize button, other clicks on the title bar are drags, and clicks in the control ui area are handled by the control.
Other points:

I agree about adding a restart for the timer.
Adding a space-bar to hide controls sounds fine.  I want to throw in some kind of interstitial to make sure students can find the controls again, but I can do that.
I debated with myself for a while about params that don't have meaningful UI.  I ended up deciding to include them just because otherwise it makes them feel like a different kind of thing.  If we allow params to be minimized, and minimize these by default, and also allow space bar to hide params entirely, then perhaps this could minimize the disadvantages, but still present these as params for the user.

Missed one.

I think the reason for having constant as a Parameter is that it makes it easier to temporarily set a constant value for something that was originally something else, like a time or random number.  I can imagine doing this for debugging: I identify a broken test case using random, and temporarily set the param to constant instead while fixing that case.  Then I set it back to random when I'm done.  This is definitely debatable, and doesn't need to be decided right away.

I have made some, but not all, changes to this code.

All parameters are now floating windows that are draggable and collapsible.
Backgrounds are partially transparent so it's clear that part of the drawing extends behind them.
Relevant sections of the UI are clipped so that parameters cannot extend outside their windows.

Still to do:

Fix the Inspect window.
Add a UI to hide all params.
Add restart to the timer.
Fix some visuals, especially where I was lazy and used unicode emojis instead of better icons.
Auto-collapse parameters that have no UI.

Overall, I'm feeling pretty good about this.

Currently just missing this:

Fix some visuals, especially where I was lazy and used unicode emojis instead of better icons.

Example: https://code.world/haskell#PwgkSRmvsPV3E27dpRhV2AA

Also:

Move param window to top when it's clicked.

Remaining work:

Fix some visuals, especially where I was lazy and used unicode emojis instead of better icons.
Port the API to codeworld-base.
Final sanity check on the API.

My current test case: https://code.world/haskell#Pe8KuRQghqMVGvj2aIyR6lQ
@alphalambda Feedback is appreciated.  I know I've made some different choices than you would have (e.g., always showing widgets even if there is no UI), and I am interested in whether for realistic examples you think the extra UI is too intrusive.

Updated for latest API changes: https://code.world/haskell#P0p4sdhr7YZ1527pWKqjoxQ

I have hidden parameterOf, for now.  I find the argument compelling that there's no great need to add new parameter types, and unfortunately the interface for that got more complicated than I hoped.

Education variant: https://code.world/#PJ3GtJJXlBPKCsA9Yz_ieFQ
Still to-do:

Fix some visuals, especially where I was lazy and used unicode emojis instead of better icons.
Final sanity check on the API.


(BUG) Ancient Debris does not show up when holding a block scanner

Ancient Debris does not show up when holding a block scanner, all other ores do.

https://github.com/SwitchCraftCC/Plethora-Fabric/blob/32b6f25ecf3d7155bc0883b0fe869cfdfe3e68cd/src/main/java/io/sc3/plethora/util/config/PlethoraConfig.kt#L93
It looks like its intended to show up according to the config

https://github.com/SwitchCraftCC/Plethora-Fabric/commit/09292d167327e06175e59ab2eee3f9bc785e8e48 It seems to have been removed on purpose in this commit as it was set to only show ores.

Hmm I see, so its intended behavior then?