[8.0.4][iOS] finishTransaction promise never finishes

Version of react-native-iap
8.0.4
Version of react-native
0.67.2
Platforms you faced the error (IOS or Android or both?)
iOS
Expected behavior
calling finishTransaction marks the transaction as finished
Actual behavior
Any code after the await RNIap.finishTransaction is not executed, and the transaction is reattempted after each relaunch of the app.
Tested environment (Emulator? Real Device?)
Real device
Steps to reproduce the behavior
Purchase a product in sandbox, call finishTransaction, check if some code after the promise is executed.
Here is my listener:
purchaseUpdatedListener = RNIap.purchaseUpdatedListener(
    async (purchase: RNIap.InAppPurchase | RNIap.SubscriptionPurchase) => {
      const receipt = purchase.transactionReceipt;

      try {
        if (receipt) {
          const decodedReceipt = await decodeAppleReceipt(receipt);
          const isValid = await isSubValid(decodedReceipt);

          if (isValid) {
            const { latest_receipt_info: latestReceipts }: any = decodedReceipt;
            const sortedReceiptInfo = latestReceipts.sort(
              (
                a: { original_purchase_date_ms: number },
                b: { original_purchase_date_ms: number },
              ) => b.original_purchase_date_ms - a.original_purchase_date_ms,
            );
            let latestReceiptInfo = sortedReceiptInfo[sortedReceiptInfo.length - 1];
            console.log(latestReceiptInfo);

            const subPrice = await getSubPrice(latestReceiptInfo.product_id);
            const subDuration = getSubDuration(latestReceiptInfo.product_id);

            latestReceiptInfo = {
              ...latestReceiptInfo,
              subscription_price: subPrice,
            };

            // Persist the purchase on backend API
            const persistedPurchase = await persistSubscriptionIOS(latestReceiptInfo, sessionId);
            const persistedPurchaseId: string = persistedPurchase.persistPurchase.id;

            latestReceiptInfo = {
              ...latestReceiptInfo,
              persisted_purchase_id: persistedPurchaseId,
              source: 'ios',
              subscription_duration: subDuration,
            };

            // Activate the subscription on backend API
            const deliveryResult = await activateSubscription(latestReceiptInfo, sessionId);

            if (isSuccess(deliveryResult)) {
              console.log('deliveryResult is true');
              await RNIap.finishTransaction(purchase, false);
              console.log('finish transaction done');
              onSuccess?.();
            }
          }
        }
      } catch (error) {
        console.error(error);
      }
    },
  );

The console.log of finish transaction done is never executed, neither my onSuccess callback. However the console.log before finishTransaction is logged.

I'm running into this too. Could this be related to the changes in #1637? https://github.com/dooboolab/react-native-iap/commit/b80d86a8dec4436c732e7b8a13c5ebc548e77000#diff-f5845f8cdcafa3f8ab197caa911871c32772df9036f11d7cf5a33a2e23d430c6L49-R51

I am also having the same issue

Same issue, downgraded to 7.5.6 too.

I am experiencing this issue as well.

Same here, downgraded to 7.5.6 to resolve issue.

Same here...

This seems to be fixed for me in 8.0.5

This problem definitely persists in 8.0.5. How are you implementing it., @aijcoa?

I still have the same issue in v8.0.5. @aijcoa Can you please provide more info on how you managed to solve it?

In looking into this, the main issue is that the resolve/reject blocks are never called in finishTransaction() in RNIapIos.swift.
    @objc public func  finishTransaction(         _ transactionIdentifier: String,         resolve: @escaping RCTPromiseResolveBlock = { _ in },         reject: @escaping RCTPromiseRejectBlock = { _, _, _ in }     ) {         finishTransaction(withIdentifier: transactionIdentifier)     }
simply adding a resolve(nil) call after finishTransaction() solves the issue, but is a brittle solution here.

@taskrik @mikeportanova I updated to 8.0.5 with the same code in the original post and finish transaction done is logged , I tested with an iOS product, not a subscription (I will try that tomorrow). I'll keep this issue open.

Thank you for your response @aijcoa! Yeah, I am trying to use it with subscriptions. Maybe the issue is with that. I'll try the products tomorrow to see if I get the same results.

@taskrik same, I am trying with renewable subscriptions. Nothing ever resolves or rejects the Swift promise created by finishTransaction(), so it never completes, even after the Swift code has called SKPaymentQueue.default().finishTransaction(transaction)

I'm also testing with renewable subscriptions, failed on 8.0.4, but haven't tried 8.0.5

@mikeportanova have you tried receipt validation with subscriptions? I'm getting 21199 error response.

Any update ?

@josejhj2 sorry for the delay. No, I am not receiving that error, but I am doing receipt validation with an auto-renewing subscription. Are you still getting that error?

Yes @mikeportanova still not receiving response ,   Can you share you code snipets ?

@mikeportanova, yes, I'm receiving validation error,  but on Version 7.5.6 because of the finisTransaction issue. What version are you on?

@josejhj2 Have you tried version 8.0.5 , i am not receiving any error but finshitransaction not giving any response
just stuck in behind ?

@eneffwork I was asking @mikeportanova about a different error when calling validateReceiptIos().
I'm aware that 8.0.5 doesn't throw an error on finshitransaction(), but I still need a response so app execution can continue after finshitransaction(), that's why I'm still on 7.5.6.

@josejhj2 Can you tell me your RN version because when i check with 7.5.6 i got undefined in response .

@eneffwork RN version is: 0.64.2

Got it i have 0.66.4 , so that's why i was not getting that error

In looking into this, the main issue is that the resolve/reject blocks are never called in finishTransaction() in RNIapIos.swift.
 @objc public func finishTransaction( _ transactionIdentifier: String, resolve: @escaping RCTPromiseResolveBlock = { _ in }, reject: @escaping RCTPromiseRejectBlock = { _, _, _ in } ) { finishTransaction(withIdentifier: transactionIdentifier) }
simply adding a resolve(nil) call after finishTransaction() solves the issue, but is a brittle solution here.

Mike i tried adding resolve(nil) but it not works for me

Got it i have 0.66.4 , so that's why i was not getting that error

Thanks @eneffwork , I will try upgrading to 0.66.4

@aijcoa @taskrik  Are you able to find any solution ?

I ended up just rewriting that function entirely
`    @objc public func  finishTransaction(
_ transactionIdentifier: String,
resolve: @escaping RCTPromiseResolveBlock = { _ in },
reject: @escaping RCTPromiseRejectBlock = { _, _, _ in }
) {
let queue = SKPaymentQueue.default()
    for transaction in queue.transactions {
        if transaction.transactionIdentifier == transactionIdentifier {
            if transaction.transactionState == .purchasing {
                print("transaction is purchasing still")

            } else {
                SKPaymentQueue.default().finishTransaction(transaction)
                resolve(nil)

            }
        }
    }
}`

Thanks @mikeportanova Let me check that

In looking at what I did, I think clearTransaction was also failing to resolve, so I added another call to resolve(nil) after the for loop that iterates over the pendingTrans array (but before the end of the if block). I don't remember if this is necessary or not, but that's what I've done.

@mikeportanova  I have tried your code but getting exception that 'finishtransaction' is not a valid objective c method was thrown invoking ...

@eneffwork  Did you copy/paste that error? If so, looks like you need to camelCase finishTransaction (you wrote finishtransaction).

@mikeportanova No I have not copy/paste , I have wrote finishTransaction , i checked it in mutiple versions but still no solutions work , I hope some one can create PR for this and update library for that issue.

@eneffwork what version of react-native-iap are you using?

@mikeportanova  I use 8.0.5

@eneffwork sounds like https://github.com/dooboolab/react-native-iap/issues/1660, as I am on 8.0.5 as well. I am not clear on why you would get that error tho -- are you sure you're rewriting the correct finishTransaction function? There are two, and only one is an @objc call.

Yes @mikeportanova , I didn't get that error now , but finishTransaction gives undefined in response , not sure if it working properly on backend or not , because on app start it show multiple receipt to validate , as we have already validate receipt and also subscription not renew  in that  small time

@eneffwork okay i've figured out a few things. If you try to requestSubscription while the module is still clearing transactions, it will hang forever. This probably only happens to people involved with development and testing, as the device is running through (in my case) hundreds of previous transactions in the PaymentQueue. I've resolved this by writing a small Swift function that simply queries SKPaymentQueue for the current array of transactions. If that is greater than zero, I simply wait and check again. When it is zero, I proceed to finishTransaction().

Following the history of the file, it looks like this was broken trying to fix https://github.com/dooboolab/react-native-iap/issues/1637 , by adding the promise methods in the header but not calling resolve/reject. I have fixed both methods (finishTransaction and clearTransaction) here: https://github.com/dooboolab/react-native-iap/pull/1665 Thank you all for helping with the research

This other PR will also help: https://github.com/dooboolab/react-native-iap/pull/1662

@andresesfm incredible news to start a Friday. Thanks for all the work you do on this package!


[zlmediakit] update zlmediakit's code and enable sctp default

[x] Changes comply with the maintainer guide.
[x] The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
[x] Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
[x] The versioning scheme in vcpkg.json matches what upstream says.
[x] The license declaration in vcpkg.json matches what upstream says.
[x] The installed as the "copyright" file matches what upstream says.
[x] The source code of the component installed comes from an authoritative source.
[x] The generated "usage text" is accurate. See adding-usage for context.
[x] The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
[x] Only one version is in the new port's versions file.
[x] Only one version is added to each modified port's versions file.

Can you explain why you're adding a default feature like this? Other than that everything seems reasonble to me...

Can you explain why you're adding a default feature like this? Other than that everything seems reasonable to me...

Many newcomers who are just getting started don't know how to use vcpkg and zlmediakit. Enabling all features by default can reduce their mental burden, and there is no cost to doing so.

The problem is that getting default features to be off can be difficult for customers to do, for example: https://github.com/microsoft/vcpkg/issues/35694
In general, we try to avoid making a feature default unless the resulting library is ~broken without one. For example, a libarchive with no archive backends is worthless.

Enabling all features by default can reduce their mental burden, and there is no cost to doing so.

There are costs to doing so because this adds a dependency on that feature for callers who might not be expecting this. Is there a particular thing about zlmediakit which makes it not worthwhile for the vast majority of users with this feature off?

Tagging vcpkg-team-review because we need to discuss how we describe how default features are to be used

The problem is that getting default features to be off can be difficult for customers to do, for example: https://github.com/microsoft/vcpkg/issues/35694

OK, i had disable sctp default, and pushed new commits, thanks!

Thanks for the update!


installer: handle installer failures better

do not proceed with other nodes if one node installation fails
retry on OOM of the installer

/assign @mfojtik

/lgtm
We will add markdown explaining the logic of picking nodes and rolling revisions as a follow up.


License?

This code is currently unlicensed. Would it be possible to add a resonably permissive license?

OK, it has license now.

Thank you!


chore: updates readme

fixes some markdown linter errors and corrects the gatsby-build snippet

