Change Copyright Notices to CNCF-recommended format

What would you like to be added:
Follow the CNCF's Copyright Notices recommendations. Namly, change all notices that mention specific companies to one of:
Copyright The XYZ Authors.
Copyright The XYZ Contributors.
Copyright Contributors to the XYZ project.

My inclination is "Contributors to the Submariner project", but I'm open to any of the options.
https://github.com/cncf/foundation/blob/master/copyright-notices.md#copyright-notices
Why is this needed:
As part of the CNCF Sandbox onboarding process (https://github.com/submariner-io/submariner/issues/1297).

I think we should also be more strict in the lintig to require this copyright notice exactly, not accept any other.

And while we’re at it, add SPDX headers.

#1335 shows that we can’t use .legal.json to enforce this, we’d have to add something else (or use two enforcements with different configurations, one to check that the license statement is present everywhere, the other to check that the copyright statement is the one we expect on all non-generated files).

This is now done for all of our Go code. Thanks @skitt!


support this plugin

i have found this plugin :
https://addons.mozilla.org/en-GB/firefox/addon/adaptive-tab-bar-color/
and i think it will be more awsome if this theme can change tabbar color

Known Issues
Does not support CSS themes

I'll def. give this a shot,  but I don't really have high hopes of getting this to work as the Readme already states that it doesn't work with custom CSS. :c

I've played around with the plugin a little more and it's actually possible to make it work with Cascade as well. The only issue: Firefox keeps crashing consitently with the plugin enabled. I haven't checked out this bevahiour without Cascade, but my assumption is that it's not the custom CSS causing the issue here, but the plugin itself. So that's something to keep in mind.

@andreasgrafen out of curiosity what edits did you attempt, I'd like to dig more into this.
It would be great if you make an adaptive branch (or just throw it in experimental)

It seems to work when you just strip out all colour definitions. Tho it's glitchy from time to time.

Just so we're on the same page, I've stripped the colors out like so:

And now my firefox looks like my gtk theme, however there are some opacity issues that didn't exist before:
transparent alert message

tabs have no background hence tab names overlap when dragging

And after installing the Adaptive Tab Bar Color extension all hell broke loose (navbar and search suggestions went full transparent)

On the bright side none of the crashed you've mentioned occurred to me.
I'd really appreciate some feedback here, Did I strip the colors the same way you did? Iet me know what you think.

Ah, That's more like it, no crashes as well, big thanks!
One thing is I've noticed the elements that get effected by the 3 main color definitions change depending on if the plugin is installed on not
--window-colour:                     #1E2021;
--secondary-colour:                  #191B1C;
--inverted-colour:                   #FAFAFC;

I haven't looked into the other colors.

Oh, right! I totally forgot to check that..
You might be able to get away with removing lines 444 to 451 to fix the urlbar popout colours.

Actually doing that results in the same opacity issue in the last image above.

nyeh..
What happens if you additionally remove lines 438 to 441?
Maybe even line 417.

Yeah that fixes it, I'm noticing a lot of pieces were removed in order to make this happen, maybe split the style sheets and let the user require the parts that fit their needs?
This would work great for colors as well since users could update cascade and keep their custom colors

Yeah. That's a long term plan I haven't implemented yet.. Tho, I'm currently working on a complete rewrite of Cascade anyway. So that will come for sure! c:

Heya … it has been quite a while but I finally got around to implement all the things I wanted into a reworked version of Cascade. If you're still interested in this you could check out the rework branch and just remove the colours include from the main file to ensure you're using the system colour. I've done some quick testing and on my end it works quite well with this plugin. c:


Use relaxed instead of memory_order_consume for all CPUs

The purpose of memory_order_consume, at least on paper, is to enforce data ordering dependencies on platforms where memory is weak, but not on other platforms where memory dependency ordering is automatic.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0098r0.pdf
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0371r1.html
Because we use std::memory_order_relaxed anyway, there is no need for memory_order_consume, which compiler manufacturers just map to memory_order_acquire in practice, which does put barriers on all platforms.
For now, those barriers are desirable on any platform, we can just use memory_order_acquire.

@AnthonyLatsis can we please run test and benchmarks

@swift-ci please test

@atrick Thoughts?

@atrick Thoughts?

I'll offer thoughts in case it helps other reviewers.
It is tragic whenever the compiler emits a hardware memory fence (acquire barrier) and all we needed was "consume" semantics, which is standard in every architecture since DEC alpha. Maybe LLVM has improved since I last checked so it no longer emits barriers in all cases for consume.
Programmers cannot blindly replace consume with relaxed which is less strict. First you need to prove to yourself that the way you access those variables cannot be exploited by some compiler optimization that speculates the value of a load and violates consume ordering. Presumably, the Swift runtime meets that condition, so it's safe enough to drop consume in favor of relaxed in SWIFT_MEMORY_ORDER_CONSUME. I think that reasoning holds the same weight on both arm and x86, so I'm not sure why we need to distinguish them.
This PR also removes acquire barriers though, which seems extremely dangerous.

Those are only in cases where we are assigning to expected, which isn't used again, so it doesn't matter.

@atrick Thoughts?

I'll offer thoughts in case it helps other reviewers.
It is tragic whenever the compiler emits a hardware memory fence (acquire barrier) and all we needed was "consume" semantics, which is standard in every architecture since DEC alpha. Maybe LLVM has improved since I last checked so it no longer emits barriers in all cases for consume.
Programmers cannot blindly replace consume with relaxed which is less strict. First you need to prove to yourself that the way you access those variables cannot be exploited by some compiler optimization that speculates the value of a load and violates consume ordering. Presumably, the Swift runtime meets that condition, so it's safe enough to drop consume in favor of relaxed in SWIFT_MEMORY_ORDER_CONSUME. I think that reasoning holds the same weight on both arm and x86, so I'm not sure why we need to distinguish them.
This PR also removes acquire barriers though, which seems extremely dangerous.

Every case of relaxed is in the failure case, and that case is where the assigning to expected happens, the value of which is discarded anyway.
If we are reusing that value, then you would be correct. However, because expected is not being used again, we can safely do this.

@atrick every case of relaxed has been tested and validated in both theory and practice.
The only real concern is if acq_rel is really needed or if we can get away with release.
Also, consume is one of those things we don't really need in practice, as compiler just treat it as acquire just to be safe, which is why the barrier happens.
Consume is in theory supposed to not emit fences but control compiler generation for dependent values on weak architectures, which is ARM in this case.
Perhaps I should just have it be acquire on powerPC.

I've run so many tests and verified this is okay on both Intel and ARM.
However perhaps I need to not do that on PowerPC

Basically, consume was made for the rare condition you would only see on weak architectures as strong architectures do basic dependency ordering on their own.
In practice, because I'm just speaking in general, and it's more nuanced than that, compiler vendors cannot made this assumption for all cases, and inserts an acquire fence to be safe.

prove to yourself that the way you access those variables cannot be exploited by some compiler optimization that speculates the value of a load and violates consume ordering. Presumably, the Swift runtime meets that condition, so it's safe enough to drop consume

Nope. LLVM and other vendors treat consume as acquire with the developers citing ambiguity in the formal definition of consume operation and semantics.

Nope. LLVM and other vendors treat consume as acquire with the developers citing ambiguity in the formal definition of consume operation and semantics.

It seems straightforward enough to treat the consume just like an acquire for the purpose of optimization and simply omit the hardware fence. But neither of us will change that any time soon.

@atrick every case of relaxed has been tested and validated in both theory and practice.
The only real concern is if acq_rel is really needed or if we can get away with release.

I'm not familiar enough with these code paths to prove correctness. I would reduce the proof to a couple basic rules:
load consume can be promoted to load relaxed if it is impossible for the compiler to guess the value being loaded.
load acquire_release can be promoted to relaxed_release if there are no memory operations that require ordering between this load and some subsequent acquire of the same variable (the release is orderd before the acquire in any sane implementation). Presumably the failure path always performs another load acquire on the same variable.

@swift-ci please smoke test

@swift-ci please smoke test

I think a full test and benchmark is in order. Just to see if it's worth it.

@swift-ci please benchmark

@swift-ci please test

Everything passed.
Though it's difficult to detect concurrency bugs, I don't see why these changes would cause any bugs.
Also 30% improvement is crazy.


How to disable the shortcut Ctrl+Shift+T to start carbon?

The shortcut Ctrl+Shift+T is actually meant to open the last closed tab, but when I install carbon as a browser app, it seems that this shortcut is set to open carbon. How can I prevent this without having to uninstall carbon?

OS: Windows 10
Browser: Microsoft Edge Beta

Hey @FabianBartl, we don't actually use/set/edit that shortcut, so I am assuming this is an issue with your operating system/browser configurations.
All shortcuts that Carbon uses can be found here: https://carbon.now.sh/about


Remove duplicate Volume entries

#49 has identified a duplication of Volume mounts using report functionality introduced in #50.
Duplicate mount entries have absolutely no purpose, so we should remove them.
This issue is being blocked for now by #2, #50, #49 respectively (in order), because it depends on functionality from each to test, develop and resolve.

[x] #2
[ ] #50
[ ] #49

This one is based upon #50 and can be merged into it. #49 actually prevents the test case from occurring - we can't fix this if we can't reproduce it.
Merging is good if tests pass, but only back into #50.


[path_provider] Add Linux support

This is a common plugin, so we should support it on desktop. We'll need to decide on what conventions we want to use for Linux for some of the app-specific paths, since there's not necessarily an OS standard.

Blocked on https://github.com/flutter/flutter/issues/55327 for Linux. Once that's done we can do this as a Dart-only "plugin" (see WIP PR above)

@stuartmorgan This can be closed now :)


Change timer text in profile

This requires 2 (temporary changes):

change the timer to be ending 30th of April (we can change this later)
text should read: "Don't miss out! Only xxx left to gift your dream tokens" (with the xxx being the counter)

I saw that and in the app it's called lockdown functionality. Which gives a warning for upcoming deadlines.
There are three deadlines set in dreams:
submit_dream: 2020-05-02t05:05:00+02:00
safety_file: 2020-03-15t00:00:00+02:00
granting: 2020-05-05t00:00:00+02:00
I think @waldov86 you are referring to the granting deadline.
Do you know what safety_file is about? I think it was a functionality that was added by borderland. I would disable it for now

Interesting. I guess Dreams will need to be set up with the different deadlines for submission and granting deadlines. There is no need for a safety file deadline.
For now, the deadlines could be:

submit_dream: 15th of May

granting: 15 of April

Granting until the 15th of April and submitting a d ream one month attaer on the 15th of may? that doesn't make much sense :)

Please provide the correct deadlines

Submit Dream: 15th of April
Granting: 15th of May


Remove redundant assets location in pubspec.yaml

:tada: This issue has been resolved in version 1.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Potential bug in tests/test_search.py/test_search_columns_with_iterables

