Xamarin.Forms - LoadingPlaceholder not always shown on initial loading

Description
Some CachedImages skip LoadingPlaceholder and go straight to Source when LoadingPlaceholder is a FileImageSource and Source is a UriImageSource. It seems to only happen to CachedImages visible when the page loads.
Steps to Reproduce

Run the repro project on Android or iOS
Don't scroll

Expected Behavior
Each CachedImage displays the LoadingPlaceholder image, and then downloads and displays the Source image.
Actual Behavior
Most CachedImages do what's expected. Some skip the LoadingPlaceholder and go straight to downloading and displaying the Source image. This results in some CachedImages showing nothing at all, until their Source image has been downloaded. This is more noticeable when the Source image takes a long time to download.
Basic Information

Version with issue: v2.3.1, v2.2.25
Last known good version: N/A
Platform: Android and iOS

Screenshots

This gif shows the problem manifest in the second and third list items.
Reproduction Link / Code
https://github.com/chaselal/ffimageloading-issue
The FFImageLoading cache is cleared during app start up, because the problem is not noticeable if the Source images are already cached.

It's because your views don't have any sizes set initially, so the placeholder is not shown as it's not a destination image. You must at least set width or height and it'll working fine. I'll try to review code if we can do something about it.

@daniel-luberda That doesn't seem to be the problem. I set lots of properties related to height/width, but the problem persists. See https://github.com/chaselal/ffimageloading-issue/blob/810978c7526ec69ae38d794e2c25ba87bdc50c10/Issue872.Pcl/MainPage.xaml#L19-L30

It was related to view size, but I fixed it (please review my commit). Should work fine now. Thank you for such a detailed info! :) It was very useful for me.

I reviewed by posting single comments at https://github.com/luberda-molinet/FFImageLoading/commit/8c2ed921624908f3dc8826814099441841a23084. I did not test the fix yet.
Thanks for this, @daniel-luberda.

@daniel-luberda I just updated to Xamarin.FFImageLoading and Xamarin.FFImageLoading.Forms v2.3.2 and tested on a Samsung Galaxy S7, an Android tablet emulator, and an iPad Air 2 simulator. I see the same result as before. It seems the problem is not fixed in v2.3.2.

Did you clean all bin/obj folders before testing and made sure that you have the same package version in all projects?

Did you clean all bin/obj folders before testing and made sure that you have the same package version in all projects?

Yes. I also updated the repro repository, deleted my local copy, cloned the repository again, and built from that. The problem is still there.

@daniel-luberda I believe the problem can also happen in this case:

Load a list with CachedImages. Use the RecycleElement caching strategy, Each CachedImage should have its LoadingPlaceholder and Source set. Source should be a Uri source to an image that takes a long time to download. LoadingPlaceholder should be an embedded resource or file source.
Fling down the list
Stop scrolling long enough for the visible items to load their Source images
Scroll up the list. On the way, notice that items coming into view display the Source images of the items that loaded while scrolling was stopped, instead of showing their own LoadingPlaceholder. In other words, the items don't show their LoadingPlaceholder when the ListView recycles them and instead they show whatever was loaded before the ListView recycled them.

I don't have a repro project for this case. I noticed it in my closed-source app.

Oops, actually v2.3.2 did fix the issue for me. I just forgot that I left out some image files used as placeholders in the repro app. I think I originally did that so the placeholder loading would fail for the second and third list items (index 1 and 2). Anyway, I can confirm that the problems described in the original post and in https://github.com/luberda-molinet/FFImageLoading/issues/873#issuecomment-354149699 are fixed now. So there's no need to open the issue again.
Thanks for fixing this so soon. I apologize for the confusion.

I can't reproduce it, maybe it's because you're missing some placeholder files:
Setting placeholder failed
System.IO.FileNotFoundException: disk3.png
  at FFImageLoading.DataResolvers.ResourceDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0005b] in C:\projects\ffimageloading\source\FFImageLoading.Droid\DataResolvers\ResourceDataResolver.cs:29
  at FFImageLoading.DataResolvers.WrappedDataResolver+<Resolve>d__2.MoveNext () [0x00020] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\WrappedDataResolver.cs:22
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0
  at FFImageLoading.Work.ImageLoaderTask`3+<ShowPlaceholder>d__107[TDecoderContainer,TImageContainer,TImageView].MoveNext () [0x00299] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:445
Setting placeholder failed
System.IO.FileNotFoundException: disk2.png
  at FFImageLoading.DataResolvers.ResourceDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0005b] in C:\projects\ffimageloading\source\FFImageLoading.Droid\DataResolvers\ResourceDataResolver.cs:29
  at FFImageLoading.DataResolvers.WrappedDataResolver+<Resolve>d__2.MoveNext () [0x00020] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\WrappedDataResolver.cs:22
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0
  at FFImageLoading.Work.ImageLoaderTask`3+<ShowPlaceholder>d__107[TDecoderContainer,TImageContainer,TImageView].MoveNext () [0x00299] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:445
