OS X and Win10: Exported apps can't find SimpleOpenNI libs

Issue Summary
Works fine in the Processing IDE, but exported apps look at root of the boot drive for the SimpleOpenNI folder, instead of in the correct location. This is an issue shared by all versions of SimpleOpenNI 1.96, including the original Max Rheiner version.
Executed Command (if any)
File > Export Application
Processing Output (if any)
Exported app crashes with gray screen.
Type of Issue

Execution error

Your System Configuration
Operating system: OS X 10.12, Win10.

Hello I will try to get one Windows PC this week to taste on Windows, currently I just have a Mac to support the library.

I wouldn't worry about Windows support yet--this is a bug that's been in every version of SimpleOpenNI since the beginning. If you can fix the Mac side, I can test on other OSes. Could you add the source of the SimpleOpenNI library itself? Like:
https://github.com/jaegonlee/SimpleOpenNI/tree/master/src/SimpleOpenNI

I try this library for Processing 3.3.7 on Windows10. It goes well. However, export problem does not fix yet. Would you please fix nativLibPath in simpleOpenNI.java. It is explained in https://github.com/wexstorm/simple-openni/issues/73 .

OK, I think I have a solution--it needed a few changes from the wexstorm one. Not sure how a PR would work with your branch structure but would be great if you could add this to your versions!
https://github.com/n1ckfg/SimpleOpenNI/blob/Processing_3.3.6/SimpleOpenNI/src/SimpleOpenNI/SimpleOpenNI.java#L32

Oh, and can you add the Java source for SimpleOpenNI.jar to your repo? Might help future-proof things.

Unfortunately the fix worked for depth but not for NITE--seems like NITE looks in the user's home directory (for some reason) when exported as a library regardless of the path set in the main jar.