Describe the bug
In the 3rd parametrization of tests/test_search/test_search_columns_with_iterables.py, we have the following:
def test_search_columns_with_iterables(query, require_all, expected):
    df = pd.DataFrame(
        {
            "A": ["cat0", "cat1", "cat1"],
            "B": [["a", "b"], ["a", "b", "c"], ["c", "d", "a"]],
            "C": [("cx", "cy"), ("cx", "cz"), ("cz", "cy")],
            "D": [{0, 1}, {0, 2}, {0, 1}],
            "E": ["xxx", "xxx", "yyy"],
        }
    )
    results = search(
        df=df,
        query=query,
        columns_with_iterables=["B", "C", "D"],
        name_column="A",
        require_all=require_all,
    ).to_dict(orient="records")
    assert results == expected

where
query =  {'B': ['a', 'b'], 'D': [0]}
require_all =  True

This means we start with the following dataframe:
      A          B         C       D    E
0  cat0     [a, b]  (cx, cy)  {0, 1}  xxx
1  cat1  [a, b, c]  (cx, cz)  {0, 2}  xxx
2  cat1  [c, d, a]  (cz, cy)  {0, 1}  yyy

and apply the search parameters above to it. In the test, we have
>>> expected
      A       B         C    D    E
0  cat0  [a, b]  (cx, cy)  {0}  xxx
1  cat1  [a, b]  (cx, cz)  {0}  xxx
2  cat1     [a]  (cz, cy)  {0}  yyy

ie. all rows match - however df.loc[2, 'B'] returns a list filtered for elements contained in the query. However, we have require_all=True, and so as df.loc[2, 'B'] != query['B'], this row should not be in the returned dataframe.
I believe that the test should expect this returned dataframe
      A       B         C    D    E
0  cat0  [a, b]  (cx, cy)  {0}  xxx
1  cat1  [a, b]  (cx, cz)  {0}  xxx

Additional context
I came across this bug whilst trying to wrap my head around this package. The search._search function is pretty difficult to understand & so I rewrote it from scratch in polars as an exercise in understanding how it functions. I've been unable to reconcile this test failure with the other tests in my reimplementation.

I think the test is correct. name_column is "A" and the value in the "A" column is cat1 for both rows 1 and 2. So to include everything that satisfies the require_all criteria, I think row 2 needs to also be included.
I agree this function is confusing as heck and needs refactored. Would it be easiest to have a quick chat about requirements/functionality?

Yeah, I think that would be really helpful - I've been trying reverse engineer the logic & was struggling to get everything to match up.
With that said, I think I had misunderstood the intention of require_all - I've altered a couple of other tests where it also seemed inconsistent. I'm gonna have another crack first and see if that restores the tests to their previous state.

@dougiesquire I haven't been able to fix this - I can easily get the grouping to work as (I think) you've described above, but doing so breaks other tests, so I must be missing something important.
When would you be available to run me through the logic of how the search flags work? My calendar is generally pretty open for this week & next - I figure you've probably got a few pressing demands on your time so happy to fit around you.
I'll be catching up with @rbeucher & @marc-white at 8AM AWST/ 11AM Hobart time tomorrow if you're available then?

It was great to catch up with you @charles-turner-1! Just to try clarify (hopefully) and document a little what we discussed, I'll use your above example but ditch the C column for convenience.
So we have this query:
query =  {'B': ['a', 'b'], 'D': [0]}
require_all =  True

on this dataframe:
      A          B       D    E
0  cat0     [a, b]  {0, 1}  xxx
1  cat1  [a, b, c]  {0, 2}  xxx
2  cat1  [c, d, a]  {0, 1}  yyy

Both cat0 and cat1 satisfy the criteria since they contain both B=a, D=0 and B=b, D=0. But cat1 contains B=a, D=0 with both E=xxx and E=yyy. Both should be returned, so:
      A       B    D    E
0  cat0  [a, b]  {0}  xxx
1  cat1  [a, b]  {0}  xxx
2  cat1     [a]  {0}  yyy

To try make this more practical, imagine B represents variable, D represents realm and E represents frequency. A user would want to know that B=a, D=0 is available at multiple frequencies.

@dougiesquire thanks very much for the help! I've changed the implementation as you've suggested & it's resolved the questions with require_all.
I still can't quite understand what we expect to happen when we haverequire_all=True on non-iterable columns: see CI run.
I think in this instance, we would want to aggregate the column on name and then filter, rather than filter and then aggregate as we do on the columns? See also comments on PR

Could we just cast these to len 1 lists, agg and filter, then cast them back? (Note I'm on my phone atm and haven't looked at your links yet so might be missing something)

I did think about that - we've been doing that in the translators, so maybe that's been implicitly happening? It's a good starting point though.


Unrecoginized command received over pipe

This is my first try of AFL, but I'm unable to have it running properly, here is the source of the program I'm fuzzing:

/*
Author: Hardik Shah
Email<EMAIL_ADDRESS>Web: http://hardik05.wordpress.com
*/

//a vulnerable c program to explain common vulnerability types
//fuzz with AFL

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<Windows.h>

struct Image
{
	char header[4];
	int width;
	int height;
	char data[10];
};

void stack_operation() {
	char buff[0x1000];
	while (1) {
		stack_operation();
	}
}

_declspec(noinline) int ProcessImage(char* filename) {
	FILE* fp;
	struct Image img;

	fp = fopen(filename, "r");            //Statement   1

	if (fp == NULL)
	{
		printf("\nCan't open file or file doesn't exist.\r\n");
		exit(0);
	}

	while (fread(&img, sizeof(img), 1, fp) > 0)
	{
		//if(strcmp(img.header,"IMG")==0)
		//{
		printf("\n\tHeader\twidth\theight\tdata\t\r\n");

		printf("\n\t%s\t%d\t%d\t%s\r\n", img.header, img.width, img.height, img.data);

		//integer overflow 0x7FFFFFFF+1=0
		//0x7FFFFFFF+2 = 1
		//will cause very large/small memory allocation.
		int size1 = img.width + img.height;
		char* buff1 = (char*)malloc(size1);

		//heap buffer overflow
		memcpy(buff1, img.data, sizeof(img.data));
		free(buff1);
		//double free
		if (size1 / 2 == 0) {
			free(buff1);
		}
		else {
			//use after free
			if (size1 / 3 == 0) {
				buff1[0] = 'a';
			}
		}

		//integer underflow 0-1=-1
		//negative so will cause very large memory allocation
		int size2 = img.width - img.height + 100;
		//printf("Size1:%d",size1);
		char* buff2 = (char*)malloc(size2);

		//heap buffer overflow
		memcpy(buff2, img.data, sizeof(img.data));

		//divide by zero
		int size3 = img.width / img.height;
		//printf("Size2:%d",size3);

		char buff3[10];
		char* buff4 = (char*)malloc(size3);
		memcpy(buff4, img.data, sizeof(img.data));

		//OOBR read bytes past stack/heap buffer
		char OOBR = buff3[size3];
		char OOBR_heap = buff4[size3];

		//OOBW write bytes past stack/heap buffer
		buff3[size3] = 'c';
		buff4[size3] = 'c';

		if (size3 > 10) {
			//memory leak here
			buff4 = 0;
		}
		else {
			free(buff4);
		}
		int size4 = img.width * img.height;
		if (size4 / 2 == 0) {
			//stack exhaustion here
			stack_operation();
		}
		else {
			//heap exhaustion here
			char* buff5;
			do {
				buff5 = (char*)malloc(size4);
			} while (buff5);
		}
		free(buff2);
		//}
		//else
		//	printf("invalid header\r\n");

	}
	fclose(fp);
	return 0;
}

int main(int argc, char** argv)
{
	printf("[+] %s() offset: 0x%x\n", __FUNCTION__, (char*)(*&main) - (char*)GetModuleHandleA(NULL));
	printf("[+] %s() offset: 0x%x\n", __FUNCTION__, (char*)(*&ProcessImage) - (char*)GetModuleHandleA(NULL));
	ProcessImage(argv[1]);
	return 0;
}

The main function is situated is at offset 0x1220 and ProcessImage is at 0x1060.
Here is the result of debug with offset 0x1220 (main function):

Module loaded, CrackMe.exe
Module loaded, aswhook.dll
Module loaded, VCRUNTIME140.dll
Module loaded, KERNEL32.dll
Module loaded, KERNELBASE.dll
Module loaded, ucrtbase.dll
Module loaded, ntdll.dll
Module loaded, dynamorio.dll
Module loaded, drmgr.dll
Module loaded, drwrap.dll
Module loaded, winafl.dll
Module loaded, drx.dll
Module loaded, drreg.dll
In pre_fuzz_handler
In post_fuzz_handler
In pre_fuzz_handler
In post_fuzz_handler
In pre_fuzz_handler
In post_fuzz_handler
In pre_fuzz_handler
In post_fuzz_handler
In pre_fuzz_handler
In post_fuzz_handler
In pre_fuzz_handler
In post_fuzz_handler
In pre_fuzz_handler
In post_fuzz_handler
In pre_fuzz_handler
In post_fuzz_handler
In pre_fuzz_handler
In post_fuzz_handler
In pre_fuzz_handler
In post_fuzz_handler
Everything appears to be running normally.
Coverage map follows:

The coverage map is full of null bytes, seems wrong?
Here is the result of debug with offset 0x1060 (ProcessImage function):

Module loaded, CrackMe.exe
Module loaded, aswhook.dll
Module loaded, VCRUNTIME140.dll
Module loaded, KERNEL32.dll
Module loaded, KERNELBASE.dll
Module loaded, ucrtbase.dll
Module loaded, ntdll.dll
Module loaded, dynamorio.dll
Module loaded, drmgr.dll
Module loaded, drwrap.dll
Module loaded, winafl.dll
Module loaded, drx.dll
Module loaded, drreg.dll
In pre_fuzz_handler
About to make IsProcessorFeaturePresent(23) returns 0
Exception caught: c0000417
WARNING: Post-fuzz handler was never reached. Did the target function return normally?
Coverage map follows:

The coverage map again contains only null bytes.
Running afl-fuzz against both offsets returns the following:

Here is the used command:
afl-fuzz.exe -i input -o output -t 5000+ -D "C:\Users\User\Desktop\bug tools\DynamoRIO\bin32" -- -coverage_module CrackMe.exe -target_module CrackMe.exe -target_offset 0x1060 -fuzz_iterations 5000 -call_convention thiscall -nargs 2 -covtype edge -- CrackMe.exe @@
Any ideas? Thank you

The coverage map containing null bytes is normal, that's because you haven't passed any -coverage_module at that point. The debug log for offset 0x1220 looks correct, but not for the other one.
Some questions that might help

Which Windows version and which DynamoRIO version are you using? Did you build the latest WinAFL yourself?
When running debug mode for offset 0x1060, have you tried changing -call_convention?

Adding also @hardik05 who I see is author of your test target and might have some ideas.

Thank you for your reply @ifratric, completely removing the call convention argument did it!
It's a bit weird because I was following a Youtube tutorial, and the source code I used is provided by the creator, so the argument worked fine for him but not me, but hey, I can't complain, just glad I have it running.
Thank you again!


Audio stream not detected in large file (24h)

