Not possible to add state.resolve from $stateChangeStart event

Overview:
Sometimes it's desirable to add state resolves on the fly, instead of needing to add them to all states beforehand. For example, a resolve that verifies a user is authenticated or fetches the user from an API.
It's possible to do this with $routeChangeSuccess using the following code:
// @see http://stackoverflow.com/a/18245378/1738217
function authenticate() {
    if ( user.isAuthenticated ) {
        return;
    }
    // simulate deferred
    return $timeout(function() {
        user.isAuthenticated = true;
    }, 3000);
}

$rootScope.$on( "$routeChangeStart", function( e, next ) {
    next.resolve = angular.extend( next.resolve || {}, {
        __authenticating__: authenticate
    });
});

However the same is not possible with $stateChangeSuccess. This is because the event is broadcast with to.self, see this line. This means if you add a resolve in the $stateChangeSuccess event, you are actually adding on to.self.resolve which is never considered for resolve.
_Related:_
https://github.com/angular-ui/ui-router/issues/1153

Need it so much. Very handy. +1

I'd love to see this as well. I wasn't able to make @christopherthielen's workaround work, though I was scratching my head as to why. Perhaps it depends on the nesting. Stepping through it, it appears the decoration has to happen before the state building is queued, for whatever reason. No hooks to work with there so for now I wrapped $stateProvider.state, decorating the config before passing it onto the original implementation. If anyone has a better solution I'd love to hear it.

+1. That would be really helpful!

also struggeld with this problem because some states had a defined resolve object and some did not.
Took me forever to figure out why this is not working with all states:
if (!toState.resolve) { toState.resolve = {} };
toState.resolve.pauseStateChange = [ '$q', ($q: ng.IQService) => {...})];

Now i use the decorator suggested by @christopherthielen ! Thanks :)
But it should be possible to extend the resolve method without this "hack"! :+1:

Thanks all for the comments, this is gold! :) :+1:

We've added this capability to the 1.0 code:
https://github.com/angular-ui/ui-router/blob/feature-1.0/src/transition/transition.ts#L162-L172
app.run(function ($transitions) {
  // register global transition start handler
  $transitions.onStart({}, function($transition$) { // inject the Transition instance
    $transition$.addResolves({
      newResolve: function(MyService) {
        return MyService.someAsyncThing();
      }
    });
  });
});

@christopherthielen I tried to use this method for ACL, but I'm running into a problem prevent route change if route/state rejected.
If I use onStart, I can't access $state$ (toState). $state$ is not exposed and error occurs.
If I use onEnter, then I don't seem to be able to prevent the route from changing.
    $transitions.onEnter({ from: '*', to: '*' }, function($state$, $q, acl) {
        var requiredPermissions = getRequiredPermissions($state$);
        return acl.ready().then(function(acl) {
            if (!acl.can(requiredPermissions)) {
                // Rejection seems to prevent individual state/view change,
                // but doesn't prevent route change
                return $q.reject({ reason: 'acl' });
            }
        });
    });

I haven't tried using addResolves yet. I previously had this working using ngRoute with resolves. The transition handler seems to be more appropriate for this case.

Tried using addResolves, but that doesn't seem to be doing it either:
        $transition$.addResolves({
            controllerAcl: function() {
                console.log('running resolve');
                var deferred = $q.defer();
                acl.ready(function(acl) {
                    if (acl.can(requiredPermissions)) {
                        console.log('resolved');
                        deferred.resolve(toState);
                    } else {
                        console.log('rejected');
                        deferred.reject({ reason: 'acl' });
                    }
                });
                return deferred.promise;
            }
        });

I get no console logs.

If I use onStart, I can't access $state$ (toState). $state$ is not exposed and error occurs.

You should inject $transition$ and use var toState = $transition$.to()

If I use onEnter, then I don't seem to be able to prevent the route from changing.

Odd, that should stop the state change...

@christopherthielen

should inject $transition$ and use var toState = $transition$.to()

Yep, that works. Though, now I'm wondering why to/from are functions.

Odd, that should stop the state change...

After some testing I found that if I use ui-sref then the route properly never changes to the rejected route, but when I use href or just type the rejected route into the location bar, the state change is rejected (views remain on previous states), but the URI in the location bar remains the rejected route. I would have expected the previously valid route to overwrite the rejected URI in the location bar. Is there another step I need to do to prevent directly navigating to invalid routes (those where I return a reject from onStart)?

Also, $stateChangeError doesn't fire when a rejection is returned from onStart

Yep, that works. Though, now I'm wondering why to/from are functions.

The to/from object defines the Transition-matching criteria.  They are used to determine if the hook should be applied to a transition or not.  You can use a glob or a function.  The function can inspect the to state or from state to determine if the hook should be applied to the transition.
See how this hook works: https://github.com/ui-router/sample-app/blob/master/app/routerhooks/redirectTo.js

when I use href or just type the rejected route into the location bar, the state change is rejected (views remain on previous states), but the URI in the location bar remains the rejected route.

I think you are describing #2455 which is fixed in master

Also, $stateChangeError doesn't fire when a rejection is returned from onStart

Did you re-enable the deprecated state events by adding ng1/stateEvents.js?
See the release notes for what I'm referring to: https://github.com/angular-ui/ui-router/releases/tag/1.0.0alpha0

All state events, (i.e. $stateChange* and friends) are deprecated and disabled by default; re-enable them by including the ng1/stateEvents.js file, and depend on the ui.router.state.events angular module in your application.

The to/from object defines the Transition-matching criteria.

Unless I misunderstand your answer, I didn't mean the matching criteria ({ to: '*', from: '*' }), but rather the to() method on injectable $transition$; why $transition$.to() and not just an object at $transition$.to?

I think you are describing #2455 which is fixed in master