Oh hey, big fan of XYscope. So I've researched this quite a bit, even experimented with recompiling the jar, and my conclusion is it's a path issue with NITE, which we don't have the source for, so it can't be completely fixed. (Hope I'm wrong though.) The good news is, there's a workaround: place the SimpleOpenNI library folder at the root of your boot drive, and all exported apps can find it. This makes it really hard for distribution to civilians, but otherwise it's not even that bad a solution, because you don't need the same 200MB folder for every app. Further good news is it still works up to Win10 and High Sierra. (Haven't tried Mojave.)

Thaanks + super thanks for quick reply. Ahaa, I was wondering about this when seeing what was changed in your various commits.. yup yup worked great (indeed not sooo user-friendly) but better than a sad gray-screen of nothingness.
Is there a flag or snippet to prevent it from including the 200mb library one each export, or simply have to inspect package contents and trash it?
If using skeleton tracking, does one still need to install OpenNi2:

brew tap brewsci/science
brew install openni2

My setup already has it.. so hard to test if app runs on fresh machine..

I just trash it...don't believe it's necessary to install OpenNI separately but need to test. Fwiw I always install the SenseCast version of OpenNI 1 on a new machine as a good-luck ritual.

Aha, nice tip (will check if OpenNI 1 suites my needs)– thanks again.

Whoa, this is the first solid lead I think we've had in the several years this issue has been hanging around. Thanks!

I've done some research about this problem today. Below are what I have found out:
the error info is:
Can't load SimpleOpenNI library (libSimpleOpenNI.jnilib) : java.lang.UnsatisfiedLinkError: Can't load library: /SimpleOpenNI/library/libSimpleOpenNI.jnilib
Verify if you installed SimpleOpenNI correctly.
http://code.google.com/p/simple-openni/wiki/Installation

java.lang.UnsatisfiedLinkError: SimpleOpenNI.SimpleOpenNIJNI.swig_module_init()V
	at SimpleOpenNI.SimpleOpenNIJNI.swig_module_init(Native Method)
	at SimpleOpenNI.SimpleOpenNIJNI.<clinit>(SimpleOpenNIJNI.java:290)
	at SimpleOpenNI.ContextWrapper.<init>(ContextWrapper.java:54)
	at SimpleOpenNI.SimpleOpenNI.<init>(SimpleOpenNI.java:253)
	at Sketch.settings(Sketch.java:28)
	at processing.core.PApplet.handleSettings(PApplet.java:954)
	at processing.core.PApplet.runSketch(PApplet.java:10786)
	at processing.core.PApplet.main(PApplet.java:10511)
	at Main.main(Main.java:7)

Why this happend?
Open SimpleOpenNI.jar through IntelliJ, and view SimpleOpenNI.class, below are how libSimpleOpenNI.jnilib is loaded:
static {
        String var0 = System.getProperty("os.name").toLowerCase();
        String var1 = "SimpleOpenNI";
        String var2 = System.getProperty("os.arch").toLowerCase();
        if (var0.indexOf("win") >= 0) {
            // ...
        } else if (var0.indexOf("nix") < 0 && var0.indexOf("linux") < 0) {
            if (var0.indexOf("mac") >= 0) {
                var1 = "lib" + var1 + ".jnilib";
                nativLibPath = getLibraryPathLinux() + "/SimpleOpenNI/library/";
                nativDepLibPath = nativLibPath + "osx/";
            }
        } else {
            nativLibPath = "/SimpleOpenNI/library/linux";
            if (var2.indexOf("86") >= 0) {
                var1 = var1 + "32";
            } else if (var2.indexOf("64") >= 0) {
                var1 = "lib" + var1 + "64.so";
                nativLibPath = getLibraryPathLinux() + "/SimpleOpenNI/library/";
                nativDepLibPath = nativLibPath + "linux64/";
            }
        }

        try {
            System.load(nativLibPath + var1);
        } catch (UnsatisfiedLinkError var5) {
            System.out.println("Can't load SimpleOpenNI library (" + var1 + ") : " + var5);
            System.out.println("Verify if you installed SimpleOpenNI correctly.\nhttp://code.google.com/p/simple-openni/wiki/Installation");
        }

        _initFlag = false;
    }

notice that, the result of getLibraryPathLinux() should be added before /SimpleOpenNI/library/libSimpleOpenNI.jnilib, the string appeared in the error information. Let's look at the function:
public static String getLibraryPathLinux() {
        URL var0 = SimpleOpenNI.class.getResource("SimpleOpenNI.class");
        if (var0 != null) {
            String var1 = var0.toString().replace("%20", " ");
            int var2 = var1.indexOf(47);
            boolean var3 = true;
            int var4 = var1.indexOf("/SimpleOpenNI/library");
            return -1 < var2 && -1 < var4 ? var1.substring(var2, var4) : "";
        } else {
            return "";
        }
    }
···

Notice this line

```java
int var4 = var1.indexOf("/SimpleOpenNI/library");

SimpleOpenNI tries to find substring /SimpleOpenNI/library from the full path of SimpleOpenNI.class file. If the substring does not show up, this function return an empty string. This is why processing fails to load SimpleOpenNI.jnilib file in exported application: when running from processing ide, the SimpleOpenNI.jar in ~/Documents/Processing/libraries/SimpleOpenNI/library directory is used, the full path of which contains /SimpleOpenNI/library. On the other hand, when running from exported application, the SimpleOpenNI.jar embedded in the application is used, which does not contain the required substring.
How to solve it.
A new implementation of getLibraryPathLinux is required to fix this problem thoroughly. A temporary solution is given below:

cd into your exported application bundle, go to Contents/MacOS, there should be a executable file with the same name of your exported application, Sketch, for example. Remove this file, and create a new empty file with the same name, edit the file and add the following contents:

#!/bin/bash
cd "$(dirname ${BASH_SOURCE})"
cd ../..
APP_ROOT=$(pwd)
cd Contents/Java

JAR_LIBS=$(ls *.jar | tr "\n" ":")
JAR_LIBS=${JAR_LIBS}./SimpleOpenNI/library/SimpleOpenNI.jar

APP_NAME=$(basename "${BASH_SOURCE}")

# Caution: if your embedded java has a different version, replace jdk1.8.0_181.jdk with the correct name
# if you didn't choose to embedded java in your exported application, set JAVA_BIN=java to use the global java
JAVA_BIN=${APP_ROOT}/Contents/PlugIns/jdk1.8.0_181.jdk/Contents/Home/jre/bin/java

${JAVA_BIN} \
-Djna.nosys=true \
-Djava.ext.dirs=$APP_ROOT/Contents/PlugIns/jdk1.8.0_181.jdk/Contents/Home/jre/lib/ext \
-Xdock:icon=$APP_ROOT/Contents/Resources/sketch.icns \
-Djava.library.path=$APP_ROOT/Contents/Java \
-Dapple.laf.useScreenMenuBar=true \
-Dcom.apple.macos.use-file-dialog-packages=true \
-Dcom.apple.macos.useScreenMenuBar=true \
-Dcom.apple.mrj.application.apple.menu.about.name=${APP_NAME} \
-classpath ${JAR_LIBS} ${APP_NAME}

make this file executable
chmod +x ./Sketch

Copy the entire folder ~/Documents/Processing/libraries/SimpleOpenNI to Contents/Java.

Amazing! I actually saved the jar source with my fork: https://github.com/n1ckfg/SimpleOpenNI/tree/Processing_3.4_test/SimpleOpenNI/src ...tried a couple path fixes and recompiled but no luck. Do you have an idea of how you would implement that directly in the source?

Amazing! I actually saved the jar source with my fork: https://github.com/n1ckfg/SimpleOpenNI/tree/Processing_3.4_test/SimpleOpenNI/src ...tried a couple path fixes and recompiled but no luck. Do you have an idea of how you would implement that directly in the source?

FINALLY! Thanks to your fork I was able to apply a definitive fix for the infamous path bug in .exe files. With your build.bat file and small changes to the solution posted in this link, you can easily generate a brand new .jar file which works perfectly with standalone .exe files. Here´s how (requires Processing 3.4 + SimpleOpenNI-Processing_3.4):

Edit @n1ckfg ´s fork "SimpleOpenNI-Processing_3.4_test\SimpleOpenNI\src\SimpleOpenNI\SimpleOpenNI.java" file with any text editor.

Insert this code before line 32:
static String workingDir = System.getProperty("user.dir");

Replace lines 50 and 56 with:
nativLibPath = getLibraryPathWin() +  workingDir + "/SimpleOpenNI/library/";

(optional) Edit @n1ckfg ´s .bat file and replace the "core.jar" location with the one at your current Processing library path if it´s not the same (as in my case). Save file changes if required.

Launch build.bat file, which generates the new SimpleOpenNI.jar

Overwrite the current file at export folder "\application.windows64\lib" with the new one.

Manually copy the folder SimpleOpenNI to the same folder where your .exe is located. (the one that contains subfolders: "documentation", "examples" and "library").

Launch the .exe file and this time it will load the SimpleOpenNI library and run the Kinect. Et voilà!

This should do the trick. Thanks again!

Amazing!

@totovr If we put this solution in a pull request, which branch would you like us to work in?

Both OS X and Windows solutions tested and working.


Package orderers are not applied when choosing a variant

I'm seeing some unhelpful behavior with version_split package_orderers:
I have:
package A-1 and A-2
package B-3 that depends on A
package C-4, with variants [A-1] and [A-2]
I also have a version_split package orderer:
package_orderers:
- type: per_family
  orderers:
  - type: version_split
    packages:
    - A
    first_version: "1"

Based on this package orderer, rez env B correctly resolves to A-1.
The issue I'm seeing is that rez env C resolves to A-2, despite A-1 being supported and preferred by the package orderer. rez env A C correctly chooses A-1, but not rez env C A, which makes me think package orderers are not applied when choosing a variant.
Environment

Windows 10
Rez 2.112.0
Python 3.7.8

To Reproduce
Expected behavior
Actual behavior
See https://github.com/ian471/rez-pkg-orderer-repro

I just put up a PR that addresses this issue: https://github.com/AcademySoftwareFoundation/rez/pull/1684


unpin sendgrid version

Love this simple Django mail backend!  Noticed it's currently pinned at sendgrid v1.4.0, which is quite a number of features and bugfixes behind.  Sendgrid's been good at following semver, so this patch would unpin the upstream version to anything below 2.X.

@elbuo8 Any comment on whether this might get merged?


reworked documentation

Codecov Report

Merging #20 (dcea74d) into master (8c52703) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #20   +/-   ##
=======================================
  Coverage   84.71%   84.71%
=======================================
  Files           3        3
  Lines         314      314
=======================================
  Hits          266      266
  Misses         48       48

Flag
Coverage Δ

unittests
84.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


SSLProtocolException caught in Http2Connection$ReaderRunnable.execute() does not propagate to application layer and  request gets retried forever

OKHttp Version 3.14.9
Platform: Android 10/11
I'm connecting to a server which supports http2 and the server requires client certificate. We rely on the exception from OkHttp layer during connection to judge whether provide the client certificate.
During the connection, the following exceptions happens when start the http2Connection in the  Http2Connection$ReaderRunnable.execute()

javax.net.ssl.SSLProtocolException: Read error: ssl=0x7b7b069008: Failure in SSL library, usually a protocol error error:10000410:SSL routines:OPENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE (external/boringssl/src/ssl/tls_record.cc:587 0x7bd930b6c8:0x00000001)

The the exception then got handled at the end of the CallServerInterceptor.intercept(), and the trackFailure was called, due to the isMultiplexed (because http2 used) returns true, the failure is not get recorded, the routeFailureCount is not get increased.Then when this exception is caught by the RetryAndFollowUpInterceptor, in its logic to check whether the exception is recovered, it would pass the check, then the request get retried, exception was not thrown to upper layer, and then the process get repeated forever, app hangs without know why.
Could you please help to analysis? As I'm not quite familiar with the whole connection workflow, not sure if it is an expected behavior, though it does seem to be an issue to me.
It does not happen if force to connect using Http1.1.

3.14.x is not maintained, can you reproduce with 4.9.1 and if so we can fix.  Are you able to provide a clean repro or unit test of the issue?

@yschimke Thanks for the info. I tried 4.9.1 and the issue is gone when I connect to the Tomcat server. Checked the history a little bit, seems the issue has been addressed in the commit from this PR https://github.com/square/okhttp/pull/5787.
Great news, thanks! I still have a webLogic14.1 server to verify, hopefully it should also be fine.


Add begin_access and end_access instructions.

NFC because we're not actually emitting them.

@swift-ci Please smoke test and merge.

@swift-ci Please smoke test.


chore: Run perf tests in CI

WIP

Warnings

:warning:
There are no updates provided to CHANGELOG. Ensure there are no publicly visible changes introduced by this PR.

  Generated by :no_entry_sign: dangerJS


Enhancement request: cancel http requests in response to task cancellation

Currently, if I call any TootClient method that triggers an HTTP request from a Task (e.g. SwiftUI’s .task(priority:_:) modifier), then cancel the Task, the URLSessionDataTask responsible for the request does not get cancelled and keeps running. Cancelling the data task in response to cancellation of the concurrency Task would help in several cases I can think of:

for UI like search, where TootClient.search gets called multiple times as the user types, cancelling any previous requests would make the last one more responsive
when using a client on a slow/unreliable internet connection, cancelling the tasks would keep incomplete requests from building up as the user navigates between views that load data, bogging things down even further
for things like uploading attachments, the upload should be stopped if the user cancels it rather than silently continuing anyway

I think the current behavior is due to the way TootSDK wraps the callback-based URLSession.dataTask() methods in URLSession+asyncData.swift. This StackOverflow answer has an example of how to wrap them like this while also adding a task cancellation handler, but their method requires some extra boilerplate for handling threaded access to the data task because of how the cancellation handler runs in parallel with the task.

This is an interesting one. It's definitely worth us taking a look at this. I'm wondering if it's related in part to the same thing I discovered with using Async Sequences as bindings... Tasks don't get cancelled when the object/actor that created them is deallocated (https://davidgarywood.com/swiftui-router-pattern-2-0/ look at the TaskCancellable section).
Looks like something we can fix though, thank you for reporting it 🙏
In the meantime for search, I would also suggest that you throttle or debounce the search requests to smooth them out a little. Even if we fix this and cancel the data tasks appropriately, you're still at risk of calling the instance unnecessarily and adding to it's load.

@daprice I pushed a possible fix in #152, would it be possible to test if it resolves the issue for you?

@kkostov Yes, I tested with a few different TootClient methods and it appears to work perfectly


Minor updates

Some comments and identifiers from the previous version were accidentally overwritten in this version when it was recently published. This PR reverts those changes.
ARM API Information (Control Plane)
MSFT employees can try out our new experience at OpenAPI Hub  - one location for using our validation tools and finding your workflow.

Azure 1st Party Service can try out the Shift Left experience to initiate API design review from ADO code repo.  If you are interested, may request engineering support by filling in with the form https://aka.ms/ShiftLeftSupportForm.
Changelog
Add a changelog entry for this PR by answering the following questions:

What's the purpose of the update?

[ ] new service onboarding
[ ] new API version
[ ] update existing version for new feature
[x] update existing version to fix swagger quality issue in s360
[ ] Other, please clarify

When are you targeting to deploy the new service/feature to public regions? No new features.
When do you expect to publish the swagger? This is very minor, just some small fixes to comments and x-ms-identifiers. it can go out whenever.
By default, Azure SDKs of all languages (.NET/Python/Java/JavaScript for both management-plane SDK and data-plane SDK, Go for management-plane SDK only ) MUST be refreshed with/after swagger of new version is published. If you prefer NOT to refresh any specific SDK language upon swagger updates in the current PR, please leave details with justification here.

Contribution checklist (MS Employees Only):

[x] I commit to follow the Breaking Change Policy of "no breaking changes"
[x] I have reviewed the documentation for the workflow.
[x] Validation tools were run on swagger spec(s) and errors have all been fixed in this PR. How to fix?

If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist

Applicability: :warning:
If your changes encompass only the following scenarios, you should SKIP this section, as these scenarios do not require ARM review.

Change to data plane APIs
Adding new properties
All removals

Otherwise your PR may be subject to ARM review requirements. Complete the following:

[x] Check this box if any of the following apply to the PR so that the label "ARMReview" and "WaitForARMFeedback" will be added by bot to kick off ARM API Review.  Missing to check this box in the following scenario may result in delays to the ARM manifest review and deployment.

Adding a new service
Adding new API(s)
Adding a new API version
-[ ] To review changes efficiently, ensure you copy the existing version into the new directory structure for first commit and then push new changes, including version updates, in separate commits. You can use OpenAPIHub to initialize the PR for adding a new version. For more details refer to the wiki.

[x] Ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

[ ] If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist
If you have any breaking changes as defined in the Breaking Change Policy, request approval from the Breaking Change Review Board.
Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Additional details on the process and office hours are on the Breaking Change Wiki.
NOTE: To update API(s) in public preview for over 1 year (refer to Retirement of Previews)
Please follow the link to find more details on PR review process.

/azp run


[1.8.9] Mysterious Crash

Not sure how it can be replicated, it happens every time the server is started. Someone on the server was messing with the mod and this started happening.

Forge 1808
ResourcefulCrops-1.8.9-1.3.0-44

https://unascribed.com/t/c2218a55.txt
@unascribed did it!
/me runs

Fixed!


Mocking MediatR with generics fails

Hello, I'm trying to write integration tests for webapi with Moq. I want to test if controller method calls mediator, and mediator does it job correctly. So working test look like this:
   Mock<IMediator> mediatrMock = new Mock<IMediator>();
            var moqResult = "FooTest";

            mediatrMock.Setup(m =>
                m.Send(It.IsAny<Foo.Query>(),
                    It.IsAny<CancellationToken>())).ReturnsAsync(() => moqResult);

            var sut = new HomeController(mediatrMock.Object);
            var ret = await sut.TestFoo();
            Assert.Equal(moqResult, ret.Value);

            mediatrMock.Verify(x => x.Send(It.IsAny<Foo.Query>(),
                It.IsAny<CancellationToken>()));

But I will have many duplicate code if I use this approach. I thought that I can use generics, because I change only Query type and set operation result each time. So :

async Task Generic<TK,K>(TK expectedResult,Func<Task<ActionResult<TK>>> callControllerMethod)
        {

            mediatrMock.Setup(m =>
                m.Send(It.IsAny<K>(),
                    It.IsAny<CancellationToken>())).ReturnsAsync(() => expectedResult);

            var ret = await callControllerMethod();

            Assert.Equal(expectedResult, ret.Value);

            mediatrMock.Verify(x => x.Send(It.IsAny<K>(),
                It.IsAny<CancellationToken>()));

        }

And I should be able to call it simply as:
  var moqResult = "BarTest";

            await Generic<string, BarQuery>(moqResult, () => sut.TestBar());

But mediatr fails to register it :/
I created a repo on github to demostrate it: https://github.com/fjod/MediatrMoq
please check it. May be I dont really understand what I am doing here xD

Why would you try to mock the mediator?
On Fri, Apr 10, 2020 at 9:13 AM Michael<EMAIL_ADDRESS>wrote:

Hello, I'm trying to write integration tests for webapi with Moq. I want
to test if controller method calls mediator, and mediator does it job
correctly. So working test look like this:
Mock mediatrMock = new Mock();
var moqResult = "FooTest";
        mediatrMock.Setup(m =>
            m.Send(It.IsAny<Foo.Query>(),
                It.IsAny<CancellationToken>())).ReturnsAsync(() => moqResult);

        var sut = new HomeController(mediatrMock.Object);
        var ret = await sut.TestFoo();
        Assert.Equal(moqResult, ret.Value);

        mediatrMock.Verify(x => x.Send(It.IsAny<Foo.Query>(),
            It.IsAny<CancellationToken>()));

But I will have many duplicate code if I use this approach. I thought that
I can use generics, because I change only Query type and set operation
result each time. So :
async Task Generic<TK,K>(TK expectedResult,Func<Task<ActionResult>> callControllerMethod)
{
        mediatrMock.Setup(m =>
            m.Send(It.IsAny<K>(),
                It.IsAny<CancellationToken>())).ReturnsAsync(() => expectedResult);

        var ret = await callControllerMethod();

        Assert.Equal(expectedResult, ret.Value);

        mediatrMock.Verify(x => x.Send(It.IsAny<K>(),
            It.IsAny<CancellationToken>()));

    }

And I should be able to call it simply as:
var moqResult = "BarTest";
        await Generic<string, BarQuery>(moqResult, () => sut.TestBar());

But mediatr fails to register it :/
I created a repo on github to demostrate it:
https://github.com/fjod/MediatrMoq
please check it. May be I dont really understand what I am doing here xD
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/jbogard/MediatR/issues/508, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAZQMSORBKQ4T2HAMPAXXLRL4SRFANCNFSM4MFPHD5A
.

Well, how do I test Controller then? I have Mediator injected in controller, so I must provide instance. If I try to do straightforward:
 public class NoMocking_Mediatr
    {
        public NoMocking_Mediatr(IMediator mediator)
        {
            Mediator = mediator;
        }

        public IMediator Mediator { get; }

        [Fact]
        public async void Test()
        {
            var moqResult = "FooTest";

            var sut = new HomeController(Mediator);
            var ret = await sut.TestFoo();
            Assert.Equal(moqResult, ret.Value);
        }

    }

It fails with "The following constructor parameters did not have matching fixture data: IMediator mediator"
And google said that I need to use mocks here https://stackoverflow.com/questions/55443201/how-to-instanciate-mediatr-as-part-of-a-unit-test

I don't think this test provides any value. I never write these tests, the logic has been pushed down into the handler instead.

Maybe not as an integration test but as a unit test ensuring that the right controller method sends the right command / query with the properties populated correctly should provide some value?

I don't think this test provides any value. I never write these tests, the logic has been pushed down into the handler instead.

This is very true, I'm not sure if I even should write them at all. Anyway, I still can test them, just without generics.


Errors made by scipy.optimize.linprog

I was solving this linear programming problem:

The function "linprog" failed to do that with a message "There is a linear combination of rows of A_eq that results in zero, suggesting a redundant constraint. However the same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible."
I check the error described in this message manually, but found this message was just wrong. I also solved this problem successfully using CVXPY and PuLP packages with same parameters.
In addition, I solved the dual problem using "linprog". The interesting thing was it could give a correct solution to the dual problem.
# Define parameters
m = 3
n = 3

p = np.array([7000, 12400, 7100])
q = np.array([13700, 5800, 7000])

C = np.array([[20, 15, 12],
              [14, 12, 10],
              [17, 12, 11]])

# Vectorlize matrix C
C_vec = C.reshape((m*n, 1), order='F')

# Construct matrix A by Kronecker product
A1 = np.kron(np.ones((1, n)), np.identity(m))
A2 = np.kron(np.identity(n), np.ones((1, m)))
A = np.vstack([A1, A2])

# Construct vector b
b = np.hstack([p, q])

# Solve the primal problem
res = linprog(C_vec, A_eq=A, b_eq=b, method='Revised simplex')

#Print results of the primal problem
print("results of the primal problem")
print("message:", res.message)
print("nit:", res.nit)
print("fun:", res.fun)
print("X:", res.x.reshape((m,n), order='F'))
print("--------------------")

# Solve the dual problem
res_d = linprog(-b, A_ub=A.T, b_ub=C_vec, bounds=[(None, None)]*(m+n), method='Revised simplex')

#Print results of the dual problem
print("results of the dual problem")
print("message:", res_d.message)
print("nit:", res_d.nit)
print("fun:", res_d.fun)
print("u:", res_d.x[:m])
print("v:", res_d.x[-n:])

Results are

Here, A and b are:

#### Scipy/Numpy/Python version information:
<!-- You can simply run the following and paste the result in a code block

1.5.2 1.19.4 sys.version_info(major=3, minor=8, micro=6, releaselevel='final', serial=0)
-->

Indeed this might be a numerical precision issue because the example satisfies the regularity
>>> [-1,-1,-1,1,1,1] @ np.hstack([A, b[:, None]])
array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])

Thanks for reporting it. It is a tolerance issue in one of the redundancy removal routines. The matrix is singular, and the routine has identified redundant rows. It checks to see if the b vector is compatible, but the tolerance is too tight, so it thinks it isn't. (Same as gh-10038, gh-10349. It's tricky to find tolerances that work for all problems.) Anyway, no harm in loosening it. I will submit a PR shortly.
In the meantime, you can pass options={'rr': False} to turn the redundancy removal off, and the problem solves fine. In SciPy 1.6.0 you will be able to choose one of three redundancy remoal routines e.g. {'rr_method': 'SVD'}, {'rr_method': 'pivot'}, {'rr_method': 'ID'} (where only SVD has the problem here), and there will be two more methods that will be much faster for large problems: method='highs-ds' and method='highs-ipm'; they have their own redundancy removal checks that don't have this problem.


useIsAuthenticated hook potentially may return false even if user is actually authenticated

Core Library
MSAL.js (@azure/msal-browser)
Wrapper Library
MSAL React (@azure/msal-react)
Public or Confidential Client?
Public
Description
Here is the current implementation of the useIsAuthenticated hook (https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/msal-react-v2.0.12/lib/msal-react/src/hooks/useIsAuthenticated.ts#L32):
export function useIsAuthenticated(matchAccount?: AccountIdentifiers): boolean {
    const { accounts: allAccounts, inProgress } = useMsal();

    const [hasAuthenticated, setHasAuthenticated] = useState<boolean>(() => {
        if (inProgress === InteractionStatus.Startup) {
            return false;
        }
        return isAuthenticated(allAccounts, matchAccount);
    });

    useEffect(() => {
        setHasAuthenticated(isAuthenticated(allAccounts, matchAccount));
    }, [allAccounts, matchAccount]);

    return hasAuthenticated;
}

If you look carefully at the implementation, you may notice that there is a chance that on subsequent renders (all renders except the initial) that hook may return false even if user is authenticated and there are actually presented accounts in msal instance (isAuthenticated(allAccounts, matchAccount)  === true). It happens because on each render we return the value (hasAuthenticated) calculated at the previous render (to be precise calculated right after the previous render, in useEffect hook).
That behavior may cause problems, for example, lately, I had a scenario where UnauthenticatedTemplate component (which uses useIsAuthenticated under the hood) was rendering its content (children props) even when the user was actually authenticated (so the account was presented in msal instance).
Below you can see pseudo-code to demonstrate that scenario:
<MsalProvider instance={msal}>
    <AuthenticatedTemplate>
        <App />
    </AuthenticatedTemplate>
    <UnauthenticatedTemplate>
        <DoLoginRedirect msal={msal} /> // that component will just call msal.redirectLogin() on initial render
    </UnauthenticatedTemplate>
</MsalProvider>

In my case, DoLoginRedirect was rendered for a short time after completing authentication (after redirecting from authentication server to be precise) and as a result, one more redundant login redirect step/loop happened.
After some time of debugging, I suspect that the implementation of useIsAuthenticated is the culprit of my problems. To be precise, I think that on render, the value returned  by useIsAuthenticated hook is stale cause it was calculated before the actual render (it was calculated after the previous render in the useEffect hook).
Taking into account everything mentioned above, I would suggest to change implementation of useIsAuthenticated hook to something like that:
export function useIsAuthenticated(matchAccount?: AccountIdentifiers): boolean {
    const { accounts: allAccounts, inProgress } = useMsal();
    const isInitialRenderRef = useRef(true);

    const hasAuthenticated = useMemo(() => {
        if (isInitialRenderRef.current && inProgress === InteractionStatus.Startup) {
            return false;
        }

        return isAuthenticated(allAccounts, matchAccount);
    }, [inProgress, allAccounts, matchAccount]);

    if (isInitialRenderRef.current) {
        isInitialRenderRef.current = false;
    }

    return hasAuthenticated;
}

I know that the suggested implementation does not look very elegant and may be improved but the main point is that new implementation solves an issue with returned stale value and it also prevents redundant re-render (because we don't update any state (useState) anymore).
Please let me know your opinion on that matter and correct me if something is wrong with my suggestions and considerations. Thank you in advance
Source
External (Customer)

I am getting the opposite isAuthenticated when there are no accounts so my pages are blowing up even though they are wrapped under AuthenticatedTemplate

Can you please raise a PR so we can review and apply the suggested change it if approved? The guidelines to contribute are here

@sameerag ok, I will create PR

I believe I just ran into this issue. It surfaced after upgrading to react 18. Overall flow is that this issue happens for freshly created accounts that get redirected back to my app.
My code looks like:
  const { accounts, inProgress } = useMsal();
  const isAuthenticated = useIsAuthenticated();

Render 1:
{isAuthenticated: false, inProgress: 'handleRedirect', accounts: Array(0)}
Render 2:
{isAuthenticated: false, inProgress: 'none', accounts: Array(1)}
Render 3:
{isAuthenticated: true, inProgress: 'none', accounts: Array(1)}
Render #2 is the problem, where the hook is returning that the user is not authenticated even though there is an account. If I revert to React 17 that doesn't happen.

@sameerag Did this get completed? I'm not seeing any associated release notes or pull request


State Change Events question

Is there a specific reason the ICircuitBreakerEvents interface isn't used or implemented anywhere?
I was thinking about adding support for the state change events to CircuitBreaker, but wanted to see why they weren't there first.
Thank you.

Lucas, thanks for raising this. Yes, I intended to add events and an extensibility point via events. I just didn't find a need yet. I will be glad to see a PR if you have time for this. 😉

Is there any concern about two consecutive state changes occurring in quick succession, and potentially triggering the events out of order?

I don't have a strong opinion on that. But I would avoid any locking and keep the code as thin as possible. Maybe atomic event version via Interlocked.Increment could solve that? Do you have a particular use case in your mind?

I would also avoid any allocation if it's possible at all. I want to keep the library as unobtrusive and thin as possible. Maybe just interface with methods (not events) would be a better option, with a default null implementation and ability to specify a custom one. I don't have a strong opinion on this either. 😕

Use case: I have a pool of related, remote resources. They can fail or slow down independently, but the remote system can also fail as a whole. If an individual resource is slow or failing, I'm fine with directing requests for that resource to another queue for processing later. However, if many of the remote resources are failing, I want the system to slow down, stop dropping requests, and wait for the remote system to stabilize. I think I need the events to be able to monitor all the instantiated CircuitBreaker's and switch into a "wait for recovery" mode if too many are "Opened". I could also just check the state of the CircuitBreaker's periodically, but I don't think that would be as reliable, as multiple state changes could occur between polls. Perhaps there's a better way I haven't considered?

The easiest way is to inject some logic into try catch block 😄 But using events or an interface is indeed a more reliable way to do it. Another option is to expose ICircuitBreakerSwitch via construction or a builder class. (and other interfaces too ie ICircuitBreakerInvoker, ICircuitBreakerState)

@LBreedlove I've just published v0.6.0


Add verify user email route

Issue: 59
Changes proposed in this pull request and/or Screenshots of changes:

Adds the verify user email route.
Takes JWT secret from URL params, marks user as verified if secret is verifiable otherwise sends bad response.

@BuddyLongLegs done.


As a CIF user, I want to be able to select a "Summary Report" reporting requirement type, so that I can track it for IA projects

Description:
Summary Reports are a type of reporting requirement specific to the IA stream
Usually, a payment is attached to it, as a percentage of the total budget
Logic and or fields associated to this report need to be confirmed with the business area
Acceptance Criteria:
Given
When
Then
Development Checklist:

[ ] Checklist item
[ ] Checklist item
[ ] Checklist item
[ ] Meets the DOD

Definition of Ready (Note: If any of these points are not applicable, mark N/A)

[ ] User story is included
[ ] User role and type are identified
[ ] Acceptance criteria are included
[ ] Wireframes are included (if required)
[ ] Design / Solution is accepted by Product Owner
[ ] Dependencies are identified (technical, business, regulatory/policy)
[ ] Story has been estimated (under 13 pts)

·Definition of Done (Note: If any of these points are not applicable, mark N/A)

[ ] Acceptance criteria are tested by the CI pipeline
[ ] UI meets accessibility requirements
[ ] Configuration changes are documented, documentation and designs are updated
[ ] Passes code peer-review
[ ] Passes QA of Acceptance Criteria with verification in Dev and Test
[ ] Ticket is ready to be merged to main branch
[ ] Can be demoed in Sprint Review
[ ] Bugs or future work cards are identified and created
[ ] Reviewed and approved by Product Owner

Notes:

PO Review (November 8, 2022):
@nanyangpro - do we have a design/wireframe for the IA Summary Page?

Hi @LindsayMacfarlane - Yes, please see in #1061. (This ticket is a duplicate of #1061, thus can be closed.)
Along with #1061, a bunch of ticket were created as outcome of Discover on IA (please see the last comment in #720). They are the issues we need to address for incorporating IA, other outdated ones can be closed as well.

Closing this ticket as per @nanyangpro recommendations.


Query regarding conversion of Big.js to Number

Firstly , thanks for the wonderful set of libraries :+1:
I have a query regarding conversion of a big.js to a number.
For example:
I need to add 0.1 and 0.2
I do
var a = big(0.1).plus(0.2);
Now i want to store it as a number on my object.
Currently I am doing
var n = Number(a);
which is probably doing
Number(a.toString());
I just want to know if there is any better way that i am missing.

Thanks for the feedback.
No, there is no better way.


separate thread for logging purposes

Might be worth wrapping something around this: https://github.com/KjellKod/g3log

Or this, which seems more popular: https://github.com/gabime/spdlog

I think in general, we should make sure this is a problem first before spending too much time on adapting these libraries.

it is not like a total preservation of glog feature, but I want to make some like LOG(INFO) << works transparently without much change. There is definitely room to make it more like it. I thought about these libraries, but I do not think they work in a transparent manner. And I agree with you that I should probably first see if it is indeed the logging that causes the problem. one  way might be to print minimum log (like every 200 requests) in the reorder exp and see if the receiver bottleneck still persists.

one way might be to print minimum log (like every 200 requests) in the reorder exp and see if the receiver bottleneck still persists.

Even easier would be to just count the total number of receives in memory and discard everything else, if we can see a higher receive rate then that would indicate logging is the bottleneck.

Ok, just an update based on some of the work I've been doing, it doesn't look like logging is a bottleneck in the full protocol compared to generating signatures, we can probably shelve this for now. It would be interesting to see for these specific proxy-receiver experiments though if it still is.

Going to close this PR for now, as explained above.


Implement ability to consume Envoy metrics via Graphite-Web

This is dependent on the implementation of #139 and #141. The task involves the creation of new utility functions to directly request timeseries data from Prometheus and transform in a way that we can render using our charts.

Blocked by #173


Add a CI presubmit that renders the documentation.

Why do we want to block CLs on this?
or does this just make the errors a bit better than the very confusing sphinx site without blocking CLs

The explicit goal is to not let you submit PRs that break the documentation build.

The explicit goal is to not let you submit PRs that break the documentation build

I guess that's reasonable. But why didn't we block on this before then? Would be nice to dig up that reason. Also it is very hard to fix docs builds from CLs. The errors are also not legible.
But if you feel strongly then LGTM.

The explicit goal is to not let you submit PRs that break the documentation build

I guess that's reasonable. But why didn't we block on this before then? Would be nice to dig up that reason. Also it is very hard to fix docs builds from CLs. The errors are also not legible.
But if you feel strongly then LGTM.

We used to block on this. But we were running the presubmit in readthedocs, and we ran out of readthedocs capacity. So we turned it off rather than block people. But I don't think that applies if the blocking part runs jn github actions.
Note: at the moment I'm trying using a free runner. If that's too slow, we can use a larger runner.

I see okay.


overriding level_to_s

I have a quick question about the "official" way to get the log level to show fully (e.g. ERROR instead of E). I can see that this is done in level_to_s method, and used in the default formatter.
Would it be best to monkey-path this method? (how?) or to define a custom formatter?
Intuitively I would use a custom formatter, but feels like a lot of copy&paste for changing a small fraction of the default format.
Or maybe there's a different option altogether?

(as a side note I'm curious about the design choice to shrink the level to one letter. I've never seen it done before, but I'm not familiar with too many logging frameworks)

Yes, the way to customize the logging format: https://rocketjob.github.io/semantic_logger/customize.html
It would be nice to be able to "configure" just one aspect of the log format without having to supply the complete block. Want to submit a PR with that capability since I am sure you are not the only one that would like it?
The real indication of the log level is actually the color of the line itself, which  is much faster than trying to read the log level text of every entry.
You can still grep for specific levels as follows
tail -f log/production.log | egrep "\[1m(W|E|F).\[0m”

Thanks @reidmorrison. I'd be happy to submit another PR, but not entirely sure how to make this "pluggable"... I'll think about it.
Yeah, colors are great, and I can regex this thing, but it's mostly for matching things automatically on logentries and generating alerts, so I'd rather rely on something a bit more expressive (plus, we remove colors on production, so logs are cleaner to inject).

In our production environment we created colored logs for humans to read. We also write to a JSON formatted log file that is read by splunk.
As for alerting, Semantic Logger does that directly by feeding New Relic, Bugsnag and others in real time without the need to "inject" the logs in any way. https://rocketjob.github.io/semantic_logger/appenders.html

Yeah, it makes sense to do things this way. We do things a bit differently. We only read logs on logentries typically, so colors just mess up things there. We also want to write to log files rather than directly using the logentries appender for a few of reasons (Not all logs are written by Rails, and we anyway send other log files using the logentries daemon, and it's less vendor-locked).
We use sentry for alerts, and the sentry appender works great for this. But some alerts are better done with logentries. For example, velocity checks. We don't log every warning to sentry, but we do write it to the log. We have a rule that detects a high number of warnings and alerts us. This alert is set on logentries.
In any case, just to give some context. I can certainly change the regex on logentries to capture the condensed log-level, but I just thought having the full level is more common in logs, and doesn't really waste that much space or cognitive power to read through.
Semantic logger looks great, and the appenders and custom formatters gives us flexibility. Just wondered if there's a simpler hack or a better way to tweak this particular part of the log. I'll keep thinking if there's a simple way to structure this so it's easier to hook into, but I can't think of anything right now.
Thanks for taking the time to answer, @reidmorrison. Much appreciated.

I'll close this for now, because my question was answered. I'd be happy to continue this discussion however and contribute to the project.

Recommend looking into Bugsnag, we send all of our errors to Bugsnag which has builtin velocity/spike detection. It is great at managing errors and exceptions across all of our servers for a very reasonable cost. Definitely helped us reduce errors and track new ones.

Thanks @reidmorrison. Bugsnag looks interesting. We recently switched to Sentry, so I don't think we're likely to switch again (Although I can't say I'm super happy with their recent pricing changes... )

We refactored the formatters in master to allow for easier customization of the format.
Create a custom formatter:
class MyFormatter < SemanticLogger::Formatters::Default
  # Return the complete log level name in uppercase
  def level
    log.level.upcase
  end
end

Specify the formatter when creating the appender:
SemanticLogger.add_appender(io: $stdout, formatter: MyFormatter.new)

Example usage:
Rails.logger.info "Hello World"

# => 2017-04-05 01:05:52.868286 INFO [13143:70216759638540 (irb):11] Rails -- Hello World

The formatter for an existing appender can also be changed directly if required.
SemanticLogger.appenders.first.formatter = MyFormatter.new

Looks really cool! Thanks @reidmorrison
Is this "officially" released?

It will be released as part of the v4.1 gem, which will be created once this change has been tested and then deployed to our production environment to ensure there are no issues.


[PT Run] TimeDate plugin: Setting to ignore number only input on global queries

Summary of the Pull Request
What is this about:
At the moment the plugin catches input like 10 10 on global queries. This can be painful when searching for files or doing calculations.
This PR adds a new plugin settings that allows the user to ignore such global queries without blocking/disabling global results for the queries time, date and now. This makes the behavior on global queries more user friendly. (The setting will be enabled by default.)

How does someone test / validate:
Update and run tests. Test functionality on local build.
Quality Checklist

[x] Linked issue: #18038
[x] Communication: I've discussed this with core contributors in the issue.
[x] Tests: Added/updated and all pass
[x] Installer: Added/updated and all pass
[x] Localization: All end user facing strings can be localized
[x] Docs: Added/ updated
[x] Binaries: Any new files are added to WXS / YML

[x] No new binaries
[ ] YML for signing for new binaries
[ ] WXS for installer for new binaries

Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.

I was looking at https://github.com/microsoft/PowerToys/issues/18038 and I don't agree with adding this option.
This behaviour is expected since the plugin have the "include in global result" option enabled (by default I think).

I was looking at #18038 and I don't agree with adding this option. This behaviour is expected since the plugin have the "include in global result" option enabled (by default I think).

EDIT: the new option will also impact the calculator plugin.

What do you mean? The new option allows to not catch this input. At the moment we catch it on every global query.

I mean that if you don't want "Date and Time" results you can just disable the plugin in global results.
That said, I leave the word to the core team.

I mean that if you don't want "Date and Time" results you can just disable the plugin in global results. That said, I leave the word to the core team.

The idea here is to allow result like time or date::10/10 in global queries, but ignore queries like 10 10.

@davidegiacometti
I have updated the PR description and hope it is more clear now.

I don't think adding options like these is good approach. Documenting the plugin better should be better IMHO. We'll have more and more plugins in the future. Adding similar options every time something like this happens will end up messy. For these cases we have both "disable specific plugin" and "activation command & include in global result" options

Maybe it makes sense to use the existing setting "Only time, date and now in global results" here instead of creating a new one. So we then only allow the results for these inputs and users can't convert a number input to these results. This might make more sense here.

hm, yes. That setting looks similar enough to the one you've added here. I guess it can be used for this too

So, I'm guessing using the already existing setting is what makes sense here?

So, I'm guessing using the already existing setting is what makes sense here?

I will change it on weekend.

I have updated the PR.

@jaimecbernardo , @crutkas
For your information you can merge this


Member1

@AthulJoshi can you take a look at this PR?

Rest all looks good. And what is the use of that py file in src?  And try to keep the .gitignore file minimal.

@AthulJoshi please look


WIP: Implement OSD sections

Still WIP, @mwheckmann free to test
As requested by #162
Current known issue, since ceph.conf gets modified during every single
run (at the end during the merge) so this will restart ceph daemons.
Signed-off-by: Sébastien Han<EMAIL_ADDRESS>

If we want to somehow give more variable we could use the Ansible inventory for that something like:
[osds]
osd0 ceph_root= default ceph_rack=foo

Ok everything works now, the only thing that I'll like to avoid is to restart Ceph during each run.

Merging this.
Simply note that everytime you replay the playbook it will restart all the OSD daemons :-(


Bugfix/ Houdini: fix default redshift version

Changelog Description
Fixing the bug reported here  https://community.ynput.io/t/houdini-redshift-deadline-executable-error/1210
Let me quote BigRoy's comment:
If we specify Version as "" then indeed it tries to access the version as Redshift_Executable_ instead of the Deadline default Redshift_Executable_1
Testing notes:

(As far as I know) Make sure  REDSHIFT_VERSION env doesn't exist
Enable render archives in Redshift ROP
Publish

Because we're splitting OpenPype into ayon-core and individual host addons, this PR would have to be re-created to target one of those.
We're closing it down, but we'll he happy for a new PR to ynput/ayon-core or the host addon repository once it's up.


⚠ Samsung has degraded performance

In 4d7364c, Samsung (https://samsung.com) experienced degraded performance:

HTTP code: 200
Response time: 2474 ms

Resolved: Samsung performance has improved in f132e88.


Adding default environment dashboard configuration to ADOP java catridge

It looks like this would populate an environment dashboard, but it doesn't create the dashboard view?  I suggest we need it to create a view.  Also, when an environment is created, should it add the env build version to the dashboard as well?

The view is added in the Jenkins image at the root of the jobs, but it would make sense to add one at a project level as well - especially if the plugin stops being global.
Regarding the PR itself, can the commits be squashed please? Also, I think the environment name should be namespaced against the workspace and project.


time to switch to modern javascript syntax?

what do you think?

plain vanilla javascript
ES Module (esm)
javascript classes
const, let
arrow function
no more CoffeeScript
native async/await/promises
dropping some old browser support
less use of lodash and more of native functinos

I think this is a wonderful idea! And it's something I've been planning to look into. I'll try and bump it up in terms of priority.

Do you have any plan on how to migrate the coffeescript files to vanilla javascript?

Maybe this can help: https://decaffeinate-project.org


References - Datalake Storage - Add Example Code

@burkeholland,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs-ref-services/data-lake-store.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

#sign-off per @TomArcher

:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

docs-ref-services/data-lake-store.md
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Change of place of exercise

Hello! exercise <IP_ADDRESS> changed place and is now the exercise <IP_ADDRESS> in the book. Also, exercise <IP_ADDRESS> has changed.

Thanks for letting us know! Addressed in PR #43 😄

Thanks for letting us know! Addressed in PR #43 😄


Builder API uses CC and BCC recepient types incorrectly

Fixed in https://github.com/bbottema/simple-java-mail/pull/20, will release to maven central soon.

Released in 2.4


Null Pointer Exception Potential

Please add more scenario description here, why we need this kind of check?

Please add more scenario description here, why we need this kind of check?

because Entity is interface, go interface contains type and data, when type is not nil, the interface will not be nil, but the data can be nil,  show some code example:
type Entity interface {
Do()
}
type ImpEntity struct {
Name string
}
func (e *ImpEntity) Do() {
fmt.Println(e.Name)
}
func main() {
var i *ImpEntity
fmt.Println(i == nil)   // true
Test(i)
}
func Test(e Entity) {
if e != nil {   // not nil
e.Do()   // panic
}
}
so when  tracer.ServiceEntity is nil,  will panic

Then, can we use the reflect.ValueOf().IsNil() to judgment the reference is nil or not? The reflect is the more lower level case, we can use the standard way to do this.

Also, please fix the conflict.


VideoPlayer duration property is alwys set to zero for webm videos

Software Versions

Python: 3.9
OS: linux mint
Kivy: 2.2.orc1
Kivy installation method:

The duration property of the videoplayer is alwys set to zero when the input video is webm format, thus causing ZeroDivisonErro when calcuting seek to set time.
seek = self.position / self.duration   d = self.duration * seek   minutes = int(d / 60)   seconds = int(d - minutes * 60)   self.ids.button_box.ids.time.text = "%d:%02d" % (minutes, seconds)

Hi @Noor-Kalibbala !
Can you please confirm the provider used to reproduce the video?
(Feel free to post the full log)

@misl6 please kindly find the log below
``
[INFO   ] [Logger      ] Record log in /home/noor/.kivy/logs/kivy_23-05-19_0.txt
[INFO   ] [Kivy        ] v2.2.0rc1, git-22fd80d, 20230504
[INFO   ] [Kivy        ] Installed at "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/init.py"
[INFO   ] [Python      ] v3.9.16 (main, Dec  7 2022, 01:12:08)
[GCC 11.3.0]
[INFO   ] [Python      ] Interpreter at "/home/noor/PycharmProjects/pythonProject/venv3.9/bin/python"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Factory     ] 190 symbols loaded
[INFO   ] [ImageLoaderFFPy] Using ffpyplayer 4.5.0
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_ffpyplayer
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] Backend used
[INFO   ] [GL          ] OpenGL version <b'4.6 (Compatibility Profile) Mesa 22.2.5'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel'>
[INFO   ] [GL          ] OpenGL renderer <b'Mesa Intel(R) HD Graphics 4600 (HSW GT2)'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 6
[INFO   ] [GL          ] Shading version <b'4.60'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Loader      ] using a thread pool of 2 workers
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [VideoFFPy   ] Using ffpyplayer 4.5.0
[INFO   ] [Video       ] Provider: ffpyplayer(['video_ffmpeg'] ignored)
[INFO   ] [KivyMD      ] 1.1.1, git-Unknown, 2023-04-11 (installed at "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivymd/init.py")
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [ProbeSysfs  ] device match: /dev/input/event5
[INFO   ] [MTD         ] Read event from </dev/input/event5>
[INFO   ] [Base        ] Start application main loop
[DEBUG  ] Importing BlpImagePlugin
[DEBUG  ] Importing BmpImagePlugin
[DEBUG  ] Importing BufrStubImagePlugin
[DEBUG  ] Importing CurImagePlugin
[DEBUG  ] Importing DcxImagePlugin
[DEBUG  ] Importing DdsImagePlugin
[DEBUG  ] Importing EpsImagePlugin
[DEBUG  ] Importing FitsImagePlugin
[DEBUG  ] Importing FitsStubImagePlugin
[DEBUG  ] Importing FliImagePlugin
[DEBUG  ] Importing FpxImagePlugin
[DEBUG  ] [Image       ] failed to import FpxImagePlugin: No module named 'olefile'
[DEBUG  ] Importing FtexImagePlugin
[DEBUG  ] Importing GbrImagePlugin
[DEBUG  ] Importing GifImagePlugin
[DEBUG  ] Importing GribStubImagePlugin
[DEBUG  ] Importing Hdf5StubImagePlugin
[DEBUG  ] Importing IcnsImagePlugin
[DEBUG  ] Importing IcoImagePlugin
[DEBUG  ] Importing ImImagePlugin
[DEBUG  ] Importing ImtImagePlugin
[DEBUG  ] Importing IptcImagePlugin
[DEBUG  ] Importing JpegImagePlugin
[DEBUG  ] Importing Jpeg2KImagePlugin
[DEBUG  ] Importing McIdasImagePlugin
[DEBUG  ] Importing MicImagePlugin
[DEBUG  ] [Image       ] failed to import MicImagePlugin: No module named 'olefile'
[DEBUG  ] Importing MpegImagePlugin
[DEBUG  ] Importing MpoImagePlugin
[DEBUG  ] Importing MspImagePlugin
[DEBUG  ] Importing PalmImagePlugin
[DEBUG  ] Importing PcdImagePlugin
[DEBUG  ] Importing PcxImagePlugin
[DEBUG  ] Importing PdfImagePlugin
[DEBUG  ] Importing PixarImagePlugin
[DEBUG  ] Importing PngImagePlugin
[DEBUG  ] Importing PpmImagePlugin
[DEBUG  ] Importing PsdImagePlugin
[DEBUG  ] Importing SgiImagePlugin
[DEBUG  ] Importing SpiderImagePlugin
[DEBUG  ] Importing SunImagePlugin
[DEBUG  ] Importing TgaImagePlugin
[DEBUG  ] Importing TiffImagePlugin
[DEBUG  ] Importing WebPImagePlugin
[DEBUG  ] Importing WmfImagePlugin
[DEBUG  ] Importing XbmImagePlugin
[DEBUG  ] Importing XpmImagePlugin
[DEBUG  ] Importing XVThumbImagePlugin
[ERROR  ] [Image       ] Error loading </home/noor/videos/Jay-Z & Kanye West - Nias In Paris (Explicit).webm>
[WARNING] Deprecated property "" of object "<kivy.uix.video.Video object at 0x7f92a101ed60>" was accessed, it will be removed in a future version
[WARNING] [MTD         ] Unable to open device "/dev/input/event5". Please ensure you have the appropriate permissions.
[INFO   ] [Base        ] Leaving application in progress...
Traceback (most recent call last):
File "/home/noor/PycharmProjects/pythonProject/mak_polls/CustomVideoPlayer/custom_video_player.py", line 340, in
TestVideoPlayer().run()
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/app.py", line 956, in run
runTouchApp()
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/base.py", line 574, in runTouchApp
EventLoop.mainloop()
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/base.py", line 339, in mainloop
self.idle()
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/base.py", line 379, in idle
Clock.tick()
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/clock.py", line 733, in tick
self.post_idle(ts, self.idle())
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/clock.py", line 776, in post_idle
self._process_events()
File "kivy/_clock.pyx", line 620, in kivy._clock.CyClockBase._process_events
File "kivy/_clock.pyx", line 653, in kivy._clock.CyClockBase._process_events
File "kivy/_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/core/video/video_ffpyplayer.py", line 227, in _redraw
self.dispatch('on_load')
File "kivy/_event.pyx", line 727, in kivy._event.EventDispatcher.dispatch
File "kivy/_event.pyx", line 1307, in kivy._event.EventObservers.dispatch
File "kivy/_event.pyx", line 1231, in kivy._event.EventObservers._dispatch
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/uix/video.py", line 266, in _on_load
self._on_video_frame(largs)
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/uix/video.py", line 255, in _on_video_frame
self.position = video.position
File "kivy/properties.pyx", line 520, in kivy.properties.Property.set
File "kivy/properties.pyx", line 567, in kivy.properties.Property.set
File "kivy/properties.pyx", line 606, in kivy.properties.Property._dispatch
File "kivy/_event.pyx", line 1307, in kivy._event.EventObservers.dispatch
File "kivy/_event.pyx", line 1213, in kivy._event.EventObservers._dispatch
File "kivy/_event.pyx", line 748, in kivy._event.EventDispatcher.__proxy_setter
File "kivy/properties.pyx", line 567, in kivy.properties.Property.set
File "kivy/properties.pyx", line 606, in kivy.properties.Property._dispatch
File "kivy/_event.pyx", line 1307, in kivy._event.EventObservers.dispatch
File "kivy/_event.pyx", line 1189, in kivy._event.EventObservers._dispatch
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/lang/builder.py", line 67, in call_fn
setattr(element, key, e_value)
File "kivy/weakproxy.pyx", line 35, in kivy.weakproxy.WeakProxy.setattr
File "kivy/properties.pyx", line 520, in kivy.properties.Property.set
File "kivy/properties.pyx", line 1667, in kivy.properties.AliasProperty.set
File "kivy/properties.pyx", line 1672, in kivy.properties.AliasProperty._dispatch
File "kivy/_event.pyx", line 1307, in kivy._event.EventObservers.dispatch
File "kivy/_event.pyx", line 1189, in kivy._event.EventObservers._dispatch
File "/home/noor/PycharmProjects/pythonProject/venv3.9/lib/python3.9/site-packages/kivy/lang/builder.py", line 55, in custom_callback
exec(kvlang.co_value, idmap)
File "/home/noor/PycharmProjects/pythonProject/mak_polls/CustomVideoPlayer/custom_video_player.kv", line 29, in
on_value: root.parent.set_time()
File "/home/noor/PycharmProjects/pythonProject/mak_polls/CustomVideoPlayer/custom_video_player.py", line 228, in set_time
seek = self.position / self.duration
ZeroDivisionError: float division by zero
Process finished with exit code 1
``

A little googling suggests one can't rely on the duration field in webm not to be empty (or zero).
https://superuser.com/questions/1585091/fixing-the-length-duration-of-a-webm-file-takes-too-much-time-by-ffmpeg
And for js users:
https://www.npmjs.com/package/fix-webm-duration

@RobertFlatt: Is it fair to say it is not Kivy's fault, and we can close the issue?

@RobertFlatt Alright , let me close it

@RobertFlatt: Is it fair to say it is not Kivy's fault, and we can close the issue?

Yes but it's an issue in ffplayer

@baseplate-admin: Good to know. Has anyone raised an issue with them?

As I understand it Webm videos can have the duration property set to zero, or not present (see link above).
There is a workaround in ffmpeg, but it takes notable time to determine the duration (see link above). There is a related issue with webm videos incorrectly encoded as H264.
ffpyplayer do not implement this workaround for the first issue, and this is the assumed ffpyplayer issue. Is this correct?
As a workaround and to test the assumption, look at configuring ffmpeg from ffpyplayer. Personally I could not guide anybody through this.


Enum input arguments not serializable

We have an issue updating Forest in the development server. In the server, when running Forest tasks you provide inputs to the forest functions in json format. Thus all input arguments need to be serializable. In the latest version of Forest we have arguments such as Frequency Enum class in the constants module that can not be made into json input.
We need to replace the Enum classes with another type such as strings and ifelse statements in the code. @hackdna do you have any thoughts?

AFAIK none of the Forest functions accept JSON as arguments. Could you provide more details like stack traces and links to the relevant code in Beiwe?

I don't have any links to code to provide. My understanding is that when running a forest stack on the beiwe server you provide the arguments for the functions in json format, thus an Enum cannot be provided.
Maybe @biblicabeebli  can provide some more context.

(oops, this sat for a bit, my bad)
Yes, this is related to the forest task runner on Beiwe Backend.  We need to be able to serialize parameters so that they can be stored in the database.  It turns out that attribute access of python Enum [meta]classes returns some enum-related class type, not primitives or strings, and the python standard library json implementation blows up.
In [1]: import enum, json
In [2]: class whatsit(enum.Enum):
   ...:     whatever = "thing"
   ...:
In [3]: json.dumps(whatsit.whatever)
------------------------***stacktrace***--------------------------------
TypeError: Object of type whatsit is not JSON serializable

There are various solutions, but the best one is to ensure that all "entrypoint" functions for Forest have json-serializeable types as defaults and as input types.  The reason this is preferable is because we want/need to be able to introspect on the default arguments of those entrypoint functions so that we don't need to update the backend whenever parameters change on those functions.  We store arguments so, provided the old parameters are still functional at all, we can re-run the tree on a participant that has uploaded new data.
My rec here is to [generally] just use a class for those defaults. The metaclass properties of the Enum type are not very valuable.

Ok, I've done some review. - forest dispatch is not my original work, there was supposed to already be parameter saving on the backend buuuut there isn't. I forgot about that. 🙄
So there isn't code I can point you to because it doesn't exist - yet.
This is our tracking issue for the forest task dispatch page updates:
https://github.com/onnela-lab/beiwe-discussions/issues/109#issuecomment-1544293233  <- this comment is my most-up-to-date statement of work to be implemented related to this swath of the forest task dispatch code.
Here's a more specific statement of what the forest task dispatch needs:

We need a mechanism of communicating parameter types for forest's tree entrypoints.
If, for-example, dates/times need to be provided in string form I need to know that those parameters are actually dates/times because I need to provide the correct website ui element (date/time selector) for manual entry.
We need well defined string conversions for those.
We need the parameters to be exportable/serializeable.

Details on the feature driving serializeability:

One of the features we want is an import/export function so that someone who is not intimately familiar with forest (me, @hydawo, a new onnela lab intern, an external sysadmin running their own beiwe instance) to be able to copy-paste a value in.  This is in addition to website form fields.

(Some of the footwork is simplified by adopting the orjson library.  It natively converts date and datetime objects to string form (pretty sure its the python isoformat), and it even looks like it actually handles those enum attributes correctly.  (The only weirdness is that its output is bytes, not str.)  It is also Extremely fast.
I would like to be able to introspect on the entrypoint functions themselves because that is hard to get wrong, but if there's another mechanism of presenting information to Beiwe I'm open to it.

@biblicabeebli Thank you for the additional info. We can make Forest parameters serializable and/or add Forest function wrappers for Beiwe to call.
The question is whether this code belongs in Forest which would require Forest to know about Beiwe and follow changes to its code or should Beiwe serialize parameters itself since it knows exactly what it needs. Also, I think this serialization layer would be helpful to have in Beiwe in case there's ever a need to use another external library that we has no control over.

@hackdna Hassan wants this picked up, getting forest working on the servers again.  I don't think anything internal to Forest needs to change, just this addition.
Regarding your prior question Ilya, the code needs to be inside Forest because the concept is (eventually) for Beiwe to allow selecting a version (a commit) of Forest.  I need some code or data that I can consume to make the website provide appropriate parameters for that version of the forest tree.
My proposal at this point is that we make a new file that contains some well defined classes and some instances of those classes.  I will assist whenever this needs updates but unless new UI needs come up it should be sufficient.
After putting this together I'm realizing this is not secure - the server is reaching to a github repository file for code to execute.  But also this is code that will install the target library so ... it doesn't matter? maybe?
I don't have time immediately to translate this into like a well specced data-only file that we parse. @GeorgeEfstathiadis  Can you do that? Take my untested-probably-broken-but-you-get-the-idea code below, and translate it into .... some decent YAML structure....?.  (Json does not allow comments, that seems kinda important, honestly it just needs to be an editable, human readable file that defines properties I can look at.
After that look at the needs of the existing trees, I need to know the current UI elements I will need for the website - do we need dates, datetimes, lists of strings, strings, booleans etc.  On the UI side (per-type) do we need dropdowns for strings, checkboxes (dropdowns?) for booleans, raw string entry, date picker, date-time picker etc.
Another topic is how and where should we validate that the spec matches the parameters for the target forest function that is run, and where/when do we run any such validation.
from typing import List

class BeiweForestConnector:
    target_function = None

# and then some classes of types of input options plus
class BeiweParameter:
    pass

class BeiweList(BeiweParameter):
    # beiwe website displays an error if any of these are not defined
    type = None
    ui = None
    display_name = None
    default = None

# and then some subclasses that are like

class MyTree(BeiweForestConnector):
    target_function = "fully.import.path.to.my_tree's.function"  # needs to be a string

    # a list
    my_list_of_ints = BeiweList()
    my_list_of_ints.type = int
    my_list_of_ints.default = [31,13,8,255]
    my_list_of_ints.ui = "json_textfield"
    my_list_of_ints.display_name = "The List of Ints (see MyTree documentation)"

    # an int
    revolutions = BeiweInt()
    revolutions.range = range(1,10)
    revolutions.default = 3
    revolutions.ui = "slider"
    revolutions.display_name = "Revolutions"

    # a boolean
    run_in_reverse = BeiweBool()
    run_in_reverse.default = False
    run_in_reverse.ui = "dropdown"
    run_in_reverse.display_name = "Run Analysis in Reverse "

@biblicabeebli I am not sure what you are trying to do with this code or what I should build with it. Where is this code supposed to be placed? Could you provide some more information on how this should be implemented?

Thank you for the additional info @biblicabeebli. It looks like there are two separate issues: argument serialization for running Forest using Celery (current bug) and Forest version selection at runtime in Beiwe (potential future feature).
We should probably postpone dealing with the latter until the need and the requirements are more clear (see https://en.wikipedia.org/wiki/You_aren't_gonna_need_it) and concentrate on the current issue in the meantime.
I think we can fairly easily solve this by inheriting from int or str. For example:
from enum import IntEnum
class Frequency(IntEnum):
    """This class enumerates possible frequencies for summary data."""
    HOURLY = 1
    DAILY = 24
    HOURLY_AND_DAILY = 0
    THREE_HOURLY = 3
    SIX_HOURLY = 6
    TWELVE_HOURLY = 12

then we can do:
>>> import json
>>> json.dumps(Frequency.HOURLY)
'1'

Should George and I create a branch with these changes for testing in Beiwe?

Woops I'm delnquent on updating my active issues this week, and you may have put in a bit of unnecessary work.
I just today got through the... crap that was in the way on the beiwe backend to run more recent versions of forest, as well as load the package on the frontend web servers. Current develop jasmine should work on the staging server, have not tested sycamore or ... the other one, but have not added oak.
As part of this work I scrapped the json parameter serializing. I know in principle there are security concerns using it unsafely, but we will just use pickle - we are literally planning to build a system that downloads a target version of a codebase and runs it, pickle isn't the problem.
I'm at the end of my week and a bit fried, I was planning to review this issue and the one about the json serializing and update both, but lost steam. I will get back to both issues monday(?) and get back to both of you on all fronts.
It also might be easiest if I make changes to forest since I am the consumer here, and then work with you two on review and make sure I haven't poked a hole somewhere.

(I am still actively working on code changes and cleanups in Beiwe Backend, not ready to sync yet.)

(last week had an emergency mobile bug that needed my attention, running through my github issue)

I am going to continue with the method I am using, e.g. pickle over json.
IntEnum definitely solves A serialization problem, but there are code accesses of the form my_frequency_enum.value, so code still fails to run. Its best if I make the effort to avoid code-level changes, and that's already accomplished with pickle.
As long as there is an understanding that changing certain function signatures require cross-codebase review before it can be merged into develop (or main) I think we are ok. I will put together a branch that adds a comment, and anything else I come across that might need to be changed, for discussion and review when the beiwe task running is working on more than just sycamore.
Those functions are currently:
from forest.jasmine.traj2stats import gps_stats_main
from forest.oak.base import run as run_oak
from forest.sycamore.base import get_submits_for_tableau
from forest.willow.log_stats import log_stats_main

(The dynamic rendering of function signatures as parameters on the frontend is not an immediate requirement.)

On my branch, beiwe-taskrunner, I'm actually making use of the enums now because I need to separate out the daily files, so we are sticking with pickle.

FYI, this seems to work with no errors:
>>> from forest.constants import Frequency
>>> import json
>>> json.dumps(Frequency.DAILY.value)
'24'

Yes but that is because .value returns an integer. Frequency.DAILY returns... I think its a class called an EnumProperty? point is its not a json supported type, its a class.

I opened this issue, I believe this issue is resolved, so I'm going to close it.

Just to clarify, my previous comment was in response to:
"ntEnum definitely solves A serialization problem, but there are code accesses of the form my_frequency_enum.value, so code still fails to run."


[PDI-16337]-Spoon db dialog cache doesn't update value of database interface after changing db type

Now after selecting and changing database type, db cache will hold and update the correct value of database interface

Build Completed
:white_check_mark: This pull request has passed all validations.
Build Commands
mvn -B -fn -f dbdialog/pom.xml clean install && mvn -B -f dbdialog/pom.xml site

Cleanup Commands
mvn -B -f dbdialog/pom.xml build-helper:remove-project-artifact

Changed files
  dbdialog/src/main/java/org/pentaho/ui/database/event/DataHandler.java
  dbdialog/src/test/java/org/pentaho/ui/database/event/DataHandlerTest.java

Unit test coverage change
These statistics help you identify how your changes have affected the coverage of the following files. If a file is not in this list, then its coverage was not affected by your changes. To get some help interpreting these metrics, please refer to Jacoco's documentation.
org.pentaho.ui.database.event.DataHandler

Branch Change:  + .61%
Complexity Change:  + .62%
Instruction Change:  + .26%
Line Change:  + .32%

Build Completed
:white_check_mark: This pull request has passed all validations.
Build Commands
mvn -B -fn -f dbdialog/pom.xml clean install && mvn -B -f dbdialog/pom.xml site

Cleanup Commands
mvn -B -f dbdialog/pom.xml build-helper:remove-project-artifact

Changed files
  dbdialog/src/main/java/org/pentaho/ui/database/event/DataHandler.java
  dbdialog/src/test/java/org/pentaho/ui/database/event/DataHandlerTest.java

Unit test coverage change
These statistics help you identify how your changes have affected the coverage of the following files. If a file is not in this list, then its coverage was not affected by your changes. To get some help interpreting these metrics, please refer to Jacoco's documentation.
org.pentaho.ui.database.event.DataHandler

Branch Change:  + .61%
Complexity Change:  + .62%
Instruction Change:  + .28%
Line Change:  + .32%

@pamval Could you ,please, take a look ?


Union type inference lost in callback in else if clause

TypeScript Version:  2.9.0-dev.20180418

Search Terms:
infer callback lost null union
Code
My attempt at a minimal reproduction - someone could probably do better:
function takeString(s: string): string {
  return s
}

const x = {
   foo: Math.random() > 0.5 ? "hello" : null
}
if (x.foo === null) {
  console.log("bar")
} else if (["hello"].some(e => e === takeString(x.foo))) { // <-- error here
  console.log("foo")
}

Expected behavior:
No error
Actual behavior:

Argument of type 'string | null' is not assignable to parameter of type 'string'.
Type 'null' is not assignable to type 'string'.

Playground Link: link
Related Issues:

It is working as intended, and the issue is the expression/lambda, not the else-if. The compiler has no guarantee that .some() will call your lambda immediately, so theoretically the value of x.foo could change in the meantime.
A solution would be to have an else block, then assign the correctly typed x.foo to a local const variable and pass that to the function.
https://github.com/Microsoft/TypeScript/issues/7719#issuecomment-202684512

Ah of course, thanks!
Although I should point out that this also fails when the field is readonly. So perhaps there is room for improvement here?

The readonly modifier is not part of the actual type of the foo property, unfortunately. The readonly modifier applies to the interface and declares that the property foo is read-only. As an unfortunate result you can just pass a readonly interface to a method accepting a mutable version and modify the object:
interface ReadonlyTest { readonly foo: string; }
interface MutableTest { foo: string; }

function mutateTest(test: MutableTest): void {
    test.foo = 'oh no!';
}

const readonlyTest: ReadonlyTest = { foo: 'bar' };
mutateTest(readonlyTest);

See #11498


[POLL] Use one branch?

I have the idea of merging the master and project branches.
Now, with these two branches, the project and all the tags are in one branch, and the docs are in another.
Pros:

Easy to make diffs, as there is nothing else in the project branch besides the actual project.
Cons:
No easy way to make PRs, since we need two PRs, one per branch, to make a new version.
(Solution: My bot runs the new-version script so it updates both branches automatically.)

The other possibility is to have a directory for the project, and the docs in the root dir, all in the same branch.
Pros:

Easier PR, greenkeeper et al. or users could make an actual useful PR without messing with multi-PR setups.
Cons:
The diffs are now not clean, since other things change besides the project code. A possible solution might be to somehow get a diff of only a dir in the repo(?).

If you are interested, have experience or an opinion, please comment here.
You can also vote:  🎉 for two branches, 🚀 for one branch.

If you already have to use a script to automate diffs, it seems like moving to a single branch would potentially improve your workload from greenkeeper etc, while at worst not making your workload worse (a script that only diffs a sub-directory). Seems like it's worth a try anyway? You could make another repo maybe to give it a try for a version or two and see how it goes? Either way, I find this repo super useful, so thanks :-)

Indeed I made a test repo. Diffing a dir is fine for making a patch, but I don't know that there is away to get the compare view on github for a specific dir. And I want to keep that compare view.

hmmm I use that compare view also. Maybe solveable with a policy - like all non-sample-app changes are always made in tags between RN versions? That would reduce utility of compare view to only single version gaps though. May not be possible... Or maybe docs are in a non-default branch, or in a fully separate repo and they just cross-reference?

Docs in a non-default branch makes it hard for people to find the links, since it would be a link to the list of links, kinda sucks.
I also thought of two repos, but that is basically the same as two branches, and probably two branches are easier to handle than two repos.
The only thing I can think of for one branch is if i find another service to do the compare view, and not github, so it would be a link to some diff service that would support dirs, or I keep it as is and just rely on my own build bot to do the commits, instead of greenkeeper.
Some more investigation is needed, and that's why I made this issue, so hopefully, we find a good solution. It's a very micro-optimization problem :p

Docs in a non-default branch makes it hard for people to find the links, since it would be a link to the list of links, kinda sucks.
I also thought of two repos, but that is basically the same as two branches, and probably two branches are easier to handle than two repos.

To me, all the above and this is the same as actually saying "two branches is not easier to handle than two repos" :-)
But this:

It's a very micro-optimization problem :p

...more than anything. The repo is already really really useful as is - even if for whatever reason you are having a Real Life (tm) and tags pile up, it's very easy to clone and it is reliable when you run the new version script locally to do self-service.

That is true. There will never be a problem since we are purging. So running it locally on a fork will always generate exactly what is needed. Maybe I'll just leave things as they are, and just make sure I generate the commits quickly after the release of a version, and done :)

I decided to use the master branch for doc, and have the project (and maybe more branches in the future) for the actual code and diffgen.


Type checking for lists incomplete/looping

Arguments that are expected to be lists are associated with a type_error(list,...) in case the argument is neither a list nor a partial list.
prolog> ?- catch((L=[a|a],sort(L,Xs)),error(E,_),true).
error: exception thrown: a

Expected: E = type_error(list,[a|a])
prolog> ?- catch((L=[a|L],sort(L,Xs)),error(E,_),writeq(success)).
fatal runtime error: allocator memory exhausted
Illegal instruction (core dumped)

Expected:
success
E = type_error(list,[a,a,a,...])

To solve this once and for all, consider to implement '$skip_list'(N, Xs0, Xs) where N will be unified with the number of skipped elements, Xs0 is the term to consider, Xs will be unified with a suffix of the list that is

a variable, in case Xs0 is a partial list
[] in case Xs0 is a list
an "infinite list", in case Xs0 is an infinite list
any other term in case Xs0 is neither a list nor a partial list nor an infinite list.

Example:
 ?- '$skip_list'(N,non_list, Xs).
 N = 0, Xs = non_list

Best is Brent's algorithm. It is simpler and always faster than Floyd.
Even better, would be a
?- '$skip_max_list'(N, Max, Xs0, Xs).`

where Max is the maximal number of elements to be skipped. This avoids visiting Xs0 too deeply.

@mthom: Please note you always forget the error(_,_) around the actual error_term. With this extra-level you can add implementation specific information to the exception. See 13211-1:1995 7.12.1


make draft of moscot kernel

This is a draft for the moscot kernel, as I imagine it to be best implemented from a moscot POV
There are not tests yet / no pre-commits, etc.
closes #982

@MUCDK, are you sure you used based off of the correct version of master? Why are there changes to 110 files? Especially ones that don't have anything to do with this PR. Please rebase correctly s.t. the suggestion can be followed and assessed easily.

replaced by #987


Changed picasa.rb to work as previous version and added authentication

Pass in :password option to automatically authenticate which will "upgrade" the default values (e.g. album visibility).
As a side-note:

Changed it to automatically return ["feed"] as it will always be wrapped in a ["feed"] when a valid response is written by the Google API.
Removed web_albums.rb as it seemed not be used anymore?

Yes of course.
And about the API I was also looking into this especially because I want to use methods as .map and .reject. Currently I'm looking into using OpenStructs. Once I'm happy with it I'll send another Pull request


GitHub Copilot Chat is not available in vscode when I log in.

VS Code Version: 1.86.2
OS Version: 13.4.1 (c)（22F770820d）
Logs: None

Steps to Reproduce:

Open normal vscode.
Install extension GitHub Copilot Chat.
Log in.
Open Chat tab.
Confirm that "Start 30-day Free Trial" is displayed.
Confirm that GitHub Copilot Chat is not available.
Click on the link to go to `https://github.com/settings/copilot
Verify that the message You have an active Copilot subscription. is displayed.

After installing Visual Studio Code Insiders and installing and logging in to the GitHub Copilot Chat extension, GitHub Copilot Chat was available.
Why is GitHub Copilot Chat not available in regular Visual Studio Code?

I have the same Problem. The Pre-Release version has the same Problem.

I might found something.
I'm logged in into 2 GitHub accounts
In the Log for Copilot chat it says that I'm logged in with my first one (my second one has the subscription).


Weird behaviour in presence of fromEnum, !!

Package name: old-time
Install it from here: https://github.com/psibi/old-time-eta
I'm facing a weird issue - Basically with the combination of fromEnum, !! - it's picking up the next element in the list. I have not been able to produce a minimal reproducible example for the issue, but I can reproduce it deterministically in the ported working library I'm currently working on. I don't know if I'm missing something basic here or if it's a bug in the compiler.
A test code which represents the bug:
module Main where

import System.Time

main :: IO ()
main = do
    let x = TOD<PHONE_NUMBER><PHONE_NUMBER>00 :: ClockTime
    print $ show x

On executing it, this produces:
@sibi::jane { ~/scripts }-> java -classpath Out.jar ghcvm.main
CalendarTime {ctYear = 2016, ctMonth = October, ctDay = 23, ctHour = 22, ctMin = 32, ctSec = 3, ctPicosec = 0, ctWDay = Sunday, ctYDay = 297, ctTZName = "India Standard Time", ctTZ = 19800, ctIsDST = False}
"Sun Nov 23 22:32:03 India Standard Time 2016"

Even though ctMonth = October, it prints Nov in the second
line. If you trace the execution, it doesn't make sense. I have
modified the show instance for ClockTime to demonstrate this
behaviour. You can see the show instance from System.Time module to
follow the workflow.
Any idea why this is happening ? This has killed around 4 hours of my day :(

It turns out this was an off-by-one error. There's a primitive operation that converts a data constructor to a tag and that tag was one off what it should be. Fixed on master. Make sure you do a cleaninstall. We probably would've encountered this sooner if we had tests going. Let's try to get that setup this week.
Since we're in testing phase and the code we're porting is known to work in Haskell, you can more often than not assume it's a compiler bug if the desired behaviour isn't achieved. Feel free to report sooner as opposed to later - the worst thing that can happen is that it's a trivial Haskell fix which isn't a big deal.


VocalSet samples have a wrong sampling rate

The samples provided in datasets_fullband/clean_fullband/VocalSet_48kHz_mono have a reported sampling rate of 48kHz.
The real sampling rate, however, is 16kHz, which results in a mickey mouse type voice (i.e. a pitch 3 times higher than originally).
To reproduce with sox:
$ soxi vocalset_female2_scales_vocal_fry_scales_vocal_fry_48kHz.wav

Input File     : 'vocalset_female2_scales_vocal_fry_scales_vocal_fry_48kHz.wav'
Channels       : 1
Sample Rate    : 48000
Precision      : 16-bit
Duration       : 00:00:27.07 = 1299432 samples ~ 2030.36 CDDA sectors
File Size      : 2.60M
Bit Rate       : 768k
Sample Encoding: 16-bit Signed Integer PCM

// This sounds awful:
$ play vocalset_female2_scales_vocal_fry_scales_vocal_fry_48kHz.wav
// With sampling rate of 16kHz this sounds normal:
$ play -r 16k vocalset_female2_scales_vocal_fry_scales_vocal_fry_48kHz.wav

Would you please fix this issue at your early convenience??  many thanks.

zenodo VocalSet would be helpful.

@nicriverhoo you could fix this issue with SoX sampling rate conversion. f.e you could run such bash in vocalset directory:
find ./ -name "*.wav" -exec sox -r 16k {} ../singing_voice_16k/{} \;


Readme edits, gitattribute and license fix

Renamed readme to README as per the usual standard & it also broke hyperlinks in the outer readme, change the file name so that in case there is another link it should keep working.
Added license fields
Added linguist ignore to the shell script
Added a note for wallet path

interestingly enough, my local has README but repo still has readme


code-server: 3.6.0 -> 3.8.0

Motivation for this change
Updates code-server to 3.8.0.
3.8.0 removes the need to run VSCode patches and fetch submodules, which simplifies the script a bit.
I added support for Darwin, tested on macOS 10.15.7 -- It required patching the install scripts of a few packages that aren't needed at runtime. I used patch for this rather than sed because it seemed easier to review the changes, but let me know if one or the other is preferred and I can switch it out if necessary.
Things done

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS
[x] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[ ] Fits CONTRIBUTING.md.

@tscholak Thanks for the help getting this package to work on Mac! Tagging you here in case you're still interested.
Also @contrun asked for an update to 3.8.0 on this PR https://github.com/NixOS/nixpkgs/pull/101628

@tscholak Thanks for the help getting this package to work on Mac! Tagging you here in case you're still interested.
Also @contrun asked for an update to 3.8.0 on this PR https://github.com/NixOS/nixpkgs/pull/101628

@dguenther yes, definitely interested, thanks for pushing for 3.8.0!

@dguenther yes, definitely interested, thanks for pushing for 3.8.0!

Squashed the commits down, thanks all for the review!

Squashed the commits down, thanks all for the review!

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110652 run on x86_64-darwin 1

1 package built:

code-server

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.
Result of nixpkgs-review pr 110652 run on x86_64-darwin 1

1 package built:

code-server


drivers: lora: sx127: convert to spi_dt_spec

Convert sx127 driver to use spi_dt_spec helpers.
Signed-off-by: Bartosz Bilas<EMAIL_ADDRESS>

This is alreayd part of #40625

Right, I haven't noticed that one.


Caused by: java.lang.ClassNotFoundException: org.elasticsearch.hadoop.mr.EsOutputFormat

What kind an issue is this?

[ ] Bug report. If you’ve found a bug, please provide a code snippet or test to reproduce it below.
The easier it is to track down the bug, the faster it is solved.
[ ] Feature Request. Start by telling us what problem you’re trying to solve.
Often a solution already exists! Don’t send pull requests to implement new features without
first getting our support. Sometimes we leave features out on purpose to keep the project small.

Issue description
Description
Steps to reproduce
Code:
Test/code snippet

Strack trace:
Stack trace goes here

Version Info
OS:         :
JVM         :
Hadoop/Spark:
ES-Hadoop   :
ES          :

Feature description

Sorry but the without any information, I'm closing the issue as invalid.


Update CI badge

Questions
Answers

Description?
Update CI badge. Replace Travis by GitHub

Type?
improvement

Thanks @matks!


Dockerfile based build : Empty reply from server

#I can't seem to get the Docker-based build to respond to any http requests. I'm using a build of the latest 1.7.4-rc.6 using my modified Dockerfile, that otherwise matches the standard one but allows me to specify a tag to build.
Reproduction Steps:

Build

$ git clone https://github.com/Megalithic-LLC/janus-dockerfile.git
$ cd janus-dockerfile
$ docker build --build-arg=JANUS_TAG=1.7.4-rc.7 -t janus .

Configure runtime env vars:

$ vi janus.env

DATABASE_DSN=mongodb://<IP_ADDRESS>/janus
REDIS_DSN=redis://<IP_ADDRESS>:6379
SECRET=password
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
DEBUG=true
LOG_LEVEL=debug

Launch Janus

$ docker run --env-file janus.env -i -p 8080:8080 -t janus
{"@timestamp":"2017-03-01T17:44:59.246556501Z","@version":"1","level":"debug","message":"Connected to mongodb","type":"Janus"}
...
01T17:44:59.250617897Z","@version":"1","level":"info","message":"Listening on :0","type":"Janus"}

Try and talk to it

$ curl -iv -X POST -H "Content-Type: application/json" -H "Accept: application/json, */*" -d '{"username":"admin","password":"admin"}' http://localhost:8080/login

*   Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
> POST /login HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.43.0
> Content-Type: application/json
> Accept: application/json, */*
> Content-Length: 39
>
* upload completely sent off: 39 out of 39 bytes
* Empty reply from server
* Connection #0 to host localhost left intact

curl: (52) Empty reply from server

Janus version: 1.7.4-rc.6
OS and version: standard Dockerfile (golang:1.8-alpine)

Hi @drauschenbach,
Thanks for reporting that, it was a mistake that I've made, the PORT environment variable should always be defined (which obviously shouldn't be necessary). I'll make a fix to have a default value and also I'll add the PORT env to the docker-compose.yml
Could you please test if setting the PORT=8080 variable to you env file works?

That works - thanks! I suppose we could close this bug by updating the Dockerfile and docker-compose.yml files to reflect what is needed. I got the fix in on my end here: 1efdf0f, and it checks out.

OK, the fix is merged. Closing in favor or #92