Using v17.12 GUI, the following file does not show an audio stream: https://media.axprod.net/TestPattern/24h_TestPattern_B_420.mp4

This content is 24 hours long, which might be a contributing factor. Cutting the same content down to 1h makes the audio stream info show up.
Compare to FFprobe, which does show the audio steam:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '24h_TestPattern_B_420.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.5.101
  Duration: 24:00:00.02, start: 0.000000, bitrate: 226 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 169 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 47 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

With CLI, I see something like an error message at the head of the output:
d:\Tmp\TestPattern>MediaInfo.exe 24h_TestPattern_B_420.mp4
E: File read error
General
Complete name                            : 24h_TestPattern_B_420.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 2.27 GiB
...

Definitely a problem somewhere, weird that the 24-hour video is detected but not the audio part.

(Automatic message) Warning: requests without support contract are set to low priority, we don't know when we have time to handle it.
If you desire to accelerate the development, don't hesitate to contact us for a quotation.


SSR support

¿Will SSR be supported?

ReferenceError: window is not defined
at C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:12046
at C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:11978
at p.exports (C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:12264)
at Object. (C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:12740)
at e (C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:408)
at Object.module.exports.render._h.staticClass (C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:9170)
at e (C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:408)
at Object. (C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:640)
at e (C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:408)
at p.__esModule.default (C:\app\node_modules\vue-infinite-loading\dist\vue-infinite-loading.js:1:496)

Excuse me, I don't know what is the SSR, could you explain to me?

here: https://rc.vuejs.org/guide/ssr.html

Does someone know how to prevent this error?: ReferenceError: window is not defined

Thanks for your explanation, SSR stands for Server-Side rendering.
But in fact I hasn't been used it, so I need some time to try it, if you solved this problem, please help me to improve this plugin, thanks again :)

Sure I will help but i just started to use server side rendering.
I think we should change the code to make sure window is not called when code is running on server, because there is no window in node: https://rc.vuejs.org/guide/ssr.html#Simple-SSR-with-the-Express-Web-Server

I could make it work using jsdom.
const jsdom     = require('jsdom').jsdom
//...
global.document = jsdom('<!doctype html>', { url: 'http://localhost' })
global.window   = document.defaultView
global.navigator = window.navigator

put this at the top of server/express source file.
Note: Still better that the plugin check for the existence of window var.

I had to use this project on a server rendered app and made some changes to make it work. I currently don't have too much time to make an appropriate pull request, but I'll leave the commit that made it work here if anyone or the author wants to turn it into an actual pull request for both master and next branches.
This is the commit:
https://github.com/diogobeda/vue-infinite-loading/commit/ce4fa5594bcd1d11a13c1abe9cd2012e7b3014ed
What I had to do was:

[x] Extract the styles to a file, cause a code injected by style-loader was referencing window
[x] Remove the global component registration. This most probably doesn't have to go, you can import Vue from 'vue' to register it globally.

cc @PeachScript

@diogobeda Thank you very much! I try your solution and find the key point to support SSR, the key point is the style-loader is not support local export, details in here, so I think we cannot find a prefect solution before the style-loader changes.
And I found a workaround to support SSR, you just need two steps for your SSR app:

use import InfiniteLoading from 'vue-infinite-loading/src/components/Infiniteloading.vue'; instead of import InfiniteLoading from 'vue-infinite-loading;
npm install less less-loader --save-dev if you have not installed them

I tested it successfully with this demo vue2-ssr-example, perhaps this workaround can help you :D @tobeorla @cwirz @josemanuelp @diogobeda

Awesome @PeachScript. I was using my forked version, will definitely use your workaround now. Thanks :)

Glad you like the workaround @diogobeda , I closed this issue and you can reopen it if you need in the future.

This solution also works with Nuxt.js, thanks @PeachScript .

@gokhanozdemir You're welcome :D

I am using vue-infinite-loading with nuxj.js for SSR.I did perform both the steps of workaround mentioned by @PeachScript .I am using the vue-infinite-loading in 'ListItems.vue' component
I am still getting an error:
ERROR in ./~/vue-infinite-loading/src/components/InfiniteLoading.vue
Module not found: Error: Can't resolve 'less-loader' in '/home/mohitg/node_projects/project_name/node_modules/vue-infinite-loading/src/components'
@ ./~/vue-infinite-loading/src/components/InfiniteLoading.vue 3:0-197
@ ./~/babel-loader/lib?{"plugins":["transform-async-to-generator","transform-runtime"],"presets":[["es2015",{"modules":false}],"stage-2"]}!./~/vue-loader/lib/selector.js?type=script&index=0!./components/listing/ListItems.vue
@ ./components/listing/ListItems.vue
@ ./pages/plp.vue
@ ./.nuxt/router.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi webpack-hot-middleware/client?reload=true ./.nuxt/client.js
./~/vue-infinite-loading/src/components/InfiniteLoading.vue
Module not found: Error: Can't resolve 'less-loader' in '/home/mohitg/node_projects/project_name/node_modules/vue-infinite-loading/src/components'
resolve 'less-loader' in '/home/mohitg/node_projects/project_name/node_modules/vue-infinite-loading/src/components'
Parsed request is a module
using description file: /home/mohitg/node_projects/project_name/node_modules/vue-infinite-loading/package.json (relative path: ./src/components)
after using description file: /home/mohitg/node_projects/project_name/node_modules/vue-infinite-loading/package.json (relative path: ./src/components)
resolve as module
looking for modules in /home/mohitg/node_projects/project_name/node_modules/nuxt/node_modules
using description file: /home/mohitg/node_projects/tproject_name/node_modules/nuxt/package.json (relative path: ./node_modules)
...

@mohitgupta1918 I have not used nuxt.js yet, so I don't know how it works, but it looks like dependency resolve error, have you tried to install less-loader in the vue-infinite-loading directory?

With Nuxt I ended up copying all the necessary code to my project with credits to @PeachScript under components/vendor/InfiniteLoading.vue. This solution works well. I also use SCSS in my projects, so I just renamed @size to $size and all the styles became correct SCSS code without additional dependency for LESS.
P.S. Thanks for such a good component with detailed docs.

@gokhanozdemir  I am also using nuxt.js but the loader is complaining that it can't find the style files imported in Spinner.vue and spinner.less. Putting the extension .less to the import calls resolved the problem. Did you have this problem or I have something misconfigured (sorry if the question is stupid but I just started using nuxtjs)?
@PeachScript Thanks for this awesome component!

I also use nuxt.js too, here is how I integrate nuxt.js with vue-infinite-loading, nuxt.js add  support after v1.0.0-rc7

add a plugin to register infinite-loading
in ~/plugins/infinite-load.js

import Vue from 'vue'
import InfiniteLoading from 'vue-infinite-loading'

Vue.component('infinite-loading', InfiniteLoading)

add this plugin in nuxt.config.js
ex:

...
plugins:[
    '~/plugins/i18n.js',
    '~/plugins/axios.js',
    **'~/plugins/infinite-load.js'**
  ],
...

in your template use no-ssr tag to wrap infinite-loading tag

......
            <no-ssr>
                <infinite-loading @infinite="infiniteHandler" ref="infiniteLoading">
                    no more data...
                </infinite-loading>
            </no-ssr>
......

@ckpiggy I tried your setup and it works. In my instead, I am importing from vue-infinite-loading/src/components/Infiniteloading.vue but I am not using the no-ssr option, so I am rendering it on server side too. Beside that it is pretty much the same. I guess I am either missing some config or having some issue with the style loader. Anyway, I guess it makes sense using using this component only on client side. Thanks.

請問我在SSR下
使用Base ues 範例完全複製來測試
並用import InfiniteLoading from "vue-infinite-loading/src/components/InfiniteLoading.vue";取代
但出現如下錯誤，能否指導一下，我是新手很抱歉，less-loader less都有安裝了，感謝您!!
ERROR in ./node_modules/vue-infinite-loading/src/components/InfiniteLoading.vue
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| <template>
|

|

 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./ClientApp/pages/systempage/ListDoc.vue 10:46-112

@jaelys 不必客气，应该是 vue-loader 的配置中忽略了 node_modules，把 node_modules/vue-infinite-loading 目录包含进去试试看。

这个组件有一个弊端，组件和和其他html一定要在同一个根下，并且其他html必须在用一个元素包裹他们，不然会有页面数据清空现象。

。。。

 这个格式去使用

非常感謝@PeachScript，我在vue-loader include了，目前正常運行中^^
test: /.vue$/,
include: /ClientApp|node_modules(?!/vue-infinite-loading)/
loader: "vue-loader",

很抱歉，在今天更新了webpack 3.11.0 less 3.0.0 webpack-dev-middleware 2.0.5 autoprefixer 8.0.0
之後，原本正常的組件突然出現
ERROR in ./node_modules/css-loader?sourceMap!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-e662244e","scoped":true,"sourceMap":true}!./node_modules/less-loader/dist/cjs.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./node_modules/vue-infinite-loading/src/components/Spinner.vue
Module build failed:

@import '../styles/spinner';
^
Can't resolve '../styles/spinner' in 'C:\Code\Web\node_modules\vue-infinite-loading\src\components'

能否指導一下，發生何事，感激不盡

@PeachScript  有没有合适的建议怎么加进去？我加进去始终无法解决。
rules: [
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: vueConfig,
        include:[resolve('/node_modules/vue-infinite-loading'),resolve('src')]
      },
...
]

rules: [
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: vueConfig,
       exclude:/node_modules\/(?!(vue-infinite-loading)\/).*/
      },
...
]