I'm not sure how to access that fix, unless it gets merged into 1.0.0alpha0. In any case, I made the modification specified in https://github.com/angular-ui/ui-router/commit/25e0c0409da6544a1173f8cba880aa88def89b9c locally, but doesn't fix either use case of HREF on an anchor or direct URL manipulation in the address bar. In both cases, the rejected URL remains in the address bar.
I noticed another side effect: after I click on an HREF link to a rejected route, the address bar changes to the new route and the current state remains, but then if I click on a UI-SREF link to go to the state I'm currently on (though the address bar says otherwise) the address bar doesn't change back to the current valid route, because it thinks I'm already there, which also raises an onError. If I refresh while the rejected route is in the address bar, I'll get no view at all (I'd expect the "otherwise" route).

Did you re-enable the deprecated state events by adding ng1/stateEvents.js?

Nope. You're right. I read that right after I posted.
It seems the alternative is using onError along with $transition$.error(), but $transition$.error() is just giving me undefined and I need to be able to access the passed rejection object.

why $transition$.to() and not just an object at $transition$.to?

Oh, I see... it's just an accessor method so we can change where the value comes from in the future without disrupting the API.

I'm not sure how to access that fix, unless it gets merged into 1.0.0alpha0.

It's merged into 1.0 because master is the 1.0 code.  The 0.2.x code is now in legacy

doesn't fix either use case of HREF on an anchor or direct URL manipulation in the address bar. In both cases, the rejected URL remains in the address bar.

Ah yes, you're right.  Would you mind opening a new ticket for that issue?  Here's a plunk http://plnkr.co/edit/9uVnia9Vikx6Dcxgaz1P?p=preview

$transition$.error() is just giving me undefined and I need to be able to access the passed rejection object.

Transition.error() is related to Transition.valid().  When a Transition is invalid (it means the transition cannot even be started), .error() returns a message explaining why the object is invalid and could not be started.  That is different from a valid transition which has started, but been rejected due to rejecgted hooks or resolves.
http://angular-ui.github.io/ui-router/feature-1.0/classes/transition.transition-1.html#error

I see you're implementing a global ACL.  One of the primary drivers for the design of the transition hooks was adding custom global behaviors like this.  I'd like the hooks to be sensible for you and your use case, and if they are not, I want to understand where the gaps are.  Where would you like to check for your ACL transition rejection?
In that same plunk I added a global error hook: http://plnkr.co/edit/9uVnia9Vikx6Dcxgaz1P?p=preview
  $transitions.onError({ }, function($error$) {
    console.log("captured error: ", $error$);
  });```

It's merged into 1.0 because master is the 1.0 code. The 0.2.x code is now in legacy

Forgive me, I'm fairly new to git, so what exactly should I tell bower to download, because I tried master, but it just gives me the 4 files for "bower package manager support". These are the options it gives me:

Available versions in git://github.com/angular-ui/angular-ui-router-bower.git: 0.2.18, 0.2.17, 0.2.16, 0.2.15, 0.2.14, 0.2.13, 0.2.12, 0.2.11, 0.2.10, 0.2.9, 0.2.8, 0.2.8-bowratic-tedium, 0.2.7, 0.2.6, 0.2.5, 0.2.0, 0.0.1

.

Would you mind opening a new ticket for that issue?

#2611

In that same plunk I added a global error hook

It looks like your plunk rejects with { reason: 'nope' }, but $error$ in onError contains {type: 5, message: "The transition was ignored.", detail: undefined}. I need that rejection object/message in $error$, but if $error$ is already a useful thing, then perhaps a property on it, such as $error$.rejection, which would contain either whatever is passed to $q.reject() or whatever else can be returned from an onEnter/onStart to cancel it.
In my current use case I have two separate hooks corresponding to two different contexts of ACL, but they both run and both could fail, and either failure requires the same redirect, and if both fail at the same time I don't want two redirects to occur. Previously, when using $stateChangeError, it would be called only once and I could check which one of the failures was raised, and redirect once. So, will onError be called once with the error that caused it, or will it be called once for every onStart/onEnter that rejected? If it is called more than once then I'd have to somehow make sure there isn't a double redirect.

what exactly should I tell bower to download

1.0.0alpha0 is a released build. We don't publish daily snapshots, so you'd have to build it yourself
git clone https://github.com/angular-ui/ui-router.git
cd ui-router
npm install
grunt build

Then use angular-ui-router.js from build/  (By the way, I recommend switching from bower to npm)

It looks like your plunk rejects with { reason: 'nope' }, but $error$ in onError contains {type: 5, message: "The transition was ignored.", detail: undefined}.

Click the link labelled "Click this Link" to see the onEnter rejection happen.

So, will onError be called once with the error that caused it, or will it be called once for every onStart/onEnter that rejected?

The hooks are run as a chain, in a specific order (onBefore -> onStart -> onExit -> onRetain -> onEnter -> onFinish -> onSuccess/onError).  A transition can only be rejected by one hook.

By the way, I recommend switching from bower to npm

I do use npm for tools and libraries related to building my app, but I use bower for libraries that will be actually included in the app, because bower offers the main property, which allows me to bower install and then just use it without having to find which file needs to be included and manually adding an include (https://github.com/ck86/main-bower-files). AFAIK the main property in package.json doesn't allow an array and typically points to a nodejs file (whereas I'm doing JS in the browser). If you know of a way to switch from bower while maintaining this automation functionality, that would be great; I'm not married to bower otherwise.

Click the link labelled "Click this Link" to see the onEnter rejection happen.

Yeah, I must have been looking at the ignore error for the state that was already applied. I do see that $error$ is decorated with the rejection object. This will work fine for my purposes, but for others: what if the rejection is a string (or something else), like how many angular examples show $q.reject('some message), how do you access the value then?

The hooks are run as a chain, in a specific order (onBefore -> onStart -> onExit -> onRetain -> onEnter -> onFinish -> onSuccess/onError). A transition can only be rejected by one hook.

So, I take that to mean that if one onEnter rejects a route, any other onEnter's (for the same route/state change) won't even run. That's fine.

If you know of a way to switch from bower while maintaining this automation functionality

I've moved to ES6 modules and a bundler (webpack, etc), but now we're quite off topic ;)

what if the rejection is a string (or something else), like how many angular examples show $q.reject('some message), how do you access the value then?

The same way: as $error$. The transition rejection (whatever it is) is provided to the onError hook as  $error$

So, I take that to mean that if one onEnter rejects a route, any other onEnter's (for the same route/state change) won't even run.

Correct

Closing since adding resolves on the fly is possible in 1.0

Can you please post an example using .addResolvable since .addResolves doesn't appear to be available anymore

See: https://ui-router.github.io/ng1/docs/latest/classes/transition.transition-1.html#addresolvable
transitionService.onBefore({ to: state => state.data.dostuff }, trans => {
  trans.addResolvable({ token: 'myResolve', deps: ['MyService'], resolveFn: MyService => MyService.getStuff() });
});

@christopherthielen thank you! That example helps! I think I was frustrated and had to bounce around to see the constructor implementation and have a tough time reading the font face or something.  Still haven't quite figured out how to navigate everything.  Probably my impatience

@stephengardner in the past, you HAD to use the Resolvable constructor, but that's not good API for end users:
import { Resolvable } from "angular-ui-router";

...
transition.addResolvable(new Resolvable('foo', ...));

In rc.1 I remembered to allow addResolvable to take a ResolvableLiteral which is a plain object, as shown above. 👍
I'll add an example to the docs.

Adding my route authentication as an example,  Thanks again for the clarification @christopherthielen
This might help someone who was in my position.
/**
 * Authentication Resolvable - if I add  "authenticate" to a route params, this will make sure the user is logged in
 * before proceeding.
 */
$transitions.onStart({}, (trans) => { // on any route, do the following...
  let next = trans.to(); // get the state and its params
  if (next.authenticate) {
    trans.addResolvable({
      token : 'authResolve', // the token can be anything, here, we never actually use it in this specific case
      deps : ['$state', 'Auth', '$q'], // inject what I need
      resolveFn: ($state, Auth, $q) => {
        return new $q((resolve, reject) => { // make sure this is a promise, in order to delay the route
          let onUserLoggedIn = () => {
            console.log('[Auth Service] the necessary *authenticate* state PASSED the resolvable, continue on!');
            return resolve();
          };
          let onUserLoggedOut = () => {
            console.log('[Auth Service] the necessary *authenticate* state FAILED the resolvable, going to login page!');
            $state.go('login');
            return reject();
          };
          // this can be substituted for any promise, observable, or async operation, here I'm using an observable
          Auth.isLoggedInAsync$().subscribe((isLoggedIn) => {
            if(!isLoggedIn) return onUserLoggedOut();
            return onUserLoggedIn();
          })
        })
      }
    }); }
});

@christopherthielen Thank you for the example. I use same code like this:
transitionService.onBefore({ to: state => state.data.dostuff }, trans => {
  trans.addResolvable({ token: 'myResolve', deps: ['MyService'], resolveFn: MyService => MyService.getStuff() });
});

It works fine but when I try to add 'myResolve' as a dependency to my page controller, it throws unknown provider exception.

@arashsoft is the "page controller" a routed controller?  In other words, is it found inside a state definition?


Change EFIS out to GPIO?

Is there a way to change the EFIS out to use the GPIO serial?  /dev/ttyAMA0
I have a TTL-Serial converter that I used SerialOut branch last year to get working. Notice the branch got merged into the main file now.
I looked in network.go @ line 243 and thought I could change it there.
	serialDev := "/dev/serialout0" //FIXME: This is temporary. Only one serial output device for now.
*Edit = yes changing to "/dev/ttyAMA0" worked.

This is still working with latest 1.5b2 release.  Also discovered GPS still works too (didn't use it before, but now I am).

How reliable has it been for you?

So far so good. I'm only ground testing right now, hope to be flying in the next month. But over a year working so far. Helps with the GRT EFIS, as I can use a USB instead of a serial port. I was under the assumption that I couldn't use GPS with serial out, but it is working fine. Maybe because I hardcoded the serialDev deivce in there.
Using an Amazon USB to TTL Serial Cable. The only thing if you buy the AHRS chip, it sits overs the TTL pins, so had to make mods for that.


Incorrect instructions link

The current instructions say:  Environments > [select an environment] > Settings > Integration > Manage document suggestions.
The actual link is:  Environments > [select an environment] > Settings > Integration > Document Management settings > Manage document suggestions.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: d19ecb2e-fd52-8bfe-87a9-3cc6039c5bd1
Version Independent ID: 1ffff37c-c73b-d07f-5312-7049730dfa90
Content: Enable document suggestions for Dynamics 365 for Customer Engagement apps - Power Platform
Content Source: power-platform/admin/enable-document-suggestions.md
Service: power-platform
GitHub Login: @jimholtz
Microsoft Alias: jimholtz

@correnasergent
Thanks for bringing this to our attention. Content has been updated.


programmatic interface to set pg config

We would like to configure postgres with startup configurations, for example
shared_preload_libraries = 'pg_stat_statements
this can be achieved today by manually editing generated postgres.conf (and restart to pick up the change)... or I guess subsequent ALTER setting config (on non postmaster pg configs) or maybe we can do this today with pg_ctl reload (which I think is already supported here) ... will research.
Probably (optionally) pass a HashMap into the function and then process around https://github.com/theseus-rs/postgresql-embedded/blob/1973b5849caaf910adaf4a99e38631e024e9d5c2/postgresql_embedded/src/postgresql.rs#L257
maybe its possible to chain .options() so we can just add '-c shared_preload_libraries='pg_stat_statements' string ... though I do not know if the current pg config builder is aware enough or if we have to munge strings direct here.
alternately we could support PG native env vars (ex. PGDATA) to control this. Maybe this already works if we start up in default without passing in any settings ... will research.
The end goal is to start a pg with custom pg configurations.

Hello @JimFuller-RedHat, thank you for the feature request.  From the description, it sounds like you are planning on spending some more time researching this.  I put together the start of something that may meet your needs; would you mind taking a look at #74 and letting me know what your thoughts are?

addresses perfectly ... thx ... maybe next time I will raise a PR (you were very fast!).

Please feel free to submit PRs if there are any changes / improvements you would like to see in the project

The changes for #74 have been released in version 0.10.1


How to set focus to a control after is busy

Hello,
your library is really cool.
Could you tell me how to set the focus to a control when IsBusy = false?
Is there a way to have a FocusAfterBusy property like the one in xceed toolkit?
Thank you.

Hi
Currently there is no property like that, but I'll add this feature in the upcoming weeks. However, if you give your control a name, then you can use [YourControlName.Focus()] after setting IsBusy=false.

Thank you for reply. I'm using MVVM (most of developers use it). A property  like FocusAfterBusy = {Binding ElementName Mycontrol} could be the best option. Thank you.

Hi
I added FocusAfterBusy property, You can use it now [ FocusAfterBusy="{Binding ElementName = MyTextBox}" ].

Thank you!!!!


#951 update system requirements

The readme should be improved with the minimum requirements.

Already updated in PR #955 .


iwlwifi fails to load firmware on stable kernel (5.4) and latest (5.6)

Describe the bug
iwlwifi fails to load the relevant firmware for my device (lspci):
28:00.0 Network controller: Intel Corporation Wi-Fi 6 AX200 (rev 1a)

This is the relevant dmesg output:
[    0.615495] stage-1-init: loading module iwlwifi...
[    0.636726] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    0.637809] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    0.637822] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    0.637823] cfg80211: failed to load regulatory.db
[    0.648177] Intel(R) Wireless WiFi driver for Linux
[    0.648178] Copyright(c) 2003- 2015 Intel Corporation
[    0.648223] iwlwifi 0000:28:00.0: enabling device (0000 -> 0002)
[    0.651723] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-52.ucode failed with error -2
[    0.651729] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-51.ucode failed with error -2
[    0.651733] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-50.ucode failed with error -2
[    0.651738] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-49.ucode failed with error -2
[    0.651743] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-48.ucode failed with error -2
[    0.651748] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-47.ucode failed with error -2
[    0.651752] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-46.ucode failed with error -2
[    0.651756] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-45.ucode failed with error -2
[    0.651761] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-44.ucode failed with error -2
[    0.651765] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-43.ucode failed with error -2
[    0.651770] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-42.ucode failed with error -2
[    0.651774] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-41.ucode failed with error -2
[    0.651778] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-40.ucode failed with error -2
[    0.651783] iwlwifi 0000:28:00.0: Direct firmware load for iwlwifi-cc-a0-39.ucode failed with error -2
[    0.651783] iwlwifi 0000:28:00.0: no suitable firmware found!
[    0.651799] iwlwifi 0000:28:00.0: minimum version required: iwlwifi-cc-a0-39
[    0.651815] iwlwifi 0000:28:00.0: maximum version supported: iwlwifi-cc-a0-52
[    0.651835] iwlwifi 0000:28:00.0: check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

To Reproduce
Use the following config with a Wi-Fi 6 AX200 controller (https://www.msi.com/Motherboard/MEG-X570-ACE/Specification to be more precise) on unstable NixOS
{
#...
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.initrd.kernelModules = [ "iwlwifi" ];
hardware.enableRedistributableFirmware = true;
hardware.enableAllFirmware = true;
hardware.firmware = [ pkgs.wireless-regdb ];
#...
}

Additional context
I'm really new to NixOS, so the above configuration might be a little bit redundant, or I have missed an option that is required.
This might be related to #68770.
Interestingly WiFi with the NixOS live install ISO (nixos-plasma5-20.09pre220217.39247f8d04c-x86_64-linux.iso) did work as expected.
Metadata
 - system: `"x86_64-linux"`
 - host os: `Linux 5.6.3, NixOS, 20.09pre221322.8686922e68d (Nightingale)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.4`
 - channels(root): `"nixos-20.09pre221322.8686922e68d"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

I had the same problem, and I fixed it by setting `hardware.enableRedistributableFirmware = true;.

@Philipp-M I suspect this is because the kernel module is already loaded in the initramfs, where the firmware is not yet available. Try removing the boot.initrd.kernelModules line, so that the module will be detected automatically in stage-2. Or do you need WiFi before boot for arcane reasons? :)

Indeed, just removing this line fixed the issue.
Thanks :)


Add integration tests (runtime-common)

We cannot use maven variables with this configuration.

The files in the script directory are outside maven scope.
The path to target in cloudbuild.yaml is relative to cloudbuild workspace whereas the maven propertie is absolute

Yes as the scripts directory grow it might be useful to create a maven module in the future to avoid to duplicate the configuration.


❓ Android devices multi-cams support

Question
From 3.0.0 lib supports Multi-cams for android. Could you please tell what devices better to use to test this?
What I tried
I tried One Plus 7T, it has a few cameras, but there is only one single back camera device.
VisionCamera Version
3.4.1
Additional information

[ ] I am using Expo
[X] I have read the Troubleshooting Guide
[X] I agree to follow this project's Code of Conduct
[X] I searched for similar questions in the issues page as well as in the discussions page and found none.

but there is only one single back camera device.
I feel like there's something wrong with your code. How did you get your device prop for camera view?

I use getAvailableCameraDevices to get all devices. And now it returns 2 devices, one front and one single back.

Hi.
VisionCamera has a very solid Devices API that is capable of detecting all Camera devices on your phone that are available for use in your app. Even USB Cameras. If there's a device missing in that list, it is pretty likely that this device is simply not available for use, and the vendor (Samsung, Huawei, One Plus, ...) just locked this and doesn't allow you to use this specific Camera device. In other words; if VisionCamera can't detect the Camera, there's nothing you can do about it. It's not even available in a native Android app (except for their stock Samsung/Huawei/... Camera app).
To confirm this, download the official Google example for Camera apps; camera-samples/Camera2Video and run it on your phone. If the Camera device is not in there either, then again, nothing you can do.
I'm sure that for specific devices such as telephoto or ultra-wide, they usually don't allow you to use those devices directly, but only in combination with other devices (e.g. a "dual-camera" consisting of a normal wide-angle and the ultra-wide-angle), because they only work like that.
Try logging all devices you get:
const devices = Camera.getAvailableCameraDevices()
devices.forEach((d) => {
  d.formats = null
})
console.log(JSON.stringify(devices, null, 2))

And if there's only one device on the back there then that's the only device third party apps can use. That's OnePlus' fault then.

See Multi-camera API and Multi-Camera Hardware Support documentation for more information.

Actually maybe this fixes this: https://github.com/mrousavy/react-native-vision-camera/pull/2073

Try 3.6.3 and let me know if the multi-cam now shows up for you. If you appreciate my efforts & dedication to VisionCamera, please 💖 consider sponsoring me on GitHub 💖 to say thanks. :)

@mrousavy  how can we use front and back cameras at a time when the back camera is open and we want to show our face as well with front camera? I am unable to use it in that way and no documentation is helpful in this


506 implementation of abiotic simple model docs

This PR describes the implementation of the abiotic_simple model.
Fixes #506
Type of change

[x] New feature (non-breaking change which adds functionality)
[ ] Optimization (back-end change that speeds up the code)
[ ] Bug fix (non-breaking change which fixes an issue)

Key checklist

[x] Make sure you've run the pre-commit checks: $ pre-commit run -a
[ ] All tests pass: $ poetry run pytest

Further checks

[ ] Code is commented, particularly in hard-to-understand areas
[ ] Tests added that prove fix is effective or that feature works
[x] Relevant documentation reviewed and updated

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.91%. Comparing base (0f840e9) to head (578e2ee).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #515   +/-   ##
========================================
  Coverage    94.91%   94.91%
========================================
  Files           70       70
  Lines         3857     3857
========================================
  Hits          3661     3661
  Misses         196      196

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


159-hotfixes

@albertkun - Sorry I didn't specify this earlier, can you actually point the "Line 2" link on the all changes page to the Line Details page?
Line 2

This has been completed!


A helper similar to iron:router pathFor

Great job with Flow Router and Layout!
I found the iron:router's helper pathFor very useful and I was wondering if you can add something similar to flow-router. In my project I added a helper like this:
UI.registerHelper 'pathFor', (route, params, queryParams) ->
   FlowRouter.path(route, params, queryParams)

Check this: https://atmospherejs.com/arillo/flow-router-helpers
On Sat, Jul 25, 2015 at 11:40 PM Orlando Quero<EMAIL_ADDRESS>wrote:

Great job with Flow Router and Layout!
I found the iron:router's helper pathFor very useful and I was wondering
if you can add something similar to flow-router. In my project I added a
helper like this:
UI.registerHelper 'pathFor', (route, params, queryParams) ->
FlowRouter.path(route, params, queryParams)
—
Reply to this email directly or view it on GitHub
https://github.com/meteorhacks/flow-router/issues/224.

Awesome thanks!


KDtree knearest doesn't return anything

Trying the helpfile, one gets nothing back. I presume it is due to the new optional parameter.
also, maybe we should consider adding the same optional parameter to knearestdistances ?

human error with new interface, helpfile example needs updating


"province" field in ISO3166CitiesMunicipality interface to be nullable

https://github.com/hyubs/ph-locations/blob/b5feb0e251561d88ea1671552c720a724097191e/%40types/index.d.ts#L5
Some city doesn't have province value like Quezon city, Pateros, San Juan City, ...

Thanks! To be corrected in an upcoming release next week.
—
Keeping this issue open until the commit is pushed.

Closing. Already resolved in develop branch. Will be released in v1.2.0.


Glyphs truncated with Cascadia Code font

I've noticed that certain wide glyphs appear to be truncated when rendered using the Cascadia Code font. Specifically I've noticed the   and  glyphs are truncated, while something like  isn't. I've tried adding text after the glyphs and the text renders fully, so I believe something about the width of the characters triggers the issue.
Here's a screen shot with correctly rendered text after the truncation to demonstrate the problem:

Happy to provide any more detail or testing! I'm running waybar v0.9.7 and cascadia code version 2106.17.

I think this may solve your issue:
https://github.com/ryanoasis/nerd-fonts/issues/442
If yes, please close the issue as it doesn't seems related to waybar itself.

Adding the trailing invisible character suggested in https://github.com/ryanoasis/nerd-fonts/issues/442#issuecomment-894028647 does fix the issue, thanks!


[SPARK-18028][SQL] simplify TableFileCatalog

What changes were proposed in this pull request?
Simplify/cleanup TableFileCatalog:

pass a CatalogTable instead of databaseName and tableName into TableFileCatalog, so that we don't need to fetch table metadata from metastore again
In TableFileCatalog.filterPartitions0, DO NOT set PartitioningAwareFileCatalog.BASE_PATH_PARAM. According to the classdoc, the default value of basePath already satisfies our need. What's more, if we set this parameter, we may break the case 2 which is metioned in the classdoc.
add equals and hashCode to TableFileCatalog
add SessionCatalog.listPartitionsByFilter which handles case sensitivity.

How was this patch tested?
existing tests.

Test build #67265 has started for PR 15568 at commit bd808af.

cc @ericl @mallman @yhuai

Test build #67265 has finished for PR 15568 at commit bd808af.

This patch fails to build.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test FAILed.

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/67265/
Test FAILed.

Test build #67266 has started for PR 15568 at commit c98c4f6.

Test build #67266 has finished for PR 15568 at commit c98c4f6.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/67266/
Test PASSed.

@cloud-fan, I don't know what you mean in item 4 about SessionCatalog.listPartitionsByFilter handling case-sensitivity. What case-sensitivity issue are you referring to, and does this PR handle it differently?

LGTM, but had a question on why we need to override equals().

@mallman , item 4 is a potential problem in the future. The current workflow is, we get the MetastoreRelation via HiveMetastoreCatalog.lookupRelation, which always lower case the database and table name. Then we construct TableFileCatalog and call ExternalCatalog.listPartitionsByFilter with the database and table name. So we won't have case senstivity problem here.
However, we may have a workflow which call listPartitionsByFilter directly with database and table name given by users. e.g. #15302. Then we need to care about case sensitivity.

Test build #67444 has started for PR 15568 at commit c4a906f.

Test build #67444 has finished for PR 15568 at commit c4a906f.

This patch passes all tests.
This patch merges cleanly.
This patch adds no public classes.

Merged build finished. Test PASSed.

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/67444/
Test PASSed.

lgtm, thanks for adding the test!

thanks for the review, merging to master!


ZH-trans: merge release1.16-temporary to master

/cc @chenrui333 @markthink @zhangxiaoyu-zidif @idealhack @SataQiu

日志暂时不可用，我会继续更新 pr。
9:05:05 PM: [ERROR] Deploy logs are currently unavailable. We are working on resolving the issue.

I have deleted the extra {{% /capture %}}, I think it may be caused by other problems but I can't see the log now which is the most troublesome

@xichengliudui  谢谢
/lgtm
/approve

Hi, it seems there're some broken links after this merge https://kubernetes.slack.com/archives/CE3LNFYJ1/p1577291939000900


Java fatal error SIGFPE during training

Migrated from https://github.com/deeplearning4j/nd4j/issues/869
While training a convolutional net using a dataset of <10,000 black and white JPEGs,  I encountered a fatal error while training my net using Spark 1.6.1:
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGFPE (0x8) at pc=0x000000012a82c8ba, pid=32002, tid=76291
#
# JRE version: Java(TM) SE Runtime Environment (8.0_65-b17) (build 1.8.0_65-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.65-b01 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libnd4j.dylib+0x278ba]  _ZN5shape8ind2subCEiPiii+0x8a
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

Application output is here: https://gist.github.com/crockpotveggies/8fdcaa59224a25b62f6d237a8c2120c3
This is the configuration of my convolutional neural net: https://gist.github.com/crockpotveggies/d342bbb8a614fc88286bb8e75a8454e1
I've uploaded a repo for reproducibility.  You can find it here: https://github.com/crockpotveggies/libnd4j-SIGFPE-error

Re run?

Latest pull resulted in the following error, will have to resolve that before getting a definite answer on this:
INFO  [2016-05-05 22:07:03,162] org.deeplearning4j.earlystopping.trainer.BaseEarlyStoppingTrainer: Starting early stopping training
WARN  [2016-05-05 22:07:08,207] org.deeplearning4j.earlystopping.trainer.BaseEarlyStoppingTrainer: Early stopping training terminated due to exception at epoch 0, iteration 0
! java.lang.IllegalStateException: Mis matched shapes
! at org.nd4j.linalg.util.LinAlgExceptions.assertSameLength(LinAlgExceptions.java:38) ~[nd4j-api-0.4-rc3.9-SNAPSHOT.jar:na]

Is this possibly a race condition? The culpri is related to the labels it looks like ;/

I've been running this in standalone mode (no Apache Spark) so I'm unsure if it's a race condition. Is anything parallelized with Canova that would cause training to fire up before it's finished?

Is this still the case?

This no longer happens using JVM 8 and can be removed.


Don't remove mongo32 sources anymore and refresh gpg key

We've decided to remove mongo from sources.list yesterday, since their GPG key was expired.
The issue (https://jira.mongodb.org/browse/SERVER-31459) has since been fixed and we just need to refresh the key.

[ ]  Tested on staging

Deploy at will, once confirmed in staging.


Fix some error for Symfony 6.1 compatibility

I have made these changes to use this bundle on Symfony 6.1 project. But I don't know how to manage correctly this change between version <= 6.0 and >= 6.1.

@macintoshplus Please could you update the CI configuration please?

@macintoshplus Please could you update the CI configuration please?

I have change the Symfony version:

remove Symfony 4.4
keep Symfony 5.4
add Symfony 6.0

Covered already in #121. Thanks a lot for work Jean-Baptiste, and for collaboration over the solution Stephane and Alexandre 🎉


issue keyword search, not topic search, from autosuggested terms

we currently execute a topic search if a user clicks an autosuggested term. sometimes, reports are tagged but do not contain a search term, and vice versa. this leads to inconsistent results, depending on the type of search issued.

[ ] instead of executing a search when a term is selected, add the text to the search box. that way, all initial searches are keyword searches.
[ ] confirm that topics are indexed with a bill's text, so both tagged and keyword results are returned from a keyword search. if they aren't, add them.

it may be a good idea to implement the hints reset functionality described in #460, as part of this issue.


Revert batching changes on main

Motivation

Solution

PR Checklist

[ ] Added Tests
[ ] Added Documentation
[ ] Updated the changelog

Codecov Report

Merging #388 (0252056) into main (b2cf5c9) will decrease coverage by 3.61%.
The diff coverage is 73.80%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #388      +/-   ##
==========================================
- Coverage   48.08%   44.48%   -3.61%
==========================================
  Files          29       23       -6
  Lines        6675     6063     -612
==========================================
- Hits         3210     2697     -513
+ Misses       3465     3366      -99

Flag
Coverage Δ

test
44.48% <73.80%> (-3.61%)
:arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

build.rs
0.00% <ø> (ø)

src/lib.rs
41.63% <ø> (-2.13%)
:arrow_down:

src/app.rs
45.63% <40.00%> (+0.34%)
:arrow_up:

src/identity_committer.rs
58.22% <50.00%> (-2.95%)
:arrow_down:

src/contracts/mod.rs
54.54% <60.52%> (+43.43%)
:arrow_up:

src/contracts/abi.rs
16.66% <100.00%> (ø)

src/ethereum_subscriber.rs
75.73% <100.00%> (-0.27%)
:arrow_down:

tests/integration-tests.rs
99.29% <100.00%> (ø)

src/server.rs
17.60% <0.00%> (-5.43%)
:arrow_down:

... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b2cf5c9...0252056. Read the comment docs.


Enable Antrea-proxy EndpointSlice Support by Default, and Improve Feature Parity to Kube-proxy v1.26

Describe the problem/challenge you have
The kube-proxy feature gate ProxyTerminatingEndpoints becomes beta in K8s 1.26. (https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features). K8s conformance test now include tests for this feature.
If I enable Antrea-agent feature gate EndpointSlice, it fails in the following test cases on K8s 1.26.

[It] [sig-network] Services should fallback to local terminating endpoints when there are no ready endpoints with externalTrafficPolicy=Local [Feature:ProxyTerminatingEndpoints]
[It] [sig-network] Services should not be able to connect to terminating and unready endpoints if PublishNotReadyAddresses is false

The first failure is related to antrea-proxy not supporting ProxyTerminatingEndpoints feature.
The second failure is related to Antrea-proxy doesn't support Endpoint condition ready, serving, terminating in EndpointSlice. Before K8s 1.25, this is not an issue, the terminating Endpoints will not be in EndpointSlice. However, after K8s 1.25, the feature gate EndpointSliceTerminatingCondition becomes beta and enabled by default, and the feature gate is GA in 1.26. Terminating Endpoint will be included in EndpointSlice, just that the Endpoint condition is set to ready=false, serving=false, terminating=true. Antrea-proxy should check Endpoint condition.
Describe the solution you'd like
Improve Antrea-proxy support for EndpointSlice

Enable EndpointSlice feature gate by default.
Check Endpoint conditions and deal with ready: false, serving: false, terminating: false conditions
Feature parity to kube-proxy ProxyTerminatingEndpoints feature gate.

Thanks @edwardbadboy , I think I can make two PRs:

[ ] Support checking Endpoint conditions and deal with ready: false, serving: false, terminating: false conditions
[ ] Add ProxyTerminatingEndpoints feature to AntreaProxy

As for Enable EndpointSlice feature gate by default, should we do some scale tests?

Hi Hongliang, so far we don't have scale test for EndpointSlice. To support ProxyTerminatingEndpoints, enabling EndpointSlice is a must. We can setup scale test environment for EndpointSlice.


when bitmap load the bitmap is zoomed

when i am loading an image its shows the same size like the canvas the both is 700 with but the image in canvas loaded is like zoomed 1000%
 stage = new createjs.Stage("scratch");
   var background = new createjs.Bitmap("IMAGE.png");
   var frame = new createjs.Bitmap("frame.png");
    stage.addChild(background);
    stage.addChild(frame);
    background.image.onload = function() {
    		stage.update();
	}

Any chance you are setting the size or scaling the canvas with CSS / jQuery?

yes with css i give the width of canvas

@lannymcnie i deleted from css the width and height and added on element its works perfect thx


Style change event detection

Hi @jgermade.
I have an element with a width in %, i'm trying to get a listener on that element that would fire when it gets re-sized.
I thought about using MutationObserver but i need to keep it IE9 supported.
I saw this question, and what he answered in the question.
I was wandering, won't it screw-up the css function all togather?
This is what he wrote:
(function() {
    var ev = new $.Event('style'),
        orig = $.fn.css;
    $.fn.css = function() {
        $(this).trigger(ev);
        return orig.apply(this, arguments);
    }
})();

This will temporary override the internal prototype.css method and the redefine it with a trigger at the end.
But i'm not sure that's what i need.... any idea?

Hi @RongBranovate , I understand that what you need is detect when an element is resized in px. So when window is resized hence element may be already resized but width property value does not change.
You may watch window resize, and check element size change. Maybe this can help you: http://plnkr.co/edit/s4Qul9ydoAbqyBpX0hAH?p=preview


shorter class file names (#43)

this gets the longest class file name down to 135 characters

LGTM.

thanks @jmelching


Can't download/save the avatar properly

Someone in the Discord server reported that when they try to save their pixel avatar, they are not being able to save the entire avatar. Instead, they are being able to save only one part of the avatar at once. (eg. pants) Link to the message: https://discord.com/channels/883478451850473483/883482557809852416/899139138396258374
This has probably got to do with the fact that we are just placing PNGs for different parts of the avatar on top of each other. But we should definitely add a download functionality.

I think it's also good to have a "share" function to allow directly sharing to twitter / something?

I did a very quick research on this issue and find a below proposal:
https://github.com/lukechilds/merge-images
function downloadAvatar() {
    mergeImages(layers.value)
        .then(b64 => {
            const element = document.createElement("a");
            element.href = b64
            element.download = "image.jpg";
            element.click();
        });
}

Yet it's not working due to the different part of traits have different dimension:

3659 × 4734
878 × 1136

Like to ask why the trails image are of different (and quite a large) dimension?

Not sure about that, @kavimaluskam. Thanks for that code snippet, tho!
Raz on Discord has also suggested a fix by using a <canvas>: https://discord.com/channels/883478451850473483/883482557809852416/899396611392823326

I am trying to modify the rendering method to canvas directly as below:
<script setup>
import { onMounted } from "@vue/runtime-core"

const props = defineProps({
    state: Object
})
const updateAvatar = (width = 448, height = 580) => {
    const canvas = document.getElementById('avatar')
    const ctx = canvas.getContext("2d");
    canvas.width = width;
    canvas.height = height;

    const images = props.state.layers.value.map(layer => new Promise((resolve, reject) => {
        var image = new Image(width, height);
        image.onerror = () => reject(new Error('Couldn\'t load image'));
        image.onload = () => resolve(Object.assign(image));
        image.src = layer;
    }));

    Promise.all(images).then(images => {
        images.forEach(image => {
            ctx.drawImage(image, 0, 0, width, height)
        })
    });
}
onMounted(() => { updateAvatar() })

</script>

<template>
    <div>
        <canvas id="avatar"></canvas>
    </div>
</template>

Its working now, but only when mounted...
Sorry that I am not very familiar with vue, is there any API so i can trigger the updateAvatar() when props changes?

Thanks for this @kavimaluskam! I'm not familiar with Vue myself either. @rasmuscnielsen could you help us out here haha

@kavimaluskam
Yeah so it's very much been a moving target as things changes and the project progresses.
The idea with the flexible traits were initially to test out the different layers of the designs, and secondly it could present a future possibility of selling tailored avatars to the public. I guess we have really discussed these options through yet.

And if it's the case, I wonder if we can close the current issue, and image download / share (share should be more important) function, which shall be solved when the team has implemented web3 functionality?

Yeah I think that sounds good! Do you have any suggestions for how this share function could work?
Should it just be the URL to the JPG, or a special landing page with social preview, where we host some more information and call-2-action for people to mint their own (?)
Just throwing some ideas around, haven't really thought it through :-)

hey any update on this? i can jump-in and help :)

I made a fix:

Convert to Canvas
Update on each prop.state change (when the user types a diff token ID)
Download as PNG (easy because its a canvas)
Save image as: {tokenID}.png

@CastilloLuis yes, please put in a PR!

I think pre the above discussion we don't want to have this feature now since the team is going to generate JPG for all avatar now? @rasmuscnielsen @Dhaiwat10 ? Please correct me if I am confused again.

@kavimaluskam oh sorry, I missed the discussion in-between. I'll leave the decision upto you and @rasmuscnielsen :)

I'll stay tuned to any final decision before submitting the PR @kavimaluskam @rasmuscnielsen

Yeah I think we can pick this one back up once the web3 integration is in place. We already have all the PNG's generated, so we just need to make a share functionality for the owned tokens once minted :-)

Just created #65 which relates to this. Since this only relates to avatars that are already claimed, it should be possible to just grab the IPFS url out of the contract and add a download function that reads from IPFS


[Fix #11677] Fix the severity for Lint/Syntax

Fixes #11677.
This PR fixes the severity for Lint/Syntax. The Lint/Syntax severity must always be fatal.

There is one exception from the general rule above and that is Lint/Syntax, a special cop that checks for syntax errors before the other cops are invoked. It cannot be disabled and its severity (fatal) cannot be changed in configuration.

https://docs.rubocop.org/rubocop/1.46/configuration.html#severity
In addition to #11666, it also fixes the following issues:
def foobar
  t = {
    a: "foo"  # missing "," syntax error
    b: 'bar'
  }
  return t
end

Before
The severity that mult be fatal (F) is unexpectedly error (E):
$ bundle exec rubocop
(snip)

Inspecting 1 file
E

Offenses:

example.rb:4:5: E: Lint/Syntax: unexpected token tIDENTIFIER
(Using Ruby 3.2 parser; configure using TargetRubyVersion parameter, under AllCops)
    b: 'bar'
    ^

1 file inspected, 1 offense detected

After
It will be fatal (F) as expected:
$ bundle exec rubocop
(snip)

Inspecting 1 file
F

Offenses:

example.rb:4:5: F: Lint/Syntax: unexpected token tIDENTIFIER
(Using Ruby 3.2 parser; configure using TargetRubyVersion parameter, under AllCops)
    b: 'bar'
    ^

1 file inspected, 1 offense detected

Before submitting the PR make sure the following are checked:

[x] The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
[x] Wrote good commit messages.
[x] Commit message starts with [Fix #issue-number] (if the related issue exists).
[x] Feature branch is up-to-date with master (if not - rebase it).
[x] Squashed related commits together.
[x] Added tests.
[x] Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
[x] Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

No idea how we missed this. Thanks!


specifying rust 1.53 for arrow and parquet crate

Which issue does this PR close?
specifying rust 1.53 for arrow and parquet crate.
related #714, as in here the pat_params is introduced.
Closes #.
Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

An alternate is to document that arrow rs only tests on the latest rust stable: https://github.com/apache/arrow-rs/pull/726
If the goal is to ensure that the arrow and parquet crates work on Rust 1.53 I suggest we  add a CI run that at least cargo checks that they can be compiled with 1.53.


VERSION: bump to 1.3.90

Signed-off-by: André Martins<EMAIL_ADDRESS>

This change is

test-me-please

Test failure is related to etcd-operator scale-down problems we have been observing:
https://jenkins.cilium.io/job/Cilium-PR-Ginkgo-Tests-Validated/7831/

test-me-please


Pre-process pipelines before uploading

This PR is making a few big changes to how pipelines are uploaded to the BK API:

Instead of uploading the pipeline files "as-is", we parse them first (either as YAML or as JSON) and upload them to the Agent API as JSON all the time. This gives us the benefit of catching JSON or YAML syntax errors before even hitting the Agent API
Instead of doing an Environment Variable Interpolation across the entire pipeline as a whole, we recursively go through the entire config and do it for strings only, after the first parse. This solves many quoting issues
When piping a pipeline in via STDIN, you must now tell the agent what format it's in --format yaml or --format json
We now accept .buildkite/pipeline.yaml (not just .yml) files as default file. Apparently .yaml is actually the official extension, but no one seems to care?
.buildkite/steps.json has officially been removed

There's a few more things I need to do before I can merge this in:

[x] Add the YAML parsing library to master and merge in
[ ] Fix the tests
[ ] Write some tests
[x] Move the EnvironmentVariableInterpolator into the it's own package (done in master)

Closing in support of another cleaner PR


Render the interactable pi chart using data from S3

Once we have rendered a pie chart with dummy data from #57, we want to render the same pie chart but with actual data stored on S3.
Acceptance Criteria

Pie chart rendered on insights website using insight from json file hosted on S3.

Object in S3:

Result: (rendering last 24 hours section)


Fitness function

MSE as fitness function
The first fitness function that I decided to use, was based in MSE.

Compute normalized MSE:

Reverse output, so that fitness is accuracy instead of error:

The problem with this approach is that the values processed in compute shaders are normalized. Squaring normalized values always produces smaller numbers, which reduces the measured error. As a result, when the calculated fitness approaches 1.0, significant differences may still exist but are not properly reflected in the fitness value.

Found this article that shows a different way of computing fitness.
Instead of calculating the differences and squaring them, we can compute the difference, calculate the complement to 1.0 of that difference, and then apply a power function to the result. This approach punishes larger errors, unlike the previous MSE-based fitness function, which tended to reduce the error.

After some testing, I decided to keep the power to 4, which tends to create a better fitness value distribution:


matrixdymanic knockout doesn't show comment field

http://surveyjs.org/examples/knockout/questiontype-matrixdynamic.html here is two comment fields instead of three

Fixed with #293


Detect Middle Element of a Linked List in C++

💥 Proposal
(A clear and concise description of what the proposal is.)
Have you read the Contributing Guidelines on Pull Requests?
(Write your answer here.)

I would like to do this, please assign me

I would like to work on this issue

I want to work on this .Please assign it to me.

@shraddhavp  I am doing this in C++

@shraddhavp  I am doing this in C++

@Sarthak-9 any updates?

@Sarthak-9 any updates?

My previous PR is merged now. I'll complete this one today.
@shraddhavp

My previous PR is merged now. I'll complete this one today.
@shraddhavp


Bug in lollipopPlot2

Please try the codes:
library(maftools)
laml.maf = system.file('extdata', 'tcga_laml.maf.gz', package = 'maftools')
laml.clin = system.file('extdata', 'tcga_laml_annot.tsv', package = 'maftools')
laml = read.maf(maf = laml.maf, clinicalData = laml.clin)
laml@gene.summary[18,]
lollipopPlot(maf = laml, gene = 'SMC1A', AACol = 'Protein_Change', showMutationRate = TRUE)
There are 5 missense mutations and 1 splice sites.
lollipopPlot2(m1 = laml, m2 = laml, AACol1 ='Protein_Change', AACol2='Protein_Change',
m1_name = "laml", m2_name = "laml",
gene = "SMC1A")
There are 3 missense mutations & 3 splice sites
The used datas are the same. There should be different result.
I think the probelem is :
the two lines in lollipopPlot2
col1 = col[unique(as.character(m1.lp[[1]][, Variant_Classification]))]
col2 = col[unique(as.character(m2.lp[[1]][, Variant_Classification]))]
should be
col1 = col[(as.character(m1.lp[[1]][, Variant_Classification]))]
col2 = col[(as.character(m2.lp[[1]][, Variant_Classification]))]

Hello,
Could you post your session info? I believe you're using an older version. Could you also install the package from GitHub and see if you can reproduce this?

Thank you for your reply.
Session info:

Packages --------------------------------------------------------------------------------
package              * version date       lib source
maftools             * 1.8.10  2019-04-14 [1] Bioconductor

After install the package from GitHub:

Packages --------------------------------------------------------------------------------
package              * version date       lib source
maftools       * 2.0.10  2019-06-27 [1] Github (PoisonAlien/maftools@d2c6598)

I can't reproduce this problem after install maftools from GitHub.
Thank you for your reply and suggestion .


typo

there is a typo written as "respository" instead of "repository":)

Thanks for addressing, fixed.


update SoftObject to include added string

SoftObjectProperty contains an extra string value in the Abiotic Factor demo's save files. This change allows uesave to parse ABF saves, but will break existing compatibility.

Abiotic Factor uses UE 5.3.2:
{
  "header": {
    "magic":<PHONE_NUMBER>,
    "save_game_version": 3,
    "package_version": {
      "New": [
        522,
        1009
      ]
    },
    "engine_version_major": 5,
    "engine_version_minor": 3,
    "engine_version_patch": 2,
    "engine_version_build": 0,
    "engine_version": "UE5",
...

I'm not sure if this change comes from 5.3 or if it's exclusive to Abiotic Factor, but I'll try to keep this updated if I find out.

Thanks so much for this. Still can't parse WorldSave_*.sav files though. Except Worldsave_MetaData.sav. The others fail with:
offset 1653: StructType for ".SimpleDoorMap.Value" unspecified, assuming Struct(None)
Error: at offset 1970: unknown property type: "DoorState_16_FC20B6E3483FF18E4FBDF19E39E880E9"

WorldSave_Facility.zip

@Egaliterrier I've updated the SoftObjectPath struct to have the same change (I believe one is simply a wrapper of the other) which fixes that save.
I took the liberty of finding the serialization code in the UE source and it looks like the format did indeed change, so I'll add some version checks and merge this at some point.

void FSoftObjectPath::SerializePathWithoutFixup(FArchive& Ar)
{
	if (Ar.IsLoading() && Ar.UEVer() < VER_UE4_ADDED_SOFT_OBJECT_PATH)
	{
		FString Path;
		Ar << Path;

		if (Ar.UEVer() < VER_UE4_KEEP_ONLY_PACKAGE_NAMES_IN_STRING_ASSET_REFERENCES_MAP)
		{
			Path = FPackageName::GetNormalizedObjectPath(Path);
		}

		SetPath(MoveTemp(Path));
	}
	else if (Ar.IsLoading() && Ar.UEVer() < EUnrealEngineObjectUE5Version::FSOFTOBJECTPATH_REMOVE_ASSET_PATH_FNAMES)
	{
		FName AssetPathName;
		Ar << AssetPathName;
		AssetPath = WriteToString<FName::StringBufferSize>(AssetPathName).ToView();

		Ar << SubPathString;
	}
	else
	{
		Ar << AssetPath;
		Ar << SubPathString;
	}
}


Vue 3 support

Are there any plans to integrate with Vue ecosystem?

@maxflex Hey! No, our library works only with React


Github marketplace action for amber

Would make amber easier to consume in the GitHub ecosystem (without requiring any changes to amber)
A developer using Github actions would not need to worry about how to install amber e.g. https://github.com/chrisjsimpson/amber-secrets-ci-example/blob/9854d92efd11bccb1919f8f74e9a38e5cbec6cd0/.github/workflows/production.yml#L19-L22 would be abstracted away.
Have some experience with this.

No objection from me if someone wants to take it on.

Github marketplace action is available now: https://github.com/fpco/amber#github-actions
So probably this issue can be closed ?


Add all tests from the express repo

This adds every test from the express repo. Heaps are failing so still need to go through and figure out which errors actually matter. I think we need some kind of replacement supertest.
run with npx mocha --require tests/express-tests/test/support/env --reporter spec --check-leaks tests/express-tests/test/ tests/express-tests/test/acceptance/

This is great!! I have problem with supertest and https://github.com/uNetworking/uWebSockets

The bridge kind of works. It just sends the request to the server with fetch. Ill try with http.request and see whats better.

uhm... this is gold! https://github.com/dimdenGD/ultimate-express/pull/22/commits/90d987a3cb13a88a760fcaa60e652a1f9c74c93b

I can publish it as a separate package if you think it's useful

why not!? I think it is useful for test uWebSockets... maybe tou can contribute directly on supertest redo?
PS. @dimdenGD and @hillac  I think some tests will fail because "ultimate-express" caches some computed properties of the request. In this case, perhaps it is useful to provide a setting to disable caching of such properties for stick with express behaviour during the test


Optimise PNGs

Knocks off about 20k in total

Can one of the admins verify this patch?

ok to test

Thanks. In the future, you may find it easier to branch from master and then PR from the branch.

Well, not really - I wasn't planning putting anything else in the PR and it's just extra faff. Otherwise sure...


A couple enhancements for your review...

Greetings Rob - thank you for the great library. I've added a couple features you might be interested in:

I utilize Write Control and wanted it enabled by default, but made it a compile time define for those who don't. Implemented in the begin function and if there's no WC pin supplied, the #define is irrelevant.

Modified the updateBlock function have the choice to perform a byte level compare and multiple updates as needed, or stick with the I2C_BUFFERSIZE compare.  Also a minor update to the original block of code that would return the full length of the buffer as number of bytes changed, even if it were just a buffer chunk (assuming the supplied buffer was larger than a I2C_BUFFERSIZE)

Best regards,
Terry Phillips
BTW - I'm also working with the ST M24256-D series of EEPROM which includes an additional Lockable Identification Page. It was super easy to extend the library for the functionality. I have a separate codebase for that if you're interested...

Thanks for thi PR.
Will look into the details later, might take a few days due to other (prio) tasks.
Interested in the extended version, preferably as a derived class I think, as that gives people choice which class to use.
Do you have a repository link?

Relates to #68

Got the review started.

I utilize Write Control and wanted it enabled by default, but made it a compile time define for those who don't. Implemented in the begin function and if there's no WC pin supplied, the #define is irrelevant.

OK I see the application and the implementation is quite straightforward, however the implementation is missing command line support.
Adding an ifndef construct it would also allow to set this flag.
Furthermore the default value of the flag EN_AUTO_WRITE_PROTECT  in the library must be 0 (false)
to have backwards compatible behavior. E.g. if someone updates the library the _autoWriteProtect flag
is "suddenly" true instead of false (current default).
in code:
I2C_EEPROM.h
//  set the flag EN_AUTO_WRITE_PROTECT to 1 to enable the Write Control at compile time
//  used if the write_protect pin is explicitly set in the begin() function.
//  the flag can be set as command line option.
#ifndef EN_AUTO_WRITE_PROTECT
#define EN_AUTO_WRITE_PROTECT 0
#endif

Same command line argument would be true for the PER_BYTE_COMPARE flag.
Haven't reviewed that code yet (only a quick glance).
It are a lot of lines added and the added value is not 100% clear to me.
Remarks:

does the default value true change the default behavior?
what is the effect on the library size.
bool getPerByteCompare() { return _perByteCompare };  could be added for convenience.

Point of attention:
Need to keep this functionality in sync with - https://github.com/RobTillaart/I2C_24LC1025 after this PR.
To be continued.

Hmm - a derived class might be more elegant than my current brute force modification of adding an additional bool  to each function: bool IDPage (defaulted to =false). The separate IDPage i2c address is always the chosen EEPROM base address + 8 and set during the begin(...). And in the end:
_wire->beginTransmission(IDPage ? _idPageDeviceAddress : _deviceAddress);
But on the flip-side, I can manage both from one instantiation. Guess it's a coin-toss.
BTW, it's an irreversible lock!
You'll find it here:  I2C_eeprom_wIDPage
Something else to note: to avoid address wrapping, I added a couple validation tests in the function _pageBlock which would apply to setBlock, writeBlock and updateBlock functions
  // Check if IDPage is true and length from the specified address is larger than the single ID page boundary
  if (IDPage && (addr + len > this->_pageSize)) {
    return 11; // Trying to crank it up to 11, and it will wrap when crossing page boundary
  }

  // Check if the entire write operation stays within the EEPROM's memory limits
  if (addr + len > this->_deviceSize) {
    return 12; // Error code 12 for attempting to write beyond the EEPROM's memory limits
  }

@microfoundry
perByteCompare
Found some time to dive into the perByteCompare modus.
In the code you allocate two buffers that are potentially large, larger than I2C buffer.

uint8_t origBuf[length];
uint8_t writeBuf[length];

Note that you do not need the writeBuf  as the data you want to write is already in buffer.

reduces memory usage
possibly slightly faster (no intermediate copy).

Furthermore the final remaining different bytes can be caught in the for loop too.
Does save a few lines.
uint16_t I2C_eeprom::updateBlock(const uint16_t memoryAddress, const uint8_t * buffer, const uint16_t length)
{
  uint16_t addr = memoryAddress;
  uint16_t len = length;
  uint16_t rv = 0;

  if (_perByteCompare) {
    //  Serial.println("Performing BYTE SIZE updates");
    uint16_t writeCnt = 0;

    //  Read the original data block from the EEPROM.
    uint8_t origBuf[length];
    _ReadBlock(addr, origBuf, length);

    uint16_t diffCount = 0;
    uint16_t startDiffAddr = 0;

    //  Iterate over each byte to find differences.
    for (uint16_t i = 0; i < len; ++i) {
      if (buffer[i] != origBuf[i]) {
        //  Start buffering when the first difference is found.
        //  Save the starting address of the difference.
        if (diffCount == 0) {
          startDiffAddr = addr + i;
        }
        diffCount++;  //  count the differing bytes.
        if (i < len - 1) continue;  //  <<<<<<<<<<<<<<  falls through when i == len -1.
      }
      //  If there was a difference and now it stops,
      //  write the buffered changes.
      if (diffCount > 0) {
        rv += diffCount;
        _pageBlock(startDiffAddr, &buffer[startDiffAddr], diffCount, true);
        diffCount = 0; //  Reset difference count after writing.
        writeCnt++;
      }
    }
    // Serial.print("EEPROM Write cycles: ");
    // Serial.println(writeCnt);

    return rv;
  }

  // Serial.println("Performing BUFFERSIZE updates");
  while (len > 0)
  {
    uint8_t buf[I2C_BUFFERSIZE];
    uint8_t cnt = I2C_BUFFERSIZE;

    if (cnt > len) cnt = len;
    _ReadBlock(addr, buf, cnt);
    if (memcmp(buffer, buf, cnt) != 0)
    {
      rv   += cnt; // update rv to actual number of bytes written due to failed compare
      _pageBlock(addr, buffer, cnt, true);
    }
    addr   += cnt;
    buffer += cnt;
    len    -= cnt;
  }
  return rv;
}

Did you run tests like:

performance comparison of the BYTE and BUFFER modi?
with length larger than the I2C_BUFFER?   (will that work in byte mode?)
an update of 256 bytes and all bytes changed?
an update of 256 bytes and every other byte changed? (worst case).
an update of 256 bytes and every 16th byte changed?

Can you post some figures?

BTW, it's an irreversible lock!
You'll find it here: I2C_eeprom_wIDPage

Thanks,
If time permits I will dive into the code.

Hi Rob - thank you for the code recommendations, I've updated my stuff to follow.
As to your questions:

with length larger than the I2C_BUFFER? (will that work in byte mode?)
Yes, it functions as expected.
performance comparison of the BYTE and BUFFER modi?
I ran a series of single pass tests as per your outline. MCU is the ESP32-S3 WROOM2 w/32MB Octal Flash, 400KHz i2c, and the default 128byte buffer (more on this after the test...). Nothing else running on the MCU except the test code.

The byte size updates were randomly placed through the 256 byte test data, so in essence if there were 16 changes, there would be 16 individual write calls when in Byte Compare mode (conversely 2 updates in BUFFER mode). Certainly not surprising that the 128 modified bytes took an astounding 429934µs to complete. But hey, that's 128 individually addressed write cycles with an avg of 3358µs each... Note: the following output originates with the 256 byte test data being loaded, and then each test. The same base 256 bytes was reloaded between each test, but I eliminated the Serial.print() for those reloads to minimize the noise.
I think the best way to quantify the usefulness of the Byte Size Compare would be:
The need to work with large buffers && (low quantity of random non-contiguous updates || the desire to minimize unnecessary writes / maximize individual memory cell life expectancy).
NOTE: published times in micros...

Writing base 256 bytes...
Write time: 15898

Setting perByteCompare = false
Performing BUFFERSIZE updates
*****************************
Updating every 16th byte...
Bytes Written with return size of: 256
Update time: 23874

Updating every 2nd byte...
Bytes Written with return size of: 256
Update time: 25004

Updating every byte...
Bytes Written with return size of: 256
Update time: 25127

Setting perByteCompare = true
Performing BYTESIZE updates
*****************************
Updating every 16th byte...
Bytes Modified: 16
Update time: 58126

Updating every 2nd byte...
Bytes Modified: 128
Update time: 429934

Updating every byte...
Bytes Modified: 256
Update time: 25275   // NOTE: This is essentially the same as 2 BUFFER writes

Updating 1 byte...
Bytes Modified: 1
Update time: 9551

Updating 2 bytes...
Bytes Modified: 2
Update time: 12861

Updating 3 bytes...
Bytes Modified: 3
Update time: 16172

Updating 4 bytes...
Bytes Modified: 4
Update time: 19483

Updating 5 bytes...
Bytes Modified: 5
Update time: 22606

Updating 6 bytes...
Bytes Modified: 6
Update time: 25836

Updating 7 bytes...
Bytes Modified: 7
Update time: 29344

Updating 8 bytes...
Bytes Modified: 8
Update time: 32718

Updating 9 bytes...
Bytes Modified: 9
Update time: 36054

Updating 10 bytes...
Bytes Modified: 10
Update time: 39350

With regards to the I2C_BUFFERSIZE :
While working with the various test configurations, I cranked up the Wire.setBufferSize() and I2C_BUFFERSIZE define to 256 out of curiosity and discovered a bug in the base code. The initial test produced an error from the ESP32 i2cWriteReadNonstop() function in the Wire wrapper, which lead me to: All the public function accept a uint16_t length parameter value. Followed by: the private _WriteBlock, _ReadBlock and _VerifyBlock functions which only accept a uint8_t length parameter, producing some undesirable results. I updated the 3 functions to accept uint16_t params and eliminated the error.
Again, I appreciate your feedback. And I hope the additional information helpful.
-Terry

Thanks for these Insightful figures.
They confirm my gut feeling that depending on the number of bytes changed the byte mode is faster.
The tests should be ran on an UNO (MEGA) too, to see what behavior it shows. My expectation is that the AVR will show a larger spread of times.

The issue with buffers beyond 8 bit is known and so far it was not reported as a problem. However imho it is important (in fact a bug)  for systems with more resources. So I will make a separate issue for it.

@microfoundry
Created a develop branch to fix #70, making the length parameter uint16_t .
Also included the compile time option EN_AUTO_WRITE_PROTECT
Further some edits for readability in .cpp file

I still need to test the compareByte code as I am not convinced of the added value.
The idea is useful in some cases, no doubt, but is it useful enough.
Also not clear how much extra memory it uses, and for smaller boards that is important.
And how can the idea be optimized using the page size of the EEPROM used.
Question: can the library decide which mode is fastest? automatically?

@microfoundry
Had a though about a variation in strategy (not tested) which might write non-changed bytes.
Definitely not a "write only changed bytes" strategy however possibly interesting to consider.
If you have time, please share your opinion.
Reading is done in a number of blocks (Think length >> I2C_BUFFERSIZE)
Within every block that is read, the segment with the changed bytes is detected (start and end position).
Write only that part to EEPROM ==> might include non=changed bytes
uint16_t I2C_eeprom::updateBlock(const uint16_t memoryAddress, const uint8_t * buffer, const uint16_t length)
{
  uint16_t address = memoryAddress;
  uint16_t len = length;
  uint16_t bufSize = I2C_BUFFERSIZE;
  uint16_t writeCount = 0;

  if (_perByteCompare) {
    //  Serial.println("Performing BYTE SIZE updates");
    while (len > 0) {
      if (bufSize > len) bufSize = len;  //  final iteration.

      //  Read data block from the EEPROM.
      uint8_t buf[I2C_BUFFERSIZE];
      uint16_t start = 65535;
      uint16_t end   = 0;
      _ReadBlock(address, buf, bufSize);
      for (uint16_t i = 0; i < bufSize; ++i) {
        //  which part of the buffer should be written to EEPROM
        if (buffer[i] != buf[i]) {
          if (start == 65535) start = i;
          end = i;
        }
      }
      if (start != 65535) writeCount += _pageBlock(address + start, buffer + start, end - start + 1);
    }
    return writeCount ;
  }

  // Serial.println("Performing BUFFERSIZE updates");
  while (len > 0)
  {
    uint8_t buf[I2C_BUFFERSIZE];
    uint8_t bufSize = I2C_BUFFERSIZE;

    if (bufSize > len) bufSize = len;
    _ReadBlock(address, buf, bufSize);
    if (memcmp(buffer, buf, bufSize) != 0) {
      writeCount += bufSize; // update rv to actual number of bytes written due to failed compare
      _pageBlock(address, buffer, bufSize, true);
    }
    address += bufSize;
    buffer  += bufSize;
    len     -= bufSize;
  }
  return writeCount;
}

Expect that on boards with a smaller I2C buffer (UNO, MEGA) , it will work quite well.

Another function to give your opinion on. Almost the above without the write, in fact I wrote this function first as knowing the number of different bytes (or ratio diffCount vs length) might help to determine the strategy.
uint16_t I2C_eeprom::diffCount(const uint16_t memoryAddress, const uint8_t * buffer, const uint16_t length)
{
  uint16_t address = memoryAddress;
  uint16_t len = length;
  uint16_t bufSize = I2C_BUFFERSIZE;
  uint16_t count = 0;

  while (len > 0) {
    if (bufSize > len) bufSize = len;  //  final iteration.
    uint8_t buf[I2C_BUFFERSIZE];
    _ReadBlock(address, buf, bufSize);
    for (uint16_t i = 0; i < bufSize; ++i) {
      if (buffer[i] != buf[i]) count++;
    }
    address += bufSize;
    buffer  += bufSize;
    len     -= bufSize;
  }
  return count;
}

@microfoundry
Some theoretical thoughts
Gaps
If I want to store one byte in EE, I need to send a header (byte deviceAddress, 2 byte memoryAddress) plus the value. The transport efficiency is 25%.
If I send more bytes the efficiency will increase.
However bytes that have not changed do not need to be sent, however...
If the gap == 1
If I have 2 bytes changed with one unchanged (gap) in between = CUC, then i can send them separately or as a block.
Separate:  HHHC. HHHC = 8 bytes 25% efficiency
Block: HHHCUC = 6 bytes. 33% efficiency (2 changed out if 6 send)
If the gap == 2
Separate: HHHC. HHHC = 8 bytes 25% efficiency
Block: HHHCUUC = 7 bytes 28% efficiency (2 changed out of 7 send)
If the gap == 3
Block: HHHCUUUC = 8 bytes, so 25% efficiency (break even)
page factor
After a write to a page the EE is off line for up to 5 milliseconds. So if 2 separate single byte writes are on the same page the EE will block for up to 10 ms.
If 1 block of 8 bytes is written on the same page it will block for up to 5 ms.
If the writes are done over 2 pages, they are roughly  equally performant.
Optimal block size.
Within one page one can calculate the break even point of how long a gap may be before blocking becomes slower.
Assume 100 KHz == 1 byte takes ~ 100 us
2 separate  takes 2 x 4 x 100 us + 10 ms = 10800 us
1 block takes 8 x 100 us + 5 ms = 5800 us.
So we have 5000 us before break even,
That is about 50 bytes!
Assuming 400 KHz == 1 byte takes ~ 25 us
So the 5000 us to break even are almost 200 bytes.
If the write delay is lower e.g 3.5 ms the numbers will be lower of course.
The conclusion seems to be that combining writes per page seems to be an important efficiency factor.
However single byte writes have the advantage that the processor can do other things.
Question remains how to translate these insights into code.
Code

the range updated must be split at page boundaries.
per page one minimizes the number of writes.
if the I2CBUFFER  < page size one has to iterate within one page.
if the I2CBUFFER>= page size one can do it in one write.

So far my theoretical thoughts,
Does this makes sense?

@microfoundry
You might need to merge the new 1.8.4


Crash in BasemapGalleryViewModelTests.testInit()

BasemapGalleryViewModelTests.testInit() will crash when running the test in isolation. This behavior is present in 200.1 and 200.2.

Closing - I'm able to run this test 100x without issue and it has no recorded failures in daily runs.


Add guidance on writing release notes

Add guidance on writing release notes, with:

a new release-notes.html.md.erb file in manuals/
a link to the new manual under 'Version control and deployments'

Thank you both!


bugs in cutecoin 0.10.0

In relative view we should see 1 UD, but it appears 0,90909 which is exactly the well known 10/11 fraction... :) Probably you take last UD you divide by actual one.
It appears also that M in units divided by UD in units is not the same result in relative view neither.
Also the account in MB divided by the UD in MB don't give the same result we see in relative view...
Note : you can either
(1) Calculate the DU live
(2) Use the DU in the blockchain, but as M is added of the DU just when it is calculated by uCoin, you will have a DU more in the money. So you can calculate all relative view dividing by 1,1 DU. For instance (M/N) / (1,1*DU) will give you the correct answer 1/c DU and not the incorrect 1/c + 1 (11 for 1/c = 10).
Probably the best option is the first one. So you need to calculate the DU corresponding to a M(t)+NDU using the full monetary mass with the general formula DU(actual) = Max(DU(t);c[M(t)+N*DU]/N) which will be the correct DU(t+1) one, if N(t) doesn't move.
It is necessary, because with second option, you will have false calculation when DU is stable.

There is a 3rd option (used by cgeek in metab.ucoin.io I beleive) is to use M(t) without the DU(t) added in it, you will integrate only at next step.
You can consider last DU(t) in the blockchain, as a calculation step, that leads to change M(t) at t+1 when the next DU calculation step appears. So with 1 unit of time of delay, you solve all calculation problem, and you can use only data written in the blockchain.
It is like considering two series of numbers V(n+1) = U(n) with a 1 gap in the numerotation that don't change at all the properties of the series.

The UD referential use the UD(t+1) calculated live. I have modified the informations page to display more accurate values.
@galuel :  can you validate the screenshots ?

Universal Divididend of 17 387 862 cannot be UD(t+1) as it is written, since in many cases N(t+1) will not be N(t) and UD(t+1) will be different. In this solution you only calculate an intermediate value UD(t+x) with 0<x<1 that is present value between "t" and "t+1" which is the discrete time of the blockchain.
So it is correct relatively to the present time, but it will differ of the blockchain.
And the formula you use is not correct too : UD t+1 = MAX ( UD t ; c * Mt / Nt )
I suggest you keep the UD(t) blockchain value, and you show the M(t-1) and N(t) values used to calculate the UD(t) because of the correct formula :
UD t+1 = MAX ( UD t ; c * Mt / Nt+1 )
so for UD(t), you replace "t" by "t-1" and you have :
UD t = MAX ( UD t-1 ; c * Mt-1 / Nt )
Exactly what it is used in http://www.metab.ucoin.io/#/home
So you use Mt-1 and Nt, and you will have 100% correct values corresponding to the blockchain, without any need to explain anything more, or to change "t" par "t+x" by "present time" or any other problem difficult to explain.
I think the solution used in http://www.metab.ucoin.io/#/home should be consider as the best one.

Houston, we have a problem.
Do you agree that to display UD referential values, I need to divide with UD(t+1) calculated live ?
But you say that I can't calculate the next UD(t+1) because N(t+1) might be different...
So how can I calculate relative values of wallets, without UD(t+1) ?

You are in a discrete time, not a continuous one. So you cannot define a value (t) as the same that (t+1), you need to clarify what is value(t) and what is value(t+1), it is absolutely not what you want.
There is no problem at all, the correct value of UD(t+1) is :
UD t+1 = MAX ( UD t ; c * Mt / Nt+1 )
But t+1 is the future, so you have not Nt+1, so you can't calculate UD(t+1) but only a UD(t+x) where t+x is the continuous present time which is between t and t+1. It is what http://www.metab.ucoin.io/#/home has called "computed" time (study this page !).
So you only can calculate, with blockchain values (t), the near past, not the future :
UD t = MAX ( UD t ; c * Mt-1 / Nt )
So using those values, and naming them with the correct t & t-1 indice, you will have correct values.
If you use the "computed" time value to estimate UD(computed) you will have something different from UD(t) and different of UD(t+1) because you don't know what will be Nt+1.
t = near past < UD(t+x) = UD(computed) = UD(present) < t+1 = future blockchain DU calculation time.

So how can I calculate relative values of wallets/transaction, without UD(t+1) ?
UD(t or t-1 ?) in the last block is included in M of the last block, so it can not be used...
So If I can not use UD of the last block, neither the calculated UD(t+1), what UD should I use ?
I' m lost here...

You use UD(t) and not UD(t+1). So you use M(t-1) and N(t).
You don't integrate UD(t) into M(t) before t+1, that's the point. Make the difference between blockchain calculation of UD(t), and validation of M(t) with UD(t) inside it.
Correct relative is always M(t-1)/N(t), so you cannot know M(t)/N(t+1) never, because t+1 is always the future !

Internally, the UD(t) is calculated live with M(t) and N(t) of the last block with this formula :
UD t = MAX ( UD t-1 ; c * Mt / Nt )
UD(t-1) is the last UD already included in M(t), and saved along M(t) in the last UD block.
Knowing that, those screen-shots should display the expected values.

it depends the definition of what is M(t) and what is M(t+1), as well as UD(t) and UD(t+1). A serie of numbers like Un can be defined as well with Vn with Vn+1 = Un.
What do you call M(t) exactly ? Is it the blockchain source or a calculated one ? Does it contain DU(t) ? Then it is false, because you need M(t) to calculate DU(t), and M(t+1) = M(t) + N(t+1)*DU(t) if you use the formula you have in information tab.
Since I don't know what you take from blockchain, what is "t" and what is "t+1" I cannot control exactly if what you put on the screen is correct or incorrect.
For instance : if people look their wallet in units, all, and they sum their units, they will obtain a value. Is this value what you call "M(t)" or is it M(t)+N(t)*DU(t) ? Or is it another stuff ?
And what is "t" exactly ? Is it "t" at the time of blockchain calculation of DU(t), or is another time "t+x" ?
And so what is "N(t)" you show here ? Is it the Number of members at "t" time of DU(t) blockchain calculation, or is it N(t+x = present time) ?
What are all the values at "t" time of UD(t) blockchain calculation, and what are the values of the blockchain at the time you show information ?

For instance : if people look their wallet in units, all, and they sum their units, they will obtain a value. Is this value what you call "M(t)" or is it M(t)+N(t)*DU(t) ? Or is it another stuff ?
Yes, M(t) is the sum of all the wallets at the current time. I take it from the last block, but it will not change until the next UD will be added.

And what is "t" exactly ? Is it "t" at the time of blockchain calculation of DU(t), or is another time "t+x" ?
t is now, the current time at the moment of the display.

And so what is "N(t)" you show here ? Is it the Number of members at "t" time of DU(t) blockchain calculation, or is it N(t+x = present time) ?
N(t) is the number of members validated in the last block of the blockchain. So at the time of the display.

What are all the values at "t" time of UD(t) blockchain calculation, and what are the values of the blockchain at the time you show information ?
At the time "t" of the display, I am sure of the M value and the N value because for me they are valid in the last block.
Based on this values, I calculate the UD(t) at the time of the display. This UD is NOT in M since I calculate it FROM M. To show UD referential values I divide units by UD(t).
As you can see I get the average of 10 UD mb for each member as expected, with a c of 10%.

Yes, M(t) is the sum of all the wallets at the current time. I take it from the last block, but it will not >change until the next UD will be added.

So it is not M(t) you display, but M(t+1) this is a first point.

it is now, the current time at the moment of the display.

So this will lead you to problems. Imagine I1 make an invoice I2 with 3 DU = n MB, when I2 will check it at his time 3 DU will not be n MB, because it is DU(t+x) used, and so it depends on the time you check it between "t" and "t+1". If you use DU(t+x) so you need to display DU(t+x) and not DU(t), with the definition of t = the discrete time where DU is calculated by the blockchain.
So you need clear definition and clear display. For instance "t" you use now is not the definition used in http://www.metab.ucoin.io/#/home who use the discrete definition.

N(t) is the number of members validated in the last block of the blockchain. So at the time of the >display.

So you must display "N(t+x)=..." or "N(now)=..." and not "N(t)=...".

At the time "t" of the display, I am sure of the M value and the N value because for me they are >valid in the last block.

Those values, and the coherence between values (M,N,DU)(t) and (M,N,DU)(t+1) depend of discrete time "t", and not a continuous one where some of theese value change (N(t+x) alway can change), and other don't change (M and DU change at discrete points only).
In a discrete function you can need  values at "t" and "t-1" or "t+1" to calculate differential values (and much more if you need to calculate more differential degrees).

Based on this values, I calculate the UD(t) at the time of the display. This UD is NOT in M since I >calculate it FROM M. To show UD referential values I divide units by UD(t).
As you can see I get the average of 10 UD mb for each member as expected, with a c of 10%.

Yes it is ok but then you need to display correct variables :
UD(t+x) which is not the last UD(t) everyone can see in his transaction tab, neither UD(t+1) which can also be different. It will be difficult to explain that.
N(t+x) and M(t+1) because you use M(t+1) and not M(t). Just before "t" you have M(t), and just after "t" UD(t) is calculated by the blockchain and added to M(t) to give M(t+1).
The definition of UD(t) is : what it is added to members accounts from M(t) to obtain M(t+1).
That is to say M(t+1) = M(t) + N(t)*UD(t), or M(t) = M(t-1) + N(t-1) DU(t-1)
What you can do to avoid to define a new time variable "t+x" is to display :
M(present) = M(t) = M(t-1) + N(t)DU(t) = ... MB
N(present) = ... members
M/N(present) = ... MB/members
DU(present) = Max[DU(t);cM(t)/N(present)]
And use DU(present) for any relative view. But doing so, different people will have different view if they look at different time with N(present) that change between them, calculating different DU(present) and will not be ok between them.
This will also differ from the blockchain and the discrete time protocol and I am not sure different clients integration will differ from the database and protocol like this.
--- another way, following discrete time and uCoin protocol is to use discrete time only ---
Last "t" verification point :
Last calculation time t = ... date / hour / minutes / seconds
M(t-1) = ... MB
N(t) = ... MB
DU(t) = ... MB
M(t-1)/N(t) = ... MB / members
** Next t+1 point **
Next calculation time = t+1 = ... date / hour / minutes / seconds
DU(t+1) = Max[DU(t);c*M(t)/N(t+1)] = protocol formula (= not continuous variation)
** now **
M(t+1) = ... MB
N(now) = ... members
DU(computed) = ... MB = Max (... MB; 10%/day * ... MB / ... members) (for information only)
And always use only DU(t) for any relative view, so all people will have same relative view.
Because people will see DU(t) in their transaction tab, it will be difficult to explain you use DU(present) to make calculation (although it can be mathematically correct). They probably will check calculation with the DU(t) they see in their transactions, and so will not understand what's happening when controlling.

The definition of UD(t) is : what it is added to members accounts from M(t) to obtain M(t+1).

That definition does not reflect the UD block generation of ucoin as explained in the protocol :
UD(t+1) = CEIL(MAX(UD(t) ; c * M(t) / N(t+1) ))
Here we have UD(t+1) added to M(t) to get M(t+1)...
So if we say that LAST UCOIN UD BLOCK TIME is "t" then it contains :

M(t) = Monetary mass including UD(t)
UD(t) = Calculated on M(t-1) and added to M(t-1) to obtain M(t)
N(t) = Nb of members included those of this block, used to calculate UD(t)

So my very first screenshots showing M(t), N(t) from the last block does not seems wrong to me.
And calculating live the UD(t+x, or t+1 or present) based on M(t) to have relative referential give accurate results on display.
Furthermore, all the display is based on the only last valid block of the blockchain so every users will see the same thing. If not, it means that their client is not synchronised correctly with the blockchain.

UD(t+1) = CEIL(MAX(UD(t) ; c * M(t) / N(t+1) ))
Here we have UD(t+1) added to M(t) to get M(t+1)...

Yes I've written it wrongly, what it is added to M(t-1) to obtain M(t), it's true.

So if we say that LAST UCOIN UD BLOCK TIME is "t" then it contains :
M(t) = Monetary mass including UD(t)
UD(t) = Calculated on M(t-1) and added to M(t-1) to obtain M(t)
N(t) = Nb of members included those of this block, used to calculate UD(t)

I don't know if last uCoin UD blocktime (t) contains M(t) or M(t-1), or if M(t) is a calculated value from the blockchain list.

So my very first screenshots showing M(t), N(t) from the last block does not seems wrong to me.

I don't know what is "last block", is it the last uCoin UD blocktime "t" ? Or is it later block ? If it is later block, you don't display N(t) but N(current) which is different.

And calculating live the UD(t+x, or t+1 or present) based on M(t) to have relative referential give >accurate results on display.

Depends of what you mean by "display". In the "transactions" tab people will see UD(t) and UD(t+1) so they won't understand what is this UD(t+x) you display, it cannot be UD(t) neither UD(t+1) so what is it else than UD(computed) which I'm not sure it is an accurate value for people, because it does not fit with what they can control in transactions ?!

Furthermore, all the display is based on the only last valid block of the blockchain so every users >will see the same thing. If not, it means that their client is not synchronised correctly with the >blockchain.

You don't think about the economy and the money when you say that. People won't see the same thing, and they won't understand what is all that curious thing !
Imagine the DU is calculated every 20 days. Then you ask for payment in 1st day "3 DU to pay before next DU", people will say "ok, he ask me 3 current DU, I can check it is 3000 MB" I will pay next week, it is still before next DU. 7 days after, N(t+x) has changed, so DU(current) will be no more 3000 MB, but only let's say 2900 MB.
People won't agree at all of what it is "3 DU", because you destroy the discrete way to do it, that assure DU is the differential value between discrete time from "t" to "t+1" so it is absolutely fix between two steps.
Because of discrete change of N(t), it is absolutely necessary to understand why calculation cannot be something else that discrete changes, and not continuous ones.

Ok, I think I understand what you mean by discrete/continuous in that context.
So the problem I need to deal with is with N.
N is the only value that can change between each UD block, but I can only use the N of the last UD block.
I want to had to my display/calculate problem another one : display the current monetary mass, an important information that the users will ask for.
So I will think about a solution to all that...
Thank you for your precious help and your patience.
Stay tuned !

What is for sure necessary is to make clear distinction between t-1, t, t+1, and t+x = current time = computed, and to be clear when displaying and calculating with Numbers(t-1,t,t+1,computed).

Now, relative values are calculated by dividing with the computed UD(computed) from the values at time t given in the last UD block : M(t), UD(t) and N(t).
All values are accurate, and, most importanty, also on wallets.

It is not correct. DU in relative cannot be something else than 1.
growth calculation must be DU(t)/(M(t-1)/N(t)) or DU(computed)/(M(t)/N(current)) so display is not correct.
If there is display of N(t), then it should be also display of N(current).
So there should be 2 subtabs, tab with "t" data including M(t-1), UD(t), N(t) and tab with "current data" with M(t) DU(computed) and N(current).
Relative values should be calculated with UD(t) and not UD(computed) that will give different views for users if they check at different times between "t" and "t+1".

All referentials values are now based on UD(t), N(t) with t = last UD bloc time.

Can I close the issue ?

Yes to me it seems 100% ok.

done in f448e988bbe1697f4bd83561339ce8a675da094f


doc: Inform about ZFS pool default compression

This pull request didn't trigger Jenkins as its author isn't in the whitelist.
An organization member must perform one of the following:

To have this branch tested by Jenkins, use the "ok to test" command.
To have a one time test done, use the "test this please" command.

Those commands are simple Github comments of the format: "jenkins: COMMAND"

jenkins: please test this

jenkins: test this please


Recognize .bib files as COBOL code

Some people uses .bib files with cobol code, mainly for secondary code or files definition.
This file, for example:

The .bib extension is commonly used by latex, so I think the best thing to do is add you own custom file associations.
https://code.visualstudio.com/docs/getstarted/settings
{
"files.associations": {"*.bib": "cobol"}
 }

Can you give more information (for my own curiosity) why the extension .bib is used?
Lastly, is the first line of the .bib file constant or can you include a comment in it?
The reason I ask, is that vscode & extensions have the ability to "guess" the source file type by looking at the first line, so if the first line has something specific/unique I could do something for you.

We (my company) use .bib files to reuse code, usually for FD file definition:

Doesn't have a pattern, the first line can be anything. We have bib files with comments and without comments hahaha
(and apologies for my weak English)

Hi,
I added support for recognizing a source file as COBOL if the first line was a COBOL comment.
Does this make it better without needing to overload the already used .bib extension?

Okay, time to close it

Have checked out the changes in the weeks?


Guidance provided should persist a reboot e.g. ENA Express

The guidance provided by the tools should persist a reboot e.g. ENA Express script provides commands which only apply at runtime and will not persist a reboot.

Hi Adam,
We did not include a guide to persist network settings through reboot as it can be specific to OS distribution you are using.
Did you consult your OS network settings guide and may be that can help?
If you are still facing issues, do let us know what details of your instance and AMI and we can put together some instructions.
Regards,
Vimal