@rudouglas 👋


Newbie question on how to monitor DOMContentLoaded event

Hello:
I am new to AngleSharp, but I like this project.  Now I have some questions:
I created a C# project using Visual Studio 2017 Version 15.9.1 on Windows 10, my goal is to monitor a web site, which uses Javascript to generate real time contents.
When using Chrome Devtools, I can see its Javascript scripts run and from time to time, the event:  XHR finished loading: GET "" is fired each time when new real time contents are generated.
I want to know if I can write a function to monitor XHR download event or not, but more importantly, I want to monitor another event: DOMContentLoaded, and use querySelectorAll to get the corresponding contents.
Now I can do with AngleSharp that I use querySelectorAll to get the corresponding contents the first time I use browser to visit that web site.
My question is: how I can use AngleSharp to monitor that web site all the time and as soon as DOMContentLoaded event happens, I can run querySelectorAll to get the corresponding contents.
If you know how to do this, please share your code.
What I can do now seem: I use querySeletorAll to get the content first, then sleep 3 seconds, do a web page reload, then use querySelectorAll to get the contents again, and do a dead loop, but this seems to be not a good idea.  Any better idea?
Thanks,

When you use the browsing context and await the content then this is implicit for a full document load event (which is even after the dom content load). Otherwise, hooking on to the event is simple and straight forward - AddEventListener and just use the DOMContentLoaded event from the event names.
But again (unless I do not correctly understand the question) this is not necessary since any document load in AngleSharp will return to its caller after the DOMContentLoaded event.
Can you show some code?

Hello:
As I am new to both AngelSharp and Chrome Devtools, I can just describe what I have done and what I want to do.
For example, I am watching one web site, like “http://www.mysite.com/”, if I open Chrome to visit this web page, and run Devtools, I can setup XHR break points:
From Element view, I can select some DIV in the HTML page, then in Source view, I can click on the “+” to add a “XHR/fetch Breakpoints” and use URL contains “mysite.livetime.txt”, so each time, when the real time contents are downloading by the JavaScript, the script will pause at in the JavaScript as long as it contains “mysite.livetime.txt”.
However, the issue for me now is: I can’t set up a similar break point on DOM for specific download part of the contents.  I tried to set break points from “Event Listener Breakpoints” on the “Dom Mutation” for “DomSubTreeModified” and “DomContentLoaded”.
It seems when new contents downloaded, the JavaScript is paused, but it seems difficult to find some condition, just like the “XHR/fetch Breakpoints”, where I can restrict the JavaScript pause when the URL contains “mysite.livetime.txt”.
So my “Event Listener Breakpoints” on “Mom Mutation” will cause JavaScript pause on all DomContentLoaded event.
But even this is currently OK, then what I want to do is: how I can use AngleSharp do the same job?

Context is the IBrowsingContext context = BrowsingContext.New(config) with default configuation, and I visited web site using: await context.OpenAsync("http://www.mysite.com/");
For me, the first time, when I visit “http://www.mysite.com/” web site and use context.Active.QuerySelectorAll("div.time").ToArray() to get all dynamic contents always works; however. My goal is to continuing monitor the web site and use the similar code to get the dynamic contents, but I want to write the code to watch for “DomContentLoaded” event, just as I did in Chrome Devtools, I don’t want to reload the same page again and again.
Please let me know if I can do this or not.
If so, please show me the C# code using AngleSharp on how to monitor “DomContentLoded” event and get the dynamic content.
If I open the “http://www.mysite.com/” web site using Chrome browser, I can see the dynamic contents coming all the time, I don’t have to do anything, as they are generated by JavaScript in real time, but how I can use Event Listener to listen to “DomContentLoaded” event and get the dynamic contents using QuerySelectorAll to get them?  I don’t want to reload the page every a few seconds, as it is not good for performance, but my knowledge for AngleSharp is limited, no idea how to do this now.
Thanks,

AngleSharp does not contain any JS engine out of the box and anything that happens is always in your control, so the scenario you describe is impossible / not applicable.
Anything that loads is controlled by you anyway and as already written the callback in AngleSharp is always after the dom content loaded event, which means you do not need to do anything here.
HTH!


Non WAV file breaking MOTUS preparation script

Reference Line: https://github.com/iranroman/SpatialScaper/blob/dd130d1e0f8aef0c93f5e1b73c3445f855b92e7b/scripts/prepare_rirs.py#L198
The error looks like:
  File "scripts/prepare_rirs.py", line 528, in <module>
    prepare_motus(motus_path, sofa_path)
  File "scripts/prepare_rirs.py", line 198, in prepare_motus
    source_pos = source_positions[source_pos_index] + random.uniform(
KeyError: 'rirs.zip'

From inspection, the downloaded MOTUS directory contains .zip files. I suggest either removing the unpacked zip files or checking for .wav extension before generating RIR_file_names. I.e:
        RIR_file_names = os.listdir(dataset_path)
        if fmt == "foa":
            RIR_file_names = [f for f in RIR_file_names if "sh" in f and f.endswith(".wav")]
        elif fmt == "mic":
            RIR_file_names = [f for f in RIR_file_names if "raw" in f and f.endswith(".wav")]

Thanks @adrianSRoman for bringing this up. We do have a flag to remove the zip files after downloading and unpacking them.
I personally did not run into this issue while testing the latest release, but I'll re-try the script to see agian. @beasteers and @karinnacvijanovich did you see this?


please make release for 1.11.2

please release for minecraft 1.11.2, thanks!

API 6 build can be found: https://github.com/FoxDenStudio/FoxCore/releases/tag/v0.10.5-api6


Peer addition won't be skipped if remote is not in peer

rbd-mirroring is not configured as adding peer is getting skipped.
Peer addition should not get skipped if its not added already
Closes - https://bugzilla.redhat.com/show_bug.cgi?id=1942444
Signed-off-by: VasishtaShastry<EMAIL_ADDRESS>

jenkins test centos-container-purge

jenkins test centos-container-lvm_osds

jenkins test centos-container-collocation

thanks @VasishtaShastry


Implement move goto_current_end goto_current_start

For example, cursor is under if condition, I can navigate to the end or start of current if condition

I think this is already supported https://github.com/nvim-treesitter/nvim-treesitter-textobjects#text-objects-move, I guess you only need to create a mapping for
@conditional.outer

Could that be used for somewhat smarter % replacement?

I think this is already supported https://github.com/nvim-treesitter/nvim-treesitter-textobjects#text-objects-move, I guess you only need to create a mapping for
@conditional.outer

With current available move option, i can map some keybinding to move goto_next_start then goto_previous_end to go to the end of current if condition. I think it 's a not smooth as some smart % behaviour like or goto_current_end option

The logic for textobject is very convoluted and could be drastically simplified by the find_best_match (although this function it self could be made more efficient) or extended by find_best_match when using textobjects with counts. I have not much time for this at the moment. So anyone is welcome to contribute!

I think it 's a not smooth as some smart % behaviour like or goto_current_end option

So, the % operator allows you to navigate between "ends" (if, else, endif, and go back to if).
Another feature would be to allow matching multiple objects with one keymap like:
    goto_next_start = {
        ["]m"] =<EMAIL_ADDRESS>| @class.outer | @conditional.outer",
      },

I'm not sure which ones your original issue is describing, but I'd like to have both anyway p:

So, the % operator allows you to navigate between "ends" (if, else, endif, and go back to if).

Is this % operator supported by nvim-treesitter, this is feature i want

I am absolute beginner, I came up with
function GoToFunctionStart()
    local params = { textDocument = vim.lsp.util.make_text_document_params() }
    vim.lsp.buf_request(0, 'textDocument/documentSymbol', params, function(err, result, ctx, config)
        if err then
            print('Error when fetching document symbols: ' .. err.message)
            return
        end
        if result == nil then
            print('No symbols found')
            return
        end

        local line = vim.api.nvim_win_get_cursor(0)[1]
        local function_symbol = nil

        -- Filter out symbols to find the nearest function above the cursor
        for _, symbol in pairs(result) do
            if symbol.kind == 12 and symbol.range.start.line < line then
                if not function_symbol or function_symbol.range.start.line < symbol.range.start.line then
                    function_symbol = symbol
                end
            end
        end

        if function_symbol then
            -- Move cursor to the start of the function
            vim.api.nvim_win_set_cursor(0, {function_symbol.range.start.line + 1, function_symbol.range.start.character})
        else
            print("No function found above the cursor")
        end
    end)
end


RuntimeError: stack expects each tensor to be equal size... error on branch dev_latest_depthcharge

After running the command
casanovo train sample_preprocessed_spectra.mgf -p sample_preprocessed_spectra.mgf -d ../data -o segfault

with sample_data as the current working directory I got this error before training started:
(depthcharge_upgrade) C:\Users\gavin\OneDrive\Documents\casanovo\sample_data>casanovo train sample_preprocessed_spectra.mgf -p sample_preprocessed_spectra.mgf -d ../data -o segfault
Seed set to 454
INFO: Casanovo version 4.2.2.dev133+g46e9606.d20241008
INFO: Early stopping disabled
INFO: Training a model from:
INFO:   sample_preprocessed_spectra.mgf
INFO: Using the following validation files:
INFO:   sample_preprocessed_spectra.mgf
GPU available: True (cuda), used: True
TPU available: False, using: 0 TPU cores
HPU available: False, using: 0 HPUs
sample_preprocessed_spectra.mgf: 128 spectra [00:00, 2037.48 spectra/s]
sample_preprocessed_spectra.mgf: 128 spectra [00:00, 2006.45 spectra/s]
WARNING: D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\callbacks\model_checkpoint.py:654: Checkpoint directory C:\Users\gavin\OneDrive\Documents\casanovo\data exists and is not empty.

WARNING: D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\callbacks\model_checkpoint.py:654: Checkpoint directory C:\Users\gavin\OneDrive\Documents\casanovo\data exists and is not empty.

LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]

  | Name       | Type             | Params | Mode