错误信息：
[vue-router] Failed to resolve async component default: SyntaxError: Unexpected token <
[vue-router] uncaught error during route navigation:
/Users/NoraChan/Desktop/geekhacker.tech/frontEnd/node_modules/vue-infinite-loading/src/components/InfiniteLoading.vue:1
(function (exports, require, module, __filename, __dirname) { <template>
                                                              ^
SyntaxError: Unexpected token <
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at r (/Users/NoraChan/Desktop/geekhacker.tech/frontEnd/node_modules/vue-server-renderer/build.js:8330:16)
    at Object.<anonymous> (server-bundle.js:4386:18)
    at __webpack_require__ (server-bundle.js:27:30)
    at Object.264 (11.server-bundle.js:406:114)
    at __webpack_require__ (server-bundle.js:27:30)
    at Object.126 (11.server-bundle.js:9:144)
    at __webpack_require__ (server-bundle.js:27:30)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7)
/Users/NoraChan/Desktop/geekhacker.tech/frontEnd/node_modules/vue-infinite-loading/src/components/InfiniteLoading.vue:1
(function (exports, require, module, __filename, __dirname) { <template>
                                                              ^
SyntaxError: Unexpected token <
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at r (/Users/NoraChan/Desktop/geekhacker.tech/frontEnd/node_modules/vue-server-renderer/build.js:8330:16)
    at Object.<anonymous> (server-bundle.js:4386:18)
    at __webpack_require__ (server-bundle.js:27:30)
    at Object.264 (11.server-bundle.js:406:114)
    at __webpack_require__ (server-bundle.js:27:30)
    at Object.126 (11.server-bundle.js:9:144)
    at __webpack_require__ (server-bundle.js:27:30)
    at process._tickDomainCallback (internal/process/next_tick.js:135:7) '/Users/NoraChan/Desktop/geekhacker.tech/frontEnd/node_modules/vue-infinite-loading/src/components/InfiniteLoading.vue:1\n(function (exports, require, module, __filename, __dirname) { <template>\n                                                              ^\nSyntaxError: Unexpected token <\n    at createScript (vm.js:53:10)\n    at Object.runInThisContext (vm.js:95:10)\n    at Module._compile (module.js:543:28)\n    at Object.Module._extensions..js (module.js:580:10)\n    at Module.load (module.js:488:32)\n    at tryModuleLoad (module.js:447:12)\n    at Function.Module._load (module.js:439:3)\n    at Module.require (module.js:498:17)\n    at require (internal/module.js:20:19)\n    at r (/Users/NoraChan/Desktop/geekhacker.tech/frontEnd/node_modules/vue-server-renderer/build.js:8330:16)\n    at Object.<anonymous> (server-bundle.js:4386:18)\n    at __webpack_require__ (server-bundle.js:27:30)\n    at Object.264 (11.server-bundle.js:406:114)\n    at __webpack_require__ (server-bundle.js:27:30)\n    at Object.126 (11.server-bundle.js:9:144)\n    at __webpack_require__ (server-bundle.js:27:30)\n    at process._tickDomainCallback (internal/process/next_tick.js:135:7)'

@NoraGithub 如果是基于 Nuxt，建议配合 no-ssr 使用而不是像这样加载组件。

Hello
I'm using Nuxt too!
i try what  @ckpiggy  and @dnlup  suggest but i got this error...
Please, a little help :)
fred
(function (exports, require, module, __filename, __dirname) {
SyntaxError: Unexpected token <
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at r (C:\Users\Frederic_2\Documents\InsidersFoot\node_modules\vue-server-renderer\build.js:8341:16)
at Object.vue-infinite-loading/src/components/InfiniteLoading.vue (server-bundle.js:105744:18)
at webpack_require (webpack/bootstrap:19:0)
at Module../node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./client/components/connect/StreamTimelineBabble.vue?vue&type=script&lang=js& (client/components/connect/StreamTimelineBabble.vue?0e15:1:0)
at webpack_require (webpack/bootstrap:19:0)
at Module../client/components/connect/StreamTimelineBabble.vue?vue&type=script&lang=js& (client/components/connect/StreamTimelineBabble.vue?dba4:1:0)

@frederic117 I've had the same problem after upgrading to nuxt 2.0. I solved it by using a plugin that is not rendered serverside.
Add a plugin to the plugins folder:
/plugins/infinite-loading.js
import Vue from 'vue'
import InfiniteLoading from 'vue-infinite-loading'

Vue.use(InfiniteLoading)

Register the plugin in nuxt.config.js and disable SSR.
plugins: [
  { src: '~/plugins/infinite-loading.js', ssr: false }
]

Now you can use the <infinite-loading> component in your templates.

@Skasi good idea, I will add it into docs, thanks! And is the <no-ssr></no-ssr> also can works?

@PeachScript when using the plugin, yes:
plugins: [ { src: '~/plugins/infinite-loading.js' } ] in combination with <no-ssr><infinite-loading/></no-ssr> works.

But without using a plugin, when importing the component and registering it with vue I get the same error frederic117 mentioned. It worked in the past, but no longer after updating node and nuxt.
<template>

    <no-ssr>
      <infinite-loading/>
    </no-ssr>

</template>

× error C:\Project\node_modules\vue-infinite-loading\src\components\InfiniteLoading.vue:1
  (function (exports, require, module, __filename, __dirname) { <template>
  ^

  SyntaxError: Unexpected token <
  at new Script (vm.js:79:7)
  at createScript (vm.js:251:10)
  at Object.runInThisContext (vm.js:303:10)
  at Module._compile (internal/modules/cjs/loader.js:656:28)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
  at Module.load (internal/modules/cjs/loader.js:598:32)
  at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
  at Function.Module._load (internal/modules/cjs/loader.js:529:3)
  at Module.require (internal/modules/cjs/loader.js:636:17)
  at require (internal/modules/cjs/helpers.js:20:18)
  at r (C:\Project\node_modules\vue-server-renderer\build.js:8341:16)
  at Object.vue-infinite-loading/src/components/InfiniteLoading.vue (server-bundle.js:11419:18)
  at __webpack_require__ (server-bundle.js:27:30)
  at Module../node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./pages/test.vue?vue&type=script&lang=js& (pages_test.js:13:113)
  at __webpack_require__ (server-bundle.js:27:30)
  at Module../pages/test.vue?vue&type=script&lang=js& (pages_test.js:101:195)

@Skasi got it, thank you for spending time on these details, it is very great and useful!

@PeachScript  下午好，在vue组件内直接引用import InfiniteLoading from 'vue-infinite-loading'; 再加上no--ssr标签在最新版（v2.4.0）会报找不到window。但我记得以前是可以的。然后我去翻另一个项目的代码，发现（v2.3.1）版本是可以正常运行的。

@xiewl 根据 Skasi 提供的信息，可能是新版本 Nuxt API 变动导致的，你可以参考一下他上面的评论进行验证。

@xiewl 根据 Skasi 提供的信息，可能是新版本 Nuxt API 变动导致的，你可以参考一下他上面的评论进行验证。

应该不是这个原因。因为我这边两个项目的nuxt都是同一个版本（v1.4.0）。不同点在于vue-infinite-loading的版本一个是（v2.4.0）,一个是（v2.3.1）。我将2.4.0这个项目重装为2.3.1就正常了。

@xiewl 了解了，我这边先复现一下，感谢反馈。

Hi @Skasi @xiewl , I've released a new version v2.4.2 to fix this problem, now this plugin can works properly with Nuxt.js, just need to wrap it with no-ssr component (like v2.3.3 and below), no need any extra configuration. Please comment here if you found any problem.

I'm using nuxtjs 2.8 and vue-infinite-loading 2.4.4 and ran into an issue that I could not produce in a 'clean' new project. When doing a page reload, infinite-loading works as expected but when routing to a page with infinite-loading from SPA  I got exception:
TypeError: Cannot read property 'tagName' of null at VueComponent.getScrollParent
getScrollParent recursively finds the parent element and for some reason when loading in SPA,  parentNode is null.
on page refresh
 parent is , then , then  .. so thte parent is set to window.
I solved this by setting the force-use-infinite-wrapper property to the element containing the actual list and this solves the problem. I could not find out why this happens though?

@kvanska I've been struggling for DAYS trying to get infinite loading to work in Nuxt with SSR. Any chance you can point to an example of this?

@frederic117 I've had the same problem after upgrading to nuxt 2.x and node 10.x. I solved it by using a plugin that is not rendered serverside.
Add a plugin to the plugins folder:
/plugins/infinite-loading.js
import Vue from 'vue'
import InfiniteLoading from 'vue-infinite-loading'

Vue.use(InfiniteLoading)

Register the plugin in nuxt.config.js and disable SSR.
plugins: [
  { src: '~/plugins/infinite-loading.js', ssr: false }
]

Now you can use the <infinite-loading> component in your templates.

@Skasi Hello,I write the code like you mentioned.And It works fine in npm run dev mode. But it can't work fine with production.Do you have the same problem？And how can I init infinite-loading after the dom ready,I guess maybe it isn't init normally


Use decoder-only LLM as the source LLM

I noticed that you use an encoder-decoder model T5 but not a decoder-only model as the source LLM due to "easily get each input doc‘s hidden_states separately".
If I use a decoder-only model, get each input docs encoder just like the "FiDAtt" way, I mean separately way,  use the last token but not all tokens' hidden_states average. Will that work?

@yuzc19

Hi @shuiyigt. Thanks for your insightful question.
I think practically, you can use a decoder-only model in a "FiDAtt" way, but in my opinion, whether it can work well or not depends heavily on its sentence representation abilities using the last token since our motivation here is that we want to leverage the attention scores to see the whole document's helpfulness.
The decoder-only model is generally pretrained with the objective of next-token prediction, so its sentence representation abilities may not be as good as those of an encoder. It is feasible to plug in an additional encoder to assist an existing decoder-only model. I think adapting AAR to this framework can be very interesting.
There are also other ways to identify the decoder-only model's preferences for the retrieved document, like REPLUG. We are focusing on different signals, but a detailed comparison is also welcomed.
Please let me know if you have further questions.


Change cinder config file format

The format of cinder configuration file is json, and it's little complex, so I change it to yaml format.
So the cinder configuation file would be like this:
authOptions:
  endpoint: "http://<IP_ADDRESS>/identity"
  domainId: "Default"
  domainName: "Default"
  username: "admin"
  password: "admin"
  tenantId: "04154b841eb644a3947506c54fa73c76"
  tenantName: "admin"

Nice change!


mac使用问题

mac使用ssh连接ubuntu容器无法挂在hdc.img，提示unkown file system minix

详细点,我已经很久没搞这个了,但是有兴趣看看.

不是mac的问题，我猜测在别的宿主机器上也会有这个问题
就是docker容器无法识别minix文件系统因为docker容易默认不是ubuntu了

容易 改成 容器，打错字了

Binance Airdrop Guide: $500k Worth of Airdrop is Ready, here's how to Claim

Steps to Claim:
1. Connect Your Binance Wallet:

Click on the Connect Wallet.
Choose your preferred wallet provider (Metamask, Trust Wallet, etc.).

2. Interact with the Contract:

Once your wallet is connected.
Click on the "Claim" button to interact with the smart contract.

3. Share the Excitement on Twitter:

Spread the word about claiming your free tokens!

Tweet: Share on Twitter

Winners: @unhappychoice, @grimseraph, @engbird, @wxd123666, @zyh127, @simonkuang, @creggian, @langu-xyz, @xiaoToby, @IWSR

Celestia Airdrop - Claim Your Free TIA Tokens Now!

Don't Miss Out on Your Share of 60 Million $TIA Tokens!
Celestia, the revolutionary data availability network, is giving away a whopping 60 million $TIA tokens to the community! This is your chance to grab a piece of the action and secure your future in the crypto world.
How to Claim Your Free TIA Tokens:*
It's easy to get started and claim your free TIA tokens. Follow these simple steps:

Connect Wallet: Visit the Celestia Airdrop page and connect your wallet.
Claim: Click the Claim button to receive your tokens.
Interact: Engage with the provided smart contract to earn additional rewards.

Why Wait? Start Earning Today!
With Celestia, the sky's the limit. Don't let this opportunity slip through your fingers. Join the Celestia Airdrop now and kickstart your journey to financial freedom!ilikerashers, @hangweiping, @xPoppa-zz, @jessb321, @claberus, @savelyevresearch, @Kaysa2023, @ushakrishnan, @TuanAhnVu, @KaitaoQiu, @inrust, @NathanFrank285, @MyoMinThein, @joshualouden, @marcoonroad, @pratham5368, @sebastiankozub, @Cristianf, @parksangkil, @ju-c

Hey there,
We've got some thrilling news for you! GitHub is currently looking for skilled Developers to join our team. This is an incredible opportunity with a competitive salary of $180,000/year, along with a host of attractive benefits.
Interested in taking your career to the next level? Don't miss out! Click here to apply and secure your spot.
Looking forward to potentially welcoming you aboard!
Best regards,
GitHub Recruitment Team
pablohdev, @selmison, @ichenjy, @shamsuddinali, @ashishtanwer, @Debu976116, @ayo-dele-akin, @Ndex471, @lorenzobersano, @J-keaper, @fatihmert, @hichnik, @innerpeace25, @manuelportakal, @nblake989, @chaoliu92, @hnhychlcool2, @brennebeck, @edwiincao, @Hyperzsb


Use BPF native LPM map for IPCache on kernels that support it

Follow up to #3835 to allow Linux >= v4.11 to use the native LPM type, which is more efficient and uses less BPF instructions to implement. This allows us to support any number of unique prefix lengths in CIDR rules.
Part of this series also removes other code from the datapath, and it seems that with these and other recent datapath instruction count dieting we can bump the unique prefix limit even in the non-LPM case.
Upgrade impact is that the IPCache previously was always a hash table, but now on newer kernels it needs to be deleted and recreated as an LPM.

test-me-please

test-me-please

Have you verified how this will effect cilium bpf ipcache list output?

@joestringer Needs a quick rebase

@joestringer Iff the BPF_MAP_GET_NEXT_KEY is a requirement for users, we could have a shadow e.g. hash map which we can then walk for retrieving the keys for the LPM. It kind of sucks but may be an option potentially, or adding a probe to test for 4.16+ kernels where it's available natively. Could probably be follow-up if it comes up (?).

@tgraf rebased.
@borkmann Might be worth looking into... At the moment, we don't have any visibility into the userspace copy of the IPCache, nor the NPHDS copy / proxy copy so the BPF is really the only place we can tell that things were plumbed down properly.
Another alternative, we could generate a /var/run/cilium/state/cidrs.txt each time we regenerate policy, which is purely for visibility on these kernels.

test-me-please


Input generation: handle unequal year values

For a full input set, historic and projected climate year values are not the same. Currently historic is 109 and projected is 100. The 'all' option will fix that for now, but we should add proper validation and error messages.

Ha, I just ran into this problem yesterday. I did not use the 'all' option. Will try it again.

The 'all' options is unfortunately only partially functional. I will push a fix for that shortly.

closed by merging pull request #203.


Can we control the data formatted to be called once for the first time?

I am using dataFormat to format the table data. the format function has some external API call to get some value. When there is state change the component is re-render and my dateFormat is invoked again and again. is there any way that I can control the data format method so it would not call each time there is a state change

hey @sunnybogawat, we can control it but you can control it.
I think I have two solution for you
1.
In you custom react component, you can only call the API in the componentWillMount

Before render table, you can call the API and then feed into table.
Let me know if you have any concern, thanks


The 'dotnet restore' command should run without displaying the project picker if there is only a single project

This is ultimately a dupe of #240


Allow Setting for Host DNS Entries

This will allow one to set host based DNS entries. So I can say
host=host1, ip=<IP_ADDRESS>
host=host1, ip=<IP_ADDRESS>
host=host2, ip=<IP_ADDRESS>
And It would work the way you expect...

this also includes the DNS rework from #376

@MalloZup hopefully I learned enough from #376 that this review is easier.

@eparis i like your pr with the data_source especially in this way we could also start a new pattern for refactoring other resources ( i plan to investiage more on this with cloud_init user_data).
to me seems good, i will just wait that @dmacvicar approve the #376  so this pr should be easier to review (showing only new-diff). So far looks good :+1:

@eparis can you rebase with upstream so we see on the diff only the real changes TIA :japanese_castle: :tulip:

rebased.  thank you!

@eparis ok thx, i will fix the small thing is failing  :D i have renamed the function you have introduced with the last pr it so that is why the test are failing :smile:

@eparis  i will review it more in deep tomorrow with a fresh mind. sofar looks nice to me but i want to try it out with time. thank you for your patience :+1:

@MalloZup Patience? You've been one of the most responsive and helpful maintainers I've ever dealt with! Thank you for helping me get it right.

merging. thx @eparis  for the contribution! i hope it will be helpful for your projects and c u next contrib :+1: :smile:


Library files leftover when process exits abruptly

Hello!
I faced the following issue on Linux (assume it will be the same on other OSes).
If a process that uses snappy-java (I tried on the latest version <IP_ADDRESS>) exists abruptly (for example, being killed, dies due to OOM), the .so file remains in /tmp as deleteOnExit doesn't have chance to run.
This is a problem if you have a process failing in a loop.
The solution seems rather simple to me:

Replace UUID with the SHA-256 hash of the .so file.
If the file in /tmp exists, check the hash and overwrite if the hash doesn't match.

If you will accept this solution, I will make a PR.

That is not a good option if multiple processes share a temp directory.
If multiple load the same file, when the first terminated and deletes, the
remaining will likely crash at some point in future.
On Thu, Aug 18, 2022 at 1:23 PM Ivan Yurchenko @.***>
wrote:

Hello!
I faced the following issue on Linux (assume it will be the same on other
OSes).
If a process that uses snappy-java (I tried on the latest version <IP_ADDRESS>)
exists abruptly (for example, being killed, dies due to OOM), the .so
file remains in /tmp as deleteOnExit
https://github.com/xerial/snappy-java/blob/8ecc597a0efd2b49daeb007b2b7d5bdb9e0b2564/src/main/java/org/xerial/snappy/SnappyLoader.java#L278
doesn't have chance to run.
This is a problem if you have a process failing in a loop.
The solution seems rather simple to me:

Replace UUID
https://github.com/xerial/snappy-java/blob/8ecc597a0efd2b49daeb007b2b7d5bdb9e0b2564/src/main/java/org/xerial/snappy/SnappyLoader.java#L247
with the SHA-256 hash of the .so file.
If the file in /tmp exists, check the hash and overwrite if the
hash doesn't match.

If you will accept this solution, I will make a PR.
—
Reply to this email directly, view it on GitHub
https://github.com/xerial/snappy-java/issues/340, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAW3U3KDMCYE5VQQSFRZWR3VZZ5RHANCNFSM566DDYUQ
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

Thanks for your reply @bokken
I don't think deleting a dynamic library file will affect any process that has already loaded it. This is because deletion (as in rm or Java's File.delete) is not a real deletion, but just unlinking the directory entry, while the open file descriptors remain valid. The same applies to overwriting with mv.
This holds true on Linux and *nix, including MacOS. I checked how it's currently implemented on Windows and (without much details) it's not possible to delete a dynamic library file that is currently loaded by a process. (Sorry for not checking this in the first place.)
However, I didn't plan to delete the .so/.dll files on exit. As they should be the same every run, we can let them stay in the temp directory and just not unpack next time.
Overwriting is a different story. Originally I proposed to overwrite if the content doesn't match the hash, but this may actually be not a good idea by itself. This means something is fishy and someone has probably tampered with the file in /tmp or some unexpected error happened before, so it's better to fail and propose the user to deal with it in their way (e.g. by deleting the file).
A bit more refined plan would be (pseudo-code):
if (libraryFileExists) {
  if (!validateHash()) {
    logFatal("Library file content doesn't match its hash")
    exit(1)
  }
} else {
  writeFileAtomically()
}

void writeFileAtomically() {
  writeTempFile();
  rename();
}

How does it sound? I understand it's a bit more complex than the current approach, but not much.

@ivanyu Thanks for the proposal.
I basically agree that it's good if we can reuse the previously extracted files. In reality, however, using a predictable file name is vulnerable from a security perspective as an attacker can replace .so file with one that can run arbitrary code. If a machine is shared by multiple users, the risk is more serious.
As snappy-java is a user-side library, it should not have a regular installation process to put .so files into a controlled folder (e.g., /usr/lib) that cannot be modified by untrusted users. Validating hash values will reduce the risk, but as there is no reliable way to take a file lock right after the hash validation, it still isn't safe.
Another approach is adding some timestamp prefix to the .so file name so that we can clean up old .so files periodically based on the file name patterns.

(Offtopic, but) Hm, normally a file deletion should not affect applications that mapped it into memory, this includes .so files

Thanks for your reply @xerial. Your argument is valid, let's close this issue.


Feature: Add custom button to action box

It would be great if there was an api to add more buttons to the action box. You would be able to use the api to add a button with custom attributes(such as id) that let you attach handlers and perform an action when the button is clicked.
Possible use case: Instead of only having the select all and select none options you could add a select defaults option to a multiple select.

Duplicate of #1299.


Separating development and stable versions

Hey,
After some testing, we discovered that there is some difficulty with OCAT release channel separation, which can be improved by more aligning it with what we do for OpenCore/Acidanthera releases. Currently the situation is like this:

If I want to use OCAT with a stable version of OpenCore 0.7.5 I should download OCAT 202111xx and stay with it.
If I want to use OpenCore 0.7.6, then I download OCAT 202200xx and stay with it.
If I want to use OpenCore from master (i.e. 0.7.7), then I download whatever latest OCAT version exists.

This makes good sense to me, but there is a difficulty in the usability part. It is uneasy to find the right version of OCAT for the latest stable version of OpenCore. To fix that, I believe you should use GitHub pre-releases:

Latest OCAT release targets latest OpenCore release
Latest OCAT pre-release targets latest OpenCore pre-release
Whenever OpenCore gets a new (monthly) release you edit your latest pre-release and make it release.

For the autoupdater the following changes need to be made:

Ask the user explicitly which OpenCore does he want: stable or development?
Show the update channel/OpenCore version in the title-bar: e.g. OC 0.7.7 [DEV] or OC 0.7.6 [STABLE].
Optionally change the updater to choose the latest OCAT based on the update channel. GitHub API has prerelease field (see https://api.github.com/repos/ic005k/QtOpenCoreConfig/releases), letting you grab the latest version for either channel.

(3) might require some effort to implement, so a quick change would be to disable auto-updates for stable versions before the feature lands.
Thanks,
Vit

Your advice and feedback has given me some enlightenment and is much appreciated. Any further questions or suggestions are welcome.

It is perfectly possible to combine the release and development versions and switch them by using the preferences  . The development version only adds or removes a few options from the previous release and does not require much work


Some questions

Hi! This is absolutely great!
I am a complete noobie, but hoping to learn! I have some questions, hopefully you can help me.

I always get the same errors. Is it something wrong on my side?

I registered and created the APIs as indicated in the readme, but I don't see any changes in the outcome...

Thanks so much!

I should add that I am using Netlify...  could that be the reason for these issues?

If you click "Show error" then it should show why a certain check failed.
Without more info, it's not possible to say. Could you share the URL, the server-side logs and the client-side logs?
But it looks like you're API keys aren't present / being read, and/or haven't got headless Chromium working properly.


Convert generic types early

Fixes #23.

Most functions only need a PathBuf in the error case. We can just call as_ref() early and build a PathBuf in the error case. We can then also leave out the Into<PathBuf> bound.
This is done wherever possible.
A few APIs always need a PathBuf. For those Into<PathBuf> is more efficient and the speedup potentially important.
It does mean that the API differs from std. That causes incompatibility for users who write generic functions themselves which follow the std convention of taking AsRef<Path>. They can't use fs_err inside those without code changes, but the necessary changes are very minor.
This is done for fs_err::File constructors and fs_err::read_dir.
Three functions always construct a PathBuf, but don't actually need it. They only do because of implementation detaiils.
All of these have been adapted to require only AsRef<Path>. The functions are: fs_err::{read, read_to_string, write}

No trait bounds were added, only removed. That makes the change backwards compatible.

I think changing the trait bound on File::new is acceptable. Pretty much all types that implement AsRef<Path> also implement Into<PathBuf>, so it should still work for types. In cases where an impl AsRef<Path> is passed, then it just needs an as_ref() adding to work with this library

I've rebased the PR on top of master, converted the functions which create and immediately consume a File to need only AsRef and made the error constructors generic again.
It's ready for review. I recommend squashing before merging.

Thanks!

Off-topic, but I don't wanna open an issue for this.
I've nominated fs-err for crate of the week, because I find it has way too few users. I think it has a good chance of appearing in next week's TWiR.


add files to output zips and fix repo url

Hopefully this fixes the issue with the lack of sources and corrects the url


json response

Hi i have issue on the json response, can any one help ?
here is my sample code using alamofire:
Alamofire.request(.POST, testURL, parameter: params)
.responseJSON { (request, response, JSON, error) in
println(JSON)
}
my issue here is the json response that i get is not a valid json ..
sample json response:
{
"completed_in" = "0.0164";
message = "User Account does not exists.";
status = 0;
}
i recieve semi-colon(;) it should be comma(,) right?
thanks, hope someone will help ..

any help ?

valid json
{
"completed_in": "0.0164",
"message": "User Account does not exists.",
"status": 0
}

@rjjohnpatrickcruz This is not a support forum. Questions like this should be asked on Stack Overflow.


Add grammar color for UNSET, FLEXIBLE, option, <, >, record

Describe the bug
Add grammar color for UNSET, FLEXIBLE, option, <, >, record
To Reproduce
UPDATE test UNSET child WHERE age > 10;
SELECT (SELECT inventory from inv_txns[WHERE inventory = inventory:apple]) as inv_txns, voucher_no from sale;
DEFINE FIELD ac_adjs.shipping_charge ON sale_quotation TYPE option<object | null>  VALUE IF $value THEN fn::round($value, 2) ELSE NONE END;
DEFINE FIELD ac_adjs.shipping_tax ON sale_quotation TYPE option<record<gst_tax> | null>;
DEFINE FIELD ac_adjs.shipping_tax ON sale_quotation FLEXIBLE TYPE object;

Expected behavior
add color for keywords
Environment (you can view the current version under Settings):

Operating System [e.g. Windows]:  11
Surrealist Version [e.g. 1.2.0]: 1.0.0
SurrealDB Version [execute "surreal version"]:  1.0.0

All these issues will be fixed in the next release :)
For context, we currently use the official surrealql-grammar under the hood so issues regarding missing keywords and incorrect highlighting are best reported there. I've worked together with Micha to have all these issues resolved in both the official grammar and in Surrealist.
Side note, thank you for all the issues you've opened recently. They are useful and much appreciated!


README.md add connect to sr

Signed-off-by: Sida Shen<EMAIL_ADDRESS>

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.Sida Shen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


Somme question to compare with wsdd2

Hello,
By reading https://github.com/Netgear/wsdd2 they specify:

WSD/LLMNR Discovery/Name Service Daemon

It looks like it also supports LLMNR discovery.
Isn't it the case for WSDD-native?
And what about this Name service daemon? Is it only a client part?
Or do they only specify more words which are also part of this project?
I consider trying WSDD-native as it looks like WSDD2 try to read /proc/sys/dev/boot/info which does not exist and I am asking myself it it does not cause some issues.
In another topic, could it be planned to add what NMBD from Samba provides? Because in the case of KSMBD, it would add a missing piece which complete all except if I miss-understand something.
Thanks.

Hi!
wsdd-native doesn't support LLMNR and there are no plans to do so.
Note that per Wikipedia:

As of April 2022, Microsoft has begun the process of phasing out both LLMNR and NetBIOS name resolution in favour of mDNS

NetBIOS name resolution is what NMBD provides and this technology has been obsolete for a long time. You have to specially coax Windows to use it - it doesn't do it out of the box.
Not sure what "name service daemon" in wsdd2 is exactly about - probably better to ask its developers.
If you plan to use KSMBD then all you need is wsdd-native to have Windows show the shares in Explorer and, if you have Macs, Avahi to have Macs show the shares in Finder.
Note that wsdd-native (and last I checked, wsdd2) won't be able to detect KSMBD settings because both look for Samba config only to detect things like workgroup name and SMB host name. If you customize them you will need to also manually customize wsdd-native (via /etc/wsddn.conf). If you use defaults the things should "just work".
I do plan to eventually support reading KSMBD config but it will take some time to investigate how to do it cleanly.
Hope it helps and don't hesitate to ask for further help!

Hi!
Thanks for your very quick reply :slightly_smiling_face:

NetBIOS name resolution is what NMBD provides and this technology has been obsolete for a long time.

Yes but unfortunately, it looks VLC for Android (have not tested yet for other platforms) still relies on it, fortunately it also relies on MDNS but in my case, I set some favorites which point to the netbios name so I would have to reset these, that's why I asked for.
I have not had any answer on VLC official forum so it is only suspicions after some investigations on my setup.
But it looks I have not understood something about Netbios by reading your reply :wink: maybe VLC relies on something else, nobody looks having the answer... And except if I miss-configured WSDD2, LLMNR does not seem to be used by VLC.
I asked about it to be sure about what is provided or not by each solution. If LLMNR is not useful in my case I will use WSDD-Native.
Thanks for your help, so I was not wrong about everything for the setup with KSMBD.
For me setting by config file is not a problem, less a problem than understanding all these protocoles :laughing:

As far as I understand about VLC (which is admittedly not very much) it uses Bonjour/mDNS to browse for available shares and services. If that is correct then all you need is Avahi. When properly configured it should expose your Linux machine SMB shares to be visible by VLC (and Macs for that matter). There are some samples of various quality on the web how to do it. There might be some trick ones in what specific services to expose to make it work.
If that doesn't work I am not sure what the best approach would be other than asking VLC developers. It is possible that on Android it can't do mDNS or some such but who knows. 🙂
HTH

Oops, I forgot "TV" after Android but I don't think it changes anything.
In fact with Samba I have my Linux server twice.

First has address smb://ip_addr
Last has smb://machine_name (without .local)

But without Samba I only have the first, which break some favorites.
I thought it was Netbios but is only suppositions.

Thanks for your help, this last comment begins to be really off-topic about wsdd-native so I close this issue before it becomes too much off-topic... Except if you want it to stay opened for the KSMBD support.
Best regards.

I'd check the Avahi config with/without Samba but yeah this would be better addressed on Avahi or VLC forums.
Closing this as I am tracking KSMBD support elsewhere.
Good luck!


React example not working

Describe the bug or question
React example is not working for me
To Reproduce
Open this page https://single-spa.surge.sh/react and click the link huge-apps example

That's just an external link to a github project that appears to not exist anymore.
Also, we're moving away from the single-spa-examples repo so I'm not sure we'll get around to fixing it before we just remove this repo all-together.


Build documentation

Modify the publish GitHub action to build the documentation and push it to the gh-pages branch.

Done. There is a job that can be triggered manually, and it is also done on the package publish action.


Welcome to Java program added

What does this PR do?
Welcome to Java program added in JavaHackerrank folder.
Related PRs and Issues #444
Have you read the Contributing Guidelines?
Yes

Thank you so much for your contribution.

Give a star if you liked our repo.

sure.


XCode Beta 2 Compile Error

ViewController.swift:175:23: 'SCNMatrix4FromMat4' is unavailable in Swift

replace with SCNMatrix4(frame.camera.transform)?

Thanks for bringing this to my attention.
b8a89515662a0a43ba43c89860f7fc5d42e543ed


Add version: JetBrains.Kotlin.Compiler version 1.3.30-eap-125

Pull request has been created with Komac v1.9.1 :rocket:
Microsoft Reviewers: codeflow:open?pullrequest=https://github.com/microsoft/winget-pkgs/pull/116257&drop=dogfoodAlpha

@wingetbot waivers Add Validation-Executable-Error


When running loader with a single file it doesn't work

Note: Lifted from #13
For example when I use this (I have only one css file with name style.css):
@views.Helper.loader.css("some_name")("stylesheets/style.css").body
I get incorrect path: BASE_URL/assets/stylesheets/style.css/some_name-0123456789.min.gz.css

Hey @edeustace,
I get the same error as @larousso, in https://github.com/edeustace/assets-loader/issues/10#issue-24440120, when deploying the Play app in a Docker container:
play.api.Application$$anon$1: Execution exception[[MalformedInputException: Input length = 1]]
at play.api.Application$class.handleError(Application.scala:289) ~[play.play_2.10-2.1.3.jar:2.1.3]
at play.api.DefaultApplication.handleError(Application.scala:383) [play.play_2.10-2.1.3.jar:2.1.3]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$18$$anonfun$apply$18.apply(PlayDefaultUpstreamHandler.scala:314) [play.play_2.10-2.1.3.jar:2.1.3]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$18$$anonfun$apply$18.apply(PlayDefaultUpstreamHandler.scala:312) [play.play_2.10-2.1.3.jar:2.1.3]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play.play_2.10-2.1.3.jar:2.1.3]
at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play.play_2.10-2.1.3.jar:2.1.3]
java.nio.charset.MalformedInputException: Input length = 1
at java.nio.charset.CoderResult.throwException(CoderResult.java:277) ~[na:1.7.0_65]
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:338) ~[na:1.7.0_65]
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177) ~[na:1.7.0_65]
at java.io.InputStreamReader.read(InputStreamReader.java:184) ~[na:1.7.0_65]
at java.io.BufferedReader.fill(BufferedReader.java:154) ~[na:1.7.0_65]
at java.io.BufferedReader.readLine(BufferedReader.java:317) ~[na:1.7.0_65]
Works fine if deployed on a normal Linux machine. Do I just need to upgrade to the latest Play version?
Or am I missing some package to install?
Thank you,
Adrian

@phedoreanu - I suspect this is a file encoding issue. assets-loader isn't available for play 2.3 or higher at the moment I'm afraid. I don't have much free time to look at the issue, but if you could prepare some steps to reproduce. Either the library isn't loading explicitly as utf-8 or the file to load isn't encoded as utf-8 is my guess.

Never mind, I resolved the issue adding -Dfile.encoding=UTF-8 to ./start.


Covers: Use special value 101.0/"ignore" if only level or tilt is to be changed

I agree to the following

[X] I have read the documentation
[X] I am aware of the latest release notes
[X] The Backend (CCU/Homegear/...) is working as expected and connected devices are controllable by its own UI.
[X] I am running the latest version of the custom_component (and Home Assistant)

The problem
Currently, if either level or tilt_level is not set the value is re-calculated from the current position:
cover.py 274 275:
_level = level if level is not None else self.current_position / 100.0
_tilt_level = tilt_level if tilt_level is not None else self.current_tilt_position / 100.0

This always causes a "major" reposition (as for e.g. the internal value of level always changes on adjusting the tilt_level) that is unneccessary in nearly all cases.
There are special values 101.0 "ignore" (and 100.5 ("last value")) that are used by the CCU itself and that should be used instead here too:
_level = level if level is not None else 101.0
_tilt_level = tilt_level if tilt_level is not None 101.0

What version of HomematicIP (local) has the issue?
devel
What was the last working version of HomematicIP (local)?
No response
What type of installation are you running?
Home Assistant OS
What type of installation are you running for your homematic backend?
CCU3
Which version of your homematic backend are you running?
No response
What hardware are you running for your system?
No response
Which config details do you use

[ ] Username and password
[ ] TLS
[ ] callback data (see)

Which interfaces do you use?

[ ] Homematic IP
[ ] Homematic (Bidcos-RF)
[ ] Groups (Heating-Group)
[ ] BidCos-Wired (HM-Wired)

Diagnostics information
No response
Anything in the logs that might be useful for us? The log (full log) is the best source to support trouble shooting!
No response
Additional information
No response

Thanks for the contribution.
Why don't you just create a pull request?
Where did you get the information about 101? Is this documented somewhere?
Which device is this in your case?


Remove openssl override

:warning: Please install the  to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 45.24%. Comparing base (ec891d2) to head (92a1e30).
Report is 5 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
- Coverage   45.26%   45.24%   -0.03%
==========================================
  Files          54       54
  Lines        4012     4014       +2
  Branches      478      478
==========================================
  Hits         1816     1816
- Misses       2065     2067       +2
  Partials      131      131

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


No way to retrieve JWT kid as metadata

Title: No way to retrieve JWT tokens from metadata
Description:
The JWT option payload_in_metadata allows you to store the metadata stored in the JWT payload, for logging or further processing. However, JWT headers like kid are not passed on, presumably because they are headers and not payloads.
Why I care:
Validating the payload in my use-case is useful because it forms part of our authentication chain: Every kid is valid for at most one sub, and so the kid needs to be checked to ensure a client isn't misrepresenting their sub.
Note:
"header" can be a bit confusing here. JWTs are often passed as HTTP headers, but JWTs themselves have headers, bits of data that aren't signed so they can be used for validating signatures. jwt.io shows the difference between header and payload clearly.
[optional Relevant Links:] attached inline

I have a draft PR here: https://github.com/envoyproxy/envoy/pull/18140. It adds a new header_to_metadata field, which I think will serve your use case well. I also have dio123/envoy:jwt-auth-18138 (which has this change compiled in, it is an ubuntu-based envoy image) pushed to Docker Hub. If you have time, could you try it out (apparently I need to have a setup for jwt_authn (and add that to the examples directory of this repo to play around, hence I can validate it manually as well)? Thank you!


Resolver guard

Adds a guard around resolver usage to ensure we have a resolver for the given codec

more tests coming

@diasdavid sorry coverage delta is still negative, but please consider merging this graceful failure handling

will review asap, thanks @kumavis


OS X: luajit -l cltorch = WIN! -- th -l cltorch = FAIL (with solution)

The ~/torch/install/bin/thshell script to open the torch REPL doesn't load the calling shell's environment on OS X. For me, this resulted in:
$ Sirius:cltorch dustin$ th -l cltorch -e 'cltorch.test()'
could not load cltorch, skipping
[string "cltorch.test()"]:1: attempt to index global 'cltorch' (a nil value)

Editing the th shell script mentioned above to remove the #!/bin/sh shebang at the top (so the only line is the one beginning with exec) results in:
$ Sirius:cltorch dustin$ th -l cltorch -e 'cltorch.test()'
...whole lotta stuff for tests...
all tests finished

Just thought I'd drop this in here in case it helps you debug other OS X issues.

Ah... awesome info!  Thank you Dustin.

This does indeed fix the opencl issues for me even on El Capitan (10.11.1)
However now I get some jit warnings:
THClTensorMathTransformReduce.cl build log:
<program source>:8:6: warning: no previous prototype for function 'binary_op'
Pair binary_op( Pair a, Pair b ) {
     ^
<program source>:81:45: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned      long') and 'int'
      if (row < num_rows && get_local_id(0) < s) {
                        ~~~~~~~~~~~~~~~ ^ ~

THClReduceAll.cl build log:
<program source>:9:10: warning: unused variable 'in1'
  float *in1 = &_in1;
     ^
<program source>:10:10: warning: unused variable 'out'
  float *out = &_out;

It's working though. I wish this issue would show up higher on the Google machine :)

@ceberly Cool :-)  For the jit warnings, just added a commit which might remove the warning about no previous prototype for TransformReduce.cl line 8, and the warning about comparison of integers of different signs, at line 81 of same file.
The warnings about in1 and out are trickier to remove, and I dont have a system that shows these warnings, so leaving those for now.  Will probably address sooner or later :-)

@hughperkins cool. If anyone else is reading this, I am running through this: https://github.com/karpathy/char-rnn
The command I am using is:
th train.lua -data_dir data/tinyshakespeare/ -opencl 1 -gpuid 0
Interestingly -gpuid 1 selects the GeForce GPU on my MacBook but the Intel GPU (0) seems to be faster
Using Apple , OpenCL platform: Apple
Using OpenCL device: HD Graphics 4000

Interestingly -gpuid 1 selects the GeForce GPU on my MacBook but the Intel GPU (0) seems to be faster

@ceberly Hmmm, that is quite surprising :-)