Setting placeholder failed
System.IO.FileNotFoundException: disk3.png
  at FFImageLoading.DataResolvers.ResourceDataResolver.Resolve (System.String identifier, FFImageLoading.Work.TaskParameter parameters, System.Threading.CancellationToken token) [0x0005b] in C:\projects\ffimageloading\source\FFImageLoading.Droid\DataResolvers\ResourceDataResolver.cs:29
  at FFImageLoading.DataResolvers.WrappedDataResolver+<Resolve>d__2.MoveNext () [0x00020] in C:\projects\ffimageloading\source\FFImageLoading.Common\DataResolvers\WrappedDataResolver.cs:22
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <657aa8fea4454dc898a9e5f379c58734>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <657aa8fea4454dc898a9e5f379c58734>:0
  at FFImageLoading.Work.ImageLoaderTask`3+<ShowPlaceholder>d__107[TDecoderContainer,TImageContainer,TImageView].MoveNext () [0x00299] in C:\projects\ffimageloading\source\FFImageLoading.Common\Work\ImageLoaderTask.cs:445


Add "New" example support

We could add creation date metadata to examples and add a "New" label to examples created in the last 15 days, later on we could also allow users to subscribe to new example notifications.

related to #121


feat(cli/help): added codecs support section

@Mikachu2333 should I add more information?

close #191

I'd like to help but I don't have the permission to modify and update the feature branch...

Sent invitation to collaborators

Need re-check


How to pass audience for authorize request

The config object does not seem to support passing an audience for authorize requests. It is not uncommon for providers to require this for jwt based access tokens. Am I missing something in the docs or is this not really supported?

ughhh I feel dumb. Found my answer on the oidc-client repo. For anyone else looking for this (or other params)

For react-oidc use token_request_extras like token_request_extras: {audience: MY-AUDIENCE}


Unpkg

I think unpkg should not be needed for compilation.

Hey @onokumus, super grateful for your contribution! ❤ Looks great - it makes it much nicer! Also easier to work with offline! Just wondering about the one thing above there, otherwise it's good to go 😊


gha: enable debug logs in conformance-clustermesh workflows

Let's enable debug-level logs in conformance-clustermesh workflows, as they might be useful when investigating possible flakes to gather more information.
Link to successful run: https://github.com/cilium/cilium/actions/runs/5256914992/jobs/9498930808?pr=26186

My only concern was would this change affect test execution time. The test run took 18m18s, well within the average run time.

I don't think it should affect the execution time, as it only changes the verbosity of the cilium logs, which are retrieved only in case of failures.

Marking as ready to merge, as reviews are in, and this is a gha change only.


purchasable skins/color schemes

It seems easy enough to load color palette from a JSON file
Will need a new menu to switch between palettes
And a new menu to actually buy them (possibly same as above)
Will also need to learn a lot about the billing API and the in-app purchases API (which might be the same)

Turning in to "epic"


Feature request: PlaceholderAPI?

Having PlaceholderAPI support would open so many possibilities for servertap to become even more useful in my humble opinion.

PlaceholderAPI: https://github.com/PlaceholderAPI/PlaceholderAPI

@koutsie can you talk any more about how you see this working in an ideal world? Would there be new API routes for ServerTap? If so what would they be?
Do you just want to be able to get the placeholder configs?


B5 medley

fail_file also fails on reads
Fix bug in rekey where an error code wasn't checked
Increase coverage
Add buffer unit test
Add is_File concept and checks
Update documentation
Add example program
Demote exceptions to asserts in gentex
Improved commit process
Dynamic block size in custom allocator

This change is

Reviewers: @mellery451 @JoelKatz @bachase
HTML docs link: http://vinniefalco.github.io/nudb

Coverage increased (+1.4%) to 96.708% when pulling 0d6383a6f11bc2869de3a46ec92bb5c6235b602e on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Current coverage is 96.76% (diff: 100%)

Merging #35 into master will increase coverage by 1.42%

@@             master        #35   diff @@
==========================================
  Files            27         28     +1
  Lines          1719       1701    -18
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
+ Hits           1639       1646     +7
+ Misses           80         55    -25
  Partials          0          0

Powered by Codecov. Last update 4bb090c...0d6383a

:lgtm:

Coverage increased (+1.4%) to 96.708% when pulling 97e8c81b691c6e98dc0f05bc191bf00fa2b1167c on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Reviewed 53 of 54 files at r1, 5 of 5 files at r2, 1 of 1 files at r3.
Review status: all files reviewed at latest revision, 7 unresolved discussions.

bench/bench.cpp, line 142 [r3] (raw file):

    Fetcher&& fetcher,
    AddSample&& add_sample,
    PreFetchHook&& pre_fetch_hook,

I don't know enough about this, but I wonder if pre_fetch_hook is always useful/needed - if not, could a default noop() be provided here?

bench/bench.cpp, line 427 [r3] (raw file):

    bench_progress progress(derr, total_ops);

    enum

do we prefer enum class ?

bench/bench.cpp, line 445 [r3] (raw file):

    // Reserve up front to database that run later don't have less memory
    for (int i = 0; i < db_last; ++i)
        for (int j = 0; i < db_last; ++i)

should these be all js here - or are you doing something tricky that I'm missing? If it is the simple inner index, then I guess compare against op_last would make sense too..

bench/bench.cpp, line 482 [r3] (raw file):

    auto const iter_w = 15;

    for(int op_idx=0;op_idx<op_last;++op_idx)

minor nit: space after semicolons?

bench/bench.cpp, line 504 [r3] (raw file):

        auto const min_sample = [&ops_per_sec]{
            for (auto i = 0; i < db_last; ++i)
                if (!ops_per_sec[i][op_fetch].empty())

it's not obvious to me why min_sample only considers op_fetch while max_sample considers the full matrix.

include/nudb/impl/rekey.ipp, line 41 [r3] (raw file):

{
    static_assert(is_File<File>::value,
        "File requiremnts not met");

typo - probably search/replace this particular typo

include/nudb/impl/verify.ipp, line 43 [r3] (raw file):

{
    static_assert(is_File<File>::value,
        "File requiremnts not met");

typo (requirements)

Comments from Reviewable

Review status: all files reviewed at latest revision, 7 unresolved discussions.

Comments from Reviewable

@mellery451 ugh..

Review status: 54 of 59 files reviewed at latest revision, 7 unresolved discussions.

bench/bench.cpp, line 427 [r3] (raw file):
Previously, mellery451 (Michael Ellery) wrote…
> do we prefer `enum class` ?

For an in-function enum, in a benchmark program, not part of public API... I don't think I'm going to get too worked up about it.

Comments from Reviewable

Review status: 54 of 59 files reviewed at latest revision, 6 unresolved discussions.

bench/bench.cpp, line 445 [r3] (raw file):
Previously, mellery451 (Michael Ellery) wrote…
> should these be all `j`s here - or are you doing something tricky that I'm missing? If it is the simple inner index, then I guess compare against `op_last` would make sense too..

Looks like a bug

include/nudb/impl/rekey.ipp, line 41 [r3] (raw file):
Previously, mellery451 (Michael Ellery) wrote…
> typo - probably search/replace this particular typo

Done.

include/nudb/impl/verify.ipp, line 43 [r3] (raw file):
Previously, mellery451 (Michael Ellery) wrote…
> typo (requirements)

Done.

Comments from Reviewable

Coverage increased (+1.4%) to 96.767% when pulling c3a27d3d197e725fdadbd4e73728956b336203b3 on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Review status: 54 of 59 files reviewed at latest revision, 5 unresolved discussions.

bench/bench.cpp, line 142 [r3] (raw file):
Previously, mellery451 (Michael Ellery) wrote…
> I don't know enough about this, but I wonder if pre_fetch_hook is always useful/needed - if not, could a default noop() be provided here?

It's hard to write a default here because `PreFetchHook` is a template and lambdas have unutterable types. If we make this a `std::function` I could add a default, but since this is a self-contained file I prefer to just leave it as a lambda.

bench/bench.cpp, line 445 [r3] (raw file):
Previously, vinniefalco (Vinnie Falco) wrote…
> Looks like a bug

That's a copy/paste bug. Though it won't effect results, it just didn't reserve the space for all the indexes. Fixed.

bench/bench.cpp, line 482 [r3] (raw file):
Previously, mellery451 (Michael Ellery) wrote…
> minor nit: space after semicolons?

Fixed

bench/bench.cpp, line 504 [r3] (raw file):
Previously, mellery451 (Michael Ellery) wrote…
> it's not obvious to me why `min_sample` only considers `op_fetch` while `max_sample` considers the full matrix.

Inserts always start with a database with zero items, I skip that because `fetch` will not have a sample at zero. However, this can be simplified to just use the batch_size. Fixed.

Comments from Reviewable

Reviewed 6 of 6 files at r4.
Review status: all files reviewed at latest revision, 4 unresolved discussions.

Comments from Reviewable

Coverage increased (+1.4%) to 96.767% when pulling 00019d671c0769f2efd9a96183caf6cc94a9cf50 on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Coverage increased (+1.3%) to 96.649% when pulling 00019d671c0769f2efd9a96183caf6cc94a9cf50 on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Coverage increased (+1.4%) to 96.708% when pulling e24ef6026f303dfef3fd9ec3c5c0483bf5d99ea7 on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Reviewed 48 of 54 files at r1, 5 of 5 files at r2, 1 of 1 files at r3, 6 of 6 files at r4, 1 of 1 files at r5.
Review status: 55 of 59 files reviewed at latest revision, 8 unresolved discussions.

bench/bench.cpp, line 258 [r3] (raw file):

        auto pre_fetch_hook = [&ts, &ec]() {
            // Open the close the db so the commit thread does not confound the
            // timings

Typo in the comment?  Should it read Close then open the db?

doc/master.qbk, line 215 [r3] (raw file):

The application-defined constant is a 64-bit unsigned integer which the
caller may set to any value. This value can be retrieved on an open database,
where it wil lbe equal to the value used at creation time. This constant can

typo, wil lbe

include/nudb/verify.hpp, line 31 [r5] (raw file):

        @li @b 1 Fast algorith
    */
    int algorithm;                      // 0 = normal, 1 = fast

Make an enum?

test/buffer.cpp, line 25 [r5] (raw file):

        using buffer = nudb::detail::buffer;
        static_assert(std::is_default_constructible<buffer>::value, "");
#if 0

Buffer requirements are changing?

Comments from Reviewable

Reviewed 4 of 4 files at r6.
Review status: all files reviewed at latest revision, 8 unresolved discussions.

Comments from Reviewable

Review status: 56 of 59 files reviewed at latest revision, 21 unresolved discussions.

bench/bench.cpp, line 507 [r5] (raw file):

            result_dict const& dict, std::uint64_t key) {
            dout << std::setw(col_w) << std::fixed << std::setprecision(2);
            // Take the average of all the values, or "NA"" if none collected

Minor nit: redundant double quote after NA

bench/bench.cpp, line 521 [r5] (raw file):

            }
        };
        for (std::uint64_t n = 0; n <= max_sample; n = n ? 10 * n : 10)

This ternary is really ugly and I'm surprised it doesn't spew warnings.  Is there a point to testing with n == 0? Why not start with 1 instead?

doc/master.qbk, line 214 [r5] (raw file):

The application-defined constant is a 64-bit unsigned integer which the
caller may set to any value. This value can be retrieved on an open database,

"retrieved on an open" -> "retrieved from an open"

include/nudb/basic_store.hpp, line 77 [r5] (raw file):

        std::size_t rate = 0;
        time_point when = clock_type::now();

Rogue white space?

include/nudb/basic_store.hpp, line 156 [r5] (raw file):

        @par Requirements

Rogue white space?

include/nudb/basic_store.hpp, line 160 [r5] (raw file):

        @par Thread safety

Rogue white space?

include/nudb/posix_file.hpp, line 117 [r5] (raw file):

    /** Remove a file from the file system.

        It is not an error to attempt erasing a file that does not exist.

"to attempt erasing" -> "to attempt to erase"

include/nudb/win32_file.hpp, line 135 [r5] (raw file):

    /** Remove a file from the file system.

        It is not an error to attempt erasing a file that does not exist.

"to attempt erasing" -> "to attempt to erase"

include/nudb/detail/arena.hpp, line 136 [r5] (raw file):

        return nullptr;
    auto const p = const_cast<std::uint8_t*>(
        reinterpret_cast<uint8_t const*>(this + 1)

Why do the const_cast dance here? It doesn't seem needed: alloc isn't const so, this isn't either. Why not simply: auto p = reinterpret_cast<uint8_t*>(this + 1) + used_;

include/nudb/detail/cache.hpp, line 80 [r5] (raw file):

    // Constructs a cache that will never have inserts
    cache_t() = default;

Rogue white space

include/nudb/impl/basic_store.ipp, line 18 [r5] (raw file):
This is strictly unnecessary: per §16.1 ¶4 of the C++ standard:

After all replacements due to macro expansion and the defined unary operator have been performed, all remaining identifiers and keywords, except for true and false, are replaced with the pp-number 0

include/nudb/impl/basic_store.ipp, line 568 [r5] (raw file):

    cache c0(s_->kh.key_size, s_->kh.block_size, "c0");
    cache c1(s_->kh.key_size, s_->kh.block_size, "c1");
    // 0.63212 ~= 1 - 1/e

Interesting fact. Cryptic comment.

include/nudb/impl/basic_store.ipp, line 668 [r5] (raw file):

    // This might be slightly better than the old
    // view since there could be fewer spills.
    m.lock();

FYI: If any of the operations below throw then m will stay locked. I haven't verified whether they do or not.

Comments from Reviewable

Reviewed 47 of 54 files at r1, 4 of 5 files at r2, 1 of 1 files at r3, 6 of 6 files at r4, 1 of 1 files at r5.
Review status: 56 of 59 files reviewed at latest revision, 21 unresolved discussions.

Comments from Reviewable

Coverage increased (+1.3%) to 96.665% when pulling aaa647ff22230e11100d280c617c7c6c17062b52 on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Review status: 56 of 59 files reviewed at latest revision, 21 unresolved discussions.

bench/bench.cpp, line 521 [r5] (raw file):
Previously, nbougalis (Nik Bougalis) wrote…
> This ternary is really ugly and I'm surprised it doesn't spew warnings.  Is there a point to testing with `n == 0`? Why not start with `1` instead?

I used to report the timing for inserting the initial batch into the zero-size database. When I took that out I missed changing the loop bounds. Fixed.

Comments from Reviewable

Coverage increased (+1.2%) to 96.548% when pulling 94d4942ce7021fb5c5dd15a4d0e0fa290156663c on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Coverage increased (+1.3%) to 96.608% when pulling<PHONE_NUMBER>8a3214b76044b701cf7bf613913b19 on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Coverage increased (+1.4%) to 96.725% when pulling<PHONE_NUMBER>8a3214b76044b701cf7bf613913b19 on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

Review status: 55 of 59 files reviewed at latest revision, 21 unresolved discussions.

bench/bench.cpp, line 521 [r5] (raw file):
Previously, seelabs (Scott Determan) wrote…
> I used to report the timing for inserting the initial batch into the zero-size database. When I took that out I missed changing the loop bounds. Fixed.

I notice that `n` now starts from `100`. I suspect that's what you want, but just want to make sure.

Comments from Reviewable

Review status: 55 of 59 files reviewed at latest revision, 20 unresolved discussions.

include/nudb/basic_store.hpp, line 77 [r5] (raw file):
Previously, nbougalis (Nik Bougalis) wrote…
> Rogue white space?

No idea what you're going on about

include/nudb/verify.hpp, line 31 [r5] (raw file):
Previously, bachase (Brad Chase) wrote…
> Make an enum?

I could make it an `enum` but I don't want to draw that much attention to this member.

include/nudb/detail/arena.hpp, line 136 [r5] (raw file):
Previously, nbougalis (Nik Bougalis) wrote…
> Why do the `const_cast` dance here? It doesn't seem needed: `alloc` isn't `const` so, `this` isn't either. Why not simply: `auto p = reinterpret_cast(this + 1) + used_;`

It was required to compile on all our targets. Maybe that's changed. But I don't know that I want to risk breaking it.

include/nudb/impl/basic_store.ipp, line 18 [r5] (raw file):
Previously, nbougalis (Nik Bougalis) wrote…
> This is strictly unnecessary: per §16.1 ¶4 of the C++ standard:
>
> > After all replacements due to macro expansion and the defined unary operator have been performed, all remaining identifiers and keywords, except for `true` and `false`, are replaced with the pp-number 0

That is true, but this define serves two purposes: to illustrate to the reader that its meant to be changed, and to provide a place where someone can edit the value and easily make it 1 or 0 without deleting the line.

include/nudb/impl/basic_store.ipp, line 568 [r5] (raw file):
Previously, nbougalis (Nik Bougalis) wrote…
> Interesting fact. Cryptic comment.

I'm open to suggested wording but I'm not sure that it matters. The exact number is not so important, only that it is less than one and more than 0.5.

include/nudb/impl/basic_store.ipp, line 668 [r5] (raw file):
Previously, nbougalis (Nik Bougalis) wrote…
> FYI: If any of the operations below `throw` then `m` will stay locked. I haven't verified whether they do or not.

That's fine, nothing is allowed to throw. Even so, the caller provides `m` which goes out of scope on a stack unwinding so we're good.

test/buffer.cpp, line 25 [r5] (raw file):
Previously, bachase (Brad Chase) wrote…
> Buffer requirements are changing?

Eventually I would like to elevate `buffer` to a public interface. This commented out code serves as a reminder.

Comments from Reviewable

Coverage increased (+1.4%) to 96.725% when pulling 4afc7350679bfd0fe254aafff3da9b49b44838b9 on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

OK

Reviewed 1 of 1 files at r7, 4 of 4 files at r8, 3 of 3 files at r9.
Review status: all files reviewed at latest revision, 16 unresolved discussions.

Comments from Reviewable

Review status: 58 of 59 files reviewed at latest revision, 16 unresolved discussions.

bench/bench.cpp, line 258 at r3 (raw file):
Previously, bachase (Brad Chase) wrote…
> Typo in the comment?  Should it read `Close then open the db`?

Done.

Comments from Reviewable

Review status: 58 of 59 files reviewed at latest revision, 16 unresolved discussions.

include/nudb/posix_file.hpp, line 117 at r5 (raw file):
Previously, nbougalis (Nik Bougalis) wrote…
> "to attempt *erasing*" -> "to attempt *to erase*"

Done.

include/nudb/verify.hpp, line 31 at r5 (raw file):
Previously, vinniefalco (Vinnie Falco) wrote…
> I could make it an `enum` but I don't want to draw that much attention to this member.

Done.

Comments from Reviewable

Coverage increased (+1.5%) to 96.842% when pulling c062611321bf83556875488a6deddc6d10c4f389 on b5 into 4bb090cc191ba719351a75fb846329f77cb0d83c on master.

All of the current comments have been addressed, is this ready to merge?

Review status: 58 of 59 files reviewed at latest revision, 10 unresolved discussions.

doc/master.qbk, line 215 at r3 (raw file):
Previously, bachase (Brad Chase) wrote…
> typo, `wil lbe`

Done.

Comments from Reviewable

:neckbeard::+1:


Terminal commands don't work in a terminal window inside Jetbrains..

..IDEs
For example the command git push doesn't do anything.
I don't know if there's an easy solution here.
One option would be to make terminal commands work in IDE contexts as well as the terminal (say by adding tag(): user.git  to the Jetbrains Talon file) , but the user isn't always using the terminal in an IDE context and it could be non-ideal to have Git commands triggering accidentally while writing code.
Talon v0.2.0-8

Hi,
It will be really awesome to get all terminal voice commands in Terminal tool tab somehow.


New syntax for Java wrappers

Currently, to wrap a Java object (a feature that's used throughout the FFI to keep Eta's polymorphism), the syntax is:
data {-# CLASS "java.util.LinkedList" #-} LinkedList a = MkLinkedList (Object# (LinkedList a))

There are currently two proposals for the new syntax:

This is the Haskell-y solution that's nice on the eyes.

data LinkedList a = MkLinkedList (@java.util.LinkedList a)

We lose the Haskell-iness in exchange for a bit of clarity that the a Eta type variable corresponds to the a generic type parameter.

data LinkedList a = MkLinkedList (@java.util.LinkedList<a>)

Comments/feedback? Other syntax proposals are welcome as well.

Both of those syntax proposals are much better than the current version.
I think the second one is a bit better, as it makes it clearer that it is dealing with the Java class java.util.LinkedList<a>.

I prefer the second as well, because the first looks like a is a field in the LinkedList constructor.

the second is better

Both are a bit confusing, however, because they don't give a name for the data constructor. Wouldn't it be something like
data LinkedList a = MkLinkedList (@java.util.LinkedList a)

or
type LinkedList a = @java.util.LinkedList a

instead?

@mitchellwrosen Thanks for the catch! I'll edit the original post.

Ah, in that case I much prefer the first!

From @java.util.LinkedList we already know that we are dealing with a java object. When we add the type variable a to (@java.util.LinkedList a) what else could it be than a generic type variable to the java class? I do not think that we gain anything by proposal number two. I.e., I much prefer proposal number one.

Fair enough :) The majority wants (1) and it also it slightly easier on the parser side to implement, so we'll go with that! If anyone is interesting in taking a stab at this, I'd be happy to guide them through the required steps.

I could give it a try, if you do not mind that I will only start working on it in about two weeks. (I am very busy in the moment).

Yeah no problem! It would be best if you can ping on the typelead/eta channel on Gitter once you're ready.

If @alexander-at-github drops the ball I'd be happy to pick it up =)

I also prefer one as it's more concise without compromising readability/meaning.

@mitchellwrosen: In case I step back, I will let you know.

Relevant files to take a look at:
compiler/ETA/Parser/Lexer.x - Define a new token type for java identifiers (@[java-identifier]). Make a rule to recognise this token under special conditions (when parsing the types in a data decl).
compiler/ETA/Parser/Parser.y - Add the token you defined above. Add a special rule for parsing data decls. When you parse it, you should change it around to the transformation above. This made require some major changes to how data decls are parsed (like more values returned by the parser monadic context).

Hey @rahulmutt, I had an accident about two weeks ago and I have been offline cause of that. I will not be able to implement the issue any time soon. Sorry, for that!
@mitchellwrosen: please feel free to adopt the issue.

Sure, I can take it over. @rahulmutt would you mind assigning me, if no one else is working on this yet?

@alexander-at-github No worries, get well soon!
@mitchellwrosen Sure, you can go ahead.

@mitchellwrosen Status? I can give more hints as required.

Status is I'm still working thru an alex/happy tutorial. Sure, if you have any hints in mind please dump them here - I was going to hop into gitter when I get back to it.

Ok cool, just wanted to know if you needed anything form my side. Sure, come on Gitter when you start hacking.


Add ability to set TTL per grain type or document

We have a large number of grain state documents in couchbase storage, most of which are no longer required once the processing they are used for has completed (which could take minutes to weeks depending on the type of grain and other factors).
Being able to set an expiry/ttl per grain type, or per document, and letting couchbase internally manage removal of expired documents would help us prevent disk space issues.
Worst case, being able to set a default expiry/ttl for the bucket would be better than not having the documents expire at all.
Please consider adding this feature.
Note: we are using version 4.6.2-3905 Enterprise Edition (build-3905).

Hi @mrd1234
This is something we can look into for you. This project needs some overdue maintenance.

Hi Mike,
I've gone and created a feature branch using gitflow and made the required changes.
Mind if I push them up to github?

Yeah, Pull Requests are very welcome.


EventMask should also Into

As per #554, xi_query_device and functions immediately using DeviceId have an Into<DeviceId> generic. However, xinput_xi_select_events takes in an EventMask parameter which contains a DeviceId and this requires a manual .into().
On a completely unrelated note (although it is related to EventMask), we eventually need to turn EventMask into Vec<u32> to call xi_select_events. It would be kind of nice if bit fields could automatically .into() the correctly sized bitfield array. Currently we have to do something like
let event_mask = EventMask {
  deviceid: Device::ALL.into(),
  mask: [(XIEventMask::A | ... | XIEventMask::Z).into()].to_vec()
};

which is kind of uncool but it works I guess.

However, xinput_xi_select_events takes in an EventMask parameter which contains a DeviceId and this requires a manual .into().

Uhm... so, how would you solve this? Right now the prototype is:
pub fn xi_select_events<'c, 'input, Conn>(conn: &'c Conn, window: xproto::Window, masks: &'input [EventMask]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
where
    Conn: RequestConnection + ?Sized,

Do you want this to be changed to the following?
pub fn xi_select_events<'c, 'input, Conn, Mask>(conn: &'c Conn, window: xproto::Window, masks: &'input [Mask]) -> Result<VoidCookie<'c, Conn>, ConnectionError>
where
    Conn: RequestConnection + ?Sized,
   Mask: Into<EventMask>,

If so, then this would require to copy the masks slice into a Vec just for the conversion (let masks = masks.iter().map(|x| x.into()).collect::<Vec<_>>()). That's not really great and I think I'd prefer to avoid this unnecessary cost.

It would be kind of nice if bit fields could automatically .into() the correctly sized bitfield array. Currently we have to do something like

Sorry, I don't understand. What is a correctly sized bitfield array? The enum XIEventMask already implements conversion to u8, u16 and u32.
The XML for EventMask is
    <struct name="EventMask">
        <field type="DeviceId" name="deviceid" altenum="Device" />
        <field type="CARD16"   name="mask_len" />
        <list type="CARD32" name="mask" mask="XIEventMask">
            <fieldref>mask_len</fieldref>
        </list>
    </struct>

This says that the list has elements of type CARD32 which is exactly what we are generating. I guess one could do something with the mask attribute, but I am not quite sure what....

A bit unrelated, but why are you doing mask: [(XIEventMask::A | ... | XIEventMask::Z).into()].to_vec()? What's wrong with vec![(XIEventMask::A | ... | XIEventMask::Z).into()]?

I just re-read the title of this issue:

EventMask should also Into

Well... I guess you mean XIEventMask and not EventMask.
This is the definition of DeviceId:
pub type DeviceId = u16;

We have this implementation already:
impl From<XIEventMask> for u32 {

You are basically asking for From<XIEventMask> for u16. How would that impl work? XIEventMask::BARRIER_LEAVE is the largest value and has the value 1 << 26. That does not fit into a u16, which is why that impl is not generated.

Well... I guess you mean XIEventMask and not EventMask.

I am thinking of
struct x11rb::protocol::xinput::EventMask<D: Into<DeviceId>> {
  deviceid: D,
  // ...
}

So we can avoid the manual <Device as Into<u16>>::into() when assigning Device::ALL or Device::ALL_MASTER to the deviceid field of xinput::EventMask, much like when we pass Device to the xinput:: set of functions that take in Into<DeviceId>, e.g.
pub fn xi_query_device<Conn: ?Sized, A>(
    conn: &Conn,
    deviceid: A
) -> Result<Cookie<'_, Conn, XIQueryDeviceReply>, ConnectionError>
where
    Conn: RequestConnection,
    A: Into<DeviceId>,

It's not the biggest deal in the world but I am a fan of not having to write .into() whenever possible

A bit unrelated, but why are you doing mask: [(XIEventMask::A | ... | XIEventMask::Z).into()].to_vec()? What's wrong with vec![(XIEventMask::A | ... | XIEventMask::Z).into()]?

Mostly just spaghetti code at the moment. both options are OK for the moment but this pattern might show up more than once within x11 (although I am not quite sure about that). Where you have a bitfield, which is passed to a function as an array of uint8_t or uint32_t, or whatever, and a size parameter for however many values are in the array. This could be XInput specific, for when they decide to add an additional 6 or more fields to XIEventMask, though.

struct x11rb::protocol::xinput::EventMask<D: Into<DeviceId>> {
  deviceid: D,
  // ...
}

Uhm. How would we know that the deviceid member needs special treatment? In the XML, it is just a normal field and it has type DeviceId:
    <struct name="EventMask">
        <field type="DeviceId" name="deviceid" altenum="Device" />
        <field type="CARD16"   name="mask_len" />
        <list type="CARD32" name="mask" mask="XIEventMask">
            <fieldref>mask_len</fieldref>
        </list>
    </struct>

Also, when receiving, we could only provide the "actual" type, i.e. EventMask<DeviceId> in your version.
The generated code is already huge and I don't think adding Intos everywhere helps with that. And it would also mean that the binary size becomes larger thanks to copies from monomorphisation.
Sorry, I am not convinced that this is a good idea.

makes sense. i'll close this for now.


Fix calls to Netfix API

Fixes #192
Looks like Netflix is no longer using the build identifier in the API URL, and instead uses the string mre.
Please test because I don't know if this is region-related, although 3 different people reported it in the issue.
For testing:
chrome.zip
firefox.zip

Thank you, this update fixed it for me.

Thank you so much, it works perfectly for me!


Source Control panes are resized unexpectedly

Issue Type: Bug
When I switch to "Source Control" (Ctrl+Shift+G) the height of pane with changes becomes low unexpectedly.
To repro

Ctrl+Shift+G, resize panes equally or make lower pane longer than upper one
Ctrl+Shift+E
Ctrl+Shift+G, observe the bug, height of upper pane (Source control providers) becomes much larger.

VS Code version: Code 1.32.3 (a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4, 2019-03-14T23:38:49.842Z)
OS version: Linux x64 4.15.0-46-generic

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz (4 x 3189)

GPU Status
2d_canvas: enabledchecker_imaging: disabled_offflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onnative_gpu_memory_buffers: disabled_softwarerasterization: disabled_softwaresurface_synchronization: enabled_onvideo_decode: unavailable_offwebgl: enabledwebgl2: enabled

Load (avg)
3, 2, 2

Memory (System)
15.55GB (0.88GB free)

Process Argv
--unity-launch

Screen Reader
no

VM
0%

Extensions (9)

Extension
Author (truncated)
Version

Bookmarks
ale
10.3.0

xml
Dot
2.4.0

json-tools
eri
1.0.2

vscode-highlight
fab
1.3.4

todo-tree
Gru
0.0.125

python
ms-
2019.2.5558

cpptools
ms-
0.21.0

vscode-docker
Pet
0.6.1

incremental-search
sie
0.2.1

This has been fixed in the latest insider release.


Added responsive left menu navigation.

@jacobclevenger there is an interested situation that I didn't think of before that I just noticed when reviewing your branch. All of the pages need to support a responsive top menu (main site nav) however some pages also need to support a responsive left menu. I am not sure where to put the toggles for both of those or how they would look/work together.
We have these issues in the design project for this repo:

https://github.com/thenewboston-developers/Website/issues/30 - top nav/header
https://github.com/thenewboston-developers/Website/issues/39 - left menu

@kristykjlee we should probably work on these together to make sure the design can support both

For the navigation links in the top nav it is pretty common to put a button on the right of the nav menu and have a dropdown come from that.


Unable to import github.com/dolthub/doltgresql/postgres/*

Hi Dolt creators,
Inspired by your blog post, I'm interested in using the postgres package to do some MySQL<->Postgresql transpiling tasks. However, I found that go build failed with:
../../go/pkg/mod/github.com/dolthub/doltgresql@v0.11.1/postgres/parser/lex/predicates.go:59:17: undefined: reservedKeywords

After checking the contribution guide, I learned that the parser package relies on some source files generated by doltgresql/postgres/parser/build.sh. However, when importing the package in my project via import "github.com/dolthub/doltgresql/postgres/parser/types", it seems impossible to run the script manually since the go mod cache is a read-only directory:
mkdir: parser/gen: Permission denied
./build.sh: line 12: parser/gen/types_regex.tmp: No such file or directory

Could you consider keeping the generated files in the source tree to make the project more compatible with the standard Go toolchain? This would simplify the build process for users who want to integrate the postgres package into their projects.
I appreciate your time and look forward to your feedback.

Hi @fanyang01,
This is an important point I don't think we had considered. We'll discuss internally and get back to you.


Release of ARM64 Supported Binaries

I was trying to build an arm64 image for terraform-resource package, but it was giving an issue as terraform-provider-stateful binary is not available for arm64 platform. I was able to build the linux binaries of terraform-provider-stateful for arm64 architecture locally without any code changes and verified it via file command.
arm139@ubuntuarm139:~/terraform-provider-stateful$ file release/terraform-provider-stateful_v1.1.0-6-g6d4f6c9-linux-arm64
release/terraform-provider-stateful_v1.1.0-6-g6d4f6c9-linux-arm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, Go BuildID=m-JJeA6y2-oUaQ6iUxiY/pimZLTqzv6CNoQcA7eNI/_cECx7YHOjJyB1U2gB4b/3uFouE3xhWtBIs9a_7Jr, not stripped

I am unable to find any arm64 specific binary in its releases. Do you have any plan to release the arm64 binaries?
If required, I am happy to help.

Hi! Yeah, haven't envisioned demand for arm64 when I released it last time, definitely need to add it.
I'm curios, what is terraform-resource?

Here it goes https://github.com/ashald/terraform-provider-stateful/releases/tag/v1.2.0 - thanks for helping this happen!


Cashier Braintree - subscription('plan')->cancel() not canceling braintree subscription when subscription is pending.

Cashier Version: 2.0
Laravel Version: 5.8.28
PHP Version: 7.2.19
Database Driver & Version: mysql  Ver 14.14

Description: Cashier Braintree - subscription('plan')->cancel() not filling ends_at if subscription is still pending. (I'm unsure if it's being canceled on the braintree side of things but there is no indication that it is.)
Steps To Reproduce: Subscribe user / cancel while subscription is still pending
note: I noticed that $subscription->billingPeriodEndDate is null when the subscription is pending. I'm no expert, but perhaps an if statement that calls cancelNow() if this value is null. I'm not sure in what other scenarios $subscription->billingPeriodEndDate would be null. If that's the only time then that should fix the issue.

Cashier Braintree isn’t maintained anymore unfortunately.


It supports multiple data source inputs and is used as a pure detection engine

Summary
I want to input into a DB (e.g. MySQL Clickhouse) to read the various parts of the HTTP that have been stored (http_url, http_reponse_body, http_param), in fact, offline detection logs, can we support it?

Yeah this is a very valid use case, you just need to write a program that
reads from DB and calls coraza API to run the analysis. Have you find any
inconvenience doing so?
On Mon, 13 Nov 2023, 10:16 键盘上的少侠, @.***> wrote:

Summary
I want to input into a DB (e.g. MySQL Clickhouse) to read the various
parts of the HTTP that have been stored (http_url, http_reponse_body,
http_param), in fact, offline detection logs, can we support it?
—
Reply to this email directly, view it on GitHub
https://github.com/corazawaf/coraza/issues/916, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAXOYASU2OHNMO43ZJXPD3DYEHQORAVCNFSM6AAAAAA7I2KB2SVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4TAMRRGI3TKNI
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>


Rounded student loan repayments to nearest pound

Closes #24

Oh, so basically we want the floor value of the given result.

Math.floor() will do the trick. I hope thats what we want here.


How to parse streams of data using nom-derive

We're processing zip files, which contain a list of CentralDirectoryRecords concatenated together.  Each individual one looks similar to:
#[derive(Nom)]
#[nom(LittleEndian)]
#[derive(Debug)]
pub struct CentralDirectoryRecord {
  pub x: u16,
  ...
  #[nom(Count = "file_name_length")]
  file_name: Vec<u8>,
}

Note the variable file length.  We have a std::fs::File read stream.  Created as such:
let reader = file.bytes();

There are 0..x of these 'CentralDirectoryRecords'.  We cannot take specific byte counts, as the record lengths are not known prior to parsing them.  We also cannot store the entire directory in memory (as it is too large).  Is there a similar function to nom::bytes::streaming::take_till in nom-derive which will allow us to repeatedly process a stream of unknown length until some condition is true?

Hi,
I am not sure I understand the problem.
If I'm correct, file.bytes() returns an iterator over bytes. Unfortunately, nom itself is not designed to work with iterators or readers, but mostly slices or strings. Using nom combinators will only return a parsed object, Incomplete or an error.
In other words, nom and nom-derive can solve one part of the problem (parsing an item once you have the bytes), but not the logic to call the read() function.
One solution is to fill a buffer, call parse to get a result. If you don't have enough bytes, you'll get an Incomplete (and needs to refill or extend your buffer), or you get an object. After using the object, you'll have to consume bytes (and shift the buffer).
For example, the pcap-parser crate works with streams (huge pcap files) by using a circular buffer and some functions to control when to refill the buffer, etc. You can find an example in the crate documentation, and the implementation of next. This may appear a bit complex, but is the most efficient way to parse items (not calling read every few bytes), and gives you fine control over the buffer and the structs.
One other solution is to use another derive crate, that would be Read-oriented. For example, binread works similarly to nom-derive, but with readers. This should be faster to implement, at the cost of being a bit less efficient (but maybe this is not your hardest constraint?)


cheat not working

Hello,
Xena Plugins are not working after latest CSGO update. (jdk 8)
I installed jdk 11 it still does not work.

pls help
Emre

@cunyilmaz make sure you're in game before running the cheat

Thank you so much :)


Capability Statement SMART on FHIR is not MUST

SMART on FHIR is not MUST – it is a SHOULD

29/5 Agreed to remove the sentence referring to SMART on FHIR endpoints being required to be advised.

Hello @heathfrankel  ,
I'm pleased to announce that the changes related to this ticket are now available in version 0.0.6, which has already been deployed to the server.
Please re-test the changes. If everything is okay, you may close this ticket. If you encounter any issues or do not observe the changes related to this ticket, please provide details here.
Thank you.
https://inferno.hl7.org.au/


CSS3 support

@mrkn per issue #5 and CSS3 spec, this adds support for rgb(), rgba(), hsl() and hsla().
Organization of the code may need some work.  Tests included to cover range-clamping described in the CSS spec.

@nanobowers Thank you for your contribution!