--------------------------------------------------------
0 | encoder    | SpectrumEncoder  | 19.4 M | train
1 | decoder    | PeptideDecoder   | 28.4 M | train
2 | softmax    | Softmax          | 0      | train
3 | celoss     | CrossEntropyLoss | 0      | train
4 | val_celoss | CrossEntropyLoss | 0      | train
--------------------------------------------------------
47.9 M    Trainable params
0         Non-trainable params
47.9 M    Total params
191.498   Total estimated model params size (MB)
234       Modules in train mode
0         Modules in eval mode
Traceback (most recent call last):
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\anaconda3\envs\depthcharge_upgrade\Scripts\casanovo.exe\__main__.py", line 7, in <module>
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\rich_click\rich_command.py", line 367, in __call__
    return super().__call__(*args, **kwargs)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\rich_click\rich_command.py", line 152, in main
    rv = self.invoke(ctx)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\gavin\OneDrive\Documents\casanovo\casanovo\casanovo.py", line 322, in train
    runner.train(train_peak_path, validation_peak_path)
  File "C:\Users\gavin\OneDrive\Documents\casanovo\casanovo\denovo\model_runner.py", line 215, in train
    self.trainer.fit(
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\trainer\trainer.py", line 538, in fit
    call._call_and_handle_interrupt(
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\trainer\call.py", line 47, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\trainer\trainer.py", line 574, in _fit_impl
    self._run(model, ckpt_path=ckpt_path)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\trainer\trainer.py", line 981, in _run
    results = self._run_stage()
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\trainer\trainer.py", line 1025, in _run_stage
    self.fit_loop.run()
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\loops\fit_loop.py", line 197, in run
    self.setup_data()
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\loops\fit_loop.py", line 263, in setup_data
    iter(self._data_fetcher)  # creates the iterator inside the fetcher
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\loops\fetchers.py", line 111, in __iter__
    batch = super().__next__()
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\loops\fetchers.py", line 60, in __next__
    batch = next(self.iterator)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\utilities\combined_loader.py", line 341, in __next__
    out = next(self._iterator)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\lightning\pytorch\utilities\combined_loader.py", line 78, in __next__
    out[i] = next(self.iterators[i])
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\torch\utils\data\dataloader.py", line 630, in __next__
    data = self._next_data()
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\torch\utils\data\dataloader.py", line 673, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\torch\utils\data\_utils\fetch.py", line 43, in fetch
    return self.collate_fn(data)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\torch\utils\data\_utils\collate.py", line 317, in default_collate
    return collate(batch, collate_fn_map=default_collate_fn_map)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\torch\utils\data\_utils\collate.py", line 155, in collate
    clone.update({key: collate([d[key] for d in batch], collate_fn_map=collate_fn_map) for key in elem})
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\torch\utils\data\_utils\collate.py", line 155, in <dictcomp>
    clone.update({key: collate([d[key] for d in batch], collate_fn_map=collate_fn_map) for key in elem})
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\torch\utils\data\_utils\collate.py", line 142, in collate
    return collate_fn_map[elem_type](batch, collate_fn_map=collate_fn_map)
  File "D:\anaconda3\envs\depthcharge_upgrade\lib\site-packages\torch\utils\data\_utils\collate.py", line 214, in collate_tensor_fn
    return torch.stack(batch, 0, out=out)
RuntimeError: stack expects each tensor to be equal size, but got [32, 111] at entry 0 and [32, 120] at entry 1

This output is from my local windows machine, but I got an equivalent error when running this same command on the cluster.

It looks like this error is caused by peaks not being zero padded out to the same length across batches, for example in the sample data the shape of the m/z batch tensors are:

(32, 111)
(32,  120)
(32, 89)
(32, 110)

I'm using this unit test as a test harness to debug this issue:
def test_harness(tmp_path):
    data_path = TEST_DIR.parent / "sample_data" / "sample_preprocessed_spectra.mgf"
    run = functools.partial(
        CliRunner().invoke, casanovo.main, catch_exceptions=False
    )

    train_args = [
        "train",
        str(data_path),
        "--validation_peak_path",
        str(data_path),
        "--output_dir",
        str(tmp_path),
    ]

    run(train_args)

As it turns out both the spectrum dataset and data loaders will retrieve the spectra in batches, so in the case that the batch size is set to 32, the spectrum dataset would yield 32 spectra per batch, but then the dataloader would retrieve 32 of those batches yielding 1024 total spectra. I fixed this by setting the spectrum dataloader batch size to None.


Wrong algorithm state

It seems to be possible sometimes that your state within the algorithm is incorrect, w.r.t. DFA. First found at https://github.com/erhant/leet-assistant

This turned to be related to two things:

Buggy equality check among UserAction instances
Buggy edge finding logic


Document url prefix config

for Mx10.5

LGTM except for one question: the screengrab has "prefix" in the field. Does it normally come empty, or with just a "p" character in it? I want to ensure the screengrab matches the default that we talk about in the text.


Error when building ICO_Template

To whom it may concern,
I checked out repos at the latest commit 3544cc42d4c9c8f868ce22dca51f83af0fccf744
When building ICO_Template project this error occurs:
1>------ Rebuild All started: Project: ICO_Template, Configuration: Debug Any CPU ------
1>  ICO_Template -> C:\workspace\examples-csharp\ICO_Template\bin\Debug\ICO_Template.dll
1>  Start NeoContract converter, Source File: C:\workspace\examples-csharp\ICO_Template\bin\Debug\ICO_Template.dll
1>  Neo.Compiler.MSIL console app v<IP_ADDRESS>
1>CONVERTTASK : LoadModule error : System.Exception: can't parese event type from:System.Action`3<System.Byte[],System.Byte[],System.Numerics.BigInteger>.maybe it is System.Action<xxx> which is defined in mscorlib.dll，copy this dll in.
1>     at Neo.Compiler.MSIL.ILField..ctor(ILType type, FieldDefinition field)
1>     at Neo.Compiler.MSIL.ILType..ctor(ILModule module, TypeDefinition type)
1>     at Neo.Compiler.MSIL.ILModule.LoadModule(Stream dllStream, Stream pdbStream)
1>     at Neo.Compiler.Program.Main(String[] args)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

My system specs:
Windows 10 Education
MS Visual Studio Professional 2017 - Version 15.4.5
MS .NET Framework Version 4.7.02053

Could you please take a look into this issue?
One more thing, I'm new in NEO world and looking for a tutorial/example to implement an ICO, like https://aphelion.org/
But in template source code there's some magic number that I don't understand, like:
private static readonly byte[] neo_asset_id = { 155, 124, 255, 218, 166, 116, 190, 174, 15, 147, 14, 190, 96, 133, 175, 144, 147, 229, 254, 86, 179, 74, 92, 34, 12, 205, 207, 110, 252, 51, 111, 197 };

Is there any more detailed example/tutorial for newbie to understand and follow?
Many thanks,

Try the latest version of compiler: https://github.com/neo-project/neo-compiler

I've tried the latest version of compiler, but the error still occurs.

@lightszero Can you check this?

you need to find a mscorlib.dll from
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework
and copy it to where Neo.SmartContract.Framework.dll and .avm is.

Try copy mscorlib.dll to you directory C:\workspace\examples-csharp\ICO_Template\bin\Debug\

Any instruction for Mac users given the full-fledged .NET Framework doesn't support macOS? @tanZiWen tan

I'm also on mac.
got this error when I am trying to compile ICO_Template.dll
LoadModule Error:System.Exception: can't parese event type from:System.Action`3<System.Byte[],System.Byte[],System.Numerics.BigInteger>.maybe it is System.Action<xxx> which is defined in mscorlib.dll，copy this dll in.
   at Neo.Compiler.MSIL.ILField..ctor(ILType type, FieldDefinition field) in /Users/xxxx/xxxx/neo-compiler-master/neon/MSIL/ILModule.cs:line 127
   at Neo.Compiler.MSIL.ILType..ctor(ILModule module, TypeDefinition type) in /Users/xxxx/xxxx/neo-compiler-master/neon/MSIL/ILModule.cs:line 73
   at Neo.Compiler.MSIL.ILModule.LoadModule(Stream dllStream, Stream pdbStream) in /Users/apisit/Downloads/neo-compiler-master/neon/MSIL/ILModule.cs:line 48
   at Neo.Compiler.Program.Main(String[] args) in /Users/xxxx/xxxx/neo-compiler-master/neon/Program.cs:line 71

I tried copying mscorlib.dll into where ICO_Template.dll  is located but doesn't seem to help.
I was able to compile the simple HelloWorld just fine.

so I finally have this solved.
so this is the updated code for ICO_Template.cs
public delegate void MyAction<T, T1>(T p0, T1 p1);
public delegate void MyAction<T, T1, T2>(T p0, T1 p1, T2 p2);

[DisplayName("transfer")]
public static event MyAction<byte[], byte[], BigInteger> Transferred;
[DisplayName("refund")]
public static event MyAction<byte[], BigInteger> Refund;

big thanks to jianying li(a coder) on discord. kindly help me debug this.
It's about System.Action that is defined in mscorlib.dll on windows but in mono it's maybe in somewhere else. making neon.dll unable to find it.

I've also documented the problem (and solution) here ...with some step by step instructions: https://github.com/mwherman2000/neo-windocs/blob/master/windocs/neo-problems/ICO-Template-Problems.md

Hi, Copying mscorlib.dll to debug or release folder is not a straight forward solution.
Add the mscorlib.dll into the solution and in property of the added file set "Copy to Output Directory" as "Copy always"

Some above workaround helps.


feat(storage-resize-images): preserve original image metadata by default

Adds a keepMetadata() to sharp calls to preserve original file metadata.
Upgrades sharp to version 0.33.2
Note: this is blocked since sharp 0.33+ requires jest 27.0+ which results in major test errors.
Fixes #1605.

@jauntybrain can you check the failing tests


M3-5063: Linode Configs modal refinements

Description
Adjust color and spacing of divider and shift the "Add a Device" button over by 1px
How to test

Go to /linodes
Click on any Linode
Go to the "Configurations" tab
Click "Add Configuration"
Scroll through the modal and check for issues

@HanaXu good catch on the dark mode! I always forget that and I prefer a tighter spacing below the divider but I could be convinced 🤔

@tiffwong Is this convincing enough? :laughing: https://material-ui.com/components/dividers/


Nested proxy-memoized selectors

Hi, I have a project where some of my proxy-memoized selectors are composed of other proxy-memoized selectors. I noticed that touches are not being recorded from the nested selectors, most likely because the proxy is being unwrapped and replaced with a new proxy within the nested selectors.
Is my understanding correct?
Is there a workaround you would suggest?
I could use the un-memoized versions to compose the higher order selectors but I would like to not have to manage two versions of each selector.

Hi, thanks for opening this up.
I had such use cases with nested selectors in mind.
https://github.com/dai-shi/proxy-memoize/blob/main/__tests__/20_nested_spec.ts should cover some use cases.
Could you create a test case, or a small reproduction in codesandbox?

I'm having trouble with codesandbox for some reason but I ran this in node and it seems to reproduce the issue
const memoize = require('proxy-memoize')

// comment the above import and replace memoize with the identity function and the code works as expected
// const memoize = fn => fn

const state1 = {
  ids: [2, 3],
  keyMap: {
    1: 'k-1',
    2: 'k-2',
    3: 'k-3',
  },
  entities: {},
}

const state2 = {
  ids: state1.ids,
  keyMap: state1.keyMap,
  entities: {
    'k-1': 'e-1',
    'k-2': 'e-2',
    'k-3': 'e-3',
  },
}

const getKeyById = memoize(({ state, id }) => {
  return state.keyMap[id]
})

const getEntityById = memoize(({ state, id }) => {
  return state.entities[getKeyById({ state, id })]
})

const getCurrentEntities = memoize(state => {
  return state.ids.map(id => getEntityById({ state, id }))
})

console.log(getCurrentEntities(state1))
console.log(getCurrentEntities(state2))

It's a bit contrived but I'm trying to simulate the level of nesting we have with the selectors. I'm more concerned about why it's happening incase there are certain patterns of usage  to avoid with proxy-memoize.

It's a bit contrived

contrived one is fine. I wonder if we can make it a little smaller to reveal the issue.
my gut feeling is the shared keyMap is causing something. 🤔

I'm having trouble with codesandbox for some reason

Is it about importing the library?
Yeah, I noticed that too. Can you try this?
import memoize from "proxy-memoize/dist/index.modern.js";

Yep that was it, thanks for the tip
https://codesandbox.io/s/prod-cookies-g9c4hd?file=/src/index.js

my gut feeling is the shared keyMap is causing something. 🤔

I shared some keys between state to simulate what might happen in a redux store, but even without doing that the issue seems to happen 🤔

I was able to simplify the sandbox example and reduce it to 1 level of nesting and removed the indirection of keyMap
import memoize from "proxy-memoize/dist/index.modern.js";

// comment the above import and replace memoize with the identity function and the code works as expected
// const memoize = (fn) => fn;

const state1 = {
  ids: [1, 2],
  entities: {}
};

const state2 = {
  ids: [1, 2],
  entities: {
    1: "e-1",
    2: "e-2",
    3: "e-3"
  }
};

const getEntityById = memoize(({ state, id }) => {
  return state.entities[id];
});

const getCurrentEntities = memoize((state) => {
  return state.ids.map((id) => getEntityById({ state, id }));
});

console.log(getCurrentEntities(state1));
console.log(getCurrentEntities(state2));

Thanks for the small reproduction!

#46 fixes the given case.
Can you play with it?
It may or may not fail with deeply nested selectors. In such a case, please open a new issue.
https://ci.codesandbox.io/status/dai-shi/proxy-memoize/pr/46 You can install the build locally. See "Local Install Instructions".

@dai-shi thanks for the quick turnaround. I tested and the issues I was experiencing previously seem to have been resolved!

Published: https://www.npmjs.com/package/proxy-memoize/v/1.1.0


Postgres down & rollback not dropping tables

Environment
Knex version: 3.0.1
Database + version: Postgres 16 in Docker
Node version: 20.10.0
OS: Arch Linux
Bug
Description
According to the dropTableIfExists documentation for the down-method of a migration, I expect the table to be dropped. But the table is not dropped.
commands executed
UID="$(id -u)" GID="$(id -g)" docker compose run my-app npm run knex:migrations:rollback
or
UID="$(id -u)" GID="$(id -g)" docker compose run my-app npm run knex:migrations:down
Error message
> knex migrate:rollback

Requiring external module ts-node/register
Using environment: development
Batch 1 rolled back: 2 migrations

docker compose logs -f shows no activity when executing the knex commands, no errors, just nothing.
Test Code
Migration Code
import { Knex } from "knex";

export async function up(knex: Knex): Promise<void> {
    knex.schema.hasTable('showcase').then(function(exists) {
        if (!exists) {
          return knex.schema.createTable('showcase', function(t) {
            t.increments('id').primary();
            t.string('first_name', 100);
            t.string('last_name', 100);
            t.text('bio');
          });
        }
      });
}

export async function down(knex: Knex): Promise<void> {
    knex.schema.dropTableIfExists('showcase');
}

knexfile
import type { Knex } from "knex";

const config: { [key: string]: Knex.Config } = {
  development: {
    client: 'pg',
    connection: {
      host : 'my-db',
      user : 'myuser',
      password : 'mypassword',
      database : 'mydb',
      charset: 'utf8'
    },
    migrations: {
      directory: __dirname + '/knex/migrations',
    },
    seeds: {
      directory: __dirname + '/knex/seeds'
    }
  },
// TODO: setup for staging & production
// after this line: autogenerated code not relevant for this issue

package.json
{
  "name": "myShowcase",
  "version": "0.1.0",
  "description": "Bug Showcase",
  "engines": {
    "node": ">=20",
    "npm": ">=10"
  },
  "main": "dist/main.js",
  "scripts": {
    "dev": "nodemon",
    "lint": "eslint .",
    "test": "jest --config jest.config.ts --coverage",
    "build": "tsc --project tsconfig.build.json",
    "ts": "ts-node src/main.ts",
    "knex:migrations:make": "knex migrate:make",
    "knex:migrations:latest": "knex migrate:latest",
    "knex:migrations:up":"knex migrate:up",
    "knex:migrations:list":"knex migrate:list",
    "knex:migrations:down":"knex migrate:down",
    "knex:migrations:rollback": "knex migrate:rollback"
  },
  "author": "miriam mueller",
  "license": "",
  "dependencies": {
    "@hapi/hapi": "^21.3.0",
    "@hapi/inert": "^7.1.0",
    "@hapi/vision": "^7.0.3",
    "@types/pg": "^8.10.9",
    "config": "^3.3.9",
    "graphlib": "^2.1.8",
    "hapi-swagger": "^17.2.0",
    "joi": "^17.11.0",
    "knex": "^3.0.1",
    "node-cache": "^5.1.2",
    "pg": "^8.11.3",
    "pino": "^8.11.0",
    "uuid": "^9.0.1"
  },
  "devDependencies": {
    "@types/config": "^3.3.0",
    "@types/graphlib": "^2.1.11",
    "@types/hapi": "^18.0.8",
    "@types/jest": "^29.4.0",
    "@types/mysql": "^2.15.24",
    "@types/node": "^20.9.2",
    "@types/uuid": "^9.0.7",
    "@typescript-eslint/eslint-plugin": "^6.11.0",
    "@typescript-eslint/parser": "^6.11.0",
    "eslint": "^8.35.0",
    "jest": "^29.5.0",
    "nodemon": "^3.0.1",
    "ts-jest": "^29.0.5",
    "ts-node": "^10.9.1",
    "typescript": "^5.2.2"
  }
}

compose.yml
version: '3.7'
services:
  my-db:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: "mydb"
      POSTGRES_USER: "myuser"
      POSTGRES_PASSWORD: "mypassword"
    volumes:
      - "database_data:/var/lib/postgresql/data"
    ports:
      - 5432:5432
  my-app:
    user: "${UID}:${GID}"
    userns_mode: host
    build:
      context: .
      target: dev-stage
    volumes:
      - ./src:/usr/src/app/src
      - ./knex:/usr/src/app/knex
      - ./config:/usr/src/app/config
    ports:
      - "9033:9033"
    depends_on:
    - "my-db"
volumes:
  database_data:
    driver: "local"

What I also tried

using knex.schema.withSchema('sys').hasTable
as described in https://github.com/knex/knex/issues/5435

Where did I take a wrong turn? Can anybody reproduce?

Sidenote: the down/rollback works if I revert the addition of columns. Just for a whole table, something is wrong

I just read at https://knexjs.org/guide/ -> "the inability to drop tables". So, this seems to be intended behavior


[BUG] GCNEncoder in rl4co fails to adjust edge_index for batched graphs

Describe the bug
In rl4co/models/nn/graph/gcn.py, the GCNEncoder class processes batched node embeddings without adjusting the edge_index for each graph in the batch. This leads to incorrect message passing in GCNConv, where nodes from different graphs may be incorrectly connected or ignored, resulting in unintended behavior of the model.
Issue in Code:
# In rl4co/models/nn/graph/gcn.py, inside the GCNEncoder class
def forward(self, td):
    # Transfer to embedding space
    init_h = self.init_embedding(td)
    bs, num_nodes, emb_dim = init_h.shape
    # (bs*num_nodes, emb_dim)
    update_node_feature = init_h.reshape(-1, emb_dim)  # Flatten batch
    # shape=(2, num_edges)
    edge_index = self.edge_idx_fn(td, num_nodes)  # Edge index for a single graph

    for layer in self.gcn_layers[:-1]:
        update_node_feature = layer(update_node_feature, edge_index)
        # ...

Problem: edge_index is generated for a single graph and not adjusted for batching.
Consequence: When node features from multiple graphs are concatenated, GCNConv incorrectly processes nodes, only properly updating nodes of the first graph.
To Reproduce
Minimal Example to Reproduce the Bug:
import torch
from torch_geometric.nn import GCNConv
from torch_geometric.data import Data
from functools import lru_cache

# Function to generate full graph edge index (as in the original code)
@lru_cache(5)
def get_full_graph_edge_index(num_node: int, self_loop=False) -> torch.Tensor:
    adj_matrix = torch.ones(num_node, num_node)
    if not self_loop:
        adj_matrix.fill_diagonal_(0)
    edge_index = torch.permute(torch.nonzero(adj_matrix), (1, 0))
    return edge_index

# Parameters
num_nodes_per_graph = 5
num_node_features = 3
batch_size = 2  # Number of graphs in the batch

# Create node features for two graphs
x1 = torch.randn(num_nodes_per_graph, num_node_features)
x2 = torch.randn(num_nodes_per_graph, num_node_features)

# Concatenate node features to simulate batching
x = torch.cat([x1, x2], dim=0)  # Shape: [batch_size * num_nodes_per_graph, num_node_features]

# Generate edge_index using the original function
edge_index_single = get_full_graph_edge_index(num_nodes_per_graph, self_loop=False)

# Use the same edge_index for both graphs without adjusting
edge_index = edge_index_single  # Edge indices from graph1, node indices 0 to 4

# Initialize GCNConv
conv = GCNConv(in_channels=num_node_features, out_channels=2, add_self_loops=False)

# Apply GCNConv without adjusting edge_index
out = conv(x, edge_index)

# Print the output
print("Output without adjusting edge_index:")
print(out)

# Now adjust edge_index for each graph to reflect batching
edge_indices = []
for i in range(batch_size):
    offset = i * num_nodes_per_graph
    adjusted_edge_index = edge_index_single + offset
    edge_indices.append(adjusted_edge_index)
edge_index_adjusted = torch.cat(edge_indices, dim=1)

# Apply GCNConv with adjusted edge_index
out_adjusted = conv(x, edge_index_adjusted)

# Compare outputs for nodes belonging to each graph
print("\nDifference in outputs for nodes belonging to the first graph:")
print(out[:num_nodes_per_graph] - out_adjusted[:num_nodes_per_graph])

print("\nDifference in outputs for nodes belonging to the second graph:")
print(out[num_nodes_per_graph:] - out_adjusted[num_nodes_per_graph:])

Explanation:
Edge Index Generation: We use the get_full_graph_edge_index function from the original code to generate the edge indices for a fully connected graph without self-loops.
Without Adjusted edge_index:
The edge_index only references nodes 0 to 4.
Nodes 5 to 9 (from the second graph) are not properly connected and thus not processed correctly by GCNConv.
With Adjusted edge_index:
By adding an offset to edge_index for each graph in the batch, nodes are correctly connected within their own graphs.
The outputs for nodes in the second graph are now properly updated based on their graph structure.
Observation:
The differences in outputs for nodes belonging to the second graph indicate that without adjusting edge_index, those nodes were not processed correctly.
Additional context
The issue arises because in the GCNEncoder, the edge_index is generated once for a single graph and used for all graphs in the batch without adjustment. This causes incorrect node indexing when processing batched graphs, leading to unintended behavior.
Reason and Possible fixes
Reason:
The edge_index is not adjusted for batched graphs, causing nodes from different graphs to be incorrectly connected or not processed correctly.
In batched graphs, node indices in edge_index need to be offset for each graph to reflect their positions in the concatenated node feature tensor.
Possible Fix:
Adjust the edge_index for each graph in the batch by adding an offset based on the cumulative number of nodes. Here's a modification to the GCNEncoder class:
def forward(self, td):
    init_h = self.init_embedding(td)
    bs, num_nodes, emb_dim = init_h.shape
    update_node_feature = init_h.reshape(-1, emb_dim)

    # Original edge_index for a single graph
    edge_index_single = self.edge_idx_fn(td, num_nodes)

    # Adjust edge_index for batching
    edge_indices = []
    for i in range(bs):
        offset = i * num_nodes
        adjusted_edge_index = edge_index_single + offset
        edge_indices.append(adjusted_edge_index)
    edge_index = torch.cat(edge_indices, dim=1).to(td.device)

    # Proceed with GCN layers using the adjusted edge_index
    for layer in self.gcn_layers[:-1]:
        update_node_feature = layer(update_node_feature, edge_index)
        update_node_feature = F.relu(update_node_feature)
        update_node_feature = F.dropout(
            update_node_feature, training=self.training, p=self.dropout
        )

    # Last layer without activation and dropout
    update_node_feature = self.gcn_layers[-1](update_node_feature, edge_index)

    # De-batch the graph
    update_node_feature = update_node_feature.view(bs, num_nodes, emb_dim)

    # Residual connection
    if self.residual:
        update_node_feature = update_node_feature + init_h

    return update_node_feature, init_h

Explanation:
Adjustment of edge_index:
For each graph in the batch, we add an offset to the edge_index so that node indices correctly map to their positions in the concatenated update_node_feature.
Benefit:
This ensures that nodes are only connected within their own graph, preventing unintended cross-graph connections.
GCNConv can now process each graph correctly within the batch.
Checklist

[√] I have checked that there is no similar issue in the repo (required)
[√] I have provided a minimal working example to reproduce the bug (required)

Thanks for reporting!
It seems that you are indeed correct - the GCN encoder should be adjusted based on the application, for example, this one. The default value should be changed to do message passing properly (cc: @cbhua @LTluttmann )
PS: here is another fix with Batch using the same indexing
import torch
from torch_geometric.nn import GCNConv
from torch_geometric.data import Data, Batch
from functools import lru_cache

# Function to generate full graph edge index (as in the original code)
@lru_cache(5)
def get_full_graph_edge_index(num_node: int, self_loop=False) -> torch.Tensor:
    adj_matrix = torch.ones(num_node, num_node)
    if not self_loop:
        adj_matrix.fill_diagonal_(0)
    edge_index = torch.permute(torch.nonzero(adj_matrix), (1, 0))
    return edge_index

# Parameters
num_nodes_per_graph = 5
num_node_features = 3
batch_size = 2  # Number of graphs in the batch

# Create node features for two graphs
x1 = torch.randn(num_nodes_per_graph, num_node_features)
x2 = torch.randn(num_nodes_per_graph, num_node_features)

# Concatenate node features to simulate batching
x = torch.cat([x1, x2], dim=0)  # Shape: [batch_size * num_nodes_per_graph, num_node_features]

# Generate edge_index using the original function
edge_index_single = get_full_graph_edge_index(num_nodes_per_graph, self_loop=False)

# Use the same edge_index for both graphs without adjusting
edge_index = edge_index_single  # Edge indices from graph1, node indices 0 to 4

# Initialize GCNConv
conv = GCNConv(in_channels=num_node_features, out_channels=2, add_self_loops=False)

# Apply GCNConv without adjusting edge_index
# print(x.shape, edge_index.shape)
out = conv(x, edge_index)

# Print the output
print("Output without adjusting edge_index:")
print(out)

# Now adjust edge_index for each graph to reflect batching
edge_indices = []
for i in range(batch_size):
    offset = i * num_nodes_per_graph
    adjusted_edge_index = edge_index_single + offset
    edge_indices.append(adjusted_edge_index)
edge_index_adjusted = torch.cat(edge_indices, dim=1)

# Apply GCNConv with adjusted edge_index
out_adjusted = conv(x, edge_index_adjusted)

# Create Data objects for each graph
data1 = Data(x=x1, edge_index=edge_index_single)
data2 = Data(x=x2, edge_index=edge_index_single)

# Batch the graphs
batch = Batch.from_data_list([data1, data2])

# Apply GCNConv on batched data
out_batched = conv(batch.x, batch.edge_index)

# Compare outputs for nodes belonging to each graph

print("\n"+20*"="+"Fix 1"+20*"=")

print("\nDifference in outputs for nodes belonging to the first graph:")
print(out[:num_nodes_per_graph] - out_adjusted[:num_nodes_per_graph])

print("\nDifference in outputs for nodes belonging to the second graph:")
print(out[num_nodes_per_graph:] - out_adjusted[num_nodes_per_graph:])

print("\n"+20*"="+"Fix 2"+20*"=")

print("\nDifference in outputs for nodes belonging to the first graph:")
print(out[:num_nodes_per_graph] - out_batched[:num_nodes_per_graph])

print("\nDifference in outputs for nodes belonging to the second graph:")
print(out[num_nodes_per_graph:] - out_batched[num_nodes_per_graph:])


Add "ATTRIBUTES" functionality

See https://github.com/senzing-garage/garage-roadmap/issues/27

Pull requests:

https://github.com/senzing-garage/sz-sdk-go/pull/188


How about two or more tables to hold the data?

Hi,
I need to input two or more tables into my R script from PBI. dataset only hold the information of one table, correct? How do I import more than one table into my R script within PBI?
also, can you explain how do I connect a slicer value to the R script? I want an end user to slice over date and my R script reads the numbers from slicer in the R script and run analytics over the new values in slicer. How do I do this in PBI using R scripting?

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

ID: a4253d0e-7a9f-a0a7-edee-4cbd387ec98d
Version Independent ID: 14a7818e-43ac-86ca-a4a1-d4da38441e42
Content: Using R in Power BI Query Editor - Power BI
Content Source: powerbi-docs/desktop-r-in-query-editor.md
Service: powerbi
GitHub Login: @davidiseminger
Microsoft Alias: davidi

Thanks for your comment, @peymanrah. We’ve forwarded your question to the writer, who should respond to this thread shortly. Thanks!

Thanks for your comment, @peymanrah. This looks like a support request rather than documentation feedback. You might find a solution in the Power BI Community, found at https://community.powerbi.com. If not, you can get support by going to https://support.powerbi.com.


fix(android): UIManagerModule fix for Bridgeless 0.74

Does any other open PR do the same thing?
No
What issue is this PR fixing?
Following APIs will be broken in Bridgeless mode after https://github.com/react-native-maps/react-native-maps/pull/4985 adds support for Bridgeless in React Native 0.74 on Android :

takeSnapshot()
getCamera()
getAddressFromCoordinates()
pointForCoordinate()
coordinateForPoint()
getMapBoundaries()

Since these depend on context.getNativeModule(UIManagerModule.class):
which returns null in Bridgeless
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java#L600-L606
How did you test this PR?
Test takeSnapshot() functionality for Android in Bridgeless

cc: @lukmccall @salah-ghanim for review

@Arushi thank you so much for your contribution, and good that you caught this crash.
but before merging can you please look into those two topics:

use of anonymous classes in java can cause overhead and ideally it gets avoided (mainly anonymous classes hold strong ref to parent class which can cause GC issues).

you can add the addUIBlock encapsulation inside such a class as well so that you don't need to repeat the code and anyone in the future can reuse it.

the code will look something like this

public class MapUIBlock implements UIBlockInterface {
    private int tag;
    private Promise promise;
    private ReactApplicationContext context;
    private Function<MapView, Void> mapOperation;

    public MapUIBlock(int tag, Promise promise, ReactApplicationContext context, Function<MapView, Void> mapOperation) {
        this.tag = tag;
        this.promise = promise;
        this.context = context;
        this.mapOperation = mapOperation;
    }

    @Override
    public void execute(NativeViewHierarchyManager nvhm) {
        executeImpl(nvhm, null);
    }

    @Override
    public void execute(UIBlockViewResolver uiBlockViewResolver) {
        executeImpl(null, uiBlockViewResolver);
    }

    private void executeImpl(NativeViewHierarchyManager nvhm, UIBlockViewResolver uiBlockViewResolver) {
        MapView view = uiBlockViewResolver != null ? (MapView) uiBlockViewResolver.resolveView(tag) : (MapView) nvhm.resolveView(tag);
        if (view == null) {
            promise.reject("AirMapView not found");
            return;
        }
        if (view.map == null) {
            promise.reject("AirMapView.map is not valid");
            return;
        }

        mapOperation.apply(view);
    }

    public void addToUIManager() {
        if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
            UIManager uiManager = UIManagerHelper.getUIManager(context, UIManagerType.FABRIC);
            ((FabricUIManager) uiManager).addUIBlock(this);
        } else {
            UIManagerModule uiManager = context.getNativeModule(UIManagerModule.class);
            uiManager.addUIBlock(this);
        }
    }
}

@salah-ghanim Will this fix be included in the next release? I suppose I could use patch-package for the time being.

@iM-GeeKy should be live in 10 minutes


Keyword dictionary

In the example keyword dictionary was created via the XML. This will not work as you will retrieve an error, once you try to import the XML. The proper way is to use the Cmdlet New-DlpKeywordDictionary. Therefore the example should be updated.

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

ID: 8d6af897-cba3-dc5c-beb1-4a650fadbaea
Version Independent ID: 12d1e00e-36c2-71a1-0632-844455b1d00c
Content: Create a custom sensitive information type in Security & Compliance Center PowerShell
Content Source: microsoft-365/compliance/create-a-custom-sensitive-information-type-in-scc-powershell.md
Service: o365-seccomp
GitHub Login: @chrfox
Microsoft Alias: chrfox

@IngoGege  - Thank you for submitting feedback.
I will get this issue over to the Microsoft 365 writing team for investigation.
Thank you for reporting and making the docs better. Much appreciated.
I made a note to request the team to update this when the work is complete.

Hello @IngoGege - Thank you for your feedback. Please note that the process of creation Keyword dictionary is already listed at https://docs.microsoft.com/en-us/microsoft-365/compliance/create-a-keyword-dictionary. This is the next topic in Sensitive information types.
Thanks.

Hi @joinimran ,
I get that, but shouldn't the documentation be corrected? People are still taking the sample XML, which has the keyword dictionary in:
https://docs.microsoft.com/en-us/microsoft-365/compliance/create-a-custom-sensitive-information-type-in-scc-powershell#sample-xml-of-a-rule-package
Ciao,
Ingo

Thank you @IngoGege  Can you please share me a screenshot where the dictionary is mentioned as a keyword because I can not find this in the document.
Thanks.

Hi @IngoGege and @joinimran
Thank you for your comment and discussion.
Ingo - Can you please attach a file that shows where the error in the XML, what the error is, and what you feel the fixed code should be?
This will help me address the question you raised.
Thanks
Chris

no reply received on request for clarification, closing issue

Hi @chrfox ,
sorry for the delay. As mentioned previously the XML file contains keywords:

Identification
Contoso Employee

card
badge
ID

credit card
national ID

identity card
national ID
EU debit card

This is causing the validation to fail, when you try to upload the file.
Ciao,
Ingo


Reduce the required dependency crates for non-default configurations

Objective

Describe the objective or issue this PR addresses.
This PR wants to make as many features as possible optional, The primary goal is to aid in reducing compilation times and binary size for custom configurations such as plugins or projects which tune the default features.

Solution
Make features optional

Changelog

Make crates/bevy_math optional
Make crates/bevy_transform optional
Make crates/bevy_input optional
Make crates/bevy_window optional
Make crates/bevy_diagnostic optional
Make crates/bevy_log and crates/bevy_time optional
Make crates/bevy_reflect optional (Leaf packages depending on it still enable it)
Reverted to fully qualified syntax in crates/bevy_core/src/lib.rs

Migration Guide

None required if using the default configuration, If a project is using default-features = false they should add the required features listed in the [features] section of bevy's root Cargo.toml.

Nit on PR title / description: you mean "make more crates optional", not "make more features optional".

You need to update https://github.com/bevyengine/bevy/blob/main/docs/cargo_features.md too though.
Will do.

in the cargo_features.md, it should probably note when features are dependent on each other. For example, I'm pretty sure bevy_winit needs bevy_window to be enabled.

@mockersf we should probably add a CI check for this, ala the Examples check 🤔

Yes! 🎟 ?

in the cargo_features.md, it should probably note when features are dependent on each other. For example, I'm pretty sure bevy_winit needs bevy_window to be enabled.

If there are dependencies between features, they should be enforced as dependencies in the toml files, not in the documentation.

If there are dependencies between features, they should be enforced as dependencies in the toml files, not in the documentation.

FYI Deleted my comment, because I was going to change it to this.

If there are dependencies between features, they should be enforced as dependencies in the toml files, not in the documentation.

FYI Deleted my comment, because I was going to change it to this. For people wondering where the quote came from

I'll work on resolving.


Ignore forked repositories

e.g. for people who have installed Renovate on all repos.
If a repo is a fork, and it doesn't have a renovate.json in it, then ignore it.

Hehe, that's great :) In any way, it is advisable to activate it one by one. Or in my case it that @tunnckoCore is now almost empty, so i transferring all my repos one by one after updating them, because i have too much things to update. It may be hard month of updating tons of things in that 300+ repos and actual npm packages, but i don't have much choice.
The mistake/damage was done in the moment that i activated GK for all repos. Because some old repos dont have proper badges, so probably most of them now show breaking, exactly because the PRs of GK, not because they are really broken.
In any way, i need to update all deps of them, because some packages are not touched for years - some of them are with out-dated deps, some of them STILL dependencies: up-to-date and build: passing for years, which is totally fantastic!


Modelclass

Implementation for Model class to wrap Pytorch and Huggingface Models, obtaining model outputs, activations, and evaluation metrics.

Codecov Report

Merging #102 (c1c466e) into dev (efebaf6) will decrease coverage by 3.56%.
The diff coverage is 33.25%.

:exclamation: Current head c1c466e differs from pull request most recent head e544f1c. Consider uploading reports for the commit e544f1c to get more accurate results

@@            Coverage Diff             @@
##              dev     #102      +/-   ##
==========================================
- Coverage   65.08%   61.52%   -3.57%
==========================================
  Files          58       66       +8
  Lines        3340     3761     +421
  Branches      590      666      +76
==========================================
+ Hits         2174     2314     +140
- Misses       1012     1292     +280
- Partials      154      155       +1

Flag
Coverage Δ

unittests
61.52% <33.25%> (-3.57%)
:arrow_down:

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

Impacted Files
Coverage Δ

meerkat/model/tensormodel.py
25.00% <25.00%> (ø)

meerkat/model/metrics.py
25.64% <25.64%> (ø)

meerkat/model/huggingfacemodel.py
30.95% <30.95%> (ø)

meerkat/model/model.py
31.81% <31.81%> (ø)

meerkat/model/activation.py
39.13% <39.13%> (ø)

meerkat/columns/instances_column.py
44.44% <44.44%> (ø)

meerkat/columns/segmentation_column.py
45.45% <45.45%> (ø)

meerkat/columns/text_column.py
83.33% <83.33%> (ø)

meerkat/__init__.py
100.00% <100.00%> (ø)

... and 7 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 efebaf6...e544f1c. Read the comment docs.

lgtm!


Print statement for resultant matrix

Storing the multiplication is now done efficiently and print statement to print the resultant matrix is now been submitted.

There are some issues @Architgupta001 in this repo
So start contributing here https://github.com/Ishaan28malik/Get-Dev-Resources


Implemented browsing in BrowseController under /browse

Implemented browsing under /browse.
All folders are redirected to /browse again from browsing.
All files are redirected to /storages for download.
Note: File/Artifact download not supported for Nuget currently as NugetArtifactController does not support direct file download currently.
Test this with accept-text/html

@sanket407 can you please point me where ArtifactResolutionService.resolveArtifactResource method used?

@sanket407 ,
What is the state of this task?


Slow message throughput compared to TCP server

Issue
During our testing of NATS we found the message throughput to be slower than expected compared to messages received by a simple TCP server.  Whilst we would expect some overhead due to the functionality that NATS is providing we are only achieving around 1.8k messages per second through NATS.  When the same sized 32 byte messages are sent direct to a TCP server the throughput is around 9k/sec on the same hardware.
Software
gnatsd: 1.2.0-beta4
golang: go1.10.1 linux/amd64
Method
With reference to our test Producer and Worker programs here; https://github.com/swdee/natsbench
Test 1
We configure three Linode 2048 instances in the same datacenter with each program running on its own instance, producing a message flow of;
Producer -> NATS -> Worker
The Producer and Worker start up HTTP /metrics endpoints that are scraped by Prometheus and a Grafana dashboard is used to monitor the message through put of Producer and Worker.
The NATS server is started with
./gnatsd

Worker is started with
./worker2 -n nats://<nats-server-ip>:4222

The Producer is started and sends 10k msgs/sec at 32 byte size using
./producer2 -d nats://<nats-server-ip>:4222 -r 10000

Test 2
Using the same Linode instances we change the topology and replace NATS with HAproxy to flow through with the Worker acting as a simple TCP server to receive the messages directly.
Producer -> HAProxy -> Worker
Worker is started and listens on port 8095
./worker2 -s :8095

The Producer is started with same 10k msgs/sec rate at 32 byte size
./producer2 -d worker://<haproxy-server-ip>:8095 -r 10000

Result
The attached graph shows throughput of Test 1 sending and receiving around 1.8k msg/sec when using NATS.

Test 2 on the other hand achieves ~9k msg/sec
We did not expect NATS to have a throughput rate of approximately 20% of that when sending to a simple TCP server.  Is there some error we have made in the Producer/Worker code that explains the poor performance with NATS?

You need to remove this line. Calling Conn.Flush() causes the library to send a PING protocol to the server and synchronously wait for a PONG response from the server. I assume that your intent was to flush the underlying buffer, but this is way more than that.
The library automatically flushes the buffer that is used to improve throughput. You don't need to call any API. You could call Flush() before a connection Close() if you were to measure the publish rate for instance in a for loop performing Publish() calls and then measuring the before/after. Then yes, I would do a Flush() after the last message is sent to make sure that all messages have been received by the server. This is what we do in our bench program here.

Also a note on your workers. It seem that you have a mode "shard" where you create subscriptions on a unique subject such as txn.a.>, txn.b.>, etc.. and in that mode then send randomly to those subjects.
If the intent is to distribute the load, then you should really look at queue subscription using QueueSubscribe() (https://github.com/nats-io/go-nats#queue-groups). You would use a single subject and group name, and in that mode, all members of the same group share the load. That is, if they subscribe on foo on group bar, then a message published on foo is given to only one of the member of that group. The distribution is random and is done by the server.

Thanks for taking a look, I did assume Conn.Flush() was just flushing the underlying buffer.  With that removed performance is now comparable in the 9k msg/sec mark.

Glad to know. Can we close the issue or do you have more questions?

Issue can be closed thanks.


Create indiegogo $50+ donator credits NPC

Should contain the names of all people with the $50 perk and a link to the indiegogo

Done in #474


feature request: commandline world id extractor

hello, i see you created a really advanced program here.
Can i make a tool request? The tool should be commandline and should be able to dump the world id of a .wld file, the syntax should be "towid.exe 'C:\Users\PC\Documents\My Games\Terraria\Worlds\worldname.wld' 'C:\Users\PC\Documents\My Games\Terraria\Worlds\output.txt'".
Can you do that? Thx! I couldn't find a way to contact you on any other medium or via mail, so i posted it here, i hope that doesn't bother you. If you want to do it and release it private, i would also pay the efford :) you can contact me at reddit (/u/Blubbll) or at discord or here or via mail. thx

I considered making something like this back when wld2txt was in its early stages, since I needed to query all kinds of information about the world anyway.
Check out this new repository. It shouldn't take too long to create this kind of tool, since wld2txt already does the heavy lifting.

wldquery should do what you want now.
Read here first: https://github.com/spinclick/wldquery
Download here (Windows 64 bit): https://github.com/spinclick/wldquery/releases
The syntax is a bit different from your example. To accomlish the same thing, you would do:
wldquery.exe 'C:\Users\PC\Documents\My Games\Terraria\Worlds\worldname.wld' world_id > 'C:\Users\PC\Documents\My Games\Terraria\Worlds\output.txt'"
Note that the '>' is shell redirection, which will only work if you are running from cmd.exe or another commandline shell.
If you can't run wldquery.exe from a shell for some reason and still need the file output option, let me know by opening a new issue on the wldquery repository and I'll add a file output command switch.


Add flowbite-svelte UI component library

Hey @TheComputerM,
Thanks for this awesome list!
I've added Flowbite Svelte as a pretty popular and open-source UI component library.
Cheers,
Zoltan

LGTM


Planning to upgrade logo on GitHub Marketplace to Microsoft logo by end of May 2021

Team,
We are planning to upgrade the logo for all 13 GitHub Actions projects listed on the GitHub Marketplace to the official Microsoft logo.

We'd like to make this change by the end of May 2021.
Please let us know if you have any objection, otherwise we'll proceed.
https://github.com/microsoft/powerplatform-actions

Hi Jeremy, no objection. Feel free to proceed. Thank you!

Awesome @xinshiMSFT! Would you mind closing out this issue? (Helps us keep track of which folks we've gotten approval from). Thanks again!


How to get NODE_ENV=test/dev in statically generated site?

I build and deploy my site to a test server (AWS S3), then hit it with Selenium tests before deploying to the prod server. I call a weather API that only allows me a certain number of calls on the free tier. I would like for NODE_ENV=test nuxt generate to point at test data instead of the actual API. I've set the dev: property in nuxt.config.js but it didn't work. Heres an example of what I'm talking about:
   if (process.env.NODE_ENV === 'production') {
       // Call the real API
    } else { // Test data
      this.temperature = '70.01'
      this.description = "sunny"
      this.iconId = weatherIcons[Math.floor(Math.random() * weatherIcons.length)].ow
      this.imgLoaded = true
    }

process.env.NODE_ENV === 'production' is replaced with true or false on build, so changing before start wouldn't make difference. EIther have separate build/dev builds or use different way to switch to test mode


UI diagrams?

We need to make a basic mockup. Integrate feedback from team. Ask Jumana and the team to create wireframes for what they want to map


Demo does not work

Steps to reproduce:

Open mailin.io
Copy the email shown there
Create and send a new email. Subject: "Demo", body: "This is a test email".
Nothing changes after 10 minutes

Expected: 4. The message is shown on the screen.
Browser: Firefox (latest) on Ubuntu 16.04
The console correctly printed Object { message: "Subscribed to room iwrhlt" }
The email I used is<EMAIL_ADDRESS>Did it never reach your server or did it reach the server but was not displayed properly?

In #117, @Flolagale explained earlier this week that the demo was down due to DNS-related issues. I believe these have not been fixed yet.

Ah sorry, I tried searching specifically for the demo not working but didn't see that issue. I'll leave this open as you might want to keep it open until it's fixed, please close this issue otherwise.

here is the mailer daemon response  i got with yandex mail:

This is the mail system at host yandex.ru.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
Please, do not reply to this message.
<EMAIL_ADDRESS>connect to mxmailin1.mailin.io[<IP_ADDRESS>]:25:
Connection refused

here is the mailer daemon response  i got with yandex mail:

This is the mail system at host yandex.ru.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
Please, do not reply to this message.
<EMAIL_ADDRESS>connect to mxmailin1.mailin.io[<IP_ADDRESS>]:25:
Connection refused


UIRefreshControl extension added to begin refresh programatically.

Checklist

[x] I checked the Contributing Guidelines before creating this request.
[x] New extensions are written in Swift 4.
[x] New extensions support iOS 8.0+ / tvOS 9.0+ / macOS 10.10+ / watchOS 2.0+.
[x] I have added tests for new extensions, and they passed.
[x] All extensions have a clear comments explaining their functionality, all parameters and return type in English.
[x] All extensions are declared as public.
[x] I have added a changelog

When a UIRefreshControl is added as a subview inside of UITableView, then calling the beginRefresh method does not show up the UIRefreshControl inside the UITableView. Developer had to manually change the content offset of the UITableView instance.
Source: Stack Overflow

          4 Messages

:book:
Thank you for submitting a pull request to SwifterSwift. The team will review your submission as soon as possible.

:book:
iOS: Executed 488 tests, with 0 failures (0 unexpected) in 3.290 (3.873) seconds

:book:
tvOS: Executed 457 tests, with 0 failures (0 unexpected) in 1.848 (2.246) seconds

:book:
macOS: Executed 331 tests, with 0 failures (0 unexpected) in 1.324 (1.570) seconds

  Generated by :no_entry_sign: Danger

While pushing the last changes, github was showing that If i tried to merge into master there is a merge conflict in CHANGELOG.md file. Then i resolved the conflict and committed the changes. After committing the changes Codecov reported that
Merging #525 into master will decrease coverage by 0.04%.
What was my fault, please mention how could i resolve it.
T.I.A


Confirm whether Minio can be used for RHODS DSP (or equivalent alternative)

We allow DSPO users to submit DSPA and specify a minio image if they would like object storage. However, this is for testing/experimentation, and we do not support this.
One major reason why is Red Hat does not have its own offering of an official Minio image, as it can be considered competing product. Before we consider whether buildling Minio is even a viable option, we should first confirm the following with the storage team:

Can RHODs use Minio?
If so, can we build Minio in CPAAS?
Does the storageteam have an alternative suggestion to Minio, that is equally as light weight, and offers similar "plug-n-play" style deployment, scoped to ocp projects for each deployment?

We'll need to stick with a documentation-only "here's how you can configure minio yourself if you want to" approach.


Propose external library for sharing logic for operator checks

Is your feature request related to a problem? Please describe.
The CNF Test Suite team and the Preflight team are both working to verify customer workloads and we would like to use some of the logic/checks that the preflight repo does for operators (and maybe even containers) from here and bring that same logic into the CNF test suite.
Describe the solution you'd like.
Some sort of consumable, external library (redhat-openshift-ecosystem/preflight-lib or some-name) where we can share the logic for performing checks against customer workloads.  We could/should also think about sharing the logic we have on our side as well for some additional collaboration.

Maybe it doesn't even need to be that extreme as the full check being broken out but possibly just the engine(s).
The wrapper around the operator-sdk commands would be cool to be able to consume for example:  https://github.com/redhat-openshift-ecosystem/openshift-preflight/blob/main/certification/internal/engine/operatorsdk.go

I have been working on implementing this the last couple of weeks and I think I'm at the point where I'm ready to demo/ask additional questions of the preflight team to help me complete the work.
Here is my WIP PoC PR for the work in the TNF suite: https://github.com/test-network-function/cnf-certification-test/pull/592
Here is my branch in my fork of the preflight repo where I'm building out the preflight "lib" functionality: https://github.com/sebrandon1/openshift-preflight/tree/preflight_lib_test
Essentially what I'm doing is trying to expose the functionality already living in preflight to be able to be consumed by the TNF suite.

Currently the preflight repo uses its cmd package to interact with the user + build test runners based on parameters passed in via the CLI.
What I did is break the the cobra/viper logic away from the test builder logic and put that into the "lib" package and corresponding folder/files.  By doing this, I can reference the lib package directly from the TNF repo and pass in the parameters I want to kick off the tests.
The TNF repo also uses Ginkgo so I report the results in the claim file output and it looks like a native test was ran as part of the TNF code.
Outstanding questions I need some clarification on:

Pyxis and connect credentials.  I have currently left those out of the scope of my changes because I didn't want to have to deal with credentials while getting this PoC running.  Maybe the preflight team can also consume oct when it's ready?
Operator scorecard tests.  The documentation seems geared towards someone running this via the CLI and passing in a valid KUBECONFIG.  If I'm already running this application within a cluster, how do I get the scorecard binary to correctly use an in-cluster-config?  Not sure if that's possible?

Pyxis and connect credentials.  I have currently left those out of the scope of my changes because I didn't want to have to deal with credentials while getting this PoC running.  Maybe the preflight team can also consume oct when it's ready?

Just to provide some clarity,. the Pyxis credentials are used for submission of images/rpm-manifests/results/artifacts to a partners certification project on their behalf. Any Pyxis call that preflight makes in a check currently does not need credentials as we call public endpoints.
I will also note that if only operator policies are being exposed in the lib, these are not needed since any interacting with the partners project is done in the Hosted or Ci Pipeline, and not in preflight directly.

I'm going to mark this issue as closed. We're currently tidying up and refactoring to get this merged into main, but the work done by @sebrandon1 here is merged to main, and the library can be consumed in the lib branch until it's merged to main in its final form!

Thanks @komish!


An option for using a standard navigation bar title?

As-is the release notes title is rendered using a Text view in:
https://github.com/mergesort/Recap/blob/8ce1035505017e6d72a309c4b2c48ab6b79ecc20/Sources/Recap/Internal/ReleaseView.swift#L13-L19
This is good, in that it works for the general case of longer titles.
It would be nice (and note: this is definitely a "nice to have" feature request due to the expected relative complexity of the required changes to the code), if it was possible to use a standard .title modifier on the ReleaseView.swift and get the benefits of the UINavigationBar large title + scrolling behavior to make the UX feel more standard.

Ahh interesting. That's pretty good justification for tuning this then.
I wonder if we can improve the behavior then to use the frosted material effect when content scrolls behind the navigation bar then? I think the fact that it's a solid background is what makes it feel somewhat off (to me) right now.


Add support for Python 3.9 - 3.12

Was done as part of the PRs that cleaned up dependencies.
Tested locally with Python 3.12.


Camera Image Broken

In Newest HA:
2022-04-17T09:17:46.264257842Z 2022-04-17 11:17:46 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: dict object has no element 1 when rendering '{{ value_json.1.value }}' 2022-04-17T09:17:46.276136155Z 2022-04-17 11:17:46 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: dict object has no element 0 when rendering '{{ value_json.0.value }}' 2022-04-17T09:17:54.841698217Z 2022-04-17 11:17:54 ERROR (MainThread) [homeassistant] Error doing job: Future exception was never retrieved 2022-04-17T09:17:54.841732977Z Traceback (most recent call last): 2022-04-17T09:17:54.841738405Z   File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run 2022-04-17T09:17:54.841742473Z     result = self.fn(*self.args, **self.kwargs) 2022-04-17T09:17:54.841745810Z   File "/config/custom_components/ha_strava/camera.py", line 168, in img_update_handler 2022-04-17T09:17:54.841749391Z     self._urls = { 2022-04-17T09:17:54.841752724Z TypeError: unhashable type: 'slice' 2022-04-17T09:17:55.001532169Z 2022-04-17 11:17:55 ERROR (MainThread) [homeassistant.components.google_assistant.http] No configuration for request_sync available

Pretty sure I saw something regarding this previously either here or at  the  - But I can find it anymore...

I the log file, the URLS seems valid:
strava_cam changed to https://dgtzuqphqg23d.cloudfront.net/lRwE0t7fVAGRcQwOOcRhI9tdLFPRtaJTl3M20ysouH0-512x384.jpg
5:24:00 PM - 1 minute ago
strava_cam changed to https://dgtzuqphqg23d.cloudfront.net/wcKfC4OqGw-RwwdNFZmyMdkMBNAybDxy6luA5Q-gmCc-512x384.jpg
5:23:45 PM - 1 minute ago
But the image is broken in lovelace:
type: picture-glance
aspect_ratio: 0%
camera_image: camera.strava_cam
entities: []


add cupy.random.logistic

Jenkins, test this please.

You are right...
>>> cupy.isfinite(cupy.random.logistic(size=10**7, dtype=cupy.float32)).all()
array(True)

I think the output is not finite In the other approachs in wikipedia.
The output of gumbel is not finite.
>>> cupy.isfinite(cupy.random.gumbel(size=10**7, dtype=cupy.float32)).all()
array(False)

And, the output of standard_exponential could be 0.

I implemented finite sampling using rejection sampling.
>>> cupy.isfinite(cupy.random.logistic(size=10**8, dtype=cupy.float32)).all()
array(True)

Jenkins, test this please.

Jenkins, test this please.

Jenkins CI test (for commit d113543ca243463d5d83282e40adfa913ada2a04, target branch master) succeeded!

Jenkins, test this please.

Jenkins CI test (for commit d113543ca243463d5d83282e40adfa913ada2a04, target branch master) succeeded!


Support for a generator input type in GaussianNormalizer

Support for Gaussian Normalizer was added in https://github.com/neuraloperator/neuraloperator/blob/main/neuralop/datasets/output_encoder.py


Is a Question not bug

Hi, I want to know if it can be implemented with a countdown @pritishvaidya 👍

It has an in-built timer for now as you can provide the initial time in seconds. I've also exposed the card component to build a custom timer.
I would like to know more about what you would like to implement, perhaps with a simple demonstration or example.
Thanks

I would like to implement a countdown like this https://www.npmjs.com/package/react-native-countdown-component, but I like it more with the design and the animation that you did.

I'll have to make a separate package for it. The timer is not an issue but the cards animations are built in such a way that it flips and shows forward progression. For backward progression, the animations need to be reversed.

Of course it is the opposite that I need, I thank you very much, you will help me a lot with a project which I am working on.

I have published a new package for it

GitHub
npm

I didn't get much time to test it completely. Feel free to open the issue on that particular project.


Send '503 Service Unavailable' when handling a request already timed out

IllegalStateException: Request already timed out has to be translated to 503 Service Unavailable but it is currently being translated to 500 Internal Server Error:
[WARN] (CentralDogmaExceptions.java:77) Unexpected exception with error code INTERNAL_SERVER_ERROR (2) from: watchFile()
com.linecorp.centraldogma.internal.thrift.CentralDogmaException: java.lang.IllegalStateException: Request already timed out.
 at com.linecorp.centraldogma.server.internal.thrift.Converter.convert(Converter.java:215)
 at com.linecorp.centraldogma.server.internal.thrift.CentralDogmaServiceImpl.logAndInvokeOnError(CentralDogmaServiceImpl.java:396)
 at com.linecorp.centraldogma.server.internal.thrift.CentralDogmaServiceImpl.lambda$handleWatchFileResult$24(CentralDogmaServiceImpl.java:388)
 at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:822)
 at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:797)
 at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
 at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
 at com.linecorp.armeria.common.util.Functions.lambda$voidFunction$0(Functions.java:182)
 at java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:870)
 at java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:852)
 at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
 at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1977)
 at com.linecorp.centraldogma.server.internal.storage.repository.cache.CachingRepository.lambda$null$3(CachingRepository.java:199)
 ...