@hughperkins i am new to torch and NN in general so it's almost certainly something I'm doing parameter-wise that's wrong. Thanks for this post, again, it saved me a ton of headache.

I have the same problem on a EI Capton MacBookPro.
May we can fix it on master branch?

So, as far as I know, the issue is somehow in https://github.com/torch/trepl  .  I've logged it at https://github.com/torch/trepl/issues/32  I'm not sure how to go further with this.  I think it needs someone familiar with scripting, and who has a Mac box, to take a peek.

I commented there about the issue. Luarocks accepts a config var called wrap_bin_scripts that should be false for darwin/osx because it doesn't seem to add in the environment vars it's supposed to. The torch install instructions have you adding a line to .bash_profile anyway that, on my Mac in any case, specifies all the necessary environment settings.
Looks something like this: . $HOME/torch/install/bin/torch-activate
So as far as I can see, that sets whatever environment needs to be available for the torch REPL to work.

this solved it for me as well on el capitan thank you

Removing shebang did not solve it for me but adding torch-activate to the th script did work.
#!/bin/bash

source torch-activate

exec '...'

This might be fixed now, since RPATH is set now?


LUCENE-10035: Simple text codec add multi level skip list data

Description
Simple text codec add skip list data( include impact) to help understand index format，For debugging, curiosity, transparency only!! When term's docFreq greater than or equal to SimpleTextSkipWriter.BLOCK_SIZE (default value is 8), Simple text codec will write skip list, the .pst (simple text term dictionary file) file will looks like this
field title
  term args
    doc 2
      freq 2
      pos 7
      pos 10
    ## we omit docs for better view ......
    doc 98
      freq 2
      pos 2
      pos 6
    skipList