Caused by: java.lang.IllegalStateException: Request already timed out.

Regarding the legacy client, do we need to add one more error code and exception class for this?
https://github.com/line/centraldogma/blob/master/client/java-armeria-legacy/src/main/java/com/linecorp/centraldogma/client/armeria/legacy/LegacyCentralDogma.java#L582

Added a log message by #401 because it's hard to find a root cause of this log.

https://github.com/line/armeria/issues/1839 needs to be resolved first.


FEATURE(aamwriter): Language and not handled properties are stored in node template props

All the properties defined in a designer node that are explicitly handled in the translation process are stored in the properties of the node template.
There are two exceptions:

The language of a module is implicitly stored in the node_type, just for the matchmaking process. With this PR, the language is also a property of the node template, so each process that needs to know  the languages of the components, is able to retrieve it (e.g. monitoring rules generator)
The QoS section of each component are not stored in the node_template properties.

Hi @andreaturli , the build failed with the following error:
The command "aws s3 sync s3://seaclouds-m2/repository/ /home/travis/.m2/repository/ --quiet" failed and exited with 1 during
I guess it is related with the QA Module. Could you have a look? Thanks.

@rosogon, please rebase your branch on push it again, it should be ok now

+1


[analyzer] spread properties from method invocation using static variables have no staticElement