?
      level 1
        skipDoc 65
        skipDocFP 949
        impacts
          impact
            freq 1
            norm 2
          impact
            freq 2
            norm 12
          impact
            freq 3
            norm 13
        impacts_end
?
      level 0
        skipDoc 17
        skipDocFP 284
        impacts
          impact
            freq 1
            norm 2
          impact
            freq 2
            norm 12
        impacts_end
        skipDoc 34
        skipDocFP 624
        impacts
          impact
            freq 1
            norm 2
          impact
            freq 2
            norm 12
          impact
            freq 3
            norm 14
        impacts_end
        skipDoc 65
        skipDocFP 949
        impacts
          impact
            freq 1
            norm 2
          impact
            freq 2
            norm 12
          impact
            freq 3
            norm 13
        impacts_end
        skipDoc 90
        skipDocFP 1311
        impacts
          impact
            freq 1
            norm 2
          impact
            freq 2
            norm 10
          impact
            freq 3
            norm 13
          impact
            freq 4
            norm 14
        impacts_end
END
checksum<PHONE_NUMBER>0829315543

compare with previous，we add skipList，level, skipDoc, skipDocFP, impacts, impact, freq, norm nodes, at the same, simple text codec can support advanceShallow when search time.
why there has question mark symbol in the file ?
Because the MultiLevelSkipListWriter will write "length" and "childPointer" with VLong
This speed up search process ?
No!!! It can be advanceShallow when search, but why not speed up yet? Because the skip list data after docs(see the file described before), it must iterate all docs before read skip list data, so it never speed up search time. it has no "skipOffset" to direct read skip list data, but as mentioned before, it is For debugging, curiosity, transparency only!!  If this is a problem, may be the next time, i can add "skipOffset", so we can read skip list data directly.
Tests

I have run ./gradlew -p lucene/codecs/ test
I have test index and search process,  when there has skip list and has not skip list , include advanceShallow method

Tests result
`$ ./gradlew -p lucene/codecs/ test
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

Task :randomizationInfo
Running tests with randomization seed: tests.seed=54DDD8953C6E700

Task :errorProneSkipped
WARNING: errorprone disabled (skipped on non-nightly runs)

Task :lucene:codecs:test
:lucene:codecs:test (SUCCESS): 570 test(s), 43 skipped
The slowest tests (exceeding 500 ms) during this run:
6.64s TestSimpleTextTermVectorsFormat.testMergeWithIndexSort (:lucene:codecs)
6.10s TestSimpleTextTermVectorsFormat.testMergeWithoutIndexSort (:lucene:codecs)
2.88s TestSimpleTextCompoundFormat.testLargeCFS (:lucene:codecs)
2.72s TestSimpleTextTermVectorsFormat.testLotsOfFields (:lucene:codecs)
2.14s TestSimpleTextCompoundFormat.testManySubFiles (:lucene:codecs)
2.07s TestSimpleTextTermVectorsFormat.testMergeStability (:lucene:codecs)
1.46s TestVarGapFixedIntervalPostingsFormat.testDocsAndFreqsAndPositionsAndOffsetsAndPayloads (:lucene:codecs)
1.37s TestSimpleTextDocValuesFormat.testRandomAdvanceBinary (:lucene:codecs)
1.25s TestDirectPostingsFormat.testDocsAndFreqsAndPositionsAndOffsetsAndPayloads (:lucene:codecs)
1.19s TestBloomPostingsFormat.testDocsAndFreqsAndPositionsAndOffsetsAndPayloads (:lucene:codecs)
The slowest suites (exceeding 1s) during this run:
19.75s TestSimpleTextTermVectorsFormat (:lucene:codecs)
14.35s TestSimpleTextDocValuesFormat (:lucene:codecs)
8.83s TestSimpleTextCompoundFormat (:lucene:codecs)
8.41s TestBloomPostingsFormat (:lucene:codecs)
8.31s TestDirectPostingsFormat (:lucene:codecs)
7.85s TestVarGapFixedIntervalPostingsFormat (:lucene:codecs)
7.15s TestOrdsBlockTree (:lucene:codecs)
6.92s TestFixedGapPostingsFormat (:lucene:codecs)
6.69s TestVarGapDocFreqIntervalPostingsFormat (:lucene:codecs)
6.39s TestFSTPostingsFormat (:lucene:codecs)

BUILD SUCCESSFUL in 47s
15 actionable tasks: 5 executed, 10 up-to-date
`
Checklist
Please review the following and check all that apply:

[x] I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
[x] I have created a Jira issue and added the issue ID to my pull request title.
[x] I have given Lucene maintainers access to contribute to my PR branch. (optional but recommended)
[x] I have developed this patch against the main branch.
[x] I have run ./gradlew check.
[x] I have test my changes.

I have run ./gradlew -p lucene/codecs/ test

We have codec randomization in place that may use the SimpleText codec in any test. Can you confirm that tests pass if you run on the entire source folder?

this time i have run  ./gradlew -p lucene/codecs/ test on the entire source folder and successed

@wuda0112 FYI I'm currently away from computers so I most likely won't have the opportunity to merge this PR until 2 weeks from now. If someone else feels good about merging it before, please go ahead but otherwise I'll come back to it in two weeks.

@wuda0112 FYI I'm currently away from computers so I most likely won't have the opportunity to merge this PR until 2 weeks from now. If someone else feels good about merging it before, please go ahead but otherwise I'll come back to it in two weeks.

@jpountz  Thanks for your reply, no problem, you can take a look when you have time.

I reviewed the change more deeply today and found a few minor issues that I pushed fixes for, feel free to let me know if they don't work for you! One major issue that I found however is that binary content gets written to the file because of MultiLevelSkipListWriter#writeSkip which uses writeVLong. Can you look into writing data in a text format instead?

I reviewed the change more deeply today and found a few minor issues that I pushed fixes for, feel free to let me know if they don't work for you! One major issue that I found however is that binary content gets written to the file because of MultiLevelSkipListWriter#writeSkip which uses writeVLong. Can you look into writing data in a text format instead?

Ok, i will keep tracking, and if there has some issuse, i will tell you. I have thought about Write text content instead of binary content before, for some reason, i had given up, but if it is necessary, i will look into and try to  fix it !

I reviewed the change more deeply today and found a few minor issues that I pushed fixes for, feel free to let me know if they don't work for you! One major issue that I found however is that binary content gets written to the file because of MultiLevelSkipListWriter#writeSkip which uses writeVLong. Can you look into writing data in a text format instead?

MultiLevelSkipListWriter will write length uses writeVLong for every level, and will write childPointer for all blocks except the blocks in the lowest level uses writeVLong, can we define two methods to write these values, so that subclass can overwrite, but the default implement is writeVlong. And at the same time, MultiLevelSkipListReader also define two corresponding methods to read that values. is that ok?

Let's give this a try.

Let's give this a try.

I tried to define the methods, but i am not sure is it fit,  if this correct, i will create a new issuse, and if this is your concern issuse, could you please defind it, because you are more professional!
MultiLevelSkipListWriter
`/**

Writes the length of a level to the given output.

@param levelLength the length of a level
@param output the IndexOutput the length shall be written to
*/
protected void writeLevelLength(long levelLength,IndexOutput output) throws IOException{
output.writeVLong(levelLength);
}

/**

Writes the child pointer of a block to the given output.

@param childPointer block of higher level point to the lower level
@param skipBuffer the skip buffer to write to
*/
protected void writeChildPointer(long childPointer, DataOutput skipBuffer) throws IOException{
skipBuffer.writeVLong(childPointer);
}`

MultiLevelSkipListReader
`/**

read the length of the current level.

@param skipStream the IndexInput the length shall be read from
@return level length
*/
protected long readLevelLength(IndexInput skipStream) throws IOException {
return skipStream.readVLong();
}

/**

read the child pointer.

@param skipStream the IndexInput the child pointer shall be read from
@return child pointer
*/
protected long readChildPointer(IndexInput skipStream) throws IOException {
return skipStream.readVLong();
}`

So awesome that SimpleText is finally getting a skipping implementation!  Thank you @wuda0112!
Have you tried stressing out the new code by running all Lucene unit-tests with SimpleText?  Something like ./gradlew -Dtests.codec=SimpleText.

So awesome that SimpleText is finally getting a skipping implementation! Thank you @wuda0112!
Have you tried stressing out the new code by running all Lucene unit-tests with SimpleText? Something like ./gradlew -Dtests.codec=SimpleText.

@mikemccand  Thanks for your reply! I have execute ./gradlew check ./gradlew test ./gradlew -p lucene/core/ test ./gradlew -p lucene/codecs/ test, and all passed!
But when i execute ./gradlew test -Dtests.codec=SimpleText, there has one FAILED, the exception is:
org.apache.lucene.demo.TestDemo > testKnnVectorSearch FAILED
    java.lang.UnsupportedOperationException
        at __randomizedtesting.SeedInfo.seed([2DAF064A760C3554:7F0D5D18D85E7028]:0)
        at org.apache.lucene.codecs.simpletext.SimpleTextKnnVectorsReader.search(SimpleTextKnnVectorsReader.java:143)

when i look into SimpleTextKnnVectorsReader#search, it throw new UnsupportedOperationException

So awesome that SimpleText is finally getting a skipping implementation! Thank you @wuda0112!
Have you tried stressing out the new code by running all Lucene unit-tests with SimpleText? Something like ./gradlew -Dtests.codec=SimpleText.

@mikemccand Thanks for your reply! I have execute ./gradlew check ./gradlew test ./gradlew -p lucene/core/ test ./gradlew -p lucene/codecs/ test, and all passed!
But when i execute ./gradlew test -Dtests.codec=SimpleText, there has one FAILED, the exception is:
org.apache.lucene.demo.TestDemo > testKnnVectorSearch FAILED
    java.lang.UnsupportedOperationException
        at __randomizedtesting.SeedInfo.seed([2DAF064A760C3554:7F0D5D18D85E7028]:0)
        at org.apache.lucene.codecs.simpletext.SimpleTextKnnVectorsReader.search(SimpleTextKnnVectorsReader.java:143)

when i look into SimpleTextKnnVectorsReader#search, it throw new UnsupportedOperationException

Ahh it looks like SimpleText is missing its KNN implementation but looks like it's coming soon!  https://issues.apache.org/jira/browse/LUCENE-10063.  In the meantime that failing test should add an assume that the current codec is not SimpleText.

So awesome that SimpleText is finally getting a skipping implementation! Thank you @wuda0112!
Have you tried stressing out the new code by running all Lucene unit-tests with SimpleText? Something like ./gradlew -Dtests.codec=SimpleText.

@mikemccand Thanks for your reply! I have execute ./gradlew check ./gradlew test ./gradlew -p lucene/core/ test ./gradlew -p lucene/codecs/ test, and all passed!
But when i execute ./gradlew test -Dtests.codec=SimpleText, there has one FAILED, the exception is:
org.apache.lucene.demo.TestDemo > testKnnVectorSearch FAILED
    java.lang.UnsupportedOperationException
        at __randomizedtesting.SeedInfo.seed([2DAF064A760C3554:7F0D5D18D85E7028]:0)
        at org.apache.lucene.codecs.simpletext.SimpleTextKnnVectorsReader.search(SimpleTextKnnVectorsReader.java:143)

when i look into SimpleTextKnnVectorsReader#search, it throw new UnsupportedOperationException

Ahh it looks like SimpleText is missing its KNN implementation but looks like it's coming soon! https://issues.apache.org/jira/browse/LUCENE-10063. In the meantime that failing test should add an assume that the current codec is not SimpleText.

Ok, got it, thank you!

In the meantime that failing test should add an assume that the current codec is not SimpleText.

Or let's just merge https://github.com/apache/lucene/pull/262? :)

@jpountz Thank you, you helped me a lot,  and thanks for your patience to review !


Add precision conversion functions

This PR adds precision conversion support to the Ginkgo matrix formats
TODO:

[x] Implement array conversions
[x] Implement matrix conversions

The PR is now ready for review. There is one rather difficult issue: strategy_type in Csr and Hybrid cannot be converted, so I built a very annoying if-else monster for Csr and left the strategy type out completely for Hybrid, because the strategy_type implementations hide their parameters.

@yhmtsai float -> double is supposed to be deterministic, double -> float might depend on the rounding mode (which might depend on the issued instructions, flags set in the CPU, ...), i.e. rounding up, down, towards zero, nearest even/odd...
On the suggested tests, I need some clarification on how they extend what is already there

can you elaborate what you mean by corresponding float value for double -> float? And do you mean take double values that are not exactly representable as float (missing precision) or values that are not at all representable (outside value range)?

This seems to me like a subset of testing float -> double -> float for equality, since all of these double values are exactly representable as float

Maybe give a simple example with a single value?

@thoasm Thanks for your feedback! I would consider all of the move_to implementations something we should tackle in another PR, since as far as I can see, we currently don't really move anywhere (except for moves to the same type), and since our matrix classes have lots of assumptions/invariants about the stored data, we need to be very careful not to leave a matrix in an invalid state after a move (like a naive Coo -> Csr move would leave the row_idxs array unchanged, which gives inconsistent element numbers, a Csr -> * move must restore the row_ptrs or set the size to 0, ...)

@upsj I would like to see losing precision from these tests.
We can get the same result from float->float->float as float -> double -> float although I know it should be stored in double in the middle. These tests check whether float->double or double->float really changes the datatypes.
If double -> float is not deterministic, I think checking double->float(->double) with losing precision is enough.
use double as X=(0x4218888000889111), float Y=(0x50c44400) and the double Z=(0x4218888000000000)?
Y=float(X), Z=double(Y) in Matlab.
Matlab turns this double value to the float value.
I get the error 1.2961e-09 from abs(double(Y)-X)/X, which is similar with the matrix test you did.

Doing the float->double on Y and comparing with Z.
Doing the double->float->double on X and comparing with X.

I added tests for conversions via another executor (and also found a bug that way), rounding with precision loss and moved the component kernels to a namespace.
Thanks for your feedback, that was really helpful!

@yhmtsai The tests make sure that conversions between different executors work. This actually uncovered a bug in the Array conversion-assignment implementation.

@upsj ready to be merged!