We have a tool internally that looks for method invocations on a certain api to generate documentation based on the codebase.
I've noticed some behavior that I would not expect.
Given the following setup:
void main() {
  Middleware().onSomeEvent();
}

class Middleware {
  // this would be a method on a specific class instance normally
  void logEvent(Map<String, String> properties) {}

  void onSomeEvent() {
    logEvent(_properties());
  }

  Map<String, String> _properties() => {_foo: "bar"};

  static const _foo = "oof";
}

We start analyzing, and we see this happening:

The analyzer will report the {..._properties()} as a SetOrMapLiteral
_properties() is reported as a MethodInvocation
_properties is reported as a SimpleIdentifier
We lookup the staticElement, and get the ParsedLibraryResult using the staticElement's library using the analysis context/session
We lookup the ElementDeclarationResult from the library element using the staticElements nonSynthetic
We find a MapLiteralEntry in tree of children of the element declaration, which contains a child in tree which is a SimpleIdentifier which refers to _foo
_foo does not have a staticElement (its null)

I would not expect the staticElement to be null for _foo
Our code to get the compilation units and analysis sessions:
      final analysisContext = AnalysisContextCollection(
        includedPaths: files.map((file) => file.absolute.path).toUnmodifiableList(),
        sdkPath: dartSdkPath,
      );

      final compilationUnits = <String, CompilationUnit>{};
      final sessions = <String, AnalysisSession>{};

      for (final file in files) {
        final context = analysisContext.contextFor(file.absolute.path);
        final resolvedUnit = await context.currentSession.getResolvedUnit(file.absolute.path);

        sessions[file.path] = context.currentSession;

        if (resolvedUnit is ResolvedUnitResult) {
          compilationUnits[resolvedUnit.path] = resolvedUnit.unit;
        }
      }

In below example we follow the same strategy, which works without issue (read: we get a staticElement for a given SimpleIdentifier):
void main() {
  final properties = {"oob": "fab"};

  logEvent(properties);
}

(here properties is also a SimpleIdentifier which we can look up)
I would almost assume this is a bug, but it could also be my knowledge lacking.
- Dart 3.2.3 (stable) (Tue Dec 5 17:58:33 2023 +0000) on "macos_arm64"
- on macos / Version 13.5.2 (Build 22G91)
- locale is en-NL

We lookup the staticElement, and get the ParsedLibraryResult using the staticElement's library using the analysis context/session

I suspect that this is the cause of the problem. The AST structure has two visible states: the parsed state and the resolved state. In the resolved state all of the fields that contain types or elements are null. In the resolved state these fields have been populated. We offer both because a parsed AST is much less expensive to produce and suitable for some uses. Just not for yours.
I suspect that you'll to be able to access the information you need if you access the ResolvedLibraryResult for the staticElement.

@bwilkerson thanks! this indeed resolves the issue. Is there any documentation somewhere on all this?

Yes, there's a description in sdk/pkg/analyzer/doc/tutorial/ast.md.


https://github.com/project-chip/connectedhomeip/issues/3276 needs to be

fixed to implement this for real.

https://github.com/project-chip/connectedhomeip/blob/f0f5de0d79ae1c51d7fddbf70900ebac0acd899a/src/app/clusters/ias-zone-server/ias-zone-server.cpp#L163-L168

This issue was generated by todo-issue based on a TODO comment in f0f5de0d79ae1c51d7fddbf70900ebac0acd899a.

This type isn't required for v1.X


Update pylint.yml

Updated the code so that it takes the file which is changed

Not useful anymore so closing


[hierarchical widget] add the alwaysGetRootLevel as an option

cc @vvo

We need to map the helper option here, easy one

@maxiloc I cannot find the option name anymore in the helper, can you?

no :smile:

@maxiloc It was removed here: https://github.com/algolia/algoliasearch-helper-js/commit/01cb48da841f2a4e740fe5cc5f870bbc4f48b00b
When we fixed the default behavior to always get the root level because it made more sense.

So I do not completely understand your issue, try again :)

It's good now, if it's the default behavior


Can I configure custom http response headers?

Details
I need to set some headers to the response of some files.
I found that it is possible by using the Amplify Console (https://docs.aws.amazon.com/amplify/latest/userguide/custom-headers.html)
But for specific reasons I am not using the console. I am deploying the app by using the amplify publish command.
Is there a way to do this with the current amplify cli? or changing some configuration?
If there isn't, this will probably turn into a feature request.
Thank you in advance.
Amplify CLI Version
4.20.0

Hi @toritroniks
I don't think we currently support this through cli. we will surely take this up into consideration for a feature request or enhancement.

hi @toritroniks
May I know specific usecase you want to achieve?

@akshbhu
In my case, there are mainly 2 use cases.

Specify the Cache-Control and Pragma response header for specific files, to avoid local browser and proxy cache.
Include some security headers in the response. (Specifically: X-Frame-Options: SAMEORIGIN)

The second one was from a security check using OWASP ZAP. It complained that the header wasn't set.
If you need any more information, just let me know.

@toritroniks Did you consider modifying the generated CloudFormation files located inside the amplify/hosting/<resource-name> directory for this? Did you run into roadblocks while customizing the generated CloudFormation file?

Hi, @kaustavghosh06
sorry for the late response.
Correct me if I’m wrong, but I don think it’s possible to set the response headers of the files inside the S3 bucket with CloudFormation.
If there is a way, I would really appreciate some guidance!
right now the only thing I can think of is to run some script to edit the files metadata after the deploy... but it’s far from ideal.
If there is no way to set it with cloudformation, I believe this is an important enhancement!


[feature request]: Implement DES algorithm

Inspiration
https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.des.create?view=net-6.0

Do you really want to promote use of an algorithm that is known to be insecure?
https://search.brave.com/search?q=Is+DES+considered+secure%3F&summary=1&summary_og=9b36ac7a622cacab00d548

@jwdonahue it sound like a valid point, it was asked few years back. But think based on this knowledge, this should not be done. I will close this feature.


No need to output error messages when subcommand is missing

Description
Fixes pyrsia/pyrsia#588

This PR fix incorrect error message when subcommand is missing
Screenshots (optional)

PR Checklist

[X] I've read the contributing guidelines.
[X] I've read "What is a Good PR?"
[X] I've included a good title and brief description along with how to review them.
[X] I've linked any associated an issue.
[X] I've requested a review  from pyrsia/collaborators.

Code Contributions

[X] I've built the code cargo build --all-targets successfully.
[X] I've run the unit tests cargo test --workspace and everything passes.

@MitaliBo can you let us know if this is the intended behavior 🙏

@AbhijithGanesh Please help to review src/artifacts_repository/artifact_manager.rs. To resolve the clippy warning, I changed &mut Pathbuf to &Path.


[Include] should not Include Source Generators

When using [Include] with a wildcard, source generators will also be included.
Since source generators would be alphabetically after the original file, the function defined in the source generator will be the one used.
There are two ways around this:

Reversing the input order.
Exlcuding source generator files.

The latter approach makes the most sense.

Reopening and renaming.
In practical terms, files can only be included predictably if they are simple .ps1 files.
As written, this could include tests files and other unintended side-effects.

Reopening once more (regex issue)